GogStyle

## GogStyle GogStyle — Style of graph objects |

## Synopsis

                        GogStyle;
    enum                GogStyleFlag;
    enum                GogFillStyle;
    enum                GogImageType;
                        GogStyleLine;
                        GogStyleMark;
    GogStyle*           gog_style_new                       (void);
    GogStyle*           gog_style_dup                       (GogStyle const *style);
    void                gog_style_assign                    (GogStyle *dst,
                                                             GogStyle const *src);
    void                gog_style_apply_theme               (GogStyle *dst,
                                                             GogStyle const *src);
    void                gog_style_set_marker                (GogStyle *style,
                                                             GOMarker *marker);
    void                gog_style_set_font_desc             (GogStyle *style,
                                                             PangoFontDescription *desc);
    void                gog_style_set_font                  (GogStyle *style,
                                                             GOFont const *font);
    void                gog_style_set_fill_brightness       (GogStyle *style,
                                                             float brightness);
    void                gog_style_set_fill_image_filename   (GogStyle *style,
                                                             char *filename);
    void                gog_style_set_text_angle            (GogStyle *style,
                                                             double angle);
    gboolean            gog_style_is_different_size         (GogStyle const *a,
                                                             GogStyle const *b);
    gboolean            gog_style_is_marker_visible         (GogStyle const *style);
    gboolean            gog_style_is_line_visible           (GogStyle const *style);
    gboolean            gog_style_is_outline_visible        (GogStyle const *style);
    gboolean            gog_style_is_fill_visible           (GogStyle const *style);
    void                gog_style_force_auto                (GogStyle *style);
    gpointer            gog_style_get_editor                (GogStyle *style,
                                                             GogStyle *default_style,
                                                             GOCmdContext *cc,
                                                             GObject *object_with_style);
    void                gog_style_populate_editor           (GogStyle *style,
                                                             GogEditor *editor,
                                                             GogStyle *default_style,
                                                             GOCmdContext *cc,
                                                             GObject *object_with_style,
                                                             gboolean watch_for_external_change);
    cairo_pattern_t*    gog_style_create_cairo_pattern      (GogStyle const *style,
                                                             cairo_t *cr);
    GOMarkerconst *     gog_style_get_marker                (GogStyle *style);

## Object Hierarchy

      GObject
       +----GogStyle

## Implemented Interfaces

GogStyle implements GogPersist.

## Description

## Details

### GogStyle

    typedef struct _GogStyle GogStyle;

### enum GogStyleFlag

    typedef enum {
    	GOG_STYLE_OUTLINE	= 1 << 0,
    	GOG_STYLE_FILL		= 1 << 1,
    	GOG_STYLE_LINE		= 1 << 2,
    	GOG_STYLE_MARKER	= 1 << 3,
    	GOG_STYLE_FONT		= 1 << 4,
    	GOG_STYLE_TEXT_LAYOUT	= 1 << 5,
    	GOG_STYLE_INTERPOLATION	= 1 << 6,
    	GOG_STYLE_MARKER_NO_COLOR	= 1 << 7,
    	GOG_STYLE_ALL		= 0x1F
    } GogStyleFlag;

### enum GogFillStyle

    typedef enum {
    	GOG_FILL_STYLE_NONE	= 0,
    	GOG_FILL_STYLE_PATTERN	= 1,
    	GOG_FILL_STYLE_GRADIENT	= 2,
    	GOG_FILL_STYLE_IMAGE	= 3
    } GogFillStyle;

### enum GogImageType

    typedef enum {
    	GOG_IMAGE_STRETCHED,
    	GOG_IMAGE_WALLPAPER,
    	GOG_IMAGE_CENTERED
    } GogImageType;

### GogStyleLine

    typedef struct {
    	/* <0 == no outline,
    	 * =0 == hairline : unscaled, minimum useful (can be bigger than visible) size.
    	 * >0 in pts */
    	float	 	 width;
    	GOLineDashType 	 dash_type;
    	gboolean	 auto_dash;
    	GOColor	 	 color;
    	gboolean 	 auto_color;
    	unsigned	 pattern_unimplemented_yet; /* TODO: implement. Not used
    				and must not be used before implementation */
    } GogStyleLine;

### GogStyleMark

    typedef struct {
    	GOMarker *mark;
    	gboolean auto_shape;
    	gboolean auto_outline_color;
    	gboolean auto_fill_color;
    } GogStyleMark;

### gog_style_new ()

    GogStyle*           gog_style_new                       (void);

Returns : |

### gog_style_dup ()

    GogStyle*           gog_style_dup                       (GogStyle const *style);

Duplicates `style`.

`style` : | a source GogStyle
Returns : | a new GogStyle

### gog_style_assign ()

    void                gog_style_assign                    (GogStyle *dst,
                                                             GogStyle const *src);

`dst` : |
`src` : |

### gog_style_apply_theme ()

    void                gog_style_apply_theme               (GogStyle *dst,
                                                             GogStyle const *src);

Merge the attributes from `src` onto the elements of `dst` that were not user assigned (is_auto)

`dst` : | GogStyle
`src` : | GogStyle

### gog_style_set_marker ()

    void                gog_style_set_marker                (GogStyle *style,
                                                             GOMarker *marker);

Absorb a reference to `marker` and assign it to `style`.

`style` : | GogStyle
`marker` : | GOMarker

### gog_style_set_font_desc ()

    void                gog_style_set_font_desc             (GogStyle *style,
                                                             PangoFontDescription *desc);

`style` : |
`desc` : |

### gog_style_set_font ()

    void                gog_style_set_font                  (GogStyle *style,
                                                             GOFont const *font);

`style` : |
`font` : |

### gog_style_set_fill_brightness ()

    void                gog_style_set_fill_brightness       (GogStyle *style,
                                                             float brightness);

`style` : |
`brightness` : |

### gog_style_set_fill_image_filename ()

    void                gog_style_set_fill_image_filename   (GogStyle *style,
                                                             char *filename);

absorb the string and eventually free it.

`style` : | GogStyle
`filename` : |

### gog_style_set_text_angle ()

    void                gog_style_set_text_angle            (GogStyle *style,
                                                             double angle);

Set text rotation angle in degrees. Valid values are in the range [-180.0° , 180.0°].

`style` : | GogStyle
`angle` : | text rotation in degrees

### gog_style_is_different_size ()

    gboolean            gog_style_is_different_size         (GogStyle const *a,
                                                             GogStyle const *b);

`a` : |
`b` : |
Returns : |

### gog_style_is_marker_visible ()

    gboolean            gog_style_is_marker_visible         (GogStyle const *style);

`style` : |
Returns : |

### gog_style_is_line_visible ()

    gboolean            gog_style_is_line_visible           (GogStyle const *style);

`style` : |
Returns : |

### gog_style_is_outline_visible ()

    gboolean            gog_style_is_outline_visible        (GogStyle const *style);

`style` : |
Returns : |

### gog_style_is_fill_visible ()

    gboolean            gog_style_is_fill_visible           (GogStyle const *style);

`style` : |
Returns : |

### gog_style_force_auto ()

    void                gog_style_force_auto                (GogStyle *style);

`style` : |

### gog_style_get_editor ()

    gpointer            gog_style_get_editor                (GogStyle *style,
                                                             GogStyle *default_style,
                                                             GOCmdContext *cc,
                                                             GObject *object_with_style);

`style` : |
`default_style` : |
`cc` : |
`object_with_style` : |
Returns : |

### gog_style_populate_editor ()

    void                gog_style_populate_editor           (GogStyle *style,
                                                             GogEditor *editor,
                                                             GogStyle *default_style,
                                                             GOCmdContext *cc,
                                                             GObject *object_with_style,
                                                             gboolean watch_for_external_change);

`style` : |
`editor` : |
`default_style` : |
`cc` : |
`object_with_style` : |
`watch_for_external_change` : |

### gog_style_create_cairo_pattern ()

    cairo_pattern_t*    gog_style_create_cairo_pattern      (GogStyle const *style,
                                                             cairo_t *cr);

Create a cairo_patern_t using the current style settings for filling. A pattern will be created only if the style has the corresponding field and if it is not set to a none constant.

`style` : | GogStyle
`cr` : | a cairo context
Returns : | the pattern or NULL if it could not be created.

### gog_style_get_marker ()

    GOMarkerconst *     gog_style_get_marker                (GogStyle *style);

Accessor for `style`::marker, without referencing it.

`style` : | GogStyle
Returns : | the style GOMarker.