diff options
Diffstat (limited to '')
-rw-r--r-- | libraries/ecore/src/lib/ecore_evas/ecore_evas_psl1ght.c | 46 |
1 files changed, 38 insertions, 8 deletions
diff --git a/libraries/ecore/src/lib/ecore_evas/ecore_evas_psl1ght.c b/libraries/ecore/src/lib/ecore_evas/ecore_evas_psl1ght.c index 0849c79..be130ad 100644 --- a/libraries/ecore/src/lib/ecore_evas/ecore_evas_psl1ght.c +++ b/libraries/ecore/src/lib/ecore_evas/ecore_evas_psl1ght.c | |||
@@ -16,7 +16,7 @@ | |||
16 | static int _ecore_evas_init_count = 0; | 16 | static int _ecore_evas_init_count = 0; |
17 | 17 | ||
18 | static Ecore_Evas *psl1ght_ee = NULL; | 18 | static Ecore_Evas *psl1ght_ee = NULL; |
19 | static Ecore_Event_Handler *ecore_evas_event_handlers[4] = { | 19 | static Ecore_Event_Handler *ecore_evas_event_handlers[5] = { |
20 | NULL, NULL, NULL, NULL | 20 | NULL, NULL, NULL, NULL |
21 | }; | 21 | }; |
22 | 22 | ||
@@ -48,7 +48,7 @@ _ecore_evas_psl1ght_event_got_focus(void *data __UNUSED__, int type __UNUSED__, | |||
48 | ee->prop.focused = 1; | 48 | ee->prop.focused = 1; |
49 | evas_focus_in(ee->evas); | 49 | evas_focus_in(ee->evas); |
50 | if (ee->func.fn_focus_in) ee->func.fn_focus_in(ee); | 50 | if (ee->func.fn_focus_in) ee->func.fn_focus_in(ee); |
51 | 51 | ||
52 | return ECORE_CALLBACK_PASS_ON; | 52 | return ECORE_CALLBACK_PASS_ON; |
53 | } | 53 | } |
54 | 54 | ||
@@ -64,7 +64,7 @@ _ecore_evas_psl1ght_event_lost_focus(void *data __UNUSED__, int type __UNUSED__, | |||
64 | evas_focus_out(ee->evas); | 64 | evas_focus_out(ee->evas); |
65 | ee->prop.focused = 0; | 65 | ee->prop.focused = 0; |
66 | if (ee->func.fn_focus_out) ee->func.fn_focus_out(ee); | 66 | if (ee->func.fn_focus_out) ee->func.fn_focus_out(ee); |
67 | 67 | ||
68 | return ECORE_CALLBACK_PASS_ON; | 68 | return ECORE_CALLBACK_PASS_ON; |
69 | } | 69 | } |
70 | 70 | ||
@@ -98,6 +98,19 @@ _ecore_evas_psl1ght_event_key_modifiers(void *data __UNUSED__, int type __UNUSED | |||
98 | return ECORE_CALLBACK_PASS_ON; | 98 | return ECORE_CALLBACK_PASS_ON; |
99 | } | 99 | } |
100 | 100 | ||
101 | static Eina_Bool | ||
102 | _ecore_evas_psl1ght_event_quit (void *data __UNUSED__, int type __UNUSED__, void *event __UNUSED__) | ||
103 | { | ||
104 | Ecore_Evas *ee; | ||
105 | |||
106 | ee = _ecore_evas_psl1ght_match(); | ||
107 | |||
108 | if (!ee) return ECORE_CALLBACK_PASS_ON; /* pass on event */ | ||
109 | if (ee->func.fn_delete_request) | ||
110 | ee->func.fn_delete_request(ee); | ||
111 | return ECORE_CALLBACK_PASS_ON; | ||
112 | } | ||
113 | |||
101 | static int | 114 | static int |
102 | _ecore_evas_render(Ecore_Evas *ee) | 115 | _ecore_evas_render(Ecore_Evas *ee) |
103 | { | 116 | { |
@@ -170,10 +183,21 @@ _ecore_evas_psl1ght_init(int w __UNUSED__, int h __UNUSED__) | |||
170 | 183 | ||
171 | ecore_event_evas_init(); | 184 | ecore_event_evas_init(); |
172 | 185 | ||
173 | ecore_evas_event_handlers[0] = ecore_event_handler_add(ECORE_PSL1GHT_EVENT_GOT_FOCUS, _ecore_evas_psl1ght_event_got_focus, NULL); | 186 | ecore_evas_event_handlers[0] = |
174 | ecore_evas_event_handlers[1] = ecore_event_handler_add(ECORE_PSL1GHT_EVENT_LOST_FOCUS, _ecore_evas_psl1ght_event_lost_focus, NULL); | 187 | ecore_event_handler_add(ECORE_PSL1GHT_EVENT_GOT_FOCUS, |
175 | ecore_evas_event_handlers[2] = ecore_event_handler_add(ECORE_PSL1GHT_EVENT_EXPOSE, _ecore_evas_psl1ght_event_video_expose, NULL); | 188 | _ecore_evas_psl1ght_event_got_focus, NULL); |
176 | ecore_evas_event_handlers[3] = ecore_event_handler_add(ECORE_PSL1GHT_EVENT_KEY_MODIFIERS, _ecore_evas_psl1ght_event_key_modifiers, NULL); | 189 | ecore_evas_event_handlers[1] = |
190 | ecore_event_handler_add(ECORE_PSL1GHT_EVENT_LOST_FOCUS, | ||
191 | _ecore_evas_psl1ght_event_lost_focus, NULL); | ||
192 | ecore_evas_event_handlers[2] = | ||
193 | ecore_event_handler_add(ECORE_PSL1GHT_EVENT_EXPOSE, | ||
194 | _ecore_evas_psl1ght_event_video_expose, NULL); | ||
195 | ecore_evas_event_handlers[3] = | ||
196 | ecore_event_handler_add(ECORE_PSL1GHT_EVENT_KEY_MODIFIERS, | ||
197 | _ecore_evas_psl1ght_event_key_modifiers, NULL); | ||
198 | ecore_evas_event_handlers[4] = | ||
199 | ecore_event_handler_add(ECORE_PSL1GHT_EVENT_QUIT, | ||
200 | _ecore_evas_psl1ght_event_quit, NULL); | ||
177 | 201 | ||
178 | return _ecore_evas_init_count; | 202 | return _ecore_evas_init_count; |
179 | } | 203 | } |
@@ -209,6 +233,12 @@ _ecore_evas_psl1ght_free(Ecore_Evas *ee) | |||
209 | } | 233 | } |
210 | 234 | ||
211 | static void | 235 | static void |
236 | _ecore_evas_psl1ght_callback_delete_request_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee)) | ||
237 | { | ||
238 | ee->func.fn_delete_request = func; | ||
239 | } | ||
240 | |||
241 | static void | ||
212 | _ecore_evas_screen_resized(Ecore_Evas *ee) | 242 | _ecore_evas_screen_resized(Ecore_Evas *ee) |
213 | { | 243 | { |
214 | int w, h; | 244 | int w, h; |
@@ -324,7 +354,7 @@ static Ecore_Evas_Engine_Func _ecore_psl1ght_engine_func = | |||
324 | NULL, | 354 | NULL, |
325 | NULL, | 355 | NULL, |
326 | NULL, | 356 | NULL, |
327 | NULL, | 357 | _ecore_evas_psl1ght_callback_delete_request_set, |
328 | NULL, | 358 | NULL, |
329 | NULL, | 359 | NULL, |
330 | NULL, | 360 | NULL, |