summaryrefslogtreecommitdiff
path: root/src/lib/evas/canvas/evas_key_grab.c
diff options
context:
space:
mode:
authorDaniel Zaoui <daniel.zaoui@samsung.com>2014-03-11 13:51:35 +0200
committerDaniel Zaoui <daniel.zaoui@samsung.com>2014-03-12 10:57:28 +0200
commitf22bd9e6eeee337df7c35223743dff2d941bdad7 (patch)
treef942477d8640839f9bd41619f513f4868e8fc799 /src/lib/evas/canvas/evas_key_grab.c
parentcd28854fdf4f31684800a0efe892634431a61f2f (diff)
Eolian: Integration of Evas Object.
const have been added in object parameter of two legacy APIs to fit Eolian generated files. Since these functions retrieve information from object, it is logic that the object would be const.
Diffstat (limited to 'src/lib/evas/canvas/evas_key_grab.c')
-rw-r--r--src/lib/evas/canvas/evas_key_grab.c55
1 files changed, 8 insertions, 47 deletions
diff --git a/src/lib/evas/canvas/evas_key_grab.c b/src/lib/evas/canvas/evas_key_grab.c
index 0104b96..b7c0d96 100644
--- a/src/lib/evas/canvas/evas_key_grab.c
+++ b/src/lib/evas/canvas/evas_key_grab.c
@@ -107,70 +107,30 @@ evas_key_grab_free(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, const c
107 107
108/* public calls */ 108/* public calls */
109 109
110EAPI Eina_Bool 110EOLIAN Eina_Bool
111evas_object_key_grab(Evas_Object *eo_obj, const char *keyname, Evas_Modifier_Mask modifiers, Evas_Modifier_Mask not_modifiers, Eina_Bool exclusive) 111_evas_object_key_grab(Eo *eo_obj, Evas_Object_Protected_Data *obj, const char *keyname, Evas_Modifier_Mask modifiers, Evas_Modifier_Mask not_modifiers, Eina_Bool exclusive)
112{ 112{
113 MAGIC_CHECK(eo_obj, Evas_Object, MAGIC_OBJ);
114 return EINA_FALSE;
115 MAGIC_CHECK_END();
116 Eina_Bool ret = EINA_FALSE;
117 eo_do(eo_obj, evas_obj_key_grab(keyname, modifiers, not_modifiers, exclusive, &ret));
118 return ret;
119}
120
121void
122_key_grab(Eo *eo_obj, void *_pd, va_list *list)
123{
124 const char *keyname = va_arg(*list, const char *);
125 Evas_Modifier_Mask modifiers = va_arg(*list, Evas_Modifier_Mask);
126 Evas_Modifier_Mask not_modifiers = va_arg(*list, Evas_Modifier_Mask);
127 Eina_Bool exclusive = va_arg(*list, int);
128 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
129
130 /* MEM OK */ 113 /* MEM OK */
131 Evas_Key_Grab *g; 114 Evas_Key_Grab *g;
132 115
133 Evas_Object_Protected_Data *obj = _pd; 116 if (((modifiers == not_modifiers) && (modifiers != 0)) || (!keyname)) return EINA_FALSE;
134 if (((modifiers == not_modifiers) && (modifiers != 0)) || (!keyname))
135 {
136 *ret = EINA_FALSE;
137 return;
138 }
139 if (exclusive) 117 if (exclusive)
140 { 118 {
141 g = evas_key_grab_find(eo_obj, obj, keyname, modifiers, not_modifiers, 119 g = evas_key_grab_find(eo_obj, obj, keyname, modifiers, not_modifiers,
142 exclusive); 120 exclusive);
143 if (g) 121 if (g) return EINA_FALSE;
144 {
145 *ret = EINA_FALSE;
146 return;
147 }
148 } 122 }
149 g = evas_key_grab_new(eo_obj, obj, keyname, modifiers, not_modifiers, exclusive); 123 g = evas_key_grab_new(eo_obj, obj, keyname, modifiers, not_modifiers, exclusive);
150 *ret = (!g) ? EINA_FALSE : EINA_TRUE; 124 return ((!g) ? EINA_FALSE : EINA_TRUE);
151} 125}
152 126
153EAPI void 127EOLIAN void
154evas_object_key_ungrab(Evas_Object *eo_obj, const char *keyname, Evas_Modifier_Mask modifiers, Evas_Modifier_Mask not_modifiers) 128_evas_object_key_ungrab(Eo *eo_obj, Evas_Object_Protected_Data *obj, const char *keyname, Evas_Modifier_Mask modifiers, Evas_Modifier_Mask not_modifiers)
155{ 129{
156 MAGIC_CHECK(eo_obj, Evas_Object, MAGIC_OBJ);
157 return;
158 MAGIC_CHECK_END();
159 eo_do(eo_obj, evas_obj_key_ungrab(keyname, modifiers, not_modifiers));
160}
161
162void
163_key_ungrab(Eo *eo_obj, void *_pd, va_list *list)
164{
165 const char *keyname = va_arg(*list, const char *);
166 Evas_Modifier_Mask modifiers = va_arg(*list, Evas_Modifier_Mask);
167 Evas_Modifier_Mask not_modifiers = va_arg(*list, Evas_Modifier_Mask);
168
169 /* MEM OK */ 130 /* MEM OK */
170 Evas_Key_Grab *g; 131 Evas_Key_Grab *g;
171 132
172 if (!keyname) return; 133 if (!keyname) return;
173 Evas_Object_Protected_Data *obj = _pd;
174 g = evas_key_grab_find(eo_obj, obj, keyname, modifiers, not_modifiers, 0); 134 g = evas_key_grab_find(eo_obj, obj, keyname, modifiers, not_modifiers, 0);
175 if (!g) return; 135 if (!g) return;
176 Evas_Object_Protected_Data *g_object = eo_data_scope_get(g->object, EVAS_OBJ_CLASS); 136 Evas_Object_Protected_Data *g_object = eo_data_scope_get(g->object, EVAS_OBJ_CLASS);
@@ -185,3 +145,4 @@ _key_ungrab(Eo *eo_obj, void *_pd, va_list *list)
185 else 145 else
186 evas_key_grab_free(g->object, g_object, keyname, modifiers, not_modifiers); 146 evas_key_grab_free(g->object, g_object, keyname, modifiers, not_modifiers);
187} 147}
148