elementary/elm_object_item - modified for consistency (naming, macros)
authorChunEon Park <hermet@hermet.pe.kr>
Wed, 3 Aug 2011 11:55:24 +0000 (11:55 +0000)
committerChunEon Park <hermet@hermet.pe.kr>
Wed, 3 Aug 2011 11:55:24 +0000 (11:55 +0000)
SVN revision: 62050

src/lib/Elementary.h.in
src/lib/elm_main.c
src/lib/elm_widget.c
src/lib/elm_widget.h

index d15e928..4e19f65 100644 (file)
@@ -763,14 +763,14 @@ extern "C" {
     * Set a content of an object item
     *
     * @param it The Elementary object item
-    * @param item The content id to unset (NULL for the default content)
+    * @param part The content part name to unset (NULL for the default content)
     * @param content The new content of the object item
     *
     * @note Elementary object items may have many contents
     *
     * @ingroup General
     */
-   EAPI void elm_object_item_content_part_set(Elm_Object_Item *it, const char *item, Evas_Object *content);
+   EAPI void elm_object_item_content_part_set(Elm_Object_Item *it, const char *part, Evas_Object *content);
 
 #define elm_object_item_content_set(it, content) elm_object_item_content_part_set((it), NULL, (content))
 
@@ -778,7 +778,7 @@ extern "C" {
     * Get a content of an object item
     *
     * @param it The Elementary object item
-    * @param item The content id to unset (NULL for the default content)
+    * @param part The content part name to unset (NULL for the default content)
     * @return content of the object item or NULL for any error
     *
     * @note Elementary object items may have many contents
@@ -793,43 +793,43 @@ extern "C" {
     * Unset a content of an object item
     *
     * @param it The Elementary object item
-    * @param item The content id to unset (NULL for the default content)
+    * @param part The content part name to unset (NULL for the default content)
     *
     * @note Elementary object items may have many contents
     *
     * @ingroup General
     */
-   EAPI Evas_Object *elm_object_item_content_part_unset(Elm_Object_Item *it, const char *item);
+   EAPI Evas_Object *elm_object_item_content_part_unset(Elm_Object_Item *it, const char *part);
 
 #define elm_object_item_content_unset(it, content) elm_object_item_content_part_unset((it), (content))
 
    /**
     * Set a label of an objec itemt
     *
-    * @param obj The Elementary object item
-    * @param item The label id to set (NULL for the default label)
+    * @param it The Elementary object item
+    * @param part The text part name to set (NULL for the default label)
     * @param label The new text of the label
     *
     * @note Elementary object items may have many labels
     *
     * @ingroup General
     */
-   EAPI void elm_object_item_text_part_set(Elm_Object_Item *it, const char *item, const char *label);
+   EAPI void elm_object_item_text_part_set(Elm_Object_Item *it, const char *part, const char *label);
 
 #define elm_object_item_text_set(it, label) elm_object_item_text_part_set((it), NULL, (label))
 
    /**
     * Get a label of an object
     *
-    * @param obj The Elementary object item
-    * @param item The label id to get (NULL for the default label)
+    * @param it The Elementary object item
+    * @param part The text part name to get (NULL for the default label)
     * @return text of the label or NULL for any error
     *
     * @note Elementary object items may have many labels
     *
     * @ingroup General
     */
-   EAPI const char *elm_object_item_text_part_get(const Elm_Object_Item *it, const char *item);
+   EAPI const char *elm_object_item_text_part_get(const Elm_Object_Item *it, const char *part);
 
 #define elm_object_item_text_get(it) elm_object_item_part_text_get((it), NULL)
 
index 0586b12..f6a80d0 100644 (file)
@@ -3453,35 +3453,35 @@ elm_longpress_timeout_get(void)
 
 EAPI void
 elm_object_item_content_part_set(Elm_Object_Item *it,
-                                 const char *item,
+                                 const char *part,
                                  Evas_Object *content)
 {
-   elm_widget_item_content_part_set(it, item, content);
+   elm_widget_item_content_part_set(it, part, content);
 }
 
 EAPI Evas_Object *
 elm_object_item_content_part_get(const Elm_Object_Item *it,
-                                 const char *item)
+                                 const char *part)
 {
-   return elm_widget_item_content_part_get(it, item);
+   return elm_widget_item_content_part_get(it, part);
 }
 
 EAPI Evas_Object *
-elm_object_item_content_part_unset(Elm_Object_Item *it, const char *item)
+elm_object_item_content_part_unset(Elm_Object_Item *it, const char *part)
 {
-   return elm_widget_item_content_part_unset(it, item);
+   return elm_widget_item_content_part_unset(it, part);
 }
 
 EAPI void
 elm_object_item_text_part_set(Elm_Object_Item *it,
-                              const char *item,
+                              const char *part,
                               const char *label)
 {
-   elm_widget_item_text_part_set(it, item, label);
+   elm_widget_item_text_part_set(it, part, label);
 }
 
 EAPI const char *
-elm_object_item_text_part_get(const Elm_Object_Item *it, const char *item)
+elm_object_item_text_part_get(const Elm_Object_Item *it, const char *part)
 {
-   return elm_widget_item_text_part_get(it, item);
+   return elm_widget_item_text_part_get(it, part);
 }
index f40fcb1..10a46e9 100644 (file)
@@ -2922,50 +2922,50 @@ _smart_reconfigure(Smart_Data *sd)
 }
 
 EAPI void
-elm_widget_item_content_part_set(Elm_Widget_Item *it,
-                                 const char *item,
+_elm_widget_item_content_part_set(Elm_Widget_Item *item,
+                                 const char *part,
                                  Evas_Object *content)
 {
-   ELM_WIDGET_ITEM_CHECK_OR_RETURN(it);
-   if (!it->on_content_set_func) return;
-   it->on_content_set_func(it, item, content);
+   ELM_WIDGET_ITEM_CHECK_OR_RETURN(item);
+   if (!item->on_content_set_func) return;
+   item->on_content_set_func(item, part, content);
 }
 
 EAPI Evas_Object *
-elm_widget_item_content_part_get(const Elm_Widget_Item *it,
-                                 const char *item)
+_elm_widget_item_content_part_get(const Elm_Widget_Item *item,
+                                 const char *part)
 {
-   ELM_WIDGET_ITEM_CHECK_OR_RETURN(it, NULL);
-   if (!it->on_content_get_func) return NULL;
-   return it->on_content_get_func(it, item);
+   ELM_WIDGET_ITEM_CHECK_OR_RETURN(item, NULL);
+   if (!item->on_content_get_func) return NULL;
+   return item->on_content_get_func(item, part);
 }
 
 EAPI Evas_Object *
-elm_widget_item_content_part_unset(Elm_Widget_Item *it,
-                                   const char *item)
+_elm_widget_item_content_part_unset(Elm_Widget_Item *item,
+                                   const char *part)
 {
-   ELM_WIDGET_ITEM_CHECK_OR_RETURN(it, NULL);
-   if (!it->on_content_unset_func) return NULL;
-   return it->on_content_unset_func(it, item);
+   ELM_WIDGET_ITEM_CHECK_OR_RETURN(item, NULL);
+   if (!item->on_content_unset_func) return NULL;
+   return item->on_content_unset_func(item, part);
 }
 
 EAPI void
-elm_widget_item_text_part_set(Elm_Widget_Item *it,
-                              const char *item,
+_elm_widget_item_text_part_set(Elm_Widget_Item *item,
+                              const char *part,
                               const char *label)
 {
-   ELM_WIDGET_ITEM_CHECK_OR_RETURN(it);
-   if (!it->on_text_set_func) return;
-   it->on_text_set_func(it, item, label);
+   ELM_WIDGET_ITEM_CHECK_OR_RETURN(item);
+   if (!item->on_text_set_func) return;
+   item->on_text_set_func(item, part, label);
 }
 
 EAPI const char *
-elm_widget_item_text_part_get(const Elm_Widget_Item *it,
-                              const char *item)
+_elm_widget_item_text_part_get(const Elm_Widget_Item *item,
+                              const char *part)
 {
-   ELM_WIDGET_ITEM_CHECK_OR_RETURN(it, NULL);
-   if (!it->on_text_get_func) return NULL;
-   return it->on_text_get_func(it, item);
+   ELM_WIDGET_ITEM_CHECK_OR_RETURN(item, NULL);
+   if (!item->on_text_get_func) return NULL;
+   return item->on_text_get_func(item, part);
 }
 
 static void
index e26c52a..4f93929 100644 (file)
@@ -202,18 +202,18 @@ struct _Elm_Widget_Item
    Evas_Object   *view; /**< the base view object */
    const void    *data; /**< item specific data */
    Evas_Smart_Cb  del_cb; /**< used to notify the item is being deleted */
-   void         (*on_content_set_func)(Elm_Widget_Item *it,
-                                       const char *item,
+   void         (*on_content_set_func)(Elm_Widget_Item *item,
+                                       const char *part,
                                        Evas_Object *content);
-   Evas_Object *(*on_content_get_func)(const Elm_Widget_Item *it,
-                                       const char *item);
-   Evas_Object *(*on_content_unset_func)(Elm_Widget_Item *it,
-                                         const char *item);
-   void         (*on_text_set_func)(Elm_Widget_Item *it,
-                                    const char *item,
+   Evas_Object *(*on_content_get_func)(const Elm_Widget_Item *item,
+                                       const char *part);
+   Evas_Object *(*on_content_unset_func)(Elm_Widget_Item *item,
+                                         const char *part);
+   void         (*on_text_set_func)(Elm_Widget_Item *item,
+                                    const char *part,
                                     const char *label);
-   const char  *(*on_text_get_func)(const Elm_Widget_Item *it,
-                                    const char *item);
+   const char  *(*on_text_get_func)(const Elm_Widget_Item *item,
+                                    const char *part);
    /* widget variations should have data from here and on */
    /* @todo: TODO check if this is enough for 1.0 release, maybe add padding! */
 };
@@ -356,11 +356,11 @@ EAPI void             _elm_widget_item_cursor_style_set(Elm_Widget_Item *item, c
 EAPI const char      *_elm_widget_item_cursor_style_get(const Elm_Widget_Item *item);
 EAPI void             _elm_widget_item_cursor_engine_only_set(Elm_Widget_Item *item, Eina_Bool engine_only);
 EAPI Eina_Bool        _elm_widget_item_cursor_engine_only_get(const Elm_Widget_Item *item);
-EAPI void             elm_widget_item_content_part_set(Elm_Object_Item *it, const char *item, Evas_Object *content);
-EAPI Evas_Object     *elm_widget_item_content_part_get(const Elm_Object_Item *it, const char *item);
-EAPI Evas_Object     *elm_widget_item_content_part_unset(Elm_Object_Item *it, const char *item);
-EAPI void             elm_widget_item_text_part_set(Elm_Object_Item *it, const char *item, const char *label);
-EAPI const char      *elm_widget_item_text_part_get(const Elm_Object_Item *it, const char *item);
+EAPI void             _elm_widget_item_content_part_set(Elm_Object_Item *item, const char *part, Evas_Object *content);
+EAPI Evas_Object     *_elm_widget_item_content_part_get(const Elm_Object_Item *item, const char *part);
+EAPI Evas_Object     *_elm_widget_item_content_part_unset(Elm_Object_Item *item, const char *part);
+EAPI void             _elm_widget_item_text_part_set(Elm_Object_Item *item, const char *part, const char *label);
+EAPI const char      *_elm_widget_item_text_part_get(const Elm_Object_Item *item, const char *part);
 
 
 /* debug function. don't use it unless you are tracking parenting issues */
@@ -487,6 +487,37 @@ EAPI void             elm_widget_tree_dot_dump(const Evas_Object *top, FILE *out
  */
 #define elm_widget_item_cursor_engine_only_get(item) \
   _elm_widget_item_cursor_engine_only_get((const Elm_Widget_Item *)item)
+/**
+ * Convenience function to query item's content part set.
+ * @see _elm_widget_item_content_part_set()
+ */
+#define elm_widget_item_content_part_set(item, part, content) \
+  _elm_widget_item_content_part_set((Elm_Widget_Item *)item, part, content)
+/**
+ * Convenience function to query item's content part get.
+ * @see _elm_widget_item_content_part_get()
+ */
+#define elm_widget_item_content_part_get(item, part) \
+  _elm_widget_item_content_part_get((const Elm_Widget_Item *)item, part)
+/**
+ * Convenience function to query item's content part unset.
+ * @see _elm_widget_item_content_part_unset()
+ */
+#define elm_widget_item_content_part_unset(item, part) \
+  _elm_widget_item_content_part_unset((Elm_Widget_Item *)item, part)
+/**
+ * Convenience function to query item's text part set.
+ * @see _elm_widget_item_text_part_set()
+ */
+#define elm_widget_item_text_part_set(item, part, label) \
+  _elm_widget_item_text_part_set((Elm_Widget_Item *)item, part, label)
+/**
+ * Convenience function to query item's text part get.
+ * @see _elm_widget_item_text_part_get()
+ */
+#define elm_widget_item_text_part_get(item, part) \
+  _elm_widget_item_text_part_get((const Elm_Widget_Item *)item, part)
+
 
 /**
  * Cast and ensure the given pointer is an Elm_Widget_Item or return NULL.