GOPattern: GOffice Reference Manual

## GOPattern GOPattern |

## Functions

char const * | go_pattern_as_str ()
cairo_pattern_t * | go_pattern_create_cairo_pattern ()
GOPatternType | go_pattern_from_str ()
guint8 const * | go_pattern_get_pattern ()
xmlChar * | go_pattern_get_svg_path ()
gboolean | go_pattern_is_solid ()
void | go_pattern_set_solid ()

## Types and Values

| GOPattern
enum | GOPatternType

## Description

## Functions

### 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);

#### Parameters

pattern | a GOPattern |
cr | a cairo context |

#### Returns

a cairo pattern object corresponding to `pattern` parameters.

[transfer full]

### 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_pattern` is deprecated and should not be used in newly-written code.

### go_pattern_get_svg_path ()

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

`go_pattern_get_svg_path` is deprecated and should not be used in newly-written code.

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.

[skip]

#### Parameters

pattern | a GOPattern |
width | pattern width |
height | pattern height |

#### Returns

a xmlChar buffer (free using xmlFree).

[transfer full]

### go_pattern_is_solid ()

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

#### Parameters

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` .

#### Parameters

pat | a GOPattern |
fore | a GOColor |

## Types and Values

### GOPattern

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

#### Members

GOColor `fore`; | foreground color. |
GOColor `back`; | background color. |
unsigned int `pattern`; | A GOPatternType specifying what kind of pattern to use. |

### enum GOPatternType

#### Members

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. |