Top |
GooCanvasStyle * | goo_canvas_style_new () |
GooCanvasStyle * | goo_canvas_style_copy () |
GooCanvasStyle * | goo_canvas_style_get_parent () |
void | goo_canvas_style_set_parent () |
GValue * | goo_canvas_style_get_property () |
void | goo_canvas_style_set_property () |
gboolean | goo_canvas_style_set_fill_options () |
gboolean | goo_canvas_style_set_stroke_options () |
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 |
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.
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.
GooCanvasStyle *
goo_canvas_style_get_parent (GooCanvasStyle *style
);
Gets the parent of the style.
void goo_canvas_style_set_parent (GooCanvasStyle *style
,GooCanvasStyle *parent
);
Sets the parent of the style.
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.
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.
gboolean goo_canvas_style_set_fill_options (GooCanvasStyle *style
,cairo_t *cr
);
Sets the standard cairo fill options using the given style.
gboolean goo_canvas_style_set_stroke_options (GooCanvasStyle *style
,cairo_t *cr
);
Sets the standard cairo stroke options using the given style.
struct GooCanvasStyle { GooCanvasStyle *parent; GArray *properties; };
GooCanvasStyle holds the style properties of a canvas item, as well as a pointer to the parent style.
GooCanvasStyle * |
the parent style. |
|
an array of GooCanvasStyleProperty property settings. |
struct GooCanvasStyleProperty { GQuark id; GValue value; };
GooCanvasStyleProperty represents a property setting.
extern GQuark goo_canvas_style_antialias_id;
Unique GQuark identifier used for the standard antialias property.
extern GQuark goo_canvas_style_fill_pattern_id;
Unique GQuark identifier used for the standard fill pattern property.
extern GQuark goo_canvas_style_fill_rule_id;
Unique GQuark identifier used for the standard fill rule property.
extern GQuark goo_canvas_style_font_desc_id;
Unique GQuark identifier used for the standard font description property.
extern GQuark goo_canvas_style_hint_metrics_id;
Unique GQuark identifier used for the standard hint metrics property.
extern GQuark goo_canvas_style_line_cap_id;
Unique GQuark identifier used for the standard line cap property.
extern GQuark goo_canvas_style_line_dash_id;
Unique GQuark identifier used for the standard line dash property.
extern GQuark goo_canvas_style_line_join_id;
Unique GQuark identifier used for the standard line join property.
extern GQuark goo_canvas_style_line_join_miter_limit_id;
Unique GQuark identifier used for the standard miter limit property.
extern GQuark goo_canvas_style_line_width_id;
Unique GQuark identifier used for the standard line width property.
extern GQuark goo_canvas_style_operator_id;
Unique GQuark identifier used for the standard operator property.