## GogTheme GogTheme — a list of default styles to apply to appropriate graph elements. |

## Synopsis

    #define             GOG_TYPE_THEME
    #define             GOG_THEME                           (o)
    #define             GOG_IS_THEME                        (o)
                        GogTheme;
    GType               gog_theme_get_type                  (void);
    char const *        gog_theme_get_name                  (GogTheme const *theme);
    char const *        gog_theme_get_local_name            (GogTheme const *theme);
    char const *        gog_theme_get_description           (GogTheme const *theme);
    void                gog_theme_fillin_style              (GogTheme const *theme,
                                                             GOStyle *style,
                                                             GogObject const *obj,
                                                             int ind,
                                                             GOStyleFlag relevant_fields);
    GogTheme *          gog_theme_registry_lookup           (char const *name);
    GSList *            gog_theme_registry_get_theme_names  (void);

## Object Hierarchy

      GObject
       +----GogTheme

## Description

The library provides two hard coded themes, "Default", and "Guppi". Other themes are described in files, some of which might be distributed with the library.

A file defining a theme is an xml file with a <GogTheme> root node. The contents must be: _name|name+, _description?|description*, GOStyle+.

_name and name nodes:

The _name node should be used for themes distributed with goffice, localized names will be in *.po files and only the default name for "C" locale needs to be there. Other files need at least one name node for the default name, and might have some translated names with an appropriate "xml:lang" attribute.

_description and description nodes:

These work just like name nodes. The difference is that no description node is mandatory. A theme can work perfectly without a description.

GOStyle nodes:

These nodes actually define the theme. Attributes and contents are: attributes: class, role. contents: (line|outline)?, fill?, marker?, font?, text_layout?

The attributes define the target for the style. You might have a class and a role attribute, or just one of them. If the role attribute is given, the class attribute, if given, represents the class of the parent object. A GOStyle node with no class or role will be used as default when another style is missing. If several such nodes exist, the last one will be used. If no default style exists, the "Default" theme is applied for missing nodes. The list of GOStyle nodes might be:

class | role | contents | comments
GogGraph |  | outline, fill
GogGraph | Title | outline, fill, font, text_layout | The graph title
GogChart |  | outline, fill
GogChart | Title | outline, fill, font, text_layout | The chart title
GogLegend |  | outline, fill, font
GogAxis |  | line, font, text_layout
GogAxisLine |  | line, font
GogGrid |  | outline, fill | GogGrid is actually the back plane
| MajorGrid | line, fill
| MinorGrid | line, fill
GogLabel |  | outline, fill, font, text_layout
GogSeries |  | line, fill, marker | One is needed for each entry in the palette
GogTrendLine |  | line, fill
GogReqEqn |  | line, fill, font, text_layout

The line and outline nodes are actually the same so using line in place of outline is not an issue. A color is specified either using the format RR:GG::BB:AA or a string as defined in rgb.txt, so black can be specified as "black" or "00:00:00:FF".

"line" or "outline" node:

attribute | value
| comments
dash | one of "none", "solid", "s-dot", "s-dash-dot", "s-dash-dot-dot", "dash-dot-dot-dot", "dot", "s-dash", "dash", "l-dash", "dash-dot", or "dash-dot-dot"
color | any color as described above
width | float | not always taken into account

"fill" node

contents: (pattern|gradient)?

attribute | value | comments
type | one of "none", "pattern", or "gradient"

"pattern" node

Should be included in the fill node if type is pattern.

attribute | value
type | one of "solid", "grey75", "grey50", "grey25", "grey12.5", "grey6.25", "horiz", "vert", "rev-diag", "diag", "diag-cross", "thick-diag-cross", "thin-horiz", "thin-vert", "thin-rev-diag", "thin-diag", "thin-horiz-cross", "thin-diag-cross", "foreground-solid", "small-circles","semi-circles", "thatch", "large-circles", or "bricks"
fore | any color as described above
back | any color as described above

"gradient" node

Should be included in the fill node if type is gradient.

attribute | value | comments
direction | one of "n-s", "s-n", "n-s-mirrored", "s-n-mirrored", "w-e", "e-w", "w-e-mirrored", "e-w-mirrored", "nw-se", "se-nw", "nw-se-mirrored", "se-nw-mirrored", "ne-sw", "sw-ne", "sw-ne-mirrored", or "ne-sw-mirrored" |
start_color | any color as described above |
brightness | float | meaningful only for monocolor gradients
end_color | any color as described above | meaningful only for bicolor gradients

"marker" node

attribute | value | comments
shape | one of "none", "square", "diamond", "triangle-down", "triangle-up", "triangle-right", "triangle-left", "circle", "x", "cross", "asterisk", "bar", "half-bar", "butterfly", "hourglass", or "lefthalf-bar" |
fill-color | any color as described above |
outline-color | any color as described above |
size | float | not always taken into account

"font" node

attribute | value
color | any color as described above
font | a string describing the font such as "Sans 10"

"text_layout" node

attribute | value | comments
angle | float | expressed in degrees

## Details

### GOG_TYPE_THEME

    #define GOG_TYPE_THEME (gog_theme_get_type ())

### GOG_THEME()

    #define GOG_THEME(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GOG_TYPE_THEME, GogTheme))

`o` : |

### GOG_IS_THEME()

    #define GOG_IS_THEME(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GOG_TYPE_THEME))

`o` : |

### GogTheme

    typedef struct _GogTheme GogTheme;

### gog_theme_get_type ()

    GType               gog_theme_get_type                  (void);

Returns : |

### gog_theme_get_name ()

    char const *        gog_theme_get_name                  (GogTheme const *theme);

`theme` : | a GogTheme
Returns : | the GogTheme name.

### gog_theme_get_local_name ()

    char const *        gog_theme_get_local_name            (GogTheme const *theme);

`theme` : | a GogTheme
Returns : | the localized GogTheme name.

### gog_theme_get_description ()

    char const *        gog_theme_get_description           (GogTheme const *theme);

`theme` : |
Returns : |

### gog_theme_fillin_style ()

    void                gog_theme_fillin_style              (GogTheme const *theme,
                                                             GOStyle *style,
                                                             GogObject const *obj,
                                                             int ind,
                                                             GOStyleFlag relevant_fields);

Fill in the auto aspects of `style` based on `theme` 's element for objects of type/role similar to `obj` with index `ind`. If `relevant_fields` is GO_STYLE_ALL, fillin the entire style, not just the auto portions included in `relevant_fields`.

`theme` : | GogTheme
`style` : | GOStyle to initialize
`obj` : | GogObject The object associated with `style`
`ind` : | an optional index
`relevant_fields` : | GOStyleFlag

### gog_theme_registry_lookup ()

    GogTheme *          gog_theme_registry_lookup           (char const *name);

`name` : | a theme name
Returns : | a GogTheme from theme registry.

### gog_theme_registry_get_theme_names ()

    GSList *            gog_theme_registry_get_theme_names  (void);

Returns : | a newly allocated theme name list from theme registry.