summaryrefslogtreecommitdiff
path: root/legacy/ecore/src/lib/ecore_evas/ecore_evas_wince.c
diff options
context:
space:
mode:
authorCarsten Haitzler <raster@rasterman.com>2010-01-07 05:29:06 +0000
committerCarsten Haitzler <raster@rasterman.com>2010-01-07 05:29:06 +0000
commit30939bf353e8065ba9454eaa9f89d73311e2725f (patch)
tree7dd0d9a3d2d5767ad93d4c046618828a8cbd71ff /legacy/ecore/src/lib/ecore_evas/ecore_evas_wince.c
parent288b812d442ace412d7d4fbd44774eac35ea5e34 (diff)
clean up engines - put idle entere handlign in core. same with lists. quyartz
looks broken to me. sdl looks like it could be much more complete - like multiple sdl windows/instances. anyway - allow rendering to be manual. SVN revision: 44938
Diffstat (limited to '')
-rw-r--r--legacy/ecore/src/lib/ecore_evas/ecore_evas_wince.c53
1 files changed, 11 insertions, 42 deletions
diff --git a/legacy/ecore/src/lib/ecore_evas/ecore_evas_wince.c b/legacy/ecore/src/lib/ecore_evas/ecore_evas_wince.c
index 0245e1d391..7e558f5609 100644
--- a/legacy/ecore/src/lib/ecore_evas/ecore_evas_wince.c
+++ b/legacy/ecore/src/lib/ecore_evas/ecore_evas_wince.c
@@ -26,11 +26,8 @@
26#define ECORE_EVAS_EVENT_COUNT 7 26#define ECORE_EVAS_EVENT_COUNT 7
27 27
28static int _ecore_evas_init_count = 0; 28static int _ecore_evas_init_count = 0;
29static int _ecore_evas_fps_debug = 0;
30 29
31static Ecore_Event_Handler *ecore_evas_event_handlers[ECORE_EVAS_EVENT_COUNT]; 30static Ecore_Event_Handler *ecore_evas_event_handlers[ECORE_EVAS_EVENT_COUNT];
32static Ecore_Idle_Enterer *ecore_evas_idle_enterer = NULL;
33static Ecore_Evas *ecore_evases = NULL;
34 31
35static int _ecore_evas_wince_event_mouse_in(void *data __UNUSED__, int type __UNUSED__, void *event); 32static int _ecore_evas_wince_event_mouse_in(void *data __UNUSED__, int type __UNUSED__, void *event);
36 33
@@ -48,9 +45,10 @@ static int _ecore_evas_wince_event_window_delete_request(void *data __UNUSED__,
48 45
49/* Private functions */ 46/* Private functions */
50 47
51static void 48static int
52_ecore_evas_wince_render(Ecore_Evas *ee) 49_ecore_evas_wince_render(Ecore_Evas *ee)
53{ 50{
51 int rend = 0;
54 Eina_List *updates = NULL; 52 Eina_List *updates = NULL;
55#ifdef BUILD_ECORE_EVAS_SOFTWARE_BUFFER 53#ifdef BUILD_ECORE_EVAS_SOFTWARE_BUFFER
56 Eina_List *ll; 54 Eina_List *ll;
@@ -86,30 +84,9 @@ _ecore_evas_wince_render(Ecore_Evas *ee)
86 } 84 }
87 else 85 else
88 evas_norender(ee->evas); 86 evas_norender(ee->evas);
87 if (updates) rend = 1;
89 if (ee->func.fn_post_render) ee->func.fn_post_render(ee); 88 if (ee->func.fn_post_render) ee->func.fn_post_render(ee);
90} 89 return rend;
91
92static int
93_ecore_evas_wince_idle_enter(void *data __UNUSED__)
94{
95 Ecore_Evas *ee;
96 double t1 = 0.0;
97 double t2 = 0.0;
98
99 if (!ecore_evases) return 1;
100 if (_ecore_evas_fps_debug)
101 {
102 t1 = ecore_time_get();
103 }
104 EINA_INLIST_FOREACH(ecore_evases, ee)
105 _ecore_evas_wince_render(ee);
106
107 if (_ecore_evas_fps_debug)
108 {
109 t2 = ecore_time_get();
110 _ecore_evas_fps_debug_rendertime_add(t2 - t1);
111 }
112 return 1;
113} 90}
114 91
115static int 92static int
@@ -118,12 +95,7 @@ _ecore_evas_wince_init(void)
118 _ecore_evas_init_count++; 95 _ecore_evas_init_count++;
119 if (_ecore_evas_init_count > 1) 96 if (_ecore_evas_init_count > 1)
120 return _ecore_evas_init_count; 97 return _ecore_evas_init_count;
121 98
122 if (getenv("ECORE_EVAS_FPS_DEBUG"))
123 _ecore_evas_fps_debug = 1;
124
125 ecore_evas_idle_enterer = ecore_idle_enterer_add(_ecore_evas_wince_idle_enter, NULL);
126
127 ecore_evas_event_handlers[0] = ecore_event_handler_add(ECORE_WINCE_EVENT_MOUSE_IN, _ecore_evas_wince_event_mouse_in, NULL); 99 ecore_evas_event_handlers[0] = ecore_event_handler_add(ECORE_WINCE_EVENT_MOUSE_IN, _ecore_evas_wince_event_mouse_in, NULL);
128 ecore_evas_event_handlers[1] = ecore_event_handler_add(ECORE_WINCE_EVENT_MOUSE_OUT, _ecore_evas_wince_event_mouse_out, NULL); 100 ecore_evas_event_handlers[1] = ecore_event_handler_add(ECORE_WINCE_EVENT_MOUSE_OUT, _ecore_evas_wince_event_mouse_out, NULL);
129 ecore_evas_event_handlers[2] = ecore_event_handler_add(ECORE_WINCE_EVENT_WINDOW_DAMAGE, _ecore_evas_wince_event_window_damage, NULL); 101 ecore_evas_event_handlers[2] = ecore_event_handler_add(ECORE_WINCE_EVENT_WINDOW_DAMAGE, _ecore_evas_wince_event_window_damage, NULL);
@@ -132,8 +104,6 @@ _ecore_evas_wince_init(void)
132 ecore_evas_event_handlers[5] = ecore_event_handler_add(ECORE_WINCE_EVENT_WINDOW_HIDE, _ecore_evas_wince_event_window_hide, NULL); 104 ecore_evas_event_handlers[5] = ecore_event_handler_add(ECORE_WINCE_EVENT_WINDOW_HIDE, _ecore_evas_wince_event_window_hide, NULL);
133 ecore_evas_event_handlers[6] = ecore_event_handler_add(ECORE_WINCE_EVENT_WINDOW_DELETE_REQUEST, _ecore_evas_wince_event_window_delete_request, NULL); 105 ecore_evas_event_handlers[6] = ecore_event_handler_add(ECORE_WINCE_EVENT_WINDOW_DELETE_REQUEST, _ecore_evas_wince_event_window_delete_request, NULL);
134 106
135 if (_ecore_evas_fps_debug) _ecore_evas_fps_debug_init();
136
137 ecore_event_evas_init(); 107 ecore_event_evas_init();
138 return _ecore_evas_init_count; 108 return _ecore_evas_init_count;
139} 109}
@@ -146,12 +116,8 @@ _ecore_evas_wince_shutdown(void)
146 { 116 {
147 int i; 117 int i;
148 118
149 while (ecore_evases) _ecore_evas_free(ecore_evases);
150 for (i = 0; i < ECORE_EVAS_EVENT_COUNT; i++) 119 for (i = 0; i < ECORE_EVAS_EVENT_COUNT; i++)
151 ecore_event_handler_del(ecore_evas_event_handlers[i]); 120 ecore_event_handler_del(ecore_evas_event_handlers[i]);
152 ecore_idle_enterer_del(ecore_evas_idle_enterer);
153 ecore_evas_idle_enterer = NULL;
154 if (_ecore_evas_fps_debug) _ecore_evas_fps_debug_shutdown();
155 ecore_event_evas_shutdown(); 121 ecore_event_evas_shutdown();
156 } 122 }
157 123
@@ -708,7 +674,7 @@ _ecore_evas_wince_fullscreen_set(Ecore_Evas *ee, int on)
708 } 674 }
709} 675}
710 676
711static const Ecore_Evas_Engine_Func _ecore_wince_engine_func = 677static Ecore_Evas_Engine_Func _ecore_wince_engine_func =
712{ 678{
713 _ecore_evas_wince_free, 679 _ecore_evas_wince_free,
714 NULL, 680 NULL,
@@ -754,7 +720,9 @@ static const Ecore_Evas_Engine_Func _ecore_wince_engine_func =
754 NULL, /* _ecore_evas_x_withdrawn_set */ 720 NULL, /* _ecore_evas_x_withdrawn_set */
755 NULL, /* _ecore_evas_x_sticky_set */ 721 NULL, /* _ecore_evas_x_sticky_set */
756 NULL, /* _ecore_evas_x_ignore_events_set */ 722 NULL, /* _ecore_evas_x_ignore_events_set */
757 NULL /* _ecore_evas_x_alpha_set */ 723 NULL, /* _ecore_evas_x_alpha_set */
724
725 NULL // render
758}; 726};
759 727
760/* API */ 728/* API */
@@ -848,7 +816,8 @@ ecore_evas_software_wince_new_internal(int backend,
848 ecore_wince_window_resume_set((Ecore_WinCE_Window *)ee->prop.window, einfo->func.resume); 816 ecore_wince_window_resume_set((Ecore_WinCE_Window *)ee->prop.window, einfo->func.resume);
849 } 817 }
850 818
851 ecore_evases = (Ecore_Evas *) eina_inlist_prepend(EINA_INLIST_GET(ecore_evases), EINA_INLIST_GET(ee)); 819 ee->engine.func->fn_render = _ecore_evas_wince_render;
820 _ecore_evas_register(ee);
852 ecore_event_window_register(ee->prop.window, ee, ee->evas, (Ecore_Event_Mouse_Move_Cb)_ecore_evas_mouse_move_process); 821 ecore_event_window_register(ee->prop.window, ee, ee->evas, (Ecore_Event_Mouse_Move_Cb)_ecore_evas_mouse_move_process);
853 822
854 return ee; 823 return ee;