summaryrefslogtreecommitdiff
path: root/src/lib/elementary
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2017-09-20 11:16:17 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2017-09-21 12:27:34 +0900
commit112edeeea807a5dc499d003729c4a8cad829c5a6 (patch)
tree1d37de5673d3ba7d7670036b02101dd41eb112e0 /src/lib/elementary
parent28b387821df6f017352b5062cd78f490c0963b9b (diff)
elm: Remove range "span_size" API in EO
Reasons: - This API has been confused with the min size of the widget, resulting in badly laid out applications. - The EO API was not very nice (Range is about numbers, the Gfx size hint in a part is really ugly). While I understand the value of this API and how it can be used in scalable applications, it is in fact not absolutely necessary. Alternatively to that span size, the widget min size can already be defined from the application side, or the widget can simply be expanded to fill in its parent. This can obviously be reinstated later if the need arises for EO. For now, keep this feature as legacy-only.
Diffstat (limited to 'src/lib/elementary')
-rw-r--r--src/lib/elementary/efl_ui_layout.c5
-rw-r--r--src/lib/elementary/efl_ui_progressbar.c55
-rw-r--r--src/lib/elementary/efl_ui_progressbar.eo2
-rw-r--r--src/lib/elementary/efl_ui_progressbar_part.eo3
-rw-r--r--src/lib/elementary/efl_ui_progressbar_private.h23
-rw-r--r--src/lib/elementary/efl_ui_slider.c89
-rw-r--r--src/lib/elementary/efl_ui_slider.eo2
-rw-r--r--src/lib/elementary/efl_ui_slider_part.eo8
-rw-r--r--src/lib/elementary/efl_ui_slider_private.h23
9 files changed, 53 insertions, 157 deletions
diff --git a/src/lib/elementary/efl_ui_layout.c b/src/lib/elementary/efl_ui_layout.c
index 24130d71b4..71168666ce 100644
--- a/src/lib/elementary/efl_ui_layout.c
+++ b/src/lib/elementary/efl_ui_layout.c
@@ -1042,8 +1042,7 @@ end:
1042} 1042}
1043 1043
1044EAPI Evas_Object * 1044EAPI Evas_Object *
1045elm_layout_content_get(const Evas_Object *obj, 1045elm_layout_content_get(const Evas_Object *obj, const char *swallow)
1046 const char *swallow)
1047{ 1046{
1048 EFL_UI_LAYOUT_CHECK(obj) NULL; 1047 EFL_UI_LAYOUT_CHECK(obj) NULL;
1049 if (!swallow) 1048 if (!swallow)
@@ -1051,6 +1050,8 @@ elm_layout_content_get(const Evas_Object *obj,
1051 swallow = elm_widget_default_content_part_get(obj); 1050 swallow = elm_widget_default_content_part_get(obj);
1052 if (!swallow) return NULL; 1051 if (!swallow) return NULL;
1053 } 1052 }
1053 else if (!_elm_layout_part_aliasing_eval(obj, &swallow, EINA_FALSE))
1054 return NULL;
1054 return efl_content_get(efl_part(obj, swallow)); 1055 return efl_content_get(efl_part(obj, swallow));
1055} 1056}
1056 1057
diff --git a/src/lib/elementary/efl_ui_progressbar.c b/src/lib/elementary/efl_ui_progressbar.c
index 38cba9635a..cfbb830443 100644
--- a/src/lib/elementary/efl_ui_progressbar.c
+++ b/src/lib/elementary/efl_ui_progressbar.c
@@ -174,33 +174,23 @@ _icon_signal_emit(Evas_Object *obj)
174 elm_layout_signal_emit(obj, buf, "elm"); 174 elm_layout_signal_emit(obj, buf, "elm");
175} 175}
176 176
177/* FIXME: replicated from elm_layout just because progressbar's icon
178 * spot is elm.swallow.content, not elm.swallow.icon. Fix that
179 * whenever we can changed the theme API */
180EOLIAN static Eina_Bool 177EOLIAN static Eina_Bool
181_efl_ui_progressbar_elm_widget_widget_sub_object_del(Eo *obj, Efl_Ui_Progressbar_Data *_pd EINA_UNUSED, Evas_Object *sobj) 178_efl_ui_progressbar_elm_widget_widget_sub_object_del(Eo *obj, Efl_Ui_Progressbar_Data *pd EINA_UNUSED, Evas_Object *sobj)
182{ 179{
183 Eina_Bool int_ret = EINA_FALSE; 180 if (!elm_obj_widget_sub_object_del(efl_super(obj, MY_CLASS), sobj))
184 int_ret = elm_widget_sub_object_del(efl_super(obj, MY_CLASS), sobj); 181 return EINA_FALSE;
185 if (!int_ret) return EINA_FALSE;
186 182
187 _icon_signal_emit(obj); 183 _icon_signal_emit(obj);
188
189 return EINA_TRUE; 184 return EINA_TRUE;
190} 185}
191 186
192/* FIXME: replicated from elm_layout just because progressbar's icon
193 * spot is elm.swallow.content, not elm.swallow.icon. Fix that
194 * whenever we can changed the theme API */
195static Eina_Bool 187static Eina_Bool
196_efl_ui_progressbar_content_set(Eo *obj, Efl_Ui_Progressbar_Data *_pd EINA_UNUSED, const char *part, Evas_Object *content) 188_efl_ui_progressbar_elm_widget_widget_sub_object_add(Eo *obj, Efl_Ui_Progressbar_Data *pd EINA_UNUSED, Evas_Object *sobj)
197{ 189{
198 Eina_Bool int_ret = EINA_FALSE; 190 if (!elm_obj_widget_sub_object_add(efl_super(obj, MY_CLASS), sobj))
199 int_ret = efl_content_set(efl_part(efl_super(obj, MY_CLASS), part), content); 191 return EINA_FALSE;
200 if (!int_ret) return EINA_FALSE;
201 192
202 _icon_signal_emit(obj); 193 _icon_signal_emit(obj);
203
204 return EINA_TRUE; 194 return EINA_TRUE;
205} 195}
206 196
@@ -399,8 +389,8 @@ _efl_ui_progressbar_efl_ui_direction_direction_get(Eo *obj EINA_UNUSED, Efl_Ui_P
399 return sd->dir; 389 return sd->dir;
400} 390}
401 391
402EOLIAN static void 392static void
403_efl_ui_progressbar_efl_ui_range_span_size_set(Eo *obj, Efl_Ui_Progressbar_Data *sd, Evas_Coord size) 393_progressbar_span_size_set(Eo *obj, Efl_Ui_Progressbar_Data *sd, Evas_Coord size)
404{ 394{
405 if (sd->size == size) return; 395 if (sd->size == size) return;
406 396
@@ -418,12 +408,6 @@ _efl_ui_progressbar_efl_ui_range_span_size_set(Eo *obj, Efl_Ui_Progressbar_Data
418 elm_layout_sizing_eval(obj); 408 elm_layout_sizing_eval(obj);
419} 409}
420 410
421EOLIAN static Evas_Coord
422_efl_ui_progressbar_efl_ui_range_span_size_get(Eo *obj EINA_UNUSED, Efl_Ui_Progressbar_Data *sd)
423{
424 return sd->size;
425}
426
427static void 411static void
428_progressbar_part_value_set(Eo *obj, Efl_Ui_Progressbar_Data *sd, const char *part_name, double val) 412_progressbar_part_value_set(Eo *obj, Efl_Ui_Progressbar_Data *sd, const char *part_name, double val)
429{ 413{
@@ -544,13 +528,15 @@ elm_progressbar_value_get(const Evas_Object *obj)
544EAPI void 528EAPI void
545elm_progressbar_span_size_set(Evas_Object *obj, Evas_Coord size) 529elm_progressbar_span_size_set(Evas_Object *obj, Evas_Coord size)
546{ 530{
547 efl_ui_range_span_size_set(obj, size); 531 EFL_UI_PROGRESSBAR_DATA_GET_OR_RETURN(obj, sd);
532 _progressbar_span_size_set(obj, sd, size);
548} 533}
549 534
550EAPI Evas_Coord 535EAPI Evas_Coord
551elm_progressbar_span_size_get(const Evas_Object *obj) 536elm_progressbar_span_size_get(const Evas_Object *obj)
552{ 537{
553 return efl_ui_range_span_size_get(obj); 538 EFL_UI_PROGRESSBAR_DATA_GET_OR_RETURN(obj, sd, 0);
539 return sd->size;
554} 540}
555 541
556EAPI void 542EAPI void
@@ -642,8 +628,18 @@ _efl_ui_progressbar_class_constructor(Efl_Class *klass)
642 628
643/* Efl.Part begin */ 629/* Efl.Part begin */
644 630
645ELM_PART_OVERRIDE_ONLY_ALIASES(efl_ui_progressbar, EFL_UI_PROGRESSBAR, Efl_Ui_Progressbar_Data, _content_aliases) 631EOLIAN static Eo *
646ELM_PART_OVERRIDE_CONTENT_SET(efl_ui_progressbar, EFL_UI_PROGRESSBAR, Efl_Ui_Progressbar_Data) 632_efl_ui_progressbar_efl_part_part(const Eo *obj, Efl_Ui_Progressbar_Data *sd EINA_UNUSED, const char *part)
633{
634 EINA_SAFETY_ON_NULL_RETURN_VAL(part, NULL);
635 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, NULL);
636
637 // Progress bars are dragable types
638 if (edje_object_part_drag_dir_get(wd->resize_obj, part) != EFL_UI_DRAG_DIR_NONE)
639 return ELM_PART_OVERRIDE_IMPLEMENT(EFL_UI_PROGRESSBAR_PART_CLASS);
640
641 return efl_part(efl_super(obj, MY_CLASS), part);
642}
647 643
648EOLIAN static void 644EOLIAN static void
649_efl_ui_progressbar_part_efl_ui_range_range_value_set(Eo *obj, void *_pd EINA_UNUSED, double val) 645_efl_ui_progressbar_part_efl_ui_range_range_value_set(Eo *obj, void *_pd EINA_UNUSED, double val)
@@ -652,6 +648,7 @@ _efl_ui_progressbar_part_efl_ui_range_range_value_set(Eo *obj, void *_pd EINA_UN
652 Efl_Ui_Progressbar_Data *sd = efl_data_scope_get(pd->obj, EFL_UI_PROGRESSBAR_CLASS); 648 Efl_Ui_Progressbar_Data *sd = efl_data_scope_get(pd->obj, EFL_UI_PROGRESSBAR_CLASS);
653 649
654 _progressbar_part_value_set(pd->obj, sd, pd->part, val); 650 _progressbar_part_value_set(pd->obj, sd, pd->part, val);
651 ELM_PART_RETURN_VOID;
655} 652}
656 653
657EOLIAN static double 654EOLIAN static double
@@ -660,7 +657,7 @@ _efl_ui_progressbar_part_efl_ui_range_range_value_get(Eo *obj, void *_pd EINA_UN
660 Elm_Part_Data *pd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS); 657 Elm_Part_Data *pd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS);
661 Efl_Ui_Progressbar_Data *sd = efl_data_scope_get(pd->obj, EFL_UI_PROGRESSBAR_CLASS); 658 Efl_Ui_Progressbar_Data *sd = efl_data_scope_get(pd->obj, EFL_UI_PROGRESSBAR_CLASS);
662 659
663 return _progressbar_part_value_get(sd, pd->part); 660 ELM_PART_RETURN_VAL(_progressbar_part_value_get(sd, pd->part));
664} 661}
665 662
666#include "efl_ui_progressbar_part.eo.c" 663#include "efl_ui_progressbar_part.eo.c"
diff --git a/src/lib/elementary/efl_ui_progressbar.eo b/src/lib/elementary/efl_ui_progressbar.eo
index dcd7f2fda0..121a7307cd 100644
--- a/src/lib/elementary/efl_ui_progressbar.eo
+++ b/src/lib/elementary/efl_ui_progressbar.eo
@@ -52,8 +52,8 @@ class Efl.Ui.Progressbar (Efl.Ui.Layout, Efl.Ui.Range, Efl.Ui.Direction)
52 Elm.Widget.theme_apply; 52 Elm.Widget.theme_apply;
53 Elm.Widget.focus_next_manager_is; 53 Elm.Widget.focus_next_manager_is;
54 Elm.Widget.focus_direction_manager_is; 54 Elm.Widget.focus_direction_manager_is;
55 Elm.Widget.widget_sub_object_add;
55 Elm.Widget.widget_sub_object_del; 56 Elm.Widget.widget_sub_object_del;
56 Efl.Ui.Range.span_size { get; set; }
57 Efl.Ui.Range.range_value { get; set; } 57 Efl.Ui.Range.range_value { get; set; }
58 Efl.Ui.Range.range_unit_format { get; set; } 58 Efl.Ui.Range.range_unit_format { get; set; }
59 Efl.Ui.Direction.direction { get; set; } 59 Efl.Ui.Direction.direction { get; set; }
diff --git a/src/lib/elementary/efl_ui_progressbar_part.eo b/src/lib/elementary/efl_ui_progressbar_part.eo
index 0eb21412ea..a57bfa7cdc 100644
--- a/src/lib/elementary/efl_ui_progressbar_part.eo
+++ b/src/lib/elementary/efl_ui_progressbar_part.eo
@@ -1,9 +1,8 @@
1class Efl.Ui.Progressbar.Part (Efl.Ui.Layout.Part_Content, Efl.Ui.Range) 1class Efl.Ui.Progressbar.Part (Efl.Ui.Layout.Part, Efl.Ui.Range)
2{ 2{
3 [[Elementary progressbar internal part class]] 3 [[Elementary progressbar internal part class]]
4 data: null; 4 data: null;
5 implements { 5 implements {
6 Efl.Container.content { set; }
7 Efl.Ui.Range.range_value { set; get; } 6 Efl.Ui.Range.range_value { set; get; }
8 } 7 }
9} 8}
diff --git a/src/lib/elementary/efl_ui_progressbar_private.h b/src/lib/elementary/efl_ui_progressbar_private.h
index 4c0a9b89f5..afc7017002 100644
--- a/src/lib/elementary/efl_ui_progressbar_private.h
+++ b/src/lib/elementary/efl_ui_progressbar_private.h
@@ -56,26 +56,13 @@ struct _Efl_Ui_Progress_Status
56#define EFL_UI_PROGRESSBAR_DATA_GET(o, sd) \ 56#define EFL_UI_PROGRESSBAR_DATA_GET(o, sd) \
57 Efl_Ui_Progressbar_Data * sd = efl_data_scope_get(o, EFL_UI_PROGRESSBAR_CLASS) 57 Efl_Ui_Progressbar_Data * sd = efl_data_scope_get(o, EFL_UI_PROGRESSBAR_CLASS)
58 58
59#define EFL_UI_PROGRESSBAR_DATA_GET_OR_RETURN(o, ptr) \ 59#define EFL_UI_PROGRESSBAR_DATA_GET_OR_RETURN(o, sd, ...) \
60 EFL_UI_PROGRESSBAR_DATA_GET(o, ptr); \ 60 Efl_Ui_Progressbar_Data *sd = efl_data_scope_safe_get(o, EFL_UI_PROGRESSBAR_CLASS); \
61 if (EINA_UNLIKELY(!ptr)) \ 61 if (EINA_UNLIKELY(!sd)) \
62 { \ 62 { \
63 CRI("No widget data for object %p (%s)", \ 63 ERR("No widget data for object %p (%s)", \
64 o, evas_object_type_get(o)); \ 64 o, evas_object_type_get(o)); \
65 return; \ 65 return __VA_ARGS__; \
66 } 66 }
67 67
68#define EFL_UI_PROGRESSBAR_DATA_GET_OR_RETURN_VAL(o, ptr, val) \
69 EFL_UI_PROGRESSBAR_DATA_GET(o, ptr); \
70 if (EINA_UNLIKELY(!ptr)) \
71 { \
72 CRI("No widget data for object %p (%s)", \
73 o, evas_object_type_get(o)); \
74 return val; \
75 }
76
77#define EFL_UI_PROGRESSBAR_CHECK(obj) \
78 if (EINA_UNLIKELY(!efl_isa((obj), EFL_UI_PROGRESSBAR_CLASS))) \
79 return
80
81#endif 68#endif
diff --git a/src/lib/elementary/efl_ui_slider.c b/src/lib/elementary/efl_ui_slider.c
index 76c3839014..f53f5760cd 100644
--- a/src/lib/elementary/efl_ui_slider.c
+++ b/src/lib/elementary/efl_ui_slider.c
@@ -12,8 +12,6 @@
12#include "elm_priv.h" 12#include "elm_priv.h"
13#include "efl_ui_slider_private.h" 13#include "efl_ui_slider_private.h"
14#include "elm_widget_layout.h" 14#include "elm_widget_layout.h"
15
16#include "efl_ui_slider_part.eo.h"
17#include "elm_part_helper.h" 15#include "elm_part_helper.h"
18 16
19#define MY_CLASS EFL_UI_SLIDER_CLASS 17#define MY_CLASS EFL_UI_SLIDER_CLASS
@@ -1234,21 +1232,6 @@ _efl_ui_slider_efl_ui_direction_direction_get(Eo *obj EINA_UNUSED, Efl_Ui_Slider
1234} 1232}
1235 1233
1236EOLIAN static void 1234EOLIAN static void
1237_efl_ui_slider_efl_ui_range_span_size_set(Eo *obj, Efl_Ui_Slider_Data *sd, Evas_Coord size)
1238{
1239 if (_is_horizontal(sd->dir))
1240 efl_gfx_size_hint_min_set(efl_part(obj, "span"), EINA_SIZE2D(size, 1));
1241 else
1242 efl_gfx_size_hint_min_set(efl_part(obj, "span"), EINA_SIZE2D(1, size));
1243}
1244
1245EOLIAN static Evas_Coord
1246_efl_ui_slider_efl_ui_range_span_size_get(Eo *obj EINA_UNUSED, Efl_Ui_Slider_Data *sd)
1247{
1248 return sd->size;
1249}
1250
1251EOLIAN static void
1252_efl_ui_slider_efl_ui_range_range_unit_format_set(Eo *obj, Efl_Ui_Slider_Data *sd, const char *units) 1235_efl_ui_slider_efl_ui_range_range_unit_format_set(Eo *obj, Efl_Ui_Slider_Data *sd, const char *units)
1253{ 1236{
1254 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); 1237 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
@@ -1509,29 +1492,9 @@ _efl_ui_slider_elm_interface_atspi_widget_action_elm_actions_get(Eo *obj EINA_UN
1509 1492
1510ELM_PART_TEXT_DEFAULT_IMPLEMENT(efl_ui_slider, Efl_Ui_Slider_Data) 1493ELM_PART_TEXT_DEFAULT_IMPLEMENT(efl_ui_slider, Efl_Ui_Slider_Data)
1511 1494
1512/* Efl.Part begin */
1513
1514EOLIAN static Eo *
1515_efl_ui_slider_efl_part_part(const Eo *obj, Efl_Ui_Slider_Data *sd EINA_UNUSED, const char *part)
1516{
1517 EINA_SAFETY_ON_NULL_RETURN_VAL(part, NULL);
1518
1519 if (eina_streq(part, "span"))
1520 return ELM_PART_OVERRIDE_IMPLEMENT(EFL_UI_SLIDER_PART_CLASS);
1521
1522 return efl_part(efl_super(obj, MY_CLASS), part);
1523}
1524
1525static void 1495static void
1526_span_size_set(Eo *obj, Efl_Ui_Slider_Data *sd, int w, int h) 1496_slider_span_size_set(Eo *obj, Efl_Ui_Slider_Data *sd, int size)
1527{ 1497{
1528 Evas_Coord size;
1529
1530 if (_is_horizontal(sd->dir))
1531 size = w;
1532 else
1533 size = h;
1534
1535 if (sd->size == size) return; 1498 if (sd->size == size) return;
1536 sd->size = size; 1499 sd->size = size;
1537 1500
@@ -1555,36 +1518,6 @@ _span_size_set(Eo *obj, Efl_Ui_Slider_Data *sd, int w, int h)
1555 evas_object_smart_changed(obj); 1518 evas_object_smart_changed(obj);
1556} 1519}
1557 1520
1558EOLIAN void
1559_efl_ui_slider_part_efl_gfx_size_hint_hint_min_set(Eo *obj, void *_pd EINA_UNUSED, Eina_Size2D sz)
1560{
1561 Elm_Part_Data *pd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS);
1562 Efl_Ui_Slider_Data *sd = efl_data_scope_get(pd->obj, EFL_UI_SLIDER_CLASS);
1563
1564 EINA_SAFETY_ON_FALSE_RETURN(eina_streq(pd->part, "span"));
1565 _span_size_set(pd->obj, sd, sz.w, sz.h);
1566}
1567
1568EOLIAN Eina_Size2D
1569_efl_ui_slider_part_efl_gfx_size_hint_hint_min_get(Eo *obj, void *_pd EINA_UNUSED)
1570{
1571 Elm_Part_Data *pd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS);
1572 Efl_Ui_Slider_Data *sd = efl_data_scope_get(pd->obj, EFL_UI_SLIDER_CLASS);
1573 Eina_Size2D ret = { 0, 0 };
1574
1575 EINA_SAFETY_ON_FALSE_GOTO(eina_streq(pd->part, "span"), end);
1576 if (_is_horizontal(sd->dir))
1577 ret = EINA_SIZE2D(sd->size, 1);
1578 else
1579 ret = EINA_SIZE2D(1, sd->size);
1580
1581end:
1582 return ret;
1583}
1584
1585#include "efl_ui_slider_part.eo.c"
1586/* Efl.Part end */
1587
1588/* Legacy APIs */ 1521/* Legacy APIs */
1589 1522
1590EAPI Evas_Object * 1523EAPI Evas_Object *
@@ -1597,13 +1530,15 @@ elm_slider_add(Evas_Object *parent)
1597EAPI void 1530EAPI void
1598elm_slider_span_size_set(Evas_Object *obj, Evas_Coord size) 1531elm_slider_span_size_set(Evas_Object *obj, Evas_Coord size)
1599{ 1532{
1600 efl_ui_range_span_size_set(obj, size); 1533 EFL_UI_SLIDER_DATA_GET_OR_RETURN(obj, sd);
1534 _slider_span_size_set(obj, sd, size);
1601} 1535}
1602 1536
1603EAPI Evas_Coord 1537EAPI Evas_Coord
1604elm_slider_span_size_get(const Evas_Object *obj) 1538elm_slider_span_size_get(const Evas_Object *obj)
1605{ 1539{
1606 return efl_ui_range_span_size_get(obj); 1540 EFL_UI_SLIDER_DATA_GET_OR_RETURN(obj, sd, 0);
1541 return sd->size;
1607} 1542}
1608 1543
1609EAPI void 1544EAPI void
@@ -1622,7 +1557,7 @@ EAPI void
1622elm_slider_horizontal_set(Evas_Object *obj, Eina_Bool horizontal) 1557elm_slider_horizontal_set(Evas_Object *obj, Eina_Bool horizontal)
1623{ 1558{
1624 Efl_Ui_Dir dir; 1559 Efl_Ui_Dir dir;
1625 EFL_UI_SLIDER_DATA_GET(obj, sd); 1560 EFL_UI_SLIDER_DATA_GET_OR_RETURN(obj, sd);
1626 1561
1627 dir = _direction_get(horizontal, _is_inverted(sd->dir)); 1562 dir = _direction_get(horizontal, _is_inverted(sd->dir));
1628 1563
@@ -1654,7 +1589,7 @@ EAPI void
1654elm_slider_inverted_set(Evas_Object *obj, Eina_Bool inverted) 1589elm_slider_inverted_set(Evas_Object *obj, Eina_Bool inverted)
1655{ 1590{
1656 Efl_Ui_Dir dir; 1591 Efl_Ui_Dir dir;
1657 EFL_UI_SLIDER_DATA_GET(obj, sd); 1592 EFL_UI_SLIDER_DATA_GET_OR_RETURN(obj, sd);
1658 1593
1659 dir = _direction_get(_is_horizontal(sd->dir), inverted); 1594 dir = _direction_get(_is_horizontal(sd->dir), inverted);
1660 1595
@@ -1673,7 +1608,7 @@ elm_slider_inverted_get(const Evas_Object *obj)
1673EAPI void 1608EAPI void
1674elm_slider_units_format_function_set(Evas_Object *obj, slider_func_type func, slider_freefunc_type free_func) 1609elm_slider_units_format_function_set(Evas_Object *obj, slider_func_type func, slider_freefunc_type free_func)
1675{ 1610{
1676 EFL_UI_SLIDER_DATA_GET(obj, sd); 1611 EFL_UI_SLIDER_DATA_GET_OR_RETURN(obj, sd);
1677 1612
1678 sd->units_format_func = func; 1613 sd->units_format_func = func;
1679 sd->units_format_free = free_func; 1614 sd->units_format_free = free_func;
@@ -1684,7 +1619,7 @@ elm_slider_units_format_function_set(Evas_Object *obj, slider_func_type func, sl
1684EAPI void 1619EAPI void
1685elm_slider_range_enabled_set(Evas_Object *obj, Eina_Bool enable) 1620elm_slider_range_enabled_set(Evas_Object *obj, Eina_Bool enable)
1686{ 1621{
1687 EFL_UI_SLIDER_DATA_GET(obj, sd); 1622 EFL_UI_SLIDER_DATA_GET_OR_RETURN(obj, sd);
1688 1623
1689 if (sd->intvl_enable == enable) return; 1624 if (sd->intvl_enable == enable) return;
1690 1625
@@ -1707,14 +1642,14 @@ elm_slider_range_enabled_set(Evas_Object *obj, Eina_Bool enable)
1707EAPI Eina_Bool 1642EAPI Eina_Bool
1708elm_slider_range_enabled_get(const Evas_Object *obj) 1643elm_slider_range_enabled_get(const Evas_Object *obj)
1709{ 1644{
1710 EFL_UI_SLIDER_DATA_GET(obj, pd); 1645 EFL_UI_SLIDER_DATA_GET_OR_RETURN(obj, pd, EINA_FALSE);
1711 return pd->intvl_enable; 1646 return pd->intvl_enable;
1712} 1647}
1713 1648
1714EAPI void 1649EAPI void
1715elm_slider_range_set(Evas_Object *obj, double from, double to) 1650elm_slider_range_set(Evas_Object *obj, double from, double to)
1716{ 1651{
1717 EFL_UI_SLIDER_DATA_GET(obj, pd); 1652 EFL_UI_SLIDER_DATA_GET_OR_RETURN(obj, pd);
1718 pd->intvl_from = from; 1653 pd->intvl_from = from;
1719 pd->val = from; 1654 pd->val = from;
1720 pd->intvl_to = to; 1655 pd->intvl_to = to;
@@ -1728,7 +1663,7 @@ elm_slider_range_set(Evas_Object *obj, double from, double to)
1728EAPI void 1663EAPI void
1729elm_slider_range_get(const Evas_Object *obj, double *from, double *to) 1664elm_slider_range_get(const Evas_Object *obj, double *from, double *to)
1730{ 1665{
1731 EFL_UI_SLIDER_DATA_GET(obj, pd); 1666 EFL_UI_SLIDER_DATA_GET_OR_RETURN(obj, pd);
1732 if (from) *from = fmin(pd->intvl_from, pd->intvl_to); 1667 if (from) *from = fmin(pd->intvl_from, pd->intvl_to);
1733 if (to) *to = fmax(pd->intvl_from, pd->intvl_to); 1668 if (to) *to = fmax(pd->intvl_from, pd->intvl_to);
1734} 1669}
diff --git a/src/lib/elementary/efl_ui_slider.eo b/src/lib/elementary/efl_ui_slider.eo
index 825ac20aca..c26ab11b3e 100644
--- a/src/lib/elementary/efl_ui_slider.eo
+++ b/src/lib/elementary/efl_ui_slider.eo
@@ -121,7 +121,6 @@ class Efl.Ui.Slider (Efl.Ui.Layout, Efl.Ui.Range, Efl.Ui.Direction,
121 Elm.Widget.focus_direction_manager_is; 121 Elm.Widget.focus_direction_manager_is;
122 Elm.Widget.on_focus_update; 122 Elm.Widget.on_focus_update;
123 Elm.Widget.widget_event; 123 Elm.Widget.widget_event;
124 Efl.Ui.Range.span_size { get; set; }
125 Efl.Ui.Range.range_value { get; set; } 124 Efl.Ui.Range.range_value { get; set; }
126 Efl.Ui.Range.range_unit_format { get; set; } 125 Efl.Ui.Range.range_unit_format { get; set; }
127 Efl.Ui.Range.range_min_max {get; set; } 126 Efl.Ui.Range.range_min_max {get; set; }
@@ -130,7 +129,6 @@ class Efl.Ui.Slider (Efl.Ui.Layout, Efl.Ui.Range, Efl.Ui.Direction,
130 Efl.Access.Value.range { get; } 129 Efl.Access.Value.range { get; }
131 Efl.Access.Value.increment { get; } 130 Efl.Access.Value.increment { get; }
132 Elm.Interface.Atspi_Widget_Action.elm_actions { get; } 131 Elm.Interface.Atspi_Widget_Action.elm_actions { get; }
133 Efl.Part.part;
134 Efl.Text.text { get; set; } 132 Efl.Text.text { get; set; }
135 } 133 }
136 events { 134 events {
diff --git a/src/lib/elementary/efl_ui_slider_part.eo b/src/lib/elementary/efl_ui_slider_part.eo
deleted file mode 100644
index 30b34c8675..0000000000
--- a/src/lib/elementary/efl_ui_slider_part.eo
+++ /dev/null
@@ -1,8 +0,0 @@
1class Efl.Ui.Slider.Part (Efl.Ui.Layout.Part_Content, Efl.Gfx.Size.Hint)
2{
3 [[Elementary slider internal part class]]
4 data: null;
5 implements {
6 Efl.Gfx.Size.Hint.hint_min { set; get; }
7 }
8}
diff --git a/src/lib/elementary/efl_ui_slider_private.h b/src/lib/elementary/efl_ui_slider_private.h
index 8e69d234fa..a81425e4b6 100644
--- a/src/lib/elementary/efl_ui_slider_private.h
+++ b/src/lib/elementary/efl_ui_slider_private.h
@@ -66,26 +66,13 @@ struct _Efl_Ui_Slider_Data
66#define EFL_UI_SLIDER_DATA_GET(o, sd) \ 66#define EFL_UI_SLIDER_DATA_GET(o, sd) \
67 Efl_Ui_Slider_Data * sd = efl_data_scope_get(o, EFL_UI_SLIDER_CLASS) 67 Efl_Ui_Slider_Data * sd = efl_data_scope_get(o, EFL_UI_SLIDER_CLASS)
68 68
69#define EFL_UI_SLIDER_DATA_GET_OR_RETURN(o, ptr) \ 69#define EFL_UI_SLIDER_DATA_GET_OR_RETURN(o, sd, ...) \
70 EFL_UI_SLIDER_DATA_GET(o, ptr); \ 70 Efl_Ui_Slider_Data * sd = efl_data_scope_safe_get(o, EFL_UI_SLIDER_CLASS); \
71 if (EINA_UNLIKELY(!ptr)) \ 71 if (EINA_UNLIKELY(!sd)) \
72 { \ 72 { \
73 CRI("No widget data for object %p (%s)", \ 73 ERR("No widget data for object %p (%s)", \
74 o, evas_object_type_get(o)); \ 74 o, evas_object_type_get(o)); \
75 return; \ 75 return __VA_ARGS__; \
76 } 76 }
77 77
78#define EFL_UI_SLIDER_DATA_GET_OR_RETURN_VAL(o, ptr, val) \
79 EFL_UI_SLIDER_DATA_GET(o, ptr); \
80 if (EINA_UNLIKELY(!ptr)) \
81 { \
82 CRI("No widget data for object %p (%s)", \
83 o, evas_object_type_get(o)); \
84 return val; \
85 }
86
87#define EFL_UI_SLIDER_CHECK(obj) \
88 if (EINA_UNLIKELY(!efl_isa((obj), EFL_UI_SLIDER_CLASS))) \
89 return
90
91#endif 78#endif