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)
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[] = {
58 {NULL, NULL} 58 {NULL, NULL}
59}; 59};
60 60
61static void _ok(void *data, Evas_Object *obj, void *event_info); 61static Eina_Bool _ok(void *data,
62static void _canc(void *data, Evas_Object *obj, void *event_info); 62 Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED);
63static Eina_Bool _canc(void *data,
64 Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED);
63 65
64/* final routine on deletion */ 66/* final routine on deletion */
65static void 67static void
@@ -158,14 +160,14 @@ _elm_fileselector_elm_widget_theme_apply(Eo *obj, Elm_Fileselector_Data *sd)
158static Eina_Bool 160static Eina_Bool
159_key_action_select(Evas_Object *obj, const char *params EINA_UNUSED) 161_key_action_select(Evas_Object *obj, const char *params EINA_UNUSED)
160{ 162{
161 _ok(obj, NULL, NULL); 163 _ok(obj, NULL, NULL, NULL);
162 return EINA_TRUE; 164 return EINA_TRUE;
163} 165}
164 166
165static Eina_Bool 167static Eina_Bool
166_key_action_escape(Evas_Object *obj, const char *params EINA_UNUSED) 168_key_action_escape(Evas_Object *obj, const char *params EINA_UNUSED)
167{ 169{
168 _canc(obj, NULL, NULL); 170 _canc(obj, NULL, NULL, NULL);
169 return EINA_TRUE; 171 return EINA_TRUE;
170} 172}
171 173
@@ -546,8 +548,8 @@ _signal_first(Listing_Request *lreq)
546 EINA_LIST_FREE(sd->paths, path) free(path); 548 EINA_LIST_FREE(sd->paths, path) free(path);
547 } 549 }
548 550
549 evas_object_smart_callback_call 551 eo_do(lreq->obj, eo_event_callback_call
550 (lreq->obj, SIG_DIRECTORY_OPEN, (void *)lreq->path); 552 (ELM_FILESELECTOR_EVENT_DIRECTORY_OPEN, (void *)lreq->path));
551 553
552 if (!lreq->parent_it) 554 if (!lreq->parent_it)
553 { 555 {
@@ -705,45 +707,49 @@ _populate(Evas_Object *obj,
705 707
706} 708}
707 709
708static void 710static Eina_Bool
709_on_list_expanded(void *data, 711_on_list_expanded(void *data,
710 Evas_Object *obj EINA_UNUSED, 712 Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
711 void *event_info)
712{ 713{
713 Elm_Object_Item *it = event_info; 714 Elm_Object_Item *it = event_info;
714 const char *path = elm_object_item_data_get(it); 715 const char *path = elm_object_item_data_get(it);
715 716
716 _populate(data, path, it, NULL); 717 _populate(data, path, it, NULL);
718
719 return EINA_TRUE;
717} 720}
718 721
719static void 722static Eina_Bool
720_on_list_contracted(void *data EINA_UNUSED, 723_on_list_contracted(void *data EINA_UNUSED,
721 Evas_Object *obj EINA_UNUSED, 724 Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
722 void *event_info)
723{ 725{
724 Elm_Object_Item *it = event_info; 726 Elm_Object_Item *it = event_info;
725 727
726 elm_genlist_item_subitems_clear(it); 728 elm_genlist_item_subitems_clear(it);
729
730 return EINA_TRUE;
727} 731}
728 732
729static void 733static Eina_Bool
730_on_list_expand_req(void *data EINA_UNUSED, 734_on_list_expand_req(void *data EINA_UNUSED,
731 Evas_Object *obj EINA_UNUSED, 735 Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
732 void *event_info)
733{ 736{
734 Elm_Object_Item *it = event_info; 737 Elm_Object_Item *it = event_info;
735 738
736 elm_genlist_item_expanded_set(it, EINA_TRUE); 739 elm_genlist_item_expanded_set(it, EINA_TRUE);
740
741 return EINA_TRUE;
737} 742}
738 743
739static void 744static Eina_Bool
740_on_list_contract_req(void *data EINA_UNUSED, 745_on_list_contract_req(void *data EINA_UNUSED,
741 Evas_Object *obj EINA_UNUSED, 746 Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
742 void *event_info)
743{ 747{
744 Elm_Object_Item *it = event_info; 748 Elm_Object_Item *it = event_info;
745 749
746 elm_genlist_item_expanded_set(it, EINA_FALSE); 750 elm_genlist_item_expanded_set(it, EINA_FALSE);
751
752 return EINA_TRUE;
747} 753}
748 754
749static Eina_Bool 755static Eina_Bool
@@ -787,10 +793,9 @@ _schedule_populate(Evas_Object *fs,
787 sd->populate_idler = ecore_idler_add(_populate_do, sdata); 793 sd->populate_idler = ecore_idler_add(_populate_do, sdata);
788} 794}
789 795
790static void 796static Eina_Bool
791_on_item_activated(void *data, 797_on_item_activated(void *data,
792 Evas_Object *obj EINA_UNUSED, 798 Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
793 void *event_info)
794{ 799{
795 //This event_info could be a list or gengrid item 800 //This event_info could be a list or gengrid item
796 Elm_Object_Item *it = event_info; 801 Elm_Object_Item *it = event_info;
@@ -800,18 +805,21 @@ _on_item_activated(void *data,
800 ELM_FILESELECTOR_DATA_GET(data, sd); 805 ELM_FILESELECTOR_DATA_GET(data, sd);
801 806
802 path = elm_object_item_data_get(it); 807 path = elm_object_item_data_get(it);
803 if (!path) return; 808 if (!path) return EINA_TRUE;
804 809
805 is_dir = ecore_file_is_dir(path); 810 is_dir = ecore_file_is_dir(path);
806 if (!is_dir) 811 if (!is_dir)
807 { 812 {
808 evas_object_smart_callback_call(data, SIG_ACTIVATED, (void *)path); 813 eo_do(data, eo_event_callback_call
809 return; 814 (ELM_FILESELECTOR_EVENT_ACTIVATED, (void *)path));
815 return EINA_TRUE;
810 } 816 }
811 817
812 if (!sd->double_tap_navigation) return; 818 if (!sd->double_tap_navigation) return EINA_TRUE;
813 819
814 _schedule_populate(data, sd, eina_stringshare_add(path), NULL); 820 _schedule_populate(data, sd, eina_stringshare_add(path), NULL);
821
822 return EINA_TRUE;
815} 823}
816 824
817static void 825static void
@@ -842,10 +850,9 @@ _clear_selections(Elm_Fileselector_Data *sd, Elm_Object_Item *last_selected)
842 } 850 }
843} 851}
844 852
845static void 853static Eina_Bool
846_on_item_selected(void *data, 854_on_item_selected(void *data,
847 Evas_Object *obj EINA_UNUSED, 855 Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
848 void *event_info)
849{ 856{
850 //This event_info could be a list or gengrid item 857 //This event_info could be a list or gengrid item
851 Elm_Object_Item *it = event_info; 858 Elm_Object_Item *it = event_info;
@@ -856,7 +863,7 @@ _on_item_selected(void *data,
856 ELM_FILESELECTOR_DATA_GET(data, sd); 863 ELM_FILESELECTOR_DATA_GET(data, sd);
857 864
858 path = elm_object_item_data_get(it); 865 path = elm_object_item_data_get(it);
859 if (!path) return; 866 if (!path) return EINA_TRUE;
860 867
861 is_dir = ecore_file_is_dir(path); 868 is_dir = ecore_file_is_dir(path);
862 869
@@ -893,7 +900,8 @@ _on_item_selected(void *data,
893 else 900 else
894 elm_object_text_set(sd->name_entry, ecore_file_file_get(path)); 901 elm_object_text_set(sd->name_entry, ecore_file_file_get(path));
895 902
896 evas_object_smart_callback_call(data, SIG_SELECTED, (void *)path); 903 eo_do(data, eo_event_callback_call
904 (ELM_FILESELECTOR_EVENT_SELECTED, (void *)path));
897 } 905 }
898 else if (sd->multi && is_dir && sd->double_tap_navigation) 906 else if (sd->multi && is_dir && sd->double_tap_navigation)
899 { 907 {
@@ -905,7 +913,7 @@ _on_item_selected(void *data,
905 * - mode is GRID; 913 * - mode is GRID;
906 * - mode is LIST and 'not expand mode'; 914 * - mode is LIST and 'not expand mode';
907 * in other cases update anchors. */ 915 * in other cases update anchors. */
908 if (!is_dir) return; 916 if (!is_dir) return EINA_TRUE;
909 917
910 if (sd->expand && sd->mode == ELM_FILESELECTOR_LIST) 918 if (sd->expand && sd->mode == ELM_FILESELECTOR_LIST)
911 { 919 {
@@ -921,18 +929,19 @@ _on_item_selected(void *data,
921 eina_stringshare_replace(&sd->path, path); 929 eina_stringshare_replace(&sd->path, path);
922 _anchors_do(data, path); 930 _anchors_do(data, path);
923 } 931 }
924 return; 932 return EINA_TRUE;
925 } 933 }
926 934
927 if (sd->double_tap_navigation) return; 935 if (sd->double_tap_navigation) return EINA_TRUE;
928 936
929 _schedule_populate(data, sd, eina_stringshare_add(path), NULL); 937 _schedule_populate(data, sd, eina_stringshare_add(path), NULL);
938
939 return EINA_TRUE;
930} 940}
931 941
932static void 942static Eina_Bool
933_on_item_unselected(void *data, 943_on_item_unselected(void *data,
934 Evas_Object *obj EINA_UNUSED, 944 Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
935 void *event_info)
936{ 945{
937 Eina_List *li, *l; 946 Eina_List *li, *l;
938 char *path; 947 char *path;
@@ -943,10 +952,10 @@ _on_item_unselected(void *data,
943 952
944 ELM_FILESELECTOR_DATA_GET(data, sd); 953 ELM_FILESELECTOR_DATA_GET(data, sd);
945 954
946 if (!sd->multi) return; 955 if (!sd->multi) return EINA_TRUE;
947 956
948 unselected_path = elm_object_item_data_get(it); 957 unselected_path = elm_object_item_data_get(it);
949 if (!unselected_path) return; 958 if (!unselected_path) return EINA_TRUE;
950 959
951 buf = eina_strbuf_new(); 960 buf = eina_strbuf_new();
952 EINA_LIST_FOREACH_SAFE(sd->paths, li, l, path) 961 EINA_LIST_FOREACH_SAFE(sd->paths, li, l, path)
@@ -969,12 +978,13 @@ _on_item_unselected(void *data,
969 978
970 elm_object_text_set(sd->name_entry, eina_strbuf_string_get(buf)); 979 elm_object_text_set(sd->name_entry, eina_strbuf_string_get(buf));
971 eina_strbuf_free(buf); 980 eina_strbuf_free(buf);
981
982 return EINA_TRUE;
972} 983}
973 984
974static void 985static Eina_Bool
975_on_dir_up(void *data, 986_on_dir_up(void *data,
976 Evas_Object *obj EINA_UNUSED, 987 Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
977 void *event_info EINA_UNUSED)
978{ 988{
979 Evas_Object *fs = data; 989 Evas_Object *fs = data;
980 char *parent; 990 char *parent;
@@ -984,12 +994,13 @@ _on_dir_up(void *data,
984 parent = ecore_file_dir_get(sd->path); 994 parent = ecore_file_dir_get(sd->path);
985 _populate(fs, parent, NULL, NULL); 995 _populate(fs, parent, NULL, NULL);
986 free(parent); 996 free(parent);
997
998 return EINA_TRUE;
987} 999}
988 1000
989static void 1001static Eina_Bool
990_home(void *data, 1002_home(void *data,
991 Evas_Object *obj EINA_UNUSED, 1003 Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
992 void *event_info EINA_UNUSED)
993{ 1004{
994 Evas_Object *fs = data; 1005 Evas_Object *fs = data;
995 const char * path = NULL; 1006 const char * path = NULL;
@@ -1002,6 +1013,8 @@ _home(void *data,
1002 1013
1003 1014
1004 _populate(fs, path, NULL, NULL); 1015 _populate(fs, path, NULL, NULL);
1016
1017 return EINA_TRUE;
1005} 1018}
1006 1019
1007static void 1020static void
@@ -1019,10 +1032,9 @@ _current_filter_changed(void *data,
1019 _populate(filter->sd->obj, filter->sd->path, NULL, NULL); 1032 _populate(filter->sd->obj, filter->sd->path, NULL, NULL);
1020} 1033}
1021 1034
1022static void 1035static Eina_Bool
1023_ok(void *data, 1036_ok(void *data,
1024 Evas_Object *obj EINA_UNUSED, 1037 Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
1025 void *event_info EINA_UNUSED)
1026{ 1038{
1027 const char *name; 1039 const char *name;
1028 const char *selection = NULL; 1040 const char *selection = NULL;
@@ -1031,8 +1043,8 @@ _ok(void *data,
1031 1043
1032 if (!sd->path) 1044 if (!sd->path)
1033 { 1045 {
1034 evas_object_smart_callback_call(fs, SIG_DONE, NULL); 1046 eo_do(fs, eo_event_callback_call(ELM_FILESELECTOR_EVENT_DONE, NULL));
1035 return; 1047 return EINA_TRUE;
1036 } 1048 }
1037 1049
1038 name = elm_object_text_get(sd->name_entry); 1050 name = elm_object_text_get(sd->name_entry);
@@ -1047,24 +1059,27 @@ _ok(void *data,
1047 else 1059 else
1048 selection = eina_stringshare_add(elm_fileselector_selected_get(fs)); 1060 selection = eina_stringshare_add(elm_fileselector_selected_get(fs));
1049 1061
1050 evas_object_smart_callback_call(fs, SIG_DONE, (void *)selection); 1062 eo_do(fs, eo_event_callback_call
1063 (ELM_FILESELECTOR_EVENT_DONE, (void *)selection));
1051 eina_stringshare_del(selection); 1064 eina_stringshare_del(selection);
1065
1066 return EINA_TRUE;
1052} 1067}
1053 1068
1054static void 1069static Eina_Bool
1055_canc(void *data, 1070_canc(void *data,
1056 Evas_Object *obj EINA_UNUSED, 1071 Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
1057 void *event_info EINA_UNUSED)
1058{ 1072{
1059 Evas_Object *fs = data; 1073 Evas_Object *fs = data;
1060 1074
1061 evas_object_smart_callback_call(fs, SIG_DONE, NULL); 1075 eo_do(fs, eo_event_callback_call(ELM_FILESELECTOR_EVENT_DONE, NULL));
1076
1077 return EINA_TRUE;
1062} 1078}
1063 1079
1064static void 1080static Eina_Bool
1065_on_text_activated(void *data, 1081_on_text_activated(void *data,
1066 Evas_Object *obj, 1082 Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
1067 void *event_info EINA_UNUSED)
1068{ 1083{
1069 Evas_Object *fs = data; 1084 Evas_Object *fs = data;
1070 const char *p, *path; 1085 const char *p, *path;
@@ -1076,8 +1091,10 @@ _on_text_activated(void *data,
1076 1091
1077 if (!ecore_file_exists(path)) 1092 if (!ecore_file_exists(path))
1078 { 1093 {
1079 evas_object_smart_callback_call(fs, SIG_SELECTED, (void *)path); 1094 eo_do(fs, eo_event_callback_call
1080 evas_object_smart_callback_call(fs, SIG_SELECTED_INVALID, (void *)path); 1095 (ELM_FILESELECTOR_EVENT_SELECTED, (void *)path));
1096 eo_do(fs, eo_event_callback_call
1097 (ELM_FILESELECTOR_EVENT_SELECTED_INVALID, (void *)path));
1081 goto end; 1098 goto end;
1082 } 1099 }
1083 1100
@@ -1089,7 +1106,8 @@ _on_text_activated(void *data,
1089 eina_stringshare_del(p); 1106 eina_stringshare_del(p);
1090 1107
1091 if (sd->only_folder) 1108 if (sd->only_folder)
1092 evas_object_smart_callback_call(fs, SIG_SELECTED, (void *)path); 1109 eo_do(fs, eo_event_callback_call
1110 (ELM_FILESELECTOR_EVENT_SELECTED, (void *)path));
1093 1111
1094 goto end; 1112 goto end;
1095 } 1113 }
@@ -1102,7 +1120,8 @@ _on_text_activated(void *data,
1102 _populate(fs, dir, NULL, path); 1120 _populate(fs, dir, NULL, path);
1103 1121
1104 if (sd->only_folder) 1122 if (sd->only_folder)
1105 evas_object_smart_callback_call(fs, SIG_SELECTED, (void *)path); 1123 eo_do(fs, eo_event_callback_call
1124 (ELM_FILESELECTOR_EVENT_SELECTED, (void *)path));
1106 } 1125 }
1107 else 1126 else
1108 { 1127 {
@@ -1143,6 +1162,8 @@ _on_text_activated(void *data,
1143 1162
1144end: 1163end:
1145 elm_object_focus_set(obj, EINA_FALSE); 1164 elm_object_focus_set(obj, EINA_FALSE);
1165
1166 return EINA_TRUE;
1146} 1167}
1147 1168
1148static Eina_Bool 1169static Eina_Bool
@@ -1158,29 +1179,31 @@ _anchors_undo(void *data)
1158 return ECORE_CALLBACK_CANCEL; 1179 return ECORE_CALLBACK_CANCEL;
1159} 1180}
1160 1181
1161static void 1182static Eina_Bool
1162_on_text_focused(void *data, 1183_on_text_focused(void *data,
1163 Evas_Object *obj EINA_UNUSED, 1184 Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
1164 void *event_info EINA_UNUSED)
1165{ 1185{
1166 ELM_FILESELECTOR_DATA_GET(data, sd); 1186 ELM_FILESELECTOR_DATA_GET(data, sd);
1167 1187
1168 if (!sd->path_entry_idler) 1188 if (!sd->path_entry_idler)
1169 sd->path_entry_idler = ecore_idler_add(_anchors_undo, data); 1189 sd->path_entry_idler = ecore_idler_add(_anchors_undo, data);
1190
1191 return EINA_TRUE;
1170} 1192}
1171static void 1193
1194static Eina_Bool
1172_on_text_unfocused(void *data, 1195_on_text_unfocused(void *data,
1173 Evas_Object *obj EINA_UNUSED, 1196 Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
1174 void *event_info EINA_UNUSED)
1175{ 1197{
1176 ELM_FILESELECTOR_DATA_GET(data, sd); 1198 ELM_FILESELECTOR_DATA_GET(data, sd);
1177 _anchors_do(data, sd->path); 1199 _anchors_do(data, sd->path);
1200
1201 return EINA_TRUE;
1178} 1202}
1179 1203
1180static void 1204static Eina_Bool
1181_anchor_clicked(void *data, 1205_anchor_clicked(void *data,
1182 Evas_Object *obj EINA_UNUSED, 1206 Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
1183 void *event_info)
1184{ 1207{
1185 Elm_Entry_Anchor_Info *info = event_info; 1208 Elm_Entry_Anchor_Info *info = event_info;
1186 Evas_Object *fs = data; 1209 Evas_Object *fs = data;
@@ -1200,10 +1223,13 @@ _anchor_clicked(void *data,
1200 ecore_idler_del(sd->path_entry_idler); 1223 ecore_idler_del(sd->path_entry_idler);
1201 sd->path_entry_idler = NULL; 1224 sd->path_entry_idler = NULL;
1202 } 1225 }
1226
1227 return EINA_TRUE;
1203} 1228}
1204 1229
1205static void 1230static Eina_Bool
1206_files_key_down(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info) 1231_files_key_down(void *data,
1232 Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
1207{ 1233{
1208 Evas_Event_Key_Down *ev = event_info; 1234 Evas_Event_Key_Down *ev = event_info;
1209 Evas_Object *par, *searchbar; 1235 Evas_Object *par, *searchbar;
@@ -1211,7 +1237,7 @@ _files_key_down(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, v
1211 par = data; 1237 par = data;
1212 searchbar = evas_object_data_get(par, "search"); 1238 searchbar = evas_object_data_get(par, "search");
1213 1239
1214 if (!searchbar) return; 1240 if (!searchbar) return EINA_TRUE;
1215 1241
1216 if (((ev->string) && *(ev->string) && 1242 if (((ev->string) && *(ev->string) &&
1217 (isalpha(*ev->string) || 1243 (isalpha(*ev->string) ||
@@ -1234,6 +1260,8 @@ _files_key_down(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, v
1234 elm_entry_entry_set(searchbar, buf); 1260 elm_entry_entry_set(searchbar, buf);
1235 } 1261 }
1236 } 1262 }
1263
1264 return EINA_TRUE;
1237} 1265}
1238 1266
1239static Evas_Object * 1267static Evas_Object *
@@ -1248,16 +1276,22 @@ _files_list_add(Evas_Object *obj)
1248 evas_object_size_hint_weight_set(li, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); 1276 evas_object_size_hint_weight_set(li, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
1249 evas_object_size_hint_min_set(li, 100, 100); 1277 evas_object_size_hint_min_set(li, 100, 100);
1250 1278
1251 evas_object_smart_callback_add(li, "selected", _on_item_selected, obj); 1279 eo_do(li, eo_event_callback_add
1252 evas_object_smart_callback_add(li, "unselected", _on_item_unselected, obj); 1280 (EVAS_SELECTABLE_INTERFACE_EVENT_SELECTED, _on_item_selected, obj));
1253 evas_object_smart_callback_add(li, "activated", _on_item_activated, obj); 1281 eo_do(li, eo_event_callback_add
1254 evas_object_smart_callback_add 1282 (EVAS_SELECTABLE_INTERFACE_EVENT_UNSELECTED, _on_item_unselected, obj));
1255 (li, "expand,request", _on_list_expand_req, obj); 1283 eo_do(li, eo_event_callback_add
1256 evas_object_smart_callback_add 1284 (ELM_GENLIST_EVENT_ACTIVATED, _on_item_activated, obj));
1257 (li, "contract,request", _on_list_contract_req, obj); 1285 eo_do(li, eo_event_callback_add
1258 evas_object_smart_callback_add(li, "expanded", _on_list_expanded, obj); 1286 (ELM_GENLIST_EVENT_EXPAND_REQUEST, _on_list_expand_req, obj));
1259 evas_object_smart_callback_add(li, "contracted", _on_list_contracted, obj); 1287 eo_do(li, eo_event_callback_add
1260 evas_object_event_callback_add(li, EVAS_CALLBACK_KEY_DOWN, _files_key_down, obj); 1288 (ELM_GENLIST_EVENT_CONTRACT_REQUEST, _on_list_contract_req, obj));
1289 eo_do(li, eo_event_callback_add
1290 (ELM_GENLIST_EVENT_EXPANDED, _on_list_expanded, obj));
1291 eo_do(li, eo_event_callback_add
1292 (ELM_GENLIST_EVENT_CONTRACTED, _on_list_contracted, obj));
1293 eo_do(li, eo_event_callback_add
1294 (EVAS_OBJECT_EVENT_KEY_DOWN, _files_key_down, obj));
1261 1295
1262 elm_widget_sub_object_add(obj, li); 1296 elm_widget_sub_object_add(obj, li);
1263 1297
@@ -1281,10 +1315,14 @@ _files_grid_add(Evas_Object *obj)
1281 1315
1282 elm_gengrid_align_set(grid, 0.0, 0.0); 1316 elm_gengrid_align_set(grid, 0.0, 0.0);
1283 1317
1284 evas_object_smart_callback_add(grid, "selected", _on_item_selected, obj); 1318 eo_do(grid, eo_event_callback_add
1285 evas_object_smart_callback_add(grid, "unselected", _on_item_unselected, obj); 1319 (ELM_GENGRID_EVENT_SELECTED, _on_item_selected, obj));
1286 evas_object_smart_callback_add(grid, "activated", _on_item_activated, obj); 1320 eo_do(grid, eo_event_callback_add
1287 evas_object_event_callback_add(grid, EVAS_CALLBACK_KEY_DOWN, _files_key_down, obj); 1321 (ELM_GENGRID_EVENT_UNSELECTED, _on_item_unselected, obj));
1322 eo_do(grid, eo_event_callback_add
1323 (ELM_GENGRID_EVENT_ACTIVATED, _on_item_activated, obj));
1324 eo_do(grid, eo_event_callback_add
1325 (EVAS_OBJECT_EVENT_KEY_DOWN, _files_key_down, obj));
1288 1326
1289 elm_widget_sub_object_add(obj, grid); 1327 elm_widget_sub_object_add(obj, grid);
1290 1328
@@ -1422,8 +1460,9 @@ _resource_deleted(void *data, int type EINA_UNUSED, void *ev)
1422 return ECORE_CALLBACK_PASS_ON; 1460 return ECORE_CALLBACK_PASS_ON;
1423} 1461}
1424 1462
1425static void _preedit_cb(void *data, Evas_Object *obj, 1463static Eina_Bool
1426 void *event_info EINA_UNUSED) 1464_preedit_cb(void *data,
1465 Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
1427{ 1466{
1428 ELM_FILESELECTOR_DATA_GET(data, sd); 1467 ELM_FILESELECTOR_DATA_GET(data, sd);
1429 1468
@@ -1431,6 +1470,8 @@ static void _preedit_cb(void *data, Evas_Object *obj,
1431 1470
1432 if (sd->search_string && sd->path) 1471 if (sd->search_string && sd->path)
1433 _populate(data, sd->path, NULL, NULL); 1472 _populate(data, sd->path, NULL, NULL);
1473
1474 return EINA_TRUE;
1434} 1475}
1435 1476
1436EOLIAN static void 1477EOLIAN static void
@@ -1460,7 +1501,8 @@ _elm_fileselector_evas_object_smart_add(Eo *obj, Elm_Fileselector_Data *priv)
1460 elm_object_part_content_set(bt, "icon", ic); 1501 elm_object_part_content_set(bt, "icon", ic);
1461 elm_object_domain_translatable_text_set(bt, PACKAGE, N_("Up")); 1502 elm_object_domain_translatable_text_set(bt, PACKAGE, N_("Up"));
1462 evas_object_size_hint_align_set(bt, 0.0, 0.0); 1503 evas_object_size_hint_align_set(bt, 0.0, 0.0);
1463 evas_object_smart_callback_add(bt, "clicked", _on_dir_up, obj); 1504 eo_do(bt, eo_event_callback_add
1505 (EVAS_CLICKABLE_INTERFACE_EVENT_CLICKED, _on_dir_up, obj));
1464 1506
1465 elm_widget_sub_object_add(obj, bt); 1507 elm_widget_sub_object_add(obj, bt);
1466 1508
@@ -1475,9 +1517,9 @@ _elm_fileselector_evas_object_smart_add(Eo *obj, Elm_Fileselector_Data *priv)
1475 elm_object_part_content_set(bt, "icon", ic); 1517 elm_object_part_content_set(bt, "icon", ic);
1476 elm_object_domain_translatable_text_set(bt, PACKAGE, N_("Home")); 1518 elm_object_domain_translatable_text_set(bt, PACKAGE, N_("Home"));
1477 evas_object_size_hint_align_set(bt, 0.0, 0.0); 1519 evas_object_size_hint_align_set(bt, 0.0, 0.0);
1478 evas_object_smart_callback_add(bt, "clicked", _home, obj); 1520 eo_do(bt, eo_event_callback_add
1521 (EVAS_CLICKABLE_INTERFACE_EVENT_CLICKED, _home, obj));
1479 1522
1480 elm_widget_sub_object_add(obj, bt);
1481 priv->home_button = bt; 1523 priv->home_button = bt;
1482 1524
1483 // spinner 1525 // spinner
@@ -1504,10 +1546,14 @@ _elm_fileselector_evas_object_smart_add(Eo *obj, Elm_Fileselector_Data *priv)
1504 evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); 1546 evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
1505 evas_object_size_hint_align_set(en, EVAS_HINT_FILL, EVAS_HINT_FILL); 1547 evas_object_size_hint_align_set(en, EVAS_HINT_FILL, EVAS_HINT_FILL);
1506 1548
1507 evas_object_smart_callback_add(en, "anchor,clicked", _anchor_clicked, obj); 1549 eo_do(en, eo_event_callback_add
1508 evas_object_smart_callback_add(en, "focused", _on_text_focused, obj); 1550 (ELM_ENTRY_EVENT_ANCHOR_CLICKED, _anchor_clicked, obj));
1509 evas_object_smart_callback_add(en, "unfocused", _on_text_unfocused, obj); 1551 eo_do(en, eo_event_callback_add
1510 evas_object_smart_callback_add(en, "activated", _on_text_activated, obj); 1552 (ELM_LAYOUT_EVENT_FOCUSED, _on_text_focused, obj));
1553 eo_do(en, eo_event_callback_add
1554 (ELM_LAYOUT_EVENT_UNFOCUSED, _on_text_unfocused, obj));
1555 eo_do(en, eo_event_callback_add
1556 (ELM_ENTRY_EVENT_ACTIVATED, _on_text_activated, obj));
1511 1557
1512 elm_widget_sub_object_add(obj, en); 1558 elm_widget_sub_object_add(obj, en);
1513 priv->path_entry = en; 1559 priv->path_entry = en;
@@ -1541,7 +1587,8 @@ _elm_fileselector_evas_object_smart_add(Eo *obj, Elm_Fileselector_Data *priv)
1541 elm_entry_icon_visible_set(en, EINA_TRUE); 1587 elm_entry_icon_visible_set(en, EINA_TRUE);
1542 evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); 1588 evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
1543 evas_object_size_hint_align_set(en, EVAS_HINT_FILL, EVAS_HINT_FILL); 1589 evas_object_size_hint_align_set(en, EVAS_HINT_FILL, EVAS_HINT_FILL);
1544 evas_object_smart_callback_add(en, "changed", _preedit_cb, obj); 1590 eo_do(en, eo_event_callback_add
1591 (ELM_ENTRY_EVENT_CHANGED, _preedit_cb, obj));
1545 evas_object_data_set(obj, "search", en); 1592 evas_object_data_set(obj, "search", en);
1546 1593
1547 elm_widget_sub_object_add(obj, en); 1594 elm_widget_sub_object_add(obj, en);
@@ -1706,7 +1753,8 @@ _elm_fileselector_buttons_ok_cancel_set(Eo *obj, Elm_Fileselector_Data *sd, Eina
1706 elm_widget_mirrored_automatic_set(bt, EINA_FALSE); 1753 elm_widget_mirrored_automatic_set(bt, EINA_FALSE);
1707 elm_object_domain_translatable_text_set(bt, PACKAGE, N_("Cancel")); 1754 elm_object_domain_translatable_text_set(bt, PACKAGE, N_("Cancel"));
1708 1755
1709 evas_object_smart_callback_add(bt, "clicked", _canc, obj); 1756 eo_do(bt, eo_event_callback_add
1757 (EVAS_CLICKABLE_INTERFACE_EVENT_CLICKED, _canc, obj));
1710 1758
1711 sd->cancel_button = bt; 1759 sd->cancel_button = bt;
1712 1760
@@ -1715,7 +1763,8 @@ _elm_fileselector_buttons_ok_cancel_set(Eo *obj, Elm_Fileselector_Data *sd, Eina
1715 elm_widget_mirrored_automatic_set(bt, EINA_FALSE); 1763 elm_widget_mirrored_automatic_set(bt, EINA_FALSE);
1716 elm_object_domain_translatable_text_set(bt, PACKAGE, N_("OK")); 1764 elm_object_domain_translatable_text_set(bt, PACKAGE, N_("OK"));
1717 1765
1718 evas_object_smart_callback_add(bt, "clicked", _ok, obj); 1766 eo_do(bt, eo_event_callback_add
1767 (EVAS_CLICKABLE_INTERFACE_EVENT_CLICKED, _ok, obj));
1719 1768
1720 sd->ok_button = bt; 1769 sd->ok_button = bt;
1721 1770
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
61 return EINA_TRUE; 61 return EINA_TRUE;
62} 62}
63 63
64static void 64static Eina_Bool
65_selection_done(void *data, 65_selection_done(void *data,
66 Evas_Object *obj EINA_UNUSED, 66 Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
67 void *event_info)
68{ 67{
69 Elm_Fileselector_Button_Data *sd = data; 68 Elm_Fileselector_Button_Data *sd = data;
70 const char *file = event_info; 69 const char *file = event_info;
@@ -77,8 +76,10 @@ _selection_done(void *data,
77 sd->fsw = NULL; 76 sd->fsw = NULL;
78 evas_object_del(del); 77 evas_object_del(del);
79 78
80 evas_object_smart_callback_call 79 eo_do(sd->obj, eo_event_callback_call
81 (sd->obj, SIG_FILE_CHOSEN, (void *)file); 80 (ELM_FILESELECTOR_BUTTON_EVENT_FILE_CHOSEN, (void *)file));
81
82 return EINA_TRUE;
82} 83}
83 84
84static Evas_Object * 85static Evas_Object *
@@ -89,7 +90,8 @@ _new_window_add(Elm_Fileselector_Button_Data *sd)
89 win = elm_win_add(NULL, "fileselector_button", ELM_WIN_DIALOG_BASIC); 90 win = elm_win_add(NULL, "fileselector_button", ELM_WIN_DIALOG_BASIC);
90 elm_win_title_set(win, sd->window_title); 91 elm_win_title_set(win, sd->window_title);
91 elm_win_autodel_set(win, EINA_TRUE); 92 elm_win_autodel_set(win, EINA_TRUE);
92 evas_object_smart_callback_add(win, "delete,request", _selection_done, sd); 93 eo_do(win, eo_event_callback_add
94 (ELM_WIN_EVENT_DELETE_REQUEST, _selection_done, sd));
93 95
94 bg = elm_bg_add(win); 96 bg = elm_bg_add(win);
95 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); 97 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
@@ -142,7 +144,8 @@ _activate(Elm_Fileselector_Button_Data *sd)
142 evas_object_size_hint_weight_set 144 evas_object_size_hint_weight_set
143 (sd->fs, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); 145 (sd->fs, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
144 evas_object_size_hint_align_set(sd->fs, EVAS_HINT_FILL, EVAS_HINT_FILL); 146 evas_object_size_hint_align_set(sd->fs, EVAS_HINT_FILL, EVAS_HINT_FILL);
145 evas_object_smart_callback_add(sd->fs, "done", _selection_done, sd); 147 eo_do(sd->fs, eo_event_callback_add
148 (ELM_FILESELECTOR_EVENT_DONE, _selection_done, sd));
146 evas_object_show(sd->fs); 149 evas_object_show(sd->fs);
147 150
148 if (is_inwin) 151 if (is_inwin)
@@ -157,12 +160,13 @@ _activate(Elm_Fileselector_Button_Data *sd)
157 } 160 }
158} 161}
159 162
160static void 163static Eina_Bool
161_button_clicked(void *data, 164_button_clicked(void *data,
162 Evas_Object *obj EINA_UNUSED, 165 Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
163 void *event_info EINA_UNUSED)
164{ 166{
165 _activate(data); 167 _activate(data);
168
169 return EINA_TRUE;
166} 170}
167 171
168EOLIAN static void 172EOLIAN static void
@@ -182,7 +186,8 @@ _elm_fileselector_button_evas_object_smart_add(Eo *obj, Elm_Fileselector_Button_
182 186
183 elm_widget_mirrored_automatic_set(obj, EINA_FALSE); 187 elm_widget_mirrored_automatic_set(obj, EINA_FALSE);
184 188
185 evas_object_smart_callback_add(obj, "clicked", _button_clicked, priv); 189 eo_do(obj, eo_event_callback_add
190 (ELM_FILESELECTOR_BUTTON_EVENT_CLICKED, _button_clicked, priv));
186 191
187 eo_do(obj, elm_obj_widget_theme_apply()); 192 eo_do(obj, elm_obj_widget_theme_apply());
188 elm_widget_can_focus_set(obj, EINA_TRUE); 193 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,
68 events { 68 events {
69 focused; 69 focused;
70 unfocused; 70 unfocused;
71 done;
72 activated;
73 selected;
74 selected,invalid;
75 directory,open;
71 } 76 }
72 77
73} 78}
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)
119 access,changed; 119 access,changed;
120 focused; 120 focused;
121 unfocused; 121 unfocused;
122 clicked;
123 file,chosen;
122 } 124 }
123 125
124} 126}