From c213824d5f16fa3019704276a28165e57331081d Mon Sep 17 00:00:00 2001 From: Christian Dywan Date: Sun, 25 Apr 2010 18:36:26 +0200 Subject: [PATCH] Expose items in a KatzeArray as GList --- katze/katze-array.c | 20 +++++++++++++++++++- katze/katze-array.h | 3 +++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/katze/katze-array.c b/katze/katze-array.c index dab35752..44b77501 100644 --- a/katze/katze-array.c +++ b/katze/katze-array.c @@ -1,5 +1,5 @@ /* - Copyright (C) 2008-2009 Christian Dywan + Copyright (C) 2008-2010 Christian Dywan 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 diff --git a/katze/katze-array.h b/katze/katze-array.h index 06953607..17d203d8 100644 --- a/katze/katze-array.h +++ b/katze/katze-array.h @@ -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); -- 2.39.5