summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCedric Bail <cedric.bail@samsung.com>2013-08-29 11:21:20 +0900
committerCedric Bail <cedric.bail@samsung.com>2013-08-29 11:21:20 +0900
commit1ac1db596fab74bd889cede127bcb1ff94ddecab (patch)
treeaf1cf834b6a34d5c4ee54bd5f26e7d42ba3142b9
parent85f0749a83a2d1eeb474d92de077d484aa195b64 (diff)
evas: add interceptor for focus_set.
Diffstat (limited to '')
-rw-r--r--ChangeLog4
-rw-r--r--NEWS1
-rw-r--r--src/lib/evas/Evas_Common.h1
-rw-r--r--src/lib/evas/Evas_Legacy.h3
-rw-r--r--src/lib/evas/canvas/evas_focus.c1
-rw-r--r--src/lib/evas/canvas/evas_object_intercept.c50
-rw-r--r--src/lib/evas/include/evas_private.h25
7 files changed, 75 insertions, 10 deletions
diff --git a/ChangeLog b/ChangeLog
index 31645b59d8..99658c5d26 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
12013-08-29 Cedric Bail 12013-08-29 Cedric Bail
2 2
3 * Evas: add interceptor for focus_set.
4
52013-08-28 Cedric Bail
6
3 * Evas: use mmap/munmap to allocate surface. 7 * Evas: use mmap/munmap to allocate surface.
4 8
52013-08-27 Jaehyun Cho 92013-08-27 Jaehyun Cho
diff --git a/NEWS b/NEWS
index d7f0bf2120..088067c802 100644
--- a/NEWS
+++ b/NEWS
@@ -60,6 +60,7 @@ Additions:
60 - Change mapping policy for image loader. 60 - Change mapping policy for image loader.
61 - textblock: Use max ascent/descent at the edges of the textblock. 61 - textblock: Use max ascent/descent at the edges of the textblock.
62 - textblock: Make the ellipsis format the same as the surrounding. 62 - textblock: Make the ellipsis format the same as the surrounding.
63 - Add interceptor for focus_set.
63 * Ecore_X: 64 * Ecore_X:
64 - Add window profile support. 65 - Add window profile support.
65 ECORE_X_ATOM_E_WINDOW_PROFILE_SUPPORTED 66 ECORE_X_ATOM_E_WINDOW_PROFILE_SUPPORTED
diff --git a/src/lib/evas/Evas_Common.h b/src/lib/evas/Evas_Common.h
index 35a673521b..77f65bd4d6 100644
--- a/src/lib/evas/Evas_Common.h
+++ b/src/lib/evas/Evas_Common.h
@@ -2511,6 +2511,7 @@ typedef void (*Evas_Object_Intercept_Lower_Cb)(void *data, Evas_Object *obj);
2511typedef void (*Evas_Object_Intercept_Stack_Above_Cb)(void *data, Evas_Object *obj, Evas_Object *above); 2511typedef void (*Evas_Object_Intercept_Stack_Above_Cb)(void *data, Evas_Object *obj, Evas_Object *above);
2512typedef void (*Evas_Object_Intercept_Stack_Below_Cb)(void *data, Evas_Object *obj, Evas_Object *above); 2512typedef void (*Evas_Object_Intercept_Stack_Below_Cb)(void *data, Evas_Object *obj, Evas_Object *above);
2513typedef void (*Evas_Object_Intercept_Layer_Set_Cb)(void *data, Evas_Object *obj, int l); 2513typedef void (*Evas_Object_Intercept_Layer_Set_Cb)(void *data, Evas_Object *obj, int l);
2514typedef void (*Evas_Object_Intercept_Focus_Set_Cb)(void *data, Evas_Object *obj, Eina_Bool focus);
2514typedef void (*Evas_Object_Intercept_Color_Set_Cb)(void *data, Evas_Object *obj, int r, int g, int b, int a); 2515typedef void (*Evas_Object_Intercept_Color_Set_Cb)(void *data, Evas_Object *obj, int r, int g, int b, int a);
2515typedef void (*Evas_Object_Intercept_Clip_Set_Cb)(void *data, Evas_Object *obj, Evas_Object *clip); 2516typedef void (*Evas_Object_Intercept_Clip_Set_Cb)(void *data, Evas_Object *obj, Evas_Object *clip);
2516typedef void (*Evas_Object_Intercept_Clip_Unset_Cb)(void *data, Evas_Object *obj); 2517typedef void (*Evas_Object_Intercept_Clip_Unset_Cb)(void *data, Evas_Object *obj);
diff --git a/src/lib/evas/Evas_Legacy.h b/src/lib/evas/Evas_Legacy.h
index 2ea4cb2e50..25fec60284 100644
--- a/src/lib/evas/Evas_Legacy.h
+++ b/src/lib/evas/Evas_Legacy.h
@@ -3816,6 +3816,9 @@ EAPI void evas_object_intercept_clip_set_callback_add(Evas_Object *obj, Evas_Ob
3816EAPI void *evas_object_intercept_clip_set_callback_del(Evas_Object *obj, Evas_Object_Intercept_Clip_Set_Cb func) EINA_ARG_NONNULL(1, 2); 3816EAPI void *evas_object_intercept_clip_set_callback_del(Evas_Object *obj, Evas_Object_Intercept_Clip_Set_Cb func) EINA_ARG_NONNULL(1, 2);
3817EAPI void evas_object_intercept_clip_unset_callback_add(Evas_Object *obj, Evas_Object_Intercept_Clip_Unset_Cb func, const void *data) EINA_ARG_NONNULL(1, 2); 3817EAPI void evas_object_intercept_clip_unset_callback_add(Evas_Object *obj, Evas_Object_Intercept_Clip_Unset_Cb func, const void *data) EINA_ARG_NONNULL(1, 2);
3818EAPI void *evas_object_intercept_clip_unset_callback_del(Evas_Object *obj, Evas_Object_Intercept_Clip_Unset_Cb func) EINA_ARG_NONNULL(1, 2); 3818EAPI void *evas_object_intercept_clip_unset_callback_del(Evas_Object *obj, Evas_Object_Intercept_Clip_Unset_Cb func) EINA_ARG_NONNULL(1, 2);
3819EAPI void evas_object_intercept_focus_set_callback_add(Evas_Object *obj, Evas_Object_Intercept_Focus_Set_Cb func, const void *data) EINA_ARG_NONNULL(1, 2);
3820EAPI void *evas_object_intercept_focus_set_callback_del(Evas_Object *obj, Evas_Object_Intercept_Focus_Set_Cb func) EINA_ARG_NONNULL(1, 2);
3821
3819/** 3822/**
3820 * @} 3823 * @}
3821 */ 3824 */
diff --git a/src/lib/evas/canvas/evas_focus.c b/src/lib/evas/canvas/evas_focus.c
index ab75ae1a5a..757f585dc7 100644
--- a/src/lib/evas/canvas/evas_focus.c
+++ b/src/lib/evas/canvas/evas_focus.c
@@ -28,6 +28,7 @@ _focus_set(Eo *eo_obj, void *_pd, va_list *list)
28 28
29 event_id = _evas_event_counter; 29 event_id = _evas_event_counter;
30 if (obj->focused == focus) goto end; 30 if (obj->focused == focus) goto end;
31 if (evas_object_intercept_call_focus_set(eo_obj, obj, focus)) goto end;
31 if (focus) 32 if (focus)
32 { 33 {
33 if (obj->layer->evas->focused) 34 if (obj->layer->evas->focused)
diff --git a/src/lib/evas/canvas/evas_object_intercept.c b/src/lib/evas/canvas/evas_object_intercept.c
index ff3d5c1e92..9b0048a572 100644
--- a/src/lib/evas/canvas/evas_object_intercept.c
+++ b/src/lib/evas/canvas/evas_object_intercept.c
@@ -129,6 +129,24 @@ evas_object_intercept_call_layer_set(Evas_Object *eo_obj,
129} 129}
130 130
131int 131int
132evas_object_intercept_call_focus_set(Evas_Object *eo_obj,
133 Evas_Object_Protected_Data *obj,
134 Eina_Bool focus)
135{
136 int ret;
137
138 if (!obj->interceptors) return 0;
139 if (obj->intercepted) return 0;
140 obj->intercepted = EINA_TRUE;
141 ret = !!(obj->interceptors->focus_set.func);
142 if (ret)
143 obj->interceptors->focus_set.func(obj->interceptors->focus_set.data, eo_obj, focus);
144 obj->intercepted = EINA_FALSE;
145 return ret;
146}
147
148
149int
132evas_object_intercept_call_color_set(Evas_Object *eo_obj, 150evas_object_intercept_call_color_set(Evas_Object *eo_obj,
133 Evas_Object_Protected_Data *obj, 151 Evas_Object_Protected_Data *obj,
134 int r, int g, int b, int a) 152 int r, int g, int b, int a)
@@ -466,6 +484,38 @@ evas_object_intercept_layer_set_callback_del(Evas_Object *eo_obj, Evas_Object_In
466} 484}
467 485
468EAPI void 486EAPI void
487evas_object_intercept_focus_set_callback_add(Evas_Object *eo_obj, Evas_Object_Intercept_Focus_Set_Cb func, const void *data)
488{
489 MAGIC_CHECK(eo_obj, Evas_Object, MAGIC_OBJ);
490 return;
491 MAGIC_CHECK_END();
492 Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJ_CLASS);
493 if (!func) return;
494 evas_object_intercept_init(eo_obj);
495 if (!obj->interceptors) return;
496 obj->interceptors->focus_set.func = func;
497 obj->interceptors->focus_set.data = (void *)data;
498}
499
500EAPI void *
501evas_object_intercept_focus_set_callback_del(Evas_Object *eo_obj, Evas_Object_Intercept_Focus_Set_Cb func)
502{
503 Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJ_CLASS);
504 void *data;
505
506 MAGIC_CHECK(eo_obj, Evas_Object, MAGIC_OBJ);
507 return NULL;
508 MAGIC_CHECK_END();
509 if (!func) return NULL;
510 if (!obj->interceptors) return NULL;
511 obj->interceptors->focus_set.func = NULL;
512 data = obj->interceptors->focus_set.data;
513 obj->interceptors->focus_set.data = NULL;
514 evas_object_intercept_deinit(eo_obj);
515 return data;
516}
517
518EAPI void
469evas_object_intercept_color_set_callback_add(Evas_Object *eo_obj, Evas_Object_Intercept_Color_Set_Cb func, const void *data) 519evas_object_intercept_color_set_callback_add(Evas_Object *eo_obj, Evas_Object_Intercept_Color_Set_Cb func, const void *data)
470{ 520{
471 MAGIC_CHECK(eo_obj, Evas_Object, MAGIC_OBJ); 521 MAGIC_CHECK(eo_obj, Evas_Object, MAGIC_OBJ);
diff --git a/src/lib/evas/include/evas_private.h b/src/lib/evas/include/evas_private.h
index f2344c5fd9..870e1474aa 100644
--- a/src/lib/evas/include/evas_private.h
+++ b/src/lib/evas/include/evas_private.h
@@ -238,6 +238,10 @@ struct _Evas_Intercept_Func
238 Evas_Object_Intercept_Clip_Unset_Cb func; 238 Evas_Object_Intercept_Clip_Unset_Cb func;
239 void *data; 239 void *data;
240 } clip_unset; 240 } clip_unset;
241 struct {
242 Evas_Object_Intercept_Focus_Set_Cb func;
243 void *data;
244 } focus_set;
241}; 245};
242 246
243struct _Evas_Smart_Cb_Description_Array 247struct _Evas_Smart_Cb_Description_Array
@@ -1015,18 +1019,19 @@ void evas_object_inform_call_image_preloaded(Evas_Object *obj);
1015void evas_object_inform_call_image_unloaded(Evas_Object *obj); 1019void evas_object_inform_call_image_unloaded(Evas_Object *obj);
1016void evas_object_inform_call_image_resize(Evas_Object *obj); 1020void evas_object_inform_call_image_resize(Evas_Object *obj);
1017void evas_object_intercept_cleanup(Evas_Object *obj); 1021void evas_object_intercept_cleanup(Evas_Object *obj);
1018int evas_object_intercept_call_show(Evas_Object *obj); 1022int evas_object_intercept_call_show(Evas_Object *obj, Evas_Object_Protected_Data *pd);
1019int evas_object_intercept_call_hide(Evas_Object *obj); 1023int evas_object_intercept_call_hide(Evas_Object *obj, Evas_Object_Protected_Data *pd);
1020int evas_object_intercept_call_move(Evas_Object *obj, Evas_Object_Protected_Data *pd, Evas_Coord x, Evas_Coord y); 1024int evas_object_intercept_call_move(Evas_Object *obj, Evas_Object_Protected_Data *pd, Evas_Coord x, Evas_Coord y);
1021int evas_object_intercept_call_resize(Evas_Object *obj, Evas_Coord w, Evas_Coord h); 1025int evas_object_intercept_call_resize(Evas_Object *obj, Evas_Object_Protected_Data *pd, Evas_Coord w, Evas_Coord h);
1022int evas_object_intercept_call_raise(Evas_Object *obj); 1026int evas_object_intercept_call_raise(Evas_Object *obj, Evas_Object_Protected_Data *pd);
1023int evas_object_intercept_call_lower(Evas_Object *obj); 1027int evas_object_intercept_call_lower(Evas_Object *obj, Evas_Object_Protected_Data *pd);
1024int evas_object_intercept_call_stack_above(Evas_Object *obj, Evas_Object *above); 1028int evas_object_intercept_call_stack_above(Evas_Object *obj, Evas_Object_Protected_Data *pd, Evas_Object *above);
1025int evas_object_intercept_call_stack_below(Evas_Object *obj, Evas_Object *below); 1029int evas_object_intercept_call_stack_below(Evas_Object *obj, Evas_Object_Protected_Data *pd, Evas_Object *below);
1026int evas_object_intercept_call_layer_set(Evas_Object *obj, int l); 1030int evas_object_intercept_call_layer_set(Evas_Object *obj, Evas_Object_Protected_Data *pd, int l);
1027int evas_object_intercept_call_color_set(Evas_Object *obj, int r, int g, int b, int a); 1031int evas_object_intercept_call_color_set(Evas_Object *obj, Evas_Object_Protected_Data *pd, int r, int g, int b, int a);
1028int evas_object_intercept_call_clip_set(Evas_Object *obj, Evas_Object_Protected_Data *pd, Evas_Object *clip); 1032int evas_object_intercept_call_clip_set(Evas_Object *obj, Evas_Object_Protected_Data *pd, Evas_Object *clip);
1029int evas_object_intercept_call_clip_unset(Evas_Object *obj); 1033int evas_object_intercept_call_clip_unset(Evas_Object *obj, Evas_Object_Protected_Data *pd);
1034int evas_object_intercept_call_focus_set(Evas_Object *obj, Evas_Object_Protected_Data *pd, Eina_Bool focus);
1030void evas_object_grabs_cleanup(Evas_Object *obj, Evas_Object_Protected_Data *pd); 1035void evas_object_grabs_cleanup(Evas_Object *obj, Evas_Object_Protected_Data *pd);
1031void evas_key_grab_free(Evas_Object *obj, Evas_Object_Protected_Data *pd, const char *keyname, Evas_Modifier_Mask modifiers, Evas_Modifier_Mask not_modifiers); 1036void evas_key_grab_free(Evas_Object *obj, Evas_Object_Protected_Data *pd, const char *keyname, Evas_Modifier_Mask modifiers, Evas_Modifier_Mask not_modifiers);
1032void evas_font_dir_cache_free(void); 1037void evas_font_dir_cache_free(void);