summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--AUTHORS2
-rw-r--r--NEWS1
-rw-r--r--src/lib/elc_ctxpopup.c499
-rw-r--r--src/lib/elc_ctxpopup.h153
-rw-r--r--src/lib/elc_fileselector.c363
-rw-r--r--src/lib/elc_fileselector.h206
-rw-r--r--src/lib/elc_fileselector_button.c319
-rw-r--r--src/lib/elc_fileselector_button.h209
-rw-r--r--src/lib/elc_fileselector_entry.c524
-rw-r--r--src/lib/elc_fileselector_entry.h233
-rw-r--r--src/lib/elc_hoversel.c275
-rw-r--r--src/lib/elc_hoversel.h148
-rw-r--r--src/lib/elc_multibuttonentry.c554
-rw-r--r--src/lib/elc_multibuttonentry.h250
-rw-r--r--src/lib/elc_naviframe.c520
-rw-r--r--src/lib/elc_naviframe.h213
-rw-r--r--src/lib/elc_player.c199
-rw-r--r--src/lib/elc_popup.c508
-rw-r--r--src/lib/elc_popup.h135
-rw-r--r--src/lib/elm_access.c95
-rw-r--r--src/lib/elm_actionslider.c312
-rw-r--r--src/lib/elm_actionslider.h109
-rw-r--r--src/lib/elm_bg.c215
-rw-r--r--src/lib/elm_bg.h115
-rw-r--r--src/lib/elm_box.c495
-rw-r--r--src/lib/elm_box.h254
-rw-r--r--src/lib/elm_bubble.c245
-rw-r--r--src/lib/elm_bubble.h41
-rw-r--r--src/lib/elm_button.c343
-rw-r--r--src/lib/elm_button.h94
-rw-r--r--src/lib/elm_calendar.c509
-rw-r--r--src/lib/elm_calendar.h283
-rw-r--r--src/lib/elm_check.c285
-rw-r--r--src/lib/elm_check.h53
-rw-r--r--src/lib/elm_clock.c357
-rw-r--r--src/lib/elm_clock.h179
-rw-r--r--src/lib/elm_colorselector.c369
-rw-r--r--src/lib/elm_colorselector.h127
-rw-r--r--src/lib/elm_conform.c131
-rw-r--r--src/lib/elm_conform.h11
-rw-r--r--src/lib/elm_container.c78
-rw-r--r--src/lib/elm_datetime.c409
-rw-r--r--src/lib/elm_datetime.h181
-rw-r--r--src/lib/elm_dayselector.c328
-rw-r--r--src/lib/elm_dayselector.h120
-rw-r--r--src/lib/elm_diskselector.c579
-rw-r--r--src/lib/elm_diskselector.h173
-rw-r--r--src/lib/elm_entry.c1613
-rw-r--r--src/lib/elm_entry.h1124
-rw-r--r--src/lib/elm_flip.c436
-rw-r--r--src/lib/elm_flip.h139
-rw-r--r--src/lib/elm_flipselector.c375
-rw-r--r--src/lib/elm_flipselector.h151
-rw-r--r--src/lib/elm_frame.c261
-rw-r--r--src/lib/elm_frame.h79
-rw-r--r--src/lib/elm_gengrid.c1133
-rw-r--r--src/lib/elm_gengrid.h601
-rw-r--r--src/lib/elm_genlist.c1340
-rw-r--r--src/lib/elm_genlist.h507
-rw-r--r--src/lib/elm_gesture_layer.c214
-rw-r--r--src/lib/elm_gesture_layer.h124
-rw-r--r--src/lib/elm_glview.c316
-rw-r--r--src/lib/elm_glview.h161
-rw-r--r--src/lib/elm_grid.c303
-rw-r--r--src/lib/elm_grid.h100
-rw-r--r--src/lib/elm_hover.c415
-rw-r--r--src/lib/elm_hover.h67
-rw-r--r--src/lib/elm_icon.c361
-rw-r--r--src/lib/elm_icon.h82
-rw-r--r--src/lib/elm_image.c878
-rw-r--r--src/lib/elm_image.h392
-rw-r--r--src/lib/elm_index.c529
-rw-r--r--src/lib/elm_index.h254
-rw-r--r--src/lib/elm_interface_scrollable.c1112
-rw-r--r--src/lib/elm_interface_scrollable.h457
-rw-r--r--src/lib/elm_inwin.c163
-rw-r--r--src/lib/elm_inwin.h16
-rw-r--r--src/lib/elm_label.c348
-rw-r--r--src/lib/elm_label.h143
-rw-r--r--src/lib/elm_layout.c1402
-rw-r--r--src/lib/elm_layout.h439
-rw-r--r--src/lib/elm_list.c784
-rw-r--r--src/lib/elm_list.h330
-rw-r--r--src/lib/elm_map.c1411
-rw-r--r--src/lib/elm_map.h557
-rw-r--r--src/lib/elm_mapbuf.c303
-rw-r--r--src/lib/elm_mapbuf.h91
-rw-r--r--src/lib/elm_menu.c333
-rw-r--r--src/lib/elm_menu.h124
-rw-r--r--src/lib/elm_notify.c403
-rw-r--r--src/lib/elm_notify.h70
-rw-r--r--src/lib/elm_panel.c346
-rw-r--r--src/lib/elm_panel.h81
-rw-r--r--src/lib/elm_panes.c290
-rw-r--r--src/lib/elm_panes.h117
-rw-r--r--src/lib/elm_photo.c236
-rw-r--r--src/lib/elm_photo.h119
-rw-r--r--src/lib/elm_photocam.c732
-rw-r--r--src/lib/elm_photocam.h208
-rw-r--r--src/lib/elm_plug.c149
-rw-r--r--src/lib/elm_plug.h42
-rw-r--r--src/lib/elm_progressbar.c398
-rw-r--r--src/lib/elm_progressbar.h204
-rw-r--r--src/lib/elm_radio.c334
-rw-r--r--src/lib/elm_radio.h105
-rw-r--r--src/lib/elm_route.c162
-rw-r--r--src/lib/elm_route.h44
-rw-r--r--src/lib/elm_scroller.c585
-rw-r--r--src/lib/elm_scroller.h98
-rw-r--r--src/lib/elm_segment_control.c396
-rw-r--r--src/lib/elm_segment_control.h126
-rw-r--r--src/lib/elm_separator.c166
-rw-r--r--src/lib/elm_separator.h40
-rw-r--r--src/lib/elm_slider.c478
-rw-r--r--src/lib/elm_slider.h257
-rw-r--r--src/lib/elm_slideshow.c492
-rw-r--r--src/lib/elm_slideshow.h329
-rw-r--r--src/lib/elm_spinner.c490
-rw-r--r--src/lib/elm_spinner.h263
-rw-r--r--src/lib/elm_table.c360
-rw-r--r--src/lib/elm_table.h146
-rw-r--r--src/lib/elm_thumb.c280
-rw-r--r--src/lib/elm_thumb.h121
-rw-r--r--src/lib/elm_toolbar.c802
-rw-r--r--src/lib/elm_toolbar.h378
-rw-r--r--src/lib/elm_video.c488
-rw-r--r--src/lib/elm_video.h254
-rw-r--r--src/lib/elm_web.c1008
-rw-r--r--src/lib/elm_web.h617
-rw-r--r--src/lib/elm_web2.c869
-rw-r--r--src/lib/elm_widget.c2115
-rw-r--r--src/lib/elm_widget.h387
-rw-r--r--src/lib/elm_widget_actionslider.h115
-rw-r--r--src/lib/elm_widget_bg.h115
-rw-r--r--src/lib/elm_widget_box.h115
-rw-r--r--src/lib/elm_widget_bubble.h113
-rw-r--r--src/lib/elm_widget_button.h115
-rw-r--r--src/lib/elm_widget_calendar.h134
-rw-r--r--src/lib/elm_widget_check.h115
-rw-r--r--src/lib/elm_widget_clock.h115
-rw-r--r--src/lib/elm_widget_colorselector.h114
-rw-r--r--src/lib/elm_widget_conform.h114
-rw-r--r--src/lib/elm_widget_container.h108
-rw-r--r--src/lib/elm_widget_ctxpopup.h111
-rw-r--r--src/lib/elm_widget_datetime.h113
-rw-r--r--src/lib/elm_widget_dayselector.h116
-rw-r--r--src/lib/elm_widget_diskselector.h122
-rw-r--r--src/lib/elm_widget_entry.h114
-rw-r--r--src/lib/elm_widget_fileselector.h114
-rw-r--r--src/lib/elm_widget_fileselector_button.h120
-rw-r--r--src/lib/elm_widget_fileselector_entry.h116
-rw-r--r--src/lib/elm_widget_flip.h114
-rw-r--r--src/lib/elm_widget_flipselector.h116
-rw-r--r--src/lib/elm_widget_frame.h115
-rw-r--r--src/lib/elm_widget_gengrid.h133
-rw-r--r--src/lib/elm_widget_genlist.h133
-rw-r--r--src/lib/elm_widget_glview.h115
-rw-r--r--src/lib/elm_widget_grid.h142
-rw-r--r--src/lib/elm_widget_hover.h113
-rw-r--r--src/lib/elm_widget_hoversel.h113
-rw-r--r--src/lib/elm_widget_icon.h109
-rw-r--r--src/lib/elm_widget_image.h166
-rw-r--r--src/lib/elm_widget_index.h113
-rw-r--r--src/lib/elm_widget_inwin.h114
-rw-r--r--src/lib/elm_widget_label.h128
-rw-r--r--src/lib/elm_widget_layout.h190
-rw-r--r--src/lib/elm_widget_list.h115
-rw-r--r--src/lib/elm_widget_map.h126
-rw-r--r--src/lib/elm_widget_mapbuf.h112
-rw-r--r--src/lib/elm_widget_menu.h113
-rw-r--r--src/lib/elm_widget_multibuttonentry.h114
-rw-r--r--src/lib/elm_widget_naviframe.h113
-rw-r--r--src/lib/elm_widget_notify.h110
-rw-r--r--src/lib/elm_widget_panel.h113
-rw-r--r--src/lib/elm_widget_panes.h114
-rw-r--r--src/lib/elm_widget_photo.h111
-rw-r--r--src/lib/elm_widget_photocam.h127
-rw-r--r--src/lib/elm_widget_player.h113
-rw-r--r--src/lib/elm_widget_plug.h120
-rw-r--r--src/lib/elm_widget_popup.h111
-rw-r--r--src/lib/elm_widget_progressbar.h113
-rw-r--r--src/lib/elm_widget_radio.h113
-rw-r--r--src/lib/elm_widget_route.h111
-rw-r--r--src/lib/elm_widget_scroller.h118
-rw-r--r--src/lib/elm_widget_segment_control.h118
-rw-r--r--src/lib/elm_widget_separator.h113
-rw-r--r--src/lib/elm_widget_slider.h113
-rw-r--r--src/lib/elm_widget_slideshow.h113
-rw-r--r--src/lib/elm_widget_spinner.h113
-rw-r--r--src/lib/elm_widget_table.h141
-rw-r--r--src/lib/elm_widget_thumb.h112
-rw-r--r--src/lib/elm_widget_toolbar.h117
-rw-r--r--src/lib/elm_widget_video.h113
-rw-r--r--src/lib/elm_widget_web.h112
-rw-r--r--src/lib/elm_win.c1436
-rw-r--r--src/lib/elm_win.h1133
-rw-r--r--src/modules/datetime_input_ctxpopup/Makefile.am1
197 files changed, 39101 insertions, 18168 deletions
diff --git a/AUTHORS b/AUTHORS
index 0d8381a5c..04be50a2c 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -67,3 +67,5 @@ Flavio Ceolin <flavio.ceolin@profusion.mobi>
67Igor Murzov <e-mail@date.by> 67Igor Murzov <e-mail@date.by>
68Jiyoun Park <jy0703.park@samsung.com> 68Jiyoun Park <jy0703.park@samsung.com>
69KoziarekBeata <b.koziarek@samsung.com> 69KoziarekBeata <b.koziarek@samsung.com>
70Daniel Zaoui <daniel.zaoui@samsung.com>
71Yakov Goldberg <yakov.g@samsung.com>
diff --git a/NEWS b/NEWS
index 3a08f278a..ecd4e9a48 100644
--- a/NEWS
+++ b/NEWS
@@ -3,6 +3,7 @@ Changes since Elementary 1.7.0:
3 3
4Additions: 4Additions:
5 5
6 * Porting to Eo
6 * Add ELM_INPUT_PANEL_RETURN_KEY_TYPE_SIGNIN. 7 * Add ELM_INPUT_PANEL_RETURN_KEY_TYPE_SIGNIN.
7 * Add elementary_codegen 8 * Add elementary_codegen
8 * Add window floating mode api's 9 * Add window floating mode api's
diff --git a/src/lib/elc_ctxpopup.c b/src/lib/elc_ctxpopup.c
index 1dae7ee6e..c72381495 100644
--- a/src/lib/elc_ctxpopup.c
+++ b/src/lib/elc_ctxpopup.c
@@ -2,6 +2,14 @@
2#include "elm_priv.h" 2#include "elm_priv.h"
3#include "elm_widget_ctxpopup.h" 3#include "elm_widget_ctxpopup.h"
4 4
5#include "Eo.h"
6
7EAPI Eo_Op ELM_OBJ_CTXPOPUP_BASE_ID = EO_NOOP;
8
9#define MY_CLASS ELM_OBJ_CTXPOPUP_CLASS
10
11#define MY_CLASS_NAME "elm_ctxpopup"
12
5EAPI const char ELM_CTXPOPUP_SMART_NAME[] = "elm_ctxpopup"; 13EAPI const char ELM_CTXPOPUP_SMART_NAME[] = "elm_ctxpopup";
6 14
7static const char SIG_DISMISSED[] = "dismissed"; 15static const char SIG_DISMISSED[] = "dismissed";
@@ -10,18 +18,33 @@ static const Evas_Smart_Cb_Description _smart_callbacks[] = {
10 {NULL, NULL} 18 {NULL, NULL}
11}; 19};
12 20
13EVAS_SMART_SUBCLASS_NEW 21
14 (ELM_CTXPOPUP_SMART_NAME, _elm_ctxpopup, Elm_Ctxpopup_Smart_Class, 22static void
15 Elm_Layout_Smart_Class, elm_layout_smart_class_get, _smart_callbacks); 23_elm_ctxpopup_smart_focus_next_manager_is(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
16static Eina_Bool
17_elm_ctxpopup_smart_focus_next(const Evas_Object *obj,
18 Elm_Focus_Direction dir,
19 Evas_Object **next)
20{ 24{
21 ELM_CTXPOPUP_DATA_GET(obj, sd); 25 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
26 *ret = EINA_TRUE;
27}
28
29static void
30_elm_ctxpopup_smart_focus_direction_manager_is(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
31{
32 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
33 *ret = EINA_FALSE;
34}
35
36static void
37_elm_ctxpopup_smart_focus_next(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
38{
39 Elm_Ctxpopup_Smart_Data *sd = _pd;
40
41 Elm_Focus_Direction dir = va_arg(*list, Elm_Focus_Direction);
42 Evas_Object **next = va_arg(*list, Evas_Object **);
43 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
44 if (ret) *ret = EINA_FALSE;
22 45
23 if (!sd) 46 if (!sd)
24 return EINA_FALSE; 47 return;
25 48
26 if (!elm_widget_focus_next_get(sd->box, dir, next)) 49 if (!elm_widget_focus_next_get(sd->box, dir, next))
27 { 50 {
@@ -29,22 +52,26 @@ _elm_ctxpopup_smart_focus_next(const Evas_Object *obj,
29 elm_widget_focus_next_get(sd->box, dir, next); 52 elm_widget_focus_next_get(sd->box, dir, next);
30 } 53 }
31 54
32 return EINA_TRUE; 55 if (ret) *ret = EINA_TRUE;
33} 56}
34 57
35static Eina_Bool 58static void
36_elm_ctxpopup_smart_event(Evas_Object *obj, 59_elm_ctxpopup_smart_event(Eo *obj, void *_pd, va_list *list)
37 Evas_Object *src __UNUSED__,
38 Evas_Callback_Type type,
39 void *event_info)
40{ 60{
61 Evas_Object *src = va_arg(*list, Evas_Object *);
62 (void)src;
63 Evas_Callback_Type type = va_arg(*list, Evas_Callback_Type);
64 void *event_info = va_arg(*list, void *);
65 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
66 if (ret) *ret = EINA_FALSE;
67
41 Evas_Event_Key_Down *ev = event_info; 68 Evas_Event_Key_Down *ev = event_info;
42 69
43 ELM_CTXPOPUP_DATA_GET(obj, sd); 70 Elm_Ctxpopup_Smart_Data *sd = _pd;
44 71
45 if (elm_widget_disabled_get(obj)) return EINA_FALSE; 72 if (elm_widget_disabled_get(obj)) return;
46 if (type != EVAS_CALLBACK_KEY_DOWN) return EINA_FALSE; 73 if (type != EVAS_CALLBACK_KEY_DOWN) return;
47 if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return EINA_FALSE; 74 if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return;
48 75
49 if (!strcmp(ev->keyname, "Tab")) 76 if (!strcmp(ev->keyname, "Tab"))
50 { 77 {
@@ -52,14 +79,15 @@ _elm_ctxpopup_smart_event(Evas_Object *obj,
52 elm_widget_focus_cycle(sd->box, ELM_FOCUS_PREVIOUS); 79 elm_widget_focus_cycle(sd->box, ELM_FOCUS_PREVIOUS);
53 else 80 else
54 elm_widget_focus_cycle(sd->box, ELM_FOCUS_NEXT); 81 elm_widget_focus_cycle(sd->box, ELM_FOCUS_NEXT);
55 return EINA_TRUE; 82 if (ret) *ret = EINA_TRUE;
83 return;
56 } 84 }
57 85
58 if (strcmp(ev->keyname, "Escape")) return EINA_FALSE; 86 if (strcmp(ev->keyname, "Escape")) return;
59 87
60 evas_object_hide(obj); 88 evas_object_hide(obj);
61 ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; 89 ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
62 return EINA_TRUE; 90 if (ret) *ret = EINA_TRUE;
63} 91}
64 92
65static void 93static void
@@ -115,6 +143,7 @@ _base_geometry_calc(Evas_Object *obj,
115 int idx; 143 int idx;
116 144
117 ELM_CTXPOPUP_DATA_GET(obj, sd); 145 ELM_CTXPOPUP_DATA_GET(obj, sd);
146 Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
118 147
119 if (!rect) return ELM_CTXPOPUP_DIRECTION_DOWN; 148 if (!rect) return ELM_CTXPOPUP_DIRECTION_DOWN;
120 149
@@ -131,8 +160,8 @@ _base_geometry_calc(Evas_Object *obj,
131 160
132 //recalc the edje 161 //recalc the edje
133 edje_object_size_min_calc 162 edje_object_size_min_calc
134 (ELM_WIDGET_DATA(sd)->resize_obj, &base_size.x, &base_size.y); 163 (wd->resize_obj, &base_size.x, &base_size.y);
135 evas_object_smart_calculate(ELM_WIDGET_DATA(sd)->resize_obj); 164 evas_object_smart_calculate(wd->resize_obj);
136 165
137 //Limit to Max Size 166 //Limit to Max Size
138 evas_object_size_hint_max_get(obj, &max_size.x, &max_size.y); 167 evas_object_size_hint_max_get(obj, &max_size.x, &max_size.y);
@@ -288,6 +317,7 @@ _arrow_update(Evas_Object *obj,
288 double drag; 317 double drag;
289 318
290 ELM_CTXPOPUP_DATA_GET(obj, sd); 319 ELM_CTXPOPUP_DATA_GET(obj, sd);
320 Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
291 321
292 evas_object_geometry_get(obj, &x, &y, NULL, NULL); 322 evas_object_geometry_get(obj, &x, &y, NULL, NULL);
293 evas_object_geometry_get 323 evas_object_geometry_get
@@ -301,7 +331,7 @@ _arrow_update(Evas_Object *obj,
301 case ELM_CTXPOPUP_DIRECTION_RIGHT: 331 case ELM_CTXPOPUP_DIRECTION_RIGHT:
302 edje_object_signal_emit(sd->arrow, "elm,state,left", "elm"); 332 edje_object_signal_emit(sd->arrow, "elm,state,left", "elm");
303 edje_object_part_swallow 333 edje_object_part_swallow
304 (ELM_WIDGET_DATA(sd)->resize_obj, 334 (wd->resize_obj,
305 (elm_widget_mirrored_get(obj) ? "elm.swallow.arrow_right" : 335 (elm_widget_mirrored_get(obj) ? "elm.swallow.arrow_right" :
306 "elm.swallow.arrow_left"), sd->arrow); 336 "elm.swallow.arrow_left"), sd->arrow);
307 337
@@ -315,7 +345,7 @@ _arrow_update(Evas_Object *obj,
315 y = y - base_size.y - (arrow_size.h * 0.5); 345 y = y - base_size.y - (arrow_size.h * 0.5);
316 drag = (double)(y) / (double)(base_size.h - arrow_size.h); 346 drag = (double)(y) / (double)(base_size.h - arrow_size.h);
317 edje_object_part_drag_value_set 347 edje_object_part_drag_value_set
318 (ELM_WIDGET_DATA(sd)->resize_obj, 348 (wd->resize_obj,
319 (elm_widget_mirrored_get(obj) ? "elm.swallow.arrow_right" : 349 (elm_widget_mirrored_get(obj) ? "elm.swallow.arrow_right" :
320 "elm.swallow.arrow_left"), 1, drag); 350 "elm.swallow.arrow_left"), 1, drag);
321 } 351 }
@@ -324,7 +354,7 @@ _arrow_update(Evas_Object *obj,
324 case ELM_CTXPOPUP_DIRECTION_LEFT: 354 case ELM_CTXPOPUP_DIRECTION_LEFT:
325 edje_object_signal_emit(sd->arrow, "elm,state,right", "elm"); 355 edje_object_signal_emit(sd->arrow, "elm,state,right", "elm");
326 edje_object_part_swallow 356 edje_object_part_swallow
327 (ELM_WIDGET_DATA(sd)->resize_obj, 357 (wd->resize_obj,
328 (elm_widget_mirrored_get(obj) ? "elm.swallow.arrow_left" : 358 (elm_widget_mirrored_get(obj) ? "elm.swallow.arrow_left" :
329 "elm.swallow.arrow_right"), sd->arrow); 359 "elm.swallow.arrow_right"), sd->arrow);
330 360
@@ -338,7 +368,7 @@ _arrow_update(Evas_Object *obj,
338 y = y - base_size.y - (arrow_size.h * 0.5); 368 y = y - base_size.y - (arrow_size.h * 0.5);
339 drag = (double)(y) / (double)(base_size.h - arrow_size.h); 369 drag = (double)(y) / (double)(base_size.h - arrow_size.h);
340 edje_object_part_drag_value_set 370 edje_object_part_drag_value_set
341 (ELM_WIDGET_DATA(sd)->resize_obj, 371 (wd->resize_obj,
342 (elm_widget_mirrored_get(obj) ? "elm.swallow.arrow_left" : 372 (elm_widget_mirrored_get(obj) ? "elm.swallow.arrow_left" :
343 "elm.swallow.arrow_right"), 0, drag); 373 "elm.swallow.arrow_right"), 0, drag);
344 } 374 }
@@ -347,7 +377,7 @@ _arrow_update(Evas_Object *obj,
347 case ELM_CTXPOPUP_DIRECTION_DOWN: 377 case ELM_CTXPOPUP_DIRECTION_DOWN:
348 edje_object_signal_emit(sd->arrow, "elm,state,top", "elm"); 378 edje_object_signal_emit(sd->arrow, "elm,state,top", "elm");
349 edje_object_part_swallow 379 edje_object_part_swallow
350 (ELM_WIDGET_DATA(sd)->resize_obj, "elm.swallow.arrow_up", 380 (wd->resize_obj, "elm.swallow.arrow_up",
351 sd->arrow); 381 sd->arrow);
352 382
353 if (base_size.w > 0) 383 if (base_size.w > 0)
@@ -360,7 +390,7 @@ _arrow_update(Evas_Object *obj,
360 x = x - base_size.x - (arrow_size.w * 0.5); 390 x = x - base_size.x - (arrow_size.w * 0.5);
361 drag = (double)(x) / (double)(base_size.w - arrow_size.w); 391 drag = (double)(x) / (double)(base_size.w - arrow_size.w);
362 edje_object_part_drag_value_set 392 edje_object_part_drag_value_set
363 (ELM_WIDGET_DATA(sd)->resize_obj, "elm.swallow.arrow_up", drag, 393 (wd->resize_obj, "elm.swallow.arrow_up", drag,
364 1); 394 1);
365 } 395 }
366 break; 396 break;
@@ -368,7 +398,7 @@ _arrow_update(Evas_Object *obj,
368 case ELM_CTXPOPUP_DIRECTION_UP: 398 case ELM_CTXPOPUP_DIRECTION_UP:
369 edje_object_signal_emit(sd->arrow, "elm,state,bottom", "elm"); 399 edje_object_signal_emit(sd->arrow, "elm,state,bottom", "elm");
370 edje_object_part_swallow 400 edje_object_part_swallow
371 (ELM_WIDGET_DATA(sd)->resize_obj, "elm.swallow.arrow_down", 401 (wd->resize_obj, "elm.swallow.arrow_down",
372 sd->arrow); 402 sd->arrow);
373 403
374 if (base_size.w > 0) 404 if (base_size.w > 0)
@@ -380,7 +410,7 @@ _arrow_update(Evas_Object *obj,
380 else x = x - base_size.x - (arrow_size.w * 0.5); 410 else x = x - base_size.x - (arrow_size.w * 0.5);
381 drag = (double)(x) / (double)(base_size.w - arrow_size.w); 411 drag = (double)(x) / (double)(base_size.w - arrow_size.w);
382 edje_object_part_drag_value_set 412 edje_object_part_drag_value_set
383 (ELM_WIDGET_DATA(sd)->resize_obj, "elm.swallow.arrow_down", 413 (wd->resize_obj, "elm.swallow.arrow_down",
384 drag, 0); 414 drag, 0);
385 } 415 }
386 break; 416 break;
@@ -390,7 +420,7 @@ _arrow_update(Evas_Object *obj,
390 } 420 }
391 421
392 //should be here for getting accurate geometry value 422 //should be here for getting accurate geometry value
393 evas_object_smart_calculate(ELM_WIDGET_DATA(sd)->resize_obj); 423 evas_object_smart_calculate(wd->resize_obj);
394} 424}
395 425
396static void 426static void
@@ -500,32 +530,33 @@ _base_shift_by_arrow(Evas_Object *arrow,
500 } 530 }
501} 531}
502 532
503static Eina_Bool 533static void
504_elm_ctxpopup_smart_sub_object_add(Evas_Object *obj, 534_elm_ctxpopup_smart_layout_sub_object_add_enable(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
505 Evas_Object *sobj)
506{ 535{
507 Elm_Widget_Smart_Class *parent_parent; 536 Eina_Bool *enable = va_arg(*list, Eina_Bool *);
537 *enable = EINA_FALSE;
538}
508 539
509 parent_parent = (Elm_Widget_Smart_Class *)((Evas_Smart_Class *) 540static void
510 _elm_ctxpopup_parent_sc)->parent; 541_elm_ctxpopup_smart_sub_object_add(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
542{
543 Evas_Object *sobj = va_arg(*list, Evas_Object *);
544 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
545 Eina_Bool int_ret;
511 546
512 /* skipping layout's code, which registers size hint changing 547 eo_do_super(obj, elm_wdg_sub_object_add(sobj, &int_ret));
513 * callback on sub objects. a hack to make ctxpopup live, as it is,
514 * on the new classing schema. this widget needs a total
515 * rewrite. */
516 if (!parent_parent->sub_object_add(obj, sobj))
517 return EINA_FALSE;
518 548
519 return EINA_TRUE; 549 if (ret) *ret = int_ret;
520} 550}
521 551
522static void 552static void
523_elm_ctxpopup_smart_sizing_eval(Evas_Object *obj) 553_elm_ctxpopup_smart_sizing_eval(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
524{ 554{
525 Evas_Coord_Rectangle rect = { 0, 0, 1, 1 }; 555 Evas_Coord_Rectangle rect = { 0, 0, 1, 1 };
526 Evas_Coord_Point list_size = { 0, 0 }; 556 Evas_Coord_Point list_size = { 0, 0 };
527 557
528 ELM_CTXPOPUP_DATA_GET(obj, sd); 558 Elm_Ctxpopup_Smart_Data *sd = _pd;
559 Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
529 560
530 if (!sd->arrow) return; /* simple way to flag "under deletion" */ 561 if (!sd->arrow) return; /* simple way to flag "under deletion" */
531 562
@@ -547,8 +578,8 @@ _elm_ctxpopup_smart_sizing_eval(Evas_Object *obj)
547 } 578 }
548 } 579 }
549 580
550 evas_object_move(ELM_WIDGET_DATA(sd)->resize_obj, rect.x, rect.y); 581 evas_object_move(wd->resize_obj, rect.x, rect.y);
551 evas_object_resize(ELM_WIDGET_DATA(sd)->resize_obj, rect.w, rect.h); 582 evas_object_resize(wd->resize_obj, rect.w, rect.h);
552 583
553 _show_signals_emit(obj, sd->dir); 584 _show_signals_emit(obj, sd->dir);
554} 585}
@@ -616,13 +647,17 @@ _on_content_resized(void *data,
616} 647}
617 648
618//FIXME: lost the content size when theme hook is called. 649//FIXME: lost the content size when theme hook is called.
619static Eina_Bool 650static void
620_elm_ctxpopup_smart_theme(Evas_Object *obj) 651_elm_ctxpopup_smart_theme(Eo *obj, void *_pd, va_list *list)
621{ 652{
622 ELM_CTXPOPUP_DATA_GET(obj, sd); 653 Elm_Ctxpopup_Smart_Data *sd = _pd;
623 654
624 if (!ELM_WIDGET_CLASS(_elm_ctxpopup_parent_sc)->theme(obj)) 655 Eina_Bool int_ret;
625 return EINA_FALSE; 656 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
657 if (ret) *ret = EINA_FALSE;
658
659 eo_do_super(obj, elm_wdg_theme(&int_ret));
660 if (!int_ret) return;
626 661
627 elm_widget_theme_object_set 662 elm_widget_theme_object_set
628 (obj, sd->bg, "ctxpopup", "bg", elm_widget_style_get(obj)); 663 (obj, sd->bg, "ctxpopup", "bg", elm_widget_style_get(obj));
@@ -641,27 +676,35 @@ _elm_ctxpopup_smart_theme(Evas_Object *obj)
641 676
642 if (sd->visible) elm_layout_sizing_eval(obj); 677 if (sd->visible) elm_layout_sizing_eval(obj);
643 678
644 return EINA_TRUE; 679 if (ret) *ret = EINA_TRUE;
645} 680}
646 681
647/* kind of a big and tricky override here: an internal box will hold 682/* kind of a big and tricky override here: an internal box will hold
648 * the actual content. content aliases won't be of much help here */ 683 * the actual content. content aliases won't be of much help here */
649static Eina_Bool 684static void
650_elm_ctxpopup_smart_content_set(Evas_Object *obj, 685_elm_ctxpopup_smart_content_set(Eo *obj, void *_pd, va_list *list)
651 const char *part,
652 Evas_Object *content)
653{ 686{
654 Evas_Coord min_w = -1, min_h = -1; 687 Evas_Coord min_w = -1, min_h = -1;
655 688
656 ELM_CTXPOPUP_DATA_GET(obj, sd); 689 Elm_Ctxpopup_Smart_Data *sd = _pd;
690 const char *part = va_arg(*list, const char *);
691 Evas_Object *content = va_arg(*list, Evas_Object *);
692 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
693 Eina_Bool int_ret = EINA_TRUE;
657 694
658 if ((part) && (strcmp(part, "default"))) 695 if ((part) && (strcmp(part, "default")))
659 return ELM_CONTAINER_CLASS(_elm_ctxpopup_parent_sc)->content_set 696 {
660 (obj, part, content); 697 eo_do_super(obj, elm_obj_container_content_set(part, content, &int_ret));
698 goto end;
699 }
661 700
662 if (!content) return EINA_FALSE; 701 if (!content)
702 {
703 int_ret = EINA_FALSE;
704 goto end;
705 }
663 706
664 if (content == sd->content) return EINA_TRUE; 707 if (content == sd->content) goto end;
665 708
666 if (sd->content) evas_object_del(sd->content); 709 if (sd->content) evas_object_del(sd->content);
667 if (sd->content == sd->list) sd->list = NULL; 710 if (sd->content == sd->list) sd->list = NULL;
@@ -683,43 +726,53 @@ _elm_ctxpopup_smart_content_set(Evas_Object *obj,
683 726
684 if (sd->visible) elm_layout_sizing_eval(obj); 727 if (sd->visible) elm_layout_sizing_eval(obj);
685 728
686 return EINA_TRUE; 729end:
730 if (ret) *ret = int_ret;
687} 731}
688 732
689static Evas_Object * 733static void
690_elm_ctxpopup_smart_content_get(const Evas_Object *obj, 734_elm_ctxpopup_smart_content_get(Eo *obj, void *_pd, va_list *list)
691 const char *part)
692{ 735{
693 ELM_CTXPOPUP_DATA_GET(obj, sd); 736 const char *part = va_arg(*list, const char *);
737 Evas_Object **ret = va_arg(*list, Evas_Object **);
738 *ret = NULL;
694 739
695 if ((part) && (strcmp(part, "default"))) 740 if ((part) && (strcmp(part, "default")))
696 return ELM_CONTAINER_CLASS(_elm_ctxpopup_parent_sc)->content_get 741 {
697 (obj, part); 742 eo_do_super(obj, elm_obj_container_content_get(part, ret));
743 return;
744 }
698 745
699 return sd->content; 746 Elm_Ctxpopup_Smart_Data *sd = _pd;
747
748 *ret = sd->content;
700} 749}
701 750
702static Evas_Object * 751static void
703_elm_ctxpopup_smart_content_unset(Evas_Object *obj, 752_elm_ctxpopup_smart_content_unset(Eo *obj, void *_pd, va_list *list)
704 const char *part)
705{ 753{
706 Evas_Object *content; 754 Evas_Object *content;
707 755
708 ELM_CTXPOPUP_DATA_GET(obj, sd); 756 const char *part = va_arg(*list, const char *);
757 Evas_Object **ret = va_arg(*list, Evas_Object **);
709 758
710 if ((part) && (strcmp(part, "default"))) 759 if ((part) && (strcmp(part, "default")))
711 return ELM_CONTAINER_CLASS(_elm_ctxpopup_parent_sc)->content_unset 760 {
712 (obj, part); 761 eo_do_super(obj, elm_obj_container_content_unset(part, &content));
762 goto end;
763 }
713 764
765 Elm_Ctxpopup_Smart_Data *sd = _pd;
714 content = sd->content; 766 content = sd->content;
715 if (!content) return NULL; 767 if (!content) goto end;
716 768
717 sd->content = NULL; 769 sd->content = NULL;
718 sd->dir = ELM_CTXPOPUP_DIRECTION_UNKNOWN; 770 sd->dir = ELM_CTXPOPUP_DIRECTION_UNKNOWN;
719 771
720 if (sd->visible) elm_layout_sizing_eval(obj); 772 if (sd->visible) elm_layout_sizing_eval(obj);
721 773
722 return content; 774end:
775 if (ret) *ret = content;
723} 776}
724 777
725static void 778static void
@@ -962,25 +1015,29 @@ _item_del_pre_hook(Elm_Object_Item *it)
962 return EINA_TRUE; 1015 return EINA_TRUE;
963} 1016}
964 1017
965static Eina_Bool 1018static void
966_elm_ctxpopup_smart_disable(Evas_Object *obj) 1019_elm_ctxpopup_smart_disable(Eo *obj, void *_pd, va_list *list)
967{ 1020{
968 ELM_CTXPOPUP_DATA_GET(obj, sd); 1021 Elm_Ctxpopup_Smart_Data *sd = _pd;
969 1022
970 if (!ELM_WIDGET_CLASS(_elm_ctxpopup_parent_sc)->disable(obj)) 1023 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
971 return EINA_FALSE; 1024 if (ret) *ret = EINA_FALSE;
1025 Eina_Bool int_ret;
1026
1027 eo_do_super(obj, elm_wdg_disable(&int_ret));
1028 if (!int_ret) return;
972 1029
973 elm_object_disabled_set(sd->list, elm_widget_disabled_get(obj)); 1030 elm_object_disabled_set(sd->list, elm_widget_disabled_get(obj));
974 1031
975 return EINA_TRUE; 1032 if (ret) *ret = EINA_TRUE;
976} 1033}
977 1034
978static void 1035static void
979_elm_ctxpopup_smart_add(Evas_Object *obj) 1036_elm_ctxpopup_smart_add(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
980{ 1037{
981 EVAS_SMART_DATA_ALLOC(obj, Elm_Ctxpopup_Smart_Data); 1038 Elm_Ctxpopup_Smart_Data *priv = _pd;
982 1039
983 ELM_WIDGET_CLASS(_elm_ctxpopup_parent_sc)->base.add(obj); 1040 eo_do_super(obj, evas_obj_smart_add());
984 1041
985 elm_layout_theme_set(obj, "ctxpopup", "base", elm_widget_style_get(obj)); 1042 elm_layout_theme_set(obj, "ctxpopup", "base", elm_widget_style_get(obj));
986 elm_layout_signal_callback_add 1043 elm_layout_signal_callback_add
@@ -1016,8 +1073,8 @@ _elm_ctxpopup_smart_add(Evas_Object *obj)
1016 (priv->box, EVAS_CALLBACK_RESIZE, _on_content_resized, obj); 1073 (priv->box, EVAS_CALLBACK_RESIZE, _on_content_resized, obj);
1017 1074
1018 /* box will be our content placeholder, thus the parent's version call */ 1075 /* box will be our content placeholder, thus the parent's version call */
1019 ELM_CONTAINER_CLASS(_elm_ctxpopup_parent_sc)->content_set 1076 Eina_Bool ret;
1020 (obj, "elm.swallow.content", priv->box); 1077 eo_do_super(obj, elm_obj_container_content_set("elm.swallow.content", priv->box, &ret));
1021 1078
1022 evas_object_event_callback_add(obj, EVAS_CALLBACK_SHOW, _on_show, NULL); 1079 evas_object_event_callback_add(obj, EVAS_CALLBACK_SHOW, _on_show, NULL);
1023 evas_object_event_callback_add(obj, EVAS_CALLBACK_HIDE, _on_hide, NULL); 1080 evas_object_event_callback_add(obj, EVAS_CALLBACK_HIDE, _on_hide, NULL);
@@ -1027,9 +1084,9 @@ _elm_ctxpopup_smart_add(Evas_Object *obj)
1027} 1084}
1028 1085
1029static void 1086static void
1030_elm_ctxpopup_smart_del(Evas_Object *obj) 1087_elm_ctxpopup_smart_del(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
1031{ 1088{
1032 ELM_CTXPOPUP_DATA_GET(obj, sd); 1089 Elm_Ctxpopup_Smart_Data *sd = _pd;
1033 1090
1034 evas_object_event_callback_del_full 1091 evas_object_event_callback_del_full
1035 (sd->box, EVAS_CALLBACK_RESIZE, _on_content_resized, obj); 1092 (sd->box, EVAS_CALLBACK_RESIZE, _on_content_resized, obj);
@@ -1042,80 +1099,53 @@ _elm_ctxpopup_smart_del(Evas_Object *obj)
1042 evas_object_del(sd->bg); 1099 evas_object_del(sd->bg);
1043 sd->bg = NULL; 1100 sd->bg = NULL;
1044 1101
1045 ELM_WIDGET_CLASS(_elm_ctxpopup_parent_sc)->base.del(obj); 1102 eo_do_super(obj, evas_obj_smart_del());
1046} 1103}
1047 1104
1048static void 1105static void
1049_elm_ctxpopup_smart_parent_set(Evas_Object *obj, 1106_elm_ctxpopup_smart_parent_set(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
1050 Evas_Object *parent)
1051{ 1107{
1108 Evas_Object *parent = va_arg(*list, Evas_Object *);
1052 //default parent is to be hover parent 1109 //default parent is to be hover parent
1053 elm_ctxpopup_hover_parent_set(obj, parent); 1110 elm_ctxpopup_hover_parent_set(obj, parent);
1054} 1111}
1055 1112
1056static void
1057_elm_ctxpopup_smart_set_user(Elm_Ctxpopup_Smart_Class *sc)
1058{
1059 ELM_WIDGET_CLASS(sc)->base.add = _elm_ctxpopup_smart_add;
1060 ELM_WIDGET_CLASS(sc)->base.del = _elm_ctxpopup_smart_del;
1061
1062 ELM_WIDGET_CLASS(sc)->parent_set = _elm_ctxpopup_smart_parent_set;
1063 ELM_WIDGET_CLASS(sc)->disable = _elm_ctxpopup_smart_disable;
1064 ELM_WIDGET_CLASS(sc)->event = _elm_ctxpopup_smart_event;
1065 ELM_WIDGET_CLASS(sc)->theme = _elm_ctxpopup_smart_theme;
1066 ELM_WIDGET_CLASS(sc)->sub_object_add = _elm_ctxpopup_smart_sub_object_add;
1067 ELM_WIDGET_CLASS(sc)->focus_next = _elm_ctxpopup_smart_focus_next;
1068 ELM_WIDGET_CLASS(sc)->focus_direction = NULL;
1069
1070 ELM_CONTAINER_CLASS(sc)->content_get = _elm_ctxpopup_smart_content_get;
1071 ELM_CONTAINER_CLASS(sc)->content_set = _elm_ctxpopup_smart_content_set;
1072 ELM_CONTAINER_CLASS(sc)->content_unset = _elm_ctxpopup_smart_content_unset;
1073
1074 ELM_LAYOUT_CLASS(sc)->sizing_eval = _elm_ctxpopup_smart_sizing_eval;
1075}
1076
1077EAPI const Elm_Ctxpopup_Smart_Class *
1078elm_ctxpopup_smart_class_get(void)
1079{
1080 static Elm_Ctxpopup_Smart_Class _sc =
1081 ELM_CTXPOPUP_SMART_CLASS_INIT_NAME_VERSION(ELM_CTXPOPUP_SMART_NAME);
1082 static const Elm_Ctxpopup_Smart_Class *class = NULL;
1083 Evas_Smart_Class *esc = (Evas_Smart_Class *)&_sc;
1084
1085 if (class)
1086 return class;
1087
1088 _elm_ctxpopup_smart_set(&_sc);
1089 esc->callbacks = _smart_callbacks;
1090 class = &_sc;
1091
1092 return class;
1093}
1094
1095EAPI Evas_Object * 1113EAPI Evas_Object *
1096elm_ctxpopup_add(Evas_Object *parent) 1114elm_ctxpopup_add(Evas_Object *parent)
1097{ 1115{
1098 Evas_Object *obj;
1099
1100 EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL); 1116 EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
1117 Evas_Object *obj = eo_add(MY_CLASS, parent);
1118 eo_unref(obj);
1119 return obj;
1120}
1101 1121
1102 obj = elm_widget_add(_elm_ctxpopup_smart_class_new(), parent); 1122static void
1103 if (!obj) return NULL; 1123_constructor(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
1104 1124{
1105 if (!elm_widget_sub_object_add(parent, obj)) 1125 eo_do_super(obj, eo_constructor());
1106 ERR("could not add %p as sub object of %p", obj, parent); 1126 eo_do(obj,
1127 evas_obj_type_set(MY_CLASS_NAME),
1128 evas_obj_smart_callbacks_descriptions_set(_smart_callbacks, NULL));
1107 1129
1108 return obj; 1130 if (!elm_widget_sub_object_add(eo_parent_get(obj), obj))
1131 ERR("could not add %p as sub object of %p", obj, eo_parent_get(obj));
1109} 1132}
1110 1133
1111EAPI void 1134EAPI void
1112elm_ctxpopup_hover_parent_set(Evas_Object *obj, 1135elm_ctxpopup_hover_parent_set(Evas_Object *obj,
1113 Evas_Object *parent) 1136 Evas_Object *parent)
1114{ 1137{
1138 ELM_CTXPOPUP_CHECK(obj);
1139 eo_do(obj, elm_obj_ctxpopup_hover_parent_set(parent));
1140}
1141
1142static void
1143_hover_parent_set(Eo *obj, void *_pd, va_list *list)
1144{
1115 Evas_Coord x, y, w, h; 1145 Evas_Coord x, y, w, h;
1146 Evas_Object *parent = va_arg(*list, Evas_Object *);
1116 1147
1117 ELM_CTXPOPUP_CHECK(obj); 1148 Elm_Ctxpopup_Smart_Data *sd = _pd;
1118 ELM_CTXPOPUP_DATA_GET(obj, sd);
1119 1149
1120 if (!parent) return; 1150 if (!parent) return;
1121 1151
@@ -1142,16 +1172,30 @@ EAPI Evas_Object *
1142elm_ctxpopup_hover_parent_get(const Evas_Object *obj) 1172elm_ctxpopup_hover_parent_get(const Evas_Object *obj)
1143{ 1173{
1144 ELM_CTXPOPUP_CHECK(obj) NULL; 1174 ELM_CTXPOPUP_CHECK(obj) NULL;
1145 ELM_CTXPOPUP_DATA_GET(obj, sd); 1175 Evas_Object *ret = NULL;
1176 eo_do((Eo *) obj, elm_obj_ctxpopup_hover_parent_get(&ret));
1177 return ret;
1178}
1146 1179
1147 return sd->parent; 1180static void
1181_hover_parent_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
1182{
1183 Evas_Object **ret = va_arg(*list, Evas_Object **);
1184 Elm_Ctxpopup_Smart_Data *sd = _pd;
1185 *ret = sd->parent;
1148} 1186}
1149 1187
1150EAPI void 1188EAPI void
1151elm_ctxpopup_clear(Evas_Object *obj) 1189elm_ctxpopup_clear(Evas_Object *obj)
1152{ 1190{
1153 ELM_CTXPOPUP_CHECK(obj); 1191 ELM_CTXPOPUP_CHECK(obj);
1154 ELM_CTXPOPUP_DATA_GET(obj, sd); 1192 eo_do(obj, elm_obj_ctxpopup_clear());
1193}
1194
1195static void
1196_clear(Eo *obj EINA_UNUSED, void *_pd, va_list *list EINA_UNUSED)
1197{
1198 Elm_Ctxpopup_Smart_Data *sd = _pd;
1155 1199
1156 _list_del(sd); 1200 _list_del(sd);
1157 sd->dir = ELM_CTXPOPUP_DIRECTION_UNKNOWN; 1201 sd->dir = ELM_CTXPOPUP_DIRECTION_UNKNOWN;
@@ -1162,7 +1206,14 @@ elm_ctxpopup_horizontal_set(Evas_Object *obj,
1162 Eina_Bool horizontal) 1206 Eina_Bool horizontal)
1163{ 1207{
1164 ELM_CTXPOPUP_CHECK(obj); 1208 ELM_CTXPOPUP_CHECK(obj);
1165 ELM_CTXPOPUP_DATA_GET(obj, sd); 1209 eo_do(obj, elm_obj_ctxpopup_horizontal_set(horizontal));
1210}
1211
1212static void
1213_horizontal_set(Eo *obj, void *_pd, va_list *list)
1214{
1215 Eina_Bool horizontal = va_arg(*list, int);
1216 Elm_Ctxpopup_Smart_Data *sd = _pd;
1166 1217
1167 sd->horizontal = !!horizontal; 1218 sd->horizontal = !!horizontal;
1168 1219
@@ -1179,9 +1230,18 @@ EAPI Eina_Bool
1179elm_ctxpopup_horizontal_get(const Evas_Object *obj) 1230elm_ctxpopup_horizontal_get(const Evas_Object *obj)
1180{ 1231{
1181 ELM_CTXPOPUP_CHECK(obj) EINA_FALSE; 1232 ELM_CTXPOPUP_CHECK(obj) EINA_FALSE;
1182 ELM_CTXPOPUP_DATA_GET(obj, sd); 1233 Eina_Bool ret = EINA_FALSE;
1234 eo_do((Eo *) obj, elm_obj_ctxpopup_horizontal_get(&ret));
1235 return ret;
1236}
1183 1237
1184 return sd->horizontal; 1238static void
1239_horizontal_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
1240{
1241 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
1242 Elm_Ctxpopup_Smart_Data *sd = _pd;
1243
1244 *ret = sd->horizontal;
1185} 1245}
1186 1246
1187EAPI Elm_Object_Item * 1247EAPI Elm_Object_Item *
@@ -1191,13 +1251,29 @@ elm_ctxpopup_item_append(Evas_Object *obj,
1191 Evas_Smart_Cb func, 1251 Evas_Smart_Cb func,
1192 const void *data) 1252 const void *data)
1193{ 1253{
1194 Elm_Ctxpopup_Item *item;
1195 1254
1196 ELM_CTXPOPUP_CHECK(obj) NULL; 1255 ELM_CTXPOPUP_CHECK(obj) NULL;
1197 ELM_CTXPOPUP_DATA_GET(obj, sd); 1256 Elm_Object_Item *ret = NULL;
1257 eo_do(obj, elm_obj_ctxpopup_item_append(label, icon, func, data, &ret));
1258 return ret;
1259}
1260
1261static void
1262_item_append(Eo *obj, void *_pd, va_list *list)
1263{
1264 const char *label = va_arg(*list, const char *);
1265 Evas_Object *icon = va_arg(*list, Evas_Object *);
1266 Evas_Smart_Cb func = va_arg(*list, Evas_Smart_Cb);
1267 const void *data = va_arg(*list, const void *);
1268 Elm_Object_Item **ret = va_arg(*list, Elm_Object_Item **);
1269 *ret = NULL;
1270
1271 Elm_Ctxpopup_Item *item;
1272
1273 Elm_Ctxpopup_Smart_Data *sd = _pd;
1198 1274
1199 item = elm_widget_item_new(obj, Elm_Ctxpopup_Item); 1275 item = elm_widget_item_new(obj, Elm_Ctxpopup_Item);
1200 if (!item) return NULL; 1276 if (!item) return;
1201 1277
1202 elm_widget_item_del_pre_hook_set(item, _item_del_pre_hook); 1278 elm_widget_item_del_pre_hook_set(item, _item_del_pre_hook);
1203 elm_widget_item_disable_hook_set(item, _item_disable_hook); 1279 elm_widget_item_disable_hook_set(item, _item_disable_hook);
@@ -1225,7 +1301,7 @@ elm_ctxpopup_item_append(Evas_Object *obj,
1225 1301
1226 if (sd->visible) elm_layout_sizing_eval(obj); 1302 if (sd->visible) elm_layout_sizing_eval(obj);
1227 1303
1228 return (Elm_Object_Item *)item; 1304 *ret = (Elm_Object_Item *)item;
1229} 1305}
1230 1306
1231EAPI void 1307EAPI void
@@ -1236,7 +1312,18 @@ elm_ctxpopup_direction_priority_set(Evas_Object *obj,
1236 Elm_Ctxpopup_Direction fourth) 1312 Elm_Ctxpopup_Direction fourth)
1237{ 1313{
1238 ELM_CTXPOPUP_CHECK(obj); 1314 ELM_CTXPOPUP_CHECK(obj);
1239 ELM_CTXPOPUP_DATA_GET(obj, sd); 1315 eo_do(obj, elm_obj_ctxpopup_direction_priority_set(first, second, third, fourth));
1316}
1317
1318static void
1319_direction_priority_set(Eo *obj, void *_pd, va_list *list)
1320{
1321 Elm_Ctxpopup_Direction first = va_arg(*list, Elm_Ctxpopup_Direction);
1322 Elm_Ctxpopup_Direction second = va_arg(*list, Elm_Ctxpopup_Direction);
1323 Elm_Ctxpopup_Direction third = va_arg(*list, Elm_Ctxpopup_Direction);
1324 Elm_Ctxpopup_Direction fourth = va_arg(*list, Elm_Ctxpopup_Direction);
1325
1326 Elm_Ctxpopup_Smart_Data *sd = _pd;
1240 1327
1241 sd->dir_priority[0] = first; 1328 sd->dir_priority[0] = first;
1242 sd->dir_priority[1] = second; 1329 sd->dir_priority[1] = second;
@@ -1254,7 +1341,18 @@ elm_ctxpopup_direction_priority_get(Evas_Object *obj,
1254 Elm_Ctxpopup_Direction *fourth) 1341 Elm_Ctxpopup_Direction *fourth)
1255{ 1342{
1256 ELM_CTXPOPUP_CHECK(obj); 1343 ELM_CTXPOPUP_CHECK(obj);
1257 ELM_CTXPOPUP_DATA_GET(obj, sd); 1344 eo_do(obj, elm_obj_ctxpopup_direction_priority_get(first, second, third, fourth));
1345}
1346
1347static void
1348_direction_priority_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
1349{
1350 Elm_Ctxpopup_Direction *first = va_arg(*list, Elm_Ctxpopup_Direction *);
1351 Elm_Ctxpopup_Direction *second = va_arg(*list, Elm_Ctxpopup_Direction *);
1352 Elm_Ctxpopup_Direction *third = va_arg(*list, Elm_Ctxpopup_Direction *);
1353 Elm_Ctxpopup_Direction *fourth = va_arg(*list, Elm_Ctxpopup_Direction *);
1354
1355 Elm_Ctxpopup_Smart_Data *sd = _pd;
1258 1356
1259 if (first) *first = sd->dir_priority[0]; 1357 if (first) *first = sd->dir_priority[0];
1260 if (second) *second = sd->dir_priority[1]; 1358 if (second) *second = sd->dir_priority[1];
@@ -1266,16 +1364,95 @@ EAPI Elm_Ctxpopup_Direction
1266elm_ctxpopup_direction_get(const Evas_Object *obj) 1364elm_ctxpopup_direction_get(const Evas_Object *obj)
1267{ 1365{
1268 ELM_CTXPOPUP_CHECK(obj) ELM_CTXPOPUP_DIRECTION_UNKNOWN; 1366 ELM_CTXPOPUP_CHECK(obj) ELM_CTXPOPUP_DIRECTION_UNKNOWN;
1269 ELM_CTXPOPUP_DATA_GET(obj, sd); 1367 Elm_Ctxpopup_Direction ret = ELM_CTXPOPUP_DIRECTION_UNKNOWN;
1368 eo_do((Eo *) obj, elm_obj_ctxpopup_direction_get(&ret));
1369 return ret;
1370}
1270 1371
1271 return sd->dir; 1372static void
1373_direction_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
1374{
1375 Elm_Ctxpopup_Direction *ret = va_arg(*list, Elm_Ctxpopup_Direction *);
1376 Elm_Ctxpopup_Smart_Data *sd = _pd;
1377
1378 *ret = sd->dir;
1272} 1379}
1273 1380
1274EAPI void 1381EAPI void
1275elm_ctxpopup_dismiss(Evas_Object *obj) 1382elm_ctxpopup_dismiss(Evas_Object *obj)
1276{ 1383{
1277 ELM_CTXPOPUP_CHECK(obj); 1384 ELM_CTXPOPUP_CHECK(obj);
1278 ELM_CTXPOPUP_DATA_GET(obj, sd); 1385 eo_do(obj, elm_obj_ctxpopup_dismiss());
1386}
1387
1388static void
1389_dismiss(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
1390{
1391 Elm_Ctxpopup_Smart_Data *sd = _pd;
1279 1392
1280 _hide_signals_emit(obj, sd->dir); 1393 _hide_signals_emit(obj, sd->dir);
1281} 1394}
1395
1396static void
1397_class_constructor(Eo_Class *klass)
1398{
1399 const Eo_Op_Func_Description func_desc[] = {
1400 EO_OP_FUNC(EO_BASE_ID(EO_BASE_SUB_ID_CONSTRUCTOR), _constructor),
1401
1402 EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_ADD), _elm_ctxpopup_smart_add),
1403 EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_DEL), _elm_ctxpopup_smart_del),
1404
1405 EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_PARENT_SET), _elm_ctxpopup_smart_parent_set),
1406 EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_DISABLE), _elm_ctxpopup_smart_disable),
1407 EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_EVENT), _elm_ctxpopup_smart_event),
1408 EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_THEME), _elm_ctxpopup_smart_theme),
1409 EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_SUB_OBJECT_ADD), _elm_ctxpopup_smart_sub_object_add),
1410 EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_NEXT_MANAGER_IS), _elm_ctxpopup_smart_focus_next_manager_is),
1411 EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_NEXT), _elm_ctxpopup_smart_focus_next),
1412 EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_DIRECTION_MANAGER_IS), _elm_ctxpopup_smart_focus_direction_manager_is),
1413
1414 EO_OP_FUNC(ELM_OBJ_CONTAINER_ID(ELM_OBJ_CONTAINER_SUB_ID_CONTENT_SET), _elm_ctxpopup_smart_content_set),
1415 EO_OP_FUNC(ELM_OBJ_CONTAINER_ID(ELM_OBJ_CONTAINER_SUB_ID_CONTENT_GET), _elm_ctxpopup_smart_content_get),
1416 EO_OP_FUNC(ELM_OBJ_CONTAINER_ID(ELM_OBJ_CONTAINER_SUB_ID_CONTENT_UNSET), _elm_ctxpopup_smart_content_unset),
1417
1418 EO_OP_FUNC(ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_SIZING_EVAL), _elm_ctxpopup_smart_sizing_eval),
1419 EO_OP_FUNC(ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_SUB_OBJECT_ADD_ENABLE), _elm_ctxpopup_smart_layout_sub_object_add_enable),
1420
1421 EO_OP_FUNC(ELM_OBJ_CTXPOPUP_ID(ELM_OBJ_CTXPOPUP_SUB_ID_HOVER_PARENT_SET), _hover_parent_set),
1422 EO_OP_FUNC(ELM_OBJ_CTXPOPUP_ID(ELM_OBJ_CTXPOPUP_SUB_ID_HOVER_PARENT_GET), _hover_parent_get),
1423 EO_OP_FUNC(ELM_OBJ_CTXPOPUP_ID(ELM_OBJ_CTXPOPUP_SUB_ID_CLEAR), _clear),
1424 EO_OP_FUNC(ELM_OBJ_CTXPOPUP_ID(ELM_OBJ_CTXPOPUP_SUB_ID_HORIZONTAL_SET), _horizontal_set),
1425 EO_OP_FUNC(ELM_OBJ_CTXPOPUP_ID(ELM_OBJ_CTXPOPUP_SUB_ID_HORIZONTAL_GET), _horizontal_get),
1426 EO_OP_FUNC(ELM_OBJ_CTXPOPUP_ID(ELM_OBJ_CTXPOPUP_SUB_ID_ITEM_APPEND), _item_append),
1427 EO_OP_FUNC(ELM_OBJ_CTXPOPUP_ID(ELM_OBJ_CTXPOPUP_SUB_ID_DIRECTION_PRIORITY_SET), _direction_priority_set),
1428 EO_OP_FUNC(ELM_OBJ_CTXPOPUP_ID(ELM_OBJ_CTXPOPUP_SUB_ID_DIRECTION_PRIORITY_GET), _direction_priority_get),
1429 EO_OP_FUNC(ELM_OBJ_CTXPOPUP_ID(ELM_OBJ_CTXPOPUP_SUB_ID_DIRECTION_GET), _direction_get),
1430 EO_OP_FUNC(ELM_OBJ_CTXPOPUP_ID(ELM_OBJ_CTXPOPUP_SUB_ID_DISMISS), _dismiss),
1431 EO_OP_FUNC_SENTINEL
1432 };
1433 eo_class_funcs_set(klass, func_desc);
1434}
1435static const Eo_Op_Description op_desc[] = {
1436 EO_OP_DESCRIPTION(ELM_OBJ_CTXPOPUP_SUB_ID_HOVER_PARENT_SET, "Set the Ctxpopup's parent."),
1437 EO_OP_DESCRIPTION(ELM_OBJ_CTXPOPUP_SUB_ID_HOVER_PARENT_GET, "Get the Ctxpopup's parent."),
1438 EO_OP_DESCRIPTION(ELM_OBJ_CTXPOPUP_SUB_ID_CLEAR, "Clear all items in the given ctxpopup object."),
1439 EO_OP_DESCRIPTION(ELM_OBJ_CTXPOPUP_SUB_ID_HORIZONTAL_SET, "Change the ctxpopup's orientation to horizontal or vertical."),
1440 EO_OP_DESCRIPTION(ELM_OBJ_CTXPOPUP_SUB_ID_HORIZONTAL_GET, "Get the value of current ctxpopup object's orientation."),
1441 EO_OP_DESCRIPTION(ELM_OBJ_CTXPOPUP_SUB_ID_ITEM_APPEND, "Add a new item to a ctxpopup object."),
1442 EO_OP_DESCRIPTION(ELM_OBJ_CTXPOPUP_SUB_ID_DIRECTION_PRIORITY_SET, "Set the direction priority of a ctxpopup."),
1443 EO_OP_DESCRIPTION(ELM_OBJ_CTXPOPUP_SUB_ID_DIRECTION_PRIORITY_GET, "Get the direction priority of a ctxpopup."),
1444 EO_OP_DESCRIPTION(ELM_OBJ_CTXPOPUP_SUB_ID_DIRECTION_GET, "Get the current direction of a ctxpopup."),
1445 EO_OP_DESCRIPTION(ELM_OBJ_CTXPOPUP_SUB_ID_DISMISS, "Dismiss a ctxpopup object."),
1446 EO_OP_DESCRIPTION_SENTINEL
1447};
1448static const Eo_Class_Description class_desc = {
1449 EO_VERSION,
1450 MY_CLASS_NAME,
1451 EO_CLASS_TYPE_REGULAR,
1452 EO_CLASS_DESCRIPTION_OPS(&ELM_OBJ_CTXPOPUP_BASE_ID, op_desc, ELM_OBJ_CTXPOPUP_SUB_ID_LAST),
1453 NULL,
1454 sizeof(Elm_Ctxpopup_Smart_Data),
1455 _class_constructor,
1456 NULL
1457};
1458EO_DEFINE_CLASS(elm_obj_ctxpopup_class_get, &class_desc, ELM_OBJ_LAYOUT_CLASS, NULL);
diff --git a/src/lib/elc_ctxpopup.h b/src/lib/elc_ctxpopup.h
index ce6cc7c59..fb1e5028a 100644
--- a/src/lib/elc_ctxpopup.h
+++ b/src/lib/elc_ctxpopup.h
@@ -18,7 +18,7 @@
18 * items have a label and/or an icon. It is intended for a small 18 * items have a label and/or an icon. It is intended for a small
19 * number of items (hence the use of list, not genlist). 19 * number of items (hence the use of list, not genlist).
20 * 20 *
21 * This widget inherits from the @ref Layout one, so that all the 21 * This widget inherits from the Layout one, so that all the
22 * functions acting on it also work for context popup objects 22 * functions acting on it also work for context popup objects
23 * (@since 1.8). 23 * (@since 1.8).
24 * 24 *
@@ -52,6 +52,157 @@
52 * @{ 52 * @{
53 */ 53 */
54 54
55#define ELM_OBJ_CTXPOPUP_CLASS elm_obj_ctxpopup_class_get()
56
57const Eo_Class *elm_obj_ctxpopup_class_get(void) EINA_CONST;
58
59extern EAPI Eo_Op ELM_OBJ_CTXPOPUP_BASE_ID;
60
61enum
62{
63 ELM_OBJ_CTXPOPUP_SUB_ID_HOVER_PARENT_SET,
64 ELM_OBJ_CTXPOPUP_SUB_ID_HOVER_PARENT_GET,
65 ELM_OBJ_CTXPOPUP_SUB_ID_CLEAR,
66 ELM_OBJ_CTXPOPUP_SUB_ID_HORIZONTAL_SET,
67 ELM_OBJ_CTXPOPUP_SUB_ID_HORIZONTAL_GET,
68 ELM_OBJ_CTXPOPUP_SUB_ID_ITEM_APPEND,
69 ELM_OBJ_CTXPOPUP_SUB_ID_DIRECTION_PRIORITY_SET,
70 ELM_OBJ_CTXPOPUP_SUB_ID_DIRECTION_PRIORITY_GET,
71 ELM_OBJ_CTXPOPUP_SUB_ID_DIRECTION_GET,
72 ELM_OBJ_CTXPOPUP_SUB_ID_DISMISS,
73 ELM_OBJ_CTXPOPUP_SUB_ID_LAST
74};
75
76#define ELM_OBJ_CTXPOPUP_ID(sub_id) (ELM_OBJ_CTXPOPUP_BASE_ID + sub_id)
77
78
79/**
80 * @def ctxpopup_hover_parent_set
81 * @since 1.8
82 *
83 * @brief Set the Ctxpopup's parent
84 *
85 * @param[in] parent
86 *
87 * @see elm_ctxpopup_hover_parent_set
88 */
89#define elm_obj_ctxpopup_hover_parent_set(parent) ELM_OBJ_CTXPOPUP_ID(ELM_OBJ_CTXPOPUP_SUB_ID_HOVER_PARENT_SET), EO_TYPECHECK(Evas_Object *, parent)
90
91/**
92 * @def ctxpopup_hover_parent_get
93 * @since 1.8
94 *
95 * @brief Get the Ctxpopup's parent
96 *
97 * @param[out] ret
98 *
99 * @see elm_ctxpopup_hover_parent_get
100 */
101#define elm_obj_ctxpopup_hover_parent_get(ret) ELM_OBJ_CTXPOPUP_ID(ELM_OBJ_CTXPOPUP_SUB_ID_HOVER_PARENT_GET), EO_TYPECHECK(Evas_Object **, ret)
102
103/**
104 * @def ctxpopup_clear
105 * @since 1.8
106 *
107 * @brief Clear all items in the given ctxpopup object.
108 *
109 *
110 * @see elm_ctxpopup_clear
111 */
112#define elm_obj_ctxpopup_clear() ELM_OBJ_CTXPOPUP_ID(ELM_OBJ_CTXPOPUP_SUB_ID_CLEAR)
113
114/**
115 * @def ctxpopup_horizontal_set
116 * @since 1.8
117 *
118 * @brief Change the ctxpopup's orientation to horizontal or vertical.
119 *
120 * @param[in] horizontal
121 *
122 * @see elm_ctxpopup_horizontal_set
123 */
124#define elm_obj_ctxpopup_horizontal_set(horizontal) ELM_OBJ_CTXPOPUP_ID(ELM_OBJ_CTXPOPUP_SUB_ID_HORIZONTAL_SET), EO_TYPECHECK(Eina_Bool, horizontal)
125
126/**
127 * @def ctxpopup_horizontal_get
128 * @since 1.8
129 *
130 * @brief Get the value of current ctxpopup object's orientation.
131 *
132 * @param[out] ret
133 *
134 * @see elm_ctxpopup_horizontal_get
135 */
136#define elm_obj_ctxpopup_horizontal_get(ret) ELM_OBJ_CTXPOPUP_ID(ELM_OBJ_CTXPOPUP_SUB_ID_HORIZONTAL_GET), EO_TYPECHECK(Eina_Bool *, ret)
137
138/**
139 * @def ctxpopup_item_append
140 * @since 1.8
141 *
142 * @brief Add a new item to a ctxpopup object.
143 *
144 * @param[in] label
145 * @param[in] icon
146 * @param[in] func
147 * @param[in] data
148 * @param[out] ret
149 *
150 * @see elm_ctxpopup_item_append
151 */
152#define elm_obj_ctxpopup_item_append(label, icon, func, data, ret) ELM_OBJ_CTXPOPUP_ID(ELM_OBJ_CTXPOPUP_SUB_ID_ITEM_APPEND), EO_TYPECHECK(const char *, label), EO_TYPECHECK(Evas_Object *, icon), EO_TYPECHECK(Evas_Smart_Cb, func), EO_TYPECHECK(const void *, data), EO_TYPECHECK(Elm_Object_Item **, ret)
153
154/**
155 * @def ctxpopup_direction_priority_set
156 * @since 1.8
157 *
158 * @brief Set the direction priority of a ctxpopup.
159 *
160 * @param[in] first
161 * @param[in] second
162 * @param[in] third
163 * @param[in] fourth
164 *
165 * @see elm_ctxpopup_direction_priority_set
166 */
167#define elm_obj_ctxpopup_direction_priority_set(first, second, third, fourth) ELM_OBJ_CTXPOPUP_ID(ELM_OBJ_CTXPOPUP_SUB_ID_DIRECTION_PRIORITY_SET), EO_TYPECHECK(Elm_Ctxpopup_Direction, first), EO_TYPECHECK(Elm_Ctxpopup_Direction, second), EO_TYPECHECK(Elm_Ctxpopup_Direction, third), EO_TYPECHECK(Elm_Ctxpopup_Direction, fourth)
168
169/**
170 * @def ctxpopup_direction_priority_get
171 * @since 1.8
172 *
173 * @brief Get the direction priority of a ctxpopup.
174 *
175 * @param[out] first
176 * @param[out] second
177 * @param[out] third
178 * @param[out] fourth
179 *
180 * @see elm_ctxpopup_direction_priority_get
181 */
182#define elm_obj_ctxpopup_direction_priority_get(first, second, third, fourth) ELM_OBJ_CTXPOPUP_ID(ELM_OBJ_CTXPOPUP_SUB_ID_DIRECTION_PRIORITY_GET), EO_TYPECHECK(Elm_Ctxpopup_Direction *, first), EO_TYPECHECK(Elm_Ctxpopup_Direction *, second), EO_TYPECHECK(Elm_Ctxpopup_Direction *, third), EO_TYPECHECK(Elm_Ctxpopup_Direction *, fourth)
183
184/**
185 * @def ctxpopup_direction_get
186 * @since 1.8
187 *
188 * @brief Get the current direction of a ctxpopup.
189 *
190 * @param[out] ret
191 *
192 * @see elm_ctxpopup_direction_get
193 */
194#define elm_obj_ctxpopup_direction_get(ret) ELM_OBJ_CTXPOPUP_ID(ELM_OBJ_CTXPOPUP_SUB_ID_DIRECTION_GET), EO_TYPECHECK(Elm_Ctxpopup_Direction *, ret)
195
196/**
197 * @def ctxpopup_dismiss
198 * @since 1.8
199 *
200 * @brief Dismiss a ctxpopup object
201 *
202 *
203 * @see elm_ctxpopup_dismiss
204 */
205#define elm_obj_ctxpopup_dismiss() ELM_OBJ_CTXPOPUP_ID(ELM_OBJ_CTXPOPUP_SUB_ID_DISMISS)
55typedef enum 206typedef enum
56{ 207{
57 ELM_CTXPOPUP_DIRECTION_DOWN, /**< ctxpopup show appear below clicked area */ 208 ELM_CTXPOPUP_DIRECTION_DOWN, /**< ctxpopup show appear below clicked area */
diff --git a/src/lib/elc_fileselector.c b/src/lib/elc_fileselector.c
index bbbec7e71..2b002f249 100644
--- a/src/lib/elc_fileselector.c
+++ b/src/lib/elc_fileselector.c
@@ -14,7 +14,13 @@
14#include "elm_priv.h" 14#include "elm_priv.h"
15#include "elm_widget_fileselector.h" 15#include "elm_widget_fileselector.h"
16 16
17EAPI const char ELM_FILESELECTOR_SMART_NAME[] = "elm_fileselector"; 17#include "Eo.h"
18
19EAPI Eo_Op ELM_OBJ_FILESELECTOR_BASE_ID = EO_NOOP;
20
21#define MY_CLASS ELM_OBJ_FILESELECTOR_CLASS
22
23#define MY_CLASS_NAME "elm_fileselector"
18 24
19static Elm_Genlist_Item_Class *list_itc[ELM_FILE_LAST]; 25static Elm_Genlist_Item_Class *list_itc[ELM_FILE_LAST];
20static Elm_Gengrid_Item_Class *grid_itc[ELM_FILE_LAST]; 26static Elm_Gengrid_Item_Class *grid_itc[ELM_FILE_LAST];
@@ -29,11 +35,6 @@ static const Evas_Smart_Cb_Description _smart_callbacks[] = {
29 {NULL, NULL} 35 {NULL, NULL}
30}; 36};
31 37
32EVAS_SMART_SUBCLASS_NEW
33 (ELM_FILESELECTOR_SMART_NAME, _elm_fileselector,
34 Elm_Fileselector_Smart_Class, Elm_Layout_Smart_Class,
35 elm_layout_smart_class_get, _smart_callbacks);
36
37/* final routine on deletion */ 38/* final routine on deletion */
38static void 39static void
39_elm_fileselector_smart_del_do(Elm_Fileselector_Smart_Data *sd) 40_elm_fileselector_smart_del_do(Elm_Fileselector_Smart_Data *sd)
@@ -42,20 +43,19 @@ _elm_fileselector_smart_del_do(Elm_Fileselector_Smart_Data *sd)
42 if (sd->selection) eina_stringshare_del(sd->selection); 43 if (sd->selection) eina_stringshare_del(sd->selection);
43 if (sd->sel_idler) free(ecore_idler_del(sd->sel_idler)); 44 if (sd->sel_idler) free(ecore_idler_del(sd->sel_idler));
44 45
45 ELM_WIDGET_CLASS(_elm_fileselector_parent_sc)->base.del 46 eo_do_super(sd->obj, evas_obj_smart_del());
46 (ELM_WIDGET_DATA(sd)->obj);
47} 47}
48 48
49static void 49static void
50_elm_fileselector_smart_sizing_eval(Evas_Object *obj) 50_elm_fileselector_smart_sizing_eval(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
51{ 51{
52 Evas_Coord minw = -1, minh = -1; 52 Evas_Coord minw = -1, minh = -1;
53 53
54 ELM_FILESELECTOR_DATA_GET(obj, sd); 54 Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
55 55
56 elm_coords_finger_size_adjust(1, &minw, 1, &minh); 56 elm_coords_finger_size_adjust(1, &minw, 1, &minh);
57 edje_object_size_min_restricted_calc 57 edje_object_size_min_restricted_calc
58 (ELM_WIDGET_DATA(sd)->resize_obj, &minw, &minh, minw, minh); 58 (wd->resize_obj, &minw, &minh, minw, minh);
59 evas_object_size_hint_min_set(obj, minw, minh); 59 evas_object_size_hint_min_set(obj, minw, minh);
60} 60}
61 61
@@ -71,23 +71,27 @@ _mirrored_set(Evas_Object *obj, Eina_Bool rtl)
71 elm_widget_mirrored_set(sd->home_button, rtl); 71 elm_widget_mirrored_set(sd->home_button, rtl);
72} 72}
73 73
74static Eina_Bool 74static void
75_elm_fileselector_smart_theme(Evas_Object *obj) 75_elm_fileselector_smart_theme(Eo *obj, void *_pd, va_list *list)
76{ 76{
77 const char *style; 77 const char *style;
78 const char *data; 78 const char *data;
79 char buf[1024]; 79 char buf[1024];
80 80
81 ELM_FILESELECTOR_DATA_GET(obj, sd); 81 Elm_Fileselector_Smart_Data *sd = _pd;
82 Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
83 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
84 if (ret) *ret = EINA_FALSE;
85 Eina_Bool int_ret;
82 86
83 if (!ELM_WIDGET_CLASS(_elm_fileselector_parent_sc)->theme(obj)) 87 eo_do_super(obj, elm_wdg_theme(&int_ret));
84 return EINA_FALSE; 88 if (!int_ret) return;
85 89
86 style = elm_widget_style_get(obj); 90 style = elm_widget_style_get(obj);
87 _mirrored_set(obj, elm_widget_mirrored_get(obj)); 91 _mirrored_set(obj, elm_widget_mirrored_get(obj));
88 92
89 data = edje_object_data_get 93 data = edje_object_data_get
90 (ELM_WIDGET_DATA(sd)->resize_obj, "path_separator"); 94 (wd->resize_obj, "path_separator");
91 if (data) sd->path_separator = data; 95 if (data) sd->path_separator = data;
92 else sd->path_separator = "/"; 96 else sd->path_separator = "/";
93 97
@@ -128,11 +132,11 @@ _elm_fileselector_smart_theme(Evas_Object *obj)
128 132
129#undef SWALLOW 133#undef SWALLOW
130 134
131 edje_object_message_signal_process(ELM_WIDGET_DATA(sd)->resize_obj); 135 edje_object_message_signal_process(wd->resize_obj);
132 136
133 elm_layout_sizing_eval(obj); 137 elm_layout_sizing_eval(obj);
134 138
135 return EINA_TRUE; 139 if (ret) *ret = EINA_TRUE;
136} 140}
137 141
138/*** GENLIST/GENGRID "MODEL" ***/ 142/*** GENLIST/GENGRID "MODEL" ***/
@@ -721,16 +725,17 @@ _anchor_clicked(void *data,
721} 725}
722 726
723static void 727static void
724_elm_fileselector_smart_add(Evas_Object *obj) 728_elm_fileselector_smart_add(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
725{ 729{
726 Evas_Object *ic, *bt, *li, *en, *grid, *pb; 730 Evas_Object *ic, *bt, *li, *en, *grid, *pb;
727 unsigned int i; 731 unsigned int i;
728 int s; 732 int s;
729 733
730 EVAS_SMART_DATA_ALLOC(obj, Elm_Fileselector_Smart_Data); 734 Elm_Fileselector_Smart_Data *priv = _pd;
735
731 EINA_REFCOUNT_INIT(priv); 736 EINA_REFCOUNT_INIT(priv);
732 737
733 ELM_WIDGET_CLASS(_elm_fileselector_parent_sc)->base.add(obj); 738 eo_do_super(obj, evas_obj_smart_add());
734 739
735 elm_widget_can_focus_set(obj, EINA_FALSE); 740 elm_widget_can_focus_set(obj, EINA_FALSE);
736 741
@@ -854,15 +859,15 @@ _elm_fileselector_smart_add(Evas_Object *obj)
854 elm_fileselector_buttons_ok_cancel_set(obj, EINA_TRUE); 859 elm_fileselector_buttons_ok_cancel_set(obj, EINA_TRUE);
855 elm_fileselector_is_save_set(obj, EINA_FALSE); 860 elm_fileselector_is_save_set(obj, EINA_FALSE);
856 861
857 _elm_fileselector_smart_theme(obj); 862 eo_do(obj, elm_wdg_theme(NULL));
858} 863}
859 864
860static void 865static void
861_elm_fileselector_smart_del(Evas_Object *obj) 866_elm_fileselector_smart_del(Eo *obj EINA_UNUSED, void *_pd, va_list *list EINA_UNUSED)
862{ 867{
863 int i; 868 int i;
864 869
865 ELM_FILESELECTOR_DATA_GET(obj, sd); 870 Elm_Fileselector_Smart_Data *sd = _pd;
866 871
867 for (i = 0; i < ELM_FILE_LAST; ++i) 872 for (i = 0; i < ELM_FILE_LAST; ++i)
868 { 873 {
@@ -881,54 +886,28 @@ _elm_fileselector_smart_del(Evas_Object *obj)
881 EINA_REFCOUNT_UNREF(sd) _elm_fileselector_smart_del_do(sd); 886 EINA_REFCOUNT_UNREF(sd) _elm_fileselector_smart_del_do(sd);
882} 887}
883 888
884static void
885_elm_fileselector_smart_set_user(Elm_Fileselector_Smart_Class *sc)
886{
887 ELM_WIDGET_CLASS(sc)->base.add = _elm_fileselector_smart_add;
888 ELM_WIDGET_CLASS(sc)->base.del = _elm_fileselector_smart_del;
889
890 ELM_WIDGET_CLASS(sc)->theme = _elm_fileselector_smart_theme;
891
892 /* not a 'focus chain manager' */
893 ELM_WIDGET_CLASS(sc)->focus_next = NULL;
894 ELM_WIDGET_CLASS(sc)->focus_direction = NULL;
895
896 ELM_LAYOUT_CLASS(sc)->sizing_eval = _elm_fileselector_smart_sizing_eval;
897}
898
899EAPI const Elm_Fileselector_Smart_Class *
900elm_fileselector_smart_class_get(void)
901{
902 static Elm_Fileselector_Smart_Class _sc =
903 ELM_FILESELECTOR_SMART_CLASS_INIT_NAME_VERSION
904 (ELM_FILESELECTOR_SMART_NAME);
905 static const Elm_Fileselector_Smart_Class *class = NULL;
906 Evas_Smart_Class *esc = (Evas_Smart_Class *)&_sc;
907
908 if (class)
909 return class;
910
911 _elm_fileselector_smart_set(&_sc);
912 esc->callbacks = _smart_callbacks;
913 class = &_sc;
914
915 return class;
916}
917
918EAPI Evas_Object * 889EAPI Evas_Object *
919elm_fileselector_add(Evas_Object *parent) 890elm_fileselector_add(Evas_Object *parent)
920{ 891{
921 Evas_Object *obj;
922
923 EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL); 892 EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
893 Evas_Object *obj = eo_add(MY_CLASS, parent);
894 eo_unref(obj);
895 return obj;
896}
924 897
925 obj = elm_widget_add(_elm_fileselector_smart_class_new(), parent); 898static void
926 if (!obj) return NULL; 899_constructor(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
927 900{
901 Elm_Fileselector_Smart_Data *sd = _pd;
902 sd->obj = obj;
903 eo_do_super(obj, eo_constructor());
904 eo_do(obj,
905 evas_obj_type_set(MY_CLASS_NAME),
906 evas_obj_smart_callbacks_descriptions_set(_smart_callbacks, NULL));
907
908 Evas_Object *parent = eo_parent_get(obj);
928 if (!elm_widget_sub_object_add(parent, obj)) 909 if (!elm_widget_sub_object_add(parent, obj))
929 ERR("could not add %p as sub object of %p", obj, parent); 910 ERR("could not add %p as sub object of %p", obj, parent);
930
931 return obj;
932} 911}
933 912
934EAPI void 913EAPI void
@@ -936,7 +915,14 @@ elm_fileselector_is_save_set(Evas_Object *obj,
936 Eina_Bool is_save) 915 Eina_Bool is_save)
937{ 916{
938 ELM_FILESELECTOR_CHECK(obj); 917 ELM_FILESELECTOR_CHECK(obj);
939 ELM_FILESELECTOR_DATA_GET(obj, sd); 918 eo_do(obj, elm_obj_fileselector_is_save_set(is_save));
919}
920
921static void
922_is_save_set(Eo *obj, void *_pd, va_list *list)
923{
924 Eina_Bool is_save = va_arg(*list, int);
925 Elm_Fileselector_Smart_Data *sd = _pd;
940 926
941 elm_object_disabled_set(sd->filename_entry, !is_save); 927 elm_object_disabled_set(sd->filename_entry, !is_save);
942 928
@@ -948,9 +934,17 @@ EAPI Eina_Bool
948elm_fileselector_is_save_get(const Evas_Object *obj) 934elm_fileselector_is_save_get(const Evas_Object *obj)
949{ 935{
950 ELM_FILESELECTOR_CHECK(obj) EINA_FALSE; 936 ELM_FILESELECTOR_CHECK(obj) EINA_FALSE;
951 ELM_FILESELECTOR_DATA_GET(obj, sd); 937 Eina_Bool ret = EINA_FALSE;
938 eo_do((Eo *) obj, elm_obj_fileselector_is_save_get(&ret));
939 return ret;
940}
952 941
953 return !elm_object_disabled_get(sd->filename_entry); 942static void
943_is_save_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
944{
945 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
946 Elm_Fileselector_Smart_Data *sd = _pd;
947 *ret = !elm_object_disabled_get(sd->filename_entry);
954} 948}
955 949
956EAPI void 950EAPI void
@@ -958,7 +952,14 @@ elm_fileselector_folder_only_set(Evas_Object *obj,
958 Eina_Bool only) 952 Eina_Bool only)
959{ 953{
960 ELM_FILESELECTOR_CHECK(obj); 954 ELM_FILESELECTOR_CHECK(obj);
961 ELM_FILESELECTOR_DATA_GET(obj, sd); 955 eo_do(obj, elm_obj_fileselector_folder_only_set(only));
956}
957
958static void
959_folder_only_set(Eo *obj, void *_pd, va_list *list)
960{
961 Eina_Bool only = va_arg(*list, int);
962 Elm_Fileselector_Smart_Data *sd = _pd;
962 963
963 if (sd->only_folder == only) return; 964 if (sd->only_folder == only) return;
964 965
@@ -970,19 +971,35 @@ EAPI Eina_Bool
970elm_fileselector_folder_only_get(const Evas_Object *obj) 971elm_fileselector_folder_only_get(const Evas_Object *obj)
971{ 972{
972 ELM_FILESELECTOR_CHECK(obj) EINA_FALSE; 973 ELM_FILESELECTOR_CHECK(obj) EINA_FALSE;
973 ELM_FILESELECTOR_DATA_GET(obj, sd); 974 Eina_Bool ret = EINA_FALSE;
975 eo_do((Eo *) obj, elm_obj_fileselector_folder_only_get(&ret));
976 return ret;
977}
974 978
975 return sd->only_folder; 979static void
980_folder_only_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
981{
982 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
983 Elm_Fileselector_Smart_Data *sd = _pd;
984 *ret = sd->only_folder;
976} 985}
977 986
978EAPI void 987EAPI void
979elm_fileselector_buttons_ok_cancel_set(Evas_Object *obj, 988elm_fileselector_buttons_ok_cancel_set(Evas_Object *obj,
980 Eina_Bool visible) 989 Eina_Bool visible)
981{ 990{
991 ELM_FILESELECTOR_CHECK(obj);
992 eo_do(obj, elm_obj_fileselector_buttons_ok_cancel_set(visible));
993}
994
995static void
996_buttons_ok_cancel_set(Eo *obj, void *_pd, va_list *list)
997{
998 Eina_Bool visible = va_arg(*list, int);
999
982 Evas_Object *bt; 1000 Evas_Object *bt;
983 1001
984 ELM_FILESELECTOR_CHECK(obj); 1002 Elm_Fileselector_Smart_Data *sd = _pd;
985 ELM_FILESELECTOR_DATA_GET(obj, sd);
986 1003
987 if (visible) 1004 if (visible)
988 { 1005 {
@@ -1004,7 +1021,7 @@ elm_fileselector_buttons_ok_cancel_set(Evas_Object *obj,
1004 1021
1005 sd->ok_button = bt; 1022 sd->ok_button = bt;
1006 1023
1007 _elm_fileselector_smart_theme(obj); 1024 eo_do(obj, elm_wdg_theme(NULL));
1008 } 1025 }
1009 else 1026 else
1010 { 1027 {
@@ -1019,9 +1036,17 @@ EAPI Eina_Bool
1019elm_fileselector_buttons_ok_cancel_get(const Evas_Object *obj) 1036elm_fileselector_buttons_ok_cancel_get(const Evas_Object *obj)
1020{ 1037{
1021 ELM_FILESELECTOR_CHECK(obj) EINA_FALSE; 1038 ELM_FILESELECTOR_CHECK(obj) EINA_FALSE;
1022 ELM_FILESELECTOR_DATA_GET(obj, sd); 1039 Eina_Bool ret = EINA_FALSE;
1040 eo_do((Eo *) obj, elm_obj_fileselector_buttons_ok_cancel_get(&ret));
1041 return ret;
1042}
1023 1043
1024 return sd->ok_button ? EINA_TRUE : EINA_FALSE; 1044static void
1045_buttons_ok_cancel_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
1046{
1047 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
1048 Elm_Fileselector_Smart_Data *sd = _pd;
1049 *ret = sd->ok_button ? EINA_TRUE : EINA_FALSE;
1025} 1050}
1026 1051
1027EAPI void 1052EAPI void
@@ -1029,7 +1054,14 @@ elm_fileselector_expandable_set(Evas_Object *obj,
1029 Eina_Bool expand) 1054 Eina_Bool expand)
1030{ 1055{
1031 ELM_FILESELECTOR_CHECK(obj); 1056 ELM_FILESELECTOR_CHECK(obj);
1032 ELM_FILESELECTOR_DATA_GET(obj, sd); 1057 eo_do(obj, elm_obj_fileselector_expandable_set(expand));
1058}
1059
1060static void
1061_expandable_set(Eo *obj, void *_pd, va_list *list)
1062{
1063 Eina_Bool expand = va_arg(*list, int);
1064 Elm_Fileselector_Smart_Data *sd = _pd;
1033 1065
1034 sd->expand = !!expand; 1066 sd->expand = !!expand;
1035 1067
@@ -1040,18 +1072,32 @@ EAPI Eina_Bool
1040elm_fileselector_expandable_get(const Evas_Object *obj) 1072elm_fileselector_expandable_get(const Evas_Object *obj)
1041{ 1073{
1042 ELM_FILESELECTOR_CHECK(obj) EINA_FALSE; 1074 ELM_FILESELECTOR_CHECK(obj) EINA_FALSE;
1043 ELM_FILESELECTOR_DATA_GET(obj, sd); 1075 Eina_Bool ret = EINA_FALSE;
1076 eo_do((Eo *) obj, elm_obj_fileselector_expandable_get(&ret));
1077 return ret;
1078}
1044 1079
1045 return sd->expand; 1080static void
1081_expandable_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
1082{
1083 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
1084 Elm_Fileselector_Smart_Data *sd = _pd;
1085 *ret = sd->expand;
1046} 1086}
1047 1087
1048EAPI void 1088EAPI void
1049elm_fileselector_path_set(Evas_Object *obj, 1089elm_fileselector_path_set(Evas_Object *obj,
1050 const char *_path) 1090 const char *_path)
1051{ 1091{
1052 char *path;
1053
1054 ELM_FILESELECTOR_CHECK(obj); 1092 ELM_FILESELECTOR_CHECK(obj);
1093 eo_do(obj, elm_obj_fileselector_path_set(_path));
1094}
1095
1096static void
1097_path_set(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
1098{
1099 const char *_path = va_arg(*list, const char *);
1100 char *path;
1055 1101
1056 path = ecore_file_realpath(_path); 1102 path = ecore_file_realpath(_path);
1057 _populate(obj, path, NULL); 1103 _populate(obj, path, NULL);
@@ -1062,9 +1108,17 @@ EAPI const char *
1062elm_fileselector_path_get(const Evas_Object *obj) 1108elm_fileselector_path_get(const Evas_Object *obj)
1063{ 1109{
1064 ELM_FILESELECTOR_CHECK(obj) NULL; 1110 ELM_FILESELECTOR_CHECK(obj) NULL;
1065 ELM_FILESELECTOR_DATA_GET(obj, sd); 1111 const char *ret = NULL;
1112 eo_do((Eo *) obj, elm_obj_fileselector_path_get(&ret));
1113 return ret;
1114}
1066 1115
1067 return sd->path; 1116static void
1117_path_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
1118{
1119 const char **ret = va_arg(*list, const char **);
1120 Elm_Fileselector_Smart_Data *sd = _pd;
1121 *ret = sd->path;
1068} 1122}
1069 1123
1070EAPI void 1124EAPI void
@@ -1072,8 +1126,15 @@ elm_fileselector_mode_set(Evas_Object *obj,
1072 Elm_Fileselector_Mode mode) 1126 Elm_Fileselector_Mode mode)
1073{ 1127{
1074 ELM_FILESELECTOR_CHECK(obj); 1128 ELM_FILESELECTOR_CHECK(obj);
1129 eo_do(obj, elm_obj_fileselector_mode_set(mode));
1130}
1075 1131
1076 ELM_FILESELECTOR_DATA_GET(obj, sd); 1132static void
1133_mode_set(Eo *obj, void *_pd, va_list *list)
1134{
1135 Elm_Fileselector_Mode mode = va_arg(*list, Elm_Fileselector_Mode);
1136
1137 Elm_Fileselector_Smart_Data *sd = _pd;
1077 1138
1078 if (mode == sd->mode) return; 1139 if (mode == sd->mode) return;
1079 1140
@@ -1092,18 +1153,36 @@ EAPI Elm_Fileselector_Mode
1092elm_fileselector_mode_get(const Evas_Object *obj) 1153elm_fileselector_mode_get(const Evas_Object *obj)
1093{ 1154{
1094 ELM_FILESELECTOR_CHECK(obj) ELM_FILESELECTOR_LAST; 1155 ELM_FILESELECTOR_CHECK(obj) ELM_FILESELECTOR_LAST;
1095 ELM_FILESELECTOR_DATA_GET(obj, sd); 1156 Elm_Fileselector_Mode ret = ELM_FILESELECTOR_LAST;
1157 eo_do((Eo *) obj, elm_obj_fileselector_mode_get(&ret));
1158 return ret;
1159}
1096 1160
1097 return sd->mode; 1161static void
1162_mode_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
1163{
1164 Elm_Fileselector_Mode *ret = va_arg(*list, Elm_Fileselector_Mode *);
1165 Elm_Fileselector_Smart_Data *sd = _pd;
1166 *ret = sd->mode;
1098} 1167}
1099 1168
1100EAPI const char * 1169EAPI const char *
1101elm_fileselector_selected_get(const Evas_Object *obj) 1170elm_fileselector_selected_get(const Evas_Object *obj)
1102{ 1171{
1103 ELM_FILESELECTOR_CHECK(obj) NULL; 1172 ELM_FILESELECTOR_CHECK(obj) NULL;
1104 ELM_FILESELECTOR_DATA_GET(obj, sd); 1173 const char *ret = NULL;
1174 eo_do((Eo *) obj, elm_obj_fileselector_selected_get(&ret));
1175 return ret;
1176}
1177
1178static void
1179_selected_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
1180{
1181 const char **ret = va_arg(*list, const char **);
1182 *ret = NULL;
1183 Elm_Fileselector_Smart_Data *sd = _pd;
1105 1184
1106 if (!sd->path) return NULL; 1185 if (!sd->path) return;
1107 1186
1108 if (sd->filename_entry) 1187 if (sd->filename_entry)
1109 { 1188 {
@@ -1131,34 +1210,47 @@ elm_fileselector_selected_get(const Evas_Object *obj)
1131 eina_stringshare_replace(&sd->selection, buf); 1210 eina_stringshare_replace(&sd->selection, buf);
1132 1211
1133 if (dir) free(dir); 1212 if (dir) free(dir);
1134 return sd->selection; 1213 *ret = sd->selection;
1214 return;
1135 } 1215 }
1136 1216
1217 *ret = sd->path;
1218
1137 if (sd->mode == ELM_FILESELECTOR_LIST) 1219 if (sd->mode == ELM_FILESELECTOR_LIST)
1138 { 1220 {
1139 Elm_Object_Item *gl_it = elm_genlist_selected_item_get(sd->files_list); 1221 Elm_Object_Item *gl_it = elm_genlist_selected_item_get(sd->files_list);
1140 1222
1141 if (gl_it) return elm_object_item_data_get(gl_it); 1223 if (gl_it) *ret = elm_object_item_data_get(gl_it);
1142 } 1224 }
1143 else 1225 else
1144 { 1226 {
1145 Elm_Object_Item *gg_it = elm_gengrid_selected_item_get(sd->files_grid); 1227 Elm_Object_Item *gg_it = elm_gengrid_selected_item_get(sd->files_grid);
1146 1228
1147 if (gg_it) return elm_object_item_data_get(gg_it); 1229 if (gg_it) *ret = elm_object_item_data_get(gg_it);
1148 } 1230 }
1149 1231
1150 return sd->path;
1151} 1232}
1152 1233
1153EAPI Eina_Bool 1234EAPI Eina_Bool
1154elm_fileselector_selected_set(Evas_Object *obj, 1235elm_fileselector_selected_set(Evas_Object *obj,
1155 const char *_path) 1236 const char *_path)
1156{ 1237{
1157 Eina_Bool ret = EINA_TRUE; 1238 ELM_FILESELECTOR_CHECK(obj) EINA_FALSE;
1239 Eina_Bool ret = EINA_FALSE;
1240 eo_do(obj, elm_obj_fileselector_selected_set(_path, &ret));
1241 return ret;
1242}
1243
1244static void
1245_selected_set(Eo *obj, void *_pd, va_list *list)
1246{
1247 const char *_path = va_arg(*list, const char *);
1248 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
1249
1250 if (ret) *ret = EINA_TRUE;
1158 char *path; 1251 char *path;
1159 1252
1160 ELM_FILESELECTOR_CHECK(obj) EINA_FALSE; 1253 Elm_Fileselector_Smart_Data *sd = _pd;
1161 ELM_FILESELECTOR_DATA_GET(obj, sd);
1162 1254
1163 path = ecore_file_realpath(_path); 1255 path = ecore_file_realpath(_path);
1164 1256
@@ -1167,7 +1259,7 @@ elm_fileselector_selected_set(Evas_Object *obj,
1167 { 1259 {
1168 if (!ecore_file_exists(path)) 1260 if (!ecore_file_exists(path))
1169 { 1261 {
1170 ret = EINA_FALSE; 1262 if (ret) *ret = EINA_FALSE;
1171 goto clean_up; 1263 goto clean_up;
1172 } 1264 }
1173 1265
@@ -1190,5 +1282,80 @@ elm_fileselector_selected_set(Evas_Object *obj,
1190 1282
1191clean_up: 1283clean_up:
1192 free(path); 1284 free(path);
1193 return ret;
1194} 1285}
1286
1287static void
1288_elm_fileselector_smart_focus_next_manager_is(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
1289{
1290 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
1291 *ret = EINA_FALSE;
1292}
1293
1294static void
1295_elm_fileselector_smart_focus_direction_manager_is(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
1296{
1297 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
1298 *ret = EINA_FALSE;
1299}
1300
1301static void
1302_class_constructor(Eo_Class *klass)
1303{
1304 const Eo_Op_Func_Description func_desc[] = {
1305 EO_OP_FUNC(EO_BASE_ID(EO_BASE_SUB_ID_CONSTRUCTOR), _constructor),
1306
1307 EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_ADD), _elm_fileselector_smart_add),
1308 EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_DEL), _elm_fileselector_smart_del),
1309
1310 EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_THEME), _elm_fileselector_smart_theme),
1311 EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_NEXT_MANAGER_IS), _elm_fileselector_smart_focus_next_manager_is),
1312 EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_DIRECTION_MANAGER_IS), _elm_fileselector_smart_focus_direction_manager_is),
1313
1314 EO_OP_FUNC(ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_SIZING_EVAL), _elm_fileselector_smart_sizing_eval),
1315
1316 EO_OP_FUNC(ELM_OBJ_FILESELECTOR_ID(ELM_OBJ_FILESELECTOR_SUB_ID_IS_SAVE_SET), _is_save_set),
1317 EO_OP_FUNC(ELM_OBJ_FILESELECTOR_ID(ELM_OBJ_FILESELECTOR_SUB_ID_IS_SAVE_GET), _is_save_get),
1318 EO_OP_FUNC(ELM_OBJ_FILESELECTOR_ID(ELM_OBJ_FILESELECTOR_SUB_ID_FOLDER_ONLY_SET), _folder_only_set),
1319 EO_OP_FUNC(ELM_OBJ_FILESELECTOR_ID(ELM_OBJ_FILESELECTOR_SUB_ID_FOLDER_ONLY_GET), _folder_only_get),
1320 EO_OP_FUNC(ELM_OBJ_FILESELECTOR_ID(ELM_OBJ_FILESELECTOR_SUB_ID_BUTTONS_OK_CANCEL_SET), _buttons_ok_cancel_set),
1321 EO_OP_FUNC(ELM_OBJ_FILESELECTOR_ID(ELM_OBJ_FILESELECTOR_SUB_ID_BUTTONS_OK_CANCEL_GET), _buttons_ok_cancel_get),
1322 EO_OP_FUNC(ELM_OBJ_FILESELECTOR_ID(ELM_OBJ_FILESELECTOR_SUB_ID_EXPANDABLE_SET), _expandable_set),
1323 EO_OP_FUNC(ELM_OBJ_FILESELECTOR_ID(ELM_OBJ_FILESELECTOR_SUB_ID_EXPANDABLE_GET), _expandable_get),
1324 EO_OP_FUNC(ELM_OBJ_FILESELECTOR_ID(ELM_OBJ_FILESELECTOR_SUB_ID_PATH_SET), _path_set),
1325 EO_OP_FUNC(ELM_OBJ_FILESELECTOR_ID(ELM_OBJ_FILESELECTOR_SUB_ID_PATH_GET), _path_get),
1326 EO_OP_FUNC(ELM_OBJ_FILESELECTOR_ID(ELM_OBJ_FILESELECTOR_SUB_ID_MODE_SET), _mode_set),
1327 EO_OP_FUNC(ELM_OBJ_FILESELECTOR_ID(ELM_OBJ_FILESELECTOR_SUB_ID_MODE_GET), _mode_get),
1328 EO_OP_FUNC(ELM_OBJ_FILESELECTOR_ID(ELM_OBJ_FILESELECTOR_SUB_ID_SELECTED_GET), _selected_get),
1329 EO_OP_FUNC(ELM_OBJ_FILESELECTOR_ID(ELM_OBJ_FILESELECTOR_SUB_ID_SELECTED_SET), _selected_set),
1330 EO_OP_FUNC_SENTINEL
1331 };
1332 eo_class_funcs_set(klass, func_desc);
1333}
1334static const Eo_Op_Description op_desc[] = {
1335 EO_OP_DESCRIPTION(ELM_OBJ_FILESELECTOR_SUB_ID_IS_SAVE_SET, "Enable/disable the file name entry box where the user can type in a name for a file, in a given file selector widget."),
1336 EO_OP_DESCRIPTION(ELM_OBJ_FILESELECTOR_SUB_ID_IS_SAVE_GET, "Get whether the given file selector is in 'saving dialog' mode."),
1337 EO_OP_DESCRIPTION(ELM_OBJ_FILESELECTOR_SUB_ID_FOLDER_ONLY_SET, "Enable/disable folder-only view for a given file selector widget."),
1338 EO_OP_DESCRIPTION(ELM_OBJ_FILESELECTOR_SUB_ID_FOLDER_ONLY_GET, "Get whether folder-only view is set for a given file selector widget."),
1339 EO_OP_DESCRIPTION(ELM_OBJ_FILESELECTOR_SUB_ID_BUTTONS_OK_CANCEL_SET, "Enable/disable the 'ok' and 'cancel' buttons on a given file selector widget."),
1340 EO_OP_DESCRIPTION(ELM_OBJ_FILESELECTOR_SUB_ID_BUTTONS_OK_CANCEL_GET, "Get whether the 'ok' and 'cancel' buttons on a given file selector widget are being shown."),
1341 EO_OP_DESCRIPTION(ELM_OBJ_FILESELECTOR_SUB_ID_EXPANDABLE_SET, "Enable/disable a tree view in the given file selector widget, if it's in #ELM_FILESELECTOR_LIST mode."),
1342 EO_OP_DESCRIPTION(ELM_OBJ_FILESELECTOR_SUB_ID_EXPANDABLE_GET, "Get whether tree view is enabled for the given file selector widget."),
1343 EO_OP_DESCRIPTION(ELM_OBJ_FILESELECTOR_SUB_ID_PATH_SET, "Set, programmatically, the directory that a given file selector widget will display contents from."),
1344 EO_OP_DESCRIPTION(ELM_OBJ_FILESELECTOR_SUB_ID_PATH_GET, "Get the parent directory's path that a given file selector widget is displaying."),
1345 EO_OP_DESCRIPTION(ELM_OBJ_FILESELECTOR_SUB_ID_MODE_SET, "Set the mode in which a given file selector widget will display (layout) file system entries in its view."),
1346 EO_OP_DESCRIPTION(ELM_OBJ_FILESELECTOR_SUB_ID_MODE_GET, "Get the mode in which a given file selector widget is displaying (layouting) file system entries in its view."),
1347 EO_OP_DESCRIPTION(ELM_OBJ_FILESELECTOR_SUB_ID_SELECTED_GET, "Get the currently selected item's (full) path, in the given file selector widget."),
1348 EO_OP_DESCRIPTION(ELM_OBJ_FILESELECTOR_SUB_ID_SELECTED_SET, "Set, programmatically, the currently selected file/directory in the given file selector widget."),
1349 EO_OP_DESCRIPTION_SENTINEL
1350};
1351static const Eo_Class_Description class_desc = {
1352 EO_VERSION,
1353 MY_CLASS_NAME,
1354 EO_CLASS_TYPE_REGULAR,
1355 EO_CLASS_DESCRIPTION_OPS(&ELM_OBJ_FILESELECTOR_BASE_ID, op_desc, ELM_OBJ_FILESELECTOR_SUB_ID_LAST),
1356 NULL,
1357 sizeof(Elm_Fileselector_Smart_Data),
1358 _class_constructor,
1359 NULL
1360};
1361EO_DEFINE_CLASS(elm_obj_fileselector_class_get, &class_desc, ELM_OBJ_LAYOUT_CLASS, NULL);
diff --git a/src/lib/elc_fileselector.h b/src/lib/elc_fileselector.h
index 7bf905463..24d37e163 100644
--- a/src/lib/elc_fileselector.h
+++ b/src/lib/elc_fileselector.h
@@ -34,7 +34,7 @@
34 * library, the second form of view will display preview thumbnails 34 * library, the second form of view will display preview thumbnails
35 * of files which it supports. 35 * of files which it supports.
36 * 36 *
37 * This widget inherits from the @ref Layout one, so that all the 37 * This widget inherits from the Layout one, so that all the
38 * functions acting on it also work for file selector objects. 38 * functions acting on it also work for file selector objects.
39 * 39 *
40 * This widget emits the following signals, besides the ones sent from 40 * This widget emits the following signals, besides the ones sent from
@@ -52,6 +52,210 @@
52 * @li @ref fileselector_example 52 * @li @ref fileselector_example
53 */ 53 */
54 54
55#define ELM_OBJ_FILESELECTOR_CLASS elm_obj_fileselector_class_get()
56
57const Eo_Class *elm_obj_fileselector_class_get(void) EINA_CONST;
58
59extern EAPI Eo_Op ELM_OBJ_FILESELECTOR_BASE_ID;
60
61enum
62{
63 ELM_OBJ_FILESELECTOR_SUB_ID_IS_SAVE_SET,
64 ELM_OBJ_FILESELECTOR_SUB_ID_IS_SAVE_GET,
65 ELM_OBJ_FILESELECTOR_SUB_ID_FOLDER_ONLY_SET,
66 ELM_OBJ_FILESELECTOR_SUB_ID_FOLDER_ONLY_GET,
67 ELM_OBJ_FILESELECTOR_SUB_ID_BUTTONS_OK_CANCEL_SET,
68 ELM_OBJ_FILESELECTOR_SUB_ID_BUTTONS_OK_CANCEL_GET,
69 ELM_OBJ_FILESELECTOR_SUB_ID_EXPANDABLE_SET,
70 ELM_OBJ_FILESELECTOR_SUB_ID_EXPANDABLE_GET,
71 ELM_OBJ_FILESELECTOR_SUB_ID_PATH_SET,
72 ELM_OBJ_FILESELECTOR_SUB_ID_PATH_GET,
73 ELM_OBJ_FILESELECTOR_SUB_ID_MODE_SET,
74 ELM_OBJ_FILESELECTOR_SUB_ID_MODE_GET,
75 ELM_OBJ_FILESELECTOR_SUB_ID_SELECTED_GET,
76 ELM_OBJ_FILESELECTOR_SUB_ID_SELECTED_SET,
77 ELM_OBJ_FILESELECTOR_SUB_ID_LAST
78};
79
80#define ELM_OBJ_FILESELECTOR_ID(sub_id) (ELM_OBJ_FILESELECTOR_BASE_ID + sub_id)
81
82
83/**
84 * @def elm_obj_fileselector_is_save_set
85 * @since 1.8
86 *
87 * Enable/disable the file name entry box where the user can type
88 * in a name for a file, in a given file selector widget
89 *
90 * @param[in] is_save
91 *
92 * @see elm_fileselector_is_save_set
93 */
94#define elm_obj_fileselector_is_save_set(is_save) ELM_OBJ_FILESELECTOR_ID(ELM_OBJ_FILESELECTOR_SUB_ID_IS_SAVE_SET), EO_TYPECHECK(Eina_Bool, is_save)
95
96/**
97 * @def elm_obj_fileselector_is_save_get
98 * @since 1.8
99 *
100 * Get whether the given file selector is in "saving dialog" mode
101 *
102 * @param[out] ret
103 *
104 * @see elm_fileselector_is_save_get
105 */
106#define elm_obj_fileselector_is_save_get(ret) ELM_OBJ_FILESELECTOR_ID(ELM_OBJ_FILESELECTOR_SUB_ID_IS_SAVE_GET), EO_TYPECHECK(Eina_Bool *, ret)
107
108/**
109 * @def elm_obj_fileselector_folder_only_set
110 * @since 1.8
111 *
112 * Enable/disable folder-only view for a given file selector widget
113 *
114 * @param[in] only
115 *
116 * @see elm_fileselector_folder_only_set
117 */
118#define elm_obj_fileselector_folder_only_set(only) ELM_OBJ_FILESELECTOR_ID(ELM_OBJ_FILESELECTOR_SUB_ID_FOLDER_ONLY_SET), EO_TYPECHECK(Eina_Bool, only)
119
120/**
121 * @def elm_obj_fileselector_folder_only_get
122 * @since 1.8
123 *
124 * Get whether folder-only view is set for a given file selector
125 *
126 * @param[out] ret
127 *
128 * @see elm_fileselector_folder_only_get
129 */
130#define elm_obj_fileselector_folder_only_get(ret) ELM_OBJ_FILESELECTOR_ID(ELM_OBJ_FILESELECTOR_SUB_ID_FOLDER_ONLY_GET), EO_TYPECHECK(Eina_Bool *, ret)
131
132/**
133 * @def elm_obj_fileselector_buttons_ok_cancel_set
134 * @since 1.8
135 *
136 * Enable/disable the "ok" and "cancel" buttons on a given file
137 *
138 * @param[in] visible
139 *
140 * @see elm_fileselector_buttons_ok_cancel_set
141 */
142#define elm_obj_fileselector_buttons_ok_cancel_set(visible) ELM_OBJ_FILESELECTOR_ID(ELM_OBJ_FILESELECTOR_SUB_ID_BUTTONS_OK_CANCEL_SET), EO_TYPECHECK(Eina_Bool, visible)
143
144/**
145 * @def elm_obj_fileselector_buttons_ok_cancel_get
146 * @since 1.8
147 *
148 * Get whether the "ok" and "cancel" buttons on a given file
149 *
150 * @param[out] ret
151 *
152 * @see elm_fileselector_buttons_ok_cancel_get
153 */
154#define elm_obj_fileselector_buttons_ok_cancel_get(ret) ELM_OBJ_FILESELECTOR_ID(ELM_OBJ_FILESELECTOR_SUB_ID_BUTTONS_OK_CANCEL_GET), EO_TYPECHECK(Eina_Bool *, ret)
155
156/**
157 * @def elm_obj_fileselector_expandable_set
158 * @since 1.8
159 *
160 * Enable/disable a tree view in the given file selector widget,
161 * <b>if it's in @c #ELM_FILESELECTOR_LIST mode</b>
162 *
163 * @param[in] expand
164 *
165 * @see elm_fileselector_expandable_set
166 */
167#define elm_obj_fileselector_expandable_set(expand) ELM_OBJ_FILESELECTOR_ID(ELM_OBJ_FILESELECTOR_SUB_ID_EXPANDABLE_SET), EO_TYPECHECK(Eina_Bool, expand)
168
169/**
170 * @def elm_obj_fileselector_expandable_get
171 * @since 1.8
172 *
173 * Get whether tree view is enabled for the given file selector
174 *
175 * @param[out] ret
176 *
177 * @see elm_fileselector_expandable_get
178 */
179#define elm_obj_fileselector_expandable_get(ret) ELM_OBJ_FILESELECTOR_ID(ELM_OBJ_FILESELECTOR_SUB_ID_EXPANDABLE_GET), EO_TYPECHECK(Eina_Bool *, ret)
180
181/**
182 * @def elm_obj_fileselector_path_set
183 * @since 1.8
184 *
185 * Set, programmatically, the directory that a given file
186 * selector widget will display contents from
187 *
188 * @param[in] _path
189 *
190 * @see elm_fileselector_path_set
191 */
192#define elm_obj_fileselector_path_set(_path) ELM_OBJ_FILESELECTOR_ID(ELM_OBJ_FILESELECTOR_SUB_ID_PATH_SET), EO_TYPECHECK(const char *, _path)
193
194/**
195 * @def elm_obj_fileselector_path_get
196 * @since 1.8
197 *
198 * Get the parent directory's path that a given file selector
199 * selector widget will display contents from
200 *
201 * @param[out] ret
202 *
203 * @see elm_fileselector_path_get
204 */
205#define elm_obj_fileselector_path_get(ret) ELM_OBJ_FILESELECTOR_ID(ELM_OBJ_FILESELECTOR_SUB_ID_PATH_GET), EO_TYPECHECK(const char **, ret)
206
207/**
208 * @def elm_obj_fileselector_mode_set
209 * @since 1.8
210 *
211 * Set the mode in which a given file selector widget will display
212 * (layout) file system entries in its view
213 *
214 * @param[in] mode
215 *
216 * @see elm_fileselector_mode_set
217 */
218#define elm_obj_fileselector_mode_set(mode) ELM_OBJ_FILESELECTOR_ID(ELM_OBJ_FILESELECTOR_SUB_ID_MODE_SET), EO_TYPECHECK(Elm_Fileselector_Mode, mode)
219
220/**
221 * @def elm_obj_fileselector_mode_get
222 * @since 1.8
223 *
224 * Get the mode in which a given file selector widget is displaying
225 *
226 * @param[out] ret
227 *
228 * @see elm_fileselector_mode_get
229 */
230#define elm_obj_fileselector_mode_get(ret) ELM_OBJ_FILESELECTOR_ID(ELM_OBJ_FILESELECTOR_SUB_ID_MODE_GET), EO_TYPECHECK(Elm_Fileselector_Mode *, ret)
231
232/**
233 * @def elm_obj_fileselector_selected_get
234 * @since 1.8
235 *
236 * Get the currently selected item's (full) path, in the given file
237 * the given file selector widget
238 *
239 * @param[out] ret
240 *
241 * @see elm_fileselector_selected_get
242 */
243#define elm_obj_fileselector_selected_get(ret) ELM_OBJ_FILESELECTOR_ID(ELM_OBJ_FILESELECTOR_SUB_ID_SELECTED_GET), EO_TYPECHECK(const char **, ret)
244
245/**
246 * @def elm_obj_fileselector_selected_set
247 * @since 1.8
248 *
249 * Set, programmatically, the currently selected file/directory in
250 * the given file selector widget
251 *
252 * @param[in] _path
253 * @param[out] ret
254 *
255 * @see elm_fileselector_selected_set
256 */
257#define elm_obj_fileselector_selected_set(_path, ret) ELM_OBJ_FILESELECTOR_ID(ELM_OBJ_FILESELECTOR_SUB_ID_SELECTED_SET), EO_TYPECHECK(const char *, _path), EO_TYPECHECK(Eina_Bool *, ret)
258
55/** 259/**
56 * @addtogroup Fileselector 260 * @addtogroup Fileselector
57 * @{ 261 * @{
diff --git a/src/lib/elc_fileselector_button.c b/src/lib/elc_fileselector_button.c
index 1b114761c..2b76a14e0 100644
--- a/src/lib/elc_fileselector_button.c
+++ b/src/lib/elc_fileselector_button.c
@@ -2,8 +2,13 @@
2#include "elm_priv.h" 2#include "elm_priv.h"
3#include "elm_widget_fileselector_button.h" 3#include "elm_widget_fileselector_button.h"
4 4
5EAPI const char ELM_FILESELECTOR_BUTTON_SMART_NAME[] = 5#include "Eo.h"
6 "elm_fileselector_button"; 6
7EAPI Eo_Op ELM_OBJ_FILESELECTOR_BUTTON_BASE_ID = EO_NOOP;
8
9#define MY_CLASS ELM_OBJ_FILESELECTOR_BUTTON_CLASS
10
11#define MY_CLASS_NAME "elm_fileselector_button"
7 12
8#define DEFAULT_WINDOW_TITLE "Select a file" 13#define DEFAULT_WINDOW_TITLE "Select a file"
9 14
@@ -13,34 +18,33 @@ static const Evas_Smart_Cb_Description _smart_callbacks[] = {
13 {NULL, NULL} 18 {NULL, NULL}
14}; 19};
15 20
16EVAS_SMART_SUBCLASS_NEW 21static void
17 (ELM_FILESELECTOR_BUTTON_SMART_NAME, _elm_fileselector_button, 22_elm_fileselector_button_smart_theme(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
18 Elm_Fileselector_Button_Smart_Class, Elm_Button_Smart_Class,
19 elm_button_smart_class_get, _smart_callbacks);
20
21static Eina_Bool
22_elm_fileselector_button_smart_theme(Evas_Object *obj)
23{ 23{
24 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
25 if (ret) *ret = EINA_FALSE;
26 Eina_Bool int_ret;
27
24 char buf[4096]; 28 char buf[4096];
25 const char *style; 29 const char *style;
26 30
27 ELM_FILESELECTOR_BUTTON_DATA_GET(obj, sd); 31 Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
28 32
29 style = eina_stringshare_add(elm_widget_style_get(obj)); 33 style = eina_stringshare_add(elm_widget_style_get(obj));
30 34
31 snprintf(buf, sizeof(buf), "fileselector_button/%s", style); 35 snprintf(buf, sizeof(buf), "fileselector_button/%s", style);
32 36
33 /* file selector button's style has an extra bit */ 37 /* file selector button's style has an extra bit */
34 eina_stringshare_replace(&(ELM_WIDGET_DATA(sd)->style), buf); 38 eina_stringshare_replace(&(wd->style), buf);
35 39
36 if (!ELM_WIDGET_CLASS(_elm_fileselector_button_parent_sc)->theme(obj)) 40 eo_do_super(obj, elm_wdg_theme(&int_ret));
37 return EINA_FALSE; 41 if (!int_ret) return;
38 42
39 eina_stringshare_replace(&(ELM_WIDGET_DATA(sd)->style), style); 43 eina_stringshare_replace(&(wd->style), style);
40 44
41 eina_stringshare_del(style); 45 eina_stringshare_del(style);
42 46
43 return EINA_TRUE; 47 if (ret) *ret = EINA_TRUE;
44} 48}
45 49
46static void 50static void
@@ -60,7 +64,7 @@ _selection_done(void *data,
60 evas_object_del(del); 64 evas_object_del(del);
61 65
62 evas_object_smart_callback_call 66 evas_object_smart_callback_call
63 (ELM_WIDGET_DATA(sd)->obj, SIG_FILE_CHOSEN, (void *)file); 67 (sd->obj, SIG_FILE_CHOSEN, (void *)file);
64} 68}
65 69
66static Evas_Object * 70static Evas_Object *
@@ -100,7 +104,7 @@ _activate(Elm_Fileselector_Button_Smart_Data *sd)
100 104
101 if (sd->inwin_mode) 105 if (sd->inwin_mode)
102 { 106 {
103 sd->fsw = _parent_win_get(ELM_WIDGET_DATA(sd)->obj); 107 sd->fsw = _parent_win_get(sd->obj);
104 108
105 if (!sd->fsw) 109 if (!sd->fsw)
106 sd->fsw = _new_window_add(sd); 110 sd->fsw = _new_window_add(sd);
@@ -115,7 +119,7 @@ _activate(Elm_Fileselector_Button_Smart_Data *sd)
115 119
116 sd->fs = elm_fileselector_add(sd->fsw); 120 sd->fs = elm_fileselector_add(sd->fsw);
117 elm_widget_mirrored_set 121 elm_widget_mirrored_set
118 (sd->fs, elm_widget_mirrored_get(ELM_WIDGET_DATA(sd)->obj)); 122 (sd->fs, elm_widget_mirrored_get(sd->obj));
119 elm_widget_mirrored_automatic_set(sd->fs, EINA_FALSE); 123 elm_widget_mirrored_automatic_set(sd->fs, EINA_FALSE);
120 elm_fileselector_expandable_set(sd->fs, sd->fsd.expandable); 124 elm_fileselector_expandable_set(sd->fs, sd->fsd.expandable);
121 elm_fileselector_folder_only_set(sd->fs, sd->fsd.folder_only); 125 elm_fileselector_folder_only_set(sd->fs, sd->fsd.folder_only);
@@ -148,11 +152,11 @@ _button_clicked(void *data,
148} 152}
149 153
150static void 154static void
151_elm_fileselector_button_smart_add(Evas_Object *obj) 155_elm_fileselector_button_smart_add(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
152{ 156{
153 EVAS_SMART_DATA_ALLOC(obj, Elm_Fileselector_Button_Smart_Data); 157 Elm_Fileselector_Button_Smart_Data *priv = _pd;
154 158
155 ELM_WIDGET_CLASS(_elm_fileselector_button_parent_sc)->base.add(obj); 159 eo_do_super(obj, evas_obj_smart_add());
156 160
157 priv->window_title = eina_stringshare_add(DEFAULT_WINDOW_TITLE); 161 priv->window_title = eina_stringshare_add(DEFAULT_WINDOW_TITLE);
158 if (getenv("HOME")) priv->fsd.path = eina_stringshare_add(getenv("HOME")); 162 if (getenv("HOME")) priv->fsd.path = eina_stringshare_add(getenv("HOME"));
@@ -167,16 +171,16 @@ _elm_fileselector_button_smart_add(Evas_Object *obj)
167 171
168 evas_object_smart_callback_add(obj, "clicked", _button_clicked, priv); 172 evas_object_smart_callback_add(obj, "clicked", _button_clicked, priv);
169 173
170 _elm_fileselector_button_smart_theme(obj); 174 eo_do(obj, elm_wdg_theme(NULL));
171 elm_widget_can_focus_set(obj, EINA_TRUE); 175 elm_widget_can_focus_set(obj, EINA_TRUE);
172} 176}
173 177
174static void 178static void
175_elm_fileselector_button_smart_del(Evas_Object *obj) 179_elm_fileselector_button_smart_del(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
176{ 180{
177 Evas_Object *win; 181 Evas_Object *win;
178 182
179 ELM_FILESELECTOR_BUTTON_DATA_GET(obj, sd); 183 Elm_Fileselector_Button_Smart_Data *sd = _pd;
180 184
181 if (sd->window_title) eina_stringshare_del(sd->window_title); 185 if (sd->window_title) eina_stringshare_del(sd->window_title);
182 if (sd->fsd.path) eina_stringshare_del(sd->fsd.path); 186 if (sd->fsd.path) eina_stringshare_del(sd->fsd.path);
@@ -186,53 +190,39 @@ _elm_fileselector_button_smart_del(Evas_Object *obj)
186 evas_object_del(win); 190 evas_object_del(win);
187 } 191 }
188 192
189 ELM_WIDGET_CLASS(_elm_fileselector_button_parent_sc)->base.del(obj); 193 eo_do_super(obj, evas_obj_smart_del());
190} 194}
191 195
192static void 196static void
193_elm_fileselector_button_smart_set_user( 197_elm_fileselector_button_smart_admits_autorepeat_get(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
194 Elm_Fileselector_Button_Smart_Class *sc)
195{
196 ELM_WIDGET_CLASS(sc)->base.add = _elm_fileselector_button_smart_add;
197 ELM_WIDGET_CLASS(sc)->base.del = _elm_fileselector_button_smart_del;
198
199 ELM_WIDGET_CLASS(sc)->theme = _elm_fileselector_button_smart_theme;
200
201 ELM_BUTTON_CLASS(sc)->admits_autorepeat = EINA_FALSE;
202}
203
204EAPI const Elm_Fileselector_Button_Smart_Class *
205elm_fileselector_button_smart_class_get(void)
206{ 198{
207 static Elm_Fileselector_Button_Smart_Class _sc = 199 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
208 ELM_FILESELECTOR_BUTTON_SMART_CLASS_INIT_NAME_VERSION 200 *ret = EINA_FALSE;
209 (ELM_FILESELECTOR_BUTTON_SMART_NAME);
210 static const Elm_Fileselector_Button_Smart_Class *class = NULL;
211 Evas_Smart_Class *esc = (Evas_Smart_Class *)&_sc;
212
213 if (class) return class;
214
215 _elm_fileselector_button_smart_set(&_sc);
216 esc->callbacks = _smart_callbacks;
217 class = &_sc;
218
219 return class;
220} 201}
221 202
222EAPI Evas_Object * 203EAPI Evas_Object *
223elm_fileselector_button_add(Evas_Object *parent) 204elm_fileselector_button_add(Evas_Object *parent)
224{ 205{
225 Evas_Object *obj;
226
227 EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL); 206 EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
207 Evas_Object *obj = eo_add(MY_CLASS, parent);
208 eo_unref(obj);
209 return obj;
210}
228 211
229 obj = elm_widget_add(_elm_fileselector_button_smart_class_new(), parent); 212static void
230 if (!obj) return NULL; 213_constructor(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
214{
215 Elm_Fileselector_Button_Smart_Data *sd = _pd;
216 sd->obj = obj;
217
218 eo_do_super(obj, eo_constructor());
219 eo_do(obj,
220 evas_obj_type_set(MY_CLASS_NAME),
221 evas_obj_smart_callbacks_descriptions_set(_smart_callbacks, NULL));
231 222
223 Evas_Object *parent = eo_parent_get(obj);
232 if (!elm_widget_sub_object_add(parent, obj)) 224 if (!elm_widget_sub_object_add(parent, obj))
233 ERR("could not add %p as sub object of %p", obj, parent); 225 ERR("could not add %p as sub object of %p", obj, parent);
234
235 return obj;
236} 226}
237 227
238EAPI void 228EAPI void
@@ -240,7 +230,14 @@ elm_fileselector_button_window_title_set(Evas_Object *obj,
240 const char *title) 230 const char *title)
241{ 231{
242 ELM_FILESELECTOR_BUTTON_CHECK(obj); 232 ELM_FILESELECTOR_BUTTON_CHECK(obj);
243 ELM_FILESELECTOR_BUTTON_DATA_GET(obj, sd); 233 eo_do(obj, elm_obj_fileselector_button_window_title_set(title));
234}
235
236static void
237_window_title_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
238{
239 const char *title = va_arg(*list, const char *);
240 Elm_Fileselector_Button_Smart_Data *sd = _pd;
244 241
245 eina_stringshare_replace(&sd->window_title, title); 242 eina_stringshare_replace(&sd->window_title, title);
246 243
@@ -251,9 +248,18 @@ EAPI const char *
251elm_fileselector_button_window_title_get(const Evas_Object *obj) 248elm_fileselector_button_window_title_get(const Evas_Object *obj)
252{ 249{
253 ELM_FILESELECTOR_BUTTON_CHECK(obj) NULL; 250 ELM_FILESELECTOR_BUTTON_CHECK(obj) NULL;
254 ELM_FILESELECTOR_BUTTON_DATA_GET(obj, sd); 251 const char *ret = NULL;
252 eo_do((Eo *) obj, elm_obj_fileselector_button_window_title_get(&ret));
253 return ret;
254}
255 255
256 return sd->window_title; 256static void
257_window_title_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
258{
259 const char **ret = va_arg(*list, const char **);
260 Elm_Fileselector_Button_Smart_Data *sd = _pd;
261
262 *ret = sd->window_title;
257} 263}
258 264
259EAPI void 265EAPI void
@@ -262,7 +268,15 @@ elm_fileselector_button_window_size_set(Evas_Object *obj,
262 Evas_Coord height) 268 Evas_Coord height)
263{ 269{
264 ELM_FILESELECTOR_BUTTON_CHECK(obj); 270 ELM_FILESELECTOR_BUTTON_CHECK(obj);
265 ELM_FILESELECTOR_BUTTON_DATA_GET(obj, sd); 271 eo_do(obj, elm_obj_fileselector_button_window_size_set(width, height));
272}
273
274static void
275_window_size_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
276{
277 Evas_Coord width = va_arg(*list, Evas_Coord);
278 Evas_Coord height = va_arg(*list, Evas_Coord);
279 Elm_Fileselector_Button_Smart_Data *sd = _pd;
266 280
267 sd->w = width; 281 sd->w = width;
268 sd->h = height; 282 sd->h = height;
@@ -276,7 +290,15 @@ elm_fileselector_button_window_size_get(const Evas_Object *obj,
276 Evas_Coord *height) 290 Evas_Coord *height)
277{ 291{
278 ELM_FILESELECTOR_BUTTON_CHECK(obj); 292 ELM_FILESELECTOR_BUTTON_CHECK(obj);
279 ELM_FILESELECTOR_BUTTON_DATA_GET(obj, sd); 293 eo_do((Eo *) obj, elm_obj_fileselector_button_window_size_get(width, height));
294}
295
296static void
297_window_size_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
298{
299 Evas_Coord *width = va_arg(*list, Evas_Coord *);
300 Evas_Coord *height = va_arg(*list, Evas_Coord *);
301 Elm_Fileselector_Button_Smart_Data *sd = _pd;
280 302
281 if (width) *width = sd->w; 303 if (width) *width = sd->w;
282 if (height) *height = sd->h; 304 if (height) *height = sd->h;
@@ -287,7 +309,14 @@ elm_fileselector_button_path_set(Evas_Object *obj,
287 const char *path) 309 const char *path)
288{ 310{
289 ELM_FILESELECTOR_BUTTON_CHECK(obj); 311 ELM_FILESELECTOR_BUTTON_CHECK(obj);
290 ELM_FILESELECTOR_BUTTON_DATA_GET(obj, sd); 312 eo_do(obj, elm_obj_fileselector_button_path_set(path));
313}
314
315static void
316_path_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
317{
318 const char *path = va_arg(*list, const char *);
319 Elm_Fileselector_Button_Smart_Data *sd = _pd;
291 320
292 eina_stringshare_replace(&sd->fsd.path, path); 321 eina_stringshare_replace(&sd->fsd.path, path);
293 322
@@ -298,9 +327,18 @@ EAPI const char *
298elm_fileselector_button_path_get(const Evas_Object *obj) 327elm_fileselector_button_path_get(const Evas_Object *obj)
299{ 328{
300 ELM_FILESELECTOR_BUTTON_CHECK(obj) NULL; 329 ELM_FILESELECTOR_BUTTON_CHECK(obj) NULL;
301 ELM_FILESELECTOR_BUTTON_DATA_GET(obj, sd); 330 const char *ret = NULL;
331 eo_do((Eo *) obj, elm_obj_fileselector_button_path_get(&ret));
332 return ret;
333}
334
335static void
336_path_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
337{
338 const char **ret = va_arg(*list, const char **);
339 Elm_Fileselector_Button_Smart_Data *sd = _pd;
302 340
303 return sd->fsd.path; 341 *ret = sd->fsd.path;
304} 342}
305 343
306EAPI void 344EAPI void
@@ -308,7 +346,14 @@ elm_fileselector_button_expandable_set(Evas_Object *obj,
308 Eina_Bool value) 346 Eina_Bool value)
309{ 347{
310 ELM_FILESELECTOR_BUTTON_CHECK(obj); 348 ELM_FILESELECTOR_BUTTON_CHECK(obj);
311 ELM_FILESELECTOR_BUTTON_DATA_GET(obj, sd); 349 eo_do(obj, elm_obj_fileselector_button_expandable_set(value));
350}
351
352static void
353_expandable_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
354{
355 Eina_Bool value = va_arg(*list, int);
356 Elm_Fileselector_Button_Smart_Data *sd = _pd;
312 357
313 sd->fsd.expandable = value; 358 sd->fsd.expandable = value;
314 359
@@ -319,9 +364,18 @@ EAPI Eina_Bool
319elm_fileselector_button_expandable_get(const Evas_Object *obj) 364elm_fileselector_button_expandable_get(const Evas_Object *obj)
320{ 365{
321 ELM_FILESELECTOR_BUTTON_CHECK(obj) EINA_FALSE; 366 ELM_FILESELECTOR_BUTTON_CHECK(obj) EINA_FALSE;
322 ELM_FILESELECTOR_BUTTON_DATA_GET(obj, sd); 367 Eina_Bool ret = EINA_FALSE;
368 eo_do((Eo *) obj, elm_obj_fileselector_button_expandable_get(&ret));
369 return ret;
370}
323 371
324 return sd->fsd.expandable; 372static void
373_expandable_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
374{
375 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
376 Elm_Fileselector_Button_Smart_Data *sd = _pd;
377
378 *ret = sd->fsd.expandable;
325} 379}
326 380
327EAPI void 381EAPI void
@@ -329,7 +383,14 @@ elm_fileselector_button_folder_only_set(Evas_Object *obj,
329 Eina_Bool value) 383 Eina_Bool value)
330{ 384{
331 ELM_FILESELECTOR_BUTTON_CHECK(obj); 385 ELM_FILESELECTOR_BUTTON_CHECK(obj);
332 ELM_FILESELECTOR_BUTTON_DATA_GET(obj, sd); 386 eo_do(obj, elm_obj_fileselector_button_folder_only_set(value));
387}
388
389static void
390_folder_only_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
391{
392 Eina_Bool value = va_arg(*list, int);
393 Elm_Fileselector_Button_Smart_Data *sd = _pd;
333 394
334 sd->fsd.folder_only = value; 395 sd->fsd.folder_only = value;
335 396
@@ -340,9 +401,18 @@ EAPI Eina_Bool
340elm_fileselector_button_folder_only_get(const Evas_Object *obj) 401elm_fileselector_button_folder_only_get(const Evas_Object *obj)
341{ 402{
342 ELM_FILESELECTOR_BUTTON_CHECK(obj) EINA_FALSE; 403 ELM_FILESELECTOR_BUTTON_CHECK(obj) EINA_FALSE;
343 ELM_FILESELECTOR_BUTTON_DATA_GET(obj, sd); 404 Eina_Bool ret = EINA_FALSE;
405 eo_do((Eo *) obj, elm_obj_fileselector_button_folder_only_get(&ret));
406 return ret;
407}
344 408
345 return sd->fsd.folder_only; 409static void
410_folder_only_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
411{
412 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
413 Elm_Fileselector_Button_Smart_Data *sd = _pd;
414
415 *ret = sd->fsd.folder_only;
346} 416}
347 417
348EAPI void 418EAPI void
@@ -350,7 +420,14 @@ elm_fileselector_button_is_save_set(Evas_Object *obj,
350 Eina_Bool value) 420 Eina_Bool value)
351{ 421{
352 ELM_FILESELECTOR_BUTTON_CHECK(obj); 422 ELM_FILESELECTOR_BUTTON_CHECK(obj);
353 ELM_FILESELECTOR_BUTTON_DATA_GET(obj, sd); 423 eo_do(obj, elm_obj_fileselector_button_is_save_set(value));
424}
425
426static void
427_is_save_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
428{
429 Eina_Bool value = va_arg(*list, int);
430 Elm_Fileselector_Button_Smart_Data *sd = _pd;
354 431
355 sd->fsd.is_save = value; 432 sd->fsd.is_save = value;
356 433
@@ -361,9 +438,18 @@ EAPI Eina_Bool
361elm_fileselector_button_is_save_get(const Evas_Object *obj) 438elm_fileselector_button_is_save_get(const Evas_Object *obj)
362{ 439{
363 ELM_FILESELECTOR_BUTTON_CHECK(obj) EINA_FALSE; 440 ELM_FILESELECTOR_BUTTON_CHECK(obj) EINA_FALSE;
364 ELM_FILESELECTOR_BUTTON_DATA_GET(obj, sd); 441 Eina_Bool ret = EINA_FALSE;
442 eo_do((Eo *) obj, elm_obj_fileselector_button_is_save_get(&ret));
443 return ret;
444}
445
446static void
447_is_save_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
448{
449 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
450 Elm_Fileselector_Button_Smart_Data *sd = _pd;
365 451
366 return sd->fsd.is_save; 452 *ret = sd->fsd.is_save;
367} 453}
368 454
369EAPI void 455EAPI void
@@ -371,7 +457,14 @@ elm_fileselector_button_inwin_mode_set(Evas_Object *obj,
371 Eina_Bool value) 457 Eina_Bool value)
372{ 458{
373 ELM_FILESELECTOR_BUTTON_CHECK(obj); 459 ELM_FILESELECTOR_BUTTON_CHECK(obj);
374 ELM_FILESELECTOR_BUTTON_DATA_GET(obj, sd); 460 eo_do(obj, elm_obj_fileselector_button_inwin_mode_set(value));
461}
462
463static void
464_inwin_mode_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
465{
466 Eina_Bool value = va_arg(*list, int);
467 Elm_Fileselector_Button_Smart_Data *sd = _pd;
375 468
376 sd->inwin_mode = value; 469 sd->inwin_mode = value;
377} 470}
@@ -380,7 +473,79 @@ EAPI Eina_Bool
380elm_fileselector_button_inwin_mode_get(const Evas_Object *obj) 473elm_fileselector_button_inwin_mode_get(const Evas_Object *obj)
381{ 474{
382 ELM_FILESELECTOR_BUTTON_CHECK(obj) EINA_FALSE; 475 ELM_FILESELECTOR_BUTTON_CHECK(obj) EINA_FALSE;
383 ELM_FILESELECTOR_BUTTON_DATA_GET(obj, sd); 476 Eina_Bool ret = EINA_FALSE;
477 eo_do((Eo *) obj, elm_obj_fileselector_button_inwin_mode_get(&ret));
478 return ret;
479}
480
481static void
482_inwin_mode_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
483{
484 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
485 Elm_Fileselector_Button_Smart_Data *sd = _pd;
486
487 *ret = sd->inwin_mode;
488}
384 489
385 return sd->inwin_mode; 490static void
491_class_constructor(Eo_Class *klass)
492{
493 const Eo_Op_Func_Description func_desc[] = {
494 EO_OP_FUNC(EO_BASE_ID(EO_BASE_SUB_ID_CONSTRUCTOR), _constructor),
495 EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_ADD), _elm_fileselector_button_smart_add),
496 EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_DEL), _elm_fileselector_button_smart_del),
497
498 EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_THEME), _elm_fileselector_button_smart_theme),
499
500 EO_OP_FUNC(ELM_OBJ_BUTTON_ID(ELM_OBJ_BUTTON_SUB_ID_ADMITS_AUTOREPEAT_GET), _elm_fileselector_button_smart_admits_autorepeat_get),
501
502 EO_OP_FUNC(ELM_OBJ_FILESELECTOR_BUTTON_ID(ELM_OBJ_FILESELECTOR_BUTTON_SUB_ID_WINDOW_TITLE_SET), _window_title_set),
503 EO_OP_FUNC(ELM_OBJ_FILESELECTOR_BUTTON_ID(ELM_OBJ_FILESELECTOR_BUTTON_SUB_ID_WINDOW_TITLE_GET), _window_title_get),
504 EO_OP_FUNC(ELM_OBJ_FILESELECTOR_BUTTON_ID(ELM_OBJ_FILESELECTOR_BUTTON_SUB_ID_WINDOW_SIZE_SET), _window_size_set),
505 EO_OP_FUNC(ELM_OBJ_FILESELECTOR_BUTTON_ID(ELM_OBJ_FILESELECTOR_BUTTON_SUB_ID_WINDOW_SIZE_GET), _window_size_get),
506 EO_OP_FUNC(ELM_OBJ_FILESELECTOR_BUTTON_ID(ELM_OBJ_FILESELECTOR_BUTTON_SUB_ID_PATH_SET), _path_set),
507 EO_OP_FUNC(ELM_OBJ_FILESELECTOR_BUTTON_ID(ELM_OBJ_FILESELECTOR_BUTTON_SUB_ID_PATH_GET), _path_get),
508 EO_OP_FUNC(ELM_OBJ_FILESELECTOR_BUTTON_ID(ELM_OBJ_FILESELECTOR_BUTTON_SUB_ID_EXPANDABLE_SET), _expandable_set),
509 EO_OP_FUNC(ELM_OBJ_FILESELECTOR_BUTTON_ID(ELM_OBJ_FILESELECTOR_BUTTON_SUB_ID_EXPANDABLE_GET), _expandable_get),
510 EO_OP_FUNC(ELM_OBJ_FILESELECTOR_BUTTON_ID(ELM_OBJ_FILESELECTOR_BUTTON_SUB_ID_FOLDER_ONLY_SET), _folder_only_set),
511 EO_OP_FUNC(ELM_OBJ_FILESELECTOR_BUTTON_ID(ELM_OBJ_FILESELECTOR_BUTTON_SUB_ID_FOLDER_ONLY_GET), _folder_only_get),
512 EO_OP_FUNC(ELM_OBJ_FILESELECTOR_BUTTON_ID(ELM_OBJ_FILESELECTOR_BUTTON_SUB_ID_IS_SAVE_SET), _is_save_set),
513 EO_OP_FUNC(ELM_OBJ_FILESELECTOR_BUTTON_ID(ELM_OBJ_FILESELECTOR_BUTTON_SUB_ID_IS_SAVE_GET), _is_save_get),
514 EO_OP_FUNC(ELM_OBJ_FILESELECTOR_BUTTON_ID(ELM_OBJ_FILESELECTOR_BUTTON_SUB_ID_INWIN_MODE_SET), _inwin_mode_set),
515 EO_OP_FUNC(ELM_OBJ_FILESELECTOR_BUTTON_ID(ELM_OBJ_FILESELECTOR_BUTTON_SUB_ID_INWIN_MODE_GET), _inwin_mode_get),
516 EO_OP_FUNC_SENTINEL
517 };
518 eo_class_funcs_set(klass, func_desc);
386} 519}
520
521static const Eo_Op_Description op_desc[] = {
522 EO_OP_DESCRIPTION(ELM_OBJ_FILESELECTOR_BUTTON_SUB_ID_WINDOW_TITLE_SET, "Set the title for a given file selector button widget's window."),
523 EO_OP_DESCRIPTION(ELM_OBJ_FILESELECTOR_BUTTON_SUB_ID_WINDOW_TITLE_GET, "Get the title for a given file selector button widget's window."),
524 EO_OP_DESCRIPTION(ELM_OBJ_FILESELECTOR_BUTTON_SUB_ID_WINDOW_SIZE_SET, "Set the size of a given file selector button widget's window, holding the file selector itself."),
525 EO_OP_DESCRIPTION(ELM_OBJ_FILESELECTOR_BUTTON_SUB_ID_WINDOW_SIZE_GET, "Get the size of a given file selector button widget's window, holding the file selector itself."),
526 EO_OP_DESCRIPTION(ELM_OBJ_FILESELECTOR_BUTTON_SUB_ID_PATH_SET, "Set the initial file system path for a given file selector button widget."),
527 EO_OP_DESCRIPTION(ELM_OBJ_FILESELECTOR_BUTTON_SUB_ID_PATH_GET, "Get the initial file system path set for a given file selector button widget."),
528 EO_OP_DESCRIPTION(ELM_OBJ_FILESELECTOR_BUTTON_SUB_ID_EXPANDABLE_SET, "Enable/disable a tree view in the given file selector button widget's internal file selector."),
529 EO_OP_DESCRIPTION(ELM_OBJ_FILESELECTOR_BUTTON_SUB_ID_EXPANDABLE_GET, "Get whether tree view is enabled for the given file selector button widget's internal file selector."),
530 EO_OP_DESCRIPTION(ELM_OBJ_FILESELECTOR_BUTTON_SUB_ID_FOLDER_ONLY_SET, "Set whether a given file selector button widget's internal file selector is to display folders only or the directory contents, as well."),
531 EO_OP_DESCRIPTION(ELM_OBJ_FILESELECTOR_BUTTON_SUB_ID_FOLDER_ONLY_GET, "Get whether a given file selector button widget's internal file selector is displaying folders only or the directory contents, as well."),
532 EO_OP_DESCRIPTION(ELM_OBJ_FILESELECTOR_BUTTON_SUB_ID_IS_SAVE_SET, "Enable/disable the file name entry box where the user can type in a name for a file, in a given file selector button widget's internal file selector."),
533 EO_OP_DESCRIPTION(ELM_OBJ_FILESELECTOR_BUTTON_SUB_ID_IS_SAVE_GET, "Get whether the given file selector button widget's internal file selector is in 'saving dialog' mode."),
534 EO_OP_DESCRIPTION(ELM_OBJ_FILESELECTOR_BUTTON_SUB_ID_INWIN_MODE_SET, "Set whether a given file selector button widget's internal file selector will raise an Elementary 'inner window', instead of a dedicated Elementary window."),
535 EO_OP_DESCRIPTION(ELM_OBJ_FILESELECTOR_BUTTON_SUB_ID_INWIN_MODE_GET, "Get whether a given file selector button widget's internal file selector will raise an Elementary 'inner window', instead of a dedicated Elementary window."),
536 EO_OP_DESCRIPTION_SENTINEL
537};
538
539static const Eo_Class_Description class_desc = {
540 EO_VERSION,
541 MY_CLASS_NAME,
542 EO_CLASS_TYPE_REGULAR,
543 EO_CLASS_DESCRIPTION_OPS(&ELM_OBJ_FILESELECTOR_BUTTON_BASE_ID, op_desc, ELM_OBJ_FILESELECTOR_BUTTON_SUB_ID_LAST),
544 NULL,
545 sizeof(Elm_Fileselector_Button_Smart_Data),
546 _class_constructor,
547 NULL
548};
549
550EO_DEFINE_CLASS(elm_obj_fileselector_button_class_get, &class_desc, ELM_OBJ_BUTTON_CLASS, NULL);
551
diff --git a/src/lib/elc_fileselector_button.h b/src/lib/elc_fileselector_button.h
index 57afad3cf..741925976 100644
--- a/src/lib/elc_fileselector_button.h
+++ b/src/lib/elc_fileselector_button.h
@@ -61,6 +61,215 @@
61 * @{ 61 * @{
62 */ 62 */
63 63
64#define ELM_OBJ_FILESELECTOR_BUTTON_CLASS elm_obj_fileselector_button_class_get()
65
66const Eo_Class *elm_obj_fileselector_button_class_get(void) EINA_CONST;
67
68extern EAPI Eo_Op ELM_OBJ_FILESELECTOR_BUTTON_BASE_ID;
69
70enum
71{
72 ELM_OBJ_FILESELECTOR_BUTTON_SUB_ID_WINDOW_TITLE_SET,
73 ELM_OBJ_FILESELECTOR_BUTTON_SUB_ID_WINDOW_TITLE_GET,
74 ELM_OBJ_FILESELECTOR_BUTTON_SUB_ID_WINDOW_SIZE_SET,
75 ELM_OBJ_FILESELECTOR_BUTTON_SUB_ID_WINDOW_SIZE_GET,
76 ELM_OBJ_FILESELECTOR_BUTTON_SUB_ID_PATH_SET,
77 ELM_OBJ_FILESELECTOR_BUTTON_SUB_ID_PATH_GET,
78 ELM_OBJ_FILESELECTOR_BUTTON_SUB_ID_EXPANDABLE_SET,
79 ELM_OBJ_FILESELECTOR_BUTTON_SUB_ID_EXPANDABLE_GET,
80 ELM_OBJ_FILESELECTOR_BUTTON_SUB_ID_FOLDER_ONLY_SET,
81 ELM_OBJ_FILESELECTOR_BUTTON_SUB_ID_FOLDER_ONLY_GET,
82 ELM_OBJ_FILESELECTOR_BUTTON_SUB_ID_IS_SAVE_SET,
83 ELM_OBJ_FILESELECTOR_BUTTON_SUB_ID_IS_SAVE_GET,
84 ELM_OBJ_FILESELECTOR_BUTTON_SUB_ID_INWIN_MODE_SET,
85 ELM_OBJ_FILESELECTOR_BUTTON_SUB_ID_INWIN_MODE_GET,
86 ELM_OBJ_FILESELECTOR_BUTTON_SUB_ID_LAST
87};
88
89#define ELM_OBJ_FILESELECTOR_BUTTON_ID(sub_id) (ELM_OBJ_FILESELECTOR_BUTTON_BASE_ID + sub_id)
90
91
92/**
93 * @def elm_obj_fileselector_button_window_title_set
94 * @since 1.8
95 *
96 * Set the title for a given file selector button widget's window
97 *
98 * @param[in] title
99 *
100 * @see elm_fileselector_button_window_title_set
101 */
102#define elm_obj_fileselector_button_window_title_set(title) ELM_OBJ_FILESELECTOR_BUTTON_ID(ELM_OBJ_FILESELECTOR_BUTTON_SUB_ID_WINDOW_TITLE_SET), EO_TYPECHECK(const char *, title)
103
104/**
105 * @def elm_obj_fileselector_button_window_title_get
106 * @since 1.8
107 *
108 * Get the title for a given file selector button widget's
109 *
110 * @param[out] ret
111 *
112 * @see elm_fileselector_button_window_title_get
113 */
114#define elm_obj_fileselector_button_window_title_get(ret) ELM_OBJ_FILESELECTOR_BUTTON_ID(ELM_OBJ_FILESELECTOR_BUTTON_SUB_ID_WINDOW_TITLE_GET), EO_TYPECHECK(const char **, ret)
115
116/**
117 * @def elm_obj_fileselector_button_window_size_set
118 * @since 1.8
119 *
120 * Set the size of a given file selector button widget's window,
121 * holding the file selector itself.
122 *
123 * @param[in] width
124 * @param[in] height
125 *
126 * @see elm_fileselector_button_window_size_set
127 */
128#define elm_obj_fileselector_button_window_size_set(width, height) ELM_OBJ_FILESELECTOR_BUTTON_ID(ELM_OBJ_FILESELECTOR_BUTTON_SUB_ID_WINDOW_SIZE_SET), EO_TYPECHECK(Evas_Coord, width), EO_TYPECHECK(Evas_Coord, height)
129
130/**
131 * @def elm_obj_fileselector_button_window_size_get
132 * @since 1.8
133 *
134 * Get the size of a given file selector button widget's window,
135 * holding the file selector itself.
136 *
137 * @param[out] width
138 * @param[out] height
139 *
140 * @see elm_fileselector_button_window_size_get
141 */
142#define elm_obj_fileselector_button_window_size_get(width, height) ELM_OBJ_FILESELECTOR_BUTTON_ID(ELM_OBJ_FILESELECTOR_BUTTON_SUB_ID_WINDOW_SIZE_GET), EO_TYPECHECK(Evas_Coord *, width), EO_TYPECHECK(Evas_Coord *, height)
143
144/**
145 * @def elm_obj_fileselector_button_path_set
146 * @since 1.8
147 *
148 * Set the initial file system path for a given file selector
149 *
150 * @param[in] path
151 *
152 * @see elm_fileselector_button_path_set
153 */
154#define elm_obj_fileselector_button_path_set(path) ELM_OBJ_FILESELECTOR_BUTTON_ID(ELM_OBJ_FILESELECTOR_BUTTON_SUB_ID_PATH_SET), EO_TYPECHECK(const char *, path)
155
156/**
157 * @def elm_obj_fileselector_button_path_get
158 * @since 1.8
159 *
160 * Get the initial file system path set for a given file selector
161 *
162 * @param[out] ret
163 *
164 * @see elm_fileselector_button_path_get
165 */
166#define elm_obj_fileselector_button_path_get(ret) ELM_OBJ_FILESELECTOR_BUTTON_ID(ELM_OBJ_FILESELECTOR_BUTTON_SUB_ID_PATH_GET), EO_TYPECHECK(const char **, ret)
167
168/**
169 * @def elm_obj_fileselector_button_expandable_set
170 * @since 1.8
171 *
172 * Enable/disable a tree view in the given file selector button
173 *
174 * @param[in] value
175 *
176 * @see elm_fileselector_button_expandable_set
177 */
178#define elm_obj_fileselector_button_expandable_set(value) ELM_OBJ_FILESELECTOR_BUTTON_ID(ELM_OBJ_FILESELECTOR_BUTTON_SUB_ID_EXPANDABLE_SET), EO_TYPECHECK(Eina_Bool, value)
179
180/**
181 * @def elm_obj_fileselector_button_expandable_get
182 * @since 1.8
183 *
184 * Get whether tree view is enabled for the given file selector
185 *
186 * @param[out] ret
187 *
188 * @see elm_fileselector_button_expandable_get
189 */
190#define elm_obj_fileselector_button_expandable_get(ret) ELM_OBJ_FILESELECTOR_BUTTON_ID(ELM_OBJ_FILESELECTOR_BUTTON_SUB_ID_EXPANDABLE_GET), EO_TYPECHECK(Eina_Bool *, ret)
191
192/**
193 * @def elm_obj_fileselector_button_folder_only_set
194 * @since 1.8
195 *
196 * Set whether a given file selector button widget's internal file
197 * selector is to display folders only or the directory contents,
198 * as well.
199 *
200 * @param[in] value
201 *
202 * @see elm_fileselector_button_folder_only_set
203 */
204#define elm_obj_fileselector_button_folder_only_set(value) ELM_OBJ_FILESELECTOR_BUTTON_ID(ELM_OBJ_FILESELECTOR_BUTTON_SUB_ID_FOLDER_ONLY_SET), EO_TYPECHECK(Eina_Bool, value)
205
206/**
207 * @def elm_obj_fileselector_button_folder_only_get
208 * @since 1.8
209 *
210 * Get whether a given file selector button widget's internal file
211 * selector is displaying folders only or the directory contents,
212 * as well.
213 *
214 * @param[out] ret
215 *
216 * @see elm_fileselector_button_folder_only_get
217 */
218#define elm_obj_fileselector_button_folder_only_get(ret) ELM_OBJ_FILESELECTOR_BUTTON_ID(ELM_OBJ_FILESELECTOR_BUTTON_SUB_ID_FOLDER_ONLY_GET), EO_TYPECHECK(Eina_Bool *, ret)
219
220/**
221 * @def elm_obj_fileselector_button_is_save_set
222 * @since 1.8
223 *
224 * Enable/disable the file name entry box where the user can type
225 *
226 * @param[in] value
227 *
228 * @see elm_fileselector_button_is_save_set
229 */
230#define elm_obj_fileselector_button_is_save_set(value) ELM_OBJ_FILESELECTOR_BUTTON_ID(ELM_OBJ_FILESELECTOR_BUTTON_SUB_ID_IS_SAVE_SET), EO_TYPECHECK(Eina_Bool, value)
231
232/**
233 * @def elm_obj_fileselector_button_is_save_get
234 * @since 1.8
235 *
236 * Get whether the given file selector button widget's internal
237 * file selector is in "saving dialog" mode
238 *
239 * @param[out] ret
240 *
241 * @see elm_fileselector_button_is_save_get
242 */
243#define elm_obj_fileselector_button_is_save_get(ret) ELM_OBJ_FILESELECTOR_BUTTON_ID(ELM_OBJ_FILESELECTOR_BUTTON_SUB_ID_IS_SAVE_GET), EO_TYPECHECK(Eina_Bool *, ret)
244
245/**
246 * @def elm_obj_fileselector_button_inwin_mode_set
247 * @since 1.8
248 *
249 * Set whether a given file selector button widget's internal file
250 * selector will raise an Elementary "inner window", instead of a
251 * dedicated Elementary window. By default, it won't.
252 *
253 * @param[in] value
254 *
255 * @see elm_fileselector_button_inwin_mode_set
256 */
257#define elm_obj_fileselector_button_inwin_mode_set(value) ELM_OBJ_FILESELECTOR_BUTTON_ID(ELM_OBJ_FILESELECTOR_BUTTON_SUB_ID_INWIN_MODE_SET), EO_TYPECHECK(Eina_Bool, value)
258
259/**
260 * @def elm_obj_fileselector_button_inwin_mode_get
261 * @since 1.8
262 *
263 * Get whether a given file selector button widget's internal file
264 * selector will raise an Elementary "inner window", instead of a
265 * dedicated Elementary window.
266 *
267 * @param[out] ret
268 *
269 * @see elm_fileselector_button_inwin_mode_get
270 */
271#define elm_obj_fileselector_button_inwin_mode_get(ret) ELM_OBJ_FILESELECTOR_BUTTON_ID(ELM_OBJ_FILESELECTOR_BUTTON_SUB_ID_INWIN_MODE_GET), EO_TYPECHECK(Eina_Bool *, ret)
272
64/** 273/**
65 * Add a new file selector button widget to the given parent 274 * Add a new file selector button widget to the given parent
66 * Elementary (container) object 275 * Elementary (container) object
diff --git a/src/lib/elc_fileselector_entry.c b/src/lib/elc_fileselector_entry.c
index fbc100919..7fd1bd689 100644
--- a/src/lib/elc_fileselector_entry.c
+++ b/src/lib/elc_fileselector_entry.c
@@ -4,6 +4,14 @@
4#include "elm_priv.h" 4#include "elm_priv.h"
5#include "elm_widget_fileselector_entry.h" 5#include "elm_widget_fileselector_entry.h"
6 6
7#include "Eo.h"
8
9EAPI Eo_Op ELM_OBJ_FILESELECTOR_ENTRY_BASE_ID = EO_NOOP;
10
11#define MY_CLASS ELM_OBJ_FILESELECTOR_ENTRY_CLASS
12
13#define MY_CLASS_NAME "elm_fileselector_entry"
14
7EAPI const char ELM_FILESELECTOR_ENTRY_SMART_NAME[] = "elm_fileselector_entry"; 15EAPI const char ELM_FILESELECTOR_ENTRY_SMART_NAME[] = "elm_fileselector_entry";
8 16
9static const char SIG_CHANGED[] = "changed"; 17static const char SIG_CHANGED[] = "changed";
@@ -56,11 +64,6 @@ SIG_FWD(SELECTION_CUT)
56SIG_FWD(UNPRESSED) 64SIG_FWD(UNPRESSED)
57#undef SIG_FWD 65#undef SIG_FWD
58 66
59EVAS_SMART_SUBCLASS_NEW
60 (ELM_FILESELECTOR_ENTRY_SMART_NAME, _elm_fileselector_entry,
61 Elm_Fileselector_Entry_Smart_Class, Elm_Layout_Smart_Class,
62 elm_layout_smart_class_get, _smart_callbacks);
63
64static void 67static void
65_FILE_CHOSEN_fwd(void *data, 68_FILE_CHOSEN_fwd(void *data,
66 Evas_Object *obj __UNUSED__, 69 Evas_Object *obj __UNUSED__,
@@ -93,27 +96,44 @@ _ACTIVATED_fwd(void *data,
93} 96}
94 97
95static void 98static void
96_elm_fileselector_entry_smart_sizing_eval(Evas_Object *obj) 99_elm_fileselector_entry_smart_sizing_eval(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
97{ 100{
98 Evas_Coord minw = -1, minh = -1; 101 Evas_Coord minw = -1, minh = -1;
99 102
100 ELM_FILESELECTOR_ENTRY_DATA_GET(obj, sd); 103 Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
101 104
102 edje_object_size_min_calc(ELM_WIDGET_DATA(sd)->resize_obj, &minw, &minh); 105 edje_object_size_min_calc(wd->resize_obj, &minw, &minh);
103 evas_object_size_hint_min_set(obj, minw, minh); 106 evas_object_size_hint_min_set(obj, minw, minh);
104 evas_object_size_hint_max_set(obj, -1, -1); 107 evas_object_size_hint_max_set(obj, -1, -1);
105} 108}
106 109
107static Eina_Bool 110static void
108_elm_fileselector_entry_smart_focus_next(const Evas_Object *obj, 111_elm_fileselector_entry_smart_focus_next_manager_is(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
109 Elm_Focus_Direction dir, 112{
110 Evas_Object **next) 113 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
114 *ret = EINA_TRUE;
115}
116
117static void
118_elm_fileselector_entry_smart_focus_direction_manager_is(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
119{
120 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
121 *ret = EINA_FALSE;
122}
123
124static void
125_elm_fileselector_entry_smart_focus_next(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
111{ 126{
112 Evas_Object *chain[2]; 127 Evas_Object *chain[2];
113 Evas_Object *to_focus; 128 Evas_Object *to_focus;
114 unsigned char i; 129 unsigned char i;
115 130
116 ELM_FILESELECTOR_ENTRY_DATA_GET(obj, sd); 131 Elm_Fileselector_Entry_Smart_Data *sd = _pd;
132
133 Elm_Focus_Direction dir = va_arg(*list, Elm_Focus_Direction);
134 Evas_Object **next = va_arg(*list, Evas_Object **);
135 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
136 Eina_Bool int_ret = EINA_FALSE;
117 137
118 /* Direction */ 138 /* Direction */
119 if (dir == ELM_FOCUS_PREVIOUS) 139 if (dir == ELM_FOCUS_PREVIOUS)
@@ -127,22 +147,27 @@ _elm_fileselector_entry_smart_focus_next(const Evas_Object *obj,
127 chain[1] = sd->button; 147 chain[1] = sd->button;
128 } 148 }
129 else 149 else
130 return EINA_FALSE; 150 goto end;
131 151
132 i = elm_widget_focus_get(chain[1]); 152 i = elm_widget_focus_get(chain[1]);
133 153
134 if (elm_widget_focus_next_get(chain[i], dir, next)) 154 if (elm_widget_focus_next_get(chain[i], dir, next))
135 return EINA_TRUE; 155 {
156 int_ret = EINA_TRUE;
157 goto end;
158 }
136 159
137 i = !i; 160 i = !i;
138 161
139 if (elm_widget_focus_next_get(chain[i], dir, &to_focus)) 162 if (elm_widget_focus_next_get(chain[i], dir, &to_focus))
140 { 163 {
141 *next = to_focus; 164 *next = to_focus;
142 return !!i; 165 int_ret = !!i;
166 goto end;
143 } 167 }
144 168
145 return EINA_FALSE; 169end:
170 if (ret) *ret = int_ret;
146} 171}
147 172
148static void 173static void
@@ -154,16 +179,21 @@ _mirrored_set(Evas_Object *obj,
154 elm_widget_mirrored_set(sd->button, rtl); 179 elm_widget_mirrored_set(sd->button, rtl);
155} 180}
156 181
157static Eina_Bool 182static void
158_elm_fileselector_entry_smart_theme(Evas_Object *obj) 183_elm_fileselector_entry_smart_theme(Eo *obj, void *_pd, va_list *list)
159{ 184{
160 const char *style; 185 const char *style;
161 char buf[1024]; 186 char buf[1024];
162 187
163 ELM_FILESELECTOR_ENTRY_DATA_GET(obj, sd); 188 Elm_Fileselector_Entry_Smart_Data *sd = _pd;
189 Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
190
191 Eina_Bool int_ret;
192 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
193 if (ret) *ret = EINA_FALSE;
164 194
165 if (!ELM_WIDGET_CLASS(_elm_fileselector_entry_parent_sc)->theme(obj)) 195 eo_do_super(obj, elm_wdg_theme(&int_ret));
166 return EINA_FALSE; 196 if (!int_ret) return;
167 197
168 style = elm_widget_style_get(obj); 198 style = elm_widget_style_get(obj);
169 199
@@ -177,105 +207,142 @@ _elm_fileselector_entry_smart_theme(Evas_Object *obj)
177 elm_widget_style_set(sd->button, buf); 207 elm_widget_style_set(sd->button, buf);
178 elm_widget_style_set(sd->entry, buf); 208 elm_widget_style_set(sd->entry, buf);
179 209
180 edje_object_message_signal_process(ELM_WIDGET_DATA(sd)->resize_obj); 210 edje_object_message_signal_process(wd->resize_obj);
181 211
182 elm_layout_sizing_eval(obj); 212 elm_layout_sizing_eval(obj);
183 213
184 return EINA_TRUE; 214 if (ret) *ret = EINA_TRUE;
185} 215}
186 216
187static Eina_Bool 217static void
188_elm_fileselector_entry_smart_disable(Evas_Object *obj) 218_elm_fileselector_entry_smart_disable(Eo *obj, void *_pd, va_list *list)
189{ 219{
190 Eina_Bool val; 220 Eina_Bool val;
191 221
192 ELM_FILESELECTOR_ENTRY_DATA_GET(obj, sd); 222 Elm_Fileselector_Entry_Smart_Data *sd = _pd;
223
224 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
225 if (ret) *ret = EINA_FALSE;
226 Eina_Bool int_ret;
193 227
194 if (!ELM_WIDGET_CLASS(_elm_fileselector_entry_parent_sc)->disable(obj)) 228 eo_do_super(obj, elm_wdg_disable(&int_ret));
195 return EINA_FALSE; 229 if (!int_ret) return;
196 230
197 val = elm_widget_disabled_get(obj); 231 val = elm_widget_disabled_get(obj);
198 232
199 elm_widget_disabled_set(sd->button, val); 233 elm_widget_disabled_set(sd->button, val);
200 elm_widget_disabled_set(sd->entry, val); 234 elm_widget_disabled_set(sd->entry, val);
201 235
202 return EINA_TRUE; 236 if (ret) *ret = EINA_TRUE;
203} 237}
204 238
205static Eina_Bool 239static void
206_elm_fileselector_entry_smart_text_set(Evas_Object *obj, 240_elm_fileselector_entry_smart_text_set(Eo *obj, void *_pd, va_list *list)
207 const char *item,
208 const char *label)
209{ 241{
210 ELM_FILESELECTOR_ENTRY_DATA_GET(obj, sd); 242 Elm_Fileselector_Entry_Smart_Data *sd = _pd;
243
244 const char *item = va_arg(*list, const char *);
245 const char *label = va_arg(*list, const char *);
246 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
247 Eina_Bool int_ret;
211 248
212 if (item && strcmp(item, "default")) 249 if (item && strcmp(item, "default"))
213 return _elm_fileselector_entry_parent_sc->text_set(obj, item, label); 250 {
251 eo_do_super(obj, elm_obj_layout_text_set(item, label, &int_ret));
252 goto end;
253 }
214 254
215 elm_object_text_set(sd->button, label); 255 elm_object_text_set(sd->button, label);
216 256
217 return EINA_TRUE; 257 int_ret = EINA_TRUE;
258end:
259 if (ret) *ret = int_ret;
218} 260}
219 261
220static const char * 262static void
221_elm_fileselector_entry_smart_text_get(const Evas_Object *obj, 263_elm_fileselector_entry_smart_text_get(Eo *obj, void *_pd, va_list *list)
222 const char *item)
223{ 264{
224 ELM_FILESELECTOR_ENTRY_DATA_GET(obj, sd); 265 Elm_Fileselector_Entry_Smart_Data *sd = _pd;
266
267 const char *item = va_arg(*list, const char *);
268 const char **text = va_arg(*list, const char **);
225 269
226 if (item && strcmp(item, "default")) 270 if (item && strcmp(item, "default"))
227 return _elm_fileselector_entry_parent_sc->text_get(obj, item); 271 {
272 eo_do_super(obj, elm_obj_layout_text_get(item, text));
273 return;
274 }
228 275
229 return elm_object_text_get(sd->button); 276 *text = elm_object_text_get(sd->button);
230} 277}
231 278
232static Eina_Bool 279static void
233_elm_fileselector_entry_smart_content_set(Evas_Object *obj, 280_elm_fileselector_entry_smart_content_set(Eo *obj, void *_pd, va_list *list)
234 const char *part,
235 Evas_Object *content)
236{ 281{
237 ELM_FILESELECTOR_ENTRY_DATA_GET(obj, sd); 282 Elm_Fileselector_Entry_Smart_Data *sd = _pd;
283
284 const char *part = va_arg(*list, const char *);
285 Evas_Object *content = va_arg(*list, Evas_Object *);
286 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
287 Eina_Bool int_ret;
238 288
239 if (part && strcmp(part, "button icon")) 289 if (part && strcmp(part, "button icon"))
240 return ELM_CONTAINER_CLASS(_elm_fileselector_entry_parent_sc)->content_set 290 {
241 (obj, part, content); 291 eo_do_super(obj, elm_obj_container_content_set(part, content, &int_ret));
292 goto end;
293 }
242 294
243 elm_layout_content_set(sd->button, NULL, content); 295 elm_layout_content_set(sd->button, NULL, content);
244 296
245 return EINA_TRUE; 297 int_ret = EINA_TRUE;
298end:
299 if (ret) *ret = int_ret;
246} 300}
247 301
248static Evas_Object * 302static void
249_elm_fileselector_entry_smart_content_get(const Evas_Object *obj, 303_elm_fileselector_entry_smart_content_get(Eo *obj, void *_pd, va_list *list)
250 const char *part)
251{ 304{
252 ELM_FILESELECTOR_ENTRY_DATA_GET(obj, sd); 305 Elm_Fileselector_Entry_Smart_Data *sd = _pd;
306
307 const char *part = va_arg(*list, const char *);
308 Evas_Object **ret = va_arg(*list, Evas_Object **);
309 *ret = NULL;
253 310
254 if (part && strcmp(part, "button icon")) 311 if (part && strcmp(part, "button icon"))
255 return ELM_CONTAINER_CLASS(_elm_fileselector_entry_parent_sc)-> 312 {
256 content_get(obj, part); 313 eo_do_super(obj, elm_obj_container_content_get(part, ret));
314 return;
315 }
257 316
258 return elm_layout_content_get(sd->button, NULL); 317 *ret = elm_layout_content_get(sd->button, NULL);
259} 318}
260 319
261static Evas_Object * 320static void
262_elm_fileselector_entry_smart_content_unset(Evas_Object *obj, 321_elm_fileselector_entry_smart_content_unset(Eo *obj, void *_pd, va_list *list)
263 const char *part)
264{ 322{
265 ELM_FILESELECTOR_ENTRY_DATA_GET(obj, sd); 323 Elm_Fileselector_Entry_Smart_Data *sd = _pd;
324
325 const char *part = va_arg(*list, const char *);
326 Evas_Object **ret = va_arg(*list, Evas_Object **);
327 Evas_Object *int_ret;
328
266 if (part && strcmp(part, "button icon")) 329 if (part && strcmp(part, "button icon"))
267 return ELM_CONTAINER_CLASS(_elm_fileselector_entry_parent_sc)-> 330 {
268 content_unset(obj, part); 331 eo_do_super(obj, elm_obj_container_content_unset(part, &int_ret));
332 goto end;
333 }
269 334
270 return elm_layout_content_unset(sd->button, NULL); 335 int_ret = elm_layout_content_unset(sd->button, NULL);
336end:
337 if (ret) *ret = int_ret;
271} 338}
272 339
273static void 340static void
274_elm_fileselector_entry_smart_add(Evas_Object *obj) 341_elm_fileselector_entry_smart_add(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
275{ 342{
276 EVAS_SMART_DATA_ALLOC(obj, Elm_Fileselector_Entry_Smart_Data); 343 Elm_Fileselector_Entry_Smart_Data *priv = _pd;
277 344
278 ELM_WIDGET_CLASS(_elm_fileselector_entry_parent_sc)->base.add(obj); 345 eo_do_super(obj, evas_obj_smart_add());
279 346
280 elm_layout_theme_set 347 elm_layout_theme_set
281 (obj, "fileselector_entry", "base", elm_widget_style_get(obj)); 348 (obj, "fileselector_entry", "base", elm_widget_style_get(obj));
@@ -325,73 +392,34 @@ _elm_fileselector_entry_smart_add(Evas_Object *obj)
325} 392}
326 393
327static void 394static void
328_elm_fileselector_entry_smart_del(Evas_Object *obj) 395_elm_fileselector_entry_smart_del(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
329{ 396{
330 ELM_FILESELECTOR_ENTRY_DATA_GET(obj, sd); 397 Elm_Fileselector_Entry_Smart_Data *sd = _pd;
331 398
332 if (sd->path) free(sd->path); 399 if (sd->path) free(sd->path);
333 400
334 ELM_WIDGET_CLASS(_elm_fileselector_entry_parent_sc)->base.del(obj); 401 eo_do_super(obj, evas_obj_smart_del());
335}
336
337static void
338_elm_fileselector_entry_smart_set_user(Elm_Fileselector_Entry_Smart_Class *sc)
339{
340 ELM_WIDGET_CLASS(sc)->base.add = _elm_fileselector_entry_smart_add;
341 ELM_WIDGET_CLASS(sc)->base.del = _elm_fileselector_entry_smart_del;
342
343 ELM_WIDGET_CLASS(sc)->disable = _elm_fileselector_entry_smart_disable;
344 ELM_WIDGET_CLASS(sc)->theme = _elm_fileselector_entry_smart_theme;
345
346 ELM_WIDGET_CLASS(sc)->focus_next = _elm_fileselector_entry_smart_focus_next;
347 ELM_WIDGET_CLASS(sc)->focus_direction = NULL;
348
349 ELM_CONTAINER_CLASS(sc)->content_set =
350 _elm_fileselector_entry_smart_content_set;
351 ELM_CONTAINER_CLASS(sc)->content_get =
352 _elm_fileselector_entry_smart_content_get;
353 ELM_CONTAINER_CLASS(sc)->content_unset =
354 _elm_fileselector_entry_smart_content_unset;
355
356 ELM_LAYOUT_CLASS(sc)->text_set = _elm_fileselector_entry_smart_text_set;
357 ELM_LAYOUT_CLASS(sc)->text_get = _elm_fileselector_entry_smart_text_get;
358 ELM_LAYOUT_CLASS(sc)->sizing_eval =
359 _elm_fileselector_entry_smart_sizing_eval;
360}
361
362EAPI const Elm_Fileselector_Entry_Smart_Class *
363elm_fileselector_entry_smart_class_get(void)
364{
365 static Elm_Fileselector_Entry_Smart_Class _sc =
366 ELM_FILESELECTOR_ENTRY_SMART_CLASS_INIT_NAME_VERSION
367 (ELM_FILESELECTOR_ENTRY_SMART_NAME);
368 static const Elm_Fileselector_Entry_Smart_Class *class = NULL;
369 Evas_Smart_Class *esc = (Evas_Smart_Class *)&_sc;
370
371 if (class)
372 return class;
373
374 _elm_fileselector_entry_smart_set(&_sc);
375 esc->callbacks = _smart_callbacks;
376 class = &_sc;
377
378 return class;
379} 402}
380 403
381EAPI Evas_Object * 404EAPI Evas_Object *
382elm_fileselector_entry_add(Evas_Object *parent) 405elm_fileselector_entry_add(Evas_Object *parent)
383{ 406{
384 Evas_Object *obj;
385
386 EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL); 407 EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
408 Evas_Object *obj = eo_add(MY_CLASS, parent);
409 eo_unref(obj);
410 return obj;
411}
387 412
388 obj = elm_widget_add(_elm_fileselector_entry_smart_class_new(), parent); 413static void
389 if (!obj) return NULL; 414_constructor(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
390 415{
391 if (!elm_widget_sub_object_add(parent, obj)) 416 eo_do_super(obj, eo_constructor());
392 ERR("could not add %p as sub object of %p", obj, parent); 417 eo_do(obj,
418 evas_obj_type_set(MY_CLASS_NAME),
419 evas_obj_smart_callbacks_descriptions_set(_smart_callbacks, NULL));
393 420
394 return obj; 421 if (!elm_widget_sub_object_add(eo_parent_get(obj), obj))
422 ERR("could not add %p as sub object of %p", obj, eo_parent_get(obj));
395} 423}
396 424
397EAPI void 425EAPI void
@@ -399,7 +427,14 @@ elm_fileselector_entry_selected_set(Evas_Object *obj,
399 const char *path) 427 const char *path)
400{ 428{
401 ELM_FILESELECTOR_ENTRY_CHECK(obj); 429 ELM_FILESELECTOR_ENTRY_CHECK(obj);
402 ELM_FILESELECTOR_ENTRY_DATA_GET(obj, sd); 430 eo_do(obj, elm_obj_fileselector_entry_selected_set(path));
431}
432
433static void
434_selected_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
435{
436 const char *path = va_arg(*list, const char *);
437 Elm_Fileselector_Entry_Smart_Data *sd = _pd;
403 438
404 elm_fileselector_button_path_set(sd->button, path); 439 elm_fileselector_button_path_set(sd->button, path);
405} 440}
@@ -408,9 +443,18 @@ EAPI const char *
408elm_fileselector_entry_selected_get(const Evas_Object *obj) 443elm_fileselector_entry_selected_get(const Evas_Object *obj)
409{ 444{
410 ELM_FILESELECTOR_ENTRY_CHECK(obj) NULL; 445 ELM_FILESELECTOR_ENTRY_CHECK(obj) NULL;
411 ELM_FILESELECTOR_ENTRY_DATA_GET(obj, sd); 446 const char *ret = NULL;
447 eo_do((Eo *) obj, elm_obj_fileselector_entry_selected_get(&ret));
448 return ret;
449}
412 450
413 return elm_fileselector_button_path_get(sd->button); 451static void
452_selected_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
453{
454 const char **ret = va_arg(*list, const char **);
455 Elm_Fileselector_Entry_Smart_Data *sd = _pd;
456
457 *ret = elm_fileselector_button_path_get(sd->button);
414} 458}
415 459
416EAPI void 460EAPI void
@@ -418,7 +462,14 @@ elm_fileselector_entry_window_title_set(Evas_Object *obj,
418 const char *title) 462 const char *title)
419{ 463{
420 ELM_FILESELECTOR_ENTRY_CHECK(obj); 464 ELM_FILESELECTOR_ENTRY_CHECK(obj);
421 ELM_FILESELECTOR_ENTRY_DATA_GET(obj, sd); 465 eo_do(obj, elm_obj_fileselector_entry_window_title_set(title));
466}
467
468static void
469_window_title_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
470{
471 const char *title = va_arg(*list, const char *);
472 Elm_Fileselector_Entry_Smart_Data *sd = _pd;
422 473
423 elm_fileselector_button_window_title_set(sd->button, title); 474 elm_fileselector_button_window_title_set(sd->button, title);
424} 475}
@@ -427,9 +478,18 @@ EAPI const char *
427elm_fileselector_entry_window_title_get(const Evas_Object *obj) 478elm_fileselector_entry_window_title_get(const Evas_Object *obj)
428{ 479{
429 ELM_FILESELECTOR_ENTRY_CHECK(obj) NULL; 480 ELM_FILESELECTOR_ENTRY_CHECK(obj) NULL;
430 ELM_FILESELECTOR_ENTRY_DATA_GET(obj, sd); 481 const char *ret = NULL;
482 eo_do((Eo *) obj, elm_obj_fileselector_entry_window_title_get(&ret));
483 return ret;
484}
431 485
432 return elm_fileselector_button_window_title_get(sd->button); 486static void
487_window_title_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
488{
489 const char **ret = va_arg(*list, const char **);
490 Elm_Fileselector_Entry_Smart_Data *sd = _pd;
491
492 *ret = elm_fileselector_button_window_title_get(sd->button);
433} 493}
434 494
435EAPI void 495EAPI void
@@ -438,7 +498,15 @@ elm_fileselector_entry_window_size_set(Evas_Object *obj,
438 Evas_Coord height) 498 Evas_Coord height)
439{ 499{
440 ELM_FILESELECTOR_ENTRY_CHECK(obj); 500 ELM_FILESELECTOR_ENTRY_CHECK(obj);
441 ELM_FILESELECTOR_ENTRY_DATA_GET(obj, sd); 501 eo_do(obj, elm_obj_fileselector_entry_window_size_set(width, height));
502}
503
504static void
505_window_size_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
506{
507 Evas_Coord width = va_arg(*list, Evas_Coord);
508 Evas_Coord height = va_arg(*list, Evas_Coord);
509 Elm_Fileselector_Entry_Smart_Data *sd = _pd;
442 510
443 elm_fileselector_button_window_size_set(sd->button, width, height); 511 elm_fileselector_button_window_size_set(sd->button, width, height);
444} 512}
@@ -449,7 +517,15 @@ elm_fileselector_entry_window_size_get(const Evas_Object *obj,
449 Evas_Coord *height) 517 Evas_Coord *height)
450{ 518{
451 ELM_FILESELECTOR_ENTRY_CHECK(obj); 519 ELM_FILESELECTOR_ENTRY_CHECK(obj);
452 ELM_FILESELECTOR_ENTRY_DATA_GET(obj, sd); 520 eo_do((Eo *) obj, elm_obj_fileselector_entry_window_size_get(width, height));
521}
522
523static void
524_window_size_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
525{
526 Evas_Coord *width = va_arg(*list, Evas_Coord *);
527 Evas_Coord *height = va_arg(*list, Evas_Coord *);
528 Elm_Fileselector_Entry_Smart_Data *sd = _pd;
453 529