Top |
Functions
gboolean | gog_theme_delete () |
GogTheme * | gog_theme_dup () |
GogTheme * | gog_theme_edit () |
void | gog_theme_foreach () |
void | gog_theme_fillin_style () |
GogAxisColorMap const * | gog_theme_get_color_map () |
char const * | gog_theme_get_description () |
char const * | gog_theme_get_id () |
char const * | gog_theme_get_name () |
GoResourceType | gog_theme_get_resource_type () |
GSList * | gog_theme_registry_get_theme_names () |
GogTheme * | gog_theme_registry_lookup () |
void | gog_theme_save_to_home_dir () |
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 root element needs to have an Id which should be unique. The uuid command provides such Ids.
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: node attributes: class, role. node 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 | ||
GogRegEqn | outline, fill, font, text_layout | ||
GogSeriesLabels | outline, fill, font, text_layout | ||
GogRegEqn | outline, fill, font, text_layout | ||
GogSeriesLabel | outline, fill, font, text_layout | ||
GogDataLabel | outline, fill, font, text_layout | ||
GogEquation | outline, 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 |
Functions
gog_theme_delete ()
gboolean
gog_theme_delete (GogTheme *theme
);
Destroys the theme and remove it from the user directory and from the database.
gog_theme_edit ()
GogTheme * gog_theme_edit (GogTheme *theme
,GOCmdContext *cc
);
Displays a dialog box to edit the theme. This can be done only for locally installed themes that are writeable.
gog_theme_foreach ()
void gog_theme_foreach (GFunc handler
,gpointer user_data
);
Executes handler
to each theme installed on the system, including built-in
themes.
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
.
gog_theme_get_color_map ()
GogAxisColorMap const * gog_theme_get_color_map (GogTheme const *theme
,gboolean discrete
);
Retrieves the themed color map. Each theme has a discrete color map and a continuous one.
Property Details
The “resource-type”
property
“resource-type” GoResourceType
The resource type for the theme.
Flags: Read / Write / Construct Only
Default value: GO_RESOURCE_INVALID