summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorYoungbok Shin <youngb.shin@samsung.com>2017-12-06 17:33:03 +0900
committerSungtaek Hong <sth253.hong@samsung.com>2017-12-08 16:02:24 +0900
commit300ded6c305459bc578c07a9905dfab8a48bfd63 (patch)
treeba9c0edbce688e7af093b81f3354056d571d5237 /src
parentbbb70f0e9b08a7e5c8ef3a6419d47679b1e8319c (diff)
efl_ui_text: apply new theme logic and use constructor/destructor
Summary: It removes legacy aliases from efl_ui_text's theme. And it also move all code from group add/del overriding functions to constructor/destructor. @fix Test Plan: N/A Reviewers: jpeg, taxi2se Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D5601
Diffstat (limited to 'src')
-rw-r--r--src/lib/elementary/efl_ui_text.c450
-rw-r--r--src/lib/elementary/efl_ui_text.eo1
-rw-r--r--src/lib/elementary/efl_ui_text_async.eo2
3 files changed, 195 insertions, 258 deletions
diff --git a/src/lib/elementary/efl_ui_text.c b/src/lib/elementary/efl_ui_text.c
index 434a4fda6f..6224676333 100644
--- a/src/lib/elementary/efl_ui_text.c
+++ b/src/lib/elementary/efl_ui_text.c
@@ -657,52 +657,6 @@ _update_selection_handler(Eo *obj)
657 } 657 }
658} 658}
659 659
660static const char *
661_efl_ui_text_theme_group_get(Evas_Object *obj)
662{
663 EFL_UI_TEXT_DATA_GET(obj, sd);
664
665 if (sd->password) return "password";
666 if (sd->editable)
667 {
668 if (sd->single_line) return "single";
669 switch (sd->line_wrap)
670 {
671 case ELM_WRAP_CHAR:
672 return "charwrap";
673
674 case ELM_WRAP_WORD:
675 return "base";
676
677 case ELM_WRAP_MIXED:
678 return "mixedwrap";
679
680 case ELM_WRAP_NONE:
681 default:
682 return "nowrap";
683 }
684 }
685 else
686 {
687 if (sd->single_line) return "single-noedit";
688 switch (sd->line_wrap)
689 {
690 case ELM_WRAP_CHAR:
691 return "noedit-charwrap";
692
693 case ELM_WRAP_WORD:
694 return "noedit";
695
696 case ELM_WRAP_MIXED:
697 return "noedit-mixedwrap";
698
699 case ELM_WRAP_NONE:
700 default:
701 return "nowrap-noedit";
702 }
703 }
704}
705
706static void 660static void
707_edje_entry_user_insert(Evas_Object *obj, const char *data) 661_edje_entry_user_insert(Evas_Object *obj, const char *data)
708{ 662{
@@ -921,7 +875,7 @@ _efl_ui_text_elm_widget_theme_apply(Eo *obj, Efl_Ui_Text_Data *sd)
921 _mirrored_set(obj, efl_ui_mirrored_get(obj)); 875 _mirrored_set(obj, efl_ui_mirrored_get(obj));
922 876
923 elm_widget_element_update(obj, sd->entry_edje, 877 elm_widget_element_update(obj, sd->entry_edje,
924 _efl_ui_text_theme_group_get(obj)); 878 elm_widget_theme_element_get(obj));
925 879
926 if (elm_widget_disabled_get(obj)) 880 if (elm_widget_disabled_get(obj))
927 edje_object_signal_emit(sd->entry_edje, "elm,state,disabled", "elm"); 881 edje_object_signal_emit(sd->entry_edje, "elm,state,disabled", "elm");
@@ -2970,58 +2924,160 @@ _end_handler_mouse_move_cb(void *data,
2970 _magnifier_move(data); 2924 _magnifier_move(data);
2971} 2925}
2972 2926
2927static void
2928_create_selection_handlers(Evas_Object *obj, Efl_Ui_Text_Data *sd)
2929{
2930 Evas_Object *handle;
2931
2932 handle = _decoration_create(obj, sd, PART_NAME_HANDLER_START, EINA_TRUE);
2933 evas_object_pass_events_set(handle, EINA_FALSE);
2934 sd->start_handler = handle;
2935 evas_object_event_callback_add(handle, EVAS_CALLBACK_MOUSE_DOWN,
2936 _start_handler_mouse_down_cb, obj);
2937 evas_object_event_callback_add(handle, EVAS_CALLBACK_MOUSE_MOVE,
2938 _start_handler_mouse_move_cb, obj);
2939 evas_object_event_callback_add(handle, EVAS_CALLBACK_MOUSE_UP,
2940 _start_handler_mouse_up_cb, obj);
2941 evas_object_show(handle);
2942
2943 handle = _decoration_create(obj, sd, PART_NAME_HANDLER_END, EINA_TRUE);
2944 evas_object_pass_events_set(handle, EINA_FALSE);
2945 sd->end_handler = handle;
2946 evas_object_event_callback_add(handle, EVAS_CALLBACK_MOUSE_DOWN,
2947 _end_handler_mouse_down_cb, obj);
2948 evas_object_event_callback_add(handle, EVAS_CALLBACK_MOUSE_MOVE,
2949 _end_handler_mouse_move_cb, obj);
2950 evas_object_event_callback_add(handle, EVAS_CALLBACK_MOUSE_UP,
2951 _end_handler_mouse_up_cb, obj);
2952 evas_object_show(handle);
2953}
2954
2973EOLIAN static void 2955EOLIAN static void
2974_efl_ui_text_efl_canvas_group_group_add(Eo *obj, Efl_Ui_Text_Data *priv) 2956_efl_ui_text_efl_gfx_position_set(Eo *obj, Efl_Ui_Text_Data *sd, Eina_Position2D pos)
2975{ 2957{
2976 Eo *text_obj; 2958 if (_evas_object_intercept_call(obj, EVAS_OBJECT_INTERCEPT_CB_MOVE, 0, pos.x, pos.y))
2959 return;
2977 2960
2978 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); 2961 efl_gfx_position_set(efl_super(obj, MY_CLASS), pos);
2962 efl_gfx_position_set(sd->hit_rect, pos);
2979 2963
2980 text_obj = efl_add(EFL_UI_INTERNAL_TEXT_INTERACTIVE_CLASS, obj); 2964 if (sd->hoversel) _hoversel_position(obj);
2981 2965
2982 efl_composite_attach(obj, text_obj); 2966 _update_selection_handler(obj);
2983 priv->text_obj = text_obj; 2967}
2984 2968
2985 // FIXME: use the theme, when a proper theming option is available 2969EOLIAN static void
2986 // (possibly, text_classes). 2970_efl_ui_text_efl_gfx_size_set(Eo *obj, Efl_Ui_Text_Data *sd, Eina_Size2D sz)
2987 // For now, set this for easier setup 2971{
2988 efl_text_font_set(text_obj, "Sans", 12); 2972 if (_evas_object_intercept_call(obj, EVAS_OBJECT_INTERCEPT_CB_RESIZE, 0, sz.w, sz.h))
2989 efl_text_normal_color_set(text_obj, 255, 255, 255, 255); 2973 return;
2974
2975 efl_gfx_size_set(sd->hit_rect, sz);
2976 _update_selection_handler(obj);
2977
2978 efl_gfx_size_set(efl_super(obj, MY_CLASS), sz);
2979}
2980
2981EOLIAN static void
2982_efl_ui_text_efl_gfx_visible_set(Eo *obj, Efl_Ui_Text_Data *sd EINA_UNUSED, Eina_Bool vis)
2983{
2984 if (_evas_object_intercept_call(obj, EVAS_OBJECT_INTERCEPT_CB_VISIBLE, 0, vis))
2985 return;
2986
2987 efl_gfx_visible_set(efl_super(obj, MY_CLASS), vis);
2988 if (vis) _update_selection_handler(obj);
2989}
2990
2991EOLIAN static void
2992_efl_ui_text_efl_canvas_group_group_member_add(Eo *obj, Efl_Ui_Text_Data *sd, Evas_Object *member)
2993{
2994 efl_canvas_group_member_add(efl_super(obj, MY_CLASS), member);
2995
2996 if (sd->hit_rect)
2997 evas_object_raise(sd->hit_rect);
2998}
2999
3000static void
3001_cb_added(void *data EINA_UNUSED, const Efl_Event *ev)
3002{
3003 const Efl_Callback_Array_Item *event = ev->info;
3004
3005 EFL_UI_TEXT_DATA_GET(ev->object, sd);
3006 if (event->desc == EFL_UI_TEXT_EVENT_VALIDATE)
3007 sd->validators++;
3008}
3009
3010static void
3011_cb_deleted(void *data EINA_UNUSED, const Efl_Event *ev)
3012{
3013 const Efl_Callback_Array_Item *event = ev->info;
3014
3015 EFL_UI_TEXT_DATA_GET(ev->object, sd);
3016 if (event->desc == EFL_UI_TEXT_EVENT_VALIDATE)
3017 sd->validators--;
3018 return;
3019
3020}
3021
3022EOLIAN static Eo *
3023_efl_ui_text_efl_object_constructor(Eo *obj, Efl_Ui_Text_Data *sd)
3024{
3025 Eo *text_obj;
3026
3027 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, NULL);
3028
3029 if (!elm_widget_theme_klass_get(obj))
3030 elm_widget_theme_klass_set(obj, "text");
3031 obj = efl_constructor(efl_super(obj, MY_CLASS));
2990 3032
2991 efl_canvas_group_add(efl_super(obj, MY_CLASS));
2992 elm_widget_sub_object_parent_add(obj); 3033 elm_widget_sub_object_parent_add(obj);
2993 3034
2994 priv->entry_edje = wd->resize_obj; 3035 evas_object_smart_callbacks_descriptions_set(obj, _smart_callbacks);
3036 efl_access_role_set(obj, EFL_ACCESS_ROLE_ENTRY);
3037 efl_event_callback_add(obj, EFL_EVENT_CALLBACK_ADD, _cb_added, NULL);
3038 efl_event_callback_add(obj, EFL_EVENT_CALLBACK_DEL, _cb_deleted, NULL);
2995 3039
2996 priv->cnp_mode = ELM_CNP_MODE_PLAINTEXT; 3040 sd->entry_edje = wd->resize_obj;
2997 priv->line_wrap = ELM_WRAP_WORD;
2998 priv->context_menu = EINA_TRUE;
2999 priv->auto_save = EINA_TRUE;
3000 priv->editable = EINA_TRUE;
3001 priv->sel_allow = EINA_TRUE;
3002 3041
3003 priv->single_line = !efl_text_multiline_get(text_obj); 3042 sd->cnp_mode = ELM_CNP_MODE_PLAINTEXT;
3043 sd->line_wrap = ELM_WRAP_WORD;
3044 sd->context_menu = EINA_TRUE;
3045 sd->auto_save = EINA_TRUE;
3046 sd->editable = EINA_TRUE;
3047 sd->sel_allow = EINA_TRUE;
3004 3048
3005 priv->drop_format = ELM_SEL_FORMAT_MARKUP | ELM_SEL_FORMAT_IMAGE; 3049 sd->drop_format = ELM_SEL_FORMAT_MARKUP | ELM_SEL_FORMAT_IMAGE;
3006 elm_drop_target_add(obj, priv->drop_format, 3050 elm_drop_target_add(obj, sd->drop_format,
3007 _dnd_enter_cb, NULL, 3051 _dnd_enter_cb, NULL,
3008 _dnd_leave_cb, NULL, 3052 _dnd_leave_cb, NULL,
3009 _dnd_pos_cb, NULL, 3053 _dnd_pos_cb, NULL,
3010 _dnd_drop_cb, NULL); 3054 _dnd_drop_cb, NULL);
3011 3055
3012 if (!elm_widget_theme_klass_get(obj))
3013 elm_widget_theme_klass_set(obj, "text");
3014 if (!elm_widget_theme_object_set(obj, wd->resize_obj, 3056 if (!elm_widget_theme_object_set(obj, wd->resize_obj,
3015 elm_widget_theme_klass_get(obj), 3057 elm_widget_theme_klass_get(obj),
3016 _efl_ui_text_theme_group_get(obj), 3058 elm_widget_theme_element_get(obj),
3017 elm_widget_theme_style_get(obj))) 3059 elm_widget_theme_style_get(obj)))
3018 CRI("Failed to set layout!"); 3060 CRI("Failed tp set layout!");
3061
3062 text_obj = efl_add(EFL_UI_INTERNAL_TEXT_INTERACTIVE_CLASS, obj);
3019 3063
3020 edje_object_part_swallow(priv->entry_edje, "elm.text", text_obj); 3064 efl_composite_attach(obj, text_obj);
3065 sd->text_obj = text_obj;
3066
3067 // FIXME: use the theme, when a proper theming option is available
3068 // (possibly, text_classes).
3069 // For now, set this for easier setup
3070 efl_text_font_set(text_obj, "Sans", 12);
3071 efl_text_normal_color_set(text_obj, 255, 255, 255, 255);
3072 efl_ui_text_interactive_editable_set(obj, EINA_FALSE);
3073
3074 sd->single_line = !efl_text_multiline_get(text_obj);
3075
3076 edje_object_part_swallow(sd->entry_edje, "elm.text", text_obj);
3021 evas_object_size_hint_weight_set 3077 evas_object_size_hint_weight_set
3022 (priv->entry_edje, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); 3078 (sd->entry_edje, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
3023 evas_object_size_hint_align_set 3079 evas_object_size_hint_align_set
3024 (priv->entry_edje, EVAS_HINT_FILL, EVAS_HINT_FILL); 3080 (sd->entry_edje, EVAS_HINT_FILL, EVAS_HINT_FILL);
3025 efl_event_callback_add(text_obj, EFL_UI_TEXT_INTERACTIVE_EVENT_CHANGED_USER, 3081 efl_event_callback_add(text_obj, EFL_UI_TEXT_INTERACTIVE_EVENT_CHANGED_USER,
3026 _efl_ui_text_changed_cb, obj); 3082 _efl_ui_text_changed_cb, obj);
3027 efl_event_callback_add(text_obj, EFL_CANVAS_TEXT_EVENT_CHANGED, 3083 efl_event_callback_add(text_obj, EFL_CANVAS_TEXT_EVENT_CHANGED,
@@ -3030,11 +3086,11 @@ _efl_ui_text_efl_canvas_group_group_add(Eo *obj, Efl_Ui_Text_Data *priv)
3030 _efl_ui_text_selection_changed_cb, obj); 3086 _efl_ui_text_selection_changed_cb, obj);
3031 efl_event_callback_add(text_obj, EFL_CANVAS_TEXT_EVENT_CURSOR_CHANGED, 3087 efl_event_callback_add(text_obj, EFL_CANVAS_TEXT_EVENT_CURSOR_CHANGED,
3032 _efl_ui_text_cursor_changed_cb, obj); 3088 _efl_ui_text_cursor_changed_cb, obj);
3033 evas_object_event_callback_add(priv->entry_edje, EVAS_CALLBACK_MOVE, 3089 evas_object_event_callback_add(sd->entry_edje, EVAS_CALLBACK_MOVE,
3034 _efl_ui_text_move_cb, obj); 3090 _efl_ui_text_move_cb, obj);
3035 3091
3036 /* Async layout */ 3092 /* Async layout */
3037 if (priv->async.enabled) 3093 if (sd->async.enabled)
3038 { 3094 {
3039#if 0 3095#if 0
3040 efl_event_callback_add(text_obj, 3096 efl_event_callback_add(text_obj,
@@ -3043,120 +3099,118 @@ _efl_ui_text_efl_canvas_group_group_add(Eo *obj, Efl_Ui_Text_Data *priv)
3043#endif 3099#endif
3044 } 3100 }
3045 3101
3046 priv->hit_rect = evas_object_rectangle_add(evas_object_evas_get(obj)); 3102 sd->hit_rect = evas_object_rectangle_add(evas_object_evas_get(obj));
3047 evas_object_data_set(priv->hit_rect, "_elm_leaveme", obj); 3103 evas_object_data_set(sd->hit_rect, "_elm_leaveme", obj);
3048 3104
3049 Evas_Object* clip = evas_object_clip_get(priv->entry_edje); 3105 Evas_Object* clip = evas_object_clip_get(sd->entry_edje);
3050 evas_object_clip_set(priv->hit_rect, clip); 3106 evas_object_clip_set(sd->hit_rect, clip);
3051 3107
3052 evas_object_smart_member_add(priv->hit_rect, obj); 3108 evas_object_smart_member_add(sd->hit_rect, obj);
3053 elm_widget_sub_object_add(obj, priv->hit_rect); 3109 elm_widget_sub_object_add(obj, sd->hit_rect);
3054 3110
3055 /* common scroller hit rectangle setup */ 3111 /* common scroller hit rectangle setup */
3056 evas_object_color_set(priv->hit_rect, 0, 0, 0, 0); 3112 evas_object_color_set(sd->hit_rect, 0, 0, 0, 0);
3057 evas_object_show(priv->hit_rect); 3113 evas_object_show(sd->hit_rect);
3058 evas_object_repeat_events_set(priv->hit_rect, EINA_TRUE); 3114 evas_object_repeat_events_set(sd->hit_rect, EINA_TRUE);
3059 3115
3060 elm_interface_scrollable_objects_set(obj, priv->entry_edje, priv->hit_rect); 3116 elm_interface_scrollable_objects_set(obj, sd->entry_edje, sd->hit_rect);
3061 3117
3062 edje_object_text_markup_filter_callback_add 3118 edje_object_text_markup_filter_callback_add
3063 (priv->entry_edje, "elm.text", _markup_filter_cb, obj); 3119 (sd->entry_edje, "elm.text", _markup_filter_cb, obj);
3064 3120
3065 evas_object_event_callback_add 3121 evas_object_event_callback_add
3066 (priv->entry_edje, EVAS_CALLBACK_KEY_DOWN, _key_down_cb, obj); 3122 (sd->entry_edje, EVAS_CALLBACK_KEY_DOWN, _key_down_cb, obj);
3067 evas_object_event_callback_add 3123 evas_object_event_callback_add
3068 (priv->entry_edje, EVAS_CALLBACK_MOUSE_DOWN, _mouse_down_cb, obj); 3124 (sd->entry_edje, EVAS_CALLBACK_MOUSE_DOWN, _mouse_down_cb, obj);
3069 evas_object_event_callback_add 3125 evas_object_event_callback_add
3070 (priv->entry_edje, EVAS_CALLBACK_MOUSE_UP, _mouse_up_cb, obj); 3126 (sd->entry_edje, EVAS_CALLBACK_MOUSE_UP, _mouse_up_cb, obj);
3071 evas_object_event_callback_add 3127 evas_object_event_callback_add
3072 (priv->entry_edje, EVAS_CALLBACK_MOUSE_MOVE, _mouse_move_cb, obj); 3128 (sd->entry_edje, EVAS_CALLBACK_MOUSE_MOVE, _mouse_move_cb, obj);
3073 3129
3074 /* this code can't go in smart_resize. sizing gets wrong */ 3130 /* this code can't go in smart_resize. sizing gets wrong */
3075 evas_object_event_callback_add(obj, EVAS_CALLBACK_RESIZE, _resize_cb, obj); 3131 evas_object_event_callback_add(obj, EVAS_CALLBACK_RESIZE, _resize_cb, obj);
3076 3132
3077 edje_object_signal_callback_add 3133 edje_object_signal_callback_add
3078 (priv->entry_edje, "entry,changed,user", "elm.text", 3134 (sd->entry_edje, "entry,changed,user", "elm.text",
3079 _entry_changed_user_signal_cb, obj); 3135 _entry_changed_user_signal_cb, obj);
3080 edje_object_signal_callback_add 3136 edje_object_signal_callback_add
3081 (priv->entry_edje, "preedit,changed", "elm.text", 3137 (sd->entry_edje, "preedit,changed", "elm.text",
3082 _entry_preedit_changed_signal_cb, obj); 3138 _entry_preedit_changed_signal_cb, obj);
3083 3139
3084 edje_object_signal_callback_add 3140 edje_object_signal_callback_add
3085 (priv->entry_edje, "cursor,changed", "elm.text", 3141 (sd->entry_edje, "cursor,changed", "elm.text",
3086 _entry_cursor_changed_signal_cb, obj); 3142 _entry_cursor_changed_signal_cb, obj);
3087 edje_object_signal_callback_add 3143 edje_object_signal_callback_add
3088 (priv->entry_edje, "cursor,changed,manual", "elm.text", 3144 (sd->entry_edje, "cursor,changed,manual", "elm.text",
3089 _entry_cursor_changed_manual_signal_cb, obj); 3145 _entry_cursor_changed_manual_signal_cb, obj);
3090 edje_object_signal_callback_add 3146 edje_object_signal_callback_add
3091 (priv->entry_edje, "anchor,mouse,down,*", "elm.text", 3147 (sd->entry_edje, "anchor,mouse,down,*", "elm.text",
3092 _entry_anchor_down_signal_cb, obj); 3148 _entry_anchor_down_signal_cb, obj);
3093 edje_object_signal_callback_add 3149 edje_object_signal_callback_add
3094 (priv->entry_edje, "anchor,mouse,up,*", "elm.text", 3150 (sd->entry_edje, "anchor,mouse,up,*", "elm.text",
3095 _entry_anchor_up_signal_cb, obj); 3151 _entry_anchor_up_signal_cb, obj);
3096 edje_object_signal_callback_add 3152 edje_object_signal_callback_add
3097 (priv->entry_edje, "anchor,mouse,move,*", "elm.text", 3153 (sd->entry_edje, "anchor,mouse,move,*", "elm.text",
3098 _entry_anchor_move_signal_cb, obj); 3154 _entry_anchor_move_signal_cb, obj);
3099 edje_object_signal_callback_add 3155 edje_object_signal_callback_add
3100 (priv->entry_edje, "anchor,mouse,in,*", "elm.text", 3156 (sd->entry_edje, "anchor,mouse,in,*", "elm.text",
3101 _entry_anchor_in_signal_cb, obj); 3157 _entry_anchor_in_signal_cb, obj);
3102 edje_object_signal_callback_add 3158 edje_object_signal_callback_add
3103 (priv->entry_edje, "anchor,mouse,out,*", "elm.text", 3159 (sd->entry_edje, "anchor,mouse,out,*", "elm.text",
3104 _entry_anchor_out_signal_cb, obj); 3160 _entry_anchor_out_signal_cb, obj);
3105 edje_object_signal_callback_add 3161 edje_object_signal_callback_add
3106 (priv->entry_edje, "entry,key,enter", "elm.text", 3162 (sd->entry_edje, "entry,key,enter", "elm.text",
3107 _entry_key_enter_signal_cb, obj); 3163 _entry_key_enter_signal_cb, obj);
3108 edje_object_signal_callback_add 3164 edje_object_signal_callback_add
3109 (priv->entry_edje, "entry,key,escape", "elm.text", 3165 (sd->entry_edje, "entry,key,escape", "elm.text",
3110 _entry_key_escape_signal_cb, obj); 3166 _entry_key_escape_signal_cb, obj);
3111 edje_object_signal_callback_add 3167 edje_object_signal_callback_add
3112 (priv->entry_edje, "mouse,down,1", "elm.text", 3168 (sd->entry_edje, "mouse,down,1", "elm.text",
3113 _entry_mouse_down_signal_cb, obj); 3169 _entry_mouse_down_signal_cb, obj);
3114 edje_object_signal_callback_add 3170 edje_object_signal_callback_add
3115 (priv->entry_edje, "mouse,clicked,1", "elm.text", 3171 (sd->entry_edje, "mouse,clicked,1", "elm.text",
3116 _entry_mouse_clicked_signal_cb, obj); 3172 _entry_mouse_clicked_signal_cb, obj);
3117 edje_object_signal_callback_add 3173 edje_object_signal_callback_add
3118 (priv->entry_edje, "mouse,down,1,double", "elm.text", 3174 (sd->entry_edje, "mouse,down,1,double", "elm.text",
3119 _entry_mouse_double_signal_cb, obj); 3175 _entry_mouse_double_signal_cb, obj);
3120 edje_object_signal_callback_add 3176 edje_object_signal_callback_add
3121 (priv->entry_edje, "mouse,down,1,triple", "elm.text", 3177 (sd->entry_edje, "mouse,down,1,triple", "elm.text",
3122 _entry_mouse_triple_signal_cb, obj); 3178 _entry_mouse_triple_signal_cb, obj);
3123 edje_object_signal_callback_add 3179 edje_object_signal_callback_add
3124 (priv->entry_edje, "entry,undo,request", "elm.text", 3180 (sd->entry_edje, "entry,undo,request", "elm.text",
3125 _entry_undo_request_signal_cb, obj); 3181 _entry_undo_request_signal_cb, obj);
3126 edje_object_signal_callback_add 3182 edje_object_signal_callback_add
3127 (priv->entry_edje, "entry,redo,request", "elm.text", 3183 (sd->entry_edje, "entry,redo,request", "elm.text",
3128 _entry_redo_request_signal_cb, obj); 3184 _entry_redo_request_signal_cb, obj);
3129 3185
3130 efl_text_set(priv->text_obj, ""); 3186 efl_text_set(sd->text_obj, "");
3131 3187
3132 elm_object_sub_cursor_set 3188 elm_object_sub_cursor_set
3133 (wd->resize_obj, obj, ELM_CURSOR_XTERM); 3189 (wd->resize_obj, obj, ELM_CURSOR_XTERM);
3134 elm_widget_can_focus_set(obj, EINA_TRUE); 3190 elm_widget_can_focus_set(obj, EINA_TRUE);
3135 if (_elm_config->desktop_entry) 3191 if (_elm_config->desktop_entry)
3136 edje_object_part_text_select_allow_set 3192 edje_object_part_text_select_allow_set
3137 (priv->entry_edje, "elm.text", EINA_TRUE); 3193 (sd->entry_edje, "elm.text", EINA_TRUE);
3138
3139 //elm_layout_sizing_eval(obj);
3140 3194
3141 efl_ui_text_input_panel_layout_set(obj, ELM_INPUT_PANEL_LAYOUT_NORMAL); 3195 efl_ui_text_input_panel_layout_set(obj, ELM_INPUT_PANEL_LAYOUT_NORMAL);
3142 efl_ui_text_input_panel_enabled_set(obj, EINA_TRUE); 3196 efl_ui_text_input_panel_enabled_set(obj, EINA_TRUE);
3143 efl_ui_text_prediction_allow_set(obj, EINA_TRUE); 3197 efl_ui_text_prediction_allow_set(obj, EINA_TRUE);
3144 efl_ui_text_input_hint_set(obj, ELM_INPUT_HINT_AUTO_COMPLETE); 3198 efl_ui_text_input_hint_set(obj, ELM_INPUT_HINT_AUTO_COMPLETE);
3145 3199
3146 priv->autocapital_type = (Elm_Autocapital_Type)edje_object_part_text_autocapital_type_get 3200 sd->autocapital_type = (Elm_Autocapital_Type)edje_object_part_text_autocapital_type_get
3147 (priv->entry_edje, "elm.text"); 3201 (sd->entry_edje, "elm.text");
3148 3202
3149 entries = eina_list_prepend(entries, obj); 3203 entries = eina_list_prepend(entries, obj);
3150 3204
3151 // module - find module for entry 3205 // module - find module for entry
3152 priv->api = _module_find(obj); 3206 sd->api = _module_find(obj);
3153 // if found - hook in 3207 // if found - hook in
3154 if ((priv->api) && (priv->api->obj_hook)) priv->api->obj_hook(obj); 3208 if ((sd->api) && (sd->api->obj_hook)) sd->api->obj_hook(obj);
3155 3209
3156 _mirrored_set(obj, efl_ui_mirrored_get(obj)); 3210 _mirrored_set(obj, efl_ui_mirrored_get(obj));
3157 3211
3158 // access 3212 // access
3159 _elm_access_object_register(obj, priv->entry_edje); 3213 _elm_access_object_register(obj, sd->entry_edje);
3160 _elm_access_text_set 3214 _elm_access_text_set
3161 (_elm_access_info_get(obj), ELM_ACCESS_TYPE, E_("Entry")); 3215 (_elm_access_info_get(obj), ELM_ACCESS_TYPE, E_("Entry"));
3162 _elm_access_callback_set 3216 _elm_access_callback_set
@@ -3165,41 +3219,15 @@ _efl_ui_text_efl_canvas_group_group_add(Eo *obj, Efl_Ui_Text_Data *priv)
3165 (_elm_access_info_get(obj), ELM_ACCESS_STATE, _access_state_cb, NULL); 3219 (_elm_access_info_get(obj), ELM_ACCESS_STATE, _access_state_cb, NULL);
3166 3220
3167 if (_elm_config->desktop_entry) 3221 if (_elm_config->desktop_entry)
3168 priv->sel_handler_disabled = EINA_TRUE; 3222 sd->sel_handler_disabled = EINA_TRUE;
3169 3223
3170 _create_text_cursors(obj, priv); 3224 _create_text_cursors(obj, sd);
3171}
3172 3225
3173static void 3226 return obj;
3174_create_selection_handlers(Evas_Object *obj, Efl_Ui_Text_Data *sd)
3175{
3176 Evas_Object *handle;
3177
3178 handle = _decoration_create(obj, sd, PART_NAME_HANDLER_START, EINA_TRUE);
3179 evas_object_pass_events_set(handle, EINA_FALSE);
3180 sd->start_handler = handle;
3181 evas_object_event_callback_add(handle, EVAS_CALLBACK_MOUSE_DOWN,
3182 _start_handler_mouse_down_cb, obj);
3183 evas_object_event_callback_add(handle, EVAS_CALLBACK_MOUSE_MOVE,
3184 _start_handler_mouse_move_cb, obj);
3185 evas_object_event_callback_add(handle, EVAS_CALLBACK_MOUSE_UP,
3186 _start_handler_mouse_up_cb, obj);
3187 evas_object_show(handle);
3188
3189 handle = _decoration_create(obj, sd, PART_NAME_HANDLER_END, EINA_TRUE);
3190 evas_object_pass_events_set(handle, EINA_FALSE);
3191 sd->end_handler = handle;
3192 evas_object_event_callback_add(handle, EVAS_CALLBACK_MOUSE_DOWN,
3193 _end_handler_mouse_down_cb, obj);
3194 evas_object_event_callback_add(handle, EVAS_CALLBACK_MOUSE_MOVE,
3195 _end_handler_mouse_move_cb, obj);
3196 evas_object_event_callback_add(handle, EVAS_CALLBACK_MOUSE_UP,
3197 _end_handler_mouse_up_cb, obj);
3198 evas_object_show(handle);
3199} 3227}
3200 3228
3201EOLIAN static void 3229EOLIAN static void
3202_efl_ui_text_efl_canvas_group_group_del(Eo *obj, Efl_Ui_Text_Data *sd) 3230_efl_ui_text_efl_object_destructor(Eo *obj, Efl_Ui_Text_Data *sd)
3203{ 3231{
3204 Elm_Entry_Context_Menu_Item *it; 3232 Elm_Entry_Context_Menu_Item *it;
3205 Elm_Entry_Item_Provider *ip; 3233 Elm_Entry_Item_Provider *ip;
@@ -3288,95 +3316,10 @@ _efl_ui_text_efl_canvas_group_group_del(Eo *obj, Efl_Ui_Text_Data *sd)
3288 // a specific behavior of SWALLOW parts. 3316 // a specific behavior of SWALLOW parts.
3289 efl_del(sd->text_obj); 3317 efl_del(sd->text_obj);
3290 sd->text_obj = NULL; 3318 sd->text_obj = NULL;
3291 efl_canvas_group_del(efl_super(obj, MY_CLASS));
3292}
3293
3294EOLIAN static void
3295_efl_ui_text_efl_gfx_position_set(Eo *obj, Efl_Ui_Text_Data *sd, Eina_Position2D pos)
3296{
3297 if (_evas_object_intercept_call(obj, EVAS_OBJECT_INTERCEPT_CB_MOVE, 0, pos.x, pos.y))
3298 return;
3299
3300 efl_gfx_position_set(efl_super(obj, MY_CLASS), pos);
3301 efl_gfx_position_set(sd->hit_rect, pos);
3302
3303 if (sd->hoversel) _hoversel_position(obj);
3304
3305 _update_selection_handler(obj);
3306}
3307 3319
3308EOLIAN static void 3320 ecore_job_del(sd->deferred_decoration_job);
3309_efl_ui_text_efl_gfx_size_set(Eo *obj, Efl_Ui_Text_Data *sd, Eina_Size2D sz) 3321 sd->deferred_decoration_job = NULL;
3310{
3311 if (_evas_object_intercept_call(obj, EVAS_OBJECT_INTERCEPT_CB_RESIZE, 0, sz.w, sz.h))
3312 return;
3313
3314 efl_gfx_size_set(sd->hit_rect, sz);
3315 _update_selection_handler(obj);
3316
3317 efl_gfx_size_set(efl_super(obj, MY_CLASS), sz);
3318}
3319
3320EOLIAN static void
3321_efl_ui_text_efl_gfx_visible_set(Eo *obj, Efl_Ui_Text_Data *sd EINA_UNUSED, Eina_Bool vis)
3322{
3323 if (_evas_object_intercept_call(obj, EVAS_OBJECT_INTERCEPT_CB_VISIBLE, 0, vis))
3324 return;
3325
3326 efl_gfx_visible_set(efl_super(obj, MY_CLASS), vis);
3327 if (vis) _update_selection_handler(obj);
3328}
3329
3330EOLIAN static void
3331_efl_ui_text_efl_canvas_group_group_member_add(Eo *obj, Efl_Ui_Text_Data *sd, Evas_Object *member)
3332{
3333 efl_canvas_group_member_add(efl_super(obj, MY_CLASS), member);
3334
3335 if (sd->hit_rect)
3336 evas_object_raise(sd->hit_rect);
3337}
3338
3339static void
3340_cb_added(void *data EINA_UNUSED, const Efl_Event *ev)
3341{
3342 const Efl_Callback_Array_Item *event = ev->info;
3343
3344 EFL_UI_TEXT_DATA_GET(ev->object, sd);
3345 if (event->desc == EFL_UI_TEXT_EVENT_VALIDATE)
3346 sd->validators++;
3347}
3348
3349static void
3350_cb_deleted(void *data EINA_UNUSED, const Efl_Event *ev)
3351{
3352 const Efl_Callback_Array_Item *event = ev->info;
3353
3354 EFL_UI_TEXT_DATA_GET(ev->object, sd);
3355 if (event->desc == EFL_UI_TEXT_EVENT_VALIDATE)
3356 sd->validators--;
3357 return;
3358
3359}
3360
3361EOLIAN static Eo *
3362_efl_ui_text_efl_object_constructor(Eo *obj, Efl_Ui_Text_Data *pd EINA_UNUSED)
3363{
3364 obj = efl_constructor(efl_super(obj, MY_CLASS));
3365 efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY);
3366 evas_object_smart_callbacks_descriptions_set(obj, _smart_callbacks);
3367 efl_access_role_set(obj, EFL_ACCESS_ROLE_ENTRY);
3368 efl_event_callback_add(obj, EFL_EVENT_CALLBACK_ADD, _cb_added, NULL);
3369 efl_event_callback_add(obj, EFL_EVENT_CALLBACK_DEL, _cb_deleted, NULL);
3370 efl_ui_text_interactive_editable_set(obj, EINA_FALSE);
3371
3372 return obj;
3373}
3374 3322
3375EOLIAN static void
3376_efl_ui_text_efl_object_destructor(Eo *obj EINA_UNUSED, Efl_Ui_Text_Data *pd)
3377{
3378 ecore_job_del(pd->deferred_decoration_job);
3379 pd->deferred_decoration_job = NULL;
3380 efl_destructor(efl_super(obj, MY_CLASS)); 3323 efl_destructor(efl_super(obj, MY_CLASS));
3381} 3324}
3382 3325
@@ -4050,12 +3993,6 @@ _efl_ui_text_elm_widget_on_access_activate(Eo *obj, Efl_Ui_Text_Data *_pd EINA_U
4050 return EINA_TRUE; 3993 return EINA_TRUE;
4051} 3994}
4052 3995
4053static void
4054_efl_ui_text_class_constructor(Efl_Class *klass)
4055{
4056 evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass);
4057}
4058
4059// ATSPI Accessibility 3996// ATSPI Accessibility
4060 3997
4061EOLIAN static Eina_Unicode 3998EOLIAN static Eina_Unicode
@@ -5362,31 +5299,28 @@ ELM_PART_OVERRIDE_CONTENT_UNSET(elm_entry, EFL_UI_TEXT, Efl_Ui_Text_Data)
5362 5299
5363/* Internal EO APIs and hidden overrides */ 5300/* Internal EO APIs and hidden overrides */
5364 5301
5365ELM_LAYOUT_CONTENT_ALIASES_IMPLEMENT(MY_CLASS_PFX) 5302//ELM_LAYOUT_CONTENT_ALIASES_IMPLEMENT(MY_CLASS_PFX)
5366 5303
5367#define EFL_UI_TEXT_EXTRA_OPS \ 5304#define EFL_UI_TEXT_EXTRA_OPS \
5368 EFL_CANVAS_GROUP_ADD_DEL_OPS(efl_ui_text), \
5369 ELM_LAYOUT_SIZING_EVAL_OPS(efl_ui_text), \ 5305 ELM_LAYOUT_SIZING_EVAL_OPS(efl_ui_text), \
5370 ELM_LAYOUT_CONTENT_ALIASES_OPS(MY_CLASS_PFX), \
5371 5306
5372#include "efl_ui_text.eo.c" 5307#include "efl_ui_text.eo.c"
5373 5308
5374EOLIAN static void 5309EOLIAN static Eo *
5375_efl_ui_text_async_efl_canvas_group_group_add(Eo *obj, void *_pd EINA_UNUSED) 5310_efl_ui_text_async_efl_object_constructor(Eo *obj, void *_pd EINA_UNUSED)
5376{ 5311{
5377 EFL_UI_TEXT_DATA_GET(obj, sd); 5312 EFL_UI_TEXT_DATA_GET(obj, sd);
5313
5378 sd->async.enabled = EINA_TRUE; 5314 sd->async.enabled = EINA_TRUE;
5379 efl_canvas_group_add(efl_super(obj, EFL_UI_TEXT_ASYNC_CLASS));
5380}
5381 5315
5382EOLIAN static void 5316 // FIXME: should we have to keep this efl_ui_text_xxx classes?
5383_efl_ui_text_async_efl_canvas_group_group_del(Eo *obj, void *_pd EINA_UNUSED) 5317 // Then, going to make new theme for these classes? ex) efl/text_async?
5384{ 5318 if (!elm_widget_theme_klass_get(obj))
5385 efl_canvas_group_del(efl_super(obj, EFL_UI_TEXT_ASYNC_CLASS)); 5319 elm_widget_theme_klass_set(obj, "text");
5386} 5320 obj = efl_constructor(efl_super(obj, EFL_UI_TEXT_ASYNC_CLASS));
5387 5321
5388#define EFL_UI_TEXT_ASYNC_EXTRA_OPS \ 5322 return obj;
5389 EFL_CANVAS_GROUP_ADD_DEL_OPS(efl_ui_text_async) 5323}
5390 5324
5391#include "efl_ui_text_async.eo.c" 5325#include "efl_ui_text_async.eo.c"
5392 5326
@@ -5397,6 +5331,10 @@ _efl_ui_text_async_efl_canvas_group_group_del(Eo *obj, void *_pd EINA_UNUSED)
5397EOLIAN static Eo * 5331EOLIAN static Eo *
5398_efl_ui_text_editable_efl_object_constructor(Eo *obj, void *_pd EINA_UNUSED) 5332_efl_ui_text_editable_efl_object_constructor(Eo *obj, void *_pd EINA_UNUSED)
5399{ 5333{
5334 // FIXME: should we have to keep this efl_ui_text_xxx classes?
5335 // Then, going to make new theme for these classes? ex) efl/text_editable?
5336 if (!elm_widget_theme_klass_get(obj))
5337 elm_widget_theme_klass_set(obj, "text");
5400 obj = efl_constructor(efl_super(obj, MY_CLASS)); 5338 obj = efl_constructor(efl_super(obj, MY_CLASS));
5401 efl_ui_text_interactive_editable_set(obj, EINA_TRUE); 5339 efl_ui_text_interactive_editable_set(obj, EINA_TRUE);
5402 5340
diff --git a/src/lib/elementary/efl_ui_text.eo b/src/lib/elementary/efl_ui_text.eo
index 567d692630..54b6addf93 100644
--- a/src/lib/elementary/efl_ui_text.eo
+++ b/src/lib/elementary/efl_ui_text.eo
@@ -348,7 +348,6 @@ class Efl.Ui.Text (Efl.Ui.Layout, Elm.Interface_Scrollable, Efl.Ui.Clickable,
348 } 348 }
349 } 349 }
350 implements { 350 implements {
351 class.constructor;
352 Efl.Object.constructor; 351 Efl.Object.constructor;
353 Efl.Object.destructor; 352 Efl.Object.destructor;
354 Efl.Gfx.visible { set; } 353 Efl.Gfx.visible { set; }
diff --git a/src/lib/elementary/efl_ui_text_async.eo b/src/lib/elementary/efl_ui_text_async.eo
index 0f57a8729b..52061e5380 100644
--- a/src/lib/elementary/efl_ui_text_async.eo
+++ b/src/lib/elementary/efl_ui_text_async.eo
@@ -6,6 +6,6 @@ class Efl.Ui.Text_Async (Efl.Ui.Text)
6 ]] 6 ]]
7 data: null; 7 data: null;
8 implements { 8 implements {
9 //Efl.Object.constructor; 9 Efl.Object.constructor;
10 } 10 }
11} 11}