Expose items in a KatzeArray as GList

This commit is contained in:
Christian Dywan 2010-04-25 18:36:26 +02:00
parent 9d3c884194
commit c213824d5f
2 changed files with 22 additions and 1 deletions

View file

@ -1,5 +1,5 @@
/*
Copyright (C) 2008-2009 Christian Dywan <christian@twotoasts.de>
Copyright (C) 2008-2010 Christian Dywan <christian@twotoasts.de>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@ -461,6 +461,24 @@ katze_array_move_item (KatzeArray* array,
g_signal_emit (array, signals[MOVE_ITEM], 0, item, position);
}
/**
* katze_array_get_items:
* @array: a #KatzeArray
*
* Retrieves the items as a list.
*
* Return value: a newly allocated #GList of items
*
* Since: 0.2.5
**/
GList*
katze_array_get_items (KatzeArray* array)
{
g_return_val_if_fail (KATZE_IS_ARRAY (array), NULL);
return g_list_copy (array->items);
}
/**
* katze_array_clear:
* @array: a #KatzeArray

View file

@ -77,6 +77,9 @@ katze_array_move_item (KatzeArray* array,
gpointer item,
gint position);
GList*
katze_array_get_items (KatzeArray* array);
void
katze_array_clear (KatzeArray* array);