summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Zaoui <daniel.zaoui@samsung.com>2015-11-17 15:41:19 +0200
committerDaniel Zaoui <daniel.zaoui@samsung.com>2015-11-17 15:41:19 +0200
commit83fb5a70151eb2d10f5879bcb1d804a102f90d53 (patch)
treeba4f85e1b275b6058b70e39ed0fb7c8070b70688
parente375e168ed30f2a12bc278b7b70217057d361134 (diff)
Evas: extend highlight to canvas
-rw-r--r--src/lib/evas_debug.c25
1 files changed, 12 insertions, 13 deletions
diff --git a/src/lib/evas_debug.c b/src/lib/evas_debug.c
index 82b4883..d5331cd 100644
--- a/src/lib/evas_debug.c
+++ b/src/lib/evas_debug.c
@@ -81,22 +81,11 @@ _obj_highlight_cb(Eina_Debug_Client *src EINA_UNUSED, void *buffer, int size)
81 uint64_t ptr64; 81 uint64_t ptr64;
82 memcpy(&ptr64, buffer, sizeof(ptr64)); 82 memcpy(&ptr64, buffer, sizeof(ptr64));
83 Eo *obj = (Eo *)ptr64; 83 Eo *obj = (Eo *)ptr64;
84 if (!eo_isa(obj, EVAS_OBJECT_CLASS)) return EINA_TRUE; 84 if (!eo_isa(obj, EVAS_OBJECT_CLASS) && !eo_isa(obj, EVAS_CANVAS_CLASS)) return EINA_TRUE;
85 Evas *e = evas_object_evas_get(obj); 85 Evas *e = evas_object_evas_get(obj);
86 Eo *rect = evas_object_polygon_add(e); 86 Eo *rect = evas_object_polygon_add(e);
87 evas_object_move(rect, 0, 0); 87 evas_object_move(rect, 0, 0);
88 const Evas_Map *map; 88 if (eo_isa(obj, EVAS_OBJECT_CLASS))
89 if ((map = evas_object_map_get(obj)))
90 {
91 int i = evas_map_count_get(map);
92 for ( ; i > 0 ; i--)
93 {
94 Evas_Coord mx, my;
95 evas_map_point_coord_get(map, i - 1, &mx, &my, NULL);
96 evas_object_polygon_point_add(rect, mx, my);
97 }
98 }
99 else
100 { 89 {
101 Evas_Coord x = 0, y = 0, w = 0, h = 0; 90 Evas_Coord x = 0, y = 0, w = 0, h = 0;
102 evas_object_geometry_get(obj, &x, &y, &w, &h); 91 evas_object_geometry_get(obj, &x, &y, &w, &h);
@@ -107,6 +96,16 @@ _obj_highlight_cb(Eina_Debug_Client *src EINA_UNUSED, void *buffer, int size)
107 evas_object_polygon_point_add(rect, x + w, y + h); 96 evas_object_polygon_point_add(rect, x + w, y + h);
108 evas_object_polygon_point_add(rect, x, y + h); 97 evas_object_polygon_point_add(rect, x, y + h);
109 } 98 }
99 else
100 {
101 Evas_Coord w = 0, h = 0;
102 evas_output_size_get(obj, &w, &h);
103
104 evas_object_polygon_point_add(rect, 0, 0);
105 evas_object_polygon_point_add(rect, w, 0);
106 evas_object_polygon_point_add(rect, w, h);
107 evas_object_polygon_point_add(rect, 0, h);
108 }
110 109
111 /* Put the object as high as possible. */ 110 /* Put the object as high as possible. */
112 evas_object_layer_set(rect, EVAS_LAYER_MAX); 111 evas_object_layer_set(rect, EVAS_LAYER_MAX);