marco 1.29.1
Window manager
Loading...
Searching...
No Matches
testgradient.c File Reference
View source
#include "gradient.h"
#include <gtk/gtk.h>
Include dependency graph for testgradient.c:

Macros

#define CHECK_SIZE   10
 
#define SPACING   2
 
#define N_COLORS   5
 
#define N_COLORS   4
 

Typedefs

typedef void(* RenderGradientFunc) (cairo_t *cr, int width, int height)
 

Functions

static void draw_checkerboard (cairo_t *cr, int width, int height)
 
static void render_simple (cairo_t *cr, int width, int height, MetaGradientType type, gboolean with_alpha)
 
static void render_vertical_func (cairo_t *cr, int width, int height)
 
static void render_horizontal_func (cairo_t *cr, int width, int height)
 
static void render_diagonal_func (cairo_t *cr, int width, int height)
 
static void render_diagonal_alpha_func (cairo_t *cr, int width, int height)
 
static void render_multi (cairo_t *cr, int width, int height, MetaGradientType type)
 
static void render_vertical_multi_func (cairo_t *cr, int width, int height)
 
static void render_horizontal_multi_func (cairo_t *cr, int width, int height)
 
static void render_diagonal_multi_func (cairo_t *cr, int width, int height)
 
static void render_interwoven_func (cairo_t *cr, int width, int height)
 
static gboolean draw_callback (GtkWidget *widget, cairo_t *cr, gpointer data)
 
static GtkWidget * create_gradient_window (const char *title, RenderGradientFunc func)
 
static void meta_gradient_test (void)
 
int main (int argc, char **argv)
 

Macro Definition Documentation

◆ CHECK_SIZE

#define CHECK_SIZE   10

◆ N_COLORS [1/2]

#define N_COLORS   5

◆ N_COLORS [2/2]

#define N_COLORS   4

◆ SPACING

#define SPACING   2

Typedef Documentation

◆ RenderGradientFunc

typedef void(* RenderGradientFunc) (cairo_t *cr, int width, int height)

Function Documentation

◆ create_gradient_window()

static GtkWidget * create_gradient_window ( const char *  title,
RenderGradientFunc  func 
)
static

References draw_callback().

Referenced by meta_gradient_test().

Here is the call graph for this function:

◆ draw_callback()

static gboolean draw_callback ( GtkWidget *  widget,
cairo_t *  cr,
gpointer  data 
)
static

References FALSE.

Referenced by create_gradient_window().

◆ draw_checkerboard()

static void draw_checkerboard ( cairo_t *  cr,
int  width,
int  height 
)
static

References CHECK_SIZE, and SPACING.

Referenced by render_simple().

◆ main()

int main ( int  argc,
char **  argv 
)

References meta_gradient_test().

Here is the call graph for this function:

◆ meta_gradient_test()

static void meta_gradient_test ( void  )
static

References create_gradient_window(), render_diagonal_alpha_func(), render_diagonal_func(), render_diagonal_multi_func(), render_horizontal_func(), render_horizontal_multi_func(), render_interwoven_func(), render_vertical_func(), and render_vertical_multi_func().

Referenced by main().

Here is the call graph for this function:

◆ render_diagonal_alpha_func()

static void render_diagonal_alpha_func ( cairo_t *  cr,
int  width,
int  height 
)
static

References META_GRADIENT_DIAGONAL, render_simple(), and TRUE.

Referenced by meta_gradient_test().

Here is the call graph for this function:

◆ render_diagonal_func()

static void render_diagonal_func ( cairo_t *  cr,
int  width,
int  height 
)
static

References FALSE, META_GRADIENT_DIAGONAL, and render_simple().

Referenced by meta_gradient_test().

Here is the call graph for this function:

◆ render_diagonal_multi_func()

static void render_diagonal_multi_func ( cairo_t *  cr,
int  width,
int  height 
)
static

References META_GRADIENT_DIAGONAL, and render_multi().

Referenced by meta_gradient_test().

Here is the call graph for this function:

◆ render_horizontal_func()

static void render_horizontal_func ( cairo_t *  cr,
int  width,
int  height 
)
static

References FALSE, META_GRADIENT_HORIZONTAL, and render_simple().

Referenced by meta_gradient_test().

Here is the call graph for this function:

◆ render_horizontal_multi_func()

static void render_horizontal_multi_func ( cairo_t *  cr,
int  width,
int  height 
)
static

References META_GRADIENT_HORIZONTAL, and render_multi().

Referenced by meta_gradient_test().

Here is the call graph for this function:

◆ render_interwoven_func()

static void render_interwoven_func ( cairo_t *  cr,
int  width,
int  height 
)
static

References meta_gradient_create_interwoven(), and N_COLORS.

Referenced by meta_gradient_test().

Here is the call graph for this function:

◆ render_multi()

static void render_multi ( cairo_t *  cr,
int  width,
int  height,
MetaGradientType  type 
)
static

References meta_gradient_create_multi(), and N_COLORS.

Referenced by render_diagonal_multi_func(), render_horizontal_multi_func(), and render_vertical_multi_func().

Here is the call graph for this function:

◆ render_simple()

static void render_simple ( cairo_t *  cr,
int  width,
int  height,
MetaGradientType  type,
gboolean  with_alpha 
)
static

References draw_checkerboard(), FALSE, meta_gradient_add_alpha(), meta_gradient_create_simple(), and META_GRADIENT_HORIZONTAL.

Referenced by render_diagonal_alpha_func(), render_diagonal_func(), render_horizontal_func(), and render_vertical_func().

Here is the call graph for this function:

◆ render_vertical_func()

static void render_vertical_func ( cairo_t *  cr,
int  width,
int  height 
)
static

References FALSE, META_GRADIENT_VERTICAL, and render_simple().

Referenced by meta_gradient_test().

Here is the call graph for this function:

◆ render_vertical_multi_func()

static void render_vertical_multi_func ( cairo_t *  cr,
int  width,
int  height 
)
static

References META_GRADIENT_VERTICAL, and render_multi().

Referenced by meta_gradient_test().

Here is the call graph for this function: