aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/elementary
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/elementary')
-rw-r--r--src/lib/elementary/Efl_Ui.h6
-rw-r--r--src/lib/elementary/Elementary.h4
-rw-r--r--src/lib/elementary/efl_ui_active_view_container.c87
-rw-r--r--src/lib/elementary/efl_ui_active_view_container.eo53
-rw-r--r--src/lib/elementary/efl_ui_active_view_util.c21
-rw-r--r--src/lib/elementary/efl_ui_active_view_util.eo11
-rw-r--r--src/lib/elementary/efl_ui_check.c157
-rw-r--r--src/lib/elementary/efl_ui_check.eo10
-rw-r--r--src/lib/elementary/efl_ui_check_private.h1
-rw-r--r--src/lib/elementary/efl_ui_datepicker.c8
-rw-r--r--src/lib/elementary/efl_ui_navigation_bar.c8
-rw-r--r--src/lib/elementary/efl_ui_progressbar.c12
-rw-r--r--src/lib/elementary/efl_ui_progressbar.eo2
-rw-r--r--src/lib/elementary/efl_ui_progressbar_part.eo2
-rw-r--r--src/lib/elementary/efl_ui_radio.c305
-rw-r--r--src/lib/elementary/efl_ui_radio.eo78
-rw-r--r--src/lib/elementary/efl_ui_radio_box.c127
-rw-r--r--src/lib/elementary/efl_ui_radio_box.eo25
-rw-r--r--src/lib/elementary/efl_ui_radio_eo.h6
-rw-r--r--src/lib/elementary/efl_ui_radio_eo.legacy.c18
-rw-r--r--src/lib/elementary/efl_ui_radio_group.eo62
-rw-r--r--src/lib/elementary/efl_ui_radio_group_impl.c152
-rw-r--r--src/lib/elementary/efl_ui_radio_group_impl.eo13
-rw-r--r--src/lib/elementary/efl_ui_radio_private.h2
-rw-r--r--src/lib/elementary/efl_ui_selection_manager.c3
-rw-r--r--src/lib/elementary/efl_ui_slider.c6
-rw-r--r--src/lib/elementary/efl_ui_slider.eo16
-rw-r--r--src/lib/elementary/efl_ui_slider_interval.c2
-rw-r--r--src/lib/elementary/efl_ui_spin.c4
-rw-r--r--src/lib/elementary/efl_ui_spin.eo2
-rw-r--r--src/lib/elementary/efl_ui_stack.c697
-rw-r--r--src/lib/elementary/efl_ui_stack.eo131
-rw-r--r--src/lib/elementary/efl_ui_stack_private.h31
-rw-r--r--src/lib/elementary/efl_ui_timepicker.c4
-rw-r--r--src/lib/elementary/efl_ui_win.c8
-rw-r--r--src/lib/elementary/efl_ui_win.eo2
-rw-r--r--src/lib/elementary/elm_check.h3
-rw-r--r--src/lib/elementary/elm_dayselector.c9
-rw-r--r--src/lib/elementary/elm_flipselector.c4
-rw-r--r--src/lib/elementary/elm_flipselector_eo.c8
-rw-r--r--src/lib/elementary/elm_interface_scrollable.c4
-rw-r--r--src/lib/elementary/elm_slider.c8
-rw-r--r--src/lib/elementary/elm_spinner.c8
-rw-r--r--src/lib/elementary/elm_spinner_eo.c8
-rw-r--r--src/lib/elementary/meson.build10
45 files changed, 839 insertions, 1299 deletions
diff --git a/src/lib/elementary/Efl_Ui.h b/src/lib/elementary/Efl_Ui.h
index bf11cb215d..6509423f05 100644
--- a/src/lib/elementary/Efl_Ui.h
+++ b/src/lib/elementary/Efl_Ui.h
@@ -4,10 +4,6 @@
#include <Efl_Config.h>
#include <Elementary_Options.h>
-/* FIXME: wtf? */
-#ifndef EFL_UI_RADIO_EVENT_CHANGED
-# define EFL_UI_RADIO_EVENT_CHANGED EFL_UI_NSTATE_EVENT_CHANGED
-#endif
/* Standard headers for standard system calls etc. */
#include <stdio.h>
#include <stdlib.h>
@@ -242,12 +238,12 @@ typedef Eo Efl_Ui_Active_View_Indicator;
# include <efl_ui_active_view_indicator_icon.eo.h>
# include <efl_ui_active_view_view_manager_scroll.eo.h>
# include <efl_ui_active_view_view_manager_stack.eo.h>
+# include <efl_ui_active_view_util.eo.h>
# include <efl_ui_navigation_bar.eo.h>
# include <efl_ui_navigation_bar_part.eo.h>
# include <efl_ui_navigation_bar_part_back_button.eo.h>
# include <efl_ui_navigation_layout.eo.h>
-# include <efl_ui_stack.eo.h>
# include <efl_ui_clickable.eo.h>
# include <efl_ui_clickable_util.eo.h>
diff --git a/src/lib/elementary/Elementary.h b/src/lib/elementary/Elementary.h
index ba78f4d2b1..78e22ebc60 100644
--- a/src/lib/elementary/Elementary.h
+++ b/src/lib/elementary/Elementary.h
@@ -147,10 +147,6 @@ EAPI extern Elm_Version *elm_version;
#include <elm_focus.h>
#include <Efl.h>
-/* FIXME: wtf? */
-#ifndef EFL_UI_RADIO_EVENT_CHANGED
-# define EFL_UI_RADIO_EVENT_CHANGED EFL_UI_NSTATE_EVENT_CHANGED
-#endif
# include <efl_ui.eot.h>
//define focus manager earlier since focus object and manager is circular
typedef Eo Efl_Ui_Focus_Manager;
diff --git a/src/lib/elementary/efl_ui_active_view_container.c b/src/lib/elementary/efl_ui_active_view_container.c
index 30dadd698b..03eca6fab6 100644
--- a/src/lib/elementary/efl_ui_active_view_container.c
+++ b/src/lib/elementary/efl_ui_active_view_container.c
@@ -23,13 +23,16 @@ typedef struct _Efl_Ui_Active_View_Container_Data
double last_pos;
Eina_Bool active;
} show_request;
+ struct {
+ Eina_Promise *transition_done;
+ Efl_Gfx_Entity *content;
+ } transition_done;
Efl_Ui_Active_View_View_Manager *transition;
Efl_Ui_Active_View_Indicator *indicator;
double position;
Eina_Bool fill_width: 1;
Eina_Bool fill_height: 1;
Eina_Bool prevent_transition_interaction : 1;
- Efl_Ui_Active_View_Container_Gravity gravity;
} Efl_Ui_Active_View_Container_Data;
#define MY_CLASS EFL_UI_ACTIVE_VIEW_CONTAINER_CLASS
@@ -67,6 +70,15 @@ _transition_end(Eo *obj EINA_UNUSED, Efl_Ui_Active_View_Container_Data *pd)
if (pd->prevent_transition_interaction) return;
+ if (pd->transition_done.content)
+ {
+ Eina_Value v = eina_value_object_init(pd->transition_done.content);
+ efl_pack_unpack(obj, pd->transition_done.content);
+ eina_promise_resolve(pd->transition_done.transition_done, v);
+ pd->transition_done.transition_done = NULL;
+ pd->transition_done.content = NULL;
+ }
+
ev.from = pd->show_request.from;
ev.to = pd->show_request.to;
efl_event_callback_call(obj, EFL_UI_ACTIVE_VIEW_EVENT_TRANSITION_END, &ev);
@@ -174,7 +186,6 @@ _efl_ui_active_view_container_efl_object_constructor(Eo *obj,
pd->fill_height = EINA_TRUE;
efl_ui_active_view_size_set(obj, EINA_SIZE2D(-1, -1));
- efl_ui_active_view_gravity_set(obj, EFL_UI_ACTIVE_VIEW_CONTAINER_GRAVITY_CONTENT);
elm_widget_can_focus_set(obj, EINA_FALSE);
@@ -255,25 +266,12 @@ _register_child(Eo *obj EINA_UNUSED, Efl_Ui_Active_View_Container_Data *pd, Efl_
return EINA_TRUE;
}
-
-EOLIAN static void
-_efl_ui_active_view_container_active_view_gravity_set(Eo *obj EINA_UNUSED, Efl_Ui_Active_View_Container_Data *pd, Efl_Ui_Active_View_Container_Gravity gravity)
-{
- pd->gravity = gravity;
-}
-
-EOLIAN static Efl_Ui_Active_View_Container_Gravity
-_efl_ui_active_view_container_active_view_gravity_get(const Eo *obj EINA_UNUSED, Efl_Ui_Active_View_Container_Data *pd)
-{
- return pd->gravity;
-}
-
static void
_update_internals(Eo *obj EINA_UNUSED, Efl_Ui_Active_View_Container_Data *pd, Efl_Gfx_Entity *subobj EINA_UNUSED, int index)
{
Eina_Bool curr_page_update = EINA_FALSE;
- if (pd->gravity == EFL_UI_ACTIVE_VIEW_CONTAINER_GRAVITY_CONTENT && pd->curr.page >= index)
+ if (pd->curr.page >= index)
{
pd->curr.page++;
curr_page_update = EINA_TRUE;
@@ -466,12 +464,10 @@ _unpack_all(Eo *obj EINA_UNUSED,
{
Eo *content = eina_list_data_get(pd->content_list);
- _unpack(obj, pd, content, 0);
-
if (clear)
efl_del(content);
-
- pd->content_list = eina_list_remove(pd->content_list, content);
+ else
+ _unpack(obj, pd, content, 0);
}
}
@@ -505,7 +501,8 @@ _unpack(Eo *obj,
pd->content_list = eina_list_remove(pd->content_list, subobj);
_elm_widget_sub_object_redirect_to_top(obj, subobj);
- if (pd->gravity == EFL_UI_ACTIVE_VIEW_CONTAINER_GRAVITY_CONTENT && index < pd->curr.page)
+ if (!efl_alive_get(obj)) return;
+ if (index < pd->curr.page)
pd->curr.page--;
if (pd->transition)
@@ -514,7 +511,7 @@ _unpack(Eo *obj,
efl_ui_active_view_indicator_content_del(pd->indicator, subobj, index);
//we deleted the current index
- if (pd->gravity == EFL_UI_ACTIVE_VIEW_CONTAINER_GRAVITY_CONTENT && early_curr_page == index)
+ if (early_curr_page == index)
{
int new_curr_page = MIN(MAX(early_curr_page, 0), (int)eina_list_count(pd->content_list) - 1);
//when we delete the active index and we are not updating the index,
@@ -651,4 +648,50 @@ _efl_ui_active_view_container_indicator_get(const Eo *obj EINA_UNUSED, Efl_Ui_Ac
return pd->indicator;
}
+EOLIAN static void
+_efl_ui_active_view_container_push(Eo *obj, Efl_Ui_Active_View_Container_Data *pd EINA_UNUSED, Efl_Gfx_Entity *view)
+{
+ int old_active_index = efl_ui_active_view_active_index_get(obj);
+
+ if (old_active_index == -1)
+ old_active_index = 0;
+
+ efl_pack_at(obj, view, old_active_index);
+ efl_ui_active_view_active_index_set(obj, old_active_index);
+}
+
+static Eina_Value
+_delete_obj(void *data EINA_UNUSED, const Eina_Value value, const Eina_Future *dead_future EINA_UNUSED)
+{
+ efl_del(eina_value_object_get(&value));
+
+ return EINA_VALUE_EMPTY;
+}
+
+EOLIAN static Eina_Future*
+_efl_ui_active_view_container_pop(Eo *obj, Efl_Ui_Active_View_Container_Data *pd, Eina_Bool del)
+{
+ Eina_Future *transition_done;
+ int new_index;
+
+ if (eina_list_count(pd->content_list) < 2)
+ new_index = -1;
+
+ new_index = efl_ui_active_view_active_index_get(obj) + 1;
+ if (new_index >= (int)eina_list_count(pd->content_list))
+ new_index -= 2;
+
+ pd->transition_done.content = efl_pack_content_get(obj, efl_ui_active_view_active_index_get(obj));
+ pd->transition_done.transition_done = efl_loop_promise_new(obj);
+
+ transition_done = eina_future_new(pd->transition_done.transition_done);
+ if (del)
+ transition_done = eina_future_then(transition_done, _delete_obj, NULL);
+
+ efl_ui_active_view_active_index_set(obj, new_index);
+
+ return transition_done;
+}
+
+
#include "efl_ui_active_view_container.eo.c"
diff --git a/src/lib/elementary/efl_ui_active_view_container.eo b/src/lib/elementary/efl_ui_active_view_container.eo
index 052e35808c..b4c46fee0d 100644
--- a/src/lib/elementary/efl_ui_active_view_container.eo
+++ b/src/lib/elementary/efl_ui_active_view_container.eo
@@ -4,15 +4,6 @@ struct @beta Efl.Ui.Active_View.Transition_Event {
to : int; [[The view index to where the transition is headed, -1 if not known.]]
}
-enum Efl.Ui.Active_View.Container_Gravity {
- [[This enum controls the behavior of @Efl.Ui.Active_View.Container.active_index when indices are
- shifted due to object addition or removal.]]
- content = 0, [[When a view is added or removed from the container, the @Efl.Ui.Active_View.Container.active_index will
- be adjusted as necessary so it points to the same view as before.]]
- index = 1, [[When a view is added or removed from the container, the @Efl.Ui.Active_View.Container.active_index will
- remain the same, possibly pointing to a different view.]]
-}
-
class @beta Efl.Ui.Active_View.Container extends Efl.Ui.Layout_Base implements Efl.Pack_Linear
{
[[The Active View widget is a container for other sub-widgets (views), where only one sub-widget is active at any given time.
@@ -51,27 +42,13 @@ class @beta Efl.Ui.Active_View.Container extends Efl.Ui.Layout_Base implements E
}
@property active_index {
[[Currently active view among all the views added to this widget.
-
+
Changing this value might trigger an animation.
]]
values {
index: int; [[Index of the active view, from 0 to the number of views - 1 (@Efl.Container.content_count - 1).]]
}
}
- @property active_view_gravity {
- [[When a new view is added to this widget, the indices for the previous views might change (for example,
- when adding a view at the beginning of the list with @Efl.Pack_Linear.pack_begin all previous view's indices are increased by one).
-
- This property controls whether the Active View should remain the same view as before (@Efl.Ui.Active_View.Container_Gravity.content)
- or if the Active View should be moved to the one with the same index as before (@Efl.Ui.Active_View.Container_Gravity.index).
-
- For example, @Efl.Ui.Active_View.Container_Gravity.index can be used to build a Stack, where @.active_index is always 0 and new
- views are pushed onto the stack with @Efl.Pack_Linear.pack_begin and popped from the stack with @Efl.Pack_Linear.pack_unpack_at 0.
- ]]
- values {
- gravity : Efl.Ui.Active_View.Container_Gravity; [[Active View behavior when adding new views. Default is @Efl.Ui.Active_View.Container_Gravity.content.]]
- }
- }
@property active_view_size {
[[The size to use when displaying the Active View. This is used by the @.view_manager to perform the rendering.
Views other than the Active one may or may not use this size.]]
@@ -79,6 +56,34 @@ class @beta Efl.Ui.Active_View.Container extends Efl.Ui.Layout_Base implements E
size: Eina.Size2D; [[Render size for the Active View. (-1, -1) means that all available space inside the container is used.]]
}
}
+ push @beta {
+ [[Packs a new view at the position indicated by @.active_index (0 by default).
+
+ This is the same behavior as a push operation on a stack.
+
+ An animation might be triggered to make the new active view come into position.
+ ]]
+ params {
+ view : Efl.Gfx.Entity; [[View to add and set to be the active view.]]
+ }
+ }
+ pop @beta {
+ [[Removes the active view from the widget.
+
+ The views behind it naturally flow down so the next one becomes the active view. This is the same behavior as a pop operation on a stack.
+ When combined with @.push you don't have to worry about @.active_index since only the first view is manipulated.
+
+ An animation might be triggered to make the new active view come into position and the old one disappear.
+
+ The removed view can be returned to the caller or deleted (depending on $delete_on_transition_end).
+ ]]
+ params {
+ deletion_on_transition_end : bool; [[ if $true, then the object will be deleted before resolving the future, and a NULL pointer is the value of the future. $false if no operation should be applied to it]]
+ }
+ return : future<Efl.Gfx.Entity>; [[ This Future gets resolved when any transition animation finishes and the popped view is ready for collection.
+ If there is no animation, the Future resolves immediately.
+ If $deletion_on_transition_end is $true then this widget will destroy the popped view and the Future will contain no Value. Otherwise, the caller becomes the owner of the view contained in the Future and must dispose of it appropriately. ]]
+ }
}
events {
transition,start : Efl.Ui.Active_View.Transition_Event; [[A transition animation has started.]]
diff --git a/src/lib/elementary/efl_ui_active_view_util.c b/src/lib/elementary/efl_ui_active_view_util.c
new file mode 100644
index 0000000000..eaf8b48cec
--- /dev/null
+++ b/src/lib/elementary/efl_ui_active_view_util.c
@@ -0,0 +1,21 @@
+#ifdef HAVE_CONFIG_H
+# include "elementary_config.h"
+#endif
+
+#include <Efl_Ui.h>
+#include "elm_priv.h"
+
+typedef struct {
+
+} Efl_Ui_Active_View_Util_Data;
+
+EOLIAN static Efl_Ui_Active_View_Container*
+_efl_ui_active_view_util_stack_gen(Efl_Ui_Widget *parent)
+{
+ Efl_Ui_Active_View_View_Manager *manager = efl_add(EFL_UI_ACTIVE_VIEW_VIEW_MANAGER_STACK_CLASS, parent);
+ return efl_add(EFL_UI_ACTIVE_VIEW_CONTAINER_CLASS, parent,
+ efl_ui_active_view_manager_set(efl_added, manager));
+}
+
+
+#include "efl_ui_active_view_util.eo.c"
diff --git a/src/lib/elementary/efl_ui_active_view_util.eo b/src/lib/elementary/efl_ui_active_view_util.eo
new file mode 100644
index 0000000000..1d7d57b58f
--- /dev/null
+++ b/src/lib/elementary/efl_ui_active_view_util.eo
@@ -0,0 +1,11 @@
+class @beta Efl.Ui.Active_View.Util {
+ methods {
+ stack_gen @class {
+ [[Get a preconfigured stack obejct]]
+ params {
+ parent : Efl.Ui.Widget;
+ }
+ return : Efl.Ui.Active_View.Container;
+ }
+ }
+}
diff --git a/src/lib/elementary/efl_ui_check.c b/src/lib/elementary/efl_ui_check.c
index e13577a407..a0f643870a 100644
--- a/src/lib/elementary/efl_ui_check.c
+++ b/src/lib/elementary/efl_ui_check.c
@@ -10,9 +10,7 @@
#include <Elementary.h>
#include "elm_priv.h"
-#include "efl_ui_nstate.eo.h"
#include "efl_ui_check_private.h"
-#include "efl_ui_nstate_private.h"
#include "elm_part_helper.h"
#define MY_CLASS EFL_UI_CHECK_CLASS
@@ -28,6 +26,12 @@ static const Elm_Layout_Part_Alias_Description _text_aliases[] =
{NULL, NULL}
};
+static const Elm_Layout_Part_Alias_Description _content_aliases[] =
+{
+ {"icon", "elm.swallow.content"},
+ {NULL, NULL}
+};
+
static const char SIG_CHANGED[] = "changed";
/* smart callbacks coming from elm check objects: */
@@ -50,26 +54,21 @@ static const Elm_Action key_actions[] = {
static void
_activate(Evas_Object *obj)
{
- EFL_UI_CHECK_DATA_GET(obj, sd);
-
- if (sd->statep) *sd->statep = !efl_ui_nstate_value_get(obj);
-
- // state will be changed to 1 by efl_ui_nstate_activate(obj)
- if (efl_ui_nstate_value_get(obj) == 0)
+ // state will be changed by the later call to the selected_set call
+ if (!efl_ui_check_selected_get(obj))
{
// FIXME: to do animation during state change , we need different signal
// so that we can distinguish between state change by user or state change
// by calling state_change() api. Keep both the signal for backward compatibility
// and remove "elm,state,check,on" signal emission when we can break ABI.
+ // efl_ui_check_selected_set below will emit "elm,state,check,*" or "efl,state,check,*"
if (elm_widget_is_legacy(obj))
{
elm_layout_signal_emit(obj, "elm,activate,check,on", "elm");
- elm_layout_signal_emit(obj, "elm,state,check,on", "elm");
}
else
{
elm_layout_signal_emit(obj, "efl,activate,check,on", "efl");
- elm_layout_signal_emit(obj, "efl,state,check,on", "efl");
}
if (_elm_config->access_mode != ELM_ACCESS_MODE_OFF)
@@ -81,27 +80,28 @@ _activate(Evas_Object *obj)
// so that we can distinguish between state change by user or state change
// by calling state_change() api. Keep both the signal for backward compatibility
// and remove "elm,state,check,off" signal emission when we can break ABI.
+ // efl_ui_check_selected_set below will emit "elm,state,check,*" or "efl,state,check,*"
if (elm_widget_is_legacy(obj))
{
elm_layout_signal_emit(obj, "elm,activate,check,off", "elm");
- elm_layout_signal_emit(obj, "elm,state,check,off", "elm");
}
else
{
elm_layout_signal_emit(obj, "efl,activate,check,off", "efl");
- elm_layout_signal_emit(obj, "efl,state,check,off", "efl");
}
if (_elm_config->access_mode != ELM_ACCESS_MODE_OFF)
_elm_access_say(E_("State: Off"));
}
-
- efl_ui_nstate_activate(obj);
+ //This commit will update the theme with the correct signals
+ // "elm,state,check,on" or "elm,state,check,off" for legacy
+ // "efl,state,check,on" or "efl,state,check,off" for eo-api
+ efl_ui_check_selected_set(obj, !efl_ui_check_selected_get(obj));
if (_elm_config->atspi_mode)
efl_access_state_changed_signal_emit(obj,
EFL_ACCESS_STATE_TYPE_CHECKED,
- efl_ui_nstate_value_get(obj));
+ efl_ui_check_selected_get(obj));
}
EOLIAN static Efl_Access_State_Set
@@ -147,14 +147,14 @@ _efl_ui_check_efl_ui_widget_theme_apply(Eo *obj, Efl_Ui_Check_Data *sd EINA_UNUS
if (elm_widget_is_legacy(obj))
{
- if (efl_ui_nstate_value_get(obj) == 0)
+ if (!efl_ui_check_selected_get(obj))
elm_layout_signal_emit(obj, "elm,state,check,off", "elm");
else
elm_layout_signal_emit(obj, "elm,state,check,on", "elm");
}
else
{
- if (efl_ui_nstate_value_get(obj) == 0)
+ if (!efl_ui_check_selected_get(obj))
elm_layout_signal_emit(obj, "efl,state,check,off", "efl");
else
elm_layout_signal_emit(obj, "efl,state,check,on", "efl");
@@ -185,7 +185,7 @@ _access_state_cb(void *data, Evas_Object *obj)
if (elm_widget_disabled_get(obj))
return strdup(E_("State: Disabled"));
- if (efl_ui_nstate_value_get(obj))
+ if (efl_ui_check_selected_get(obj))
{
on_text = elm_layout_text_get(data, "on");
@@ -213,6 +213,17 @@ _access_state_cb(void *data, Evas_Object *obj)
}
static void
+_flush_selected(Eo *obj, Eina_Bool sel)
+{
+ efl_ui_check_selected_set(obj, sel);
+
+ if (_elm_config->atspi_mode)
+ efl_access_state_changed_signal_emit(obj,
+ EFL_ACCESS_STATE_TYPE_CHECKED,
+ efl_ui_check_selected_get(obj));
+}
+
+static void
_on_check_off(void *data,
Evas_Object *o EINA_UNUSED,
const char *emission EINA_UNUSED,
@@ -220,21 +231,7 @@ _on_check_off(void *data,
{
Evas_Object *obj = data;
- EFL_UI_CHECK_DATA_GET(obj, sd);
-
- if (sd->statep) *sd->statep = 0;
-
- if (elm_widget_is_legacy(obj))
- elm_layout_signal_emit(obj, "elm,state,check,off", "elm");
- else
- elm_layout_signal_emit(obj, "efl,state,check,off", "efl");
-
- efl_ui_nstate_value_set(obj, 0);
-
- if (_elm_config->atspi_mode)
- efl_access_state_changed_signal_emit(data,
- EFL_ACCESS_STATE_TYPE_CHECKED,
- efl_ui_nstate_value_get(obj));
+ _flush_selected(obj, EINA_FALSE);
}
static void
@@ -245,21 +242,7 @@ _on_check_on(void *data,
{
Evas_Object *obj = data;
- EFL_UI_CHECK_DATA_GET(obj, sd);
-
- if (sd->statep) *sd->statep = 1;
-
- if (elm_widget_is_legacy(obj))
- elm_layout_signal_emit(obj, "elm,state,check,on", "elm");
- else
- elm_layout_signal_emit(obj, "efl,state,check,on", "efl");
-
- efl_ui_nstate_value_set(obj, 1);
-
- if (_elm_config->atspi_mode)
- efl_access_state_changed_signal_emit(data,
- EFL_ACCESS_STATE_TYPE_CHECKED,
- efl_ui_nstate_value_get(obj));
+ _flush_selected(obj, EINA_TRUE);
}
static void
@@ -272,17 +255,23 @@ _on_check_toggle(void *data,
}
EOLIAN static Eina_Bool
-_efl_ui_check_selected_get(const Eo *obj, Efl_Ui_Check_Data *pd EINA_UNUSED)
+_efl_ui_check_selected_get(const Eo *obj EINA_UNUSED, Efl_Ui_Check_Data *pd EINA_UNUSED)
{
- return !!efl_ui_nstate_value_get(obj);
+ return pd->selected;
}
EOLIAN static void
-_efl_ui_check_selected_set(Eo *obj, Efl_Ui_Check_Data *sd, Eina_Bool value)
+_efl_ui_check_selected_set(Eo *obj, Efl_Ui_Check_Data *pd, Eina_Bool value)
{
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
- if (sd->statep) *sd->statep = value;
+ if (pd->selected == value) return;
+
+ if (elm_widget_is_legacy(obj))
+ {
+ if (pd->statep)
+ *pd->statep = value;
+ }
if (elm_widget_is_legacy(obj))
{
@@ -301,16 +290,12 @@ _efl_ui_check_selected_set(Eo *obj, Efl_Ui_Check_Data *sd, Eina_Bool value)
edje_object_message_signal_process(wd->resize_obj);
- efl_ui_nstate_value_set(obj, value);
-}
+ pd->selected = value;
-EOLIAN static void
-_efl_ui_check_efl_ui_nstate_value_set(Eo *obj, Efl_Ui_Check_Data *pd EINA_UNUSED, int state)
-{
- Eina_Bool _state = !!state;
- if (_state == efl_ui_nstate_value_get(obj)) return;
-
- efl_ui_nstate_value_set(efl_super(obj, MY_CLASS), _state);
+ if (elm_widget_is_legacy(obj))
+ evas_object_smart_callback_call(obj, "changed", NULL);
+ else
+ efl_event_callback_call(obj, EFL_UI_CHECK_EVENT_SELECTED_CHANGED, &pd->selected);
}
EOLIAN static Eo *
@@ -360,43 +345,21 @@ EAPI void
elm_check_state_set(Evas_Object *obj, Eina_Bool state)
{
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
- EFL_UI_NSTATE_DATA_GET_OR_RETURN(obj, nd);
EFL_UI_CHECK_DATA_GET_OR_RETURN(obj, sd);
- if (state != nd->state)
- {
- nd->state = state;
- if (sd->statep) *sd->statep = state;
-
- if (elm_widget_is_legacy(obj))
- {
- if (state == 1)
- elm_layout_signal_emit(obj, "elm,state,check,on", "elm");
- else
- elm_layout_signal_emit(obj, "elm,state,check,off", "elm");
- }
- else
- {
- if (state == 1)
- elm_layout_signal_emit(obj, "efl,state,check,on", "efl");
- else
- elm_layout_signal_emit(obj, "efl,state,check,off", "efl");
- }
- edje_object_message_signal_process(wd->resize_obj);
- }
+ efl_ui_check_selected_set(obj, state);
}
EAPI Eina_Bool
elm_check_state_get(const Evas_Object *obj)
{
- return !!efl_ui_nstate_value_get(obj);
+ return !!efl_ui_check_selected_get(obj);
}
EAPI void
elm_check_state_pointer_set(Eo *obj, Eina_Bool *statep)
{
EFL_UI_CHECK_DATA_GET_OR_RETURN(obj, sd);
- EFL_UI_NSTATE_DATA_GET_OR_RETURN(obj, nd);
if (!statep)
{
@@ -405,24 +368,9 @@ elm_check_state_pointer_set(Eo *obj, Eina_Bool *statep)
}
sd->statep = statep;
- if (*sd->statep != nd->state)
+ if (*sd->statep != sd->selected)
{
- nd->state = *sd->statep;
-
- if (elm_widget_is_legacy(obj))
- {
- if (nd->state == 1)
- elm_layout_signal_emit(obj, "elm,state,check,on", "elm");
- else
- elm_layout_signal_emit(obj, "elm,state,check,off", "elm");
- }
- else
- {
- if (nd->state == 1)
- elm_layout_signal_emit(obj, "efl,state,check,on", "efl");
- else
- elm_layout_signal_emit(obj, "efl,state,check,off", "efl");
- }
+ efl_ui_check_selected_set(obj, *sd->statep);
}
}
@@ -439,14 +387,19 @@ _efl_ui_check_efl_access_widget_action_elm_actions_get(const Eo *obj EINA_UNUSED
/* Standard widget overrides */
ELM_WIDGET_KEY_DOWN_DEFAULT_IMPLEMENT(efl_ui_check, Efl_Ui_Check_Data)
+ELM_PART_TEXT_DEFAULT_IMPLEMENT(efl_ui_check, Efl_Ui_Check_Data)
+ELM_PART_CONTENT_DEFAULT_IMPLEMENT(efl_ui_check, Efl_Ui_Check_Data)
+ELM_LAYOUT_CONTENT_ALIASES_IMPLEMENT(MY_CLASS_PFX)
/* Internal EO APIs and hidden overrides */
ELM_LAYOUT_TEXT_ALIASES_IMPLEMENT(MY_CLASS_PFX)
#define EFL_UI_CHECK_EXTRA_OPS \
+ ELM_LAYOUT_CONTENT_ALIASES_OPS(MY_CLASS_PFX), \
ELM_LAYOUT_TEXT_ALIASES_OPS(MY_CLASS_PFX)
+
#include "efl_ui_check.eo.c"
#include "efl_ui_check_eo.legacy.c"
diff --git a/src/lib/elementary/efl_ui_check.eo b/src/lib/elementary/efl_ui_check.eo
index 5bd3d187e1..95d1635054 100644
--- a/src/lib/elementary/efl_ui_check.eo
+++ b/src/lib/elementary/efl_ui_check.eo
@@ -1,4 +1,4 @@
-class @beta Efl.Ui.Check extends Efl.Ui.Nstate implements Efl.Access.Widget.Action
+class @beta Efl.Ui.Check extends Efl.Ui.Layout_Base implements Efl.Access.Widget.Action, Efl.Text, Efl.Content
{
[[Check widget
@@ -24,8 +24,14 @@ class @beta Efl.Ui.Check extends Efl.Ui.Nstate implements Efl.Access.Widget.Acti
Efl.Ui.Widget.on_access_activate;
Efl.Ui.Widget.theme_apply;
Efl.Ui.Widget.widget_input_event_handler;
- Efl.Ui.Nstate.value { set; }
Efl.Access.Object.state_set { get; }
Efl.Access.Widget.Action.elm_actions { get; }
+ Efl.Content.content { get; set; }
+ Efl.Content.content_unset;
+ Efl.Text.text { get; set; }
+ Efl.Ui.L10n.l10n_text { get; set; }
+ }
+ events {
+ selected,changed : bool; [[Emitted each time selected has changed]]
}
}
diff --git a/src/lib/elementary/efl_ui_check_private.h b/src/lib/elementary/efl_ui_check_private.h
index e44c6035e4..82031b28fe 100644
--- a/src/lib/elementary/efl_ui_check_private.h
+++ b/src/lib/elementary/efl_ui_check_private.h
@@ -27,6 +27,7 @@ typedef struct _Efl_Ui_Check_Data Efl_Ui_Check_Data;
struct _Efl_Ui_Check_Data
{
Eina_Bool *statep;
+ Eina_Bool selected;
};
/**
diff --git a/src/lib/elementary/efl_ui_datepicker.c b/src/lib/elementary/efl_ui_datepicker.c
index 671822fca9..810c9bc4c4 100644
--- a/src/lib/elementary/efl_ui_datepicker.c
+++ b/src/lib/elementary/efl_ui_datepicker.c
@@ -133,7 +133,7 @@ _field_changed_cb(void *data, const Efl_Event *ev)
if (!(ev->object == pd->day))
{
max_day = _max_days_get((pd->cur_date[DATEPICKER_YEAR] - 1900), (pd->cur_date[DATEPICKER_MONTH] - 1));
- efl_ui_range_min_max_set(pd->day, 1, max_day);
+ efl_ui_range_limits_set(pd->day, 1, max_day);
}
if (_validate_date_limits(pd->cur_date, pd->min_date, EINA_FALSE) ||
@@ -160,21 +160,21 @@ _fields_init(Eo *obj)
//Field create.
pd->year = efl_add(EFL_UI_SPIN_BUTTON_CLASS, obj,
- efl_ui_range_min_max_set(efl_added, 1970, 2037),
+ efl_ui_range_limits_set(efl_added, 1970, 2037),
efl_ui_spin_button_circulate_set(efl_added, EINA_TRUE),
efl_ui_spin_button_editable_set(efl_added, EINA_TRUE),
efl_ui_layout_orientation_set(efl_added, EFL_UI_LAYOUT_ORIENTATION_VERTICAL),
efl_event_callback_add(efl_added, EFL_UI_SPIN_EVENT_CHANGED,_field_changed_cb, obj));
pd->month = efl_add(EFL_UI_SPIN_BUTTON_CLASS, obj,
- efl_ui_range_min_max_set(efl_added, 1, 12),
+ efl_ui_range_limits_set(efl_added, 1, 12),
efl_ui_spin_button_circulate_set(efl_added, EINA_TRUE),
efl_ui_spin_button_editable_set(efl_added, EINA_TRUE),
efl_ui_layout_orientation_set(efl_added, EFL_UI_LAYOUT_ORIENTATION_VERTICAL),
efl_event_callback_add(efl_added, EFL_UI_SPIN_EVENT_CHANGED,_field_changed_cb, obj));
pd->day = efl_add(EFL_UI_SPIN_BUTTON_CLASS, obj,
- efl_ui_range_min_max_set(efl_added, 1, 31),
+ efl_ui_range_limits_set(efl_added, 1, 31),
efl_ui_spin_button_circulate_set(efl_added, EINA_TRUE),
efl_ui_spin_button_editable_set(efl_added, EINA_TRUE),
efl_ui_layout_orientation_set(efl_added, EFL_UI_LAYOUT_ORIENTATION_VERTICAL),
diff --git a/src/lib/elementary/efl_ui_navigation_bar.c b/src/lib/elementary/efl_ui_navigation_bar.c
index 6df57fd461..8f893eb304 100644
--- a/src/lib/elementary/efl_ui_navigation_bar.c
+++ b/src/lib/elementary/efl_ui_navigation_bar.c
@@ -19,14 +19,14 @@ _back_button_clicked_cb(void *data, const Efl_Event *ev EINA_UNUSED)
{
Eo *navigation_bar = data;
- Eo *stack = efl_provider_find(navigation_bar, EFL_UI_STACK_CLASS);
- if (!stack)
+ Eo *active_view = efl_provider_find(navigation_bar, EFL_UI_ACTIVE_VIEW_CONTAINER_CLASS);
+ if (!active_view)
{
- ERR("Cannot find EFL_UI_STACK_CLASS instance!");
+ ERR("Cannot find EFL_UI_ACTIVE_VIEW_CONTAINER_CLASS instance!");
return;
}
- efl_ui_stack_pop(stack);
+ efl_ui_active_view_pop(active_view, EINA_TRUE);
}
EOLIAN static Eo *
diff --git a/src/lib/elementary/efl_ui_progressbar.c b/src/lib/elementary/efl_ui_progressbar.c
index d7034b1167..ce48253169 100644
--- a/src/lib/elementary/efl_ui_progressbar.c
+++ b/src/lib/elementary/efl_ui_progressbar.c
@@ -414,7 +414,7 @@ _efl_ui_progressbar_efl_object_constructor(Eo *obj, Efl_Ui_Progressbar_Data *_pd
obj = efl_constructor(efl_super(obj, MY_CLASS));
evas_object_smart_callbacks_descriptions_set(obj, _smart_callbacks);
efl_access_object_role_set(obj, EFL_ACCESS_ROLE_PROGRESS_BAR);
- efl_ui_range_min_max_set(obj, 0.0, 1.0);
+ efl_ui_range_limits_set(obj, 0.0, 1.0);
return obj;
}
@@ -540,7 +540,7 @@ _progressbar_part_value_set(Eo *obj, Efl_Ui_Progressbar_Data *sd, const char *pa
Eina_Bool is_cur_progressbar = !strcmp(part_name, curprogresspart[elm_widget_is_legacy(obj)]);
if ((!is_cur_progressbar) || sd->has_cur_progressbar_part)
- efl_ui_range_min_max_get(efl_part(obj, part_name), &min, &max);
+ efl_ui_range_limits_get(efl_part(obj, part_name), &min, &max);
if (val < min) val = min;
if (val > max) val = max;
@@ -666,7 +666,7 @@ _efl_ui_progressbar_pulse_get(const Eo *obj EINA_UNUSED, Efl_Ui_Progressbar_Data
}
EOLIAN static void
-_efl_ui_progressbar_efl_ui_range_display_range_min_max_set(Eo *obj, Efl_Ui_Progressbar_Data *sd, double min, double max)
+_efl_ui_progressbar_efl_ui_range_display_range_limits_set(Eo *obj, Efl_Ui_Progressbar_Data *sd, double min, double max)
{
if (elm_widget_is_legacy(obj))
_progress_part_min_max_set(obj, sd, "elm.cur.progressbar", min, max);
@@ -675,7 +675,7 @@ _efl_ui_progressbar_efl_ui_range_display_range_min_max_set(Eo *obj, Efl_Ui_Progr
}
EOLIAN static void
-_efl_ui_progressbar_efl_ui_range_display_range_min_max_get(const Eo *obj EINA_UNUSED, Efl_Ui_Progressbar_Data *sd, double *min, double *max)
+_efl_ui_progressbar_efl_ui_range_display_range_limits_get(const Eo *obj EINA_UNUSED, Efl_Ui_Progressbar_Data *sd, double *min, double *max)
{
if (min) *min = sd->val_min;
if (max) *max = sd->val_max;
@@ -721,7 +721,7 @@ _efl_ui_progressbar_efl_access_value_value_and_text_get(const Eo *obj EINA_UNUSE
}
EOLIAN static void
-_efl_ui_progressbar_part_efl_ui_range_display_range_min_max_set(Eo *obj, void *_pd EINA_UNUSED, double min, double max)
+_efl_ui_progressbar_part_efl_ui_range_display_range_limits_set(Eo *obj, void *_pd EINA_UNUSED, double min, double max)
{
Elm_Part_Data *pd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS);
Efl_Ui_Progressbar_Data *sd = efl_data_scope_get(pd->obj, EFL_UI_PROGRESSBAR_CLASS);
@@ -730,7 +730,7 @@ _efl_ui_progressbar_part_efl_ui_range_display_range_min_max_set(Eo *obj, void *_
}
EOLIAN static void
-_efl_ui_progressbar_part_efl_ui_range_display_range_min_max_get(const Eo *obj, void *_pd EINA_UNUSED, double *min, double *max)
+_efl_ui_progressbar_part_efl_ui_range_display_range_limits_get(const Eo *obj, void *_pd EINA_UNUSED, double *min, double *max)
{
Efl_Ui_Progress_Status *ps;
Eina_List *l;
diff --git a/src/lib/elementary/efl_ui_progressbar.eo b/src/lib/elementary/efl_ui_progressbar.eo
index f770709d96..a26ba6742f 100644
--- a/src/lib/elementary/efl_ui_progressbar.eo
+++ b/src/lib/elementary/efl_ui_progressbar.eo
@@ -46,7 +46,7 @@ class @beta Efl.Ui.Progressbar extends Efl.Ui.Layout_Base implements Efl.Ui.Rang
Efl.Object.constructor;
Efl.Ui.Widget.theme_apply;
Efl.Ui.Range_Display.range_value { get; set; }
- Efl.Ui.Range_Display.range_min_max {get; set; }
+ Efl.Ui.Range_Display.range_limits {get; set; }
Efl.Ui.Layout_Orientable.orientation { get; set; }
Efl.Ui.Format.format_cb { set; }
Efl.Part.part_get;
diff --git a/src/lib/elementary/efl_ui_progressbar_part.eo b/src/lib/elementary/efl_ui_progressbar_part.eo
index b80177dd16..212c427f47 100644
--- a/src/lib/elementary/efl_ui_progressbar_part.eo
+++ b/src/lib/elementary/efl_ui_progressbar_part.eo
@@ -4,6 +4,6 @@ class @beta Efl.Ui.Progressbar_Part extends Efl.Ui.Layout_Part implements Efl.Ui
data: null;
implements {
Efl.Ui.Range_Display.range_value { set; get; }
- Efl.Ui.Range_Display.range_min_max {get; set; }
+ Efl.Ui.Range_Display.range_limits {get; set; }
}
}
diff --git a/src/lib/elementary/efl_ui_radio.c b/src/lib/elementary/efl_ui_radio.c
index 565a80e13c..c38c9fadc7 100644
--- a/src/lib/elementary/efl_ui_radio.c
+++ b/src/lib/elementary/efl_ui_radio.c
@@ -43,57 +43,49 @@ static const Elm_Action key_actions[] = {
};
static void
-_state_set(Evas_Object *obj, Eina_Bool state, Eina_Bool activate)
+_radio_widget_signal_emit(Evas_Object *obj, const char *middle_term)
{
- ELM_RADIO_DATA_GET(obj, sd);
+ const char *source, *state;
+ char path[PATH_MAX];
+
+ if (elm_widget_is_legacy(obj))
+ source = "elm";
+ else
+ source = "efl";
+
+ if (efl_ui_check_selected_get(obj))
+ state = "on";
+ else
+ state = "off";
+
+ snprintf(path, sizeof(path), "%s,%s,%s", source, middle_term, state);
+ elm_layout_signal_emit(obj, path, source);
+}
+
+static void
+_efl_ui_radio_efl_ui_check_selected_set(Eo *obj, Efl_Ui_Radio_Data *pd EINA_UNUSED, Eina_Bool value)
+{
+ if (value == efl_ui_check_selected_get(obj)) return;
+ efl_ui_check_selected_set(efl_super(obj, MY_CLASS), value);
- if (state != sd->state)
+ _radio_widget_signal_emit(obj, "state,radio");
+
+ if (_elm_config->atspi_mode)
{
- sd->state = state;
- if (sd->state)
- {
- // FIXME: to do animation during state change , we need different signal
- // so that we can distinguish between state change by user or state change
- // by calling state_change() api. Keep both the signal for backward compatibility
- // and only emit "elm,state,radio,on" when activate is false when we can break ABI.
- if (elm_widget_is_legacy(obj))
- {
- if (activate) elm_layout_signal_emit(obj, "elm,activate,radio,on", "elm");
- elm_layout_signal_emit(obj, "elm,state,radio,on", "elm");
- }
- else
- {
- if (activate) elm_layout_signal_emit(obj, "efl,activate,radio,on", "efl");
- elm_layout_signal_emit(obj, "efl,state,radio,on", "efl");
- }
- }
- else
- {
- // FIXME: to do animation during state change , we need different signal
- // so that we can distinguish between state change by user or state change
- // by calling state_change() api. Keep both the signal for backward compatibility
- // and only emit "elm,state,radio,off"when activate is false when we can break ABI.
- if (elm_widget_is_legacy(obj))
- {
- if (activate) elm_layout_signal_emit(obj, "elm,activate,radio,off", "elm");
- elm_layout_signal_emit(obj, "elm,state,radio,off", "elm");
- }
- else
- {
- if (activate) elm_layout_signal_emit(obj, "efl,activate,radio,off", "efl");
- elm_layout_signal_emit(obj, "efl,state,radio,off", "efl");
- }
- }
- if (_elm_config->atspi_mode)
+ if (efl_ui_check_selected_get(obj))
{
- if (sd->state)
- {
- efl_access_state_changed_signal_emit(obj, EFL_ACCESS_STATE_TYPE_CHECKED, EINA_TRUE);
- }
+ efl_access_state_changed_signal_emit(obj, EFL_ACCESS_STATE_TYPE_CHECKED, EINA_TRUE);
}
}
}
+
+static void
+_activate_state_emit(Evas_Object *obj)
+{
+ _radio_widget_signal_emit(obj, "activate,radio");
+}
+
static void
_state_set_all(Efl_Ui_Radio_Data *sd, Eina_Bool activate)
{
@@ -105,16 +97,25 @@ _state_set_all(Efl_Ui_Radio_Data *sd, Eina_Bool activate)
{
ELM_RADIO_DATA_GET(child, sdc);
- if (sdc->state) selected = child;
+ if (efl_ui_check_selected_get(child)) selected = child;
if (sdc->value == sd->group->value)
{
- _state_set(child, EINA_TRUE, activate);
- if (!sdc->state) disabled = EINA_TRUE;
+ if (activate) _activate_state_emit(child);
+ efl_ui_check_selected_set(child, EINA_TRUE);
+ if (!efl_ui_check_selected_get(child)) disabled = EINA_TRUE;
+ }
+ else
+ {
+ if (activate) _activate_state_emit(child);
+ efl_ui_check_selected_set(child, EINA_FALSE);
}
- else _state_set(child, EINA_FALSE, activate);
}
- if ((disabled) && (selected)) _state_set(selected, 1, activate);
+ if ((disabled) && (selected))
+ {
+ if (activate) _activate_state_emit(selected);
+ efl_ui_check_selected_set(selected, EINA_TRUE);
+ }
}
static void
@@ -122,21 +123,27 @@ _activate(Evas_Object *obj)
{
ELM_RADIO_DATA_GET(obj, sd);
- if (sd->group->value == sd->value) return;
-
- if ((!_elm_config->access_mode) ||
- (_elm_access_2nd_click_timeout(obj)))
+ if (elm_widget_is_legacy(obj))
{
- sd->group->value = sd->value;
- if (sd->group->valuep) *(sd->group->valuep) = sd->group->value;
+ //in legacy, group is handeled by the widget
+ if (sd->group->value == sd->value) return;
- _state_set_all(sd, EINA_TRUE);
+ if ((!_elm_config->access_mode) ||
+ (_elm_access_2nd_click_timeout(obj)))
+ {
+ sd->group->value = sd->value;
+ if (sd->group->valuep) *(sd->group->valuep) = sd->group->value;
- if (_elm_config->access_mode)
- _elm_access_say(E_("State: On"));
- efl_event_callback_legacy_call
- (obj, EFL_UI_RADIO_EVENT_CHANGED, NULL);
+ _state_set_all(sd, EINA_TRUE);
+ if (_elm_config->access_mode)
+ _elm_access_say(E_("State: On"));
+ }
+ }
+ else
+ {
+ //in new API, we just toggle the state of the widget, rest will be automatically handled
+ efl_ui_check_selected_set(obj, !efl_ui_check_selected_get(obj));
}
}
@@ -148,7 +155,7 @@ _key_action_activate(Evas_Object *obj, const char *params EINA_UNUSED)
}
EOLIAN static Eina_Error
-_efl_ui_radio_efl_ui_widget_theme_apply(Eo *obj, Efl_Ui_Radio_Data *sd)
+_efl_ui_radio_efl_ui_widget_theme_apply(Eo *obj, Efl_Ui_Radio_Data *sd EINA_UNUSED)
{
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EFL_UI_THEME_APPLY_ERROR_GENERIC);
Eina_Error int_ret = EFL_UI_THEME_APPLY_ERROR_GENERIC;
@@ -157,12 +164,12 @@ _efl_ui_radio_efl_ui_widget_theme_apply(Eo *obj, Efl_Ui_Radio_Data *sd)
if (elm_widget_is_legacy(obj))
{
- if (sd->state) elm_layout_signal_emit(obj, "elm,state,radio,on", "elm");
+ if (efl_ui_check_selected_get(obj)) elm_layout_signal_emit(obj, "elm,state,radio,on", "elm");
else elm_layout_signal_emit(obj, "elm,state,radio,off", "elm");
}
else
{
- if (sd->state) elm_layout_signal_emit(obj, "efl,state,radio,on", "efl");
+ if (efl_ui_check_selected_get(obj)) elm_layout_signal_emit(obj, "efl,state,radio,on", "efl");
else elm_layout_signal_emit(obj, "efl,state,radio,off", "efl");
}
@@ -196,10 +203,8 @@ _access_info_cb(void *data EINA_UNUSED, Evas_Object *obj)
static char *
_access_state_cb(void *data EINA_UNUSED, Evas_Object *obj)
{
- ELM_RADIO_DATA_GET(obj, sd);
-
if (elm_widget_disabled_get(obj)) return strdup(E_("State: Disabled"));
- if (sd->state) return strdup(E_("State: On"));
+ if (efl_ui_check_selected_get(obj)) return strdup(E_("State: On"));
return strdup(E_("State: Off"));
}
@@ -221,8 +226,11 @@ _efl_ui_radio_efl_object_constructor(Eo *obj, Efl_Ui_Radio_Data *pd)
elm_layout_signal_callback_add
(obj, "efl,action,radio,toggle", "*", _radio_on_cb, obj);
- pd->group = calloc(1, sizeof(Group));
- pd->group->radios = eina_list_append(pd->group->radios, obj);
+ if (elm_widget_is_legacy(obj))
+ {
+ pd->group = calloc(1, sizeof(Group));
+ pd->group->radios = eina_list_append(pd->group->radios, obj);
+ }
elm_layout_sizing_eval(obj);
@@ -240,43 +248,24 @@ _efl_ui_radio_efl_object_constructor(Eo *obj, Efl_Ui_Radio_Data *pd)
EOLIAN static void
_efl_ui_radio_efl_object_destructor(Eo *obj EINA_UNUSED, Efl_Ui_Radio_Data *pd)
{
- pd->group->radios = eina_list_remove(pd->group->radios, obj);
- if (!pd->group->radios) free(pd->group);
-
- efl_destructor(efl_super(obj, MY_CLASS));
-}
-
-EOLIAN static void
-_efl_ui_radio_group_add(Eo *obj, Efl_Ui_Radio_Data *sd, Evas_Object *group)
-{
- ELM_RADIO_DATA_GET(group, sdg);
-
- if (!sdg)
- {
- if (eina_list_count(sd->group->radios) == 1) return;
- sd->group->radios = eina_list_remove(sd->group->radios, obj);
- sd->group = calloc(1, sizeof(Group));
- sd->group->radios = eina_list_append(sd->group->radios, obj);
- }
- else if (sd->group == sdg->group)
- return;
- else
+ if (elm_widget_is_legacy(obj))
{
- sd->group->radios = eina_list_remove(sd->group->radios, obj);
- if (!sd->group->radios) free(sd->group);
- sd->group = sdg->group;
- sd->group->radios = eina_list_append(sd->group->radios, obj);
+ pd->group->radios = eina_list_remove(pd->group->radios, obj);
+ if (!pd->group->radios) free(pd->group);
}
- if (sd->value == sd->group->value) _state_set(obj, EINA_TRUE, EINA_FALSE);
- else _state_set(obj, EINA_FALSE, EINA_FALSE);
+
+ efl_destructor(efl_super(obj, MY_CLASS));
}
EOLIAN static void
_efl_ui_radio_state_value_set(Eo *obj, Efl_Ui_Radio_Data *sd, int value)
{
sd->value = value;
- if (sd->value == sd->group->value) _state_set(obj, EINA_TRUE, EINA_FALSE);
- else _state_set(obj, EINA_FALSE, EINA_FALSE);
+ if (elm_widget_is_legacy(obj))
+ {
+ if (sd->value == sd->group->value) efl_ui_check_selected_set(obj, EINA_TRUE);
+ else efl_ui_check_selected_set(obj, EINA_FALSE);
+ }
}
EOLIAN static int
@@ -285,52 +274,6 @@ _efl_ui_radio_state_value_get(const Eo *obj EINA_UNUSED, Efl_Ui_Radio_Data *sd)
return sd->value;
}
-EOLIAN static void
-_efl_ui_radio_efl_ui_nstate_value_set(Eo *obj EINA_UNUSED, Efl_Ui_Radio_Data *sd, int value)
-{
- if (value == sd->group->value) return;
- sd->group->value = value;
- if (sd->group->valuep) *(sd->group->valuep) = sd->group->value;
- _state_set_all(sd, EINA_FALSE);
-}
-
-EOLIAN static int
-_efl_ui_radio_efl_ui_nstate_value_get(const Eo *obj EINA_UNUSED, Efl_Ui_Radio_Data *sd)
-{
- return sd->group->value;
-}
-
-EOLIAN static void
-_efl_ui_radio_value_pointer_set(Eo *obj EINA_UNUSED, Efl_Ui_Radio_Data *sd, int *valuep)
-{
- if (valuep)
- {
- sd->group->valuep = valuep;
- if (*(sd->group->valuep) != sd->group->value)
- {
- sd->group->value = *(sd->group->valuep);
- _state_set_all(sd, EINA_FALSE);
- }
- }
- else sd->group->valuep = NULL;
-}
-
-EOLIAN static Evas_Object*
-_efl_ui_radio_selected_object_get(const Eo *obj EINA_UNUSED, Efl_Ui_Radio_Data *sd)
-{
- Eina_List *l;
- Evas_Object *child;
-
- EINA_LIST_FOREACH(sd->group->radios, l, child)
- {
- ELM_RADIO_DATA_GET(child, sdc);
-
- if (sdc->value == sd->group->value) return child;
- }
-
- return NULL;
-}
-
EOLIAN static Eina_Bool
_efl_ui_radio_efl_ui_widget_on_access_activate(Eo *obj, Efl_Ui_Radio_Data *_pd EINA_UNUSED, Efl_Ui_Activate act)
{
@@ -373,6 +316,7 @@ ELM_LAYOUT_TEXT_ALIASES_IMPLEMENT(MY_CLASS_PFX)
ELM_LAYOUT_TEXT_ALIASES_OPS(MY_CLASS_PFX)
#include "efl_ui_radio.eo.c"
+#include "efl_ui_radio_group.eo.c"
#include "efl_ui_radio_eo.legacy.c"
#include "efl_ui_radio_legacy_eo.h"
@@ -486,13 +430,86 @@ elm_radio_add(Evas_Object *parent)
EAPI void
elm_radio_value_set(Evas_Object *obj, int value)
{
- efl_ui_nstate_value_set(obj, value);
+ EINA_SAFETY_ON_FALSE_RETURN(elm_widget_is_legacy(obj));
+ ELM_RADIO_DATA_GET(obj, sd);
+
+ if (value == sd->group->value) return;
+ sd->group->value = value;
+ if (sd->group->valuep) *(sd->group->valuep) = sd->group->value;
+ _state_set_all(sd, EINA_FALSE);
}
EAPI int
elm_radio_value_get(const Evas_Object *obj)
{
- return efl_ui_nstate_value_get(obj);
+ EINA_SAFETY_ON_FALSE_RETURN_VAL(elm_widget_is_legacy(obj), 0);
+ ELM_RADIO_DATA_GET(obj, sd);
+ return sd->group->value;
+}
+
+EAPI void
+elm_radio_value_pointer_set(Efl_Ui_Radio *obj, int *valuep)
+{
+ EINA_SAFETY_ON_FALSE_RETURN(elm_widget_is_legacy(obj));
+ ELM_RADIO_DATA_GET(obj, sd);
+
+ if (valuep)
+ {
+ sd->group->valuep = valuep;
+ if (*(sd->group->valuep) != sd->group->value)
+ {
+ sd->group->value = *(sd->group->valuep);
+ _state_set_all(sd, EINA_FALSE);
+ }
+ }
+ else sd->group->valuep = NULL;
+}
+
+EAPI Efl_Canvas_Object *
+elm_radio_selected_object_get(const Efl_Ui_Radio *obj)
+{
+ EINA_SAFETY_ON_FALSE_RETURN_VAL(elm_widget_is_legacy(obj), NULL);
+ ELM_RADIO_DATA_GET(obj, sd);
+
+ Eina_List *l;
+ Evas_Object *child;
+
+ EINA_LIST_FOREACH(sd->group->radios, l, child)
+ {
+ ELM_RADIO_DATA_GET(child, sdc);
+
+ if (sdc->value == sd->group->value) return child;
+ }
+
+ return NULL;
+}
+
+EAPI void
+elm_radio_group_add(Efl_Ui_Radio *obj, Efl_Ui_Radio *group)
+{
+ EINA_SAFETY_ON_FALSE_RETURN(elm_widget_is_legacy(obj));
+ EINA_SAFETY_ON_FALSE_RETURN(elm_widget_is_legacy(group));
+ ELM_RADIO_DATA_GET(group, sdg);
+ ELM_RADIO_DATA_GET(obj, sd);
+
+ if (!sdg)
+ {
+ if (eina_list_count(sd->group->radios) == 1) return;
+ sd->group->radios = eina_list_remove(sd->group->radios, obj);
+ sd->group = calloc(1, sizeof(Group));
+ sd->group->radios = eina_list_append(sd->group->radios, obj);
+ }
+ else if (sd->group == sdg->group)
+ return;
+ else
+ {
+ sd->group->radios = eina_list_remove(sd->group->radios, obj);
+ if (!sd->group->radios) free(sd->group);
+ sd->group = sdg->group;
+ sd->group->radios = eina_list_append(sd->group->radios, obj);
+ }
+ if (sd->value == sd->group->value) efl_ui_check_selected_set(obj, EINA_TRUE);
+ else efl_ui_check_selected_set(obj, EINA_FALSE);
}
#include "efl_ui_radio_legacy_eo.c"
diff --git a/src/lib/elementary/efl_ui_radio.eo b/src/lib/elementary/efl_ui_radio.eo
index 8dabfc7cfc..a19e42da61 100644
--- a/src/lib/elementary/efl_ui_radio.eo
+++ b/src/lib/elementary/efl_ui_radio.eo
@@ -1,59 +1,35 @@
-class @beta Efl.Ui.Radio extends Efl.Ui.Check implements Efl.Access.Widget.Action, Efl.Content
+class @beta Efl.Ui.Radio extends Efl.Ui.Check implements Efl.Access.Widget.Action
{
- [[Elementary radio class]]
- methods {
- @property state_value {
- set {
- [[Set the integer value that this radio object represents.
+ [[Elementary radio button class.
- This sets the value of the radio.
- ]]
- }
- get {
- [[Get the integer value that this radio object represents.
+ Radio buttons are like check boxes in that they can be either checked or unchecked.
+ However, radio buttons are always bunched together in groups, and only one button in
+ each group can be checked at any given time. Pressing a different button in the group
+ will automatically uncheck any previously checked button.
- This gets the value of the radio.
- ]]
- }
- values {
- value: int; [[The value to use if this radio object is selected.]]
- }
- }
- @property value_pointer {
- set {
- [[Set a convenience pointer to an integer, which changes when radio group
- value changes.
+ They are a common way to allow a user to select one option among a list.
- This sets a pointer to an integer that in addition to the radio
- object state will also be modified directly. To stop setting the
- object pointed to, simply use NULL as the valuep argument. If
- valuep is not NULL then when called, the radio object
- state will also be modified to reflect the value of the integer
- valuep points to, just like calling elm_radio_value_set().
- ]]
- }
- values {
- valuep: ptr(int); [[Pointer to the integer to modify]]
- }
- }
- @property selected_object {
- get {
- [[Get the selected radio object.]]
- return: Efl.Canvas.Object; [[The selected radio object]]
- }
- }
- group_add {
- [[Add this radio to a group of other radio objects
+ To handle button grouping, you can either use an @Efl.Ui.Radio_Group_Impl object or use more convenient widgets like @Efl.Ui.Radio_Box.
+ ]]
+ methods {
+ @property state_value {
+ [[Integer value that this radio button represents.
- Radio objects work in groups. Each member should have a different
- integer value assigned. In order to have them work as a group, they
- need to know about each other. This adds the given radio object to
- the group of which the group object indicated is a member.
- ]]
+ Each radio button in a group must have a unique value. The selected button in a group
+ can then be set or retrieved through the @Efl.Ui.Radio_Group.selected_value property.
+ This value is also informed through the @[Efl.Ui.Radio_Group.value,changed] event.
- params {
- @in group: Efl.Ui.Radio; [[Any radio object whose group the obj is
- to join.]]
+ All non-negative values are legal but keep in mind that 0 is the starting value for all new groups:
+ If no button in the group has this value, then no button in the group is initially
+ selected. -1 is the value that @Efl.Ui.Radio_Group.selected_value returns when no button
+ is selected and therefore cannot be used.
+ ]]
+ set {}
+ get {}
+ values {
+ value: int; [[The value to use when this radio button is selected.
+ Any value can be used but 0 and -1 have special meanings as described
+ above.]]
}
}
}
@@ -65,6 +41,6 @@ class @beta Efl.Ui.Radio extends Efl.Ui.Check implements Efl.Access.Widget.Actio
Efl.Ui.Widget.widget_input_event_handler;
Efl.Access.Object.state_set { get; }
Efl.Access.Widget.Action.elm_actions { get; }
- Efl.Ui.Nstate.value { set; get; }
+ Efl.Ui.Check.selected {set;}
}
}
diff --git a/src/lib/elementary/efl_ui_radio_box.c b/src/lib/elementary/efl_ui_radio_box.c
new file mode 100644
index 0000000000..b58e76f3fe
--- /dev/null
+++ b/src/lib/elementary/efl_ui_radio_box.c
@@ -0,0 +1,127 @@
+#ifdef HAVE_CONFIG_H
+# include "elementary_config.h"
+#endif
+
+#include <Elementary.h>
+#include "elm_priv.h"
+
+#define MY_CLASS EFL_UI_RADIO_BOX_CLASS
+
+typedef struct {
+ Eina_Bool in_pack;
+ Efl_Ui_Radio_Group *group;
+} Efl_Ui_Radio_Box_Data;
+
+static inline Eina_Bool
+register_safe_in_group_begin(Eo *subobj, Efl_Ui_Radio_Box_Data *pd)
+{
+ EINA_SAFETY_ON_FALSE_RETURN_VAL(efl_isa(subobj, EFL_UI_RADIO_CLASS), EINA_FALSE);
+ if (!pd->in_pack)
+ efl_ui_radio_group_register(pd->group, subobj);
+ pd->in_pack = EINA_TRUE;
+
+ return EINA_TRUE;
+}
+
+static inline Eina_Bool
+register_safe_group_end(Eo *subobj, Efl_Ui_Radio_Box_Data *pd, Eina_Bool result)
+{
+ if (!result)
+ efl_ui_radio_group_unregister(pd->group, subobj);
+ pd->in_pack = EINA_FALSE;
+
+ return result;
+}
+
+#define REGISTER_SAFE(f) \
+ Eina_Bool result; \
+ if (!register_safe_in_group_begin(subobj, pd)) \
+ return EINA_FALSE; \
+ result = f ; \
+ return register_safe_group_end(subobj, pd, result);
+
+static void
+unpack_from_logical(Eo *obj, Efl_Ui_Radio_Box_Data *pd)
+{
+ int length = efl_content_count(obj);
+ for (int i = 0; i < length; ++i)
+ {
+ efl_ui_radio_group_unregister(pd->group, efl_pack_content_get(obj, i));
+ }
+}
+
+EOLIAN static Eina_Bool
+_efl_ui_radio_box_efl_pack_pack_clear(Eo *obj, Efl_Ui_Radio_Box_Data *pd)
+{
+ unpack_from_logical(obj, pd);
+ return efl_pack_clear(efl_super(obj, MY_CLASS));
+}
+
+EOLIAN static Eina_Bool
+_efl_ui_radio_box_efl_pack_unpack_all(Eo *obj, Efl_Ui_Radio_Box_Data *pd)
+{
+ unpack_from_logical(obj, pd);
+ return efl_pack_unpack_all(efl_super(obj, MY_CLASS));
+}
+
+EOLIAN static Eina_Bool
+_efl_ui_radio_box_efl_pack_unpack(Eo *obj, Efl_Ui_Radio_Box_Data *pd, Efl_Gfx_Entity *subobj)
+{
+ efl_ui_radio_group_unregister(pd->group, subobj);
+ return efl_pack_unpack(efl_super(obj, MY_CLASS), subobj);
+}
+
+EOLIAN static Efl_Gfx_Entity*
+_efl_ui_radio_box_efl_pack_linear_pack_unpack_at(Eo *obj, Efl_Ui_Radio_Box_Data *pd, int index)
+{
+ efl_ui_radio_group_unregister(pd->group, efl_pack_content_get(obj, index));
+ return efl_pack_unpack_at(efl_super(obj, MY_CLASS), index);
+}
+
+EOLIAN static Eina_Bool
+_efl_ui_radio_box_efl_pack_pack(Eo *obj, Efl_Ui_Radio_Box_Data *pd, Efl_Gfx_Entity *subobj)
+{
+ REGISTER_SAFE(efl_pack(efl_super(obj, MY_CLASS), subobj))
+}
+
+EOLIAN static Eina_Bool
+_efl_ui_radio_box_efl_pack_linear_pack_begin(Eo *obj, Efl_Ui_Radio_Box_Data *pd, Efl_Gfx_Entity *subobj)
+{
+ REGISTER_SAFE(efl_pack_begin(efl_super(obj, MY_CLASS), subobj))
+}
+
+EOLIAN static Eina_Bool
+_efl_ui_radio_box_efl_pack_linear_pack_end(Eo *obj, Efl_Ui_Radio_Box_Data *pd, Efl_Gfx_Entity *subobj)
+{
+ REGISTER_SAFE(efl_pack_end(efl_super(obj, MY_CLASS), subobj))
+}
+
+EOLIAN static Eina_Bool
+_efl_ui_radio_box_efl_pack_linear_pack_before(Eo *obj, Efl_Ui_Radio_Box_Data *pd, Efl_Gfx_Entity *subobj, const Efl_Gfx_Entity *existing)
+{
+ REGISTER_SAFE(efl_pack_before(efl_super(obj, MY_CLASS), subobj, existing));
+}
+
+EOLIAN static Eina_Bool
+_efl_ui_radio_box_efl_pack_linear_pack_after(Eo *obj, Efl_Ui_Radio_Box_Data *pd, Efl_Gfx_Entity *subobj, const Efl_Gfx_Entity *existing)
+{
+ REGISTER_SAFE(efl_pack_after(efl_super(obj, MY_CLASS), subobj, existing));
+}
+
+EOLIAN static Eina_Bool
+_efl_ui_radio_box_efl_pack_linear_pack_at(Eo *obj, Efl_Ui_Radio_Box_Data *pd, Efl_Gfx_Entity *subobj, int index)
+{
+ REGISTER_SAFE(efl_pack_at(efl_super(obj, MY_CLASS), subobj, index));
+}
+
+EOLIAN static Efl_Object*
+_efl_ui_radio_box_efl_object_constructor(Eo *obj, Efl_Ui_Radio_Box_Data *pd)
+{
+ pd->group = efl_new(EFL_UI_RADIO_GROUP_IMPL_CLASS, NULL);
+ efl_composite_attach(obj, pd->group);
+ efl_event_callback_forwarder_add(pd->group, EFL_UI_RADIO_GROUP_EVENT_VALUE_CHANGED, obj);
+ return efl_constructor(efl_super(obj, MY_CLASS));
+}
+
+
+#include "efl_ui_radio_box.eo.c"
diff --git a/src/lib/elementary/efl_ui_radio_box.eo b/src/lib/elementary/efl_ui_radio_box.eo
new file mode 100644
index 0000000000..aa2d91c835
--- /dev/null
+++ b/src/lib/elementary/efl_ui_radio_box.eo
@@ -0,0 +1,25 @@
+class @beta Efl.Ui.Radio_Box extends Efl.Ui.Box implements Efl.Ui.Radio_Group
+{
+ [[A standard @Efl.Ui.Box container which automatically handles grouping of any @Efl.Ui.Radio
+ widget added to it.
+
+ All @Efl.Ui.Radio widgets are added to the same internal group which you only indirectly
+ access through this object.
+ ]]
+ implements {
+ Efl.Pack.pack_clear;
+ Efl.Pack.unpack_all;
+ Efl.Pack.unpack;
+ Efl.Pack.pack;
+ Efl.Pack_Linear.pack_begin;
+ Efl.Pack_Linear.pack_end;
+ Efl.Pack_Linear.pack_before;
+ Efl.Pack_Linear.pack_after;
+ Efl.Pack_Linear.pack_at;
+ Efl.Pack_Linear.pack_unpack_at;
+ Efl.Object.constructor;
+ }
+ composite {
+ Efl.Ui.Radio_Group;
+ }
+}
diff --git a/src/lib/elementary/efl_ui_radio_eo.h b/src/lib/elementary/efl_ui_radio_eo.h
index c16605e9a3..bd8665d728 100644
--- a/src/lib/elementary/efl_ui_radio_eo.h
+++ b/src/lib/elementary/efl_ui_radio_eo.h
@@ -1 +1,7 @@
+#define _EFL_UI_RADIO_EO_CLASS_TYPE
+typedef Eo Efl_Ui_Radio;
+
+#include "efl_ui_radio_group.eo.h"
+#include "efl_ui_radio_group_impl.eo.h"
#include "efl_ui_radio.eo.h"
+#include "efl_ui_radio_box.eo.h"
diff --git a/src/lib/elementary/efl_ui_radio_eo.legacy.c b/src/lib/elementary/efl_ui_radio_eo.legacy.c
index 69b23653ed..8e9a4dd06f 100644
--- a/src/lib/elementary/efl_ui_radio_eo.legacy.c
+++ b/src/lib/elementary/efl_ui_radio_eo.legacy.c
@@ -10,21 +10,3 @@ elm_radio_state_value_get(const Efl_Ui_Radio *obj)
{
return efl_ui_radio_state_value_get(obj);
}
-
-EAPI void
-elm_radio_value_pointer_set(Efl_Ui_Radio *obj, int *valuep)
-{
- efl_ui_radio_value_pointer_set(obj, valuep);
-}
-
-EAPI Efl_Canvas_Object *
-elm_radio_selected_object_get(const Efl_Ui_Radio *obj)
-{
- return efl_ui_radio_selected_object_get(obj);
-}
-
-EAPI void
-elm_radio_group_add(Efl_Ui_Radio *obj, Efl_Ui_Radio *group)
-{
- efl_ui_radio_group_add(obj, group);
-}
diff --git a/src/lib/elementary/efl_ui_radio_group.eo b/src/lib/elementary/efl_ui_radio_group.eo
new file mode 100644
index 0000000000..34f0d7b907
--- /dev/null
+++ b/src/lib/elementary/efl_ui_radio_group.eo
@@ -0,0 +1,62 @@
+interface @beta Efl.Ui.Radio_Group
+{
+ [[Interface for manually handling a group of @Efl.Ui.Radio buttons.
+
+ See the documentation of @Efl.Ui.Radio for an explanation of radio button grouping.
+ ]]
+ methods {
+ @property selected_object {
+ [[Currently selected button in a radio button group, or $NULL if no button is selected.
+
+ See also @.selected_value.
+ ]]
+ values {
+ selected_object : Efl.Ui.Radio; [[The currently selected radio button in the group, or $NULL.]]
+ }
+ }
+ @property selected_value {
+ [[The value associated with the currently selected button in the group.
+ Give each radio button in the group a different value using @Efl.Ui.Radio.state_value.
+
+ A value of -1 means that no button is selected.
+ Only values associated with the buttons in the group (and -1) can be used.
+ ]]
+ values {
+ selected_value : int; [[The value of the currently selected radio button, or -1.]]
+ }
+ }
+ register {
+ [[Register a new @Efl.Ui.Radio button to this group.
+ Keep in mind that registering to a group will only handle button grouping, you still
+ need to add the button to a layout for it to be rendered.
+
+ If the @Efl.Ui.Radio.state_value of the new button is already used by a previous
+ button in the group, the button will not be added.
+
+ See also @.unregister.
+ ]]
+ params {
+ radio : Efl.Ui.Radio; [[The radio button to add to the group.]]
+ }
+ }
+ unregister {
+ [[Unregister an @Efl.Ui.Radio button from this group.
+ This will unlink the behavior of this button from the other buttons in the group,
+ but if it still belongs to a layout, it will still be rendered.
+
+ If the button was not registered in the group the call is ignored.
+ If the button was selected, no button will be selected in the group after this call.
+
+ See also @.register.
+ ]]
+ params {
+ radio : Efl.Ui.Radio; [[The radio button to remove from the group.]]
+ }
+ }
+ }
+ events {
+ value,changed : int; [[Emitted each time the $selected_value changes. The event information
+ contains the @Efl.Ui.Radio.state_value of the newly selected button or
+ -1 if no button is now selected.]]
+ }
+}
diff --git a/src/lib/elementary/efl_ui_radio_group_impl.c b/src/lib/elementary/efl_ui_radio_group_impl.c
new file mode 100644
index 0000000000..4e68299540
--- /dev/null
+++ b/src/lib/elementary/efl_ui_radio_group_impl.c
@@ -0,0 +1,152 @@
+#ifdef HAVE_CONFIG_H
+# include "elementary_config.h"
+#endif
+
+#include <Elementary.h>
+#include "elm_priv.h"
+
+#define MY_CLASS EFL_UI_RADIO_GROUP_IMPL_CLASS
+
+static Eina_Hash *radio_group_map;
+
+typedef struct {
+ Efl_Ui_Radio *selected;
+ Eina_List *registered_set;
+} Efl_Ui_Radio_Group_Impl_Data;
+
+EOLIAN static void
+_efl_ui_radio_group_impl_efl_ui_radio_group_selected_object_set(Eo *obj EINA_UNUSED, Efl_Ui_Radio_Group_Impl_Data *pd, Efl_Ui_Radio *selected_object)
+{
+ int new_value = -1;
+ Eo *old_selected;
+
+ if (pd->selected == selected_object) return;
+
+ old_selected = pd->selected;
+ pd->selected = selected_object;
+
+ //it is essential to *first* set pd->selected to the new state before calling this
+ //otherwise this here will be called again, and the event will get emitted twice
+ if (old_selected && efl_alive_get(old_selected))
+ efl_ui_check_selected_set(old_selected, EINA_FALSE);
+
+ if (pd->selected)
+ {
+ efl_ui_check_selected_set(pd->selected, EINA_TRUE);
+ new_value = efl_ui_radio_state_value_get(pd->selected);
+ }
+ efl_event_callback_call(obj, EFL_UI_RADIO_GROUP_EVENT_VALUE_CHANGED, &new_value);
+}
+
+EOLIAN static Efl_Ui_Radio*
+_efl_ui_radio_group_impl_efl_ui_radio_group_selected_object_get(const Eo *obj EINA_UNUSED, Efl_Ui_Radio_Group_Impl_Data *pd)
+{
+ return pd->selected;
+}
+
+EOLIAN static void
+_efl_ui_radio_group_impl_efl_ui_radio_group_selected_value_set(Eo *obj, Efl_Ui_Radio_Group_Impl_Data *pd, int selected_value)
+{
+ Efl_Ui_Radio *reged;
+ Eina_List *n;
+
+ EINA_LIST_FOREACH(pd->registered_set, n, reged)
+ {
+ if (efl_ui_radio_state_value_get(reged) == selected_value)
+ {
+ efl_ui_radio_group_selected_object_set(obj, reged);
+ return;
+ }
+ }
+ ERR("Value %d not assosiated with any radio button", selected_value);
+}
+
+EOLIAN static int
+_efl_ui_radio_group_impl_efl_ui_radio_group_selected_value_get(const Eo *obj EINA_UNUSED, Efl_Ui_Radio_Group_Impl_Data *pd)
+{
+ return pd->selected ? efl_ui_radio_state_value_get(pd->selected) : -1;
+}
+
+static void
+_selected_cb(void *data, const Efl_Event *ev)
+{
+ if (efl_ui_check_selected_get(ev->object))
+ {
+ efl_ui_radio_group_selected_object_set(data, ev->object);
+ }
+ else
+ {
+ //if something was unselected, we need to make sure that we are unsetting the internal pointer to NULL
+ if (efl_ui_radio_group_selected_object_get(data) == ev->object)
+ {
+ efl_ui_radio_group_selected_object_set(data, NULL);
+ }
+ }
+}
+
+static void
+_invalidate_cb(void *data, const Efl_Event *ev)
+{
+ efl_ui_radio_group_unregister(data, ev->object);
+}
+
+EFL_CALLBACKS_ARRAY_DEFINE(radio_btn_cb,
+ {EFL_UI_CHECK_EVENT_SELECTED_CHANGED, _selected_cb},
+ {EFL_EVENT_INVALIDATE, _invalidate_cb},
+)
+
+EOLIAN static void
+_efl_ui_radio_group_impl_efl_ui_radio_group_register(Eo *obj, Efl_Ui_Radio_Group_Impl_Data *pd, Efl_Ui_Radio *radio)
+{
+ Efl_Ui_Radio *reged;
+ Eina_List *n;
+
+ if (eina_hash_find(radio_group_map, &radio))
+ {
+ ERR("Radio button %p is already part of another group", radio);
+ return;
+ }
+
+ EINA_LIST_FOREACH(pd->registered_set, n, reged)
+ {
+ EINA_SAFETY_ON_TRUE_RETURN(radio == reged);
+ EINA_SAFETY_ON_TRUE_RETURN(efl_ui_radio_state_value_get(radio) == efl_ui_radio_state_value_get(reged));
+ }
+ EINA_SAFETY_ON_TRUE_RETURN(efl_ui_radio_state_value_get(radio) == -1);
+
+ pd->registered_set = eina_list_append(pd->registered_set, radio);
+ eina_hash_add(radio_group_map, &radio, obj);
+ efl_event_callback_array_add(radio, radio_btn_cb(), obj);
+}
+
+EOLIAN static void
+_efl_ui_radio_group_impl_efl_ui_radio_group_unregister(Eo *obj, Efl_Ui_Radio_Group_Impl_Data *pd, Efl_Ui_Radio *radio)
+{
+ if (pd->selected == radio)
+ efl_ui_radio_group_selected_object_set(obj, NULL);
+
+ efl_event_callback_array_del(radio, radio_btn_cb(), obj);
+ pd->registered_set = eina_list_remove(pd->registered_set, radio);
+ eina_hash_del(radio_group_map, &radio, obj);
+}
+
+EOLIAN static void
+_efl_ui_radio_group_impl_efl_object_destructor(Eo *obj, Efl_Ui_Radio_Group_Impl_Data *pd)
+{
+ Eo *radio;
+
+ EINA_LIST_FREE(pd->registered_set, radio)
+ {
+ efl_event_callback_array_del(radio, radio_btn_cb(), obj);
+ eina_hash_del(radio_group_map, &radio, obj);
+ }
+ efl_destructor(efl_super(obj, MY_CLASS));
+}
+
+void
+_efl_ui_radio_group_impl_class_constructor(Efl_Class *klass EINA_UNUSED)
+{
+ radio_group_map = eina_hash_pointer_new(NULL);
+}
+
+#include "efl_ui_radio_group_impl.eo.c"
diff --git a/src/lib/elementary/efl_ui_radio_group_impl.eo b/src/lib/elementary/efl_ui_radio_group_impl.eo
new file mode 100644
index 0000000000..bc41093526
--- /dev/null
+++ b/src/lib/elementary/efl_ui_radio_group_impl.eo
@@ -0,0 +1,13 @@
+class @beta Efl.Ui.Radio_Group_Impl extends Efl.Object implements Efl.Ui.Radio_Group
+{
+ [[Object with the default implementation for @Efl.Ui.Radio_Group.
+ ]]
+ implements {
+ class.constructor;
+ Efl.Object.destructor;
+ Efl.Ui.Radio_Group.selected_object {get; set;}
+ Efl.Ui.Radio_Group.selected_value {get; set;}
+ Efl.Ui.Radio_Group.register;
+ Efl.Ui.Radio_Group.unregister;
+ }
+}
diff --git a/src/lib/elementary/efl_ui_radio_private.h b/src/lib/elementary/efl_ui_radio_private.h
index a59ea0c48d..f60c28ec24 100644
--- a/src/lib/elementary/efl_ui_radio_private.h
+++ b/src/lib/elementary/efl_ui_radio_private.h
@@ -37,8 +37,6 @@ struct _Efl_Ui_Radio_Data
{
int value;
Group *group;
-
- Eina_Bool state : 1;
};
/**
diff --git a/src/lib/elementary/efl_ui_selection_manager.c b/src/lib/elementary/efl_ui_selection_manager.c
index cbef9226af..5c4db17b0c 100644
--- a/src/lib/elementary/efl_ui_selection_manager.c
+++ b/src/lib/elementary/efl_ui_selection_manager.c
@@ -2723,6 +2723,7 @@ _wl_selection_send(void *data, int type EINA_UNUSED, void *event)
free(data_ret);
close(ev->fd);
+ ecore_wl2_display_flush(ev->display);
return ECORE_CALLBACK_PASS_ON;
}
@@ -2763,6 +2764,7 @@ _wl_dnd_end(void *data, int type EINA_UNUSED, void *event)
seat_sel->accept = EINA_FALSE;
+ ecore_wl2_display_flush(ev->display);
return ECORE_CALLBACK_PASS_ON;
}
@@ -2976,6 +2978,7 @@ _wl_efl_sel_manager_selection_get(const Efl_Object *request, Efl_Ui_Selection_Ma
_wl_selection_receive, sel);
ecore_wl2_offer_receive(offer, (char*)sm_wl_convertion[i].translates[j]);
+ ecore_wl2_display_flush(ecore_wl2_input_display_get(input));
return EINA_TRUE;
}
}
diff --git a/src/lib/elementary/efl_ui_slider.c b/src/lib/elementary/efl_ui_slider.c
index 3e5ff63cbf..6b2c78953e 100644
--- a/src/lib/elementary/efl_ui_slider.c
+++ b/src/lib/elementary/efl_ui_slider.c
@@ -34,7 +34,7 @@ _delay_change(void *data)
EFL_UI_SLIDER_DATA_GET(data, sd);
sd->delay = NULL;
- efl_event_callback_call(data, EFL_UI_SLIDER_EVENT_DELAY_CHANGED, NULL);
+ efl_event_callback_call(data, EFL_UI_SLIDER_EVENT_STEADY, NULL);
if (_elm_config->atspi_mode)
efl_access_value_changed_signal_emit(data);
@@ -718,7 +718,7 @@ _efl_ui_slider_efl_ui_layout_orientable_orientation_get(const Eo *obj EINA_UNUSE
}
EOLIAN static void
-_efl_ui_slider_efl_ui_range_display_range_min_max_set(Eo *obj, Efl_Ui_Slider_Data *sd, double min, double max)
+_efl_ui_slider_efl_ui_range_display_range_limits_set(Eo *obj, Efl_Ui_Slider_Data *sd, double min, double max)
{
if ((sd->val_min == min) && (sd->val_max == max)) return;
sd->val_min = min;
@@ -730,7 +730,7 @@ _efl_ui_slider_efl_ui_range_display_range_min_max_set(Eo *obj, Efl_Ui_Slider_Dat
}
EOLIAN static void
-_efl_ui_slider_efl_ui_range_display_range_min_max_get(const Eo *obj EINA_UNUSED, Efl_Ui_Slider_Data *sd, double *min, double *max)
+_efl_ui_slider_efl_ui_range_display_range_limits_get(const Eo *obj EINA_UNUSED, Efl_Ui_Slider_Data *sd, double *min, double *max)
{
if (min) *min = sd->val_min;
if (max) *max = sd->val_max;
diff --git a/src/lib/elementary/efl_ui_slider.eo b/src/lib/elementary/efl_ui_slider.eo
index 4b703a3bf7..364b226db6 100644
--- a/src/lib/elementary/efl_ui_slider.eo
+++ b/src/lib/elementary/efl_ui_slider.eo
@@ -11,7 +11,7 @@ class @beta Efl.Ui.Slider extends Efl.Ui.Layout_Base implements Efl.Ui.Range_Int
Efl.Ui.Focus.Object.on_focus_update;
Efl.Ui.Widget.widget_input_event_handler;
Efl.Ui.Range_Display.range_value { get; set; }
- Efl.Ui.Range_Display.range_min_max {get; set; }
+ Efl.Ui.Range_Display.range_limits {get; set; }
Efl.Ui.Range_Interactive.range_step { get; set; }
Efl.Ui.Layout_Orientable.orientation { get; set; }
Efl.Access.Value.value_and_text { get; set; }
@@ -20,9 +20,15 @@ class @beta Efl.Ui.Slider extends Efl.Ui.Layout_Base implements Efl.Ui.Range_Int
Efl.Access.Widget.Action.elm_actions { get; }
}
events {
- changed: void; [[Called when slider changed]]
- delay,changed: void; [[Called when delay changed]]
- slider,drag,start: void; [[Called when slider drag started]]
- slider,drag,stop: void; [[Called when slider drag stopped]]
+ changed: void; [[Called when the slider position has changed.]]
+ steady: void; [[Called when the slider position has changed and has remained unchanged for 0.2s.
+ This allows filtering out unwanted "noise" from the slider signal if you are only
+ interested in the final position of the slider.
+ Use this signal instead of @[Efl.Ui.Slider.changed] if you are going to perform a costly operation
+ on its handler.]]
+ slider,drag,start: void; [[Called when a slider drag operation has started. This means a $press event
+ has been received on the slider thumb but not the $unpress.]]
+ slider,drag,stop: void; [[Called when a slider drag operation has finished. This means an $unpress event
+ has been received on the slider thumb.]]
}
}
diff --git a/src/lib/elementary/efl_ui_slider_interval.c b/src/lib/elementary/efl_ui_slider_interval.c
index 8256c7de22..0f0f9a5b8d 100644
--- a/src/lib/elementary/efl_ui_slider_interval.c
+++ b/src/lib/elementary/efl_ui_slider_interval.c
@@ -22,7 +22,7 @@ _delay_change(void *data)
EFL_UI_SLIDER_INTERVAL_DATA_GET(data, pd);
pd->delay = NULL;
- efl_event_callback_call(data, EFL_UI_SLIDER_EVENT_DELAY_CHANGED, NULL);
+ efl_event_callback_call(data, EFL_UI_SLIDER_EVENT_STEADY, NULL);
if (_elm_config->atspi_mode)
efl_access_value_changed_signal_emit(data);
diff --git a/src/lib/elementary/efl_ui_spin.c b/src/lib/elementary/efl_ui_spin.c
index f446bab9f3..feb3f543af 100644
--- a/src/lib/elementary/efl_ui_spin.c
+++ b/src/lib/elementary/efl_ui_spin.c
@@ -308,7 +308,7 @@ _efl_ui_spin_efl_ui_format_format_cb_set(Eo *obj, Efl_Ui_Spin_Data *sd, void *fu
}
EOLIAN static void
-_efl_ui_spin_efl_ui_range_display_range_min_max_set(Eo *obj, Efl_Ui_Spin_Data *sd, double min, double max)
+_efl_ui_spin_efl_ui_range_display_range_limits_set(Eo *obj, Efl_Ui_Spin_Data *sd, double min, double max)
{
if (max < min)
{
@@ -329,7 +329,7 @@ _efl_ui_spin_efl_ui_range_display_range_min_max_set(Eo *obj, Efl_Ui_Spin_Data *s
}
EOLIAN static void
-_efl_ui_spin_efl_ui_range_display_range_min_max_get(const Eo *obj EINA_UNUSED, Efl_Ui_Spin_Data *sd, double *min, double *max)
+_efl_ui_spin_efl_ui_range_display_range_limits_get(const Eo *obj EINA_UNUSED, Efl_Ui_Spin_Data *sd, double *min, double *max)
{
if (min) *min = sd->val_min;
if (max) *max = sd->val_max;
diff --git a/src/lib/elementary/efl_ui_spin.eo b/src/lib/elementary/efl_ui_spin.eo
index e523ecbd3b..4fee3df56c 100644
--- a/src/lib/elementary/efl_ui_spin.eo
+++ b/src/lib/elementary/efl_ui_spin.eo
@@ -35,7 +35,7 @@ class @beta Efl.Ui.Spin extends Efl.Ui.Layout_Base implements Efl.Ui.Range_Inter
Efl.Object.constructor;
Efl.Object.destructor;
Efl.Ui.Widget.widget_input_event_handler;
- Efl.Ui.Range_Display.range_min_max { get; set; }
+ Efl.Ui.Range_Display.range_limits { get; set; }
Efl.Ui.Range_Interactive.range_step { get; set; }
Efl.Ui.Range_Display.range_value { get; set; }
Efl.Ui.Format.format_cb { set; }
diff --git a/src/lib/elementary/efl_ui_stack.c b/src/lib/elementary/efl_ui_stack.c
deleted file mode 100644
index 92241acf87..0000000000
--- a/src/lib/elementary/efl_ui_stack.c
+++ /dev/null
@@ -1,697 +0,0 @@
-#ifdef HAVE_CONFIG_H
-# include "elementary_config.h"
-#endif
-
-#include <Elementary.h>
-
-#include "elm_priv.h"
-#include "efl_ui_stack_private.h"
-
-#define MY_CLASS EFL_UI_STACK_CLASS
-#define MY_CLASS_NAME "Efl.Ui.Stack"
-
-static Efl_Canvas_Animation *show_anim = NULL;
-static Efl_Canvas_Animation *hide_anim = NULL;
-
-static void
-_announce_hiding(Efl_Ui_Stack *obj, Evas_Object *content)
-{
- //Deactivated Event
- Efl_Ui_Stack_Event_Deactivated deactivated_info;
- deactivated_info.content = content;
- efl_event_callback_call(obj,
- EFL_UI_STACK_EVENT_DEACTIVATED,
- &deactivated_info);
-
- //Unloaded Event
- Efl_Ui_Stack_Event_Unloaded unloaded_info;
- unloaded_info.content = content;
- efl_event_callback_call(obj,
- EFL_UI_STACK_EVENT_UNLOADED,
- &unloaded_info);
-}
-
-static void
-_show_content_without_anim(Efl_Ui_Stack *obj, Evas_Object *content)
-{
- //Loaded Event
- Efl_Ui_Stack_Event_Loaded loaded_info;
- loaded_info.content = content;
- efl_event_callback_call(obj, EFL_UI_STACK_EVENT_LOADED,
- &loaded_info);
-
- evas_object_raise(content);
- /* efl_ui_widget_resize_object_set() calls efl_gfx_entity_visible_set()
- * internally.
- * Therefore, efl_ui_widget_resize_object_set() is called after
- * setting animation and efl_gfx_entity_visible_set() is not called. */
- efl_ui_widget_resize_object_set(obj, content);
-
- //Activated Event
- Efl_Ui_Stack_Event_Activated activated_info;
- activated_info.content = content;
- efl_event_callback_call(obj, EFL_UI_STACK_EVENT_ACTIVATED,
- &activated_info);
-}
-
-static void
-_hide_content_without_anim(Efl_Ui_Stack *obj EINA_UNUSED, Evas_Object *content)
-{
- efl_gfx_entity_visible_set(content, EINA_FALSE);
-}
-
-static void
-_content_del_cb(void *data, const Efl_Event *event EINA_UNUSED)
-{
- Content_Data *cd = data;
-
- //Popped content has already called deactivated event and unloaded event.
- if (cd->popped_hidden) return;
-
- _announce_hiding(NULL, cd->content);
-}
-
-static Content_Data *
-_content_data_new(Eo *obj EINA_UNUSED, Eo *content)
-{
- Content_Data *cd = calloc(1, sizeof(Content_Data));
- if (!cd)
- {
- ERR("Memory allocation error!");
- return NULL;
- }
-
- cd->content = content;
-
- efl_event_callback_add(cd->content, EFL_EVENT_DEL, _content_del_cb, cd);
-
- return cd;
-}
-
-static void
-_content_data_del(Content_Data *cd)
-{
- if (!cd) return;
-
- if (cd->content)
- efl_del(cd->content);
-
- free(cd);
-}
-
-static void
-_anim_started_cb(void *data EINA_UNUSED, const Efl_Event *event)
-{
- efl_event_freeze(efl_animation_player_target_get(event->object));
-}
-
-static Evas_Object*
-_end_anim(Transit_Data *td)
-{
- Efl_Canvas_Object *content = td->cd->content;
-
- efl_event_thaw(content);
- td->cd->on_pushing = EINA_FALSE;
- td->cd->on_popping = EINA_FALSE;
- free(td);
-
- return content;
-}
-
-static void
-_hide_anim_ended_cb(void *data, const Efl_Event *event EINA_UNUSED)
-{
- Efl_Ui_Stack_Data *pd = efl_data_scope_safe_get(data, EFL_UI_STACK_CLASS);
- Efl_Canvas_Object *content;
-
- EINA_SAFETY_ON_NULL_RETURN(pd);
-
- content = _end_anim(pd->hide_td);
- pd->hide_td = NULL;
- efl_gfx_entity_visible_set(content, EINA_FALSE);
- _announce_hiding(data, content);
-}
-
-static void
-_show_anim_ended_cb(void *data, const Efl_Event *event EINA_UNUSED)
-{
- Efl_Ui_Stack_Data *pd = efl_data_scope_safe_get(data, EFL_UI_STACK_CLASS);
- Efl_Canvas_Object *content;
-
- EINA_SAFETY_ON_NULL_RETURN(pd);
-
- content = _end_anim(pd->show_td);
- pd->show_td = NULL;
- //Activated Event
- Efl_Ui_Stack_Event_Activated activated_info;
- activated_info.content = content;
- efl_event_callback_call(data,
- EFL_UI_STACK_EVENT_ACTIVATED,
- &activated_info);
-}
-
-static void
-_show_content_with_anim(Efl_Ui_Stack *obj, Efl_Ui_Stack_Data *pd, Content_Data *cd)
-{
- //immidiatly stop hiding animation
- efl_player_stop(pd->show);
- if (pd->show_td)
- EINA_SAFETY_ERROR("td is set but it should not");
-
- //attach new content target
- efl_animation_player_target_set(pd->show, cd->content);
-
- Transit_Data *td = calloc(1, sizeof(Transit_Data));
- if (!td)
- {
- ERR("Memory allocation error!");
-
- //show content without animation
- _show_content_without_anim(obj, cd->content);
- return;
- }
-
- td->cd = cd;
- pd->show_td = td;
-
- /* efl_ui_widget_resize_object_set() calls efl_gfx_entity_visible_set()
- * internally.
- * Therefore, efl_ui_widget_resize_object_set() is called after
- * setting animation and efl_gfx_entity_visible_set() is not called. */
- efl_ui_widget_resize_object_set(obj, cd->content);
- efl_player_start(pd->show);
-}
-
-static void
-_hide_content_with_anim(Efl_Ui_Stack *obj EINA_UNUSED, Efl_Ui_Stack_Data *pd, Content_Data *cd)
-{
- //immidiatly stop hiding animation
- efl_player_stop(pd->hide);
- if (pd->hide_td)
- EINA_SAFETY_ERROR("td is set but it should not");
-
- //attach new content target
- efl_animation_player_target_set(pd->hide, cd->content);
-
- Transit_Data *td = calloc(1, sizeof(Transit_Data));
- if (!td)
- {
- ERR("Memory allocation error!");
-
- //hide content without animation
- _hide_content_without_anim(obj, cd->content);
- return;
- }
-
- td->cd = cd;
- pd->hide_td = td;
-
- efl_player_start(pd->hide);
-}
-
-EOLIAN static void
-_efl_ui_stack_push(Eo *obj, Efl_Ui_Stack_Data *pd, Eo *content)
-{
- if (!content) return;
-
- //If the given content exists in the stack, promote the given content to the top.
- Content_Data *cd = NULL;
- EINA_INLIST_FOREACH(pd->stack, cd)
- if (cd->content == content)
- break;
-
- Content_Data *top_cd = NULL;
- if (pd->stack)
- top_cd = EINA_INLIST_CONTAINER_GET(pd->stack->last, Content_Data);
-
- if (cd)
- {
- //If given content is already the top content, then do nothing.
- if (cd == top_cd)
- return;
-
- //Remove the given content(existing content) to promote it to the top.
- pd->stack = eina_inlist_remove(pd->stack, EINA_INLIST_GET(cd));
- }
- else
- {
- cd = _content_data_new(obj, content);
- if (!cd) return;
-
- evas_object_smart_member_add(content, obj);
- }
-
- pd->stack = eina_inlist_append(pd->stack, EINA_INLIST_GET(cd));
-
- //Loaded Event
- Efl_Ui_Stack_Event_Loaded loaded_info;
- loaded_info.content = content;
- efl_event_callback_call(obj, EFL_UI_STACK_EVENT_LOADED, &loaded_info);
-
- /* Apply transition to top content.
- * Hide top content with animation. */
- if (top_cd)
- {
- Eo *top_content = top_cd->content;
-
- /* If content is being pushed now, then finish current animation and hide
- * the content without animation. */
- if (top_cd->on_pushing)
- {
- _hide_content_without_anim(obj, top_content);
- _announce_hiding(obj, top_content);
- }
- else
- {
- top_cd->on_pushing = EINA_TRUE;
-
- _hide_content_with_anim(obj, pd, top_cd);
- }
- }
-
- /* Prepare transition for new content.
- * Hide new content without animation. */
- cd->on_pushing = EINA_TRUE;
- _hide_content_without_anim(obj, content);
-
- /* Apply transition to new content.
- * Show new content with animation. */
- _show_content_with_anim(obj, pd, cd);
-}
-
-static void
-_pop_content_hide_cb(void *data, const Efl_Event *event)
-{
- Content_Data *cd = data;
- Eina_Bool *visible = event->info;
- /* object is being shown */
- if (*visible) return;
-
- cd->popped_hidden = EINA_TRUE;
-
- _content_data_del(cd);
-}
-
-EOLIAN static Eo *
-_efl_ui_stack_pop(Eo *obj, Efl_Ui_Stack_Data *pd)
-{
- if (!pd->stack)
- {
- ERR("There is no content in the stack!");
- return NULL;
- }
-
- Content_Data *top_cd = EINA_INLIST_CONTAINER_GET(pd->stack->last, Content_Data);
-
- pd->stack = eina_inlist_remove(pd->stack, EINA_INLIST_GET(top_cd));
-
- /* Apply transition to top content.
- * Hide top content with animation. */
- {
- Eo *top_content = top_cd->content;
-
- /* If content is being popped now, then finish current animation and show
- * the content without animation. */
- if (top_cd->on_popping)
- {
- _hide_content_without_anim(obj, top_content);
- _announce_hiding(obj, top_content);
- }
- else
- {
- top_cd->on_popping = EINA_TRUE;
-
- //Deallocate content data when hide animation is finished.
- efl_event_callback_add(top_content, EFL_GFX_ENTITY_EVENT_VISIBILITY_CHANGED,
- _pop_content_hide_cb, top_cd);
-
- _hide_content_with_anim(obj, pd, top_cd);
- }
- }
-
- if (pd->stack)
- {
- Content_Data *prev_cd = EINA_INLIST_CONTAINER_GET(pd->stack->last,
- Content_Data);
- Eo *prev_content = prev_cd->content;
-
- prev_cd->on_popping = EINA_TRUE;
-
- //Loaded Event
- Efl_Ui_Stack_Event_Loaded loaded_info;
- loaded_info.content = prev_content;
- efl_event_callback_call(obj, EFL_UI_STACK_EVENT_LOADED,
- &loaded_info);
-
- /* Apply transition to previous content.
- * Show previous content with animation. */
- _show_content_with_anim(obj, pd, prev_cd);
- }
-
- return NULL;
-}
-
-EOLIAN static void
-_efl_ui_stack_insert_before(Eo *obj, Efl_Ui_Stack_Data *pd,
- Eo *base_content, Eo *content)
-{
- if (!content) return;
-
- Content_Data *base_cd = NULL;
- EINA_INLIST_FOREACH(pd->stack, base_cd)
- if (base_cd->content == base_content)
- break;
-
- if (!base_cd)
- {
- ERR("The given base content is not found in the stack!");
- return;
- }
-
- Content_Data *cd = _content_data_new(obj, content);
- if (!cd) return;
-
- pd->stack = eina_inlist_prepend_relative(pd->stack,
- EINA_INLIST_GET(cd),
- EINA_INLIST_GET(base_cd));
- evas_object_smart_member_add(content, obj);
-}
-
-EOLIAN static void
-_efl_ui_stack_insert_after(Eo *obj, Efl_Ui_Stack_Data *pd,
- Eo *base_content, Eo *content)
-{
- if (!content) return;
-
- Content_Data *base_cd = NULL;
- EINA_INLIST_FOREACH(pd->stack, base_cd)
- if (base_cd->content == base_content)
- break;
-
- if (!base_cd)
- {
- ERR("The given base content is not found in the stack!");
- return;
- }
-
- Content_Data *cd = _content_data_new(obj, content);
- if (!cd) return;
-
- pd->stack = eina_inlist_append_relative(pd->stack,
- EINA_INLIST_GET(cd),
- EINA_INLIST_GET(base_cd));
- evas_object_smart_member_add(content, obj);
-
- if (pd->stack->last == EINA_INLIST_GET(cd))
- {
- /* Do not apply transition for insert.
- * Hide top content without animation. */
- _hide_content_without_anim(obj, base_cd->content);
- _announce_hiding(obj, base_cd->content);
-
- /* Do not apply transition for insert.
- * Show new content without animation. */
- _show_content_without_anim(obj, content);
- }
-}
-
-EOLIAN static void
-_efl_ui_stack_insert_at(Eo *obj, Efl_Ui_Stack_Data *pd,
- int index, Eo *content)
-{
- if (!content)
- {
- ERR("The given content is NULL!");
- return;
- }
-
- int count = eina_inlist_count(pd->stack);
- if ((index < 0) || (index > count))
- {
- ERR("The index(%d) should be from 0 to #contents in the stack(%d)!",
- index, count);
- return;
- }
-
- Content_Data *base_cd = NULL;
-
- if (index == count)
- {
- base_cd = EINA_INLIST_CONTAINER_GET(pd->stack->last, Content_Data);
- }
- else
- {
- int i = 0;
- EINA_INLIST_FOREACH(pd->stack, base_cd)
- {
- if (i == index)
- break;
-
- i++;
- }
- }
-
- Content_Data *cd = _content_data_new(obj, content);
- if (!cd) return;
-
- if (index == count)
- pd->stack = eina_inlist_append_relative(pd->stack,
- EINA_INLIST_GET(cd),
- EINA_INLIST_GET(base_cd));
- else
- pd->stack = eina_inlist_prepend_relative(pd->stack,
- EINA_INLIST_GET(cd),
- EINA_INLIST_GET(base_cd));
-
- evas_object_smart_member_add(content, obj);
-
- if (pd->stack->last == EINA_INLIST_GET(cd))
- {
-
- /* Do not apply transition for insert.
- * Hide top content without animation. */
- _hide_content_without_anim(obj, base_cd->content);
- _announce_hiding(obj, base_cd->content);
-
- /* Do not apply transition for insert.
- * Show new content without animation. */
- _show_content_without_anim(obj, content);
- }
-}
-
-EOLIAN static void
-_efl_ui_stack_remove(Eo *obj, Efl_Ui_Stack_Data *pd, Eo *content)
-{
- if (!pd->stack)
- {
- ERR("There is no content in the stack!");
- return;
- }
-
- if (!content)
- {
- ERR("The given content is NULL!");
- return;
- }
-
- Content_Data *cd = NULL;
-
- EINA_INLIST_FOREACH(pd->stack, cd)
- {
- if (cd->content == content)
- break;
- }
- if (!cd)
- {
- ERR("The given content does not exist in the stack!");
- return;
- }
-
- Eina_Bool remove_top = EINA_FALSE;
- if (pd->stack->last == EINA_INLIST_GET(cd))
- remove_top = EINA_TRUE;
-
- pd->stack = eina_inlist_remove(pd->stack, EINA_INLIST_GET(cd));
-
- _announce_hiding(obj, cd->content);
- _content_data_del(cd);
-
- if (remove_top)
- {
- if (pd->stack)
- {
- Content_Data *new_top_cd = EINA_INLIST_CONTAINER_GET(pd->stack->last,
- Content_Data);
-
- /* Do not apply transition for insert.
- * Show new content without animation. */
- _show_content_without_anim(obj, new_top_cd->content);
- }
- }
-}
-
-EOLIAN static void
-_efl_ui_stack_remove_at(Eo *obj, Efl_Ui_Stack_Data *pd,
- int index)
-{
- if (!pd->stack)
- {
- ERR("There is no content in the stack!");
- return;
- }
-
- int count = eina_inlist_count(pd->stack);
- if ((index < 0) || (index >= count))
- {
- ERR("The index(%d) should be from 0 to (#contents - 1) in the stack(%d)!",
- index, count);
- return;
- }
-
- Content_Data *cd = NULL;
- int i = 0;
- EINA_INLIST_FOREACH(pd->stack, cd)
- {
- if (i == index)
- break;
- i++;
- }
-
- Eina_Bool remove_top = EINA_FALSE;
- if (pd->stack->last == EINA_INLIST_GET(cd))
- remove_top = EINA_TRUE;
-
- pd->stack = eina_inlist_remove(pd->stack, EINA_INLIST_GET(cd));
-
- _announce_hiding(NULL, cd->content);
- _content_data_del(cd);
-
- //FIXME: Apply transition here.
- if (remove_top)
- {
- if (pd->stack)
- {
- Content_Data *new_top_cd = EINA_INLIST_CONTAINER_GET(pd->stack->last,
- Content_Data);
- /* Do not apply transition for insert.
- * Show new content without animation. */
- _show_content_without_anim(obj, new_top_cd->content);
- }
- }
-}
-
-EOLIAN static int
-_efl_ui_stack_index_get(Eo *obj EINA_UNUSED, Efl_Ui_Stack_Data *pd, Efl_Canvas_Object *content)
-{
- if (!pd->stack)
- {
- ERR("There is no content in the stack!");
- return -1;
- }
-
- if (!content)
- {
- ERR("The given content is NULL!");
- return -1;
- }
-
- Content_Data *cd = NULL;
- int index = 0;
- int count = eina_inlist_count(pd->stack);
-
- EINA_INLIST_FOREACH(pd->stack, cd)
- {
- if (cd->content == content)
- break;
- index++;
- }
-
- //The given content is not found.
- if (index == count) return -1;
-
- return index;
-}
-
-EOLIAN static Eo *
-_efl_ui_stack_content_get(Eo *obj EINA_UNUSED, Efl_Ui_Stack_Data *pd, int index)
-{
- if (!pd->stack)
- {
- ERR("There is no content in the stack!");
- return NULL;
- }
-
- int count = eina_inlist_count(pd->stack);
- if ((index < 0) || (index >= count))
- {
- ERR("The index(%d) should be from 0 to (#contents - 1) in the stack(%d)!",
- index, count);
- return NULL;
- }
-
- Content_Data *cd = NULL;
- int i = 0;
- EINA_INLIST_FOREACH(pd->stack, cd)
- {
- if (i == index)
- break;
- i++;
- }
-
- if (cd)
- return cd->content;
-
- return NULL;
-}
-
-EOLIAN static Eo *
-_efl_ui_stack_top(Eo *obj EINA_UNUSED, Efl_Ui_Stack_Data *pd)
-{
- if (!pd->stack) return NULL;
-
- Content_Data *cd = EINA_INLIST_CONTAINER_GET(pd->stack->last, Content_Data);
-
- return cd->content;
-}
-
-EFL_CALLBACKS_ARRAY_DEFINE(_anim_show_event_cb,
- {EFL_ANIMATION_PLAYER_EVENT_STARTED, _anim_started_cb},
- {EFL_ANIMATION_PLAYER_EVENT_ENDED, _show_anim_ended_cb},
-)
-
-EFL_CALLBACKS_ARRAY_DEFINE(_anim_hide_event_cb,
- {EFL_ANIMATION_PLAYER_EVENT_STARTED, _anim_started_cb},
- {EFL_ANIMATION_PLAYER_EVENT_ENDED, _hide_anim_ended_cb},
-)
-
-EOLIAN static Eo *
-_efl_ui_stack_efl_object_constructor(Eo *obj, Efl_Ui_Stack_Data *pd EINA_UNUSED)
-{
- Efl_Canvas_Animation *sh, *hi;
- obj = efl_constructor(efl_super(obj, MY_CLASS));
- efl_canvas_object_type_set(obj, MY_CLASS_NAME);
-
- //Default Show Animation
- sh = show_anim = efl_add(EFL_CANVAS_ANIMATION_ALPHA_CLASS, obj);
- efl_animation_alpha_set(show_anim, 0.0, 1.0);
- efl_animation_duration_set(show_anim, 0.5);
-
- pd->show = efl_add(EFL_CANVAS_ANIMATION_PLAYER_CLASS, obj);
- efl_animation_player_animation_set(pd->show, sh);
- efl_player_play_set(pd->show, EINA_FALSE);
- efl_event_callback_array_add(pd->show, _anim_show_event_cb(), obj);
-
- //Default Hide Animation
- hi = hide_anim = efl_add(EFL_CANVAS_ANIMATION_ALPHA_CLASS, obj);
- efl_animation_alpha_set(hide_anim, 1.0, 0.0);
- efl_animation_duration_set(hide_anim, 0.5);
-
- pd->hide = efl_add(EFL_CANVAS_ANIMATION_PLAYER_CLASS, obj);
- efl_animation_player_animation_set(pd->hide, hi);
- efl_player_play_set(pd->hide, EINA_FALSE);
- efl_event_callback_array_add(pd->hide, _anim_hide_event_cb(), obj);
-
- return obj;
-}
-
-#include "efl_ui_stack.eo.c"
diff --git a/src/lib/elementary/efl_ui_stack.eo b/src/lib/elementary/efl_ui_stack.eo
deleted file mode 100644
index 8fbc2cf2ed..0000000000
--- a/src/lib/elementary/efl_ui_stack.eo
+++ /dev/null
@@ -1,131 +0,0 @@
-struct @beta Efl.Ui.Stack_Event_Loaded {
- [[Information of loaded event.]]
- content: Efl.Canvas.Object; [[Loaded content.]]
-}
-
-struct @beta Efl.Ui.Stack_Event_Unloaded {
- [[Information of unloaded event.]]
- content: Efl.Canvas.Object; [[Unloaded content.]]
-}
-
-struct @beta Efl.Ui.Stack_Event_Activated {
- [[Information of activated event.]]
- content: Efl.Canvas.Object; [[Activated content.]]
-}
-
-struct @beta Efl.Ui.Stack_Event_Deactivated {
- [[Information of deactivated event.]]
- content: Efl.Canvas.Object; [[Deactivated content.]]
-}
-
-class @beta Efl.Ui.Stack extends Efl.Ui.Layout_Base
-{
- [[Stack widget.
-
- Stack widget arranges objects in stack structure by pushing and poping them.
- ]]
- methods {
- push {
- [[Pushes a new object to the top of the stack and shows it.
- ]]
- params {
- @in content: Efl.Canvas.Object;
- [[The pushed object which becomes the top content of the stack.]]
- }
- }
- pop {
- [[Pops the top content from the stack and deletes it.
- ]]
- return: Efl.Canvas.Object;
- [[The top content which is removed from the stack.]]
- }
- insert_before {
- [[Inserts an object before the given base content in the stack.
- ]]
- params {
- @in base_content: Efl.Canvas.Object;
- [[$content is inserted before this $base_content.]]
- @in content: Efl.Canvas.Object;
- [[The inserted object in the stack.]]
- }
- }
- insert_after {
- [[Inserts an object after the given base content in the stack.
- ]]
- params {
- @in base_content: Efl.Canvas.Object;
- [[$content is inserted after this $base_content.]]
- @in content: Efl.Canvas.Object;
- [[The inserted object in the stack.]]
- }
- }
- insert_at {
- [[Inserts an object at the given place in the stack.
- ]]
- params {
- @in index: int;
- [[The index of the inserted object in the stack.
- $index begins from bottom to top of the stack.
- $index of the bottom content is 0.
- ]]
- @in content: Efl.Canvas.Object;
- [[The inserted object in the stack.]]
- }
- }
- remove {
- [[Removes the given content in the stack.
- ]]
- params {
- @in content: Efl.Canvas.Object;
- [[The removed content from the stack.]]
- }
- }
- remove_at {
- [[Removes a content matched to the given index in the stack.
- ]]
- params {
- @in index: int;
- [[The index of the removed object in the stack.
- $index begins from bottom to top of the stack.
- $index of the bottom content is 0.
- ]]
- }
- }
- index_get {
- [[Gets the index of the given content in the stack.
- The index begins from bottom to top of the stack.
- The index of the bottom content is 0.
- ]]
- return: int;
- [[The index of $content in the stack.]]
- params {
- @in content: Efl.Canvas.Object;
- [[The content matched to the index to be returned in the stack.]]
- }
- }
- content_get {
- [[Gets the content matched to the given index in the stack.
- ]]
- return: Efl.Canvas.Object;
- [[The content matched to $index in the stack.]]
- params {
- @in index: int;
- [[The index of the content to be returned in the stack.]]
- }
- }
- top {
- [[Gets the top content in the stack.
- ]]
- return: Efl.Canvas.Object; [[The top content in the stack.]]
- }
- }
- implements {
- Efl.Object.constructor;
- }
- events {
- loaded: Efl.Ui.Stack_Event_Loaded; [[Called when content is loaded right before transition.]]
- unloaded: Efl.Ui.Stack_Event_Unloaded; [[Called when content is unloaded right after being deactivated.]]
- activated: Efl.Ui.Stack_Event_Activated; [[Called when content is activated right after transition.]]
- deactivated: Efl.Ui.Stack_Event_Deactivated; [[Called when content is deactivated right after transition.]]
- }
-}
diff --git a/src/lib/elementary/efl_ui_stack_private.h b/src/lib/elementary/efl_ui_stack_private.h
deleted file mode 100644
index f3d3b7a7c4..0000000000
--- a/src/lib/elementary/efl_ui_stack_private.h
+++ /dev/null
@@ -1,31 +0,0 @@
-#ifndef EFL_UI_WIDGET_STACK_H
-#define EFL_UI_WIDGET_STACK_H
-
-
-typedef struct _Content_Data Content_Data;
-struct _Content_Data
-{
- EINA_INLIST;
-
- Eo *content;
- Eina_Bool on_pushing : 1;
- Eina_Bool on_popping : 1;
- Eina_Bool popped_hidden : 1;
-};
-
-typedef struct _Transit_Data Transit_Data;
-struct _Transit_Data
-{
- Content_Data *cd;
-};
-
-typedef struct _Efl_Ui_Stack_Data Efl_Ui_Stack_Data;
-struct _Efl_Ui_Stack_Data
-{
- Eina_Inlist *stack; /* the last item is the top item */
- Efl_Canvas_Animation_Player *hide, *show;
- Transit_Data *show_td, *hide_td;
-
-};
-
-#endif
diff --git a/src/lib/elementary/efl_ui_timepicker.c b/src/lib/elementary/efl_ui_timepicker.c
index 08a106f557..938c22c846 100644
--- a/src/lib/elementary/efl_ui_timepicker.c
+++ b/src/lib/elementary/efl_ui_timepicker.c
@@ -122,14 +122,14 @@ _fields_init(Eo *obj)
//Field create.
pd->hour = efl_add(EFL_UI_SPIN_BUTTON_CLASS, obj,
- efl_ui_range_min_max_set(efl_added, 1, 12),
+ efl_ui_range_limits_set(efl_added, 1, 12),
efl_ui_spin_button_circulate_set(efl_added, EINA_TRUE),
efl_ui_spin_button_editable_set(efl_added, EINA_TRUE),
efl_ui_layout_orientation_set(efl_added, EFL_UI_LAYOUT_ORIENTATION_VERTICAL),
efl_event_callback_add(efl_added, EFL_UI_SPIN_EVENT_CHANGED,_field_changed_cb, obj));
pd->min = efl_add(EFL_UI_SPIN_BUTTON_CLASS, obj,
- efl_ui_range_min_max_set(efl_added, 0, 59),
+ efl_ui_range_limits_set(efl_added, 0, 59),
efl_ui_spin_button_circulate_set(efl_added, EINA_TRUE),
efl_ui_spin_button_editable_set(efl_added, EINA_TRUE),
efl_ui_layout_orientation_set(efl_added, EFL_UI_LAYOUT_ORIENTATION_VERTICAL),
diff --git a/src/lib/elementary/efl_ui_win.c b/src/lib/elementary/efl_ui_win.c
index 2e24a00b99..ebf381477f 100644
--- a/src/lib/elementary/efl_ui_win.c
+++ b/src/lib/elementary/efl_ui_win.c
@@ -2178,13 +2178,13 @@ _win_event_add_cb(void *data, const Efl_Event *ev)
else if (array[i].desc == EFL_CANVAS_SCENE_EVENT_SCENE_FOCUS_IN)
{
if (!(sd->event_forward.focus_in++))
- evas_event_callback_add(sd->evas, EVAS_CALLBACK_FOCUS_IN,
+ evas_event_callback_add(sd->evas, EVAS_CALLBACK_CANVAS_FOCUS_IN,
_elm_win_evas_focus_in, win);
}
else if (array[i].desc == EFL_CANVAS_SCENE_EVENT_SCENE_FOCUS_OUT)
{
if (!(sd->event_forward.focus_out++))
- evas_event_callback_add(sd->evas, EVAS_CALLBACK_FOCUS_OUT,
+ evas_event_callback_add(sd->evas, EVAS_CALLBACK_CANVAS_FOCUS_OUT,
_elm_win_evas_focus_out, win);
}
else if (array[i].desc == EFL_CANVAS_SCENE_EVENT_OBJECT_FOCUS_IN)
@@ -2658,8 +2658,8 @@ _efl_ui_win_pointer_iterate(const Eo *obj, Efl_Ui_Win_Data *sd,
ptr = efl_input_pointer_instance_get( (Eo *) obj, (void **) &ptrdata);
if (!ptrdata) break;
- ptrdata->tool = evas_touch_point_list_nth_id_get(sd->evas, i);
- _efl_input_value_mark(ptrdata, EFL_INPUT_VALUE_TOOL);
+ ptrdata->touch_id = evas_touch_point_list_nth_id_get(sd->evas, i);
+ _efl_input_value_mark(ptrdata, EFL_INPUT_VALUE_TOUCH_ID);
// Note that "still" maps to "down" here.
state = evas_touch_point_list_nth_state_get(sd->evas, i);
diff --git a/src/lib/elementary/efl_ui_win.eo b/src/lib/elementary/efl_ui_win.eo
index 1a3e3a4db3..315770daf1 100644
--- a/src/lib/elementary/efl_ui_win.eo
+++ b/src/lib/elementary/efl_ui_win.eo
@@ -734,7 +734,7 @@ class Efl.Ui.Win extends Efl.Ui.Widget implements Efl.Canvas.Scene, Efl.Access.W
an object of type @Efl.Input.Pointer.
Each finger in a multi touch environment can then be identified
- by the @Efl.Input.Pointer.tool property. The order of the pointers
+ by the @Efl.Input.Pointer.touch_id property. The order of the pointers
in this iterator is not defined.
Note: If the input surface supports hovering input, some pointers
diff --git a/src/lib/elementary/elm_check.h b/src/lib/elementary/elm_check.h
index 492494a2f8..9cddb69c15 100644
--- a/src/lib/elementary/elm_check.h
+++ b/src/lib/elementary/elm_check.h
@@ -58,9 +58,6 @@
*
* @{
*/
-
-#define EFL_UI_CHECK_EVENT_CHANGED EFL_UI_NSTATE_EVENT_CHANGED
-
#ifndef EFL_NOLEGACY_API_SUPPORT
#include "elm_check_legacy.h"
#endif
diff --git a/src/lib/elementary/elm_dayselector.c b/src/lib/elementary/elm_dayselector.c
index 781ee0c868..d01495219c 100644
--- a/src/lib/elementary/elm_dayselector.c
+++ b/src/lib/elementary/elm_dayselector.c
@@ -204,11 +204,11 @@ _item_signal_emit_cb(void *data,
}
static void
-_item_clicked_cb(void *data, const Efl_Event *event EINA_UNUSED)
+_item_clicked_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info)
{
Elm_Dayselector_Item_Data *it = data;
- efl_event_callback_legacy_call(WIDGET(it), EFL_UI_CHECK_EVENT_CHANGED, (void *)it->day);
+ evas_object_smart_callback_call(WIDGET(it), "changed", event_info);
}
static Elm_Dayselector_Item_Data *
@@ -295,8 +295,7 @@ _elm_dayselector_content_set(Eo *obj, Elm_Dayselector_Data *sd, const char *item
snprintf(buf, sizeof(buf), "day%d,visible", _item_location_get(sd, it));
elm_layout_signal_emit(obj, buf, "elm");
- efl_event_callback_add
- (VIEW(it), EFL_UI_CHECK_EVENT_CHANGED, _item_clicked_cb, it);
+ evas_object_smart_callback_add(VIEW(it), "changed", _item_clicked_cb, it);
evas_object_event_callback_add
(VIEW(it), EVAS_CALLBACK_DEL, _item_del_cb, obj);
@@ -342,7 +341,7 @@ _elm_dayselector_content_unset(Eo *obj, Elm_Dayselector_Data *sd, const char *it
if (!content) return NULL;
sd->items = eina_list_remove(sd->items, it);
- efl_event_callback_del(content, EFL_UI_CHECK_EVENT_CHANGED, _item_clicked_cb, it);
+ evas_object_smart_callback_del_full(content, "changed", _item_clicked_cb, it);
evas_object_event_callback_del(content, EVAS_CALLBACK_DEL, _item_del_cb);
elm_object_signal_callback_del
diff --git a/src/lib/elementary/elm_flipselector.c b/src/lib/elementary/elm_flipselector.c
index f9ba061f75..53bc6d0ce9 100644
--- a/src/lib/elementary/elm_flipselector.c
+++ b/src/lib/elementary/elm_flipselector.c
@@ -473,7 +473,7 @@ _items_add(Evas_Object *obj)
}
EOLIAN static void
-_elm_flipselector_efl_ui_range_display_range_min_max_set(Eo *obj, Elm_Flipselector_Data *sd, double min, double max)
+_elm_flipselector_efl_ui_range_display_range_limits_set(Eo *obj, Elm_Flipselector_Data *sd, double min, double max)
{
if ((sd->val_min == min) && (sd->val_max == max)) return;
@@ -484,7 +484,7 @@ _elm_flipselector_efl_ui_range_display_range_min_max_set(Eo *obj, Elm_Flipselect
}
EOLIAN static void
-_elm_flipselector_efl_ui_range_display_range_min_max_get(const Eo *obj EINA_UNUSED, Elm_Flipselector_Data *sd, double *min, double *max)
+_elm_flipselector_efl_ui_range_display_range_limits_get(const Eo *obj EINA_UNUSED, Elm_Flipselector_Data *sd, double *min, double *max)
{
if (min) *min = sd->val_min;
if (max) *max = sd->val_max;
diff --git a/src/lib/elementary/elm_flipselector_eo.c b/src/lib/elementary/elm_flipselector_eo.c
index f4bdae836b..3ad73d3a17 100644
--- a/src/lib/elementary/elm_flipselector_eo.c
+++ b/src/lib/elementary/elm_flipselector_eo.c
@@ -76,10 +76,10 @@ Eina_Error _elm_flipselector_efl_ui_widget_theme_apply(Eo *obj, Elm_Flipselector
Eina_Bool _elm_flipselector_efl_ui_widget_widget_input_event_handler(Eo *obj, Elm_Flipselector_Data *pd, const Efl_Event *eo_event, Efl_Canvas_Object *source);
-void _elm_flipselector_efl_ui_range_display_range_min_max_set(Eo *obj, Elm_Flipselector_Data *pd, double min, double max);
+void _elm_flipselector_efl_ui_range_display_range_limits_set(Eo *obj, Elm_Flipselector_Data *pd, double min, double max);
-void _elm_flipselector_efl_ui_range_display_range_min_max_get(const Eo *obj, Elm_Flipselector_Data *pd, double *min, double *max);
+void _elm_flipselector_efl_ui_range_display_range_limits_get(const Eo *obj, Elm_Flipselector_Data *pd, double *min, double *max);
void _elm_flipselector_efl_ui_range_interactive_range_step_set(Eo *obj, Elm_Flipselector_Data *pd, double step);
@@ -122,8 +122,8 @@ _elm_flipselector_class_initializer(Efl_Class *klass)
EFL_OBJECT_OP_FUNC(efl_constructor, _elm_flipselector_efl_object_constructor),
EFL_OBJECT_OP_FUNC(efl_ui_widget_theme_apply, _elm_flipselector_efl_ui_widget_theme_apply),
EFL_OBJECT_OP_FUNC(efl_ui_widget_input_event_handler, _elm_flipselector_efl_ui_widget_widget_input_event_handler),
- EFL_OBJECT_OP_FUNC(efl_ui_range_min_max_set, _elm_flipselector_efl_ui_range_display_range_min_max_set),
- EFL_OBJECT_OP_FUNC(efl_ui_range_min_max_get, _elm_flipselector_efl_ui_range_display_range_min_max_get),
+ EFL_OBJECT_OP_FUNC(efl_ui_range_limits_set, _elm_flipselector_efl_ui_range_display_range_limits_set),
+ EFL_OBJECT_OP_FUNC(efl_ui_range_limits_get, _elm_flipselector_efl_ui_range_display_range_limits_get),
EFL_OBJECT_OP_FUNC(efl_ui_range_step_set, _elm_flipselector_efl_ui_range_interactive_range_step_set),
EFL_OBJECT_OP_FUNC(efl_ui_range_step_get, _elm_flipselector_efl_ui_range_interactive_range_step_get),
EFL_OBJECT_OP_FUNC(efl_ui_range_value_set, _elm_flipselector_efl_ui_range_display_range_value_set),
diff --git a/src/lib/elementary/elm_interface_scrollable.c b/src/lib/elementary/elm_interface_scrollable.c
index 9db380ed68..02b808361c 100644
--- a/src/lib/elementary/elm_interface_scrollable.c
+++ b/src/lib/elementary/elm_interface_scrollable.c
@@ -4825,8 +4825,8 @@ _elm_interface_scrollable_content_loop_set(Eo *obj EINA_UNUSED, Elm_Scrollable_S
EOLIAN static void
_elm_interface_scrollable_content_loop_get(const Eo *obj EINA_UNUSED, Elm_Scrollable_Smart_Interface_Data *sid, Eina_Bool *loop_h, Eina_Bool *loop_v)
{
- *loop_h = sid->loop_h;
- *loop_v = sid->loop_v;
+ if (loop_h) *loop_h = sid->loop_h;
+ if (loop_v) *loop_v = sid->loop_v;
}
EOLIAN static void
diff --git a/src/lib/elementary/elm_slider.c b/src/lib/elementary/elm_slider.c
index fe148057c4..e57893c795 100644
--- a/src/lib/elementary/elm_slider.c
+++ b/src/lib/elementary/elm_slider.c
@@ -62,7 +62,7 @@ _delay_change(void *data)
ELM_SLIDER_DATA_GET(data, sd);
sd->delay = NULL;
- efl_event_callback_legacy_call(data, EFL_UI_SLIDER_EVENT_DELAY_CHANGED, NULL);
+ evas_object_smart_callback_call(data, SIG_DELAY_CHANGED, NULL);
if (_elm_config->atspi_mode)
efl_access_value_changed_signal_emit(data);
@@ -536,7 +536,7 @@ void
_elm_slider_val_fetch(Evas_Object *obj, Elm_Slider_Data *pd, Eina_Bool user_event)
{
double posx = 0.0, posy = 0.0, pos = 0.0, val;
- double posx2 = 0.0, posy2 = 0.0, pos2 = 0.0, val2;
+ double posx2 = 0.0, posy2 = 0.0, pos2 = 0.0, val2 = 0.0;
Eina_Bool inverted = EINA_FALSE;
Eina_Bool evented = EINA_FALSE;
@@ -1357,13 +1357,13 @@ elm_slider_range_get(const Evas_Object *obj, double *from, double *to)
EAPI void
elm_slider_min_max_set(Evas_Object *obj, double min, double max)
{
- efl_ui_range_min_max_set(obj, min, max);
+ efl_ui_range_limits_set(obj, min, max);
}
EAPI void
elm_slider_min_max_get(const Evas_Object *obj, double *min, double *max)
{
- efl_ui_range_min_max_get(obj, min, max);
+ efl_ui_range_limits_get(obj, min, max);
}
EAPI void
diff --git a/src/lib/elementary/elm_spinner.c b/src/lib/elementary/elm_spinner.c
index 3c35f0e2ce..ba22b6fa06 100644
--- a/src/lib/elementary/elm_spinner.c
+++ b/src/lib/elementary/elm_spinner.c
@@ -1372,13 +1372,13 @@ elm_spinner_add(Evas_Object *parent)
EAPI void
elm_spinner_min_max_set(Evas_Object *obj, double min, double max)
{
- efl_ui_range_min_max_set(obj, min, max);
+ efl_ui_range_limits_set(obj, min, max);
}
EAPI void
elm_spinner_min_max_get(const Evas_Object *obj, double *min, double *max)
{
- efl_ui_range_min_max_get(obj, min, max);
+ efl_ui_range_limits_get(obj, min, max);
}
EAPI void
@@ -1449,7 +1449,7 @@ _elm_spinner_label_format_get(const Eo *obj EINA_UNUSED, Elm_Spinner_Data *sd)
}
EOLIAN static void
-_elm_spinner_efl_ui_range_display_range_min_max_set(Eo *obj, Elm_Spinner_Data *sd, double min, double max)
+_elm_spinner_efl_ui_range_display_range_limits_set(Eo *obj, Elm_Spinner_Data *sd, double min, double max)
{
if ((sd->val_min == min) && (sd->val_max == max)) return;
@@ -1464,7 +1464,7 @@ _elm_spinner_efl_ui_range_display_range_min_max_set(Eo *obj, Elm_Spinner_Data *s
}
EOLIAN static void
-_elm_spinner_efl_ui_range_display_range_min_max_get(const Eo *obj EINA_UNUSED, Elm_Spinner_Data *sd, double *min, double *max)
+_elm_spinner_efl_ui_range_display_range_limits_get(const Eo *obj EINA_UNUSED, Elm_Spinner_Data *sd, double *min, double *max)
{
if (min) *min = sd->val_min;
if (max) *max = sd->val_max;
diff --git a/src/lib/elementary/elm_spinner_eo.c b/src/lib/elementary/elm_spinner_eo.c
index d8ac147ba0..f4dde7d242 100644
--- a/src/lib/elementary/elm_spinner_eo.c
+++ b/src/lib/elementary/elm_spinner_eo.c
@@ -222,10 +222,10 @@ Eina_Bool _elm_spinner_efl_ui_focus_object_on_focus_update(Eo *obj, Elm_Spinner_
Eina_Bool _elm_spinner_efl_ui_widget_widget_input_event_handler(Eo *obj, Elm_Spinner_Data *pd, const Efl_Event *eo_event, Efl_Canvas_Object *source);
-void _elm_spinner_efl_ui_range_display_range_min_max_set(Eo *obj, Elm_Spinner_Data *pd, double min, double max);
+void _elm_spinner_efl_ui_range_display_range_limits_set(Eo *obj, Elm_Spinner_Data *pd, double min, double max);
-void _elm_spinner_efl_ui_range_display_range_min_max_get(const Eo *obj, Elm_Spinner_Data *pd, double *min, double *max);
+void _elm_spinner_efl_ui_range_display_range_limits_get(const Eo *obj, Elm_Spinner_Data *pd, double *min, double *max);
void _elm_spinner_efl_ui_range_interactive_range_step_set(Eo *obj, Elm_Spinner_Data *pd, double step);
@@ -288,8 +288,8 @@ _elm_spinner_class_initializer(Efl_Class *klass)
EFL_OBJECT_OP_FUNC(efl_ui_widget_on_access_update, _elm_spinner_efl_ui_widget_on_access_update),
EFL_OBJECT_OP_FUNC(efl_ui_focus_object_on_focus_update, _elm_spinner_efl_ui_focus_object_on_focus_update),
EFL_OBJECT_OP_FUNC(efl_ui_widget_input_event_handler, _elm_spinner_efl_ui_widget_widget_input_event_handler),
- EFL_OBJECT_OP_FUNC(efl_ui_range_min_max_set, _elm_spinner_efl_ui_range_display_range_min_max_set),
- EFL_OBJECT_OP_FUNC(efl_ui_range_min_max_get, _elm_spinner_efl_ui_range_display_range_min_max_get),
+ EFL_OBJECT_OP_FUNC(efl_ui_range_limits_set, _elm_spinner_efl_ui_range_display_range_limits_set),
+ EFL_OBJECT_OP_FUNC(efl_ui_range_limits_get, _elm_spinner_efl_ui_range_display_range_limits_get),
EFL_OBJECT_OP_FUNC(efl_ui_range_step_set, _elm_spinner_efl_ui_range_interactive_range_step_set),
EFL_OBJECT_OP_FUNC(efl_ui_range_step_get, _elm_spinner_efl_ui_range_interactive_range_step_get),
EFL_OBJECT_OP_FUNC(efl_ui_range_value_set, _elm_spinner_efl_ui_range_display_range_value_set),
diff --git a/src/lib/elementary/meson.build b/src/lib/elementary/meson.build
index af84503512..3ed70ff15c 100644
--- a/src/lib/elementary/meson.build
+++ b/src/lib/elementary/meson.build
@@ -46,7 +46,6 @@ pub_eo_files = [
'efl_ui_check.eo',
'efl_ui_flip.eo',
'efl_ui_frame.eo',
- 'efl_ui_stack.eo',
'efl_ui_image.eo',
'efl_ui_image_zoomable.eo',
'efl_ui_layout.eo',
@@ -59,6 +58,9 @@ pub_eo_files = [
'efl_ui_panes.eo',
'efl_ui_progressbar.eo',
'efl_ui_radio.eo',
+ 'efl_ui_radio_group.eo',
+ 'efl_ui_radio_box.eo',
+ 'efl_ui_radio_group_impl.eo',
'efl_ui_slider.eo',
'efl_ui_slider_interval.eo',
'efl_ui_spin.eo',
@@ -160,6 +162,7 @@ pub_eo_files = [
'efl_ui_active_view_view_manager_stack.eo',
'efl_ui_active_view_indicator.eo',
'efl_ui_active_view_indicator_icon.eo',
+ 'efl_ui_active_view_util.eo',
'efl_ui_tab_pager.eo',
'efl_ui_tab_bar.eo',
'efl_ui_tab_page.eo',
@@ -292,7 +295,6 @@ elementary_headers_unstable = [
'efl_ui_widget_flip.h',
'elm_widget_flipselector.h',
'efl_ui_widget_frame.h',
- 'efl_ui_stack_private.h',
'efl_ui_animation_view_private.h',
'elm_widget_gengrid.h',
'elm_widget_genlist.h',
@@ -778,7 +780,6 @@ elementary_src = [
'elm_flipselector.c',
'elm_font.c',
'efl_ui_frame.c',
- 'efl_ui_stack.c',
'elm_gengrid.c',
'elm_genlist.c',
'elm_gesture_layer.c',
@@ -821,6 +822,8 @@ elementary_src = [
'elm_prefs_data.c',
'efl_ui_progressbar.c',
'efl_ui_radio.c',
+ 'efl_ui_radio_group_impl.c',
+ 'efl_ui_radio_box.c',
'elm_route.c',
'elm_scroller.c',
'elm_segment_control.c',
@@ -926,6 +929,7 @@ elementary_src = [
'efl_ui_active_view_view_manager_stack.c',
'efl_ui_active_view_indicator.c',
'efl_ui_active_view_indicator_icon.c',
+ 'efl_ui_active_view_util.c',
'efl_ui_focus_graph.h',
'efl_ui_focus_graph.c',
'efl_ui_tab_pager.c',