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

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

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

index 10e2697..bffe4af 100644 (file)
@@ -2554,8 +2554,8 @@ extern "C" {
     */
 
    EAPI Evas_Object *elm_fileselector_entry_add(Evas_Object *parent) EINA_ARG_NONNULL(1);
-   EAPI void         elm_fileselector_entry_button_label_set(Evas_Object *obj, const char *label) EINA_ARG_NONNULL(1);
-   EAPI const char  *elm_fileselector_entry_button_label_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
+   EINA_DEPRECATED EAPI void         elm_fileselector_entry_button_label_set(Evas_Object *obj, const char *label) EINA_ARG_NONNULL(1);
+   EINA_DEPRECATED EAPI const char  *elm_fileselector_entry_button_label_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
    EAPI void         elm_fileselector_entry_button_icon_set(Evas_Object *obj, Evas_Object *icon) EINA_ARG_NONNULL(1);
    EAPI Evas_Object *elm_fileselector_entry_button_icon_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
    EAPI Evas_Object *elm_fileselector_entry_button_icon_unset(Evas_Object *obj) EINA_ARG_NONNULL(1);
index 19f150a..1707b29 100644 (file)
@@ -212,6 +212,26 @@ _changed_size_hints(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__,
    _sizing_eval(data);
 }
 
+static void
+_elm_fileselector_entry_button_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;
+   elm_object_text_set(wd->button, label);
+}
+
+static const char *
+_elm_fileselector_entry_button_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 elm_object_text_get(wd->button);
+}
+
 /**
  * Add a new file selector entry into the parent object.
  *
@@ -238,6 +258,8 @@ elm_fileselector_entry_add(Evas_Object *parent)
    elm_widget_focus_next_hook_set(obj, _elm_fileselector_entry_focus_next_hook);
    elm_widget_can_focus_set(obj, EINA_FALSE);
    elm_widget_theme_hook_set(obj, _theme_hook);
+   elm_widget_text_set_hook_set(obj, _elm_fileselector_entry_button_label_set);
+   elm_widget_text_get_hook_set(obj, _elm_fileselector_entry_button_label_get);
 
    wd->edje = edje_object_add(e);
    _elm_theme_object_set(obj, wd->edje, "fileselector_entry", "base", "default");
@@ -303,23 +325,18 @@ elm_fileselector_entry_add(Evas_Object *parent)
  * @param label The text label text to be displayed on the entry
  *
  * @ingroup File_Selector_Entry
+ * @deprecated use elm_object_text_set() instead.
  */
 EAPI void
 elm_fileselector_entry_button_label_set(Evas_Object *obj, const char *label)
 {
-   ELM_CHECK_WIDTYPE(obj, widtype);
-   Widget_Data *wd = elm_widget_data_get(obj);
-   if (!wd) return;
-   elm_object_text_set(wd->button, label);
+   _elm_fileselector_entry_button_label_set(obj, NULL, label);
 }
 
 EAPI const char *
 elm_fileselector_entry_button_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 elm_object_text_get(wd->button);
+   return _elm_fileselector_entry_button_label_get(obj, NULL);
 }
 
 /**