summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvi Levin <avi.levin@samsung.com>2015-05-10 17:49:01 +0300
committerAvi Levin <avi.levin@samsung.com>2015-06-29 17:03:33 +0300
commitff372b6ac8c07042ae312824059afc13cfcd40db (patch)
treea1137439e4ca9843f3679764313b00fa26cd568b
parentea22f23a476bd06478940d2a45854a090a38fe26 (diff)
downloadelementary-ff372b6ac8c07042ae312824059afc13cfcd40db.tar.gz
elc_fileselector, elc_fileselector_button: porting evas smart callbacks to eo
-rw-r--r--src/lib/elc_fileselector.c253
-rw-r--r--src/lib/elc_fileselector_button.c27
-rw-r--r--src/lib/elm_fileselector.eo5
-rw-r--r--src/lib/elm_fileselector_button.eo2
4 files changed, 174 insertions, 113 deletions
diff --git a/src/lib/elc_fileselector.c b/src/lib/elc_fileselector.c
index 32d3cffe3..70ceca0c9 100644
--- a/src/lib/elc_fileselector.c
+++ b/src/lib/elc_fileselector.c
@@ -58,8 +58,10 @@ static const Elm_Action key_actions[] = {
{NULL, NULL}
};
-static void _ok(void *data, Evas_Object *obj, void *event_info);
-static void _canc(void *data, Evas_Object *obj, void *event_info);
+static Eina_Bool _ok(void *data,
+ Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED);
+static Eina_Bool _canc(void *data,
+ Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED);
/* final routine on deletion */
static void
@@ -158,14 +160,14 @@ _elm_fileselector_elm_widget_theme_apply(Eo *obj, Elm_Fileselector_Data *sd)
static Eina_Bool
_key_action_select(Evas_Object *obj, const char *params EINA_UNUSED)
{
- _ok(obj, NULL, NULL);
+ _ok(obj, NULL, NULL, NULL);
return EINA_TRUE;
}
static Eina_Bool
_key_action_escape(Evas_Object *obj, const char *params EINA_UNUSED)
{
- _canc(obj, NULL, NULL);
+ _canc(obj, NULL, NULL, NULL);
return EINA_TRUE;
}
@@ -546,8 +548,8 @@ _signal_first(Listing_Request *lreq)
EINA_LIST_FREE(sd->paths, path) free(path);
}
- evas_object_smart_callback_call
- (lreq->obj, SIG_DIRECTORY_OPEN, (void *)lreq->path);
+ eo_do(lreq->obj, eo_event_callback_call
+ (ELM_FILESELECTOR_EVENT_DIRECTORY_OPEN, (void *)lreq->path));
if (!lreq->parent_it)
{
@@ -705,45 +707,49 @@ _populate(Evas_Object *obj,
}
-static void
+static Eina_Bool
_on_list_expanded(void *data,
- Evas_Object *obj EINA_UNUSED,
- void *event_info)
+ Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
{
Elm_Object_Item *it = event_info;
const char *path = elm_object_item_data_get(it);
_populate(data, path, it, NULL);
+
+ return EINA_TRUE;
}
-static void
-_on_list_contracted(void *data EINA_UNUSED,
- Evas_Object *obj EINA_UNUSED,
- void *event_info)
+static Eina_Bool
+_on_list_contracted(void *data EINA_UNUSED,
+ Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
{
Elm_Object_Item *it = event_info;
elm_genlist_item_subitems_clear(it);
+
+ return EINA_TRUE;
}
-static void
-_on_list_expand_req(void *data EINA_UNUSED,
- Evas_Object *obj EINA_UNUSED,
- void *event_info)
+static Eina_Bool
+_on_list_expand_req(void *data EINA_UNUSED,
+ Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
{
Elm_Object_Item *it = event_info;
elm_genlist_item_expanded_set(it, EINA_TRUE);
+
+ return EINA_TRUE;
}
-static void
-_on_list_contract_req(void *data EINA_UNUSED,
- Evas_Object *obj EINA_UNUSED,
- void *event_info)
+static Eina_Bool
+_on_list_contract_req(void *data EINA_UNUSED,
+ Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
{
Elm_Object_Item *it = event_info;
elm_genlist_item_expanded_set(it, EINA_FALSE);
+
+ return EINA_TRUE;
}
static Eina_Bool
@@ -787,10 +793,9 @@ _schedule_populate(Evas_Object *fs,
sd->populate_idler = ecore_idler_add(_populate_do, sdata);
}
-static void
+static Eina_Bool
_on_item_activated(void *data,
- Evas_Object *obj EINA_UNUSED,
- void *event_info)
+ Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
{
//This event_info could be a list or gengrid item
Elm_Object_Item *it = event_info;
@@ -800,18 +805,21 @@ _on_item_activated(void *data,
ELM_FILESELECTOR_DATA_GET(data, sd);
path = elm_object_item_data_get(it);
- if (!path) return;
+ if (!path) return EINA_TRUE;
is_dir = ecore_file_is_dir(path);
if (!is_dir)
{
- evas_object_smart_callback_call(data, SIG_ACTIVATED, (void *)path);
- return;
+ eo_do(data, eo_event_callback_call
+ (ELM_FILESELECTOR_EVENT_ACTIVATED, (void *)path));
+ return EINA_TRUE;
}
- if (!sd->double_tap_navigation) return;
+ if (!sd->double_tap_navigation) return EINA_TRUE;
_schedule_populate(data, sd, eina_stringshare_add(path), NULL);
+
+ return EINA_TRUE;
}
static void
@@ -842,10 +850,9 @@ _clear_selections(Elm_Fileselector_Data *sd, Elm_Object_Item *last_selected)
}
}
-static void
+static Eina_Bool
_on_item_selected(void *data,
- Evas_Object *obj EINA_UNUSED,
- void *event_info)
+ Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
{
//This event_info could be a list or gengrid item
Elm_Object_Item *it = event_info;
@@ -856,7 +863,7 @@ _on_item_selected(void *data,
ELM_FILESELECTOR_DATA_GET(data, sd);
path = elm_object_item_data_get(it);
- if (!path) return;
+ if (!path) return EINA_TRUE;
is_dir = ecore_file_is_dir(path);
@@ -893,7 +900,8 @@ _on_item_selected(void *data,
else
elm_object_text_set(sd->name_entry, ecore_file_file_get(path));
- evas_object_smart_callback_call(data, SIG_SELECTED, (void *)path);
+ eo_do(data, eo_event_callback_call
+ (ELM_FILESELECTOR_EVENT_SELECTED, (void *)path));
}
else if (sd->multi && is_dir && sd->double_tap_navigation)
{
@@ -905,7 +913,7 @@ _on_item_selected(void *data,
* - mode is GRID;
* - mode is LIST and 'not expand mode';
* in other cases update anchors. */
- if (!is_dir) return;
+ if (!is_dir) return EINA_TRUE;
if (sd->expand && sd->mode == ELM_FILESELECTOR_LIST)
{
@@ -921,18 +929,19 @@ _on_item_selected(void *data,
eina_stringshare_replace(&sd->path, path);
_anchors_do(data, path);
}
- return;
+ return EINA_TRUE;
}
- if (sd->double_tap_navigation) return;
+ if (sd->double_tap_navigation) return EINA_TRUE;
_schedule_populate(data, sd, eina_stringshare_add(path), NULL);
+
+ return EINA_TRUE;
}
-static void
+static Eina_Bool
_on_item_unselected(void *data,
- Evas_Object *obj EINA_UNUSED,
- void *event_info)
+ Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
{
Eina_List *li, *l;
char *path;
@@ -943,10 +952,10 @@ _on_item_unselected(void *data,
ELM_FILESELECTOR_DATA_GET(data, sd);
- if (!sd->multi) return;
+ if (!sd->multi) return EINA_TRUE;
unselected_path = elm_object_item_data_get(it);
- if (!unselected_path) return;
+ if (!unselected_path) return EINA_TRUE;
buf = eina_strbuf_new();
EINA_LIST_FOREACH_SAFE(sd->paths, li, l, path)
@@ -969,12 +978,13 @@ _on_item_unselected(void *data,
elm_object_text_set(sd->name_entry, eina_strbuf_string_get(buf));
eina_strbuf_free(buf);
+
+ return EINA_TRUE;
}
-static void
+static Eina_Bool
_on_dir_up(void *data,
- Evas_Object *obj EINA_UNUSED,
- void *event_info EINA_UNUSED)
+ Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
{
Evas_Object *fs = data;
char *parent;
@@ -984,12 +994,13 @@ _on_dir_up(void *data,
parent = ecore_file_dir_get(sd->path);
_populate(fs, parent, NULL, NULL);
free(parent);
+
+ return EINA_TRUE;
}
-static void
+static Eina_Bool
_home(void *data,
- Evas_Object *obj EINA_UNUSED,
- void *event_info EINA_UNUSED)
+ Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
{
Evas_Object *fs = data;
const char * path = NULL;
@@ -1002,6 +1013,8 @@ _home(void *data,
_populate(fs, path, NULL, NULL);
+
+ return EINA_TRUE;
}
static void
@@ -1019,10 +1032,9 @@ _current_filter_changed(void *data,
_populate(filter->sd->obj, filter->sd->path, NULL, NULL);
}
-static void
+static Eina_Bool
_ok(void *data,
- Evas_Object *obj EINA_UNUSED,
- void *event_info EINA_UNUSED)
+ Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
{
const char *name;
const char *selection = NULL;
@@ -1031,8 +1043,8 @@ _ok(void *data,
if (!sd->path)
{
- evas_object_smart_callback_call(fs, SIG_DONE, NULL);
- return;
+ eo_do(fs, eo_event_callback_call(ELM_FILESELECTOR_EVENT_DONE, NULL));
+ return EINA_TRUE;
}
name = elm_object_text_get(sd->name_entry);
@@ -1047,24 +1059,27 @@ _ok(void *data,
else
selection = eina_stringshare_add(elm_fileselector_selected_get(fs));
- evas_object_smart_callback_call(fs, SIG_DONE, (void *)selection);
+ eo_do(fs, eo_event_callback_call
+ (ELM_FILESELECTOR_EVENT_DONE, (void *)selection));
eina_stringshare_del(selection);
+
+ return EINA_TRUE;
}
-static void
+static Eina_Bool
_canc(void *data,
- Evas_Object *obj EINA_UNUSED,
- void *event_info EINA_UNUSED)
+ Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
{
Evas_Object *fs = data;
- evas_object_smart_callback_call(fs, SIG_DONE, NULL);
+ eo_do(fs, eo_event_callback_call(ELM_FILESELECTOR_EVENT_DONE, NULL));
+
+ return EINA_TRUE;
}
-static void
+static Eina_Bool
_on_text_activated(void *data,
- Evas_Object *obj,
- void *event_info EINA_UNUSED)
+ Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
{
Evas_Object *fs = data;
const char *p, *path;
@@ -1076,8 +1091,10 @@ _on_text_activated(void *data,
if (!ecore_file_exists(path))
{
- evas_object_smart_callback_call(fs, SIG_SELECTED, (void *)path);
- evas_object_smart_callback_call(fs, SIG_SELECTED_INVALID, (void *)path);
+ eo_do(fs, eo_event_callback_call
+ (ELM_FILESELECTOR_EVENT_SELECTED, (void *)path));
+ eo_do(fs, eo_event_callback_call
+ (ELM_FILESELECTOR_EVENT_SELECTED_INVALID, (void *)path));
goto end;
}
@@ -1089,7 +1106,8 @@ _on_text_activated(void *data,
eina_stringshare_del(p);
if (sd->only_folder)
- evas_object_smart_callback_call(fs, SIG_SELECTED, (void *)path);
+ eo_do(fs, eo_event_callback_call
+ (ELM_FILESELECTOR_EVENT_SELECTED, (void *)path));
goto end;
}
@@ -1102,7 +1120,8 @@ _on_text_activated(void *data,
_populate(fs, dir, NULL, path);
if (sd->only_folder)
- evas_object_smart_callback_call(fs, SIG_SELECTED, (void *)path);
+ eo_do(fs, eo_event_callback_call
+ (ELM_FILESELECTOR_EVENT_SELECTED, (void *)path));
}
else
{
@@ -1143,6 +1162,8 @@ _on_text_activated(void *data,
end:
elm_object_focus_set(obj, EINA_FALSE);
+
+ return EINA_TRUE;
}
static Eina_Bool
@@ -1158,29 +1179,31 @@ _anchors_undo(void *data)
return ECORE_CALLBACK_CANCEL;
}
-static void
+static Eina_Bool
_on_text_focused(void *data,
- Evas_Object *obj EINA_UNUSED,
- void *event_info EINA_UNUSED)
+ Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
{
ELM_FILESELECTOR_DATA_GET(data, sd);
if (!sd->path_entry_idler)
sd->path_entry_idler = ecore_idler_add(_anchors_undo, data);
+
+ return EINA_TRUE;
}
-static void
+
+static Eina_Bool
_on_text_unfocused(void *data,
- Evas_Object *obj EINA_UNUSED,
- void *event_info EINA_UNUSED)
+ Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
{
ELM_FILESELECTOR_DATA_GET(data, sd);
_anchors_do(data, sd->path);
+
+ return EINA_TRUE;
}
-static void
+static Eina_Bool
_anchor_clicked(void *data,
- Evas_Object *obj EINA_UNUSED,
- void *event_info)
+ Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
{
Elm_Entry_Anchor_Info *info = event_info;
Evas_Object *fs = data;
@@ -1200,10 +1223,13 @@ _anchor_clicked(void *data,
ecore_idler_del(sd->path_entry_idler);
sd->path_entry_idler = NULL;
}
+
+ return EINA_TRUE;
}
-static void
-_files_key_down(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info)
+static Eina_Bool
+_files_key_down(void *data,
+ Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
{
Evas_Event_Key_Down *ev = event_info;
Evas_Object *par, *searchbar;
@@ -1211,7 +1237,7 @@ _files_key_down(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, v
par = data;
searchbar = evas_object_data_get(par, "search");
- if (!searchbar) return;
+ if (!searchbar) return EINA_TRUE;
if (((ev->string) && *(ev->string) &&
(isalpha(*ev->string) ||
@@ -1234,6 +1260,8 @@ _files_key_down(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, v
elm_entry_entry_set(searchbar, buf);
}
}
+
+ return EINA_TRUE;
}
static Evas_Object *
@@ -1248,16 +1276,22 @@ _files_list_add(Evas_Object *obj)
evas_object_size_hint_weight_set(li, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_min_set(li, 100, 100);
- evas_object_smart_callback_add(li, "selected", _on_item_selected, obj);
- evas_object_smart_callback_add(li, "unselected", _on_item_unselected, obj);
- evas_object_smart_callback_add(li, "activated", _on_item_activated, obj);
- evas_object_smart_callback_add
- (li, "expand,request", _on_list_expand_req, obj);
- evas_object_smart_callback_add
- (li, "contract,request", _on_list_contract_req, obj);
- evas_object_smart_callback_add(li, "expanded", _on_list_expanded, obj);
- evas_object_smart_callback_add(li, "contracted", _on_list_contracted, obj);
- evas_object_event_callback_add(li, EVAS_CALLBACK_KEY_DOWN, _files_key_down, obj);
+ eo_do(li, eo_event_callback_add
+ (EVAS_SELECTABLE_INTERFACE_EVENT_SELECTED, _on_item_selected, obj));
+ eo_do(li, eo_event_callback_add
+ (EVAS_SELECTABLE_INTERFACE_EVENT_UNSELECTED, _on_item_unselected, obj));
+ eo_do(li, eo_event_callback_add
+ (ELM_GENLIST_EVENT_ACTIVATED, _on_item_activated, obj));
+ eo_do(li, eo_event_callback_add
+ (ELM_GENLIST_EVENT_EXPAND_REQUEST, _on_list_expand_req, obj));
+ eo_do(li, eo_event_callback_add
+ (ELM_GENLIST_EVENT_CONTRACT_REQUEST, _on_list_contract_req, obj));
+ eo_do(li, eo_event_callback_add
+ (ELM_GENLIST_EVENT_EXPANDED, _on_list_expanded, obj));
+ eo_do(li, eo_event_callback_add
+ (ELM_GENLIST_EVENT_CONTRACTED, _on_list_contracted, obj));
+ eo_do(li, eo_event_callback_add
+ (EVAS_OBJECT_EVENT_KEY_DOWN, _files_key_down, obj));
elm_widget_sub_object_add(obj, li);
@@ -1281,10 +1315,14 @@ _files_grid_add(Evas_Object *obj)
elm_gengrid_align_set(grid, 0.0, 0.0);
- evas_object_smart_callback_add(grid, "selected", _on_item_selected, obj);
- evas_object_smart_callback_add(grid, "unselected", _on_item_unselected, obj);
- evas_object_smart_callback_add(grid, "activated", _on_item_activated, obj);
- evas_object_event_callback_add(grid, EVAS_CALLBACK_KEY_DOWN, _files_key_down, obj);
+ eo_do(grid, eo_event_callback_add
+ (ELM_GENGRID_EVENT_SELECTED, _on_item_selected, obj));
+ eo_do(grid, eo_event_callback_add
+ (ELM_GENGRID_EVENT_UNSELECTED, _on_item_unselected, obj));
+ eo_do(grid, eo_event_callback_add
+ (ELM_GENGRID_EVENT_ACTIVATED, _on_item_activated, obj));
+ eo_do(grid, eo_event_callback_add
+ (EVAS_OBJECT_EVENT_KEY_DOWN, _files_key_down, obj));
elm_widget_sub_object_add(obj, grid);
@@ -1422,8 +1460,9 @@ _resource_deleted(void *data, int type EINA_UNUSED, void *ev)
return ECORE_CALLBACK_PASS_ON;
}
-static void _preedit_cb(void *data, Evas_Object *obj,
- void *event_info EINA_UNUSED)
+static Eina_Bool
+_preedit_cb(void *data,
+ Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
{
ELM_FILESELECTOR_DATA_GET(data, sd);
@@ -1431,6 +1470,8 @@ static void _preedit_cb(void *data, Evas_Object *obj,
if (sd->search_string && sd->path)
_populate(data, sd->path, NULL, NULL);
+
+ return EINA_TRUE;
}
EOLIAN static void
@@ -1460,7 +1501,8 @@ _elm_fileselector_evas_object_smart_add(Eo *obj, Elm_Fileselector_Data *priv)
elm_object_part_content_set(bt, "icon", ic);
elm_object_domain_translatable_text_set(bt, PACKAGE, N_("Up"));
evas_object_size_hint_align_set(bt, 0.0, 0.0);
- evas_object_smart_callback_add(bt, "clicked", _on_dir_up, obj);
+ eo_do(bt, eo_event_callback_add
+ (EVAS_CLICKABLE_INTERFACE_EVENT_CLICKED, _on_dir_up, obj));
elm_widget_sub_object_add(obj, bt);
@@ -1475,9 +1517,9 @@ _elm_fileselector_evas_object_smart_add(Eo *obj, Elm_Fileselector_Data *priv)
elm_object_part_content_set(bt, "icon", ic);
elm_object_domain_translatable_text_set(bt, PACKAGE, N_("Home"));
evas_object_size_hint_align_set(bt, 0.0, 0.0);
- evas_object_smart_callback_add(bt, "clicked", _home, obj);
+ eo_do(bt, eo_event_callback_add
+ (EVAS_CLICKABLE_INTERFACE_EVENT_CLICKED, _home, obj));
- elm_widget_sub_object_add(obj, bt);
priv->home_button = bt;
// spinner
@@ -1504,10 +1546,14 @@ _elm_fileselector_evas_object_smart_add(Eo *obj, Elm_Fileselector_Data *priv)
evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(en, EVAS_HINT_FILL, EVAS_HINT_FILL);
- evas_object_smart_callback_add(en, "anchor,clicked", _anchor_clicked, obj);
- evas_object_smart_callback_add(en, "focused", _on_text_focused, obj);
- evas_object_smart_callback_add(en, "unfocused", _on_text_unfocused, obj);
- evas_object_smart_callback_add(en, "activated", _on_text_activated, obj);
+ eo_do(en, eo_event_callback_add
+ (ELM_ENTRY_EVENT_ANCHOR_CLICKED, _anchor_clicked, obj));
+ eo_do(en, eo_event_callback_add
+ (ELM_LAYOUT_EVENT_FOCUSED, _on_text_focused, obj));
+ eo_do(en, eo_event_callback_add
+ (ELM_LAYOUT_EVENT_UNFOCUSED, _on_text_unfocused, obj));
+ eo_do(en, eo_event_callback_add
+ (ELM_ENTRY_EVENT_ACTIVATED, _on_text_activated, obj));
elm_widget_sub_object_add(obj, en);
priv->path_entry = en;
@@ -1541,7 +1587,8 @@ _elm_fileselector_evas_object_smart_add(Eo *obj, Elm_Fileselector_Data *priv)
elm_entry_icon_visible_set(en, EINA_TRUE);
evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(en, EVAS_HINT_FILL, EVAS_HINT_FILL);
- evas_object_smart_callback_add(en, "changed", _preedit_cb, obj);
+ eo_do(en, eo_event_callback_add
+ (ELM_ENTRY_EVENT_CHANGED, _preedit_cb, obj));
evas_object_data_set(obj, "search", en);
elm_widget_sub_object_add(obj, en);
@@ -1706,7 +1753,8 @@ _elm_fileselector_buttons_ok_cancel_set(Eo *obj, Elm_Fileselector_Data *sd, Eina
elm_widget_mirrored_automatic_set(bt, EINA_FALSE);
elm_object_domain_translatable_text_set(bt, PACKAGE, N_("Cancel"));
- evas_object_smart_callback_add(bt, "clicked", _canc, obj);
+ eo_do(bt, eo_event_callback_add
+ (EVAS_CLICKABLE_INTERFACE_EVENT_CLICKED, _canc, obj));
sd->cancel_button = bt;
@@ -1715,7 +1763,8 @@ _elm_fileselector_buttons_ok_cancel_set(Eo *obj, Elm_Fileselector_Data *sd, Eina
elm_widget_mirrored_automatic_set(bt, EINA_FALSE);
elm_object_domain_translatable_text_set(bt, PACKAGE, N_("OK"));
- evas_object_smart_callback_add(bt, "clicked", _ok, obj);
+ eo_do(bt, eo_event_callback_add
+ (EVAS_CLICKABLE_INTERFACE_EVENT_CLICKED, _ok, obj));
sd->ok_button = bt;
diff --git a/src/lib/elc_fileselector_button.c b/src/lib/elc_fileselector_button.c
index b62b684cb..86569afbc 100644
--- a/src/lib/elc_fileselector_button.c
+++ b/src/lib/elc_fileselector_button.c
@@ -61,10 +61,9 @@ _elm_fileselector_button_elm_widget_theme_apply(Eo *obj, Elm_Fileselector_Button
return EINA_TRUE;
}
-static void
+static Eina_Bool
_selection_done(void *data,
- Evas_Object *obj EINA_UNUSED,
- void *event_info)
+ Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
{
Elm_Fileselector_Button_Data *sd = data;
const char *file = event_info;
@@ -77,8 +76,10 @@ _selection_done(void *data,
sd->fsw = NULL;
evas_object_del(del);
- evas_object_smart_callback_call
- (sd->obj, SIG_FILE_CHOSEN, (void *)file);
+ eo_do(sd->obj, eo_event_callback_call
+ (ELM_FILESELECTOR_BUTTON_EVENT_FILE_CHOSEN, (void *)file));
+
+ return EINA_TRUE;
}
static Evas_Object *
@@ -89,7 +90,8 @@ _new_window_add(Elm_Fileselector_Button_Data *sd)
win = elm_win_add(NULL, "fileselector_button", ELM_WIN_DIALOG_BASIC);
elm_win_title_set(win, sd->window_title);
elm_win_autodel_set(win, EINA_TRUE);
- evas_object_smart_callback_add(win, "delete,request", _selection_done, sd);
+ eo_do(win, eo_event_callback_add
+ (ELM_WIN_EVENT_DELETE_REQUEST, _selection_done, sd));
bg = elm_bg_add(win);
evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
@@ -142,7 +144,8 @@ _activate(Elm_Fileselector_Button_Data *sd)
evas_object_size_hint_weight_set
(sd->fs, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(sd->fs, EVAS_HINT_FILL, EVAS_HINT_FILL);
- evas_object_smart_callback_add(sd->fs, "done", _selection_done, sd);
+ eo_do(sd->fs, eo_event_callback_add
+ (ELM_FILESELECTOR_EVENT_DONE, _selection_done, sd));
evas_object_show(sd->fs);
if (is_inwin)
@@ -157,12 +160,13 @@ _activate(Elm_Fileselector_Button_Data *sd)
}
}
-static void
+static Eina_Bool
_button_clicked(void *data,
- Evas_Object *obj EINA_UNUSED,
- void *event_info EINA_UNUSED)
+ Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
{
_activate(data);
+
+ return EINA_TRUE;
}
EOLIAN static void
@@ -182,7 +186,8 @@ _elm_fileselector_button_evas_object_smart_add(Eo *obj, Elm_Fileselector_Button_
elm_widget_mirrored_automatic_set(obj, EINA_FALSE);
- evas_object_smart_callback_add(obj, "clicked", _button_clicked, priv);
+ eo_do(obj, eo_event_callback_add
+ (ELM_FILESELECTOR_BUTTON_EVENT_CLICKED, _button_clicked, priv));
eo_do(obj, elm_obj_widget_theme_apply());
elm_widget_can_focus_set(obj, EINA_TRUE);
diff --git a/src/lib/elm_fileselector.eo b/src/lib/elm_fileselector.eo
index 616a9cd73..6fb8fd799 100644
--- a/src/lib/elm_fileselector.eo
+++ b/src/lib/elm_fileselector.eo
@@ -68,6 +68,11 @@ class Elm.Fileselector (Elm.Layout, Elm_Interface_Fileselector,
events {
focused;
unfocused;
+ done;
+ activated;
+ selected;
+ selected,invalid;
+ directory,open;
}
}
diff --git a/src/lib/elm_fileselector_button.eo b/src/lib/elm_fileselector_button.eo
index 49ff20c98..865b4393a 100644
--- a/src/lib/elm_fileselector_button.eo
+++ b/src/lib/elm_fileselector_button.eo
@@ -119,6 +119,8 @@ class Elm.Fileselector_Button (Elm.Button, Elm_Interface_Fileselector)
access,changed;
focused;
unfocused;
+ clicked;
+ file,chosen;
}
}