Next: , Previous: Offset class, Up: Class reference

8.3.12 Property class

A node for changing style properties (like color) for its descendants. It stores a set of properties. There is no automatic change propagation after a change of the property values, so the programmer can change many properties and then call vcl_property_changed() to process all changes at once.

It supports the object interface, the node interface, the container interface and the enclosure interface.

     struct vcl_property * vcl_property_new (void)

Creates a property node with an empty set of properties.

     void vcl_property_set (struct vcl_property * obj, int prop_id,
                            void *prop_data)

Sets the property with ID prop_id to value prop_data.

     int vcl_property_get_count (struct vcl_property * obj)

Returns the size of the set of properties in obj.

     int vcl_property_get_nth_type (struct vcl_property * obj, int n)

Returns the ID of the n-th property.

     void * vcl_property_get_nth_value (struct vcl_property * obj, int n)

Returns the value of the n-th property.

     void * vcl_property_get (struct vcl_property * obj, int prop_id)

Returns the value of the property with ID prop_id.

     void vcl_property_changed (struct vcl_property * obj)

Causes the change propagation (and a drawing update).

Shortcuts to set common properties

          void vcl_property_set_fill_color (void  *prop, u32 color)

          void vcl_property_set_stroke_color (void  *prop, u32 color)

          void vcl_property_set_stroke_width (struct vcl_property * obj, double width)

          void vcl_property_set_stroke_cap_style (void  *prop, uns cap_style)

          void vcl_property_set_stroke_join_style (void  *prop, uns join_style)