summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorAli Alzyod <ali198724@gmail.com>2020-01-28 16:54:32 +0000
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2020-01-29 11:13:23 +0100
commitd53f83571a6f817343140b6e6fc6c18e1e111aaa (patch)
tree9407c5bdd0a95dd6c28f54d6c68d9832d9c875f5 /src/lib
parentbdf696a6076973d7091ba878ea2546d899154ff1 (diff)
efl.ui.textbox: clean up all evas_object related functions from stable methods/interfaces
This patch will: - Replace all Evas callbacks with unified ones. - Replace evas_object* methods with unified ones (For **stabilized** methods and interfaces) Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de> Differential Revision: https://phab.enlightenment.org/D11217
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/elementary/efl_ui_textbox.c304
1 files changed, 135 insertions, 169 deletions
diff --git a/src/lib/elementary/efl_ui_textbox.c b/src/lib/elementary/efl_ui_textbox.c
index 0976e81616..aa39ff5b16 100644
--- a/src/lib/elementary/efl_ui_textbox.c
+++ b/src/lib/elementary/efl_ui_textbox.c
@@ -125,7 +125,7 @@ struct _Anchor
125 if (EINA_UNLIKELY(!ptr)) \ 125 if (EINA_UNLIKELY(!ptr)) \
126 { \ 126 { \
127 ERR("No widget data for object %p (%s)", \ 127 ERR("No widget data for object %p (%s)", \
128 o, evas_object_type_get(o)); \ 128 o, efl_class_name_get(o)); \
129 return; \ 129 return; \
130 } 130 }
131 131
@@ -134,7 +134,7 @@ struct _Anchor
134 if (EINA_UNLIKELY(!ptr)) \ 134 if (EINA_UNLIKELY(!ptr)) \
135 { \ 135 { \
136 ERR("No widget data for object %p (%s)", \ 136 ERR("No widget data for object %p (%s)", \
137 o, evas_object_type_get(o)); \ 137 o, efl_class_name_get(o)); \
138 return val; \ 138 return val; \
139 } 139 }
140 140
@@ -197,7 +197,7 @@ static void _efl_ui_textbox_cursor_changed_cb(void *data, const Efl_Event *event
197static void _text_size_changed_cb(void *data, const Efl_Event *event EINA_UNUSED); 197static void _text_size_changed_cb(void *data, const Efl_Event *event EINA_UNUSED);
198static void _scroller_size_changed_cb(void *data, const Efl_Event *event EINA_UNUSED); 198static void _scroller_size_changed_cb(void *data, const Efl_Event *event EINA_UNUSED);
199static void _text_position_changed_cb(void *data, const Efl_Event *event EINA_UNUSED); 199static void _text_position_changed_cb(void *data, const Efl_Event *event EINA_UNUSED);
200static void _efl_ui_textbox_move_cb(void *data, Evas *e, Evas_Object *obj, void *event_info); 200static void _efl_ui_textbox_move_cb(void *data, const Efl_Event *event EINA_UNUSED);
201static const char* _efl_ui_textbox_selection_get(const Eo *obj, Efl_Ui_Textbox_Data *sd); 201static const char* _efl_ui_textbox_selection_get(const Eo *obj, Efl_Ui_Textbox_Data *sd);
202static void _edje_signal_emit(Efl_Ui_Textbox_Data *obj, const char *sig, const char *src); 202static void _edje_signal_emit(Efl_Ui_Textbox_Data *obj, const char *sig, const char *src);
203static void _decoration_defer_all(Eo *obj); 203static void _decoration_defer_all(Eo *obj);
@@ -276,10 +276,8 @@ _viewport_region_get(Evas_Object *obj)
276 { 276 {
277 if (efl_isa(parent, EFL_UI_SCROLLABLE_INTERFACE)) 277 if (efl_isa(parent, EFL_UI_SCROLLABLE_INTERFACE))
278 { 278 {
279 Eina_Rectangle r; 279 Eina_Rect r = efl_gfx_entity_geometry_get(parent);
280 EINA_RECTANGLE_SET(&r, 0, 0, 0, 0); 280 if (!eina_rectangle_intersection(&rect.rect, &r.rect))
281 evas_object_geometry_get(parent, &r.x, &r.y, &r.w, &r.h);
282 if (!eina_rectangle_intersection(&rect.rect, &r))
283 { 281 {
284 rect = EINA_RECT_EMPTY(); 282 rect = EINA_RECT_EMPTY();
285 break; 283 break;
@@ -329,7 +327,7 @@ _update_selection_handler(Eo *obj)
329 off = _decoration_calc_offset(sd); 327 off = _decoration_calc_offset(sd);
330 hx = off.x + sx; 328 hx = off.x + sx;
331 hy = off.y + sy + sh; 329 hy = off.y + sy + sh;
332 evas_object_move(sd->start_handler, hx, hy); 330 efl_gfx_entity_position_set(sd->start_handler, EINA_POSITION2D(hx, hy));
333 331
334 rect = _viewport_region_get(obj); 332 rect = _viewport_region_get(obj);
335 333
@@ -359,7 +357,7 @@ _update_selection_handler(Eo *obj)
359 357
360 hx = off.x + ex; 358 hx = off.x + ex;
361 hy = off.y + ey + eh; 359 hy = off.y + ey + eh;
362 evas_object_move(sd->end_handler, hx, hy); 360 efl_gfx_entity_position_set(sd->end_handler, EINA_POSITION2D(hx, hy));
363 361
364 if (!eina_rectangle_xcoord_inside(&rect.rect, hx) || 362 if (!eina_rectangle_xcoord_inside(&rect.rect, hx) ||
365 !eina_rectangle_ycoord_inside(&rect.rect, hy)) 363 !eina_rectangle_ycoord_inside(&rect.rect, hy))
@@ -450,14 +448,14 @@ _dnd_pos_cb(void *data EINA_UNUSED,
450 Elm_Xdnd_Action action EINA_UNUSED) 448 Elm_Xdnd_Action action EINA_UNUSED)
451{ 449{
452 int pos; 450 int pos;
453 Evas_Coord ox, oy, ex, ey; 451 Eina_Rect o, e;
454 452
455 EFL_UI_TEXT_DATA_GET(obj, sd); 453 EFL_UI_TEXT_DATA_GET(obj, sd);
456 454
457 evas_object_geometry_get(obj, &ox, &oy, NULL, NULL); 455 o = efl_gfx_entity_geometry_get(obj);
458 evas_object_geometry_get(sd->entry_edje, &ex, &ey, NULL, NULL); 456 e = efl_gfx_entity_geometry_get(sd->entry_edje);
459 x = x + ox - ex; 457 x = x + o.x - e.x;
460 y = y + oy - ey; 458 y = y + o.y - e.y;
461 459
462 edje_object_part_text_cursor_coord_set 460 edje_object_part_text_cursor_coord_set
463 (sd->entry_edje, "efl.text", EDJE_CURSOR_USER, x, y); 461 (sd->entry_edje, "efl.text", EDJE_CURSOR_USER, x, y);
@@ -570,7 +568,7 @@ _efl_ui_textbox_efl_ui_widget_theme_apply(Eo *obj, Efl_Ui_Textbox_Data *sd)
570 568
571 efl_layout_signal_process(sd->entry_edje, EINA_FALSE); 569 efl_layout_signal_process(sd->entry_edje, EINA_FALSE);
572 570
573 Evas_Object* clip = evas_object_clip_get(sd->entry_edje); 571 Evas_Object* clip = efl_canvas_object_clipper_get(sd->entry_edje);
574 efl_canvas_object_clipper_set(sd->hit_rect, clip); 572 efl_canvas_object_clipper_set(sd->hit_rect, clip);
575 573
576 if (sd->start_handler) 574 if (sd->start_handler)
@@ -604,16 +602,12 @@ _cursor_geometry_recalc(Evas_Object *obj)
604{ 602{
605 EFL_UI_TEXT_DATA_GET(obj, sd); 603 EFL_UI_TEXT_DATA_GET(obj, sd);
606 604
607 Evas_Coord x, y, w, h;
608 Evas_Coord x2, y2, w2, h2;
609 Evas_Coord cx, cy, cw, ch; 605 Evas_Coord cx, cy, cw, ch;
610 Eina_Rect rc; 606 Eina_Rect rc;
611 607
612 if (!efl_text_interactive_editable_get(obj)) return; 608 if (!efl_text_interactive_editable_get(obj)) return;
613 609
614 cx = cy = cw = ch = 0; 610 cx = cy = cw = ch = 0;
615 x2 = y2 = w2 = h2 = 0;
616 x = y = w = h = 0;
617 611
618 Efl_Text_Cursor *main_cur = 612 Efl_Text_Cursor *main_cur =
619 efl_text_interactive_main_cursor_get(obj); 613 efl_text_interactive_main_cursor_get(obj);
@@ -628,10 +622,6 @@ _cursor_geometry_recalc(Evas_Object *obj)
628 if (cw < 1) cw = 1; 622 if (cw < 1) cw = 1;
629 if (ch < 1) ch = 1; 623 if (ch < 1) ch = 1;
630 edje_object_size_min_restricted_calc(sd->cursor, &cw, NULL, cw, 0); 624 edje_object_size_min_restricted_calc(sd->cursor, &cw, NULL, cw, 0);
631 evas_object_geometry_get(sd->entry_edje, &x, &y, &w, &h);
632 evas_object_geometry_get(
633 sd->text_obj,
634 &x2, &y2, &w2, &h2);
635 625
636 efl_ui_scrollable_scroll(sd->scroller, EINA_RECT(cx, cy, cw, ch), EINA_FALSE); 626 efl_ui_scrollable_scroll(sd->scroller, EINA_RECT(cx, cy, cw, ch), EINA_FALSE);
637 627
@@ -746,7 +736,7 @@ _efl_ui_textbox_efl_ui_focus_object_on_focus_update(Eo *obj, Efl_Ui_Textbox_Data
746EOLIAN static Eina_Rect 736EOLIAN static Eina_Rect
747_efl_ui_textbox_efl_ui_widget_interest_region_get(const Eo *obj EINA_UNUSED, Efl_Ui_Textbox_Data *sd) 737_efl_ui_textbox_efl_ui_widget_interest_region_get(const Eo *obj EINA_UNUSED, Efl_Ui_Textbox_Data *sd)
748{ 738{
749 Evas_Coord edje_x, edje_y, elm_x, elm_y; 739 Eina_Rect edje, elm;
750 Eina_Rect r = {}; 740 Eina_Rect r = {};
751 741
752 r = efl_text_cursor_geometry_get( 742 r = efl_text_cursor_geometry_get(
@@ -754,15 +744,16 @@ _efl_ui_textbox_efl_ui_widget_interest_region_get(const Eo *obj EINA_UNUSED, Efl
754 744
755 if (!efl_text_multiline_get(obj)) 745 if (!efl_text_multiline_get(obj))
756 { 746 {
757 evas_object_geometry_get(sd->entry_edje, NULL, NULL, NULL, &r.h); 747 Eina_Rect rr = efl_gfx_entity_geometry_get(sd->entry_edje);
748 r.h = rr.h;
758 r.y = 0; 749 r.y = 0;
759 } 750 }
760 751
761 evas_object_geometry_get(sd->entry_edje, &edje_x, &edje_y, NULL, NULL); 752 edje = efl_gfx_entity_geometry_get(sd->entry_edje);
762 evas_object_geometry_get(obj, &elm_x, &elm_y, NULL, NULL); 753 elm = efl_gfx_entity_geometry_get(obj);
763 754
764 r.x += edje_x - elm_x; 755 r.x += edje.x - elm.x;
765 r.y += edje_y - elm_y; 756 r.y += edje.y - elm.y;
766 if (r.w < 1) r.w = 1; 757 if (r.w < 1) r.w = 1;
767 if (r.h < 1) r.h = 1; 758 if (r.h < 1) r.h = 1;
768 759
@@ -772,17 +763,19 @@ _efl_ui_textbox_efl_ui_widget_interest_region_get(const Eo *obj EINA_UNUSED, Efl
772static void 763static void
773_popup_position(Evas_Object *obj) 764_popup_position(Evas_Object *obj)
774{ 765{
775 Evas_Coord cx, cy, cw, ch, x, y, mw, mh, w, h; 766 Eina_Rect r;
767 Evas_Coord cx, cy, cw, ch;
768 Eina_Size2D m;
776 769
777 EFL_UI_TEXT_DATA_GET(obj, sd); 770 EFL_UI_TEXT_DATA_GET(obj, sd);
778 771
779 cx = cy = 0; 772 cx = cy = 0;
780 cw = ch = 1; 773 cw = ch = 1;
781 evas_object_geometry_get(sd->entry_edje, &x, &y, &w, &h); 774 r = efl_gfx_entity_geometry_get(sd->entry_edje);
782 if (sd->use_down) 775 if (sd->use_down)
783 { 776 {
784 cx = sd->downx - x; 777 cx = sd->downx - r.x;
785 cy = sd->downy - y; 778 cy = sd->downy - r.y;
786 cw = 1; 779 cw = 1;
787 ch = 1; 780 ch = 1;
788 } 781 }
@@ -790,12 +783,12 @@ _popup_position(Evas_Object *obj)
790 edje_object_part_text_cursor_geometry_get 783 edje_object_part_text_cursor_geometry_get
791 (sd->entry_edje, "efl.text", &cx, &cy, &cw, &ch); 784 (sd->entry_edje, "efl.text", &cx, &cy, &cw, &ch);
792 785
793 evas_object_size_hint_min_get(sd->popup, &mw, &mh); 786 m = efl_gfx_hint_size_restricted_min_get(sd->popup);
794 if (cx + mw > w) 787 if (cx + m.w > r.w)
795 cx = w - mw; 788 cx = r.w - m.w;
796 if (cy + mh > h) 789 if (cy + m.h > r.h)
797 cy = h - mh; 790 cy = r.h - m.h;
798 evas_object_geometry_set(sd->popup, x + cx, y + cy, mw, mh); 791 efl_gfx_entity_geometry_set(sd->popup, EINA_RECT(r.x + cx, r.y + cy, m.w, m.h));
799} 792}
800 793
801static Eina_Value 794static Eina_Value
@@ -1058,12 +1051,9 @@ _long_press_cb(void *data, const Efl_Event *ev EINA_UNUSED)
1058} 1051}
1059 1052
1060static void 1053static void
1061_key_down_cb(void *data, 1054_key_down_cb(void *data, const Efl_Event *event)
1062 Evas *evas EINA_UNUSED,
1063 Evas_Object *obj EINA_UNUSED,
1064 void *event_info)
1065{ 1055{
1066 Evas_Event_Key_Down *ev = event_info; 1056 Efl_Input_Key_Data *ev = efl_data_scope_get(event->info, EFL_INPUT_KEY_CLASS);
1067 Eina_Bool on_hold = EINA_FALSE; 1057 Eina_Bool on_hold = EINA_FALSE;
1068 1058
1069 /* First check if context menu disabled is false or not, and 1059 /* First check if context menu disabled is false or not, and
@@ -1106,19 +1096,16 @@ _key_down_cb(void *data,
1106} 1096}
1107 1097
1108static void 1098static void
1109_mouse_down_cb(void *data, 1099_mouse_down_cb(void *data, const Efl_Event *event)
1110 Evas *evas EINA_UNUSED,
1111 Evas_Object *obj EINA_UNUSED,
1112 void *event_info)
1113{ 1100{
1114 Evas_Event_Mouse_Down *ev = event_info; 1101 Efl_Input_Pointer_Data *ev;
1115 1102 ev = efl_data_scope_get(event->info, EFL_INPUT_POINTER_CLASS);
1116 EFL_UI_TEXT_DATA_GET(data, sd); 1103 EFL_UI_TEXT_DATA_GET(data, sd);
1117 1104
1118 if (efl_ui_widget_disabled_get(data)) return; 1105 if (efl_ui_widget_disabled_get(data)) return;
1119 if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return; 1106 if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return;
1120 sd->downx = ev->canvas.x; 1107 sd->downx = ev->cur.x;
1121 sd->downy = ev->canvas.y; 1108 sd->downy = ev->cur.y;
1122 sd->long_pressed = EINA_FALSE; 1109 sd->long_pressed = EINA_FALSE;
1123 1110
1124 1111
@@ -1140,12 +1127,10 @@ _mouse_down_cb(void *data,
1140} 1127}
1141 1128
1142static void 1129static void
1143_mouse_up_cb(void *data, 1130_mouse_up_cb(void *data, const Efl_Event *event)
1144 Evas *evas EINA_UNUSED,
1145 Evas_Object *obj EINA_UNUSED,
1146 void *event_info)
1147{ 1131{
1148 Evas_Event_Mouse_Up *ev = event_info; 1132 Efl_Input_Pointer_Data *ev;
1133 ev = efl_data_scope_get(event->info, EFL_INPUT_POINTER_CLASS);
1149 Efl_Object *top; 1134 Efl_Object *top;
1150 1135
1151 EFL_UI_TEXT_DATA_GET(data, sd); 1136 EFL_UI_TEXT_DATA_GET(data, sd);
@@ -1183,28 +1168,26 @@ _mouse_up_cb(void *data,
1183} 1168}
1184 1169
1185static void 1170static void
1186_mouse_move_cb(void *data, 1171_mouse_move_cb(void *data, const Efl_Event *event)
1187 Evas *evas EINA_UNUSED,
1188 Evas_Object *obj EINA_UNUSED,
1189 void *event_info)
1190{ 1172{
1191 Evas_Event_Mouse_Move *ev = event_info; 1173 Efl_Input_Pointer_Data *ev;
1174 ev = efl_data_scope_get(event->info, EFL_INPUT_POINTER_CLASS);
1192 Evas_Coord dx, dy; 1175 Evas_Coord dx, dy;
1193 1176
1194 EFL_UI_TEXT_DATA_GET(data, sd); 1177 EFL_UI_TEXT_DATA_GET(data, sd);
1195 1178
1196 if (efl_ui_widget_disabled_get(data)) return; 1179 if (efl_ui_widget_disabled_get(data)) return;
1197 if (ev->buttons == 1) 1180 if (ev->pressed_buttons == 1)
1198 { 1181 {
1199 if (sd->long_pressed) 1182 if (sd->long_pressed)
1200 { 1183 {
1201 Evas_Coord x, y; 1184 Eina_Rect r;
1202 Eina_Bool rv; 1185 Eina_Bool rv;
1203 1186
1204 evas_object_geometry_get(sd->entry_edje, &x, &y, NULL, NULL); 1187 r = efl_gfx_entity_geometry_get(sd->entry_edje);
1205 rv = edje_object_part_text_cursor_coord_set 1188 rv = edje_object_part_text_cursor_coord_set
1206 (sd->entry_edje, "efl.text", EDJE_CURSOR_USER, 1189 (sd->entry_edje, "efl.text", EDJE_CURSOR_USER,
1207 ev->cur.canvas.x - x, ev->cur.canvas.y - y); 1190 ev->cur.x - r.x, ev->cur.y - r.y);
1208 if (rv) 1191 if (rv)
1209 { 1192 {
1210 edje_object_part_text_cursor_copy 1193 edje_object_part_text_cursor_copy
@@ -1223,9 +1206,9 @@ _mouse_move_cb(void *data,
1223 } 1206 }
1224 } 1207 }
1225 1208
1226 dx = sd->downx - ev->cur.canvas.x; 1209 dx = sd->downx - ev->cur.x;
1227 dx *= dx; 1210 dx *= dx;
1228 dy = sd->downy - ev->cur.canvas.y; 1211 dy = sd->downy - ev->cur.y;
1229 dy *= dy; 1212 dy *= dy;
1230 if ((dx + dy) > ((_elm_config->finger_size / 2) * 1213 if ((dx + dy) > ((_elm_config->finger_size / 2) *
1231 (_elm_config->finger_size / 2))) 1214 (_elm_config->finger_size / 2)))
@@ -1291,10 +1274,7 @@ _selection_handlers_offset_calc(Evas_Object *obj, Evas_Object *handler)
1291} 1274}
1292 1275
1293static void 1276static void
1294_start_handler_mouse_down_cb(void *data, 1277_start_handler_mouse_down_cb(void *data, const Efl_Event *event EINA_UNUSED)
1295 Evas *e EINA_UNUSED,
1296 Evas_Object *obj EINA_UNUSED,
1297 void *event_info EINA_UNUSED)
1298{ 1278{
1299 EFL_UI_TEXT_DATA_GET(data, sd); 1279 EFL_UI_TEXT_DATA_GET(data, sd);
1300 1280
@@ -1328,10 +1308,7 @@ _start_handler_mouse_down_cb(void *data,
1328} 1308}
1329 1309
1330static void 1310static void
1331_start_handler_mouse_up_cb(void *data, 1311_start_handler_mouse_up_cb(void *data, const Efl_Event *event EINA_UNUSED)
1332 Evas *e EINA_UNUSED,
1333 Evas_Object *obj EINA_UNUSED,
1334 void *event_info EINA_UNUSED)
1335{ 1312{
1336 EFL_UI_TEXT_DATA_GET(data, sd); 1313 EFL_UI_TEXT_DATA_GET(data, sd);
1337 1314
@@ -1344,22 +1321,20 @@ _start_handler_mouse_up_cb(void *data,
1344} 1321}
1345 1322
1346static void 1323static void
1347_start_handler_mouse_move_cb(void *data, 1324_start_handler_mouse_move_cb(void *data, const Efl_Event *event)
1348 Evas *e EINA_UNUSED,
1349 Evas_Object *obj EINA_UNUSED,
1350 void *event_info)
1351{ 1325{
1352 EFL_UI_TEXT_DATA_GET(data, sd); 1326 EFL_UI_TEXT_DATA_GET(data, sd);
1353 1327
1354 if (!sd->start_handler_down) return; 1328 if (!sd->start_handler_down) return;
1355 Evas_Event_Mouse_Move *ev = event_info; 1329 Efl_Input_Pointer_Data *ev;
1356 Evas_Coord ex, ey; 1330 ev = efl_data_scope_get(event->info, EFL_INPUT_POINTER_CLASS);
1331 Eina_Rect re;
1357 Evas_Coord cx, cy; 1332 Evas_Coord cx, cy;
1358 int pos; 1333 int pos;
1359 1334
1360 evas_object_geometry_get(sd->entry_edje, &ex, &ey, NULL, NULL); 1335 re = efl_gfx_entity_geometry_get(sd->entry_edje);
1361 cx = ev->cur.canvas.x - sd->ox - ex; 1336 cx = ev->cur.x - sd->ox - re.x;
1362 cy = ev->cur.canvas.y - sd->oy - ey; 1337 cy = ev->cur.y - sd->oy - re.y;
1363 if (cx <= 0) cx = 1; 1338 if (cx <= 0) cx = 1;
1364 1339
1365 efl_text_cursor_char_coord_set(sd->sel_handler_cursor, EINA_POSITION2D(cx, cy)); 1340 efl_text_cursor_char_coord_set(sd->sel_handler_cursor, EINA_POSITION2D(cx, cy));
@@ -1374,10 +1349,7 @@ _start_handler_mouse_move_cb(void *data,
1374} 1349}
1375 1350
1376static void 1351static void
1377_end_handler_mouse_down_cb(void *data, 1352_end_handler_mouse_down_cb(void *data, const Efl_Event *event EINA_UNUSED)
1378 Evas *e EINA_UNUSED,
1379 Evas_Object *obj EINA_UNUSED,
1380 void *event_info EINA_UNUSED)
1381{ 1353{
1382 EFL_UI_TEXT_DATA_GET(data, sd); 1354 EFL_UI_TEXT_DATA_GET(data, sd);
1383 1355
@@ -1411,10 +1383,7 @@ _end_handler_mouse_down_cb(void *data,
1411} 1383}
1412 1384
1413static void 1385static void
1414_end_handler_mouse_up_cb(void *data, 1386_end_handler_mouse_up_cb(void *data, const Efl_Event *event EINA_UNUSED)
1415 Evas *e EINA_UNUSED,
1416 Evas_Object *obj EINA_UNUSED,
1417 void *event_info EINA_UNUSED)
1418{ 1387{
1419 EFL_UI_TEXT_DATA_GET(data, sd); 1388 EFL_UI_TEXT_DATA_GET(data, sd);
1420 1389
@@ -1427,22 +1396,20 @@ _end_handler_mouse_up_cb(void *data,
1427} 1396}
1428 1397
1429static void 1398static void
1430_end_handler_mouse_move_cb(void *data, 1399_end_handler_mouse_move_cb(void *data, const Efl_Event *event)
1431 Evas *e EINA_UNUSED,
1432 Evas_Object *obj EINA_UNUSED,
1433 void *event_info)
1434{ 1400{
1435 EFL_UI_TEXT_DATA_GET(data, sd); 1401 EFL_UI_TEXT_DATA_GET(data, sd);
1402 Efl_Input_Pointer_Data *ev;
1403 ev = efl_data_scope_get(event->info, EFL_INPUT_POINTER_CLASS);
1436 1404
1437 if (!sd->end_handler_down) return; 1405 if (!sd->end_handler_down) return;
1438 Evas_Event_Mouse_Move *ev = event_info; 1406 Eina_Rect re;
1439 Evas_Coord ex, ey;
1440 Evas_Coord cx, cy; 1407 Evas_Coord cx, cy;
1441 int pos; 1408 int pos;
1442 1409
1443 evas_object_geometry_get(sd->entry_edje, &ex, &ey, NULL, NULL); 1410 re = efl_gfx_entity_geometry_get(sd->entry_edje);
1444 cx = ev->cur.canvas.x - sd->ox - ex; 1411 cx = ev->cur.x - sd->ox - re.x;
1445 cy = ev->cur.canvas.y - sd->oy - ey; 1412 cy = ev->cur.y - sd->oy - re.y;
1446 if (cx <= 0) cx = 1; 1413 if (cx <= 0) cx = 1;
1447 1414
1448 efl_text_cursor_char_coord_set(sd->sel_handler_cursor, EINA_POSITION2D(cx, cy)); 1415 efl_text_cursor_char_coord_set(sd->sel_handler_cursor, EINA_POSITION2D(cx, cy));
@@ -1459,26 +1426,26 @@ _create_selection_handlers(Evas_Object *obj, Efl_Ui_Textbox_Data *sd)
1459 Evas_Object *handle; 1426 Evas_Object *handle;
1460 1427
1461 handle = _decoration_create(obj, sd, PART_NAME_HANDLER_START, EINA_TRUE); 1428 handle = _decoration_create(obj, sd, PART_NAME_HANDLER_START, EINA_TRUE);
1462 evas_object_pass_events_set(handle, EINA_FALSE); 1429 efl_canvas_object_pass_events_set(handle, EINA_FALSE);
1463 sd->start_handler = handle; 1430 sd->start_handler = handle;
1464 evas_object_event_callback_add(handle, EVAS_CALLBACK_MOUSE_DOWN, 1431 efl_event_callback_add(handle, EFL_EVENT_POINTER_DOWN,
1465 _start_handler_mouse_down_cb, obj); 1432 _start_handler_mouse_down_cb, obj);
1466 evas_object_event_callback_add(handle, EVAS_CALLBACK_MOUSE_MOVE, 1433 efl_event_callback_add(handle, EFL_EVENT_POINTER_MOVE,
1467 _start_handler_mouse_move_cb, obj); 1434 _start_handler_mouse_move_cb, obj);
1468 evas_object_event_callback_add(handle, EVAS_CALLBACK_MOUSE_UP, 1435 efl_event_callback_add(handle, EFL_EVENT_POINTER_UP,
1469 _start_handler_mouse_up_cb, obj); 1436 _start_handler_mouse_up_cb, obj);
1470 evas_object_show(handle); 1437 efl_gfx_entity_visible_set(handle, EINA_TRUE);
1471 1438
1472 handle = _decoration_create(obj, sd, PART_NAME_HANDLER_END, EINA_TRUE); 1439 handle = _decoration_create(obj, sd, PART_NAME_HANDLER_END, EINA_TRUE);
1473 evas_object_pass_events_set(handle, EINA_FALSE); 1440 efl_canvas_object_pass_events_set(handle, EINA_FALSE);
1474 sd->end_handler = handle; 1441 sd->end_handler = handle;
1475 evas_object_event_callback_add(handle, EVAS_CALLBACK_MOUSE_DOWN, 1442 efl_event_callback_add(handle, EFL_EVENT_POINTER_DOWN,
1476 _end_handler_mouse_down_cb, obj); 1443 _end_handler_mouse_down_cb, obj);
1477 evas_object_event_callback_add(handle, EVAS_CALLBACK_MOUSE_MOVE, 1444 efl_event_callback_add(handle, EFL_EVENT_POINTER_MOVE,
1478 _end_handler_mouse_move_cb, obj); 1445 _end_handler_mouse_move_cb, obj);
1479 evas_object_event_callback_add(handle, EVAS_CALLBACK_MOUSE_UP, 1446 efl_event_callback_add(handle, EFL_EVENT_POINTER_UP,
1480 _end_handler_mouse_up_cb, obj); 1447 _end_handler_mouse_up_cb, obj);
1481 evas_object_show(handle); 1448 efl_gfx_entity_visible_set(handle, EINA_TRUE);
1482} 1449}
1483 1450
1484EOLIAN static void 1451EOLIAN static void
@@ -1512,7 +1479,7 @@ _efl_ui_textbox_efl_canvas_group_group_member_add(Eo *obj, Efl_Ui_Textbox_Data *
1512 efl_canvas_group_member_add(efl_super(obj, MY_CLASS), member); 1479 efl_canvas_group_member_add(efl_super(obj, MY_CLASS), member);
1513 1480
1514 if (sd->hit_rect) 1481 if (sd->hit_rect)
1515 evas_object_raise(sd->hit_rect); 1482 efl_gfx_stack_raise_to_top(sd->hit_rect);
1516} 1483}
1517 1484
1518static void 1485static void
@@ -1712,9 +1679,9 @@ _efl_ui_textbox_efl_object_finalize(Eo *obj,
1712 1679
1713 sd->item_fallback_factory = efl_add(EFL_UI_TEXT_FACTORY_FALLBACK_CLASS, obj); 1680 sd->item_fallback_factory = efl_add(EFL_UI_TEXT_FACTORY_FALLBACK_CLASS, obj);
1714 1681
1715 evas_object_size_hint_weight_set 1682 efl_gfx_hint_weight_set
1716 (sd->entry_edje, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); 1683 (sd->entry_edje, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
1717 evas_object_size_hint_align_set 1684 efl_gfx_hint_align_set
1718 (sd->entry_edje, EVAS_HINT_FILL, EVAS_HINT_FILL); 1685 (sd->entry_edje, EVAS_HINT_FILL, EVAS_HINT_FILL);
1719 efl_event_callback_add(sd->text_obj, EFL_TEXT_INTERACTIVE_EVENT_CHANGED_USER, 1686 efl_event_callback_add(sd->text_obj, EFL_TEXT_INTERACTIVE_EVENT_CHANGED_USER,
1720 _efl_ui_textbox_changed_user_cb, obj); 1687 _efl_ui_textbox_changed_user_cb, obj);
@@ -1728,17 +1695,17 @@ _efl_ui_textbox_efl_object_finalize(Eo *obj,
1728 _efl_ui_textbox_cursor_changed_cb, obj); 1695 _efl_ui_textbox_cursor_changed_cb, obj);
1729 efl_event_callback_add(sd->text_obj, EFL_GFX_ENTITY_EVENT_POSITION_CHANGED, 1696 efl_event_callback_add(sd->text_obj, EFL_GFX_ENTITY_EVENT_POSITION_CHANGED,
1730 _text_position_changed_cb, obj); 1697 _text_position_changed_cb, obj);
1731 evas_object_event_callback_add(sd->entry_edje, EVAS_CALLBACK_MOVE, 1698 efl_event_callback_add(sd->entry_edje, EFL_GFX_ENTITY_EVENT_POSITION_CHANGED,
1732 _efl_ui_textbox_move_cb, obj); 1699 _efl_ui_textbox_move_cb, obj);
1733 1700
1734 evas_object_event_callback_add 1701 efl_event_callback_add
1735 (sd->entry_edje, EVAS_CALLBACK_KEY_DOWN, _key_down_cb, obj); 1702 (sd->entry_edje, EFL_EVENT_KEY_DOWN, _key_down_cb, obj);
1736 evas_object_event_callback_add 1703 efl_event_callback_add
1737 (sd->entry_edje, EVAS_CALLBACK_MOUSE_DOWN, _mouse_down_cb, obj); 1704 (sd->entry_edje, EFL_EVENT_POINTER_DOWN, _mouse_down_cb, obj);
1738 evas_object_event_callback_add 1705 efl_event_callback_add
1739 (sd->entry_edje, EVAS_CALLBACK_MOUSE_UP, _mouse_up_cb, obj); 1706 (sd->entry_edje, EFL_EVENT_POINTER_UP, _mouse_up_cb, obj);
1740 evas_object_event_callback_add 1707 efl_event_callback_add
1741 (sd->entry_edje, EVAS_CALLBACK_MOUSE_MOVE, _mouse_move_cb, obj); 1708 (sd->entry_edje, EFL_EVENT_POINTER_MOVE, _mouse_move_cb, obj);
1742 efl_ui_action_connector_bind_clickable_to_object(sd->entry_edje, obj); 1709 efl_ui_action_connector_bind_clickable_to_object(sd->entry_edje, obj);
1743 1710
1744 efl_event_callback_add(obj, EFL_GFX_ENTITY_EVENT_SIZE_CHANGED, 1711 efl_event_callback_add(obj, EFL_GFX_ENTITY_EVENT_SIZE_CHANGED,
@@ -1775,8 +1742,8 @@ _efl_ui_textbox_efl_object_destructor(Eo *obj, Efl_Ui_Textbox_Data *sd)
1775 1742
1776 if (sd->start_handler) 1743 if (sd->start_handler)
1777 { 1744 {
1778 evas_object_del(sd->start_handler); 1745 efl_del(sd->start_handler);
1779 evas_object_del(sd->end_handler); 1746 efl_del(sd->end_handler);
1780 } 1747 }
1781 1748
1782 _anchors_free(sd); 1749 _anchors_free(sd);
@@ -1921,14 +1888,14 @@ _efl_ui_textbox_efl_text_interactive_editable_set(Eo *obj, Efl_Ui_Textbox_Data *
1921 _dnd_drop_cb, NULL); 1888 _dnd_drop_cb, NULL);
1922 if (sd->cursor) 1889 if (sd->cursor)
1923 { 1890 {
1924 evas_object_show(sd->cursor); 1891 efl_gfx_entity_visible_set(sd->cursor, EINA_TRUE);
1925 evas_object_show(sd->cursor_bidi); 1892 efl_gfx_entity_visible_set(sd->cursor_bidi, EINA_TRUE);
1926 } 1893 }
1927 } 1894 }
1928 if (!editable && sd->cursor) 1895 if (!editable && sd->cursor)
1929 { 1896 {
1930 evas_object_hide(sd->cursor); 1897 efl_gfx_entity_visible_set(sd->cursor, EINA_FALSE);
1931 evas_object_hide(sd->cursor_bidi); 1898 efl_gfx_entity_visible_set(sd->cursor_bidi, EINA_FALSE);
1932 } 1899 }
1933} 1900}
1934 1901
@@ -2134,7 +2101,7 @@ _efl_ui_textbox_efl_ui_widget_on_access_activate(Eo *obj, Efl_Ui_Textbox_Data *_
2134 EFL_UI_TEXT_DATA_GET(obj, sd); 2101 EFL_UI_TEXT_DATA_GET(obj, sd);
2135 2102
2136 if (!efl_ui_widget_disabled_get(obj) && 2103 if (!efl_ui_widget_disabled_get(obj) &&
2137 !evas_object_freeze_events_get(obj)) 2104 !(efl_event_freeze_count_get(obj) > 0))
2138 { 2105 {
2139 efl_event_callback_call(obj, EFL_INPUT_EVENT_CLICKED, NULL); 2106 efl_event_callback_call(obj, EFL_INPUT_EVENT_CLICKED, NULL);
2140 if (efl_text_interactive_editable_get(obj) && efl_input_text_input_panel_autoshow_get(obj)) 2107 if (efl_text_interactive_editable_get(obj) && efl_input_text_input_panel_autoshow_get(obj))
@@ -2711,17 +2678,17 @@ _decoration_create(Eo *obj, Efl_Ui_Textbox_Data *sd,
2711 2678
2712 ret = efl_add(EFL_CANVAS_LAYOUT_CLASS, obj); 2679 ret = efl_add(EFL_CANVAS_LAYOUT_CLASS, obj);
2713 elm_widget_element_update(obj, ret, group_name); 2680 elm_widget_element_update(obj, ret, group_name);
2714 evas_object_smart_member_add(ret, sd->entry_edje); 2681 efl_canvas_group_member_add(sd->entry_edje, ret);
2715 if (above) 2682 if (above)
2716 { 2683 {
2717 evas_object_stack_above(ret, sd->text_table); 2684 efl_gfx_stack_above(ret, sd->text_table);
2718 } 2685 }
2719 else 2686 else
2720 { 2687 {
2721 evas_object_stack_below(ret, NULL); 2688 efl_gfx_stack_below(ret, NULL);
2722 } 2689 }
2723 efl_canvas_object_clipper_set(ret, clip); 2690 efl_canvas_object_clipper_set(ret, clip);
2724 evas_object_pass_events_set(ret, EINA_TRUE); 2691 efl_canvas_object_pass_events_set(ret, EINA_TRUE);
2725 return ret; 2692 return ret;
2726} 2693}
2727 2694
@@ -2733,8 +2700,8 @@ _create_text_cursors(Eo *obj, Efl_Ui_Textbox_Data *sd)
2733 2700
2734 if (!efl_text_interactive_editable_get(obj)) 2701 if (!efl_text_interactive_editable_get(obj))
2735 { 2702 {
2736 evas_object_hide(sd->cursor); 2703 efl_gfx_entity_visible_set(sd->cursor, EINA_FALSE);
2737 evas_object_hide(sd->cursor_bidi); 2704 efl_gfx_entity_visible_set(sd->cursor_bidi, EINA_FALSE);
2738 } 2705 }
2739} 2706}
2740 2707
@@ -2782,21 +2749,21 @@ _update_text_cursors(Eo *obj)
2782 if (hh < 1) hh = 1; 2749 if (hh < 1) hh = 1;
2783 if (sd->cursor) 2750 if (sd->cursor)
2784 { 2751 {
2785 evas_object_geometry_set(sd->cursor, off.x + xx, off.y + yy, ww, hh); 2752 efl_gfx_entity_geometry_set(sd->cursor, EINA_RECT(off.x + xx, off.y + yy, ww, hh));
2786 } 2753 }
2787 if (sd->cursor_bidi) 2754 if (sd->cursor_bidi)
2788 { 2755 {
2789 if (bidi_cursor) 2756 if (bidi_cursor)
2790 { 2757 {
2791 evas_object_geometry_set(sd->cursor_bidi, 2758 efl_gfx_entity_geometry_set(sd->cursor_bidi,
2792 off.x + rc_tmp2.x, off.y + rc_tmp2.y + (hh / 2), 2759 EINA_RECT(off.x + rc_tmp2.x, off.y + rc_tmp2.y + (hh / 2),
2793 ww, hh / 2); 2760 ww, hh / 2));
2794 evas_object_resize(sd->cursor, ww, hh / 2); 2761 efl_gfx_entity_size_set(sd->cursor, EINA_SIZE2D(ww, hh / 2));
2795 evas_object_show(sd->cursor_bidi); 2762 efl_gfx_entity_visible_set(sd->cursor_bidi, EINA_TRUE);
2796 } 2763 }
2797 else 2764 else
2798 { 2765 {
2799 evas_object_hide(sd->cursor_bidi); 2766 efl_gfx_entity_visible_set(sd->cursor_bidi, EINA_FALSE);
2800 } 2767 }
2801 } 2768 }
2802 if (sd->cursor_update) 2769 if (sd->cursor_update)
@@ -2850,7 +2817,7 @@ _update_text_selection(Eo *obj, Eo *text_obj)
2850 sd->sel = eina_list_append(sd->sel, rect); 2817 sd->sel = eina_list_append(sd->sel, rect);
2851 2818
2852 rect->obj_bg = _decoration_create(obj, sd, PART_NAME_SELECTION, EINA_FALSE); 2819 rect->obj_bg = _decoration_create(obj, sd, PART_NAME_SELECTION, EINA_FALSE);
2853 evas_object_show(rect->obj_bg); 2820 efl_gfx_entity_visible_set(rect->obj_bg, EINA_TRUE);
2854 } 2821 }
2855 else 2822 else
2856 { 2823 {
@@ -2860,8 +2827,8 @@ _update_text_selection(Eo *obj, Eo *text_obj)
2860 2827
2861 if (rect->obj_bg) 2828 if (rect->obj_bg)
2862 { 2829 {
2863 evas_object_geometry_set(rect->obj_bg, off.x + r->x, off.y + r->y, 2830 efl_gfx_entity_geometry_set(rect->obj_bg, EINA_RECT(off.x + r->x, off.y + r->y,
2864 r->w, r->h); 2831 r->w, r->h));
2865 } 2832 }
2866 } 2833 }
2867 eina_iterator_free(range); 2834 eina_iterator_free(range);
@@ -3009,8 +2976,8 @@ _anchors_update(Eo *obj, Efl_Ui_Textbox_Data *sd)
3009 efl_del(start); 2976 efl_del(start);
3010 efl_del(end); 2977 efl_del(end);
3011 2978
3012 smart = evas_object_smart_parent_get(obj); 2979 smart = efl_canvas_object_render_parent_get(obj);
3013 clip = evas_object_clip_get(sd->text_obj); 2980 clip = efl_canvas_object_clipper_get(sd->text_obj);
3014 off = _decoration_calc_offset(sd); 2981 off = _decoration_calc_offset(sd);
3015 2982
3016 EINA_ITERATOR_FOREACH(it, an) 2983 EINA_ITERATOR_FOREACH(it, an)
@@ -3077,12 +3044,12 @@ _anchors_update(Eo *obj, Efl_Ui_Textbox_Data *sd)
3077 ob = _decoration_create(obj, sd, PART_NAME_ANCHOR, EINA_TRUE); 3044 ob = _decoration_create(obj, sd, PART_NAME_ANCHOR, EINA_TRUE);
3078 rect->obj_fg = ob; 3045 rect->obj_fg = ob;
3079 // hit-rectangle 3046 // hit-rectangle
3080 ob = evas_object_rectangle_add(obj); 3047 ob = efl_add(EFL_CANVAS_RECTANGLE_CLASS, obj);
3081 evas_object_color_set(ob, 0, 0, 0, 0); 3048 efl_gfx_color_set(ob, 0, 0, 0, 0);
3082 evas_object_smart_member_add(ob, smart); 3049 efl_canvas_group_member_add(smart, ob);
3083 evas_object_stack_above(ob, obj); 3050 efl_gfx_stack_above(ob, obj);
3084 efl_canvas_object_clipper_set(ob, clip); 3051 efl_canvas_object_clipper_set(ob, clip);
3085 evas_object_repeat_events_set(ob, EINA_TRUE); 3052 efl_canvas_object_repeat_events_set(ob, EINA_TRUE);
3086 rect->obj = ob; 3053 rect->obj = ob;
3087 //FIXME: add event handlers 3054 //FIXME: add event handlers
3088 } 3055 }
@@ -3108,24 +3075,24 @@ _anchors_update(Eo *obj, Efl_Ui_Textbox_Data *sd)
3108 rect = eina_list_data_get(l); 3075 rect = eina_list_data_get(l);
3109 if (rect->obj_bg) 3076 if (rect->obj_bg)
3110 { 3077 {
3111 evas_object_geometry_set(rect->obj_bg, 3078 efl_gfx_entity_geometry_set(rect->obj_bg,
3112 off.x + r->x, off.y + r->y, 3079 EINA_RECT(off.x + r->x, off.y + r->y,
3113 r->w, r->h); 3080 r->w, r->h));
3114 evas_object_show(rect->obj_bg); 3081 efl_gfx_entity_visible_set(rect->obj_bg, EINA_TRUE);
3115 } 3082 }
3116 if (rect->obj_fg) 3083 if (rect->obj_fg)
3117 { 3084 {
3118 evas_object_geometry_set(rect->obj_fg, 3085 efl_gfx_entity_geometry_set(rect->obj_fg,
3119 off.x + r->x, off.y + r->y, 3086 EINA_RECT(off.x + r->x, off.y + r->y,
3120 r->w, r->h); 3087 r->w, r->h));
3121 evas_object_show(rect->obj_fg); 3088 efl_gfx_entity_visible_set(rect->obj_fg, EINA_TRUE);
3122 } 3089 }
3123 if (rect->obj) 3090 if (rect->obj)
3124 { 3091 {
3125 evas_object_geometry_set(rect->obj, 3092 efl_gfx_entity_geometry_set(rect->obj,
3126 off.x + r->x, off.y + r->y, 3093 EINA_RECT(off.x + r->x, off.y + r->y,
3127 r->w, r->h); 3094 r->w, r->h));
3128 evas_object_show(rect->obj); 3095 efl_gfx_entity_visible_set(rect->obj, EINA_TRUE);
3129 } 3096 }
3130 3097
3131 l = eina_list_next(l); 3098 l = eina_list_next(l);
@@ -3183,7 +3150,7 @@ _decoration_defer(Eo *obj)
3183 EFL_UI_TEXT_DATA_GET(obj, sd); 3150 EFL_UI_TEXT_DATA_GET(obj, sd);
3184 if (!sd->deferred_decoration_job) 3151 if (!sd->deferred_decoration_job)
3185 { 3152 {
3186 sd->deferred_decoration_job = 3153 sd->deferred_decoration_job =
3187 ecore_job_add(_deferred_decoration_job, obj); 3154 ecore_job_add(_deferred_decoration_job, obj);
3188 } 3155 }
3189} 3156}
@@ -3298,8 +3265,7 @@ _efl_ui_textbox_selection_changed_cb(void *data, const Efl_Event *event EINA_UNU
3298} 3265}
3299 3266
3300static void 3267static void
3301_efl_ui_textbox_move_cb(void *data, Evas *e EINA_UNUSED, 3268_efl_ui_textbox_move_cb(void *data, const Efl_Event *event EINA_UNUSED)
3302 Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
3303{ 3269{
3304 _decoration_defer_all(data); 3270 _decoration_defer_all(data);
3305} 3271}