summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAli Alzyod <ali198724@gmail.com>2020-01-06 10:09:04 +0000
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2020-01-06 14:37:41 +0100
commitcdaecf2dfb6d10cd1376623a5377b195e777dd57 (patch)
tree01dbea515a471082d88dc16579c2d5465f32a519
parent31a96be9a28fc8086d6e617a66b5d786b2ecb8ce (diff)
efl.ui.textbox: clean up (remove unused vars and methods)
efl.ui.textbox: clean up (remove unused vars and methods) Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de> Differential Revision: https://phab.enlightenment.org/D11023
-rw-r--r--src/lib/elementary/efl_ui_textbox.c126
1 files changed, 6 insertions, 120 deletions
diff --git a/src/lib/elementary/efl_ui_textbox.c b/src/lib/elementary/efl_ui_textbox.c
index a36faf29b8..aeff628640 100644
--- a/src/lib/elementary/efl_ui_textbox.c
+++ b/src/lib/elementary/efl_ui_textbox.c
@@ -30,12 +30,9 @@ typedef struct _Selection_Loss_Data Selection_Loss_Data;
30 */ 30 */
31struct _Efl_Ui_Textbox_Data 31struct _Efl_Ui_Textbox_Data
32{ 32{
33 Evas_Object *hit_rect, *entry_edje, *scr_edje; 33 Evas_Object *hit_rect, *entry_edje;
34 34
35 Evas_Object *hoversel; 35 Evas_Object *hoversel;
36 Evas_Object *mgf_bg;
37 Evas_Object *mgf_clip;
38 Evas_Object *mgf_proxy;
39 Eo *text_obj; 36 Eo *text_obj;
40 Eo *text_guide_obj; 37 Eo *text_guide_obj;
41 Eo *text_table; 38 Eo *text_table;
@@ -47,14 +44,10 @@ struct _Efl_Ui_Textbox_Data
47 Evas_Object *start_handler; 44 Evas_Object *start_handler;
48 Evas_Object *end_handler; 45 Evas_Object *end_handler;
49 Ecore_Job *deferred_decoration_job; 46 Ecore_Job *deferred_decoration_job;
50 Ecore_Timer *delay_write;
51 /* for deferred appending */ 47 /* for deferred appending */
52 Ecore_Idler *append_text_idler;
53 char *append_text_left;
54 int append_text_position; 48 int append_text_position;
55 int append_text_len; 49 int append_text_len;
56 /* Only for clipboard */ 50 /* Only for clipboard */
57 const char *cut_sel;
58 const char *text; 51 const char *text;
59 const char *file; 52 const char *file;
60 Elm_Text_Format format; 53 Elm_Text_Format format;
@@ -64,19 +57,13 @@ struct _Efl_Ui_Textbox_Data
64 Eina_List *anchors; 57 Eina_List *anchors;
65 int gen; 58 int gen;
66 Eina_List *sel; 59 Eina_List *sel;
67 Eina_List *items; /** context menu item list */
68 Efl_Canvas_Textblock_Factory *item_factory; 60 Efl_Canvas_Textblock_Factory *item_factory;
69 Efl_Canvas_Textblock_Factory *item_fallback_factory; 61 Efl_Canvas_Textblock_Factory *item_fallback_factory;
70 Eina_List *markup_filters;
71 Ecore_Job *hov_deljob; 62 Ecore_Job *hov_deljob;
72 Mod_Api *api; // module api if supplied 63 Mod_Api *api; // module api if supplied
73 int cursor_pos; 64 int cursor_pos;
74 Elm_Scroller_Policy policy_h, policy_v; 65 Elm_Scroller_Policy policy_h, policy_v;
75 Elm_Wrap_Type line_wrap;
76 Efl_Text_Cursor *sel_handler_cursor; 66 Efl_Text_Cursor *sel_handler_cursor;
77 void *input_panel_imdata;
78 int input_panel_imdata_len;
79 int validators;
80 struct 67 struct
81 { 68 {
82 Evas_Object *hover_parent; /**< hover parent object. entry is a hover parent object by default */ 69 Evas_Object *hover_parent; /**< hover parent object. entry is a hover parent object by default */
@@ -361,30 +348,6 @@ _efl_ui_textbox_guide_update(Evas_Object *obj,
361} 348}
362 349
363static void 350static void
364_filter_free(Elm_Entry_Markup_Filter *tf)
365{
366 if (tf->func == elm_entry_filter_limit_size)
367 {
368 Elm_Entry_Filter_Limit_Size *lim = tf->data;
369
370 free(lim);
371 }
372 else if (tf->func == elm_entry_filter_accept_set)
373 {
374 Elm_Entry_Filter_Accept_Set *as = tf->data;
375
376 if (as)
377 {
378 eina_stringshare_del(as->accepted);
379 eina_stringshare_del(as->rejected);
380
381 free(as);
382 }
383 }
384 free(tf);
385}
386
387static void
388_mirrored_set(Evas_Object *obj, 351_mirrored_set(Evas_Object *obj,
389 Eina_Bool rtl) 352 Eina_Bool rtl)
390{ 353{
@@ -674,7 +637,6 @@ _efl_ui_textbox_efl_ui_widget_disabled_set(Eo *obj, Efl_Ui_Textbox_Data *sd, Ein
674 efl_layout_signal_emit(sd->entry_edje, emission, "efl"); 637 efl_layout_signal_emit(sd->entry_edje, emission, "efl");
675 if (sd->scroll) 638 if (sd->scroll)
676 { 639 {
677 efl_layout_signal_emit(sd->scr_edje, emission, "efl");
678 elm_interface_scrollable_freeze_set(obj, efl_ui_widget_disabled_get(obj)); 640 elm_interface_scrollable_freeze_set(obj, efl_ui_widget_disabled_get(obj));
679 } 641 }
680 642
@@ -726,8 +688,6 @@ _efl_ui_textbox_efl_ui_widget_theme_apply(Eo *obj, Efl_Ui_Textbox_Data *sd)
726 if (efl_ui_focus_object_focus_get(obj)) 688 if (efl_ui_focus_object_focus_get(obj))
727 { 689 {
728 efl_layout_signal_emit(sd->entry_edje, "efl,action,focus", "efl"); 690 efl_layout_signal_emit(sd->entry_edje, "efl,action,focus", "efl");
729 if (sd->scroll)
730 efl_layout_signal_emit(sd->scr_edje, "efl,action,focus", "efl");
731 } 691 }
732 692
733 efl_layout_signal_process(sd->entry_edje, EINA_FALSE); 693 efl_layout_signal_process(sd->entry_edje, EINA_FALSE);
@@ -863,8 +823,6 @@ _efl_ui_textbox_efl_ui_focus_object_on_focus_update(Eo *obj, Efl_Ui_Textbox_Data
863 evas_object_focus_set(sd->text_obj, EINA_TRUE); 823 evas_object_focus_set(sd->text_obj, EINA_TRUE);
864 824
865 _edje_signal_emit(sd, "efl,action,focus", "efl"); 825 _edje_signal_emit(sd, "efl,action,focus", "efl");
866 if (sd->scroll)
867 efl_layout_signal_emit(sd->scr_edje, "efl,action,focus", "efl");
868 826
869 if (top && efl_input_text_input_panel_autoshow_get(obj) && !efl_input_text_input_panel_show_on_demand_get(obj)) 827 if (top && efl_input_text_input_panel_autoshow_get(obj) && !efl_input_text_input_panel_show_on_demand_get(obj))
870 elm_win_keyboard_mode_set(top, ELM_WIN_KEYBOARD_ON); 828 elm_win_keyboard_mode_set(top, ELM_WIN_KEYBOARD_ON);
@@ -876,8 +834,6 @@ _efl_ui_textbox_efl_ui_focus_object_on_focus_update(Eo *obj, Efl_Ui_Textbox_Data
876 Eo *sw = sd->text_obj; 834 Eo *sw = sd->text_obj;
877 835
878 _edje_signal_emit(sd, "efl,action,unfocus", "efl"); 836 _edje_signal_emit(sd, "efl,action,unfocus", "efl");
879 if (sd->scroll)
880 efl_layout_signal_emit(sd->scr_edje, "efl,action,unfocus", "efl");
881 evas_object_focus_set(sw, EINA_FALSE); 837 evas_object_focus_set(sw, EINA_FALSE);
882 838
883 if (top && top_is_win && efl_input_text_input_panel_autoshow_get(obj)) 839 if (top && top_is_win && efl_input_text_input_panel_autoshow_get(obj))
@@ -896,7 +852,6 @@ _efl_ui_textbox_efl_ui_focus_object_on_focus_update(Eo *obj, Efl_Ui_Textbox_Data
896 edje_object_part_text_select_none(sd->entry_edje, "efl.text"); 852 edje_object_part_text_select_none(sd->entry_edje, "efl.text");
897 } 853 }
898 } 854 }
899 efl_layout_signal_emit(sd->scr_edje, "validation,default", "efl");
900 } 855 }
901 856
902 return EINA_TRUE; 857 return EINA_TRUE;
@@ -1133,22 +1088,9 @@ _hover_cancel_cb(void *data,
1133} 1088}
1134 1089
1135static void 1090static void
1136_hover_item_clicked_cb(void *data,
1137 Evas_Object *obj EINA_UNUSED,
1138 void *event_info EINA_UNUSED)
1139{
1140 Elm_Entry_Context_Menu_Item *it = data;
1141 if (!it) return;
1142
1143 if (it->func) it->func(it->data, it->obj, it);
1144}
1145
1146static void
1147_menu_call(Evas_Object *obj) 1091_menu_call(Evas_Object *obj)
1148{ 1092{
1149 Evas_Object *top; 1093 Evas_Object *top;
1150 const Eina_List *l;
1151 const Elm_Entry_Context_Menu_Item *it;
1152 1094
1153 EFL_UI_TEXT_DATA_GET(obj, sd); 1095 EFL_UI_TEXT_DATA_GET(obj, sd);
1154 1096
@@ -1166,13 +1108,10 @@ _menu_call(Evas_Object *obj)
1166 Eina_Bool ownersel; 1108 Eina_Bool ownersel;
1167 1109
1168 ownersel = elm_selection_selection_has_owner(obj); 1110 ownersel = elm_selection_selection_has_owner(obj);
1169 if (!sd->items) 1111 /* prevent stupid blank hoversel */
1170 { 1112 if (efl_text_interactive_have_selection_get(obj) && efl_text_password_get(obj)) return;
1171 /* prevent stupid blank hoversel */ 1113 if (_elm_config->desktop_entry && (!efl_text_interactive_have_selection_get(obj)) && ((!efl_text_interactive_editable_get(obj)) || (!ownersel)))
1172 if (efl_text_interactive_have_selection_get(obj) && efl_text_password_get(obj)) return; 1114 return;
1173 if (_elm_config->desktop_entry && (!efl_text_interactive_have_selection_get(obj)) && ((!efl_text_interactive_editable_get(obj)) || (!ownersel)))
1174 return;
1175 }
1176 if (sd->hoversel) evas_object_del(sd->hoversel); 1115 if (sd->hoversel) evas_object_del(sd->hoversel);
1177 else efl_ui_widget_scroll_freeze_push(obj); 1116 else efl_ui_widget_scroll_freeze_push(obj);
1178 1117
@@ -1238,12 +1177,6 @@ _menu_call(Evas_Object *obj)
1238 _hover_cancel_cb, obj); 1177 _hover_cancel_cb, obj);
1239 } 1178 }
1240 1179
1241 EINA_LIST_FOREACH(sd->items, l, it)
1242 {
1243 elm_hoversel_item_add(sd->hoversel, it->label, it->icon_file,
1244 it->icon_type, _hover_item_clicked_cb, it);
1245 }
1246
1247 if (sd->hoversel) 1180 if (sd->hoversel)
1248 { 1181 {
1249 _hoversel_position(obj); 1182 _hoversel_position(obj);
@@ -1488,12 +1421,6 @@ _efl_ui_textbox_efl_layout_signal_signal_emit(Eo *obj EINA_UNUSED, Efl_Ui_Textbo
1488 1421
1489 // FIXME: This should not be here! 1422 // FIXME: This should not be here!
1490 efl_layout_signal_process(sd->entry_edje, EINA_TRUE); 1423 efl_layout_signal_process(sd->entry_edje, EINA_TRUE);
1491
1492 if (sd->scr_edje)
1493 {
1494 efl_layout_signal_emit(sd->scr_edje, emission, source);
1495 efl_layout_signal_process(sd->scr_edje, EINA_TRUE); // FIXME
1496 }
1497} 1424}
1498 1425
1499static Eina_Bool 1426static Eina_Bool
@@ -1502,8 +1429,6 @@ _efl_ui_textbox_efl_layout_signal_signal_callback_add(Eo *obj EINA_UNUSED, Efl_U
1502 Eina_Bool ok; 1429 Eina_Bool ok;
1503 1430
1504 ok = efl_layout_signal_callback_add(pd->entry_edje, emission, source, func_data, func, func_free_cb); 1431 ok = efl_layout_signal_callback_add(pd->entry_edje, emission, source, func_data, func, func_free_cb);
1505 if (pd->scr_edje)
1506 ok = efl_layout_signal_callback_add(pd->scr_edje, emission, source, func_data, func, func_free_cb);
1507 1432
1508 return ok; 1433 return ok;
1509} 1434}
@@ -1514,8 +1439,6 @@ _efl_ui_textbox_efl_layout_signal_signal_callback_del(Eo *obj EINA_UNUSED, Efl_U
1514 Eina_Bool ok; 1439 Eina_Bool ok;
1515 1440
1516 ok = efl_layout_signal_callback_del(pd->entry_edje, emission, source, func_data, func, func_free_cb); 1441 ok = efl_layout_signal_callback_del(pd->entry_edje, emission, source, func_data, func, func_free_cb);
1517 if (pd->scr_edje)
1518 ok = efl_layout_signal_callback_del(pd->scr_edje, emission, source, func_data, func, func_free_cb);
1519 1442
1520 return ok; 1443 return ok;
1521} 1444}
@@ -1957,7 +1880,6 @@ _efl_ui_textbox_efl_object_constructor(Eo *obj, Efl_Ui_Textbox_Data *sd)
1957 1880
1958 sd->entry_edje = wd->resize_obj; 1881 sd->entry_edje = wd->resize_obj;
1959 sd->cnp_mode = EFL_UI_SELECTION_FORMAT_TEXT; 1882 sd->cnp_mode = EFL_UI_SELECTION_FORMAT_TEXT;
1960 sd->line_wrap = ELM_WRAP_WORD;
1961 sd->context_menu_enabled = EINA_TRUE; 1883 sd->context_menu_enabled = EINA_TRUE;
1962 sd->auto_save = EINA_TRUE; 1884 sd->auto_save = EINA_TRUE;
1963 efl_text_interactive_editable_set(obj, EINA_TRUE); 1885 efl_text_interactive_editable_set(obj, EINA_TRUE);
@@ -2058,15 +1980,6 @@ _efl_ui_textbox_efl_object_finalize(Eo *obj,
2058EOLIAN static void 1980EOLIAN static void
2059_efl_ui_textbox_efl_object_destructor(Eo *obj, Efl_Ui_Textbox_Data *sd) 1981_efl_ui_textbox_efl_object_destructor(Eo *obj, Efl_Ui_Textbox_Data *sd)
2060{ 1982{
2061 Elm_Entry_Context_Menu_Item *it;
2062 Elm_Entry_Markup_Filter *tf;
2063
2064 if (sd->delay_write)
2065 {
2066 ELM_SAFE_FREE(sd->delay_write, ecore_timer_del);
2067 if (sd->auto_save) _save_do(obj);
2068 }
2069
2070 efl_event_freeze(obj); 1983 efl_event_freeze(obj);
2071 1984
2072 eina_stringshare_del(sd->file); 1985 eina_stringshare_del(sd->file);
@@ -2075,33 +1988,9 @@ _efl_ui_textbox_efl_object_destructor(Eo *obj, Efl_Ui_Textbox_Data *sd)
2075 if ((sd->api) && (sd->api->obj_unhook)) 1988 if ((sd->api) && (sd->api->obj_unhook))
2076 sd->api->obj_unhook(obj); // module - unhook 1989 sd->api->obj_unhook(obj); // module - unhook
2077 1990
2078 evas_object_del(sd->mgf_proxy);
2079 evas_object_del(sd->mgf_bg);
2080 evas_object_del(sd->mgf_clip);
2081
2082 entries = eina_list_remove(entries, obj); 1991 entries = eina_list_remove(entries, obj);
2083 eina_stringshare_del(sd->cut_sel);
2084 eina_stringshare_del(sd->text); 1992 eina_stringshare_del(sd->text);
2085 ecore_job_del(sd->deferred_decoration_job); 1993 ecore_job_del(sd->deferred_decoration_job);
2086 if (sd->append_text_idler)
2087 {
2088 ecore_idler_del(sd->append_text_idler);
2089 ELM_SAFE_FREE(sd->append_text_left, free);
2090 sd->append_text_idler = NULL;
2091 }
2092 EINA_LIST_FREE(sd->items, it)
2093 {
2094 eina_stringshare_del(it->label);
2095 eina_stringshare_del(it->icon_file);
2096 eina_stringshare_del(it->icon_group);
2097 free(it);
2098 }
2099 EINA_LIST_FREE(sd->markup_filters, tf)
2100 {
2101 _filter_free(tf);
2102 }
2103 ELM_SAFE_FREE(sd->delay_write, ecore_timer_del);
2104 free(sd->input_panel_imdata);
2105 eina_stringshare_del(sd->anchor_hover.hover_style); 1994 eina_stringshare_del(sd->anchor_hover.hover_style);
2106 1995
2107 efl_event_thaw(obj); 1996 efl_event_thaw(obj);
@@ -2161,7 +2050,6 @@ _efl_ui_textbox_efl_text_format_password_set(Eo *obj, Efl_Ui_Textbox_Data *sd, E
2161 if (password) 2050 if (password)
2162 { 2051 {
2163 efl_text_multiline_set(obj, EINA_FALSE); 2052 efl_text_multiline_set(obj, EINA_FALSE);
2164 sd->line_wrap = ELM_WRAP_NONE;
2165 efl_input_text_input_hint_set(obj, ((efl_input_text_input_hint_get(obj) & ~EFL_INPUT_TEXT_HINTS_TYPE_AUTO_COMPLETE) | EFL_INPUT_TEXT_HINTS_TYPE_SENSITIVE_DATA)); 2053 efl_input_text_input_hint_set(obj, ((efl_input_text_input_hint_get(obj) & ~EFL_INPUT_TEXT_HINTS_TYPE_AUTO_COMPLETE) | EFL_INPUT_TEXT_HINTS_TYPE_SENSITIVE_DATA));
2166 efl_access_object_role_set(obj, EFL_ACCESS_ROLE_PASSWORD_TEXT); 2054 efl_access_object_role_set(obj, EFL_ACCESS_ROLE_PASSWORD_TEXT);
2167 } 2055 }
@@ -2373,10 +2261,9 @@ _efl_ui_textbox_efl_file_file_set(Eo *obj, Efl_Ui_Textbox_Data *sd, const char *
2373} 2261}
2374 2262
2375EOLIAN static void 2263EOLIAN static void
2376_efl_ui_textbox_efl_file_unload(Eo *obj, Efl_Ui_Textbox_Data *sd) 2264_efl_ui_textbox_efl_file_unload(Eo *obj, Efl_Ui_Textbox_Data *sd EINA_UNUSED)
2377{ 2265{
2378 efl_file_unload(efl_super(obj, MY_CLASS)); 2266 efl_file_unload(efl_super(obj, MY_CLASS));
2379 ELM_SAFE_FREE(sd->delay_write, ecore_timer_del);
2380 elm_object_text_set(obj, ""); 2267 elm_object_text_set(obj, "");
2381} 2268}
2382 2269
@@ -2388,7 +2275,6 @@ _efl_ui_textbox_efl_file_load(Eo *obj, Efl_Ui_Textbox_Data *sd)
2388 if (efl_file_loaded_get(obj)) return 0; 2275 if (efl_file_loaded_get(obj)) return 0;
2389 err = efl_file_load(efl_super(obj, MY_CLASS)); 2276 err = efl_file_load(efl_super(obj, MY_CLASS));
2390 if (err) return err; 2277 if (err) return err;
2391 ELM_SAFE_FREE(sd->delay_write, ecore_timer_del);
2392 if (sd->auto_save) _save_do(obj); 2278 if (sd->auto_save) _save_do(obj);
2393 return _load_do(obj); 2279 return _load_do(obj);
2394} 2280}