1 #ifndef _ECORE_EVAS_PRIVATE_H
2 #define _ECORE_EVAS_PRIVATE_H
12 #ifdef HAVE_SYS_MMAN_H
13 # include <sys/mman.h>
18 #include <ecore_private.h>
19 #include <Ecore_Input.h>
20 #include <Ecore_Input_Evas.h>
22 #define ECORE_MAGIC_EVAS 0x76543211
24 #ifdef BUILD_ECORE_EVAS_X11
26 # include <Ecore_X_Atoms.h>
27 # ifdef HAVE_ECORE_X_XCB
30 # ifdef HAVE_ECORE_X_XLIB
31 # include <X11/Xlib.h>
32 # include <X11/Xutil.h>
36 #ifdef BUILD_ECORE_EVAS_SOFTWARE_X11
37 # include <Evas_Engine_Software_X11.h>
40 #ifdef BUILD_ECORE_EVAS_OPENGL_X11
41 # include <Evas_Engine_GL_X11.h>
44 #ifdef BUILD_ECORE_EVAS_SOFTWARE_8_X11
45 # include <Evas_Engine_Software_8_X11.h>
48 #ifdef BUILD_ECORE_EVAS_SOFTWARE_16_X11
49 # include <Evas_Engine_Software_16_X11.h>
52 #ifdef BUILD_ECORE_EVAS_FB
53 # include <Evas_Engine_FB.h>
56 #ifdef BUILD_ECORE_EVAS_DIRECTFB
57 # include <Evas_Engine_DirectFB.h>
58 # include "Ecore_DirectFB.h"
61 #if defined(BUILD_ECORE_EVAS_SOFTWARE_BUFFER) || defined(BUILD_ECORE_EVAS_EWS)
62 # include <Evas_Engine_Buffer.h>
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>
70 # ifdef BUILD_ECORE_EVAS_SOFTWARE_DDRAW
71 # include <Evas_Engine_Software_DDraw.h>
73 # ifdef BUILD_ECORE_EVAS_DIRECT3D
74 # include <Evas_Engine_Direct3D.h>
76 # ifdef BUILD_ECORE_EVAS_OPENGL_GLEW
77 # include <Evas_Engine_GL_Glew.h>
79 # ifdef BUILD_ECORE_EVAS_SOFTWARE_16_DDRAW
80 # include <Evas_Engine_Software_16_DDraw.h>
84 #ifdef BUILD_ECORE_EVAS_SOFTWARE_16_WINCE
85 # include "Ecore_WinCE.h"
86 # include <Evas_Engine_Software_16_WinCE.h>
89 #ifdef BUILD_ECORE_EVAS_GL_COCOA
90 # include "Ecore_Cocoa.h"
91 # include <Evas_Engine_Gl_Cocoa.h>
95 Log domain macros and variable
98 extern int _ecore_evas_log_dom;
100 #ifdef ECORE_EVAS_DEFAULT_LOG_COLOR
101 # undef ECORE_EVAS_DEFAULT_LOG_COLOR
103 #define ECORE_EVAS_DEFAULT_LOG_COLOR EINA_COLOR_BLUE
108 #define ERR(...) EINA_LOG_DOM_ERR(_ecore_evas_log_dom, __VA_ARGS__)
112 #define DBG(...) EINA_LOG_DOM_DBG(_ecore_evas_log_dom, __VA_ARGS__)
116 #define INF(...) EINA_LOG_DOM_INFO(_ecore_evas_log_dom, __VA_ARGS__)
120 #define WRN(...) EINA_LOG_DOM_WARN(_ecore_evas_log_dom, __VA_ARGS__)
124 #define CRIT(...) EINA_LOG_DOM_CRIT(_ecore_evas_log_dom, __VA_ARGS__)
127 #define IDLE_FLUSH_TIME 0.5
128 #ifndef _ECORE_EVAS_H
129 typedef struct _Ecore_Evas Ecore_Evas;
132 typedef struct _Ecore_Evas_Engine Ecore_Evas_Engine;
133 typedef struct _Ecore_Evas_Engine_Func Ecore_Evas_Engine_Func;
135 struct _Ecore_Evas_Engine_Func
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);
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);
188 struct _Ecore_Evas_Engine
190 Ecore_Evas_Engine_Func *func;
192 /* TODO: UGLY! This should be an union or inheritance! */
193 #ifdef BUILD_ECORE_EVAS_X11
196 Ecore_X_Window win_root;
197 Eina_List *win_extra;
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)
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;
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;
229 Ecore_X_Window win_shaped_input;
232 #ifdef BUILD_ECORE_EVAS_FB
238 #ifdef BUILD_ECORE_EVAS_SOFTWARE_BUFFER
242 void (*free_func) (void *data, void *pix);
243 void *(*alloc_func) (void *data, int size);
247 #ifdef BUILD_ECORE_EVAS_DIRECTFB
249 Ecore_DirectFB_Window *window;
252 #ifdef BUILD_ECORE_EVAS_WIN32
254 Ecore_Win32_Window *parent;
256 unsigned char region : 1;
257 unsigned char fullscreen : 1;
261 #ifdef BUILD_ECORE_EVAS_SOFTWARE_16_WINCE
263 Ecore_WinCE_Window *window;
265 unsigned char fullscreen : 1;
269 #ifdef BUILD_ECORE_EVAS_EWS
275 Ecore_Timer *idle_flush_timer;
287 Eina_Bool shaped : 1;
288 Eina_Bool visible : 1;
289 Eina_Bool draw_ok : 1;
290 Eina_Bool should_be_visible : 1;
292 Eina_Bool transparent : 1;
327 unsigned char avoid_damage;
336 char request_pos : 1;
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);
357 Ecore_Evas_Engine engine;
358 Eina_List *sub_ecore_evas;
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 int gl_sync_draw_done; // added by gl77.lee
371 void _ecore_evas_ref(Ecore_Evas *ee);
372 void _ecore_evas_unref(Ecore_Evas *ee);
374 #ifdef BUILD_ECORE_EVAS_X11
375 int _ecore_evas_x_shutdown(void);
377 #ifdef BUILD_ECORE_EVAS_FB
378 int _ecore_evas_fb_shutdown(void);
380 #ifdef BUILD_ECORE_EVAS_SOFTWARE_BUFFER
381 int _ecore_evas_buffer_shutdown(void);
382 int _ecore_evas_buffer_render(Ecore_Evas *ee);
384 #ifdef BUILD_ECORE_EVAS_DIRECTFB
385 int _ecore_evas_directfb_shutdown(void);
387 #ifdef BUILD_ECORE_EVAS_WIN32
388 int _ecore_evas_win32_shutdown(void);
390 #ifdef BUILD_ECORE_EVAS_SOFTWARE_16_WINCE
391 int _ecore_evas_wince_shutdown(void);
393 #ifdef BUILD_ECORE_EVAS_EWS
394 void _ecore_evas_ews_events_init(void);
395 int _ecore_evas_ews_shutdown(void);
398 void _ecore_evas_fps_debug_init(void);
399 void _ecore_evas_fps_debug_shutdown(void);
400 void _ecore_evas_fps_debug_rendertime_add(double t);
401 void _ecore_evas_register(Ecore_Evas *ee);
402 void _ecore_evas_free(Ecore_Evas *ee);
403 void _ecore_evas_idle_timeout_update(Ecore_Evas *ee);
404 void _ecore_evas_mouse_move_process(Ecore_Evas *ee, int x, int y, unsigned int timestamp);
405 void _ecore_evas_mouse_multi_move_process(Ecore_Evas *ee, int device,
408 double radius_x, double radius_y,
411 double mx, double my,
412 unsigned int timestamp);
413 void _ecore_evas_mouse_multi_down_process(Ecore_Evas *ee, int device,
416 double radius_x, double radius_y,
419 double mx, double my,
420 Evas_Button_Flags flags,
421 unsigned int timestamp);
422 void _ecore_evas_mouse_multi_up_process(Ecore_Evas *ee, int device,
425 double radius_x, double radius_y,
428 double mx, double my,
429 Evas_Button_Flags flags,
430 unsigned int timestamp);
432 extern Eina_Bool _ecore_evas_app_comp_sync;