summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Zaoui <daniel.zaoui@samsung.com>2013-10-13 06:55:28 +0300
committerDaniel Zaoui <daniel.zaoui@samsung.com>2013-10-21 19:03:24 +0300
commit208c4242388b23c35ec9e0d4e37520cf89135f46 (patch)
treeafe034c83a1cb00c70947f603e759b6f2cf17353
parent203c3e7c157196aa4442b0a238dc93e30e0acaba (diff)
Evas: Add API to access private function
We need a function in DnD for the overlapping feature to retrieve all the objects at a specific position. A private function exists in Evas (evas_event_objects_event_list) for that purpose. We need an access to this function for Elementary but we don't want the is_frozen flag to be checked.
-rw-r--r--src/lib/evas/Evas_Eo.h18
-rw-r--r--src/lib/evas/Evas_Legacy.h18
-rw-r--r--src/lib/evas/canvas/evas_events.c37
-rw-r--r--src/lib/evas/canvas/evas_main.c2
-rw-r--r--src/lib/evas/include/evas_private.h1
5 files changed, 73 insertions, 3 deletions
diff --git a/src/lib/evas/Evas_Eo.h b/src/lib/evas/Evas_Eo.h
index 2b692f997c..256cfc980c 100644
--- a/src/lib/evas/Evas_Eo.h
+++ b/src/lib/evas/Evas_Eo.h
@@ -257,6 +257,7 @@ enum
257 EVAS_CANVAS_SUB_ID_SMART_OBJECTS_CALCULATE, 257 EVAS_CANVAS_SUB_ID_SMART_OBJECTS_CALCULATE,
258 EVAS_CANVAS_SUB_ID_SMART_OBJECTS_CALCULATE_COUNT_GET, 258 EVAS_CANVAS_SUB_ID_SMART_OBJECTS_CALCULATE_COUNT_GET,
259 EVAS_CANVAS_SUB_ID_RENDER_ASYNC, 259 EVAS_CANVAS_SUB_ID_RENDER_ASYNC,
260 EVAS_CANVAS_SUB_ID_TREE_OBJECTS_AT_XY_GET,
260 EVAS_CANVAS_SUB_ID_LAST 261 EVAS_CANVAS_SUB_ID_LAST
261}; 262};
262 263
@@ -1158,6 +1159,23 @@ enum
1158 * @see evas_event_refeed_event 1159 * @see evas_event_refeed_event
1159 */ 1160 */
1160#define evas_canvas_event_refeed_event(event_copy, event_type) EVAS_CANVAS_ID(EVAS_CANVAS_SUB_ID_EVENT_REFEED_EVENT), EO_TYPECHECK(void *, event_copy), EO_TYPECHECK(Evas_Callback_Type, event_type) 1161#define evas_canvas_event_refeed_event(event_copy, event_type) EVAS_CANVAS_ID(EVAS_CANVAS_SUB_ID_EVENT_REFEED_EVENT), EO_TYPECHECK(void *, event_copy), EO_TYPECHECK(Evas_Callback_Type, event_type)
1162
1163/**
1164 * @def evas_canvas_tree_objects_at_xy_get
1165 * @since 1.8
1166 *
1167 * Retrieve a list of Evas objects lying over a given position in
1168 * a canvas.
1169 *
1170 * @param[in] stop An Evas Object where to stop searching.
1171 * @param[in] x The horizontal coordinate of the position.
1172 * @param[in] y The vertical coordinate of the position.
1173 * @param[out] list of Evas Objects.
1174 *
1175 * @see evas_tree_objects_at_xy_get
1176 */
1177#define evas_canvas_tree_objects_at_xy_get(stop, x, y, ret) EVAS_CANVAS_ID(EVAS_CANVAS_SUB_ID_TREE_OBJECTS_AT_XY_GET), EO_TYPECHECK(Evas_Object *, stop), EO_TYPECHECK(int, x), EO_TYPECHECK(int, y), EO_TYPECHECK(Eina_List **, ret)
1178
1161/** 1179/**
1162 * @} 1180 * @}
1163 */ 1181 */
diff --git a/src/lib/evas/Evas_Legacy.h b/src/lib/evas/Evas_Legacy.h
index ffb3bb821e..8b362bec44 100644
--- a/src/lib/evas/Evas_Legacy.h
+++ b/src/lib/evas/Evas_Legacy.h
@@ -1272,6 +1272,24 @@ EAPI void evas_event_feed_hold(Evas *e, int hold, unsigned int timestamp, const
1272EAPI void evas_event_refeed_event(Evas *e, void *event_copy, Evas_Callback_Type event_type) EINA_ARG_NONNULL(1); 1272EAPI void evas_event_refeed_event(Evas *e, void *event_copy, Evas_Callback_Type event_type) EINA_ARG_NONNULL(1);
1273 1273
1274/** 1274/**
1275 * Retrieve a list of Evas objects lying over a given position in
1276 * a canvas.
1277 *
1278 * @param e A handle to the canvas.
1279 * @param stop An Evas Object where to stop searching.
1280 * @param x The horizontal coordinate of the position.
1281 * @param y The vertical coordinate of the position.
1282 *
1283 * This function will traverse all the layers of the given canvas,
1284 * from top to bottom, querying for objects with areas covering the
1285 * given position. It will enter the smart objects.
1286 * It will not append to the list pass events as hidden objects.
1287 * Call eina_list_free on the returned list after usage.
1288 *
1289 */
1290EAPI Eina_List *evas_tree_objects_at_xy_get(Evas *eo_e, Evas_Object *stop, int x, int y) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
1291
1292/**
1275 * @} 1293 * @}
1276 */ 1294 */
1277 1295
diff --git a/src/lib/evas/canvas/evas_events.c b/src/lib/evas/canvas/evas_events.c
index 513d0c4f1c..59ad975937 100644
--- a/src/lib/evas/canvas/evas_events.c
+++ b/src/lib/evas/canvas/evas_events.c
@@ -861,14 +861,14 @@ _evas_event_object_list_in_get(Evas *eo_e, Eina_List *in,
861 no_rep, source); 861 no_rep, source);
862} 862}
863 863
864Eina_List * 864static Eina_List *
865evas_event_objects_event_list(Evas *eo_e, Evas_Object *stop, int x, int y) 865_evas_event_objects_event_list_no_frozen_check(Evas *eo_e, Evas_Object *stop, int x, int y)
866{ 866{
867 Evas_Public_Data *e = eo_data_scope_get(eo_e, EVAS_CLASS); 867 Evas_Public_Data *e = eo_data_scope_get(eo_e, EVAS_CLASS);
868 Evas_Layer *lay; 868 Evas_Layer *lay;
869 Eina_List *in = NULL; 869 Eina_List *in = NULL;
870 870
871 if ((!e->layers) || (e->is_frozen)) return NULL; 871 if (!e->layers) return NULL;
872 872
873 EINA_INLIST_REVERSE_FOREACH((EINA_INLIST_GET(e->layers)), lay) 873 EINA_INLIST_REVERSE_FOREACH((EINA_INLIST_GET(e->layers)), lay)
874 { 874 {
@@ -881,6 +881,37 @@ evas_event_objects_event_list(Evas *eo_e, Evas_Object *stop, int x, int y)
881 return in; 881 return in;
882} 882}
883 883
884EAPI Eina_List *
885evas_tree_objects_at_xy_get(Evas *eo_e, Evas_Object *stop, int x, int y)
886{
887 MAGIC_CHECK(eo_e, Evas, MAGIC_EVAS);
888 return NULL;
889 MAGIC_CHECK_END();
890 Eina_List *list = NULL;
891 eo_do(eo_e, evas_canvas_tree_objects_at_xy_get(stop, x, y, &list));
892 return list;
893}
894
895void
896_canvas_tree_objects_at_xy_get(Eo *eo_e, void *_pd EINA_UNUSED, va_list *list)
897{
898 Evas_Object *stop = va_arg(*list, Evas_Object *);
899 int x = va_arg(*list, int);
900 int y = va_arg(*list, int);
901 Eina_List **in = va_arg(*list, Eina_List **);
902
903 *in = _evas_event_objects_event_list_no_frozen_check(eo_e, stop, x, y);
904}
905
906Eina_List *
907evas_event_objects_event_list(Evas *eo_e, Evas_Object *stop, int x, int y)
908{
909 Evas_Public_Data *e = eo_data_scope_get(eo_e, EVAS_CLASS);
910
911 if ((!e->layers) || (e->is_frozen)) return NULL;
912 return _evas_event_objects_event_list_no_frozen_check(eo_e, stop, x, y);
913}
914
884static Eina_List * 915static Eina_List *
885evas_event_list_copy(Eina_List *list) 916evas_event_list_copy(Eina_List *list)
886{ 917{
diff --git a/src/lib/evas/canvas/evas_main.c b/src/lib/evas/canvas/evas_main.c
index aefdce5090..f755fccb0e 100644
--- a/src/lib/evas/canvas/evas_main.c
+++ b/src/lib/evas/canvas/evas_main.c
@@ -1103,6 +1103,7 @@ _class_constructor(Eo_Class *klass)
1103 EO_OP_FUNC(EVAS_CANVAS_ID(EVAS_CANVAS_SUB_ID_SMART_OBJECTS_CALCULATE), _canvas_smart_objects_calculate), 1103 EO_OP_FUNC(EVAS_CANVAS_ID(EVAS_CANVAS_SUB_ID_SMART_OBJECTS_CALCULATE), _canvas_smart_objects_calculate),
1104 EO_OP_FUNC(EVAS_CANVAS_ID(EVAS_CANVAS_SUB_ID_SMART_OBJECTS_CALCULATE_COUNT_GET), _canvas_smart_objects_calculate_count_get), 1104 EO_OP_FUNC(EVAS_CANVAS_ID(EVAS_CANVAS_SUB_ID_SMART_OBJECTS_CALCULATE_COUNT_GET), _canvas_smart_objects_calculate_count_get),
1105 EO_OP_FUNC(EVAS_CANVAS_ID(EVAS_CANVAS_SUB_ID_RENDER_ASYNC), _canvas_render_async), 1105 EO_OP_FUNC(EVAS_CANVAS_ID(EVAS_CANVAS_SUB_ID_RENDER_ASYNC), _canvas_render_async),
1106 EO_OP_FUNC(EVAS_CANVAS_ID(EVAS_CANVAS_SUB_ID_TREE_OBJECTS_AT_XY_GET), _canvas_tree_objects_at_xy_get),
1106 EO_OP_FUNC_SENTINEL 1107 EO_OP_FUNC_SENTINEL
1107 }; 1108 };
1108 1109
@@ -1207,6 +1208,7 @@ static const Eo_Op_Description op_desc[] = {
1207 EO_OP_DESCRIPTION(EVAS_CANVAS_SUB_ID_SMART_OBJECTS_CALCULATE, "Call user-provided calculate() smart functions."), 1208 EO_OP_DESCRIPTION(EVAS_CANVAS_SUB_ID_SMART_OBJECTS_CALCULATE, "Call user-provided calculate() smart functions."),
1208 EO_OP_DESCRIPTION(EVAS_CANVAS_SUB_ID_SMART_OBJECTS_CALCULATE_COUNT_GET, "Get the internal counter that counts the number of smart calculations."), 1209 EO_OP_DESCRIPTION(EVAS_CANVAS_SUB_ID_SMART_OBJECTS_CALCULATE_COUNT_GET, "Get the internal counter that counts the number of smart calculations."),
1209 EO_OP_DESCRIPTION(EVAS_CANVAS_SUB_ID_RENDER_ASYNC, "Renders the canvas asynchronously."), 1210 EO_OP_DESCRIPTION(EVAS_CANVAS_SUB_ID_RENDER_ASYNC, "Renders the canvas asynchronously."),
1211 EO_OP_DESCRIPTION(EVAS_CANVAS_SUB_ID_TREE_OBJECTS_AT_XY_GET, "Retrieve a list of Evas objects lying over a given position in a canvas."),
1210 EO_OP_DESCRIPTION_SENTINEL 1212 EO_OP_DESCRIPTION_SENTINEL
1211}; 1213};
1212 1214
diff --git a/src/lib/evas/include/evas_private.h b/src/lib/evas/include/evas_private.h
index 01658f7b97..bf2bb3fc81 100644
--- a/src/lib/evas/include/evas_private.h
+++ b/src/lib/evas/include/evas_private.h
@@ -1144,6 +1144,7 @@ void _canvas_event_feed_key_up(Eo *e, void *_pd, va_list *list);
1144void _canvas_event_feed_hold(Eo *e, void *_pd, va_list *list); 1144void _canvas_event_feed_hold(Eo *e, void *_pd, va_list *list);
1145void _canvas_event_refeed_event(Eo *e, void *_pd, va_list *list); 1145void _canvas_event_refeed_event(Eo *e, void *_pd, va_list *list);
1146void _canvas_event_down_count_get(Eo *e, void *_pd, va_list *list); 1146void _canvas_event_down_count_get(Eo *e, void *_pd, va_list *list);
1147void _canvas_tree_objects_at_xy_get(Eo *e, void *_pd, va_list *list);
1147void _canvas_focus_get(Eo *e, void *_pd, va_list *list); 1148void _canvas_focus_get(Eo *e, void *_pd, va_list *list);
1148void _canvas_font_path_clear(Eo *e, void *_pd, va_list *list); 1149void _canvas_font_path_clear(Eo *e, void *_pd, va_list *list);
1149void _canvas_font_path_append(Eo *e, void *_pd, va_list *list); 1150void _canvas_font_path_append(Eo *e, void *_pd, va_list *list);