elm check: add the elm_object_text_set/get hooks.
authortasn <tasn@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Mon, 4 Jul 2011 09:18:10 +0000 (09:18 +0000)
committertasn <tasn@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Mon, 4 Jul 2011 09:18:10 +0000 (09:18 +0000)
deprecate: elm_check_indicator_label_set/get.

git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/elementary@60973 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

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

index 1db4458..e85e00c 100644 (file)
@@ -4498,8 +4498,8 @@ extern "C" {
 
    /* check */
    EAPI Evas_Object *elm_check_add(Evas_Object *parent) EINA_ARG_NONNULL(1);
-   EAPI void         elm_check_label_set(Evas_Object *obj, const char *label); EINA_ARG_NONNULL(1)
-   EAPI const char  *elm_check_label_get(const Evas_Object *obj); EINA_ARG_NONNULL(1)
+   EINA_DEPRECATED EAPI void         elm_check_label_set(Evas_Object *obj, const char *label); EINA_ARG_NONNULL(1)
+   EINA_DEPRECATED EAPI const char  *elm_check_label_get(const Evas_Object *obj); EINA_ARG_NONNULL(1)
    EAPI void         elm_check_icon_set(Evas_Object *obj, Evas_Object *icon); EINA_ARG_NONNULL(1)
    EAPI Evas_Object *elm_check_icon_get(const Evas_Object *obj); EINA_ARG_NONNULL(1)
    EAPI Evas_Object *elm_check_icon_unset(Evas_Object *obj); EINA_ARG_NONNULL(1)
index 1b02206..8ad2215 100644 (file)
@@ -231,6 +231,33 @@ _activate(Evas_Object *obj)
    evas_object_smart_callback_call(obj, SIG_CHANGED, NULL);
 }
 
+static void
+_elm_check_label_set(Evas_Object *obj, const char *item, const char *label)
+{
+   ELM_CHECK_WIDTYPE(obj, widtype);
+   Widget_Data *wd = elm_widget_data_get(obj);
+   if (item) return;
+   if (!wd) return;
+   eina_stringshare_replace(&wd->label, label);
+   if (label)
+     edje_object_signal_emit(wd->chk, "elm,state,text,visible", "elm");
+   else
+     edje_object_signal_emit(wd->chk, "elm,state,text,hidden", "elm");
+   edje_object_message_signal_process(wd->chk);
+   edje_object_part_text_set(wd->chk, "elm.text", label);
+   _sizing_eval(obj);
+}
+
+static const char *
+_elm_check_label_get(const Evas_Object *obj, const char *item)
+{
+   ELM_CHECK_WIDTYPE(obj, widtype) NULL;
+   Widget_Data *wd = elm_widget_data_get(obj);
+   if (item) return NULL;
+   if (!wd) return NULL;
+   return wd->label;
+}
+
 /**
  * Add a new Check object
  *
@@ -259,6 +286,8 @@ elm_check_add(Evas_Object *parent)
    elm_widget_can_focus_set(obj, EINA_TRUE);
    elm_widget_activate_hook_set(obj, _activate_hook);
    elm_widget_event_hook_set(obj, _event_hook);
+   elm_widget_label_set_hook_set(obj, _elm_check_label_set);
+   elm_widget_label_get_hook_set(obj, _elm_check_label_get);
 
    wd->chk = edje_object_add(e);
    _elm_theme_object_set(obj, wd->chk, "check", "base", "default");
@@ -292,17 +321,7 @@ elm_check_add(Evas_Object *parent)
 EAPI void
 elm_check_label_set(Evas_Object *obj, const char *label)
 {
-   ELM_CHECK_WIDTYPE(obj, widtype);
-   Widget_Data *wd = elm_widget_data_get(obj);
-   if (!wd) return;
-   eina_stringshare_replace(&wd->label, label);
-   if (label)
-     edje_object_signal_emit(wd->chk, "elm,state,text,visible", "elm");
-   else
-     edje_object_signal_emit(wd->chk, "elm,state,text,hidden", "elm");
-   edje_object_message_signal_process(wd->chk);
-   edje_object_part_text_set(wd->chk, "elm.text", label);
-   _sizing_eval(obj);
+   _elm_check_label_set(obj, NULL, label);
 }
 
 /**
@@ -316,10 +335,7 @@ elm_check_label_set(Evas_Object *obj, const char *label)
 EAPI const char *
 elm_check_label_get(const Evas_Object *obj)
 {
-   ELM_CHECK_WIDTYPE(obj, widtype) NULL;
-   Widget_Data *wd = elm_widget_data_get(obj);
-   if (!wd) return NULL;
-   return wd->label;
+   return _elm_check_label_get(obj, NULL);
 }
 
 /**