![]() |
![]() |
![]() |
katze Reference Manual | ![]() |
---|---|---|---|---|
Top | Description |
#include <katze/katze.h> struct KatzeArray; struct KatzeArrayClass; KatzeArray * katze_array_new ();
GType typegboolean katze_array_is_a (KatzeArray *array
,);
GType is_a_typevoid katze_array_add_item (KatzeArray *array
,);
gpointer itemvoid katze_array_remove_item (KatzeArray *array
,);
gpointer itemgpointer katze_array_get_nth_item (KatzeArray *array
,);
guint ngboolean katze_array_is_empty (KatzeArray *array
);gint katze_array_get_item_index (KatzeArray *array
,);
gpointer itemgpointer katze_array_find_token (KatzeArray *array
,const
);gchar *tokengpointer katze_array_find_uri (KatzeArray *array
,const
);gchar *uriguint katze_array_get_length (KatzeArray *array
);void katze_array_move_item (KatzeArray *array
,,
gpointer item);
gint positionGList * katze_array_get_items (KatzeArray *array
);GList * katze_array_peek_items (KatzeArray *array
); extern GList* kalistglobal; #define KATZE_ARRAY_FOREACH_ITEM (kaitem, kaarray) #define KATZE_ARRAY_FOREACH_ITEM_L (kaitem, kaarray, kalist)void katze_array_clear (KatzeArray *array
);void katze_array_update (KatzeArray *array
);
struct KatzeArrayClass { KatzeItemClass parent_class; /* Signals */ void (*add_item) (KatzeArray* array, gpointer item); void (*remove_item) (KatzeArray* array, gpointer item); void (*move_item) (KatzeArray* array, gpointer item, gint index); void (*clear) (KatzeArray* array); void (*update) (KatzeArray* array); };
KatzeArray * katze_array_new (GType type
);
Creates a new KatzeArray for type
items.
The array will keep a reference on each object until it is removed from the array.
|
the expected item type |
Returns : |
a new KatzeArray. [transfer full] |
gboolean katze_array_is_a (KatzeArray *array
,);
GType is_a_type
Checks whether the array is compatible with items of the specified type.
|
a KatzeArray |
|
type to compare with |
Returns : |
TRUE array is compatible with is_a_type
|
void katze_array_add_item (KatzeArray *array
,);
gpointer item
Adds an item to the array.
If item
is a KatzeItem its parent is set accordingly.
|
a KatzeArray |
|
an item. [type GObject][transfer none] |
void katze_array_remove_item (KatzeArray *array
,);
gpointer item
Removes an item from the array.
If item
is a KatzeItem its parent is unset accordingly.
|
a KatzeArray |
|
an item. [type GObject] |
gpointer katze_array_get_nth_item (KatzeArray *array
,);
guint n
Retrieves the item in array
at the position n
.
|
a KatzeArray |
|
an index in the array |
Returns : |
an item, or NULL |
gboolean katze_array_is_empty (KatzeArray *array
);
Determines whether array
is empty.
|
a KatzeArray |
Returns : |
TRUE |
gint katze_array_get_item_index (KatzeArray *array
,);
gpointer item
Retrieves the index of the item in array
.
|
a KatzeArray |
|
an item in the array. [type GObject] |
Returns : |
the index of the item, or -1 if the item is not present in the array |
gpointer katze_array_find_token (KatzeArray *array
,const
);gchar *token
Looks up an item in the array which has the specified token.
This function will fail and return NULL if the KatzeArray's element type is not based on KatzeItem.
Note that token
is by definition unique to one item.
Since 0.4.4 token
can be a "token keywords" string.
|
a KatzeArray |
|
a token string, or "token keywords" string |
Returns : |
an item, or NULL |
gpointer katze_array_find_uri (KatzeArray *array
,const
);gchar *uri
Looks up an item in the array which has the specified URI.
This function will fail and return NULL if the KatzeArray's element type is not based on KatzeItem.
|
a KatzeArray |
|
an URI |
Returns : |
an item, or NULL |
Since 0.2.0
guint katze_array_get_length (KatzeArray *array
);
Retrieves the number of items in array
.
|
a KatzeArray |
Returns : |
the length of the KatzeArray |
void katze_array_move_item (KatzeArray *array
,,
gpointer item);
gint position
Moves item
to the position position
.
|
a KatzeArray |
|
the item being moved. [type GObject] |
|
the new position of the item |
Since 0.1.6
GList * katze_array_get_items (KatzeArray *array
);
Retrieves the items as a list.
|
a KatzeArray |
Returns : |
a newly allocated |
Since 0.2.5
GList * katze_array_peek_items (KatzeArray *array
);
Peeks at the KatzeArray's internal list of items.
|
a KatzeArray |
Returns : |
the KatzeArray's internal |
void katze_array_clear (KatzeArray *array
);
Deletes all items currently contained in array
.
|
a KatzeArray |
void katze_array_update (KatzeArray *array
);
Indicates that the array changed and any display widgets should be updated.
|
a KatzeArray |
Since 0.3.0