diff options
author | Amitesh Singh <amitesh.sh@samsung.com> | 2017-11-02 17:26:12 +0900 |
---|---|---|
committer | Amitesh Singh <amitesh.sh@samsung.com> | 2017-11-02 17:28:48 +0900 |
commit | 225b70465158e4886d0150ece63190823c6a92d4 (patch) | |
tree | 1e1b9d8ec67a50dd1f6b3158ee265cbfb4b54948 /src | |
parent | 83493bba73aa44b91467408c3e7789c4a05733e8 (diff) |
Efl.Ui.Radio: remove value{} api
Efl.Ui.Nstate already implements value{}.
@fix
Diffstat (limited to 'src')
-rw-r--r-- | src/bin/elementary/test_bg.c | 4 | ||||
-rw-r--r-- | src/bin/elementary/test_panes.c | 8 | ||||
-rw-r--r-- | src/bin/elementary/test_photocam.c | 2 | ||||
-rw-r--r-- | src/lib/elementary/efl_ui_radio.c | 32 | ||||
-rw-r--r-- | src/lib/elementary/efl_ui_radio.eo | 17 | ||||
-rw-r--r-- | src/lib/elementary/elm_radio_legacy.h | 23 |
6 files changed, 53 insertions, 33 deletions
diff --git a/src/bin/elementary/test_bg.c b/src/bin/elementary/test_bg.c index b8fde191dd..53c05ae38f 100644 --- a/src/bin/elementary/test_bg.c +++ b/src/bin/elementary/test_bg.c | |||
@@ -374,7 +374,7 @@ _cb_radio_changed_scale_type(void *data, const Efl_Event *ev) | |||
374 | { | 374 | { |
375 | Evas_Object *o_bg = data; | 375 | Evas_Object *o_bg = data; |
376 | 376 | ||
377 | efl_ui_image_scale_type_set(o_bg, efl_ui_radio_value_get(ev->object)); | 377 | efl_ui_image_scale_type_set(o_bg, efl_ui_nstate_value_get(ev->object)); |
378 | } | 378 | } |
379 | 379 | ||
380 | static void | 380 | static void |
@@ -464,7 +464,7 @@ test_bg_scale_type(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *e | |||
464 | efl_event_callback_add(efl_added, EFL_UI_RADIO_EVENT_CHANGED, _cb_radio_changed_scale_type, o_bg), | 464 | efl_event_callback_add(efl_added, EFL_UI_RADIO_EVENT_CHANGED, _cb_radio_changed_scale_type, o_bg), |
465 | efl_pack(hbox, efl_added)); | 465 | efl_pack(hbox, efl_added)); |
466 | 466 | ||
467 | efl_ui_radio_value_set(rdg, EFL_UI_IMAGE_SCALE_TYPE_FILL); | 467 | efl_ui_nstate_value_set(rdg, EFL_UI_IMAGE_SCALE_TYPE_FILL); |
468 | 468 | ||
469 | efl_add(EFL_UI_CHECK_CLASS, hbox, | 469 | efl_add(EFL_UI_CHECK_CLASS, hbox, |
470 | efl_text_set(efl_added, "Bg Color"), | 470 | efl_text_set(efl_added, "Bg Color"), |
diff --git a/src/bin/elementary/test_panes.c b/src/bin/elementary/test_panes.c index a4d6894b0f..bb4e7ff893 100644 --- a/src/bin/elementary/test_panes.c +++ b/src/bin/elementary/test_panes.c | |||
@@ -123,24 +123,24 @@ test_panes_minsize(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *e | |||
123 | efl_add(EFL_UI_BUTTON_CLASS, win, | 123 | efl_add(EFL_UI_BUTTON_CLASS, win, |
124 | efl_text_set(efl_added, "Left - user set min size(110,110)"), | 124 | efl_text_set(efl_added, "Left - user set min size(110,110)"), |
125 | efl_gfx_size_hint_min_set(efl_added, EINA_SIZE2D(110, 110)), | 125 | efl_gfx_size_hint_min_set(efl_added, EINA_SIZE2D(110, 110)), |
126 | efl_content_set(efl_part(panes, "first"), efl_added) | 126 | efl_content_set(efl_part(panes, "elm.swallow.left"), efl_added) |
127 | ); | 127 | ); |
128 | 128 | ||
129 | panes_h = efl_add(EFL_UI_PANES_CLASS, win, | 129 | panes_h = efl_add(EFL_UI_PANES_CLASS, win, |
130 | efl_ui_direction_set(efl_added, EFL_UI_DIR_HORIZONTAL), | 130 | efl_ui_direction_set(efl_added, EFL_UI_DIR_HORIZONTAL), |
131 | efl_content_set(efl_part(panes, "second"), efl_added) | 131 | efl_content_set(efl_part(panes, "elm.swallow.right"), efl_added) |
132 | ); | 132 | ); |
133 | efl_add(EFL_UI_BUTTON_CLASS, win, | 133 | efl_add(EFL_UI_BUTTON_CLASS, win, |
134 | efl_text_set(efl_added, "Up - user set min size(10,0)"), | 134 | efl_text_set(efl_added, "Up - user set min size(10,0)"), |
135 | efl_gfx_size_hint_min_set(efl_added, EINA_SIZE2D(10, 0)), | 135 | efl_gfx_size_hint_min_set(efl_added, EINA_SIZE2D(10, 0)), |
136 | efl_content_set(efl_part(panes_h, "first"), efl_added) | 136 | efl_content_set(efl_part(panes_h, "elm.swallow.left"), efl_added) |
137 | ); | 137 | ); |
138 | efl_ui_panes_part_hint_min_allow_set(efl_part(panes_h, "first"), EINA_TRUE); | 138 | efl_ui_panes_part_hint_min_allow_set(efl_part(panes_h, "first"), EINA_TRUE); |
139 | 139 | ||
140 | efl_add(EFL_UI_BUTTON_CLASS, win, | 140 | efl_add(EFL_UI_BUTTON_CLASS, win, |
141 | efl_text_set(efl_added, "Down - min size 50 40"), | 141 | efl_text_set(efl_added, "Down - min size 50 40"), |
142 | efl_gfx_size_hint_min_set(efl_added, EINA_SIZE2D(50, 40)), | 142 | efl_gfx_size_hint_min_set(efl_added, EINA_SIZE2D(50, 40)), |
143 | efl_content_set(efl_part(panes_h, "second"), efl_added) | 143 | efl_content_set(efl_part(panes_h, "elm.swallow.right"), efl_added) |
144 | ); | 144 | ); |
145 | 145 | ||
146 | efl_gfx_size_set(win, EINA_SIZE2D(320, 400)); | 146 | efl_gfx_size_set(win, EINA_SIZE2D(320, 400)); |
diff --git a/src/bin/elementary/test_photocam.c b/src/bin/elementary/test_photocam.c index 162834e6e2..58e34e1a31 100644 --- a/src/bin/elementary/test_photocam.c +++ b/src/bin/elementary/test_photocam.c | |||
@@ -653,7 +653,7 @@ static const struct { | |||
653 | static void | 653 | static void |
654 | _radio_changed_cb(void *data, Evas_Object *obj, void *event_info EINA_UNUSED) | 654 | _radio_changed_cb(void *data, Evas_Object *obj, void *event_info EINA_UNUSED) |
655 | { | 655 | { |
656 | unsigned char index = efl_ui_radio_value_get(obj); | 656 | unsigned char index = efl_ui_nstate_value_get(obj); |
657 | efl_ui_image_icon_set(data, photocam_icons[index].name); | 657 | efl_ui_image_icon_set(data, photocam_icons[index].name); |
658 | printf("icon is %s\n", efl_ui_image_icon_get(data)); | 658 | printf("icon is %s\n", efl_ui_image_icon_get(data)); |
659 | } | 659 | } |
diff --git a/src/lib/elementary/efl_ui_radio.c b/src/lib/elementary/efl_ui_radio.c index c2edeb7b21..89d0578066 100644 --- a/src/lib/elementary/efl_ui_radio.c +++ b/src/lib/elementary/efl_ui_radio.c | |||
@@ -202,13 +202,6 @@ _access_state_cb(void *data EINA_UNUSED, Evas_Object *obj) | |||
202 | return strdup(E_("State: Off")); | 202 | return strdup(E_("State: Off")); |
203 | } | 203 | } |
204 | 204 | ||
205 | EAPI Evas_Object * | ||
206 | elm_radio_add(Evas_Object *parent) | ||
207 | { | ||
208 | EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL); | ||
209 | return efl_add(MY_CLASS, parent, efl_canvas_object_legacy_ctor(efl_added)); | ||
210 | } | ||
211 | |||
212 | EOLIAN static Eo * | 205 | EOLIAN static Eo * |
213 | _efl_ui_radio_efl_object_constructor(Eo *obj, Efl_Ui_Radio_Data *pd) | 206 | _efl_ui_radio_efl_object_constructor(Eo *obj, Efl_Ui_Radio_Data *pd) |
214 | { | 207 | { |
@@ -288,7 +281,7 @@ _efl_ui_radio_state_value_get(Eo *obj EINA_UNUSED, Efl_Ui_Radio_Data *sd) | |||
288 | } | 281 | } |
289 | 282 | ||
290 | EOLIAN static void | 283 | EOLIAN static void |
291 | _efl_ui_radio_value_set(Eo *obj EINA_UNUSED, Efl_Ui_Radio_Data *sd, int value) | 284 | _efl_ui_radio_efl_ui_nstate_value_set(Eo *obj EINA_UNUSED, Efl_Ui_Radio_Data *sd, int value) |
292 | { | 285 | { |
293 | if (value == sd->group->value) return; | 286 | if (value == sd->group->value) return; |
294 | sd->group->value = value; | 287 | sd->group->value = value; |
@@ -297,7 +290,7 @@ _efl_ui_radio_value_set(Eo *obj EINA_UNUSED, Efl_Ui_Radio_Data *sd, int value) | |||
297 | } | 290 | } |
298 | 291 | ||
299 | EOLIAN static int | 292 | EOLIAN static int |
300 | _efl_ui_radio_value_get(Eo *obj EINA_UNUSED, Efl_Ui_Radio_Data *sd) | 293 | _efl_ui_radio_efl_ui_nstate_value_get(Eo *obj EINA_UNUSED, Efl_Ui_Radio_Data *sd) |
301 | { | 294 | { |
302 | return sd->group->value; | 295 | return sd->group->value; |
303 | } | 296 | } |
@@ -384,3 +377,24 @@ ELM_LAYOUT_TEXT_ALIASES_IMPLEMENT(MY_CLASS_PFX) | |||
384 | ELM_LAYOUT_TEXT_ALIASES_OPS(MY_CLASS_PFX) | 377 | ELM_LAYOUT_TEXT_ALIASES_OPS(MY_CLASS_PFX) |
385 | 378 | ||
386 | #include "efl_ui_radio.eo.c" | 379 | #include "efl_ui_radio.eo.c" |
380 | |||
381 | /* Legacy APIs */ | ||
382 | |||
383 | EAPI Evas_Object * | ||
384 | elm_radio_add(Evas_Object *parent) | ||
385 | { | ||
386 | EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL); | ||
387 | return efl_add(MY_CLASS, parent, efl_canvas_object_legacy_ctor(efl_added)); | ||
388 | } | ||
389 | |||
390 | EAPI void | ||
391 | elm_radio_value_set(Evas_Object *obj, int value) | ||
392 | { | ||
393 | efl_ui_nstate_value_set(obj, value); | ||
394 | } | ||
395 | |||
396 | EAPI int | ||
397 | elm_radio_value_get(const Evas_Object *obj) | ||
398 | { | ||
399 | return efl_ui_nstate_value_get(obj); | ||
400 | } | ||
diff --git a/src/lib/elementary/efl_ui_radio.eo b/src/lib/elementary/efl_ui_radio.eo index d3a3bfd35a..ff3f5752b3 100644 --- a/src/lib/elementary/efl_ui_radio.eo +++ b/src/lib/elementary/efl_ui_radio.eo | |||
@@ -20,22 +20,6 @@ class Efl.Ui.Radio (Efl.Ui.Check, Elm.Interface.Atspi_Widget_Action) | |||
20 | value: int; [[The value to use if this radio object is selected]] | 20 | value: int; [[The value to use if this radio object is selected]] |
21 | } | 21 | } |
22 | } | 22 | } |
23 | @property value { | ||
24 | set { | ||
25 | [[Set the value of the radio group. | ||
26 | |||
27 | This sets the value of the radio group and will also set the | ||
28 | value if pointed to, to the value supplied, but will not call | ||
29 | any callbacks. | ||
30 | ]] | ||
31 | } | ||
32 | get { | ||
33 | [[Get the value of the radio group]] | ||
34 | } | ||
35 | values { | ||
36 | value: int; [[The value to use for the group]] | ||
37 | } | ||
38 | } | ||
39 | @property value_pointer { | 23 | @property value_pointer { |
40 | set { | 24 | set { |
41 | [[Set a convenience pointer to a integer to change when radio group | 25 | [[Set a convenience pointer to a integer to change when radio group |
@@ -83,6 +67,7 @@ class Efl.Ui.Radio (Efl.Ui.Check, Elm.Interface.Atspi_Widget_Action) | |||
83 | Elm.Widget.widget_event; | 67 | Elm.Widget.widget_event; |
84 | Efl.Access.state_set { get; } | 68 | Efl.Access.state_set { get; } |
85 | Elm.Interface.Atspi_Widget_Action.elm_actions { get; } | 69 | Elm.Interface.Atspi_Widget_Action.elm_actions { get; } |
70 | Efl.Ui.Nstate.value { set; get; } | ||
86 | } | 71 | } |
87 | events { | 72 | events { |
88 | changed; [[Called when radio changed]] | 73 | changed; [[Called when radio changed]] |
diff --git a/src/lib/elementary/elm_radio_legacy.h b/src/lib/elementary/elm_radio_legacy.h index 67aa0184b2..b9a58db7df 100644 --- a/src/lib/elementary/elm_radio_legacy.h +++ b/src/lib/elementary/elm_radio_legacy.h | |||
@@ -8,4 +8,25 @@ | |||
8 | */ | 8 | */ |
9 | EAPI Evas_Object *elm_radio_add(Evas_Object *parent); | 9 | EAPI Evas_Object *elm_radio_add(Evas_Object *parent); |
10 | 10 | ||
11 | #include "efl_ui_radio.eo.legacy.h" \ No newline at end of file | 11 | /** |
12 | * @brief Set the value of the radio group. | ||
13 | * | ||
14 | * This sets the value of the radio group and will also set the value if | ||
15 | * pointed to, to the value supplied, but will not call any callbacks. | ||
16 | * | ||
17 | * @param[in] value The value to use for the group | ||
18 | * | ||
19 | * @ingroup Elm_Radio | ||
20 | */ | ||
21 | EAPI void elm_radio_value_set(Evas_Object *obj, int value); | ||
22 | |||
23 | /** | ||
24 | * @brief Get the value of the radio group | ||
25 | * | ||
26 | * @return The value to use for the group | ||
27 | * | ||
28 | * @ingroup Elm_Radio | ||
29 | */ | ||
30 | EAPI int elm_radio_value_get(const Efl_Ui_Radio *obj); | ||
31 | |||
32 | #include "efl_ui_radio.eo.legacy.h" | ||