diff options
author | David Walter Seikel | 2013-01-13 17:29:19 +1000 |
---|---|---|
committer | David Walter Seikel | 2013-01-13 17:29:19 +1000 |
commit | 07274513e984f0b5544586c74508ccd16e7dcafa (patch) | |
tree | b32ff2a9136fbc1a4a6a0ed1e4d79cde0f5f16d9 /libraries/ecore/src/lib/ecore_imf_evas/ecore_imf_evas.c | |
parent | Added Irrlicht 1.8, but without all the Windows binaries. (diff) | |
download | SledjHamr-07274513e984f0b5544586c74508ccd16e7dcafa.zip SledjHamr-07274513e984f0b5544586c74508ccd16e7dcafa.tar.gz SledjHamr-07274513e984f0b5544586c74508ccd16e7dcafa.tar.bz2 SledjHamr-07274513e984f0b5544586c74508ccd16e7dcafa.tar.xz |
Remove EFL, since it's been released now.
Diffstat (limited to 'libraries/ecore/src/lib/ecore_imf_evas/ecore_imf_evas.c')
-rw-r--r-- | libraries/ecore/src/lib/ecore_imf_evas/ecore_imf_evas.c | 303 |
1 files changed, 0 insertions, 303 deletions
diff --git a/libraries/ecore/src/lib/ecore_imf_evas/ecore_imf_evas.c b/libraries/ecore/src/lib/ecore_imf_evas/ecore_imf_evas.c deleted file mode 100644 index 62ba4c8..0000000 --- a/libraries/ecore/src/lib/ecore_imf_evas/ecore_imf_evas.c +++ /dev/null | |||
@@ -1,303 +0,0 @@ | |||
1 | #ifdef HAVE_CONFIG_H | ||
2 | # include <config.h> | ||
3 | #endif | ||
4 | |||
5 | #include "Ecore_IMF_Evas.h" | ||
6 | |||
7 | /** | ||
8 | * @defgroup Ecore_IMF_Evas_Group Ecore Input Method Context Evas Helper Functions | ||
9 | * | ||
10 | * Helper functions to make it easy to use Evas with Ecore_IMF. | ||
11 | */ | ||
12 | |||
13 | static const char *_ecore_imf_evas_event_empty = ""; | ||
14 | |||
15 | /* Converts the Evas modifiers to Ecore_IMF keyboard modifiers */ | ||
16 | static void | ||
17 | _ecore_imf_evas_event_modifiers_wrap(Evas_Modifier *evas_modifiers, | ||
18 | Ecore_IMF_Keyboard_Modifiers *imf_keyboard_modifiers) | ||
19 | { | ||
20 | if (!evas_modifiers || !imf_keyboard_modifiers) | ||
21 | return; | ||
22 | |||
23 | *imf_keyboard_modifiers = ECORE_IMF_KEYBOARD_MODIFIER_NONE; | ||
24 | if (evas_key_modifier_is_set(evas_modifiers, "Control")) | ||
25 | *imf_keyboard_modifiers |= ECORE_IMF_KEYBOARD_MODIFIER_CTRL; | ||
26 | if (evas_key_modifier_is_set(evas_modifiers, "Alt")) | ||
27 | *imf_keyboard_modifiers |= ECORE_IMF_KEYBOARD_MODIFIER_ALT; | ||
28 | if (evas_key_modifier_is_set(evas_modifiers, "Shift")) | ||
29 | *imf_keyboard_modifiers |= ECORE_IMF_KEYBOARD_MODIFIER_SHIFT; | ||
30 | if (evas_key_modifier_is_set(evas_modifiers, "Super") || evas_key_modifier_is_set(evas_modifiers, "Hyper")) | ||
31 | *imf_keyboard_modifiers |= ECORE_IMF_KEYBOARD_MODIFIER_WIN; | ||
32 | } | ||
33 | |||
34 | /* Converts the Evas locks to Ecore_IMF keyboard locks */ | ||
35 | static void | ||
36 | _ecore_imf_evas_event_locks_wrap(Evas_Lock *evas_locks, | ||
37 | Ecore_IMF_Keyboard_Locks *imf_keyboard_locks) | ||
38 | { | ||
39 | if (!evas_locks || !imf_keyboard_locks) | ||
40 | return; | ||
41 | |||
42 | *imf_keyboard_locks = ECORE_IMF_KEYBOARD_LOCK_NONE; | ||
43 | if (evas_key_lock_is_set(evas_locks, "Num_Lock")) | ||
44 | *imf_keyboard_locks |= ECORE_IMF_KEYBOARD_LOCK_NUM; | ||
45 | if (evas_key_lock_is_set(evas_locks, "Caps_Lock")) | ||
46 | *imf_keyboard_locks |= ECORE_IMF_KEYBOARD_LOCK_CAPS; | ||
47 | if (evas_key_lock_is_set(evas_locks, "Scroll_Lock")) | ||
48 | *imf_keyboard_locks |= ECORE_IMF_KEYBOARD_LOCK_SCROLL; | ||
49 | } | ||
50 | |||
51 | /* Converts the Evas mouse flags to Ecore_IMF mouse flags */ | ||
52 | static void | ||
53 | _ecore_imf_evas_event_mouse_flags_wrap(Evas_Button_Flags evas_flags, | ||
54 | Ecore_IMF_Mouse_Flags *imf_flags) | ||
55 | { | ||
56 | if (!imf_flags) | ||
57 | return; | ||
58 | |||
59 | *imf_flags = ECORE_IMF_MOUSE_NONE; | ||
60 | if (evas_flags & EVAS_BUTTON_DOUBLE_CLICK) | ||
61 | *imf_flags |= ECORE_IMF_MOUSE_DOUBLE_CLICK; | ||
62 | if (evas_flags & EVAS_BUTTON_TRIPLE_CLICK) | ||
63 | *imf_flags |= ECORE_IMF_MOUSE_TRIPLE_CLICK; | ||
64 | } | ||
65 | |||
66 | /** | ||
67 | * Converts a "mouse_in" event from Evas to the corresponding event of Ecore_IMF. | ||
68 | * | ||
69 | * @param evas_event The received Evas event. | ||
70 | * @param imf_event The location to store the converted Ecore_IMF event. | ||
71 | * @ingroup Ecore_IMF_Evas_Group | ||
72 | */ | ||
73 | EAPI void | ||
74 | ecore_imf_evas_event_mouse_in_wrap(Evas_Event_Mouse_In *evas_event, | ||
75 | Ecore_IMF_Event_Mouse_In *imf_event) | ||
76 | { | ||
77 | if (!evas_event || !imf_event) | ||
78 | return; | ||
79 | |||
80 | imf_event->buttons = evas_event->buttons; | ||
81 | imf_event->output.x = evas_event->output.x; | ||
82 | imf_event->output.y = evas_event->output.y; | ||
83 | imf_event->canvas.x = evas_event->canvas.x; | ||
84 | imf_event->canvas.y = evas_event->canvas.y; | ||
85 | imf_event->timestamp = evas_event->timestamp; | ||
86 | _ecore_imf_evas_event_modifiers_wrap(evas_event->modifiers, &imf_event->modifiers); | ||
87 | _ecore_imf_evas_event_locks_wrap(evas_event->locks, &imf_event->locks); | ||
88 | } | ||
89 | |||
90 | /** | ||
91 | * Converts a "mouse_out" event from Evas to the corresponding event of Ecore_IMF. | ||
92 | * | ||
93 | * @param evas_event The received Evas event. | ||
94 | * @param imf_event The location to store the converted Ecore_IMF event. | ||
95 | * @ingroup Ecore_IMF_Evas_Group | ||
96 | */ | ||
97 | EAPI void | ||
98 | ecore_imf_evas_event_mouse_out_wrap(Evas_Event_Mouse_Out *evas_event, | ||
99 | Ecore_IMF_Event_Mouse_Out *imf_event) | ||
100 | { | ||
101 | if (!evas_event || !imf_event) | ||
102 | return; | ||
103 | |||
104 | imf_event->buttons = evas_event->buttons; | ||
105 | imf_event->output.x = evas_event->output.x; | ||
106 | imf_event->output.y = evas_event->output.y; | ||
107 | imf_event->canvas.x = evas_event->canvas.x; | ||
108 | imf_event->canvas.y = evas_event->canvas.y; | ||
109 | imf_event->timestamp = evas_event->timestamp; | ||
110 | _ecore_imf_evas_event_modifiers_wrap(evas_event->modifiers, &imf_event->modifiers); | ||
111 | _ecore_imf_evas_event_locks_wrap(evas_event->locks, &imf_event->locks); | ||
112 | } | ||
113 | |||
114 | /** | ||
115 | * Converts a "mouse_move" event from Evas to the corresponding event of Ecore_IMF. | ||
116 | * | ||
117 | * @param evas_event The received Evas event. | ||
118 | * @param imf_event The location to store the converted Ecore_IMF event. | ||
119 | * @ingroup Ecore_IMF_Evas_Group | ||
120 | */ | ||
121 | EAPI void | ||
122 | ecore_imf_evas_event_mouse_move_wrap(Evas_Event_Mouse_Move *evas_event, | ||
123 | Ecore_IMF_Event_Mouse_Move *imf_event) | ||
124 | { | ||
125 | if (!evas_event || !imf_event) | ||
126 | return; | ||
127 | |||
128 | imf_event->buttons = evas_event->buttons; | ||
129 | imf_event->cur.output.x = evas_event->cur.output.x; | ||
130 | imf_event->cur.output.y = evas_event->cur.output.y; | ||
131 | imf_event->prev.output.x = evas_event->prev.output.x; | ||
132 | imf_event->prev.output.y = evas_event->prev.output.y; | ||
133 | imf_event->cur.canvas.x = evas_event->cur.canvas.x; | ||
134 | imf_event->cur.canvas.y = evas_event->cur.canvas.y; | ||
135 | imf_event->prev.canvas.x = evas_event->prev.canvas.x; | ||
136 | imf_event->prev.canvas.y = evas_event->prev.canvas.y; | ||
137 | imf_event->timestamp = evas_event->timestamp; | ||
138 | _ecore_imf_evas_event_modifiers_wrap(evas_event->modifiers, &imf_event->modifiers); | ||
139 | _ecore_imf_evas_event_locks_wrap(evas_event->locks, &imf_event->locks); | ||
140 | } | ||
141 | |||
142 | /** | ||
143 | * Converts a "mouse_down" event from Evas to the corresponding event of Ecore_IMF. | ||
144 | * | ||
145 | * @param evas_event The received Evas event. | ||
146 | * @param imf_event The location to store the converted Ecore_IMF event. | ||
147 | * @ingroup Ecore_IMF_Evas_Group | ||
148 | */ | ||
149 | EAPI void | ||
150 | ecore_imf_evas_event_mouse_down_wrap(Evas_Event_Mouse_Down *evas_event, | ||
151 | Ecore_IMF_Event_Mouse_Down *imf_event) | ||
152 | { | ||
153 | if (!evas_event || !imf_event) | ||
154 | return; | ||
155 | |||
156 | imf_event->button = evas_event->button; | ||
157 | imf_event->output.x = evas_event->output.x; | ||
158 | imf_event->output.y = evas_event->output.y; | ||
159 | imf_event->canvas.x = evas_event->canvas.x; | ||
160 | imf_event->canvas.y = evas_event->canvas.y; | ||
161 | imf_event->timestamp = evas_event->timestamp; | ||
162 | _ecore_imf_evas_event_modifiers_wrap(evas_event->modifiers, &imf_event->modifiers); | ||
163 | _ecore_imf_evas_event_locks_wrap(evas_event->locks, &imf_event->locks); | ||
164 | _ecore_imf_evas_event_mouse_flags_wrap(evas_event->flags, &imf_event->flags); | ||
165 | } | ||
166 | |||
167 | /** | ||
168 | * Converts a "mouse_up" event from Evas to the corresponding event of Ecore_IMF. | ||
169 | * | ||
170 | * @param evas_event The received Evas event. | ||
171 | * @param imf_event The location to store the converted Ecore_IMF event. | ||
172 | * @ingroup Ecore_IMF_Evas_Group | ||
173 | */ | ||
174 | EAPI void | ||
175 | ecore_imf_evas_event_mouse_up_wrap(Evas_Event_Mouse_Up *evas_event, | ||
176 | Ecore_IMF_Event_Mouse_Up *imf_event) | ||
177 | { | ||
178 | if (!evas_event || !imf_event) | ||
179 | return; | ||
180 | |||
181 | imf_event->button = evas_event->button; | ||
182 | imf_event->output.x = evas_event->output.x; | ||
183 | imf_event->output.y = evas_event->output.y; | ||
184 | imf_event->canvas.x = evas_event->canvas.x; | ||
185 | imf_event->canvas.y = evas_event->canvas.y; | ||
186 | imf_event->timestamp = evas_event->timestamp; | ||
187 | _ecore_imf_evas_event_modifiers_wrap(evas_event->modifiers, &imf_event->modifiers); | ||
188 | _ecore_imf_evas_event_locks_wrap(evas_event->locks, &imf_event->locks); | ||
189 | _ecore_imf_evas_event_mouse_flags_wrap(evas_event->flags, &imf_event->flags); | ||
190 | } | ||
191 | |||
192 | /** | ||
193 | * Converts a "mouse_wheel" event from Evas to the corresponding event of Ecore_IMF. | ||
194 | * | ||
195 | * @param evas_event The received Evas event. | ||
196 | * @param imf_event The location to store the converted Ecore_IMF event. | ||
197 | * @ingroup Ecore_IMF_Evas_Group | ||
198 | */ | ||
199 | EAPI void | ||
200 | ecore_imf_evas_event_mouse_wheel_wrap(Evas_Event_Mouse_Wheel *evas_event, | ||
201 | Ecore_IMF_Event_Mouse_Wheel *imf_event) | ||
202 | { | ||
203 | if (!evas_event || !imf_event) | ||
204 | return; | ||
205 | |||
206 | imf_event->direction = evas_event->direction; | ||
207 | imf_event->z = evas_event->z; | ||
208 | imf_event->output.x = evas_event->output.x; | ||
209 | imf_event->output.y = evas_event->output.y; | ||
210 | imf_event->canvas.x = evas_event->canvas.x; | ||
211 | imf_event->canvas.y = evas_event->canvas.y; | ||
212 | imf_event->timestamp = evas_event->timestamp; | ||
213 | _ecore_imf_evas_event_modifiers_wrap(evas_event->modifiers, &imf_event->modifiers); | ||
214 | _ecore_imf_evas_event_locks_wrap(evas_event->locks, &imf_event->locks); | ||
215 | imf_event->timestamp = evas_event->timestamp; | ||
216 | } | ||
217 | |||
218 | /** | ||
219 | * Converts a "key_down" event from Evas to the corresponding event of Ecore_IMF. | ||
220 | * | ||
221 | * @param evas_event The received Evas event. | ||
222 | * @param imf_event The location to store the converted Ecore_IMF event. | ||
223 | * @ingroup Ecore_IMF_Evas_Group | ||
224 | * | ||
225 | * Example | ||
226 | * @code | ||
227 | * static void | ||
228 | * _key_down_cb(void *data, Evas *e, Evas_Object *obj, void *event_info) | ||
229 | * { | ||
230 | * Evas_Event_Key_Down *ev = event_info; | ||
231 | * if (!ev->keyname) return; | ||
232 | * | ||
233 | * if (imf_context) | ||
234 | * { | ||
235 | * Ecore_IMF_Event_Key_Down ecore_ev; | ||
236 | * ecore_imf_evas_event_key_down_wrap(ev, &ecore_ev); | ||
237 | * if (ecore_imf_context_filter_event(imf_context, | ||
238 | * ECORE_IMF_EVENT_KEY_DOWN, | ||
239 | * (Ecore_IMF_Event *)&ecore_ev)) | ||
240 | * return; | ||
241 | * } | ||
242 | * } | ||
243 | * | ||
244 | * evas_object_event_callback_add(obj, EVAS_CALLBACK_KEY_DOWN, _key_down_cb, data); | ||
245 | * @endcode | ||
246 | */ | ||
247 | EAPI void | ||
248 | ecore_imf_evas_event_key_down_wrap(Evas_Event_Key_Down *evas_event, | ||
249 | Ecore_IMF_Event_Key_Down *imf_event) | ||
250 | { | ||
251 | if (!evas_event || !imf_event) | ||
252 | return; | ||
253 | |||
254 | imf_event->keyname = evas_event->keyname ? evas_event->keyname : _ecore_imf_evas_event_empty; | ||
255 | imf_event->key = evas_event->key ? evas_event->key : _ecore_imf_evas_event_empty; | ||
256 | imf_event->string = evas_event->string ? evas_event->string : _ecore_imf_evas_event_empty; | ||
257 | imf_event->compose = evas_event->compose ? evas_event->compose : _ecore_imf_evas_event_empty; | ||
258 | imf_event->timestamp = evas_event->timestamp; | ||
259 | _ecore_imf_evas_event_modifiers_wrap(evas_event->modifiers, &imf_event->modifiers); | ||
260 | _ecore_imf_evas_event_locks_wrap(evas_event->locks, &imf_event->locks); | ||
261 | } | ||
262 | |||
263 | /** | ||
264 | * Converts a "key_up" event from Evas to the corresponding event of Ecore_IMF. | ||
265 | * | ||
266 | * @param evas_event The received Evas event. | ||
267 | * @param imf_event The location to store the converted Ecore_IMF event. | ||
268 | * @ingroup Ecore_IMF_Evas_Group | ||
269 | * | ||
270 | * Example | ||
271 | * @code | ||
272 | * static void | ||
273 | * _key_up_cb(void *data, Evas *e, Evas_Object *obj, void *event_info) | ||
274 | * { | ||
275 | * Evas_Event_Key_Up *ev = event_info; | ||
276 | * if (!ev->keyname) return; | ||
277 | * | ||
278 | * if (imf_context) | ||
279 | * { | ||
280 | * Ecore_IMF_Event_Key_Up ecore_ev; | ||
281 | * ecore_imf_evas_event_key_up_wrap(ev, &ecore_ev); | ||
282 | * if (ecore_imf_context_filter_event(imf_context, | ||
283 | * ECORE_IMF_EVENT_KEY_UP, | ||
284 | * (Ecore_IMF_Event *)&ecore_ev)) | ||
285 | * return; | ||
286 | * } | ||
287 | * } | ||
288 | * | ||
289 | * evas_object_event_callback_add(obj, EVAS_CALLBACK_KEY_UP, _key_up_cb, data); | ||
290 | * @endcode | ||
291 | */ | ||
292 | EAPI void | ||
293 | ecore_imf_evas_event_key_up_wrap(Evas_Event_Key_Up *evas_event, | ||
294 | Ecore_IMF_Event_Key_Up *imf_event) | ||
295 | { | ||
296 | imf_event->keyname = evas_event->keyname ? evas_event->keyname : _ecore_imf_evas_event_empty; | ||
297 | imf_event->key = evas_event->key ? evas_event->key : _ecore_imf_evas_event_empty; | ||
298 | imf_event->string = evas_event->string ? evas_event->string : _ecore_imf_evas_event_empty; | ||
299 | imf_event->compose = evas_event->compose ? evas_event->compose : _ecore_imf_evas_event_empty; | ||
300 | imf_event->timestamp = evas_event->timestamp; | ||
301 | _ecore_imf_evas_event_modifiers_wrap(evas_event->modifiers, &imf_event->modifiers); | ||
302 | _ecore_imf_evas_event_locks_wrap(evas_event->locks, &imf_event->locks); | ||
303 | } | ||