fileselector entry: Move EO API to legacy
authorJean-Philippe Andre <jp.andre@samsung.com>
Wed, 25 May 2016 02:56:59 +0000 (11:56 +0900)
committerJean-Philippe Andre <jp.andre@samsung.com>
Wed, 25 May 2016 06:00:34 +0000 (15:00 +0900)
src/lib/elementary/elc_fileselector_entry.c
src/lib/elementary/elc_fileselector_entry_legacy.h
src/lib/elementary/elm_fileselector_entry.eo

index 5792a47..f4ad6d7 100644 (file)
@@ -210,9 +210,7 @@ _elm_fileselector_entry_elm_layout_text_set(Eo *obj, Elm_Fileselector_Entry_Data
 {
    if (part && strcmp(part, "default"))
      {
-        Eina_Bool int_ret = EINA_FALSE;
-        int_ret = elm_obj_layout_text_set(eo_super(obj, MY_CLASS), part, label);
-        return int_ret;
+        return elm_obj_layout_text_set(eo_super(obj, MY_CLASS), part, label);
      }
 
    elm_object_text_set(sd->button, label);
@@ -237,9 +235,7 @@ _elm_fileselector_entry_efl_container_content_set(Eo *obj, Elm_Fileselector_Entr
 {
    if (part && strcmp(part, "button icon"))
      {
-        Eina_Bool int_ret = EINA_FALSE;
-        int_ret = efl_content_set(eo_super(obj, MY_CLASS), part, content);
-        return int_ret;
+        return efl_content_set(eo_super(obj, MY_CLASS), part, content);
      }
 
    elm_layout_content_set(sd->button, NULL, content);
@@ -252,9 +248,7 @@ _elm_fileselector_entry_efl_container_content_get(Eo *obj, Elm_Fileselector_Entr
 {
    if (part && strcmp(part, "button icon"))
      {
-        Evas_Object *ret = NULL;
-        ret = efl_content_get(eo_super(obj, MY_CLASS), part);
-        return ret;
+        return efl_content_get(eo_super(obj, MY_CLASS), part);
      }
 
    return elm_layout_content_get(sd->button, NULL);
@@ -265,9 +259,7 @@ _elm_fileselector_entry_efl_container_content_unset(Eo *obj, Elm_Fileselector_En
 {
    if (part && strcmp(part, "button icon"))
      {
-        Evas_Object *ret = NULL;
-        ret = efl_content_unset(eo_super(obj, MY_CLASS), part);
-        return ret;
+        return efl_content_unset(eo_super(obj, MY_CLASS), part);
      }
 
    return elm_layout_content_unset(sd->button, NULL);
@@ -342,8 +334,7 @@ EAPI Evas_Object *
 elm_fileselector_entry_add(Evas_Object *parent)
 {
    EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
-   Evas_Object *obj = eo_add(MY_CLASS, parent);
-   return obj;
+   return eo_add(MY_CLASS, parent);
 }
 
 EOLIAN static Eo *
@@ -376,9 +367,7 @@ EINA_DEPRECATED EAPI const char *
 elm_fileselector_entry_selected_get(const Evas_Object *obj)
 {
    ELM_FILESELECTOR_INTERFACE_CHECK(obj, NULL);
-   const char *ret = NULL;
-   ret = elm_interface_fileselector_selected_get((Eo *) obj);
-   return ret;
+   return elm_interface_fileselector_selected_get((Eo *) obj);
 }
 
 EOLIAN static const char *
@@ -387,27 +376,37 @@ _elm_fileselector_entry_elm_interface_fileselector_selected_get(Eo *obj EINA_UNU
    return elm_fileselector_path_get(sd->button);
 }
 
-EOLIAN static void
-_elm_fileselector_entry_window_title_set(Eo *obj EINA_UNUSED, Elm_Fileselector_Entry_Data *sd, const char *title)
+EAPI void
+elm_fileselector_entry_window_title_set(Eo *obj, const char *title)
 {
+   ELM_FILESELECTOR_ENTRY_CHECK(obj);
+   ELM_FILESELECTOR_ENTRY_DATA_GET_OR_RETURN(obj, sd);
    elm_fileselector_button_window_title_set(sd->button, title);
 }
 
-EOLIAN static const char *
-_elm_fileselector_entry_window_title_get(Eo *obj EINA_UNUSED, Elm_Fileselector_Entry_Data *sd)
+EAPI const char *
+elm_fileselector_entry_window_title_get(const Eo *obj)
 {
+   ELM_FILESELECTOR_ENTRY_CHECK(obj) NULL;
+   ELM_FILESELECTOR_ENTRY_DATA_GET_OR_RETURN_VAL(obj, sd, NULL);
    return elm_fileselector_button_window_title_get(sd->button);
 }
 
-EOLIAN static void
-_elm_fileselector_entry_window_size_set(Eo *obj EINA_UNUSED, Elm_Fileselector_Entry_Data *sd, Evas_Coord width, Evas_Coord height)
+EAPI void
+elm_fileselector_entry_window_size_set(Eo *obj, Evas_Coord width, Evas_Coord height)
 {
+   ELM_FILESELECTOR_ENTRY_CHECK(obj);
+   ELM_FILESELECTOR_ENTRY_DATA_GET_OR_RETURN(obj, sd);
    elm_fileselector_button_window_size_set(sd->button, width, height);
 }
 
-EOLIAN static void
-_elm_fileselector_entry_window_size_get(Eo *obj EINA_UNUSED, Elm_Fileselector_Entry_Data *sd, Evas_Coord *width, Evas_Coord *height)
+EAPI void
+elm_fileselector_entry_window_size_get(const Eo *obj, Evas_Coord *width, Evas_Coord *height)
 {
+   if (width) *width = 0;
+   if (height) *height = 0;
+   ELM_FILESELECTOR_ENTRY_CHECK(obj);
+   ELM_FILESELECTOR_ENTRY_DATA_GET_OR_RETURN(obj, sd);
    elm_fileselector_button_window_size_get(sd->button, width, height);
 }
 
@@ -437,9 +436,7 @@ EINA_DEPRECATED EAPI const char *
 elm_fileselector_entry_path_get(const Evas_Object *obj)
 {
    ELM_FILESELECTOR_INTERFACE_CHECK(obj, NULL);
-   const char *ret = NULL;
-   ret = elm_interface_fileselector_path_get((Eo *) obj);
-   return ret;
+   return elm_interface_fileselector_path_get((Eo *) obj);
 }
 
 EOLIAN static const char *
@@ -468,9 +465,7 @@ EINA_DEPRECATED EAPI Eina_Bool
 elm_fileselector_entry_expandable_get(const Evas_Object *obj)
 {
    ELM_FILESELECTOR_INTERFACE_CHECK(obj, EINA_FALSE);
-   Eina_Bool ret = EINA_FALSE;
-   ret = elm_interface_fileselector_expandable_get((Eo *) obj);
-   return ret;
+   return elm_interface_fileselector_expandable_get((Eo *) obj);
 }
 
 EOLIAN static Eina_Bool
@@ -497,9 +492,7 @@ EINA_DEPRECATED EAPI Eina_Bool
 elm_fileselector_entry_folder_only_get(const Evas_Object *obj)
 {
    ELM_FILESELECTOR_INTERFACE_CHECK(obj, EINA_FALSE);
-   Eina_Bool ret = EINA_FALSE;
-   ret = elm_interface_fileselector_folder_only_get((Eo *) obj);
-   return ret;
+   return elm_interface_fileselector_folder_only_get((Eo *) obj);
 }
 
 EOLIAN static Eina_Bool
@@ -526,9 +519,7 @@ EINA_DEPRECATED EAPI Eina_Bool
 elm_fileselector_entry_is_save_get(const Evas_Object *obj)
 {
    ELM_FILESELECTOR_INTERFACE_CHECK(obj, EINA_FALSE);
-   Eina_Bool ret = EINA_FALSE;
-   ret = elm_interface_fileselector_is_save_get((Eo *) obj);
-   return ret;
+   return elm_interface_fileselector_is_save_get((Eo *) obj);
 }
 
 EOLIAN static Eina_Bool
@@ -537,15 +528,19 @@ _elm_fileselector_entry_elm_interface_fileselector_is_save_get(Eo *obj EINA_UNUS
    return elm_fileselector_is_save_get(sd->button);
 }
 
-EOLIAN static void
-_elm_fileselector_entry_inwin_mode_set(Eo *obj EINA_UNUSED, Elm_Fileselector_Entry_Data *sd, Eina_Bool value)
+EAPI void
+elm_fileselector_entry_inwin_mode_set(Eo *obj, Eina_Bool value)
 {
+   ELM_FILESELECTOR_ENTRY_CHECK(obj);
+   ELM_FILESELECTOR_ENTRY_DATA_GET_OR_RETURN(obj, sd);
    elm_fileselector_button_inwin_mode_set(sd->button, value);
 }
 
-EOLIAN static Eina_Bool
-_elm_fileselector_entry_inwin_mode_get(Eo *obj EINA_UNUSED, Elm_Fileselector_Entry_Data *sd)
+EAPI Eina_Bool
+elm_fileselector_entry_inwin_mode_get(const Eo *obj)
 {
+   ELM_FILESELECTOR_ENTRY_CHECK(obj) EINA_FALSE;
+   ELM_FILESELECTOR_ENTRY_DATA_GET_OR_RETURN_VAL(obj, sd, EINA_FALSE);
    return elm_fileselector_button_inwin_mode_get(sd->button);
 }
 
index f4f9b98..f06d403 100644 (file)
 EAPI Evas_Object                *elm_fileselector_entry_add(Evas_Object *parent);
 
 #include "elm_fileselector_entry.eo.legacy.h"
+
+/**
+ * @brief Set whether a given file selector entry widget's internal file
+ * selector will raise an Elementary "inner window", instead of a dedicated
+ * Elementary window. By default, it depends on the current profile.
+ *
+ * See also @ref elm_win_inwin_add for more information on inner windows,
+ * @ref elm_fileselector_entry_inwin_mode_get.
+ *
+ * @param[in] value @c true to make it use an inner window, @c false to make it
+ * use a dedicated window.
+ *
+ * @ingroup Elm_Fileselector_Entry
+ */
+EAPI void elm_fileselector_entry_inwin_mode_set(Elm_Fileselector_Entry *obj, Eina_Bool value);
+
+/**
+ * @brief Get whether a given file selector entry widget's internal file
+ * selector will raise an Elementary "inner window", instead of a dedicated
+ * Elementary window.
+ *
+ * See also @ref elm_fileselector_entry_inwin_mode_set for more details.
+ *
+ * @return @c true to make it use an inner window, @c false to make it use a
+ * dedicated window.
+ *
+ * @ingroup Elm_Fileselector_Entry
+ */
+EAPI Eina_Bool elm_fileselector_entry_inwin_mode_get(const Elm_Fileselector_Entry *obj);
+
+/**
+ * @brief Set the size of a given file selector entry widget's window, holding
+ * the file selector itself.
+ *
+ * @note it will only take any effect if the file selector entry widget is not
+ * under "inwin mode". The default size for the window (when applicable) is
+ * 400x400 pixels.
+ *
+ * See also @ref elm_fileselector_entry_window_size_get.
+ *
+ * @param[in] width The window's width.
+ * @param[in] height The window's height.
+ *
+ * @ingroup Elm_Fileselector_Entry
+ */
+EAPI void elm_fileselector_entry_window_size_set(Elm_Fileselector_Entry *obj, Evas_Coord width, Evas_Coord height);
+
+/**
+ * @brief Get the size of a given file selector entry widget's window, holding
+ * the file selector itself.
+ *
+ * @note Use @c null pointers on the size values you're not interested in:
+ * they'll be ignored by the function.
+ *
+ * See also @ref elm_fileselector_entry_window_size_set, for more details.
+ *
+ * @param[out] width The window's width.
+ * @param[out] height The window's height.
+ *
+ * @ingroup Elm_Fileselector_Entry
+ */
+EAPI void elm_fileselector_entry_window_size_get(const Elm_Fileselector_Entry *obj, Evas_Coord *width, Evas_Coord *height);
+
+/**
+ * @brief Set the title for a given file selector entry widget's window
+ *
+ * This will change the window's title, when the file selector pops out after a
+ * click on the entry's button. Those windows have the default (unlocalized)
+ * value of $"Select a file" as titles.
+ *
+ * @note It will only take any effect if the file selector entry widget is not
+ * under "inwin mode".
+ *
+ * See also @ref elm_fileselector_entry_window_title_get.
+ *
+ * @param[in] title The title string.
+ *
+ * @ingroup Elm_Fileselector_Entry
+ */
+EAPI void elm_fileselector_entry_window_title_set(Elm_Fileselector_Entry *obj, const char *title);
+
+/**
+ * @brief Get the title set for a given file selector entry widget's window.
+ *
+ * See also @ref elm_fileselector_entry_window_title_set for more details.
+ *
+ * @return The title string.
+ *
+ * @ingroup Elm_Fileselector_Entry
+ */
+EAPI const char *elm_fileselector_entry_window_title_get(const Elm_Fileselector_Entry *obj);
index 1cd1feb..401d295 100644 (file)
@@ -1,87 +1,8 @@
 class Elm.Fileselector_Entry (Elm.Layout, Elm.Interface.Fileselector,
                               Evas.Clickable_Interface, Evas.Selectable_Interface)
 {
-   legacy_prefix: elm_fileselector_entry;
-   eo_prefix: elm_obj_fileselector_entry;
+   [[Not an EO API.]]
    event_prefix: elm_fileselector_entry;
-   methods {
-      @property inwin_mode {
-         set {
-            [[Set whether a given file selector entry widget's internal file
-              selector will raise an Elementary "inner window", instead of a
-              dedicated Elementary window. By default, it depends on the current
-              profile.
-
-              See also \@ref elm_win_inwin_add for more information on inner windows,
-              @.inwin_mode.get.
-            ]]
-         }
-         get {
-            [[Get whether a given file selector entry widget's internal file
-              selector will raise an Elementary "inner window", instead of a
-              dedicated Elementary window.
-
-              See also @.inwin_mode.set for more details.
-            ]]
-         }
-         values {
-            value: bool; [[$true to make it use an inner window, $false
-            to make it use a dedicated window.]]
-         }
-      }
-      @property window_size {
-         set {
-            [[Set the size of a given file selector entry widget's window,
-              holding the file selector itself.
-
-              Note: it will only take any effect if the file selector entry
-              widget is not under "inwin mode". The default size for the
-              window (when applicable) is 400x400 pixels.
-
-              See also @.window_size.get.
-            ]]
-         }
-         get {
-            [[Get the size of a given file selector entry widget's window,
-              holding the file selector itself.
-
-              Note: Use $null pointers on the size values you're not
-              interested in: they'll be ignored by the function.
-
-              See also @.window_size.set, for more details.
-            ]]
-         }
-         values {
-            width: Evas.Coord; [[The window's width.]]
-            height: Evas.Coord; [[The window's height.]]
-         }
-      }
-      @property window_title {
-         set {
-            [[Set the title for a given file selector entry widget's window
-
-              This will change the window's title, when the file selector pops
-              out after a click on the entry's button. Those windows have the
-              default (unlocalized) value of $"Select a file" as titles.
-
-              Note: It will only take any effect if the file selector
-              entry widget is not under "inwin mode".
-
-              See also @.window_title.get.
-            ]]
-         }
-         get {
-            [[Get the title set for a given file selector entry widget's
-              window.
-
-              See also @.window_title.set for more details.
-            ]]
-         }
-         values {
-            title: const(char)*; [[The title string.]]
-         }
-      }
-   }
    implements {
       class.constructor;
       Eo.Base.constructor;