Enlightenment CVS committal
Author : davemds
Project : e17
Module : libs/etk
Dir : e17/libs/etk/src/lib
Modified Files:
etk_iconbox.c etk_iconbox.h
Log Message:
Add 2 functions to etk_iconbox:
Etk_Iconbox_Icon *etk_iconbox_icon_get_by_label(Etk_Iconbox *iconbox, const
char *label)
and
Etk_Iconbox_Icon *etk_iconbox_icon_get_by_data(Etk_Iconbox *iconbox, void *data)
You can use this function to get an icon from his label or his attached data.
===================================================================
RCS file: /cvs/e/e17/libs/etk/src/lib/etk_iconbox.c,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -3 -r1.34 -r1.35
--- etk_iconbox.c 23 Jun 2008 00:45:52 -0000 1.34
+++ etk_iconbox.c 24 Jun 2008 18:03:54 -0000 1.35
@@ -600,6 +600,48 @@
}
/**
+ * @brief Get the first icon with the given label. If more than one icon has
the
+ * same label only the first is returned.
+ * @param iconbox an iconbox
+ * @param label the label to search for
+ * @return Return the icon with the given label, or NULL if the string is not
found.
+ */
+Etk_Iconbox_Icon *etk_iconbox_icon_get_by_label(Etk_Iconbox *iconbox, const
char *label)
+{
+ Etk_Iconbox_Icon *icon;
+
+ if (!iconbox || !label)
+ return NULL;
+
+ for (icon = iconbox->first_icon; icon; icon = icon->next)
+ if (!strcmp(icon->label, label))
+ return icon;
+
+ return NULL;
+}
+
+/**
+ * @brief Get the first icon with the given data attached. If more than one
icon has the
+ * same data only the first is returned.
+ * @param iconbox an iconbox
+ * @param data the data to search for
+ * @return Return the icon with the given data attached, or NULL if the data
is not found.
+ */
+Etk_Iconbox_Icon *etk_iconbox_icon_get_by_data(Etk_Iconbox *iconbox, void
*data)
+{
+ Etk_Iconbox_Icon *icon;
+
+ if (!iconbox || !data)
+ return NULL;
+
+ for (icon = iconbox->first_icon; icon; icon = icon->next)
+ if (icon->data == data)
+ return icon;
+
+ return NULL;
+}
+
+/**
* @brief Sets the file path of the icon's image
* @param icon an icon
* @param filename the filename of the icon's image
===================================================================
RCS file: /cvs/e/e17/libs/etk/src/lib/etk_iconbox.h,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -3 -r1.14 -r1.15
--- etk_iconbox.h 28 Sep 2007 19:47:51 -0000 1.14
+++ etk_iconbox.h 24 Jun 2008 18:03:55 -0000 1.15
@@ -146,6 +146,8 @@
void etk_iconbox_icon_del(Etk_Iconbox_Icon *icon);
void etk_iconbox_clear(Etk_Iconbox *iconbox);
Etk_Iconbox_Icon *etk_iconbox_icon_get_at_xy(Etk_Iconbox *iconbox, int x, int
y, Etk_Bool over_cell, Etk_Bool over_icon, Etk_Bool over_label);
+Etk_Iconbox_Icon *etk_iconbox_icon_get_by_label(Etk_Iconbox *iconbox, const
char *label);
+Etk_Iconbox_Icon *etk_iconbox_icon_get_by_data(Etk_Iconbox *iconbox, void
*data);
void etk_iconbox_icon_file_set(Etk_Iconbox_Icon *icon, const
char *filename, const char *edje_group);
void etk_iconbox_icon_file_get(Etk_Iconbox_Icon *icon, const
char **filename, const char **edje_group);
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
enlightenment-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs