Sync ctxpopup API with upstream
authorMike McCormack <mj.mccormack@samsung.com>
Mon, 7 Nov 2011 03:25:14 +0000 (12:25 +0900)
committerMike McCormack <mj.mccormack@samsung.com>
Mon, 7 Nov 2011 06:00:24 +0000 (15:00 +0900)
src/lib/Elementary.h.in
src/lib/elc_ctxpopup.c
src/lib/elm_controlbar.c

index 0492ff8..b084f89 100644 (file)
@@ -26175,8 +26175,6 @@ extern "C" {
     * @}
     */
 
-   typedef struct _Elm_Ctxpopup_Item Elm_Ctxpopup_Item;
-
    /**
     * @defgroup Ctxpopup Ctxpopup
     *
@@ -26216,6 +26214,7 @@ extern "C" {
                                         area */
         ELM_CTXPOPUP_DIRECTION_UNKNOWN, /**< ctxpopup does not determine it's direction yet*/
      } Elm_Ctxpopup_Direction;
+#define Elm_Ctxpopup_Item Elm_Object_Item
 
    /**
     * @brief Add a new Ctxpopup object to the parent.
@@ -26284,7 +26283,7 @@ extern "C" {
     *
     * @see elm_ctxpopup_content_set()
     */
-   Elm_Ctxpopup_Item *elm_ctxpopup_item_append(Evas_Object *obj, const char *label, Evas_Object *icon, Evas_Smart_Cb func, const void *data) EINA_ARG_NONNULL(1);
+   Elm_Object_Item *elm_ctxpopup_item_append(Evas_Object *obj, const char *label, Evas_Object *icon, Evas_Smart_Cb func, const void *data) EINA_ARG_NONNULL(1);
    /**
     * @brief Delete the given item in a ctxpopup object.
     *
@@ -26292,7 +26291,7 @@ extern "C" {
     *
     * @see elm_ctxpopup_item_append()
     */
-   EAPI void          elm_ctxpopup_item_del(Elm_Ctxpopup_Item *item) EINA_ARG_NONNULL(1);
+   EAPI void          elm_ctxpopup_item_del(Elm_Object_Item *it) EINA_ARG_NONNULL(1);
    /**
     * @brief Set the ctxpopup item's state as disabled or enabled.
     *
@@ -26301,7 +26300,7 @@ extern "C" {
     *
     * When disabled the item is greyed out to indicate it's state.
     */
-   EAPI void          elm_ctxpopup_item_disabled_set(Elm_Ctxpopup_Item *item, Eina_Bool disabled) EINA_ARG_NONNULL(1);
+   EAPI void          elm_ctxpopup_item_disabled_set(Elm_Object_Item *it, Eina_Bool disabled) EINA_ARG_NONNULL(1);
    /**
     * @brief Get the ctxpopup item's disabled/enabled state.
     *
@@ -26310,7 +26309,7 @@ extern "C" {
     *
     * @see elm_ctxpopup_item_disabled_set()
     */
-   EAPI Eina_Bool     elm_ctxpopup_item_disabled_get(const Elm_Ctxpopup_Item *item) EINA_ARG_NONNULL(1);
+   EAPI Eina_Bool     elm_ctxpopup_item_disabled_get(const Elm_Object_Item *it) EINA_ARG_NONNULL(1);
    /**
     * @brief Get the icon object for the given ctxpopup item.
     *
@@ -26321,7 +26320,7 @@ extern "C" {
     * @see elm_ctxpopup_item_append()
     * @see elm_ctxpopup_item_icon_set()
     */
-   EAPI Evas_Object  *elm_ctxpopup_item_icon_get(const Elm_Ctxpopup_Item *item) EINA_ARG_NONNULL(1);
+   EAPI Evas_Object  *elm_ctxpopup_item_icon_get(const Elm_Object_Item *it) EINA_ARG_NONNULL(1);
    /**
     * @brief Sets the side icon associated with the ctxpopup item
     *
@@ -26334,7 +26333,7 @@ extern "C" {
     *
     * @see elm_ctxpopup_item_append()
     */
-   EAPI void          elm_ctxpopup_item_icon_set(Elm_Ctxpopup_Item *item, Evas_Object *icon) EINA_ARG_NONNULL(1);
+   EAPI void          elm_ctxpopup_item_icon_set(Elm_Object_Item *it, Evas_Object *icon) EINA_ARG_NONNULL(1);
    /**
     * @brief Get the label for the given ctxpopup item.
     *
@@ -26345,14 +26344,14 @@ extern "C" {
     * @see elm_ctxpopup_item_append()
     * @see elm_ctxpopup_item_label_set()
     */
-   EAPI const char   *elm_ctxpopup_item_label_get(const Elm_Ctxpopup_Item *item) EINA_ARG_NONNULL(1);
+   EAPI const char   *elm_ctxpopup_item_label_get(const Elm_Object_Item *it) EINA_ARG_NONNULL(1);
    /**
     * @brief (Re)set the label on the given ctxpopup item.
     *
     * @param it Ctxpopup item
     * @param label String to set as label
     */
-   EAPI void          elm_ctxpopup_item_label_set(Elm_Ctxpopup_Item *item, const char *label) EINA_ARG_NONNULL(1);
+   EAPI void          elm_ctxpopup_item_label_set(Elm_Object_Item *it, const char *label) EINA_ARG_NONNULL(1);
    /**
     * @brief Set an elm widget as the content of the ctxpopup.
     *
index 91deec2..b8a2f55 100644 (file)
@@ -1,23 +1,10 @@
 #include <Elementary.h>
 #include "elm_priv.h"
 
-/**
- * @defgroup Ctxpopup
- *
- * A ctxpopup is a widget that, when shown, pops up a list of items.
- * It automatically chooses an area inside its parent object's view
- * (set via elm_ctxpopup_add() and elm_ctxpopup_hover_parent_set()) to
- * optimally fit into it. In the default theme, it will also point an
- * arrow to the cursor position at the time one shows it. Ctxpopup
- * items have a label and/or an icon. It is intended for a small
- * number of items (hence the use of list, not genlist).
- *
- * Signals that you can add callbacks for are:
- *
- * "dismissed" - the ctxpopup was dismissed
- */
+#undef Elm_Ctxpopup_Item
 
 typedef struct _Widget_Data Widget_Data;
+typedef struct _Elm_Ctxpopup_Item Elm_Ctxpopup_Item;
 
 struct _Elm_Ctxpopup_Item
 {
@@ -1134,9 +1121,10 @@ elm_ctxpopup_add(Evas_Object *parent)
  * @ingroup Ctxpopup
  */
 EAPI Evas_Object *
-elm_ctxpopup_item_icon_get(const Elm_Ctxpopup_Item *item)
+elm_ctxpopup_item_icon_get(const Elm_Object_Item *it)
 {
-   ELM_CTXPOPUP_ITEM_CHECK_RETURN(item, NULL);
+   ELM_OBJ_ITEM_CHECK_OR_RETURN(it, NULL);
+   Elm_Ctxpopup_Item *item = (Elm_Ctxpopup_Item *) it;
    return item->icon;
 }
 
@@ -1154,11 +1142,12 @@ elm_ctxpopup_item_icon_get(const Elm_Ctxpopup_Item *item)
  * @ingroup Ctxpopup
  */
 EAPI void
-elm_ctxpopup_item_icon_set(Elm_Ctxpopup_Item *item, Evas_Object *icon)
+elm_ctxpopup_item_icon_set(Elm_Object_Item *it, Evas_Object *icon)
 {
-   ELM_CTXPOPUP_ITEM_CHECK_RETURN(item);
+   ELM_OBJ_ITEM_CHECK_OR_RETURN(it);
 
    Widget_Data *wd;
+   Elm_Ctxpopup_Item *item = (Elm_Ctxpopup_Item *) it;
 
    wd = elm_widget_data_get(item->base.widget);
    if (!wd) return;
@@ -1182,9 +1171,10 @@ elm_ctxpopup_item_icon_set(Elm_Ctxpopup_Item *item, Evas_Object *icon)
  *
  */
 EAPI const char *
-elm_ctxpopup_item_label_get(const Elm_Ctxpopup_Item *item)
+elm_ctxpopup_item_label_get(const Elm_Object_Item *it)
 {
-   ELM_CTXPOPUP_ITEM_CHECK_RETURN(item, NULL);
+   ELM_OBJ_ITEM_CHECK_OR_RETURN(it, NULL);
+   Elm_Ctxpopup_Item *item = (Elm_Ctxpopup_Item *) it;
    return item->label;
 }
 
@@ -1197,11 +1187,12 @@ elm_ctxpopup_item_label_get(const Elm_Ctxpopup_Item *item)
  * @ingroup Ctxpopup
  */
 EAPI void
-elm_ctxpopup_item_label_set(Elm_Ctxpopup_Item *item, const char *label)
+elm_ctxpopup_item_label_set(Elm_Object_Item *it, const char *label)
 {
-   ELM_CTXPOPUP_ITEM_CHECK_RETURN(item);
+   ELM_OBJ_ITEM_CHECK_OR_RETURN(it);
 
    Widget_Data *wd;
+   Elm_Ctxpopup_Item *item = (Elm_Ctxpopup_Item *) it;
 
    wd = elm_widget_data_get(item->base.widget);
    if (!wd) return;
@@ -1387,7 +1378,7 @@ elm_ctxpopup_horizontal_get(const Evas_Object *obj)
  *
  * @ingroup Ctxpopup
  */
-EAPI Elm_Ctxpopup_Item *
+EAPI Elm_Object_Item *
 elm_ctxpopup_item_append(Evas_Object *obj, const char *label,
                          Evas_Object *icon, Evas_Smart_Cb func,
                          const void *data)
@@ -1431,7 +1422,7 @@ elm_ctxpopup_item_append(Evas_Object *obj, const char *label,
         _sizing_eval(obj);
      }
 
-   return item;
+   return (Elm_Object_Item*) item;
 }
 
 /**
@@ -1442,11 +1433,12 @@ elm_ctxpopup_item_append(Evas_Object *obj, const char *label,
  * @ingroup Ctxpopup
  */
 EAPI void
-elm_ctxpopup_item_del(Elm_Ctxpopup_Item *item)
+elm_ctxpopup_item_del(Elm_Object_Item *it)
 {
-   ELM_CTXPOPUP_ITEM_CHECK_RETURN(item);
+   ELM_OBJ_ITEM_CHECK_OR_RETURN(it);
 
    Widget_Data *wd;
+   Elm_Ctxpopup_Item *item = (Elm_Ctxpopup_Item *) it;
 
    wd = elm_widget_data_get(item->base.widget);
    if (!wd) return;
@@ -1478,11 +1470,12 @@ elm_ctxpopup_item_del(Elm_Ctxpopup_Item *item)
  * @ingroup Ctxpopup
  */
 EAPI void
-elm_ctxpopup_item_disabled_set(Elm_Ctxpopup_Item *item, Eina_Bool disabled)
+elm_ctxpopup_item_disabled_set(Elm_Object_Item *it, Eina_Bool disabled)
 {
-   ELM_CTXPOPUP_ITEM_CHECK_RETURN(item);
+   ELM_OBJ_ITEM_CHECK_OR_RETURN(it);
 
    Widget_Data *wd;
+   Elm_Ctxpopup_Item *item = (Elm_Ctxpopup_Item *) it;
 
    wd = elm_widget_data_get(item->base.widget);
    if (!wd) return;
@@ -1507,9 +1500,10 @@ elm_ctxpopup_item_disabled_set(Elm_Ctxpopup_Item *item, Eina_Bool disabled)
  * @ingroup Ctxpopup
  */
 EAPI Eina_Bool
-elm_ctxpopup_item_disabled_get(const Elm_Ctxpopup_Item *item)
+elm_ctxpopup_item_disabled_get(const Elm_Object_Item *it)
 {
-   ELM_CTXPOPUP_ITEM_CHECK_RETURN(item, EINA_FALSE);
+   ELM_OBJ_ITEM_CHECK_OR_RETURN(it, EINA_FALSE);
+   Elm_Ctxpopup_Item *item = (Elm_Ctxpopup_Item *) it;
    return item->disabled;
 }
 
index c306e6e..3ad3b7d 100644 (file)
@@ -1219,7 +1219,7 @@ static void _ctxpopup_cb(void *data, Evas_Object *obj, void *event_info)
 
    EINA_LIST_FOREACH(wd->items, l, it)
      {
-        label = elm_ctxpopup_item_label_get((Elm_Ctxpopup_Item *) event_info);
+        label = elm_ctxpopup_item_label_get((Elm_Object_Item *) event_info);
         if ((label) && (!strcmp(it->text, label))) break;
      }