Top |
Functions
Types and Values
struct | GooCanvasStyle |
struct | GooCanvasStyleProperty |
extern GQuark | goo_canvas_style_antialias_id |
extern GQuark | goo_canvas_style_fill_pattern_id |
extern GQuark | goo_canvas_style_fill_rule_id |
extern GQuark | goo_canvas_style_font_desc_id |
extern GQuark | goo_canvas_style_hint_metrics_id |
extern GQuark | goo_canvas_style_line_cap_id |
extern GQuark | goo_canvas_style_line_dash_id |
extern GQuark | goo_canvas_style_line_join_id |
extern GQuark | goo_canvas_style_line_join_miter_limit_id |
extern GQuark | goo_canvas_style_line_width_id |
extern GQuark | goo_canvas_style_operator_id |
extern GQuark | goo_canvas_style_stroke_pattern_id |
Description
GooCanvasStyle provides support for cascading style properties for canvas items. It is intended to be used when implementing new canvas items.
The cascading styles canvas feature may be removed in a future version of GooCanvas.
Style properties are identified by a unique GQuark, and contain arbitrary data stored in a GValue.
GooCanvasStyle also provides a few convenience functions such as
goo_canvas_style_set_stroke_options()
and
goo_canvas_style_set_fill_options()
which efficiently apply an item's
standard style properties to the given cairo_t.
Functions
goo_canvas_style_copy ()
GooCanvasStyle *
goo_canvas_style_copy (GooCanvasStyle *style
);
Copies the given GooCanvasStyle, by copying all of its properties. Though the parent of the new style is left unset.
goo_canvas_style_get_parent ()
GooCanvasStyle *
goo_canvas_style_get_parent (GooCanvasStyle *style
);
Gets the parent of the style.
goo_canvas_style_set_parent ()
void goo_canvas_style_set_parent (GooCanvasStyle *style
,GooCanvasStyle *parent
);
Sets the parent of the style.
goo_canvas_style_get_property ()
GValue * goo_canvas_style_get_property (GooCanvasStyle *style
,GQuark property_id
);
Gets the value of a property.
This searches though all the GooCanvasStyle's own list of property settings and also all ancestor GooCanvasStyle objects.
Note that it returns a pointer to the internal GValue setting, which should not be changed.
goo_canvas_style_set_property ()
void goo_canvas_style_set_property (GooCanvasStyle *style
,GQuark property_id
,const GValue *value
);
Sets a property in the style, replacing any current setting.
Note that this will override the property setting in ancestor GooCanvasStyle objects.
goo_canvas_style_set_fill_options ()
gboolean goo_canvas_style_set_fill_options (GooCanvasStyle *style
,cairo_t *cr
);
Sets the standard cairo fill options using the given style.
goo_canvas_style_set_stroke_options ()
gboolean goo_canvas_style_set_stroke_options (GooCanvasStyle *style
,cairo_t *cr
);
Sets the standard cairo stroke options using the given style.
Types and Values
struct GooCanvasStyle
struct GooCanvasStyle { GooCanvasStyle *parent; GArray *properties; };
GooCanvasStyle holds the style properties of a canvas item, as well as a pointer to the parent style.
Members
GooCanvasStyle * |
the parent style. |
|
GArray * |
an array of GooCanvasStyleProperty property settings. |
struct GooCanvasStyleProperty
struct GooCanvasStyleProperty { GQuark id; GValue value; };
GooCanvasStyleProperty represents a property setting.
goo_canvas_style_antialias_id
extern GQuark goo_canvas_style_antialias_id;
Unique GQuark identifier used for the standard antialias property.
goo_canvas_style_fill_pattern_id
extern GQuark goo_canvas_style_fill_pattern_id;
Unique GQuark identifier used for the standard fill pattern property.
goo_canvas_style_fill_rule_id
extern GQuark goo_canvas_style_fill_rule_id;
Unique GQuark identifier used for the standard fill rule property.
goo_canvas_style_font_desc_id
extern GQuark goo_canvas_style_font_desc_id;
Unique GQuark identifier used for the standard font description property.
goo_canvas_style_hint_metrics_id
extern GQuark goo_canvas_style_hint_metrics_id;
Unique GQuark identifier used for the standard hint metrics property.
goo_canvas_style_line_cap_id
extern GQuark goo_canvas_style_line_cap_id;
Unique GQuark identifier used for the standard line cap property.
goo_canvas_style_line_dash_id
extern GQuark goo_canvas_style_line_dash_id;
Unique GQuark identifier used for the standard line dash property.
goo_canvas_style_line_join_id
extern GQuark goo_canvas_style_line_join_id;
Unique GQuark identifier used for the standard line join property.
goo_canvas_style_line_join_miter_limit_id
extern GQuark goo_canvas_style_line_join_miter_limit_id;
Unique GQuark identifier used for the standard miter limit property.
goo_canvas_style_line_width_id
extern GQuark goo_canvas_style_line_width_id;
Unique GQuark identifier used for the standard line width property.
goo_canvas_style_operator_id
extern GQuark goo_canvas_style_operator_id;
Unique GQuark identifier used for the standard operator property.
goo_canvas_style_stroke_pattern_id
extern GQuark goo_canvas_style_stroke_pattern_id;
Unique GQuark identifier used for the standard stroke pattern property.