Efl.Ui.Autorepeat: Add efl autorepeat interface
authorAmitesh Singh <amitesh.sh@samsung.com>
Tue, 16 May 2017 06:57:16 +0000 (15:57 +0900)
committerAmitesh Singh <amitesh.sh@samsung.com>
Tue, 16 May 2017 11:01:13 +0000 (20:01 +0900)
Signed-off-by: Amitesh Singh <amitesh.sh@samsung.com>
13 files changed:
src/Makefile_Efl.am
src/lib/efl/CMakeLists.txt
src/lib/efl/Efl.h
src/lib/efl/interfaces/efl_ui_autorepeat.eo [new file with mode: 0644]
src/lib/elementary/elc_combobox.c
src/lib/elementary/elc_fileselector_button.c
src/lib/elementary/elc_hoversel.c
src/lib/elementary/elm_button.c
src/lib/elementary/elm_button.eo
src/lib/elementary/elm_button_legacy.h
src/lib/elementary/elm_combobox.eo
src/lib/elementary/elm_fileselector_button.eo
src/lib/elementary/elm_hoversel.eo

index a8fbf03..5cde197 100644 (file)
@@ -59,6 +59,7 @@ efl_eolian_files = \
       lib/efl/interfaces/efl_observable.eo \
       lib/efl/interfaces/efl_ui_item.eo \
       lib/efl/interfaces/efl_ui_menu.eo \
+      lib/efl/interfaces/efl_ui_autorepeat.eo \
       $(efl_eolian_legacy_files) \
       $(NULL)
 
index 359c3f2..b039107 100644 (file)
@@ -54,6 +54,7 @@ set(PUBLIC_EO_FILES
   interfaces/efl_ui_menu.eo
   interfaces/efl_ui_progress.eo
   interfaces/efl_ui_spin.eo
+  interfaces/efl_ui_autorepeat.eo
   interfaces/efl_vpath.eo
   interfaces/efl_vpath_core.eo
   interfaces/efl_vpath_file.eo
index bbf8c71..4a3f858 100644 (file)
@@ -85,6 +85,7 @@ typedef Efl_Gfx_Path_Command_Type Efl_Gfx_Path_Command;
 #include "interfaces/efl_ui_progress.eo.h"
 #include "interfaces/efl_ui_item.eo.h"
 #include "interfaces/efl_ui_menu.eo.h"
+#include "interfaces/efl_ui_autorepeat.eo.h"
 
 #include "interfaces/efl_screen.eo.h"
 
diff --git a/src/lib/efl/interfaces/efl_ui_autorepeat.eo b/src/lib/efl/interfaces/efl_ui_autorepeat.eo
new file mode 100644 (file)
index 0000000..3116bab
--- /dev/null
@@ -0,0 +1,54 @@
+interface Efl.Ui.Autorepeat {
+   [[Efl UI autorepeat interface]]
+   methods {
+      @property initial_timeout {
+         [[The initial timeout before the autorepeat event is generated
+
+           Sets the timeout, in seconds, since the button is pressed until the
+           first $repeated signal is emitted. If $t is 0.0 or less, there
+           won't be any delay and the event will be fired the moment the button is
+           pressed.
+
+           See also @.enabled.set, @.gap_timeout.set.
+         ]]
+         values {
+            t: double; [[Timeout in seconds]]
+         }
+      }
+      @property gap_timeout {
+         [[The interval between each generated autorepeat event
+
+           After the first $repeated event is fired, all subsequent ones will
+           follow after a delay of $t seconds for each.
+
+           See also @.initial_timeout.set.
+         ]]
+         values {
+            t: double; [[Interval in seconds]]
+         }
+      }
+      @property enabled {
+         [[Turn on/off the autorepeat event generated when the button is kept pressed
+
+           When off, no autorepeat is performed and buttons emit a normal $clicked
+           signal when they are clicked.
+
+           When on, keeping a button pressed will continuously emit a $repeated
+           signal until the button is released. The time it takes until it starts
+           emitting the signal is given by @.initial_timeout.set, and the
+           time between each new emission by @.gap_timeout.set.
+         ]]
+         values {
+            on: bool; [[A bool to turn on/off the event]]
+         }
+      }
+      @property supported {
+         [[Whether the button supports autorepeat.]]
+         get {
+         }
+         values {
+            ret: bool; [[$true if autorepeat is supported, $false otherwise]]
+         }
+      }
+   }
+}
index 01dc21a..0ef2b5e 100644 (file)
@@ -323,8 +323,8 @@ _elm_combobox_efl_gfx_visible_set(Eo *obj, Elm_Combobox_Data *sd, Eina_Bool vis)
 }
 
 EOLIAN static Eina_Bool
-_elm_combobox_elm_button_admits_autorepeat_get(Eo *obj EINA_UNUSED,
-                                               Elm_Combobox_Data *sd EINA_UNUSED)
+_elm_combobox_efl_ui_autorepeat_supported_get(Eo *obj EINA_UNUSED,
+                                              Elm_Combobox_Data *sd EINA_UNUSED)
 {
    return EINA_FALSE;
 }
index 2b37fe8..2e57f2e 100644 (file)
@@ -251,7 +251,7 @@ _elm_fileselector_button_efl_canvas_group_group_del(Eo *obj, Elm_Fileselector_Bu
 }
 
 EOLIAN static Eina_Bool
-_elm_fileselector_button_elm_button_admits_autorepeat_get(Eo *obj EINA_UNUSED, Elm_Fileselector_Button_Data *sd EINA_UNUSED)
+_elm_fileselector_button_efl_ui_autorepeat_supported_get(Eo *obj EINA_UNUSED, Elm_Fileselector_Button_Data *sd EINA_UNUSED)
 {
    return EINA_FALSE;
 }
index e8b673e..87f7859 100644 (file)
@@ -675,7 +675,7 @@ _elm_hoversel_elm_widget_widget_parent_set(Eo *obj, Elm_Hoversel_Data *_pd EINA_
 }
 
 EOLIAN static Eina_Bool
-_elm_hoversel_elm_button_admits_autorepeat_get(Eo *obj EINA_UNUSED, Elm_Hoversel_Data *sd EINA_UNUSED)
+_elm_hoversel_efl_ui_autorepeat_supported_get(Eo *obj EINA_UNUSED, Elm_Hoversel_Data *sd EINA_UNUSED)
 {
    return EINA_FALSE;
 }
index 5dba423..a56a0b7 100644 (file)
@@ -343,7 +343,7 @@ _elm_button_efl_object_constructor(Eo *obj, Elm_Button_Data *_pd EINA_UNUSED)
 }
 
 EOLIAN static void
-_elm_button_autorepeat_set(Eo *obj EINA_UNUSED, Elm_Button_Data *sd, Eina_Bool on)
+_elm_button_efl_ui_autorepeat_enabled_set(Eo *obj EINA_UNUSED, Elm_Button_Data *sd, Eina_Bool on)
 {
    ELM_SAFE_FREE(sd->timer, ecore_timer_del);
    sd->autorepeat = on;
@@ -351,30 +351,30 @@ _elm_button_autorepeat_set(Eo *obj EINA_UNUSED, Elm_Button_Data *sd, Eina_Bool o
 }
 
 #define _AR_CAPABLE(obj) \
-  (_internal_elm_button_admits_autorepeat_get(obj))
+  (_internal_elm_button_autorepeat_supported_get(obj))
 
 static Eina_Bool
-_internal_elm_button_admits_autorepeat_get(const Evas_Object *obj)
+_internal_elm_button_autorepeat_supported_get(const Evas_Object *obj)
 {
    Eina_Bool ret = EINA_FALSE;
-   ret = elm_obj_button_admits_autorepeat_get((Eo *) obj);
+   ret = efl_ui_autorepeat_supported_get(obj);
    return ret;
 }
 
 EOLIAN static Eina_Bool
-_elm_button_admits_autorepeat_get(Eo *obj EINA_UNUSED, Elm_Button_Data *_pd EINA_UNUSED)
+_elm_button_efl_ui_autorepeat_supported_get(Eo *obj EINA_UNUSED, Elm_Button_Data *_pd EINA_UNUSED)
 {
    return EINA_TRUE;
 }
 
 EOLIAN static Eina_Bool
-_elm_button_autorepeat_get(Eo *obj, Elm_Button_Data *sd)
+_elm_button_efl_ui_autorepeat_enabled_get(Eo *obj, Elm_Button_Data *sd)
 {
    return (_AR_CAPABLE(obj) & sd->autorepeat);
 }
 
 EOLIAN static void
-_elm_button_autorepeat_initial_timeout_set(Eo *obj, Elm_Button_Data *sd, double t)
+_elm_button_efl_ui_autorepeat_initial_timeout_set(Eo *obj, Elm_Button_Data *sd, double t)
 {
    if (!_AR_CAPABLE(obj))
      {
@@ -388,7 +388,7 @@ _elm_button_autorepeat_initial_timeout_set(Eo *obj, Elm_Button_Data *sd, double
 }
 
 EOLIAN static double
-_elm_button_autorepeat_initial_timeout_get(Eo *obj, Elm_Button_Data *sd)
+_elm_button_efl_ui_autorepeat_initial_timeout_get(Eo *obj, Elm_Button_Data *sd)
 {
    if (!_AR_CAPABLE(obj))
       return 0.0;
@@ -397,7 +397,7 @@ _elm_button_autorepeat_initial_timeout_get(Eo *obj, Elm_Button_Data *sd)
 }
 
 EOLIAN static void
-_elm_button_autorepeat_gap_timeout_set(Eo *obj, Elm_Button_Data *sd, double t)
+_elm_button_efl_ui_autorepeat_gap_timeout_set(Eo *obj, Elm_Button_Data *sd, double t)
 {
    if (!_AR_CAPABLE(obj))
      {
@@ -412,7 +412,7 @@ _elm_button_autorepeat_gap_timeout_set(Eo *obj, Elm_Button_Data *sd, double t)
 }
 
 EOLIAN static double
-_elm_button_autorepeat_gap_timeout_get(Eo *obj EINA_UNUSED, Elm_Button_Data *sd)
+_elm_button_efl_ui_autorepeat_gap_timeout_get(Eo *obj EINA_UNUSED, Elm_Button_Data *sd)
 {
    return sd->ar_gap_timeout;
 }
@@ -455,4 +455,40 @@ ELM_PART_OVERRIDE_CONTENT_SET(elm_button, ELM_BUTTON, ELM_LAYOUT, Elm_Button_Dat
 
 /* Efl.Part end */
 
+EAPI void
+elm_button_autorepeat_initial_timeout_set(Evas_Object *obj, double t)
+{
+   efl_ui_autorepeat_initial_timeout_set(obj, t);
+}
+
+EAPI double
+elm_button_autorepeat_initial_timeout_get(const Evas_Object *obj)
+{
+   return efl_ui_autorepeat_initial_timeout_get(obj);
+}
+
+EAPI void
+elm_button_autorepeat_gap_timeout_set(Evas_Object *obj, double t)
+{
+   efl_ui_autorepeat_gap_timeout_set(obj, t);
+}
+
+EAPI double
+elm_button_autorepeat_gap_timeout_get(const Evas_Object *obj)
+{
+   return efl_ui_autorepeat_gap_timeout_get(obj);
+}
+
+EAPI void
+elm_button_autorepeat_set(Evas_Object *obj, Eina_Bool on)
+{
+   efl_ui_autorepeat_enabled_set(obj, on);
+}
+
+EAPI Eina_Bool
+elm_button_autorepeat_get(const Evas_Object *obj)
+{
+   return efl_ui_autorepeat_enabled_get(obj);
+}
+
 #include "elm_button.eo.c"
index 7ace6b9..bc28878 100644 (file)
@@ -1,4 +1,4 @@
-class Elm.Button (Elm.Layout, Efl.Ui.Clickable, Efl.Text,
+class Elm.Button (Elm.Layout, Efl.Ui.Clickable, Efl.Ui.Autorepeat, Efl.Text,
                   Elm.Interface.Atspi_Widget_Action)
 {
    [[Push-button widget
@@ -9,73 +9,15 @@ class Elm.Button (Elm.Layout, Efl.Ui.Clickable, Efl.Text,
    legacy_prefix: elm_button;
    eo_prefix: elm_obj_button;
    methods {
-      @property autorepeat_initial_timeout {
-         [[The initial timeout before the autorepeat event is generated
-
-           Sets the timeout, in seconds, since the button is pressed until the
-           first $repeated signal is emitted. If $t is 0.0 or less, there
-           won't be any delay and the event will be fired the moment the button is
-           pressed.
-
-           See also @.autorepeat.set, @.autorepeat_gap_timeout.set.
-         ]]
-         set {
-         }
-         get {
-         }
-         values {
-            t: double; [[Timeout in seconds]]
-         }
-      }
-      @property autorepeat_gap_timeout {
-         [[The interval between each generated autorepeat event
-
-           After the first $repeated event is fired, all subsequent ones will
-           follow after a delay of $t seconds for each.
-
-           See also @.autorepeat_initial_timeout.set.
-         ]]
-         set {
-         }
-         get {
-         }
-         values {
-            t: double; [[Interval in seconds]]
-         }
-      }
-      @property autorepeat {
-         [[Turn on/off the autorepeat event generated when the button is kept pressed
-
-           When off, no autorepeat is performed and buttons emit a normal $clicked
-           signal when they are clicked.
-
-           When on, keeping a button pressed will continuously emit a $repeated
-           signal until the button is released. The time it takes until it starts
-           emitting the signal is given by @.autorepeat_initial_timeout.set, and the
-           time between each new emission by @.autorepeat_gap_timeout.set.
-         ]]
-         set {
-         }
-         get {
-         }
-         values {
-            on: bool; [[A bool to turn on/off the event]]
-         }
-      }
-      @property admits_autorepeat {
-         [[Whether the button supports autorepeat.]]
-         get {
-            legacy: null;
-         }
-         values {
-            ret: bool; [[$true if autorepeat is supported, $false otherwise]]
-         }
-      }
    }
    implements {
       class.constructor;
       Efl.Object.constructor;
       Efl.Canvas.Group.group_add;
+      Efl.Ui.Autorepeat.initial_timeout { set; get; }
+      Efl.Ui.Autorepeat.gap_timeout { set; get; }
+      Efl.Ui.Autorepeat.enabled { set; get; }
+      Efl.Ui.Autorepeat.supported { get;}
       Elm.Widget.activate;
       Elm.Widget.focus_next_manager_is;
       Elm.Widget.focus_direction_manager_is;
index 7901823..ee7fe79 100644 (file)
@@ -8,4 +8,104 @@
  */
 EAPI Evas_Object                 *elm_button_add(Evas_Object *parent);
 
+/**
+ * @brief The initial timeout before the autorepeat event is generated
+ *
+ * Sets the timeout, in seconds, since the button is pressed until the first
+ * @c repeated signal is emitted. If @c t is 0.0 or less, there won't be any
+ * delay and the event will be fired the moment the button is pressed.
+ *
+ * See also @ref elm_button_autorepeat_set,
+ * @ref elm_button_autorepeat_gap_timeout_set.
+ *
+ * @param[in] t Timeout in seconds
+ *
+ * @ingroup Elm_Button
+ */
+
+EAPI void                        elm_button_autorepeat_initial_timeout_set(Evas_Object *obj, double t);
+
+/**
+ * @brief The initial timeout before the autorepeat event is generated
+ *
+ * Sets the timeout, in seconds, since the button is pressed until the first
+ * @c repeated signal is emitted. If @c t is 0.0 or less, there won't be any
+ * delay and the event will be fired the moment the button is pressed.
+ *
+ * See also @ref elm_button_autorepeat_set,
+ * @ref elm_button_autorepeat_gap_timeout_set.
+ *
+ * @return Timeout in seconds
+ *
+ * @ingroup Elm_Button
+ */
+
+EAPI double                      elm_button_autorepeat_initial_timeout_get(const Evas_Object *obj);
+
+/**
+ * @brief The interval between each generated autorepeat event
+ *
+ * After the first @c repeated event is fired, all subsequent ones will follow
+ * after a delay of @c t seconds for each.
+ *
+ * See also @ref elm_button_autorepeat_initial_timeout_set.
+ *
+ * @param[in] t Interval in seconds
+ *
+ * @ingroup Elm_Button
+ */
+EAPI void                        elm_button_autorepeat_gap_timeout_set(Evas_Object *obj, double t);
+
+/**
+ * @brief The interval between each generated autorepeat event
+ *
+ * After the first @c repeated event is fired, all subsequent ones will follow
+ * after a delay of @c t seconds for each.
+ *
+ * See also @ref elm_button_autorepeat_initial_timeout_set.
+ *
+ * @return Interval in seconds
+ *
+ * @ingroup Elm_Button
+ */
+EAPI double                      elm_button_autorepeat_gap_timeout_get(const Evas_Object *obj);
+
+/**
+ * @brief Turn on/off the autorepeat event generated when the button is kept
+ * pressed
+ *
+ * When off, no autorepeat is performed and buttons emit a normal @c clicked
+ * signal when they are clicked.
+ *
+ * When on, keeping a button pressed will continuously emit a @c repeated
+ * signal until the button is released. The time it takes until it starts
+ * emitting the signal is given by @ref elm_button_autorepeat_initial_timeout_set,
+ * and the time between each new emission by
+ * @ref elm_button_autorepeat_gap_timeout_set.
+ *
+ * @param[in] on A bool to turn on/off the event
+ *
+ * @ingroup Elm_Button
+ */
+EAPI void                        elm_button_autorepeat_set(Evas_Object *obj, Eina_Bool on);
+
+/**
+ * @brief Turn on/off the autorepeat event generated when the button is kept
+ * pressed
+ *
+ * When off, no autorepeat is performed and buttons emit a normal @c clicked
+ * signal when they are clicked.
+ *
+ * When on, keeping a button pressed will continuously emit a @c repeated
+ * signal until the button is released. The time it takes until it starts
+ * emitting the signal is given by @ref elm_button_autorepeat_initial_timeout_set,
+ * and the time between each new emission by
+ * @ref elm_button_autorepeat_gap_timeout_set.
+ *
+ * @return A bool to turn on/off the event
+ *
+ * @ingroup Elm_Button
+ */
+EAPI Eina_Bool                   elm_button_autorepeat_get(const Evas_Object *obj);
+
 #include "elm_button.eo.legacy.h"
index 591126e..d801ce8 100644 (file)
@@ -45,7 +45,7 @@ class Elm.Combobox (Elm.Button, Efl.Ui.Selectable,
       Elm.Widget.theme_apply;
       Elm.Widget.translate;
       Elm.Widget.widget_event;
-      Elm.Button.admits_autorepeat { get; }
+      Efl.Ui.Autorepeat.supported { get; }
       Elm.Genlist.filter { set; }
       Elm.Interface.Atspi_Widget_Action.elm_actions { get; }
    }
index fa24766..31840ff 100644 (file)
@@ -7,7 +7,7 @@ class Elm.Fileselector_Button (Elm.Button, Elm.Interface.Fileselector)
       Efl.Canvas.Group.group_add;
       Efl.Canvas.Group.group_del;
       Elm.Widget.theme_apply;
-      Elm.Button.admits_autorepeat { get; }
+      Efl.Ui.Autorepeat.supported { get; }
       Elm.Interface.Fileselector.selected_models { get; }
       Elm.Interface.Fileselector.expandable { get; set; }
       Elm.Interface.Fileselector.thumbnail_size { get; set; }
index b82484d..30816d5 100644 (file)
@@ -101,7 +101,7 @@ class Elm.Hoversel (Elm.Button, Efl.Ui.Selectable,
       Elm.Widget.theme_apply;
       Elm.Widget.translate;
       Elm.Widget.widget_event;
-      Elm.Button.admits_autorepeat { get; }
+      Efl.Ui.Autorepeat.supported { get; }
       Elm.Interface.Atspi_Widget_Action.elm_actions { get; }
    }
    events {