deprecated elm_ctxpopup_content_set/content_unset
authorhermet <hermet@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Wed, 3 Aug 2011 04:38:44 +0000 (04:38 +0000)
committerMike McCormack <mj.mccormack@samsung.com>
Wed, 9 Nov 2011 00:26:50 +0000 (09:26 +0900)
but available them with elm_object_content_set/content_unset instead.

git-svn-id: https://svn.enlightenment.org/svn/e/trunk/elementary@62036 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/lib/Elementary.h.in
src/lib/elc_ctxpopup.c

index 725463f..a7f1189 100644 (file)
@@ -26513,7 +26513,7 @@ extern "C" {
     * @warning Ctxpopup can't hold both a item list and a content at the same
     * time. When a content is set, any previous items will be removed.
     */
-   EAPI void          elm_ctxpopup_content_set(Evas_Object *obj, Evas_Object *content) EINA_ARG_NONNULL(1, 2);
+   EINA_DEPRECATED EAPI void          elm_ctxpopup_content_set(Evas_Object *obj, Evas_Object *content) EINA_ARG_NONNULL(1, 2);
    /**
     * @brief Unset the ctxpopup content
     *
@@ -26526,7 +26526,7 @@ extern "C" {
     *
     * @see elm_ctxpopup_content_set()
     */
-   EAPI Evas_Object  *elm_ctxpopup_content_unset(Evas_Object *obj) EINA_ARG_NONNULL(1);
+   EINA_DEPRECATED EAPI Evas_Object  *elm_ctxpopup_content_unset(Evas_Object *obj) EINA_ARG_NONNULL(1);
    /**
     * @brief Set the direction priority of a ctxpopup.
     *
index 612cfee..7f7820d 100644 (file)
@@ -75,9 +75,18 @@ static void _shift_base_by_arrow(Evas_Object *arrow,
 static void _del_pre_hook(Evas_Object *obj);
 static void _del_hook(Evas_Object *obj);
 static void _theme_hook(Evas_Object *obj);
+static void _content_set_hook(Evas_Object *obj,
+                              const char *item __UNUSED__,
+                              Evas_Object *content);
+static Evas_Object * _content_unset_hook(Evas_Object *obj,
+                                         const char *item __UNUSED__);
+static Evas_Object * _content_get_hook(const Evas_Object *obj,
+                                       const char *item __UNUSED__);
 static void _bg_clicked_cb(void *data, Evas_Object *obj,
                            const char *emission,
                            const char *source);
+static void _parent_resize(void *data, Evas *e, Evas_Object *obj,
+                           void *event_info __UNUSED__);
 static void _ctxpopup_show(void *data,
                            Evas *e,
                            Evas_Object *obj,
@@ -815,6 +824,68 @@ _theme_hook(Evas_Object *obj)
 }
 
 static void
+_content_set_hook(Evas_Object *obj, const char *item __UNUSED__,
+                  Evas_Object *content)
+{
+   ELM_CHECK_WIDTYPE(obj, widtype);
+
+   Widget_Data *wd;
+
+   wd = elm_widget_data_get(obj);
+   if ((!wd) || (!content)) return;
+
+   if (wd->items) elm_ctxpopup_clear(obj);
+   if (wd->content) evas_object_del(wd->content);
+
+   evas_object_event_callback_add(content, EVAS_CALLBACK_DEL, _content_del,
+                                  obj);
+
+   elm_widget_sub_object_add(obj, content);
+   edje_object_part_swallow(wd->base, "elm.swallow.content", content);
+   edje_object_message_signal_process(wd->base);
+
+   wd->content = content;
+
+   if (wd->visible)
+      _sizing_eval(obj);
+}
+
+static Evas_Object *
+_content_unset_hook(Evas_Object *obj, const char *item __UNUSED__)
+{
+   ELM_CHECK_WIDTYPE(obj, widtype) NULL;
+
+   Widget_Data *wd;
+   Evas_Object *content;
+
+   wd = elm_widget_data_get(obj);
+   if (!wd) return NULL;
+
+   content = wd->content;
+   if (!content) return NULL;
+
+   edje_object_part_unswallow(wd->base, content);
+   elm_widget_sub_object_del(obj, content);
+   evas_object_event_callback_del(content, EVAS_CALLBACK_DEL, _content_del);
+   edje_object_signal_emit(wd->base, "elm,state,content,disable", "elm");
+
+   wd->content = NULL;
+
+   return content;
+
+}
+
+static Evas_Object *
+_content_get_hook(const Evas_Object *obj, const char *item __UNUSED__)
+{
+   ELM_CHECK_WIDTYPE(obj, widtype) NULL;
+
+   Widget_Data *wd = elm_widget_data_get(obj);
+   if (!wd) return NULL;
+   return wd->content;
+}
+
+static void
 _bg_clicked_cb(void *data, Evas_Object *obj __UNUSED__,
                const char *emission __UNUSED__, const char *source __UNUSED__)
 {
@@ -1016,7 +1087,7 @@ static void
 _content_del(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__,
              void *event_info __UNUSED__)
 {
-   elm_ctxpopup_content_unset(data);
+   elm_object_content_unset(data);
 }
 
 static void
@@ -1092,6 +1163,9 @@ elm_ctxpopup_add(Evas_Object *parent)
    elm_widget_del_pre_hook_set(obj, _del_pre_hook);
    elm_widget_del_hook_set(obj, _del_hook);
    elm_widget_theme_hook_set(obj, _theme_hook);
+   elm_widget_content_set_hook_set(obj, _content_set_hook);
+   elm_widget_content_unset_hook_set(obj, _content_unset_hook);
+   elm_widget_content_get_hook_set(obj, _content_get_hook);
 
    wd->parent = parent;
 
@@ -1332,7 +1406,7 @@ elm_ctxpopup_item_append(Evas_Object *obj, const char *label,
 
    //The first item is appended.
    if (wd->content)
-     evas_object_del(elm_ctxpopup_content_unset(obj));
+     evas_object_del(elm_object_content_unset(obj));
 
    if (!wd->items)
      _list_new(obj);
@@ -1423,55 +1497,13 @@ elm_ctxpopup_item_disabled_get(const Elm_Object_Item *it)
 EAPI void
 elm_ctxpopup_content_set(Evas_Object *obj, Evas_Object *content)
 {
-   ELM_CHECK_WIDTYPE(obj, widtype);
-
-   Widget_Data *wd;
-
-   wd = elm_widget_data_get(obj);
-   if ((!wd) || (!content))
-     return;
-
-   if (wd->items)
-     elm_ctxpopup_clear(obj);
-
-   if (wd->content)
-     evas_object_del(wd->content);
-
-   evas_object_event_callback_add(content, EVAS_CALLBACK_DEL, _content_del,
-                                  obj);
-
-   elm_widget_sub_object_add(obj, content);
-   edje_object_part_swallow(wd->base, "elm.swallow.content", content);
-   edje_object_message_signal_process(wd->base);
-
-   wd->content = content;
-
-   if (wd->visible)
-     _sizing_eval(obj);
+   elm_object_content_set(obj, content);
 }
 
 EAPI Evas_Object *
 elm_ctxpopup_content_unset(Evas_Object *obj)
 {
-   ELM_CHECK_WIDTYPE(obj, widtype) NULL;
-
-   Widget_Data *wd;
-   Evas_Object *content;
-
-   wd = elm_widget_data_get(obj);
-   if (!wd) return NULL;
-
-   content = wd->content;
-   if (!content) return NULL;
-
-   edje_object_part_unswallow(wd->base, content);
-   elm_widget_sub_object_del(obj, content);
-   evas_object_event_callback_del(content, EVAS_CALLBACK_DEL, _content_del);
-   edje_object_signal_emit(wd->base, "elm,state,content,disable", "elm");
-
-   wd->content = NULL;
-
-   return content;
+   return elm_object_content_unset(obj);
 }
 
 EAPI void