summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/bin/elementary/test_nstate.c34
-rw-r--r--src/lib/elementary/efl_ui_check.eo4
-rw-r--r--src/lib/elementary/efl_ui_nstate.c2
-rw-r--r--src/lib/elementary/efl_ui_nstate.eo2
-rw-r--r--src/lib/elementary/efl_ui_radio.eo3
-rw-r--r--src/lib/elementary/elm_check.h1
-rw-r--r--src/lib/elementary/elm_radio.h1
7 files changed, 17 insertions, 30 deletions
diff --git a/src/bin/elementary/test_nstate.c b/src/bin/elementary/test_nstate.c
index 98dcfd4269..ebc97d4f3c 100644
--- a/src/bin/elementary/test_nstate.c
+++ b/src/bin/elementary/test_nstate.c
@@ -4,16 +4,10 @@
4#include <Elementary.h> 4#include <Elementary.h>
5 5
6static void 6static void
7_state_changed_cb(void *d EINA_UNUSED, Evas_Object *o, void *ei EINA_UNUSED) 7_state_changed_cb(void *data EINA_UNUSED, const Efl_Event *ev)
8{ 8{
9 char buf[100]; 9 int val = efl_ui_nstate_value_get(ev->object);
10 int val; 10 efl_text_set(ev->object, eina_slstr_printf("nstate = %d", val));
11
12 val = efl_ui_nstate_value_get(o);
13
14 printf("nstate widget state: %d\n", val);
15 sprintf(buf, "nstate = %d", val);
16 elm_object_text_set(o, buf);
17} 11}
18 12
19void 13void
@@ -21,21 +15,19 @@ test_nstate(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_in
21{ 15{
22 Evas_Object *win, *bx, *nstate; 16 Evas_Object *win, *bx, *nstate;
23 17
24 win = elm_win_util_standard_add("nstate", "nstate"); 18 win = efl_add(EFL_UI_WIN_CLASS, NULL,
25 elm_win_autodel_set(win, EINA_TRUE); 19 efl_text_set(efl_added, "N-state widget"),
20 elm_win_autodel_set(efl_added, EINA_TRUE));
26 21
27 bx = elm_box_add(win); 22 bx = efl_add(EFL_UI_BOX_CLASS, win);
28 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); 23 efl_content_set(win, bx);
29 elm_win_resize_object_add(win, bx);
30 evas_object_show(bx);
31 24
32 nstate = efl_add(EFL_UI_NSTATE_CLASS, win); 25 nstate = efl_add(EFL_UI_NSTATE_CLASS, win);
26 efl_event_callback_add(nstate, EFL_UI_NSTATE_EVENT_CHANGED,
27 _state_changed_cb, NULL);
33 efl_ui_nstate_count_set(nstate, 5); 28 efl_ui_nstate_count_set(nstate, 5);
34 elm_object_text_set(nstate, "nstate = 0"); 29 efl_text_set(nstate, "nstate = 0");
35 elm_box_pack_end(bx, nstate); 30 efl_pack(bx, nstate);
36 evas_object_smart_callback_add(nstate, "state,changed",
37 _state_changed_cb, NULL);
38 31
39 evas_object_resize(win, 100, 100); 32 efl_gfx_size_set(win, EINA_SIZE2D(120, 80));
40 evas_object_show(win);
41} 33}
diff --git a/src/lib/elementary/efl_ui_check.eo b/src/lib/elementary/efl_ui_check.eo
index 441227776d..44d79d9272 100644
--- a/src/lib/elementary/efl_ui_check.eo
+++ b/src/lib/elementary/efl_ui_check.eo
@@ -32,8 +32,4 @@ class Efl.Ui.Check (Efl.Ui.Nstate, Efl.Access.Widget.Action)
32 Efl.Access.state_set { get; } 32 Efl.Access.state_set { get; }
33 Efl.Access.Widget.Action.elm_actions { get; } 33 Efl.Access.Widget.Action.elm_actions { get; }
34 } 34 }
35 events {
36 changed; [[This is called whenever the user changes the state of the check
37 objects (event_info is always NULL).]]
38 }
39} 35}
diff --git a/src/lib/elementary/efl_ui_nstate.c b/src/lib/elementary/efl_ui_nstate.c
index 99c3a766d5..14313763ef 100644
--- a/src/lib/elementary/efl_ui_nstate.c
+++ b/src/lib/elementary/efl_ui_nstate.c
@@ -73,7 +73,7 @@ _state_active(Evas_Object *obj, Efl_Ui_Nstate_Data *sd)
73 elm_layout_signal_emit(obj, buf, "elm"); 73 elm_layout_signal_emit(obj, buf, "elm");
74 edje_object_message_signal_process(elm_layout_edje_get(obj)); 74 edje_object_message_signal_process(elm_layout_edje_get(obj));
75 elm_layout_sizing_eval(obj); 75 elm_layout_sizing_eval(obj);
76 efl_event_callback_legacy_call(obj, EFL_UI_NSTATE_EVENT_STATE_CHANGED, NULL); 76 efl_event_callback_legacy_call(obj, EFL_UI_NSTATE_EVENT_CHANGED, NULL);
77} 77}
78 78
79EOLIAN static int 79EOLIAN static int
diff --git a/src/lib/elementary/efl_ui_nstate.eo b/src/lib/elementary/efl_ui_nstate.eo
index 7f8bb978f6..bdf5da9e9d 100644
--- a/src/lib/elementary/efl_ui_nstate.eo
+++ b/src/lib/elementary/efl_ui_nstate.eo
@@ -34,6 +34,6 @@ class Efl.Ui.Nstate(Efl.Ui.Button)
34 Elm.Widget.widget_event; 34 Elm.Widget.widget_event;
35 } 35 }
36 events { 36 events {
37 state,changed; [[Called when nstate widget changed]] 37 changed; [[Called when the value changed.]]
38 } 38 }
39} 39}
diff --git a/src/lib/elementary/efl_ui_radio.eo b/src/lib/elementary/efl_ui_radio.eo
index ff6d0acb21..e4e5b9e368 100644
--- a/src/lib/elementary/efl_ui_radio.eo
+++ b/src/lib/elementary/efl_ui_radio.eo
@@ -71,7 +71,4 @@ class Efl.Ui.Radio (Efl.Ui.Check, Efl.Access.Widget.Action, Efl.Content)
71 Efl.Content.content_unset; 71 Efl.Content.content_unset;
72 Efl.Ui.Nstate.value { set; get; } 72 Efl.Ui.Nstate.value { set; get; }
73 } 73 }
74 events {
75 changed; [[Called when radio changed]]
76 }
77} 74}
diff --git a/src/lib/elementary/elm_check.h b/src/lib/elementary/elm_check.h
index 0cf6b821c7..b0e404e8bc 100644
--- a/src/lib/elementary/elm_check.h
+++ b/src/lib/elementary/elm_check.h
@@ -61,6 +61,7 @@
61 61
62#ifdef EFL_EO_API_SUPPORT 62#ifdef EFL_EO_API_SUPPORT
63#include "efl_ui_check_eo.h" 63#include "efl_ui_check_eo.h"
64#define EFL_UI_CHECK_EVENT_CHANGED EFL_UI_NSTATE_EVENT_CHANGED
64#endif 65#endif
65#ifndef EFL_NOLEGACY_API_SUPPORT 66#ifndef EFL_NOLEGACY_API_SUPPORT
66#include "elm_check_legacy.h" 67#include "elm_check_legacy.h"
diff --git a/src/lib/elementary/elm_radio.h b/src/lib/elementary/elm_radio.h
index 03c266dc80..4a58cac81d 100644
--- a/src/lib/elementary/elm_radio.h
+++ b/src/lib/elementary/elm_radio.h
@@ -66,6 +66,7 @@
66 66
67#ifdef EFL_EO_API_SUPPORT 67#ifdef EFL_EO_API_SUPPORT
68#include "efl_ui_radio_eo.h" 68#include "efl_ui_radio_eo.h"
69#define EFL_UI_RADIO_EVENT_CHANGED EFL_UI_NSTATE_EVENT_CHANGED
69#endif 70#endif
70#ifndef EFL_NOLEGACY_API_SUPPORT 71#ifndef EFL_NOLEGACY_API_SUPPORT
71#include "elm_radio_legacy.h" 72#include "elm_radio_legacy.h"