awn-cairo-utils

awn-cairo-utils

Synopsis

enum                AwnCairoRoundCorners;
void                awn_cairo_rounded_rect              (cairo_t *cr,
                                                         double x0,
                                                         double y0,
                                                         double width,
                                                         double height,
                                                         double radius,
                                                         AwnCairoRoundCorners state);
void                awn_cairo_rounded_rect_shadow       (cairo_t *cr,
                                                         double rx0,
                                                         double ry0,
                                                         double width,
                                                         double height,
                                                         double radius,
                                                         AwnCairoRoundCorners state,
                                                         double shadow_radius,
                                                         double shadow_alpha);
void                awn_cairo_set_source_color          (cairo_t *cr,
                                                         DesktopAgnosticColor *color);
void                awn_cairo_set_source_color_with_alpha_multiplier
                                                        (cairo_t *cr,
                                                         DesktopAgnosticColor *color,
                                                         gdouble multiplier);
void                awn_cairo_set_source_color_with_multipliers
                                                        (cairo_t *cr,
                                                         DesktopAgnosticColor *color,
                                                         gdouble color_multiplier,
                                                         gdouble alpha_multiplier);
void                awn_cairo_pattern_add_color_stop_color
                                                        (cairo_pattern_t *pattern,
                                                         double offset,
                                                         DesktopAgnosticColor *color);
void                awn_cairo_pattern_add_color_stop_color_with_alpha_multiplier
                                                        (cairo_pattern_t *pattern,
                                                         double offset,
                                                         DesktopAgnosticColor *color,
                                                         gdouble multiplier);

Description

Details

enum AwnCairoRoundCorners

typedef enum
{
	ROUND_NONE		= 0,
	ROUND_TOP_LEFT		= 1 << 0,
	ROUND_TOP_RIGHT		= 1 << 1,
	ROUND_BOTTOM_RIGHT = 1 << 2,
	ROUND_BOTTOM_LEFT = 1 << 3,
	ROUND_TOP		= ROUND_TOP_LEFT | ROUND_TOP_RIGHT,
	ROUND_BOTTOM		= ROUND_BOTTOM_LEFT | ROUND_BOTTOM_RIGHT,
	ROUND_LEFT		= ROUND_TOP_LEFT | ROUND_BOTTOM_LEFT,
	ROUND_RIGHT		= ROUND_TOP_RIGHT | ROUND_BOTTOM_RIGHT,
	ROUND_ALL		= ROUND_LEFT | ROUND_RIGHT
} AwnCairoRoundCorners;


awn_cairo_rounded_rect ()

void                awn_cairo_rounded_rect              (cairo_t *cr,
                                                         double x0,
                                                         double y0,
                                                         double width,
                                                         double height,
                                                         double radius,
                                                         AwnCairoRoundCorners state);

Draws a rounded rectangle via cairo.

cr :

x0 :

y0 :

width :

height :

radius :

state :


awn_cairo_rounded_rect_shadow ()

void                awn_cairo_rounded_rect_shadow       (cairo_t *cr,
                                                         double rx0,
                                                         double ry0,
                                                         double width,
                                                         double height,
                                                         double radius,
                                                         AwnCairoRoundCorners state,
                                                         double shadow_radius,
                                                         double shadow_alpha);

Draws a shadow for rounded rectangle via cairo.

cr :

rx0 :

ry0 :

width :

height :

radius :

state :

shadow_radius :

shadow_alpha :


awn_cairo_set_source_color ()

void                awn_cairo_set_source_color          (cairo_t *cr,
                                                         DesktopAgnosticColor *color);

A convenience function which wraps cairo_set_source_rgba by using the values from the color parameter.

cr :

A cairo context.

color :

The source color.

awn_cairo_set_source_color_with_alpha_multiplier ()

void                awn_cairo_set_source_color_with_alpha_multiplier
                                                        (cairo_t *cr,
                                                         DesktopAgnosticColor *color,
                                                         gdouble multiplier);

Similar to awn_cairo_set_source_color, except for the multiplier parameter.

cr :

A cairo context.

color :

The source color.

multiplier :

The number (between 0 and 1.0 inclusive) that the alpha value is multiplied by.

awn_cairo_set_source_color_with_multipliers ()

void                awn_cairo_set_source_color_with_multipliers
                                                        (cairo_t *cr,
                                                         DesktopAgnosticColor *color,
                                                         gdouble color_multiplier,
                                                         gdouble alpha_multiplier);

Similar to awn_cairo_set_source_color_with_alpha_multiplier, except that there is an additional color_multiplier parameter.

cr :

A cairo context.

color :

The source color.

color_multiplier :

The number that the color values are multiplied by.

alpha_multiplier :

The number that the alpha value is multiplied by.

awn_cairo_pattern_add_color_stop_color ()

void                awn_cairo_pattern_add_color_stop_color
                                                        (cairo_pattern_t *pattern,
                                                         double offset,
                                                         DesktopAgnosticColor *color);

A convenience function which wraps cairo_pattern_add_color_stop_rgba by using the values from the color parameter.

pattern :

A cairo pattern.

offset :

An offset in the range [0.0 .. 1.0].

color :

The source color.

awn_cairo_pattern_add_color_stop_color_with_alpha_multiplier ()

void                awn_cairo_pattern_add_color_stop_color_with_alpha_multiplier
                                                        (cairo_pattern_t *pattern,
                                                         double offset,
                                                         DesktopAgnosticColor *color,
                                                         gdouble multiplier);

Similar to awn_cairo_pattern_add_color_stop_color, except for the multiplier parameter.

pattern :

A cairo pattern.

offset :

An offset in the range [0.0 .. 1.0].

color :

The source color.

multiplier :

The number (between 0 and 1.0 inclusive) that the alpha value is multiplied by.