I added new Elementary common APIs
Each widget can use the APIs when they need the swallowed objects. 
EAPI void elm_object_content_part_set(Evas_Object *obj, const char *item, 
Evas_Object *content);
EAPI Evas_Object *elm_object_content_part_get(const Evas_Object *obj, const 
char *item);
 EAPI Evas_Object *elm_object_content_part_unset(Evas_Object *obj, const char 
*item);
If you agree with them, 
then need to make widgets use them. ahhhhhhhhhhhh-
------------------------------------
Let's run together for the best moment!
 -Regards, Hermet-
 
-----Original Message-----
From: "Enlightenment SVN"<no-re...@enlightenment.org> 
To: enlightenment-...@lists.sourceforge.net
Cc: 
Sent: 11-07-27(수) 18:49:14
Subject: E SVN: hermet trunk/elementary/src/libLog:
elementary - added common APIs elm_object_content_set/get/unset 
 
 Now need to widgets use them. 
 
 
Author: hermet
Date: 2011-07-27 02:49:14 -0700 (Wed, 27 Jul 2011)
New Revision: 61802
Trac: http://trac.enlightenment.org/e/changeset/61802
Modified:
 trunk/elementary/src/lib/Elementary.h.in trunk/elementary/src/lib/elm_main.c 
trunk/elementary/src/lib/elm_widget.c trunk/elementary/src/lib/elm_widget.h 
Modified: trunk/elementary/src/lib/Elementary.h.in
===================================================================
--- trunk/elementary/src/lib/Elementary.h.in 2011-07-27 09:43:09 UTC (rev 61801)
+++ trunk/elementary/src/lib/Elementary.h.in 2011-07-27 09:49:14 UTC (rev 61802)
@@ -711,6 +711,51 @@
 #define elm_object_text_get(obj) elm_object_text_part_get((obj), NULL)
 
 /**
+ * Set a content of an object
+ *
+ * @param obj The Elementary object
+ * @param item The content id to set (NULL for the default content)
+ * @param content The new content of the object 
+ *
+ * @note Elementary objects may have many contents
+ *
+ * @ingroup General
+ */
+ EAPI void elm_object_content_part_set(Evas_Object *obj, const char *item, 
Evas_Object *content);
+
+#define elm_object_content_set(obj, content) 
elm_object_content_part_set((obj), NULL, (content))
+
+ /**
+ * Get a content of an object
+ *
+ * @param obj The Elementary object
+ * @param item The content id to get (NULL for the default content)
+ * @return content of the object or
+ * NULL for any error
+ *
+ * @note Elementary objects may have many contents
+ *
+ * @ingroup General
+ */
+ EAPI Evas_Object *elm_object_content_part_get(const Evas_Object *obj, const 
char *item);
+
+#define elm_object_content_get(obj) elm_object_content_part_get((obj), NULL)
+
+ /**
+ * Unset a content of an object
+ *
+ * @param obj The Elementary object
+ * @param item The content id to unset (NULL for the default content)
+ *
+ * @note Elementary objects may have many contents
+ *
+ * @ingroup General
+ */
+ EAPI Evas_Object *elm_object_content_part_unset(Evas_Object *obj, const char 
*item);
+
+#define elm_object_content_unset(obj) elm_object_content_part_unset((obj), 
NULL)
+
+ /**
 * @}
 */
 
Modified: trunk/elementary/src/lib/elm_main.c
===================================================================
--- trunk/elementary/src/lib/elm_main.c 2011-07-27 09:43:09 UTC (rev 61801)
+++ trunk/elementary/src/lib/elm_main.c 2011-07-27 09:49:14 UTC (rev 61802)
@@ -1214,6 +1214,27 @@
 return elm_widget_text_part_get(obj, item);
 }
 
+EAPI void
+elm_object_content_part_set(Evas_Object *obj, const char *item, Evas_Object 
*content)
+{
+ EINA_SAFETY_ON_NULL_RETURN(obj);
+ elm_widget_content_part_set(obj, item, content);
+}
+
+EAPI Evas_Object *
+elm_object_content_part_get(const Evas_Object *obj, const char *item)
+{
+ EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL);
+ return elm_widget_content_part_get(obj, item);
+}
+
+EAPI Evas_Object *
+elm_object_content_part_unset(Evas_Object *obj, const char *item)
+{
+ EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL);
+ return elm_widget_content_part_unset(obj, item);
+}
+
 /**
 * Get the global scaling factor
 *
Modified: trunk/elementary/src/lib/elm_widget.c
===================================================================
--- trunk/elementary/src/lib/elm_widget.c 2011-07-27 09:43:09 UTC (rev 61801)
+++ trunk/elementary/src/lib/elm_widget.c 2011-07-27 09:49:14 UTC (rev 61802)
@@ -75,6 +75,13 @@
 const char *text);
 const char *(*on_text_get_func)(const Evas_Object *obj,
 const char *item);
+ void (*on_content_set_func)(Evas_Object *obj,
+ const char *item,
+ Evas_Object *content);
+ Evas_Object *(*on_content_get_func)(const Evas_Object *obj,
+ const char *item);
+ Evas_Object *(*on_content_unset_func)(Evas_Object *obj,
+ const char *item);
 void *data;
 Evas_Coord rx, ry, rw, rh;
 int scroll_hold;
@@ -502,6 +509,33 @@
 }
 
 EAPI void
+elm_widget_content_set_hook_set(Evas_Object *obj,
+ void (*func)(Evas_Object *obj,
+ const char *item,
+ Evas_Object *content))
+{
+ API_ENTRY return;
+ sd->on_content_set_func = func;
+}
+
+EAPI void
+elm_widget_content_get_hook_set(Evas_Object *obj,
+ Evas_Object *(*func)(const Evas_Object *obj, const char *item))
+{
+ API_ENTRY return;
+ sd->on_content_get_func = func;
+}
+
+EAPI void
+elm_widget_content_unset_hook_set(Evas_Object *obj,
+ Evas_Object *(*func)(Evas_Object *obj,
+ const char *item))
+{
+ API_ENTRY return;
+ sd->on_content_unset_func = func;
+}
+
+EAPI void
 elm_widget_changed_hook_set(Evas_Object *obj,
 void (*func)(Evas_Object *obj))
 {
@@ -2042,6 +2076,33 @@
 return sd->on_text_get_func(obj, item);
 }
 
+EAPI void
+elm_widget_content_part_set(Evas_Object *obj, const char *item, Evas_Object 
*content)
+{
+ API_ENTRY return;
+
+ if (!sd->on_content_set_func) return;
+ sd->on_content_set_func(obj, item, content);
+}
+
+EAPI Evas_Object *
+elm_widget_content_part_get(const Evas_Object *obj, const char *item)
+{
+ API_ENTRY return NULL;
+
+ if (!sd->on_content_get_func) return NULL;
+ return sd->on_content_get_func(obj, item);
+}
+
+EAPI Evas_Object *
+elm_widget_content_part_unset(Evas_Object *obj, const char *item)
+{
+ API_ENTRY return NULL;
+
+ if (!sd->on_content_unset_func) return NULL;
+ return sd->on_content_unset_func(obj, item);
+}
+
 EAPI Elm_Theme *
 elm_widget_theme_get(const Evas_Object *obj)
 {
Modified: trunk/elementary/src/lib/elm_widget.h
===================================================================
--- trunk/elementary/src/lib/elm_widget.h 2011-07-27 09:43:09 UTC (rev 61801)
+++ trunk/elementary/src/lib/elm_widget.h 2011-07-27 09:49:14 UTC (rev 61802)
@@ -230,6 +230,9 @@
 EAPI void elm_widget_focus_region_hook_set(Evas_Object *obj, void (*func) 
(Evas_Object *obj, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h));
 EAPI void elm_widget_text_set_hook_set(Evas_Object *obj, void 
(*func)(Evas_Object *obj, const char *item, const char *text));
 EAPI void elm_widget_text_get_hook_set(Evas_Object *obj, const char 
*(*func)(const Evas_Object *obj, const char *item));
+EAPI void elm_widget_content_set_hook_set(Evas_Object *obj, void 
(*func)(Evas_Object *obj, const char *item, Evas_Object *content));
+EAPI void elm_widget_content_get_hook_set(Evas_Object *obj, Evas_Object 
*(*func)(const Evas_Object *obj, const char *item));
+EAPI void elm_widget_content_unset_hook_set(Evas_Object *obj, Evas_Object 
*(*func)(Evas_Object *obj, const char *item));
 EAPI void elm_widget_on_focus_region_hook_set(Evas_Object *obj, void (*func) 
(const Evas_Object *obj, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, 
Evas_Coord *h));
 EAPI void elm_widget_data_set(Evas_Object *obj, void *data);
 EAPI void *elm_widget_data_get(const Evas_Object *obj);
@@ -313,7 +316,9 @@
 EAPI void elm_widget_focus_disabled_handle(Evas_Object *obj);
 EAPI void elm_widget_text_part_set(Evas_Object *obj, const char *item, const 
char *label);
 EAPI const char *elm_widget_text_part_get(const Evas_Object *obj, const char 
*item);
-
+EAPI void elm_widget_content_part_set(Evas_Object *obj, const char *item, 
Evas_Object *content);
+EAPI Evas_Object *elm_widget_content_part_get(const Evas_Object *obj, const 
char *item);
+EAPI Evas_Object *elm_widget_content_part_unset(Evas_Object *obj, const char 
*item);
 EAPI Elm_Widget_Item *_elm_widget_item_new(Evas_Object *parent, size_t 
alloc_size);
 EAPI void _elm_widget_item_del(Elm_Widget_Item *item);
 EAPI void _elm_widget_item_pre_notify_del(Elm_Widget_Item *item);
------------------------------------------------------------------------------
Got Input? Slashdot Needs You.
Take our quick survey online. Come on, we don't ask for help often.
Plus, you'll get a chance to win $100 to spend on ThinkGeek.
http://p.sf.net/sfu/slashdot-survey
_______________________________________________
enlightenment-svn mailing list
enlightenment-...@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-svn
------------------------------------------------------------------------------
Got Input?   Slashdot Needs You.
Take our quick survey online.  Come on, we don't ask for help often.
Plus, you'll get a chance to win $100 to spend on ThinkGeek.
http://p.sf.net/sfu/slashdot-survey
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to