diff options
Diffstat (limited to 'libraries/ecore/src/lib/ecore_evas/ecore_evas_private.h')
-rw-r--r-- | libraries/ecore/src/lib/ecore_evas/ecore_evas_private.h | 433 |
1 files changed, 433 insertions, 0 deletions
diff --git a/libraries/ecore/src/lib/ecore_evas/ecore_evas_private.h b/libraries/ecore/src/lib/ecore_evas/ecore_evas_private.h new file mode 100644 index 0000000..2c20761 --- /dev/null +++ b/libraries/ecore/src/lib/ecore_evas/ecore_evas_private.h | |||
@@ -0,0 +1,433 @@ | |||
1 | #ifndef _ECORE_EVAS_PRIVATE_H | ||
2 | #define _ECORE_EVAS_PRIVATE_H | ||
3 | |||
4 | #ifdef HAVE_CONFIG_H | ||
5 | # include <config.h> | ||
6 | #endif | ||
7 | |||
8 | #include <sys/types.h> | ||
9 | #include <sys/stat.h> | ||
10 | #include <fcntl.h> | ||
11 | |||
12 | #ifdef HAVE_SYS_MMAN_H | ||
13 | # include <sys/mman.h> | ||
14 | #endif | ||
15 | |||
16 | #include <Evas.h> | ||
17 | #include <Ecore.h> | ||
18 | #include <ecore_private.h> | ||
19 | #include <Ecore_Input.h> | ||
20 | #include <Ecore_Input_Evas.h> | ||
21 | |||
22 | #define ECORE_MAGIC_EVAS 0x76543211 | ||
23 | |||
24 | #ifdef BUILD_ECORE_EVAS_X11 | ||
25 | # include <Ecore_X.h> | ||
26 | # include <Ecore_X_Atoms.h> | ||
27 | # ifdef HAVE_ECORE_X_XCB | ||
28 | # include <xcb/xcb.h> | ||
29 | # endif | ||
30 | # ifdef HAVE_ECORE_X_XLIB | ||
31 | # include <X11/Xlib.h> | ||
32 | # include <X11/Xutil.h> | ||
33 | # endif | ||
34 | #endif | ||
35 | |||
36 | #ifdef BUILD_ECORE_EVAS_SOFTWARE_X11 | ||
37 | # include <Evas_Engine_Software_X11.h> | ||
38 | #endif | ||
39 | |||
40 | #ifdef BUILD_ECORE_EVAS_OPENGL_X11 | ||
41 | # include <Evas_Engine_GL_X11.h> | ||
42 | #endif | ||
43 | |||
44 | #ifdef BUILD_ECORE_EVAS_SOFTWARE_8_X11 | ||
45 | # include <Evas_Engine_Software_8_X11.h> | ||
46 | #endif | ||
47 | |||
48 | #ifdef BUILD_ECORE_EVAS_SOFTWARE_16_X11 | ||
49 | # include <Evas_Engine_Software_16_X11.h> | ||
50 | #endif | ||
51 | |||
52 | #ifdef BUILD_ECORE_EVAS_FB | ||
53 | # include <Evas_Engine_FB.h> | ||
54 | #endif | ||
55 | |||
56 | #ifdef BUILD_ECORE_EVAS_DIRECTFB | ||
57 | # include <Evas_Engine_DirectFB.h> | ||
58 | # include "Ecore_DirectFB.h" | ||
59 | #endif | ||
60 | |||
61 | #if defined(BUILD_ECORE_EVAS_SOFTWARE_BUFFER) || defined(BUILD_ECORE_EVAS_EWS) | ||
62 | # include <Evas_Engine_Buffer.h> | ||
63 | #endif | ||
64 | |||
65 | #ifdef BUILD_ECORE_EVAS_WIN32 | ||
66 | # include "Ecore_Win32.h" | ||
67 | # ifdef BUILD_ECORE_EVAS_SOFTWARE_GDI | ||
68 | # include <Evas_Engine_Software_Gdi.h> | ||
69 | # endif | ||
70 | # ifdef BUILD_ECORE_EVAS_SOFTWARE_DDRAW | ||
71 | # include <Evas_Engine_Software_DDraw.h> | ||
72 | # endif | ||
73 | # ifdef BUILD_ECORE_EVAS_DIRECT3D | ||
74 | # include <Evas_Engine_Direct3D.h> | ||
75 | # endif | ||
76 | # ifdef BUILD_ECORE_EVAS_OPENGL_GLEW | ||
77 | # include <Evas_Engine_GL_Glew.h> | ||
78 | # endif | ||
79 | # ifdef BUILD_ECORE_EVAS_SOFTWARE_16_DDRAW | ||
80 | # include <Evas_Engine_Software_16_DDraw.h> | ||
81 | # endif | ||
82 | #endif | ||
83 | |||
84 | #ifdef BUILD_ECORE_EVAS_SOFTWARE_16_WINCE | ||
85 | # include "Ecore_WinCE.h" | ||
86 | # include <Evas_Engine_Software_16_WinCE.h> | ||
87 | #endif | ||
88 | |||
89 | #ifdef BUILD_ECORE_EVAS_GL_COCOA | ||
90 | # include "Ecore_Cocoa.h" | ||
91 | # include <Evas_Engine_Gl_Cocoa.h> | ||
92 | #endif | ||
93 | |||
94 | /** | ||
95 | Log domain macros and variable | ||
96 | **/ | ||
97 | |||
98 | extern int _ecore_evas_log_dom; | ||
99 | |||
100 | #ifdef ECORE_EVAS_DEFAULT_LOG_COLOR | ||
101 | # undef ECORE_EVAS_DEFAULT_LOG_COLOR | ||
102 | #endif | ||
103 | #define ECORE_EVAS_DEFAULT_LOG_COLOR EINA_COLOR_BLUE | ||
104 | |||
105 | #ifdef ERR | ||
106 | # undef ERR | ||
107 | #endif | ||
108 | #define ERR(...) EINA_LOG_DOM_ERR(_ecore_evas_log_dom, __VA_ARGS__) | ||
109 | #ifdef DBG | ||
110 | # undef DBG | ||
111 | #endif | ||
112 | #define DBG(...) EINA_LOG_DOM_DBG(_ecore_evas_log_dom, __VA_ARGS__) | ||
113 | #ifdef INF | ||
114 | # undef INF | ||
115 | #endif | ||
116 | #define INF(...) EINA_LOG_DOM_INFO(_ecore_evas_log_dom, __VA_ARGS__) | ||
117 | #ifdef WRN | ||
118 | # undef WRN | ||
119 | #endif | ||
120 | #define WRN(...) EINA_LOG_DOM_WARN(_ecore_evas_log_dom, __VA_ARGS__) | ||
121 | #ifdef CRIT | ||
122 | # undef CRIT | ||
123 | #endif | ||
124 | #define CRIT(...) EINA_LOG_DOM_CRIT(_ecore_evas_log_dom, __VA_ARGS__) | ||
125 | |||
126 | |||
127 | #define IDLE_FLUSH_TIME 0.5 | ||
128 | #ifndef _ECORE_EVAS_H | ||
129 | typedef struct _Ecore_Evas Ecore_Evas; | ||
130 | #endif | ||
131 | |||
132 | typedef struct _Ecore_Evas_Engine Ecore_Evas_Engine; | ||
133 | typedef struct _Ecore_Evas_Engine_Func Ecore_Evas_Engine_Func; | ||
134 | |||
135 | struct _Ecore_Evas_Engine_Func | ||
136 | { | ||
137 | void (*fn_free) (Ecore_Evas *ee); | ||
138 | void (*fn_callback_resize_set) (Ecore_Evas *ee, void (*func) (Ecore_Evas *ee)); | ||
139 | void (*fn_callback_move_set) (Ecore_Evas *ee, void (*func) (Ecore_Evas *ee)); | ||
140 | void (*fn_callback_show_set) (Ecore_Evas *ee, void (*func) (Ecore_Evas *ee)); | ||
141 | void (*fn_callback_hide_set) (Ecore_Evas *ee, void (*func) (Ecore_Evas *ee)); | ||
142 | void (*fn_callback_delete_request_set) (Ecore_Evas *ee, void (*func) (Ecore_Evas *ee)); | ||
143 | void (*fn_callback_destroy_set) (Ecore_Evas *ee, void (*func) (Ecore_Evas *ee)); | ||
144 | void (*fn_callback_focus_in_set) (Ecore_Evas *ee, void (*func) (Ecore_Evas *ee)); | ||
145 | void (*fn_callback_focus_out_set) (Ecore_Evas *ee, void (*func) (Ecore_Evas *ee)); | ||
146 | void (*fn_callback_mouse_in_set) (Ecore_Evas *ee, void (*func) (Ecore_Evas *ee)); | ||
147 | void (*fn_callback_mouse_out_set) (Ecore_Evas *ee, void (*func) (Ecore_Evas *ee)); | ||
148 | void (*fn_callback_sticky_set) (Ecore_Evas *ee, void (*func) (Ecore_Evas *ee)); | ||
149 | void (*fn_callback_unsticky_set) (Ecore_Evas *ee, void (*func) (Ecore_Evas *ee)); | ||
150 | void (*fn_callback_pre_render_set) (Ecore_Evas *ee, void (*func) (Ecore_Evas *ee)); | ||
151 | void (*fn_callback_post_render_set) (Ecore_Evas *ee, void (*func) (Ecore_Evas *ee)); | ||
152 | void (*fn_move) (Ecore_Evas *ee, int x, int y); | ||
153 | void (*fn_managed_move) (Ecore_Evas *ee, int x, int y); | ||
154 | void (*fn_resize) (Ecore_Evas *ee, int w, int h); | ||
155 | void (*fn_move_resize) (Ecore_Evas *ee, int x, int y, int w, int h); | ||
156 | void (*fn_rotation_set) (Ecore_Evas *ee, int rot, int resize); | ||
157 | void (*fn_shaped_set) (Ecore_Evas *ee, int shaped); | ||
158 | void (*fn_show) (Ecore_Evas *ee); | ||
159 | void (*fn_hide) (Ecore_Evas *ee); | ||
160 | void (*fn_raise) (Ecore_Evas *ee); | ||
161 | void (*fn_lower) (Ecore_Evas *ee); | ||
162 | void (*fn_activate) (Ecore_Evas *ee); | ||
163 | void (*fn_title_set) (Ecore_Evas *ee, const char *t); | ||
164 | void (*fn_name_class_set) (Ecore_Evas *ee, const char *n, const char *c); | ||
165 | void (*fn_size_min_set) (Ecore_Evas *ee, int w, int h); | ||
166 | void (*fn_size_max_set) (Ecore_Evas *ee, int w, int h); | ||
167 | void (*fn_size_base_set) (Ecore_Evas *ee, int w, int h); | ||
168 | void (*fn_size_step_set) (Ecore_Evas *ee, int w, int h); | ||
169 | void (*fn_object_cursor_set) (Ecore_Evas *ee, Evas_Object *obj, int layer, int hot_x, int hot_y); | ||
170 | void (*fn_layer_set) (Ecore_Evas *ee, int layer); | ||
171 | void (*fn_focus_set) (Ecore_Evas *ee, int on); | ||
172 | void (*fn_iconified_set) (Ecore_Evas *ee, int on); | ||
173 | void (*fn_borderless_set) (Ecore_Evas *ee, int on); | ||
174 | void (*fn_override_set) (Ecore_Evas *ee, int on); | ||
175 | void (*fn_maximized_set) (Ecore_Evas *ee, int on); | ||
176 | void (*fn_fullscreen_set) (Ecore_Evas *ee, int on); | ||
177 | void (*fn_avoid_damage_set) (Ecore_Evas *ee, int on); | ||
178 | void (*fn_withdrawn_set) (Ecore_Evas *ee, int withdrawn); | ||
179 | void (*fn_sticky_set) (Ecore_Evas *ee, int sticky); | ||
180 | void (*fn_ignore_events_set) (Ecore_Evas *ee, int ignore); | ||
181 | void (*fn_alpha_set) (Ecore_Evas *ee, int alpha); | ||
182 | void (*fn_transparent_set) (Ecore_Evas *ee, int transparent); | ||
183 | |||
184 | int (*fn_render) (Ecore_Evas *ee); | ||
185 | void (*fn_screen_geometry_get) (const Ecore_Evas *ee, int *x, int *y, int *w, int *h); | ||
186 | }; | ||
187 | |||
188 | struct _Ecore_Evas_Engine | ||
189 | { | ||
190 | Ecore_Evas_Engine_Func *func; | ||
191 | |||
192 | /* TODO: UGLY! This should be an union or inheritance! */ | ||
193 | #ifdef BUILD_ECORE_EVAS_X11 | ||
194 | struct | ||
195 | { | ||
196 | Ecore_X_Window win_root; | ||
197 | Eina_List *win_extra; | ||
198 | Ecore_X_Pixmap pmap; | ||
199 | Ecore_X_Pixmap mask; | ||
200 | Ecore_X_GC gc; | ||
201 | Ecore_X_XRegion *damages; | ||
202 | Ecore_X_Sync_Counter sync_counter; | ||
203 | Ecore_X_Window leader; | ||
204 | Ecore_X_Sync_Counter netwm_sync_counter; | ||
205 | int netwm_sync_val_hi; | ||
206 | unsigned int netwm_sync_val_lo; | ||
207 | int sync_val; // bigger! this will screw up at 2 billion frames (414 days of continual rendering @ 60fps) | ||
208 | int screen_num; | ||
209 | int px, py, pw, ph; | ||
210 | unsigned char direct_resize : 1; | ||
211 | unsigned char using_bg_pixmap : 1; | ||
212 | unsigned char managed : 1; | ||
213 | unsigned char sync_began : 1; | ||
214 | unsigned char sync_cancel : 1; | ||
215 | unsigned char netwm_sync_set : 1; | ||
216 | unsigned char configure_coming : 1; | ||
217 | struct { | ||
218 | unsigned char modal : 1; | ||
219 | unsigned char sticky : 1; | ||
220 | unsigned char maximized_v : 1; | ||
221 | unsigned char maximized_h : 1; | ||
222 | unsigned char shaded : 1; | ||
223 | unsigned char skip_taskbar : 1; | ||
224 | unsigned char skip_pager : 1; | ||
225 | unsigned char fullscreen : 1; | ||
226 | unsigned char above : 1; | ||
227 | unsigned char below : 1; | ||
228 | } state; | ||
229 | Ecore_X_Window win_shaped_input; | ||
230 | } x; | ||
231 | #endif | ||
232 | #ifdef BUILD_ECORE_EVAS_FB | ||
233 | struct { | ||
234 | int real_w; | ||
235 | int real_h; | ||
236 | } fb; | ||
237 | #endif | ||
238 | #ifdef BUILD_ECORE_EVAS_SOFTWARE_BUFFER | ||
239 | struct { | ||
240 | void *pixels; | ||
241 | Evas_Object *image; | ||
242 | void (*free_func) (void *data, void *pix); | ||
243 | void *(*alloc_func) (void *data, int size); | ||
244 | void *data; | ||
245 | } buffer; | ||
246 | #endif | ||
247 | #ifdef BUILD_ECORE_EVAS_DIRECTFB | ||
248 | struct { | ||
249 | Ecore_DirectFB_Window *window; | ||
250 | } directfb; | ||
251 | #endif | ||
252 | #ifdef BUILD_ECORE_EVAS_WIN32 | ||
253 | struct { | ||
254 | Ecore_Win32_Window *parent; | ||
255 | struct { | ||
256 | unsigned char region : 1; | ||
257 | unsigned char fullscreen : 1; | ||
258 | } state; | ||
259 | } win32; | ||
260 | #endif | ||
261 | #ifdef BUILD_ECORE_EVAS_SOFTWARE_16_WINCE | ||
262 | struct { | ||
263 | Ecore_WinCE_Window *window; | ||
264 | struct { | ||
265 | unsigned char fullscreen : 1; | ||
266 | } state; | ||
267 | } wince; | ||
268 | #endif | ||
269 | #ifdef BUILD_ECORE_EVAS_EWS | ||
270 | struct { | ||
271 | Evas_Object *image; | ||
272 | } ews; | ||
273 | #endif | ||
274 | |||
275 | Ecore_Timer *idle_flush_timer; | ||
276 | }; | ||
277 | |||
278 | struct _Ecore_Evas | ||
279 | { | ||
280 | EINA_INLIST; | ||
281 | ECORE_MAGIC; | ||
282 | Evas *evas; | ||
283 | const char *driver; | ||
284 | char *name; | ||
285 | int x, y, w, h; | ||
286 | short rotation; | ||
287 | Eina_Bool shaped : 1; | ||
288 | Eina_Bool visible : 1; | ||
289 | Eina_Bool draw_ok : 1; | ||
290 | Eina_Bool should_be_visible : 1; | ||
291 | Eina_Bool alpha : 1; | ||
292 | Eina_Bool transparent : 1; | ||
293 | |||
294 | Eina_Hash *data; | ||
295 | |||
296 | struct { | ||
297 | int x, y, w, h; | ||
298 | } req; | ||
299 | |||
300 | struct { | ||
301 | int x, y; | ||
302 | } mouse; | ||
303 | |||
304 | struct { | ||
305 | int w, h; | ||
306 | } expecting_resize; | ||
307 | |||
308 | struct { | ||
309 | char *title; | ||
310 | char *name; | ||
311 | char *clas; | ||
312 | struct { | ||
313 | int w, h; | ||
314 | } min, | ||
315 | max, | ||
316 | base, | ||
317 | step; | ||
318 | struct { | ||
319 | Evas_Object *object; | ||
320 | int layer; | ||
321 | struct { | ||
322 | int x, y; | ||
323 | } hot; | ||
324 | } cursor; | ||
325 | int layer; | ||
326 | Ecore_Window window; | ||
327 | unsigned char avoid_damage; | ||
328 | char focused : 1; | ||
329 | char iconified : 1; | ||
330 | char borderless : 1; | ||
331 | char override : 1; | ||
332 | char maximized : 1; | ||
333 | char fullscreen : 1; | ||
334 | char withdrawn : 1; | ||
335 | char sticky : 1; | ||
336 | char request_pos : 1; | ||
337 | } prop; | ||
338 | |||
339 | struct { | ||
340 | void (*fn_resize) (Ecore_Evas *ee); | ||
341 | void (*fn_move) (Ecore_Evas *ee); | ||
342 | void (*fn_show) (Ecore_Evas *ee); | ||
343 | void (*fn_hide) (Ecore_Evas *ee); | ||
344 | void (*fn_delete_request) (Ecore_Evas *ee); | ||
345 | void (*fn_destroy) (Ecore_Evas *ee); | ||
346 | void (*fn_focus_in) (Ecore_Evas *ee); | ||
347 | void (*fn_focus_out) (Ecore_Evas *ee); | ||
348 | void (*fn_sticky) (Ecore_Evas *ee); | ||
349 | void (*fn_unsticky) (Ecore_Evas *ee); | ||
350 | void (*fn_mouse_in) (Ecore_Evas *ee); | ||
351 | void (*fn_mouse_out) (Ecore_Evas *ee); | ||
352 | void (*fn_pre_render) (Ecore_Evas *ee); | ||
353 | void (*fn_post_render) (Ecore_Evas *ee); | ||
354 | void (*fn_pre_free) (Ecore_Evas *ee); | ||
355 | } func; | ||
356 | |||
357 | Ecore_Evas_Engine engine; | ||
358 | Eina_List *sub_ecore_evas; | ||
359 | |||
360 | int refcount; | ||
361 | |||
362 | unsigned char ignore_events : 1; | ||
363 | unsigned char manual_render : 1; | ||
364 | unsigned char registered : 1; | ||
365 | unsigned char no_comp_sync : 1; | ||
366 | unsigned char semi_sync : 1; | ||
367 | unsigned char deleted : 1; | ||
368 | }; | ||
369 | |||
370 | void _ecore_evas_ref(Ecore_Evas *ee); | ||
371 | void _ecore_evas_unref(Ecore_Evas *ee); | ||
372 | |||
373 | #ifdef BUILD_ECORE_EVAS_X11 | ||
374 | int _ecore_evas_x_shutdown(void); | ||
375 | #endif | ||
376 | #ifdef BUILD_ECORE_EVAS_FB | ||
377 | int _ecore_evas_fb_shutdown(void); | ||
378 | #endif | ||
379 | #ifdef BUILD_ECORE_EVAS_SOFTWARE_BUFFER | ||
380 | int _ecore_evas_buffer_shutdown(void); | ||
381 | int _ecore_evas_buffer_render(Ecore_Evas *ee); | ||
382 | #endif | ||
383 | #ifdef BUILD_ECORE_EVAS_DIRECTFB | ||
384 | int _ecore_evas_directfb_shutdown(void); | ||
385 | #endif | ||
386 | #ifdef BUILD_ECORE_EVAS_WIN32 | ||
387 | int _ecore_evas_win32_shutdown(void); | ||
388 | #endif | ||
389 | #ifdef BUILD_ECORE_EVAS_SOFTWARE_16_WINCE | ||
390 | int _ecore_evas_wince_shutdown(void); | ||
391 | #endif | ||
392 | #ifdef BUILD_ECORE_EVAS_EWS | ||
393 | void _ecore_evas_ews_events_init(void); | ||
394 | int _ecore_evas_ews_shutdown(void); | ||
395 | #endif | ||
396 | |||
397 | void _ecore_evas_fps_debug_init(void); | ||
398 | void _ecore_evas_fps_debug_shutdown(void); | ||
399 | void _ecore_evas_fps_debug_rendertime_add(double t); | ||
400 | void _ecore_evas_register(Ecore_Evas *ee); | ||
401 | void _ecore_evas_free(Ecore_Evas *ee); | ||
402 | void _ecore_evas_idle_timeout_update(Ecore_Evas *ee); | ||
403 | void _ecore_evas_mouse_move_process(Ecore_Evas *ee, int x, int y, unsigned int timestamp); | ||
404 | void _ecore_evas_mouse_multi_move_process(Ecore_Evas *ee, int device, | ||
405 | int x, int y, | ||
406 | double radius, | ||
407 | double radius_x, double radius_y, | ||
408 | double pressure, | ||
409 | double angle, | ||
410 | double mx, double my, | ||
411 | unsigned int timestamp); | ||
412 | void _ecore_evas_mouse_multi_down_process(Ecore_Evas *ee, int device, | ||
413 | int x, int y, | ||
414 | double radius, | ||
415 | double radius_x, double radius_y, | ||
416 | double pressure, | ||
417 | double angle, | ||
418 | double mx, double my, | ||
419 | Evas_Button_Flags flags, | ||
420 | unsigned int timestamp); | ||
421 | void _ecore_evas_mouse_multi_up_process(Ecore_Evas *ee, int device, | ||
422 | int x, int y, | ||
423 | double radius, | ||
424 | double radius_x, double radius_y, | ||
425 | double pressure, | ||
426 | double angle, | ||
427 | double mx, double my, | ||
428 | Evas_Button_Flags flags, | ||
429 | unsigned int timestamp); | ||
430 | |||
431 | extern Eina_Bool _ecore_evas_app_comp_sync; | ||
432 | |||
433 | #endif | ||