summaryrefslogtreecommitdiff
path: root/src/lib/evas/canvas/evas_object_main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/evas/canvas/evas_object_main.c')
-rw-r--r--src/lib/evas/canvas/evas_object_main.c101
1 files changed, 48 insertions, 53 deletions
diff --git a/src/lib/evas/canvas/evas_object_main.c b/src/lib/evas/canvas/evas_object_main.c
index 9d90cf5..2536973 100644
--- a/src/lib/evas/canvas/evas_object_main.c
+++ b/src/lib/evas/canvas/evas_object_main.c
@@ -87,8 +87,7 @@ _animator_repeater(void *data, const Eo_Event *event)
87{ 87{
88 Evas_Object_Protected_Data *obj = data; 88 Evas_Object_Protected_Data *obj = data;
89 89
90 eo_do(obj->object, 90 eo_event_callback_call(obj->object, EFL_CORE_ANIMATOR_EVENT_ANIMATOR_TICK, event->event_info);
91 eo_event_callback_call(EFL_CORE_ANIMATOR_EVENT_ANIMATOR_TICK, event->event_info));
92 DBG("Emitting animator tick on %p.", obj->object); 91 DBG("Emitting animator tick on %p.", obj->object);
93 92
94 return EO_CALLBACK_CONTINUE; 93 return EO_CALLBACK_CONTINUE;
@@ -107,8 +106,7 @@ _check_event_catcher_add(void *data, const Eo_Event *event)
107 { 106 {
108 if (obj->animator_ref++ > 0) break; 107 if (obj->animator_ref++ > 0) break;
109 108
110 eo_do(obj->layer->evas->evas, 109 eo_event_callback_add(obj->layer->evas->evas, EFL_CORE_ANIMATOR_EVENT_ANIMATOR_TICK, _animator_repeater, obj);
111 eo_event_callback_add(EFL_CORE_ANIMATOR_EVENT_ANIMATOR_TICK, _animator_repeater, obj));
112 INF("Registering an animator tick on canvas %p for object %p.", 110 INF("Registering an animator tick on canvas %p for object %p.",
113 obj->layer->evas->evas, obj->object); 111 obj->layer->evas->evas, obj->object);
114 } 112 }
@@ -134,8 +132,7 @@ _check_event_catcher_del(void *data, const Eo_Event *event)
134 { 132 {
135 if ((--obj->animator_ref) > 0) break; 133 if ((--obj->animator_ref) > 0) break;
136 134
137 eo_do(obj->layer->evas->evas, 135 eo_event_callback_del(obj->layer->evas->evas, EFL_CORE_ANIMATOR_EVENT_ANIMATOR_TICK, _animator_repeater, obj);
138 eo_event_callback_del(EFL_CORE_ANIMATOR_EVENT_ANIMATOR_TICK, _animator_repeater, obj));
139 INF("Unregistering an animator tick on canvas %p for object %p.", 136 INF("Unregistering an animator tick on canvas %p for object %p.",
140 obj->layer->evas->evas, obj->object); 137 obj->layer->evas->evas, obj->object);
141 } 138 }
@@ -157,11 +154,11 @@ _evas_object_eo_base_constructor(Eo *eo_obj, Evas_Object_Protected_Data *obj)
157{ 154{
158 Eo *parent = NULL; 155 Eo *parent = NULL;
159 156
160 eo_obj = eo_do_super_ret(eo_obj, MY_CLASS, eo_obj, eo_constructor()); 157 eo_obj = eo_constructor(eo_super(eo_obj, MY_CLASS));
161 eo_do(eo_obj, evas_obj_type_set(MY_CLASS_NAME)); 158 evas_obj_type_set(eo_obj, MY_CLASS_NAME);
162 eo_manual_free_set(eo_obj, EINA_TRUE); 159 eo_manual_free_set(eo_obj, EINA_TRUE);
163 160
164 eo_do(eo_obj, parent = eo_parent_get()); 161 parent = eo_parent_get(eo_obj);
165 162
166 if (!obj || !_init_cow() || !eo_isa(parent, EVAS_COMMON_INTERFACE_INTERFACE)) 163 if (!obj || !_init_cow() || !eo_isa(parent, EVAS_COMMON_INTERFACE_INTERFACE))
167 { 164 {
@@ -180,7 +177,7 @@ _evas_object_eo_base_constructor(Eo *eo_obj, Evas_Object_Protected_Data *obj)
180 177
181 evas_object_inject(eo_obj, obj, evas_object_evas_get(parent)); 178 evas_object_inject(eo_obj, obj, evas_object_evas_get(parent));
182 179
183 eo_do(eo_obj, eo_event_callback_array_add(event_catcher_watch(), obj)); 180 eo_event_callback_array_add(eo_obj, event_catcher_watch(), obj);
184 181
185 return eo_obj; 182 return eo_obj;
186} 183}
@@ -358,7 +355,7 @@ evas_object_change(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj)
358 } 355 }
359 EINA_LIST_FOREACH(obj->proxy->proxy_textures, l, texture) 356 EINA_LIST_FOREACH(obj->proxy->proxy_textures, l, texture)
360 { 357 {
361 eo_do(texture, evas_canvas3d_object_change(EVAS_CANVAS3D_STATE_TEXTURE_DATA, NULL)); 358 evas_canvas3d_object_change(texture, EVAS_CANVAS3D_STATE_TEXTURE_DATA, NULL);
362 } 359 }
363 if (obj->smart.parent) 360 if (obj->smart.parent)
364 { 361 {
@@ -795,7 +792,7 @@ _evas_object_eo_base_destructor(Eo *eo_obj, Evas_Object_Protected_Data *obj)
795 if (eo_isa(proxy, EVAS_IMAGE_CLASS)) 792 if (eo_isa(proxy, EVAS_IMAGE_CLASS))
796 evas_object_image_source_unset(proxy); 793 evas_object_image_source_unset(proxy);
797 else if (eo_isa(proxy, EVAS_TEXT_CLASS)) 794 else if (eo_isa(proxy, EVAS_TEXT_CLASS))
798 eo_do(proxy, efl_gfx_filter_source_set(NULL, eo_obj)); 795 efl_gfx_filter_source_set(proxy, NULL, eo_obj);
799 } 796 }
800 797
801 /* Eina_Cow has no way to know if we are going to really change something 798 /* Eina_Cow has no way to know if we are going to really change something
@@ -806,7 +803,7 @@ _evas_object_eo_base_destructor(Eo *eo_obj, Evas_Object_Protected_Data *obj)
806 Evas_Object_Proxy_Data, proxy_src) 803 Evas_Object_Proxy_Data, proxy_src)
807 { 804 {
808 EINA_LIST_FREE(proxy_src->proxy_textures, texture) 805 EINA_LIST_FREE(proxy_src->proxy_textures, texture)
809 eo_do(texture, evas_canvas3d_texture_source_set(NULL)); 806 evas_canvas3d_texture_source_set(texture, NULL);
810 } 807 }
811 EINA_COW_WRITE_END(evas_object_proxy_cow, obj->proxy, proxy_src); 808 EINA_COW_WRITE_END(evas_object_proxy_cow, obj->proxy, proxy_src);
812 } 809 }
@@ -827,7 +824,7 @@ end:
827 evas_object_event_callback_all_del(eo_obj); 824 evas_object_event_callback_all_del(eo_obj);
828 evas_object_event_callback_cleanup(eo_obj); 825 evas_object_event_callback_cleanup(eo_obj);
829 826
830 eo_do_super(eo_obj, MY_CLASS, eo_destructor()); 827 eo_destructor(eo_super(eo_obj, MY_CLASS));
831} 828}
832 829
833EAPI void 830EAPI void
@@ -836,15 +833,14 @@ evas_object_geometry_set(Evas_Object *eo_obj, Evas_Coord x, Evas_Coord y, Evas_C
836 MAGIC_CHECK(eo_obj, Evas_Object, MAGIC_OBJ); 833 MAGIC_CHECK(eo_obj, Evas_Object, MAGIC_OBJ);
837 return; 834 return;
838 MAGIC_CHECK_END(); 835 MAGIC_CHECK_END();
839 eo_do(eo_obj, 836 efl_gfx_position_set(eo_obj, x, y);
840 efl_gfx_position_set(x, y), 837 efl_gfx_size_set(eo_obj, w, h);
841 efl_gfx_size_set(w, h));
842} 838}
843 839
844EAPI void 840EAPI void
845evas_object_move(Evas_Object *obj, Evas_Coord x, Evas_Coord y) 841evas_object_move(Evas_Object *obj, Evas_Coord x, Evas_Coord y)
846{ 842{
847 eo_do((Evas_Object *)obj, efl_gfx_position_set(x, y)); 843 efl_gfx_position_set((Evas_Object *)obj, x, y);
848} 844}
849 845
850EOLIAN static void 846EOLIAN static void
@@ -893,7 +889,7 @@ _evas_object_efl_gfx_base_position_set(Eo *eo_obj, Evas_Object_Protected_Data *o
893 889
894 if (obj->is_smart) 890 if (obj->is_smart)
895 { 891 {
896 eo_do(eo_obj, evas_obj_smart_move(x, y)); 892 evas_obj_smart_move(eo_obj, x, y);
897 } 893 }
898 894
899 EINA_COW_STATE_WRITE_BEGIN(obj, state_write, cur) 895 EINA_COW_STATE_WRITE_BEGIN(obj, state_write, cur)
@@ -935,7 +931,7 @@ _evas_object_efl_gfx_base_position_set(Eo *eo_obj, Evas_Object_Protected_Data *o
935EAPI void 931EAPI void
936evas_object_resize(Evas_Object *obj, Evas_Coord w, Evas_Coord h) 932evas_object_resize(Evas_Object *obj, Evas_Coord w, Evas_Coord h)
937{ 933{
938 eo_do((Evas_Object *)obj, efl_gfx_size_set(w, h)); 934 efl_gfx_size_set((Evas_Object *)obj, w, h);
939} 935}
940 936
941EOLIAN static void 937EOLIAN static void
@@ -975,7 +971,7 @@ _evas_object_efl_gfx_base_size_set(Eo *eo_obj, Evas_Object_Protected_Data *obj,
975 971
976 if (obj->is_smart) 972 if (obj->is_smart)
977 { 973 {
978 eo_do(eo_obj, evas_obj_smart_resize(w, h)); 974 evas_obj_smart_resize(eo_obj, w, h);
979 } 975 }
980 976
981 EINA_COW_STATE_WRITE_BEGIN(obj, state_write, cur) 977 EINA_COW_STATE_WRITE_BEGIN(obj, state_write, cur)
@@ -1024,7 +1020,8 @@ evas_object_geometry_get(const Evas_Object *eo_obj, Evas_Coord *x, Evas_Coord *y
1024 if (x) *x = 0; if (y) *y = 0; if (w) *w = 0; if (h) *h = 0; 1020 if (x) *x = 0; if (y) *y = 0; if (w) *w = 0; if (h) *h = 0;
1025 return; 1021 return;
1026 MAGIC_CHECK_END(); 1022 MAGIC_CHECK_END();
1027 eo_do((Eo *)eo_obj, efl_gfx_position_get(x, y), efl_gfx_size_get(w, h)); 1023 efl_gfx_position_get((Eo *)eo_obj, x, y);
1024 efl_gfx_size_get((Eo *)eo_obj, w, h);
1028} 1025}
1029 1026
1030EOLIAN static void 1027EOLIAN static void
@@ -1291,14 +1288,14 @@ evas_object_show(Evas_Object *eo_obj)
1291 MAGIC_CHECK(eo_obj, Evas_Object, MAGIC_OBJ); 1288 MAGIC_CHECK(eo_obj, Evas_Object, MAGIC_OBJ);
1292 return; 1289 return;
1293 MAGIC_CHECK_END(); 1290 MAGIC_CHECK_END();
1294 eo_do(eo_obj, efl_gfx_visible_set(EINA_TRUE)); 1291 efl_gfx_visible_set(eo_obj, EINA_TRUE);
1295} 1292}
1296 1293
1297EAPI void 1294EAPI void
1298evas_object_hide(Evas_Object *eo_obj) 1295evas_object_hide(Evas_Object *eo_obj)
1299{ 1296{
1300 if (!eo_obj) return; 1297 if (!eo_obj) return;
1301 eo_do(eo_obj, efl_gfx_visible_set(EINA_FALSE)); 1298 efl_gfx_visible_set(eo_obj, EINA_FALSE);
1302} 1299}
1303 1300
1304EAPI Eina_Bool 1301EAPI Eina_Bool
@@ -1306,7 +1303,7 @@ evas_object_visible_get(const Evas_Object *obj)
1306{ 1303{
1307 Eina_Bool ret; 1304 Eina_Bool ret;
1308 1305
1309 return eo_do_ret((Evas_Object *)obj, ret, efl_gfx_visible_get()); 1306 return efl_gfx_visible_get((Evas_Object *)obj);
1310} 1307}
1311 1308
1312static void 1309static void
@@ -1331,7 +1328,7 @@ _show(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj)
1331 if (evas_object_intercept_call_show(eo_obj, obj)) return; 1328 if (evas_object_intercept_call_show(eo_obj, obj)) return;
1332 if (obj->is_smart) 1329 if (obj->is_smart)
1333 { 1330 {
1334 eo_do(eo_obj, evas_obj_smart_show()); 1331 evas_obj_smart_show(eo_obj);
1335 } 1332 }
1336 EINA_COW_STATE_WRITE_BEGIN(obj, state_write, cur) 1333 EINA_COW_STATE_WRITE_BEGIN(obj, state_write, cur)
1337 { 1334 {
@@ -1380,7 +1377,7 @@ _hide(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj)
1380 if (evas_object_intercept_call_hide(eo_obj, obj)) return; 1377 if (evas_object_intercept_call_hide(eo_obj, obj)) return;
1381 if (obj->is_smart) 1378 if (obj->is_smart)
1382 { 1379 {
1383 eo_do(eo_obj, evas_obj_smart_hide()); 1380 evas_obj_smart_hide(eo_obj);
1384 } 1381 }
1385 1382
1386 EINA_COW_STATE_WRITE_BEGIN(obj, state_write, cur) 1383 EINA_COW_STATE_WRITE_BEGIN(obj, state_write, cur)
@@ -1498,7 +1495,7 @@ _evas_object_efl_gfx_base_visible_get(Eo *eo_obj EINA_UNUSED,
1498EAPI void 1495EAPI void
1499evas_object_color_set(Evas_Object *obj, int r, int g, int b, int a) 1496evas_object_color_set(Evas_Object *obj, int r, int g, int b, int a)
1500{ 1497{
1501 eo_do((Evas_Object *)obj, efl_gfx_color_set(r, g, b, a)); 1498 efl_gfx_color_set((Evas_Object *)obj, r, g, b, a);
1502} 1499}
1503 1500
1504EOLIAN static void 1501EOLIAN static void
@@ -1530,7 +1527,7 @@ _evas_object_efl_gfx_base_color_set(Eo *eo_obj, Evas_Object_Protected_Data *obj,
1530 if (evas_object_intercept_call_color_set(eo_obj, obj, r, g, b, a)) return; 1527 if (evas_object_intercept_call_color_set(eo_obj, obj, r, g, b, a)) return;
1531 if (obj->is_smart) 1528 if (obj->is_smart)
1532 { 1529 {
1533 eo_do(eo_obj, evas_obj_smart_color_set(r, g, b, a)); 1530 evas_obj_smart_color_set(eo_obj, r, g, b, a);
1534 } 1531 }
1535 if ((obj->cur->color.r == r) && 1532 if ((obj->cur->color.r == r) &&
1536 (obj->cur->color.g == g) && 1533 (obj->cur->color.g == g) &&
@@ -1572,7 +1569,7 @@ _evas_object_efl_gfx_base_color_part_set(Eo *obj, Evas_Object_Protected_Data *pd
1572EAPI void 1569EAPI void
1573evas_object_color_get(const Evas_Object *obj, int *r, int *g, int *b, int *a) 1570evas_object_color_get(const Evas_Object *obj, int *r, int *g, int *b, int *a)
1574{ 1571{
1575 eo_do((Evas_Object *)obj, efl_gfx_color_get(r, g, b, a)); 1572 efl_gfx_color_get((Evas_Object *)obj, r, g, b, a);
1576} 1573}
1577 1574
1578EOLIAN static void 1575EOLIAN static void
@@ -1677,7 +1674,7 @@ _evas_object_render_op_get(Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *o
1677EOLIAN static void 1674EOLIAN static void
1678_evas_object_eo_base_dbg_info_get(Eo *eo_obj, Evas_Object_Protected_Data *obj EINA_UNUSED, Eo_Dbg_Info *root) 1675_evas_object_eo_base_dbg_info_get(Eo *eo_obj, Evas_Object_Protected_Data *obj EINA_UNUSED, Eo_Dbg_Info *root)
1679{ 1676{
1680 eo_do_super(eo_obj, MY_CLASS, eo_dbg_info_get(root)); 1677 eo_dbg_info_get(eo_super(eo_obj, MY_CLASS), root);
1681 Eo_Dbg_Info *group = EO_DBG_INFO_LIST_APPEND(root, MY_CLASS_NAME); 1678 Eo_Dbg_Info *group = EO_DBG_INFO_LIST_APPEND(root, MY_CLASS_NAME);
1682 Eo_Dbg_Info *node; 1679 Eo_Dbg_Info *node;
1683 const char *name; 1680 const char *name;
@@ -1699,25 +1696,24 @@ _evas_object_eo_base_dbg_info_get(Eo *eo_obj, Evas_Object_Protected_Data *obj EI
1699 Eina_Bool repeat_event; 1696 Eina_Bool repeat_event;
1700 Eina_Bool clipees_has; 1697 Eina_Bool clipees_has;
1701 1698
1702 eo_do(eo_obj, 1699 visible = efl_gfx_visible_get(eo_obj);
1703 visible = efl_gfx_visible_get(), 1700 layer = efl_gfx_stack_layer_get(eo_obj);
1704 layer = efl_gfx_stack_layer_get(), 1701 name = evas_obj_name_get(eo_obj);
1705 name = evas_obj_name_get(), 1702 efl_gfx_position_get(eo_obj, &x, &y);
1706 efl_gfx_position_get(&x, &y), 1703 efl_gfx_size_get(eo_obj, &w, &h);
1707 efl_gfx_size_get(&w, &h), 1704 scale = evas_obj_scale_get(eo_obj);
1708 scale = evas_obj_scale_get(), 1705 evas_obj_size_hint_min_get(eo_obj, &minw, &minh);
1709 evas_obj_size_hint_min_get(&minw, &minh), 1706 evas_obj_size_hint_max_get(eo_obj, &maxw, &maxh);
1710 evas_obj_size_hint_max_get(&maxw, &maxh), 1707 evas_obj_size_hint_request_get(eo_obj, &requestw, &requesth);
1711 evas_obj_size_hint_request_get(&requestw, &requesth), 1708 evas_obj_size_hint_align_get(eo_obj, &dblx, &dbly);
1712 evas_obj_size_hint_align_get(&dblx, &dbly), 1709 evas_obj_size_hint_weight_get(eo_obj, &dblw, &dblh);
1713 evas_obj_size_hint_weight_get(&dblw, &dblh), 1710 efl_gfx_color_get(eo_obj, &r, &g, &b, &a);
1714 efl_gfx_color_get(&r, &g, &b, &a), 1711 focus = evas_obj_focus_get(eo_obj);
1715 focus = evas_obj_focus_get(), 1712 m = evas_obj_pointer_mode_get(eo_obj);
1716 m = evas_obj_pointer_mode_get(), 1713 pass_event = evas_obj_pass_events_get(eo_obj);
1717 pass_event = evas_obj_pass_events_get(), 1714 repeat_event = evas_obj_repeat_events_get(eo_obj);
1718 repeat_event = evas_obj_repeat_events_get(), 1715 propagate_event = evas_obj_propagate_events_get(eo_obj);
1719 propagate_event = evas_obj_propagate_events_get(), 1716 clipees_has = evas_obj_clipees_has(eo_obj);
1720 clipees_has = evas_obj_clipees_has());
1721 1717
1722 EO_DBG_INFO_APPEND(group, "Visibility", EINA_VALUE_TYPE_CHAR, visible); 1718 EO_DBG_INFO_APPEND(group, "Visibility", EINA_VALUE_TYPE_CHAR, visible);
1723 1719
@@ -1792,7 +1788,7 @@ _evas_object_eo_base_dbg_info_get(Eo *eo_obj, Evas_Object_Protected_Data *obj EI
1792 EO_DBG_INFO_APPEND(group, "Has clipees", EINA_VALUE_TYPE_CHAR, clipees_has); 1788 EO_DBG_INFO_APPEND(group, "Has clipees", EINA_VALUE_TYPE_CHAR, clipees_has);
1793 1789
1794 Evas_Object *clipper = NULL; 1790 Evas_Object *clipper = NULL;
1795 eo_do(eo_obj, clipper = evas_obj_clip_get()); 1791 clipper = evas_obj_clip_get(eo_obj);
1796 EO_DBG_INFO_APPEND(group, "Clipper", EINA_VALUE_TYPE_UINT64, (uintptr_t) clipper); 1792 EO_DBG_INFO_APPEND(group, "Clipper", EINA_VALUE_TYPE_UINT64, (uintptr_t) clipper);
1797 1793
1798 const Evas_Map *map = evas_object_map_get(eo_obj); 1794 const Evas_Map *map = evas_object_map_get(eo_obj);
@@ -1868,8 +1864,7 @@ evas_object_top_at_pointer_get(const Evas *eo_e)
1868 Evas_Public_Data *e = eo_data_scope_get(eo_e, EVAS_CANVAS_CLASS); 1864 Evas_Public_Data *e = eo_data_scope_get(eo_e, EVAS_CANVAS_CLASS);
1869 Evas_Object *ret = NULL; 1865 Evas_Object *ret = NULL;
1870 if (!e) return NULL; 1866 if (!e) return NULL;
1871 eo_do((Eo *)eo_e, ret = evas_canvas_object_top_at_xy_get(e->pointer.x, e->pointer.y, EINA_TRUE, 1867 ret = evas_canvas_object_top_at_xy_get((Eo *)eo_e, e->pointer.x, e->pointer.y, EINA_TRUE, EINA_TRUE);
1872 EINA_TRUE));
1873 return ret; 1868 return ret;
1874} 1869}
1875 1870