![]() |
![]() |
![]() |
DiaCanvas2 Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Prerequisites | Known Implementations | Signals |
DiaCanvasGroupable; void dia_canvas_groupable_add (DiaCanvasGroupable *group
,DiaCanvasItem *item
); void dia_canvas_groupable_remove (DiaCanvasGroupable *group
,DiaCanvasItem *item
); void dia_canvas_groupable_add_construction (DiaCanvasGroupable *group
,DiaCanvasItem *item
); void dia_canvas_groupable_remove_destruction (DiaCanvasGroupable *group
,DiaCanvasItem *item
); gboolean dia_canvas_groupable_get_iter (DiaCanvasGroupable *group
,DiaCanvasIter *iter
); gboolean dia_canvas_groupable_next (DiaCanvasGroupable *group
,DiaCanvasIter *iter
); DiaCanvasItem * dia_canvas_groupable_value (DiaCanvasGroupable *group
,DiaCanvasIter *iter
); gint dia_canvas_groupable_length (DiaCanvasGroupable *group
); gint dia_canvas_groupable_pos (DiaCanvasGroupable *group
,DiaCanvasItem *item
);
typedef struct _DiaCanvasGroupable DiaCanvasGroupable;
DiaCanvasItems supporting this interface can have child objects in them which will be displayed on the DiaCanvasView as a seperate object.
void dia_canvas_groupable_add (DiaCanvasGroupable *group
,DiaCanvasItem *item
);
Append an item to the groupable object. This is done by emiting the 'add'
signal. The group
should add the item (or not) and return TRUE
or FALSE
.
The group should not worry about any attributes that need to be set on the
item
, since this method takes care of that.
This function also creates a weak reference from the item to its parent and
from the item to the canvas. If one of them is destroyed, their reference
is set to NULL
automatically.
If you, in your callback function, could not add the item
, stop
signal emission with g_signal_stop_emission()
or
g_signal_stop_emission_by_name()
.
void dia_canvas_groupable_remove (DiaCanvasGroupable *group
,DiaCanvasItem *item
);
Remove item
from the groupable object. This is done by emiting the 'remove'
signal. If the signal returns with TRUE
, the item
-> group relationship
is removed. The group
should only care about removing it's reference to the
item
.
If you, in your callback function, could not remove the item
, stop
signal emission with g_signal_stop_emission()
or
g_signal_stop_emission_by_name()
.
void dia_canvas_groupable_add_construction (DiaCanvasGroupable *group
,DiaCanvasItem *item
);
void dia_canvas_groupable_remove_destruction (DiaCanvasGroupable *group
,DiaCanvasItem *item
);
gboolean dia_canvas_groupable_get_iter (DiaCanvasGroupable *group
,DiaCanvasIter *iter
);
Get an iterator for the groupable object. This works the same as the
text iterator and the tree iterator in GTK+. You can get the actual item by
calling dia_canvas_groupable_value()
. The iterator can be set to the next
item with dia_canvas_groupable_next()
.
|
iterator, must already exist in memory. |
Returns : |
FALSE if no iterator is set, TRUE otherwise. |
gboolean dia_canvas_groupable_next (DiaCanvasGroupable *group
,DiaCanvasIter *iter
);
Make the iterator point to the next item. If no more items are left
(FALSE is returned) the iterator is automatically destroyed.
If you quit iterating before the last item is requested, make sure you
call dia_canvas_iter_destroy()
.
Returns : |
TRUE if the iterator points to a valid object, FALSE otherwise. |
DiaCanvasItem * dia_canvas_groupable_value (DiaCanvasGroupable *group
,DiaCanvasIter *iter
);
Retrieve the value pointer to by the iterator.
Returns : |
The DiaCanvasItem pointed to by the iterator. |
gint dia_canvas_groupable_length (DiaCanvasGroupable *group
);
Get the amount of items the groupable object holds.
Returns : |
number of child items, -1 on error. |
gint dia_canvas_groupable_pos (DiaCanvasGroupable *group
,DiaCanvasItem *item
);
Get the position of item
in the group.
Returns : |
Position of item , -1 on error. |
"add"
signalvoid user_function (DiaCanvasGroupable *diacanvasgroupable,
GObject *arg1,
gpointer user_data) : Run First
|
the object which received the signal. |
|
user data set when the signal handler was connected. |
"remove"
signalvoid user_function (DiaCanvasGroupable *diacanvasgroupable,
GObject *arg1,
gpointer user_data) : Run First
|
the object which received the signal. |
|
user data set when the signal handler was connected. |