From b73b77f43a7dcb9d6f28806bf2c3cba0fc6f7aa2 Mon Sep 17 00:00:00 2001 From: Nikias Bassen Date: Mon, 12 Jul 2010 14:02:57 +0200 Subject: Add support for new iconstate format and displaying folder icons --- src/sbitem.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/sbitem.c') diff --git a/src/sbitem.c b/src/sbitem.c index a53949e..b49a98f 100644 --- a/src/sbitem.c +++ b/src/sbitem.c @@ -63,11 +63,24 @@ SBItem *sbitem_new(plist_t icon_info) item = g_new0(SBItem, 1); item->node = plist_copy(icon_info); item->texture = NULL; + item->drawn = FALSE; item->is_dock_item = FALSE; + item->is_folder = FALSE; + item->subitems = NULL; return item; } +SBItem *sbitem_new_with_subitems(plist_t icon_info, GList *subitems) +{ + SBItem *item = sbitem_new(icon_info); + if (item) { + item->subitems = subitems; + item->is_folder = TRUE; + } + return item; +} + void sbitem_free(SBItem *item) { if (item) { @@ -85,6 +98,10 @@ void sbitem_free(SBItem *item) item->texture = NULL; } } + if (item->subitems) { + g_list_foreach(item->subitems, (GFunc)(g_func_sbitem_free), NULL); + g_list_free(item->subitems); + } if (item->label && CLUTTER_IS_ACTOR(item->label)) { clutter_actor_destroy(item->label); item->label = NULL; -- cgit v1.1-32-gdbae