Synopsis

                    GOPattern;
enum                GOPatternType;
char const	*        go_pattern_as_str                   (GOPatternType pattern);
cairo_pattern_t *   go_pattern_create_cairo_pattern     (GOPattern const *pattern,
                                                         cairo_t *cr);
GOPatternType       go_pattern_from_str                 (char const *name);
guint8 const 	*     go_pattern_get_pattern              (GOPattern const *pat);
xmlChar *           go_pattern_get_svg_path             (GOPattern const *pattern,
                                                         double *width,
                                                         double *height);
gboolean            go_pattern_is_solid                 (GOPattern const *pat,
                                                         GOColor *color);
void                go_pattern_set_solid                (GOPattern *pat,
                                                         GOColor fore);

Description

Details

GOPattern

typedef struct {
	GOColor	 fore, back;
	unsigned pattern;
} GOPattern;

GOPattern::pattern is the used GOPatternType.

GOColor fore;

foreground color.

GOColor back;

background color.

enum GOPatternType

typedef enum {
	GO_PATTERN_SOLID,
	GO_PATTERN_GREY75,
	GO_PATTERN_GREY50,
	GO_PATTERN_GREY25,
	GO_PATTERN_GREY125,
	GO_PATTERN_GREY625,
	GO_PATTERN_HORIZ,
	GO_PATTERN_VERT,
	GO_PATTERN_REV_DIAG,
	GO_PATTERN_DIAG,
	GO_PATTERN_DIAG_CROSS,
	GO_PATTERN_THICK_DIAG_CROSS,
	GO_PATTERN_THIN_HORIZ,
	GO_PATTERN_THIN_VERT,
	GO_PATTERN_THIN_REV_DIAG,
	GO_PATTERN_THIN_DIAG,
	GO_PATTERN_THIN_HORIZ_CROSS,
	GO_PATTERN_THIN_DIAG_CROSS,
	GO_PATTERN_FOREGROUND_SOLID,
	GO_PATTERN_SMALL_CIRCLES,
	GO_PATTERN_SEMI_CIRCLES,
	GO_PATTERN_THATCH,
	GO_PATTERN_LARGE_CIRCLES,
	GO_PATTERN_BRICKS,
	GO_PATTERN_MAX
} GOPatternType;

GO_PATTERN_SOLID

solid using background color.

GO_PATTERN_GREY75

75% background color.

GO_PATTERN_GREY50

50% background color.

GO_PATTERN_GREY25

25% background color.

GO_PATTERN_GREY125

12.5% background color.

GO_PATTERN_GREY625

6.25% background color.

GO_PATTERN_HORIZ

horizontal stripe.

GO_PATTERN_VERT

vertical stripe.

GO_PATTERN_REV_DIAG

reverse diagonal stripe.

GO_PATTERN_DIAG

diagonal stripe.

GO_PATTERN_DIAG_CROSS

diagonal crosshatch.

GO_PATTERN_THICK_DIAG_CROSS

thick diagonal crosshatch.

GO_PATTERN_THIN_HORIZ

thin horizontal stripe.

GO_PATTERN_THIN_VERT

thin vertical stripe.

GO_PATTERN_THIN_REV_DIAG

thin reverse diagonal stripe.

GO_PATTERN_THIN_DIAG

thin diagonal stripe.

GO_PATTERN_THIN_HORIZ_CROSS

thin horizontal crosshatch.

GO_PATTERN_THIN_DIAG_CROSS

thin diagonal crosshatch.

GO_PATTERN_FOREGROUND_SOLID

solid using foreground color.

GO_PATTERN_SMALL_CIRCLES

small circles.

GO_PATTERN_SEMI_CIRCLES

semi circles.

GO_PATTERN_THATCH

thatch.

GO_PATTERN_LARGE_CIRCLES

large circles.

GO_PATTERN_BRICKS

bricks.

GO_PATTERN_MAX

maximum value, should not occur.

go_pattern_as_str ()

char const	*        go_pattern_as_str                   (GOPatternType pattern);


go_pattern_create_cairo_pattern ()

cairo_pattern_t *   go_pattern_create_cairo_pattern     (GOPattern const *pattern,
                                                         cairo_t *cr);

pattern :

a GOPattern

cr :

a cairo context

Returns :

a cairo pattern object corresponding to pattern parameters. The returned surface must be freed after use, using cairo_pattern_destroy.

go_pattern_from_str ()

GOPatternType       go_pattern_from_str                 (char const *name);


go_pattern_get_pattern ()

guint8 const 	*     go_pattern_get_pattern              (GOPattern const *pat);


go_pattern_get_svg_path ()

xmlChar *           go_pattern_get_svg_path             (GOPattern const *pattern,
                                                         double *width,
                                                         double *height);

Retrieves an SVG path as string, which represents pattern shape. Caller is responsible for freeing the resulting string.

If width != NULL, returns pattern width. If height != NULL, returns pattern height.

pattern :

a GOPattern

width :

pattern width

height :

pattern height

Returns :

a xmlChar buffer (free using xmlFree).

go_pattern_is_solid ()

gboolean            go_pattern_is_solid                 (GOPattern const *pat,
                                                         GOColor *color);

pat :

GOPattern

color :

GOColor

Returns :

if pat is solid, and stores the color in color. If pat is not solid color is not touched.

go_pattern_set_solid ()

void                go_pattern_set_solid                (GOPattern *pat,
                                                         GOColor fore);

Makes pat a solid pattern with colour fore.

pat :

a GOPattern

fore :

a GOColor