goocanvas.Style

goocanvas.Style — Support for cascading style properties for canvas items.

Synopsis

 goocanvas.Style extends, gobject.GObject {
  goocanvas.Style();
  copy();
  get_parent();
  get_style_property(property_id);
  set_fill_options(cr);
  set_parent(parent);
  set_stroke_options(cr);
  set_style_property(property_id,
                     value);

}

Ancestry

+-- gobject.GObject
        +-- goocanvas.Style

Description

goocanvas.Style provides support for cascading style properties for canvas items. It is intended to be used when implementing new canvas items.

Style properties are identified by a unique GQuark, and contain arbitrary data stored in a GValue.

goocanvas.Style also provides a few convenience functions such as set_stroke_options and set_fill_options which efficiently apply an item's standard style properties to the given cairo_t.

Constructor

goocanvas.Style();

Returns :

A new goocanvas.Style

Creates a new canvas Style object.

Methods

goocanvas.Style.copy

convert_from_item_scopypace();

Returns :

A copy of the given goocanvas.Style

Copies the given goocanvas.Style, by copying all of its properties. Though the parent of the new style is left unset.

goocanvas.Style.get_parent

get_parent();

Returns :

The parent of the given style, or None.

Gets the parent of the style.

goocanvas.Style.get_style_property

get_style_property(property_id);

property_id :

The property identifier.

Returns :

The property value, or None if it isn't set.

Gets the value of a property.

This searches though all the goocanvas.Style's own list of property settings and also all ancestor goocanvas.Style objects.

goocanvas.Style.set_fill_options

set_fill_options(cr);

cr :

A cairo context.

Returns :

True if a paint source is set, or False if the fill should be skipped.

Sets the standard cairo fill options using the given style.

goocanvas.Style.set_parent

set_parent(parent);

parent :

The new parent

Sets the parent of the style.

goocanvas.Style.set_stroke_options

set_stroke_options(cr);

cr :

A cairo context.

Returns :

True if a paint source is set, or False if the stroke should be skipped.

Sets the standard cairo stroke options using the given style.

goocanvas.Style.set_style_property

set_style_property(property_id,
                   value);

property_id :

the property identifier.

value :

the value of the property.

Sets a property in the style, replacing any current setting.

Note that this will override the property setting in ancestor goocanvas.Style objects.