1 #ifndef _ECORE_EVAS_PRIVATE_H
2 #define _ECORE_EVAS_PRIVATE_H
6 #include <ecore_private.h>
7 #include <Ecore_Input.h>
8 #include <Ecore_Input_Evas.h>
10 #define ECORE_MAGIC_EVAS 0x76543211
12 #ifdef BUILD_ECORE_EVAS_X11
14 # include <Ecore_X_Atoms.h>
15 # ifdef HAVE_ECORE_X_XCB
18 # ifdef HAVE_ECORE_X_XLIB
19 # include <X11/Xlib.h>
20 # include <X11/Xutil.h>
24 #ifdef BUILD_ECORE_EVAS_SOFTWARE_X11
25 # include <Evas_Engine_Software_X11.h>
28 #ifdef BUILD_ECORE_EVAS_OPENGL_X11
29 # include <Evas_Engine_GL_X11.h>
32 #ifdef BUILD_ECORE_EVAS_SOFTWARE_8_X11
33 # include <Evas_Engine_Software_8_X11.h>
36 #ifdef BUILD_ECORE_EVAS_SOFTWARE_16_X11
37 # include <Evas_Engine_Software_16_X11.h>
40 #ifdef BUILD_ECORE_EVAS_FB
41 # include <Evas_Engine_FB.h>
44 #ifdef BUILD_ECORE_EVAS_DIRECTFB
45 # include <Evas_Engine_DirectFB.h>
46 # include "Ecore_DirectFB.h"
49 #if defined(BUILD_ECORE_EVAS_SOFTWARE_BUFFER) || defined(BUILD_ECORE_EVAS_EWS)
50 # include <Evas_Engine_Buffer.h>
53 #ifdef BUILD_ECORE_EVAS_WIN32
54 # include "Ecore_Win32.h"
55 # ifdef BUILD_ECORE_EVAS_SOFTWARE_GDI
56 # include <Evas_Engine_Software_Gdi.h>
58 # ifdef BUILD_ECORE_EVAS_SOFTWARE_DDRAW
59 # include <Evas_Engine_Software_DDraw.h>
61 # ifdef BUILD_ECORE_EVAS_DIRECT3D
62 # include <Evas_Engine_Direct3D.h>
64 # ifdef BUILD_ECORE_EVAS_OPENGL_GLEW
65 # include <Evas_Engine_GL_Glew.h>
67 # ifdef BUILD_ECORE_EVAS_SOFTWARE_16_DDRAW
68 # include <Evas_Engine_Software_16_DDraw.h>
72 #ifdef BUILD_ECORE_EVAS_SOFTWARE_16_WINCE
73 # include "Ecore_WinCE.h"
74 # include <Evas_Engine_Software_16_WinCE.h>
77 #ifdef BUILD_ECORE_EVAS_GL_COCOA
78 # include "Ecore_Cocoa.h"
79 # include <Evas_Engine_Gl_Cocoa.h>
82 #ifdef BUILD_ECORE_EVAS_WAYLAND_SHM
83 # include "Ecore_Wayland.h"
84 # include <Evas_Engine_Wayland_Shm.h>
87 #ifdef BUILD_ECORE_EVAS_WAYLAND_EGL
88 # include "Ecore_Wayland.h"
89 # include <Evas_Engine_Wayland_Egl.h>
92 /** Log domain macros and variables **/
94 extern int _ecore_evas_log_dom;
96 #ifdef ECORE_EVAS_DEFAULT_LOG_COLOR
97 # undef ECORE_EVAS_DEFAULT_LOG_COLOR
99 #define ECORE_EVAS_DEFAULT_LOG_COLOR EINA_COLOR_BLUE
104 #define ERR(...) EINA_LOG_DOM_ERR(_ecore_evas_log_dom, __VA_ARGS__)
108 #define DBG(...) EINA_LOG_DOM_DBG(_ecore_evas_log_dom, __VA_ARGS__)
112 #define INF(...) EINA_LOG_DOM_INFO(_ecore_evas_log_dom, __VA_ARGS__)
116 #define WRN(...) EINA_LOG_DOM_WARN(_ecore_evas_log_dom, __VA_ARGS__)
120 #define CRIT(...) EINA_LOG_DOM_CRIT(_ecore_evas_log_dom, __VA_ARGS__)
123 #define IDLE_FLUSH_TIME 0.5
124 #ifndef _ECORE_EVAS_H
125 typedef struct _Ecore_Evas Ecore_Evas;
126 typedef void (*Ecore_Evas_Event_Cb) (Ecore_Evas *ee);
129 typedef struct _Ecore_Evas_Engine Ecore_Evas_Engine;
130 typedef struct _Ecore_Evas_Engine_Func Ecore_Evas_Engine_Func;
132 struct _Ecore_Evas_Engine_Func
134 void (*fn_free) (Ecore_Evas *ee);
135 void (*fn_callback_resize_set) (Ecore_Evas *ee, Ecore_Evas_Event_Cb func);
136 void (*fn_callback_move_set) (Ecore_Evas *ee, Ecore_Evas_Event_Cb func);
137 void (*fn_callback_show_set) (Ecore_Evas *ee, Ecore_Evas_Event_Cb func);
138 void (*fn_callback_hide_set) (Ecore_Evas *ee, Ecore_Evas_Event_Cb func);
139 void (*fn_callback_delete_request_set) (Ecore_Evas *ee, Ecore_Evas_Event_Cb func);
140 void (*fn_callback_destroy_set) (Ecore_Evas *ee, Ecore_Evas_Event_Cb func);
141 void (*fn_callback_focus_in_set) (Ecore_Evas *ee, Ecore_Evas_Event_Cb func);
142 void (*fn_callback_focus_out_set) (Ecore_Evas *ee, Ecore_Evas_Event_Cb func);
143 void (*fn_callback_mouse_in_set) (Ecore_Evas *ee, Ecore_Evas_Event_Cb func);
144 void (*fn_callback_mouse_out_set) (Ecore_Evas *ee, Ecore_Evas_Event_Cb func);
145 void (*fn_callback_sticky_set) (Ecore_Evas *ee, Ecore_Evas_Event_Cb func);
146 void (*fn_callback_unsticky_set) (Ecore_Evas *ee, Ecore_Evas_Event_Cb func);
147 void (*fn_callback_pre_render_set) (Ecore_Evas *ee, Ecore_Evas_Event_Cb func);
148 void (*fn_callback_post_render_set) (Ecore_Evas *ee, Ecore_Evas_Event_Cb func);
149 void (*fn_move) (Ecore_Evas *ee, int x, int y);
150 void (*fn_managed_move) (Ecore_Evas *ee, int x, int y);
151 void (*fn_resize) (Ecore_Evas *ee, int w, int h);
152 void (*fn_move_resize) (Ecore_Evas *ee, int x, int y, int w, int h);
153 void (*fn_rotation_set) (Ecore_Evas *ee, int rot, int resize);
154 void (*fn_shaped_set) (Ecore_Evas *ee, int shaped);
155 void (*fn_show) (Ecore_Evas *ee);
156 void (*fn_hide) (Ecore_Evas *ee);
157 void (*fn_raise) (Ecore_Evas *ee);
158 void (*fn_lower) (Ecore_Evas *ee);
159 void (*fn_activate) (Ecore_Evas *ee);
160 void (*fn_title_set) (Ecore_Evas *ee, const char *t);
161 void (*fn_name_class_set) (Ecore_Evas *ee, const char *n, const char *c);
162 void (*fn_size_min_set) (Ecore_Evas *ee, int w, int h);
163 void (*fn_size_max_set) (Ecore_Evas *ee, int w, int h);
164 void (*fn_size_base_set) (Ecore_Evas *ee, int w, int h);
165 void (*fn_size_step_set) (Ecore_Evas *ee, int w, int h);
166 void (*fn_object_cursor_set) (Ecore_Evas *ee, Evas_Object *obj, int layer, int hot_x, int hot_y);
167 void (*fn_layer_set) (Ecore_Evas *ee, int layer);
168 void (*fn_focus_set) (Ecore_Evas *ee, int on);
169 void (*fn_iconified_set) (Ecore_Evas *ee, int on);
170 void (*fn_borderless_set) (Ecore_Evas *ee, int on);
171 void (*fn_override_set) (Ecore_Evas *ee, int on);
172 void (*fn_maximized_set) (Ecore_Evas *ee, int on);
173 void (*fn_fullscreen_set) (Ecore_Evas *ee, int on);
174 void (*fn_avoid_damage_set) (Ecore_Evas *ee, int on);
175 void (*fn_withdrawn_set) (Ecore_Evas *ee, int withdrawn);
176 void (*fn_sticky_set) (Ecore_Evas *ee, int sticky);
177 void (*fn_ignore_events_set) (Ecore_Evas *ee, int ignore);
178 void (*fn_alpha_set) (Ecore_Evas *ee, int alpha);
179 void (*fn_transparent_set) (Ecore_Evas *ee, int transparent);
180 void (*fn_profiles_set) (Ecore_Evas *ee, const char **profiles, int num_profiles);
182 void (*fn_window_group_set) (Ecore_Evas *ee, const Ecore_Evas *ee_group);
183 void (*fn_aspect_set) (Ecore_Evas *ee, double aspect);
184 void (*fn_urgent_set) (Ecore_Evas *ee, int urgent);
185 void (*fn_modal_set) (Ecore_Evas *ee, int modal);
186 void (*fn_demands_attention_set) (Ecore_Evas *ee, int demand);
187 void (*fn_focus_skip_set) (Ecore_Evas *ee, int skip);
189 int (*fn_render) (Ecore_Evas *ee);
190 void (*fn_screen_geometry_get) (const Ecore_Evas *ee, int *x, int *y, int *w, int *h);
191 void (*fn_screen_dpi_get) (const Ecore_Evas *ee, int *xdpi, int *ydpi);
192 void (*fn_wm_rot_preferred_rotation_set) (Ecore_Evas *ee, int rot);
193 void (*fn_wm_rot_available_rotations_set) (Ecore_Evas *ee, const int *rots, unsigned int count);
196 struct _Ecore_Evas_Engine
198 Ecore_Evas_Engine_Func *func;
200 /* TODO: UGLY! This should be an union or inheritance! */
201 #ifdef BUILD_ECORE_EVAS_X11
204 Ecore_X_Window win_root;
205 Eina_List *win_extra;
209 Ecore_X_XRegion *damages;
210 Ecore_X_Sync_Counter sync_counter;
211 Ecore_X_Window leader;
212 Ecore_X_Sync_Counter netwm_sync_counter;
213 int netwm_sync_val_hi;
214 unsigned int netwm_sync_val_lo;
215 int sync_val; // bigger! this will screw up at 2 billion frames (414 days of continual rendering @ 60fps)
218 unsigned char direct_resize : 1;
219 unsigned char using_bg_pixmap : 1;
220 unsigned char managed : 1;
221 unsigned char sync_began : 1;
222 unsigned char sync_cancel : 1;
223 unsigned char netwm_sync_set : 1;
224 unsigned char configure_coming : 1;
226 unsigned char supported: 1;
227 unsigned char prepare : 1;
228 unsigned char request : 1;
229 unsigned char done : 1;
230 unsigned char configure_coming : 1;
233 unsigned char modal : 1;
234 unsigned char sticky : 1;
235 unsigned char maximized_v : 1;
236 unsigned char maximized_h : 1;
237 unsigned char shaded : 1;
238 unsigned char skip_taskbar : 1;
239 unsigned char skip_pager : 1;
240 unsigned char fullscreen : 1;
241 unsigned char above : 1;
242 unsigned char below : 1;
244 Ecore_X_Window win_shaped_input;
247 #ifdef BUILD_ECORE_EVAS_FB
253 #ifdef BUILD_ECORE_EVAS_SOFTWARE_BUFFER
257 void (*free_func) (void *data, void *pix);
258 void *(*alloc_func) (void *data, int size);
262 #ifdef BUILD_ECORE_EVAS_DIRECTFB
264 Ecore_DirectFB_Window *window;
267 #ifdef BUILD_ECORE_EVAS_WIN32
269 Ecore_Win32_Window *parent;
271 unsigned char region : 1;
272 unsigned char fullscreen : 1;
276 #ifdef BUILD_ECORE_EVAS_SOFTWARE_16_WINCE
278 Ecore_WinCE_Window *window;
280 unsigned char fullscreen : 1;
284 #ifdef BUILD_ECORE_EVAS_EWS
290 #if defined(BUILD_ECORE_EVAS_WAYLAND_SHM) || defined(BUILD_ECORE_EVAS_WAYLAND_EGL)
293 Ecore_Wl_Window *parent, *win;
296 # if defined(BUILD_ECORE_EVAS_WAYLAND_SHM)
297 struct wl_shm_pool *pool;
300 struct wl_buffer *buffer;
301 Eina_Bool buffer_valid;
307 Ecore_Timer *idle_flush_timer;
319 Eina_Bool shaped : 1;
320 Eina_Bool visible : 1;
321 Eina_Bool draw_ok : 1;
322 Eina_Bool should_be_visible : 1;
324 Eina_Bool transparent : 1;
349 Eina_Bool win_resize; // v0
351 // added for the window manager rotation protocol
352 Eina_Bool app_set; // v1: app wants to communicate with the window manager to rotate
353 int rot; // v1: decided rotation by the window manager
354 int preferred_rot; // v1: app specified rotation
355 int *available_rots;// v1: app specified available rotations
356 unsigned int count; // v1: number of elements of available rotations
373 unsigned char avoid_damage;
374 Ecore_Evas *group_ee;
375 Ecore_Window group_ee_win;
385 char request_pos : 1;
390 char demand_attention : 1;
395 void (*fn_resize) (Ecore_Evas *ee);
396 void (*fn_move) (Ecore_Evas *ee);
397 void (*fn_show) (Ecore_Evas *ee);
398 void (*fn_hide) (Ecore_Evas *ee);
399 void (*fn_delete_request) (Ecore_Evas *ee);
400 void (*fn_destroy) (Ecore_Evas *ee);
401 void (*fn_focus_in) (Ecore_Evas *ee);
402 void (*fn_focus_out) (Ecore_Evas *ee);
403 void (*fn_sticky) (Ecore_Evas *ee);
404 void (*fn_unsticky) (Ecore_Evas *ee);
405 void (*fn_mouse_in) (Ecore_Evas *ee);
406 void (*fn_mouse_out) (Ecore_Evas *ee);
407 void (*fn_pre_render) (Ecore_Evas *ee);
408 void (*fn_post_render) (Ecore_Evas *ee);
409 void (*fn_pre_free) (Ecore_Evas *ee);
410 void (*fn_state_change) (Ecore_Evas *ee);
413 Ecore_Evas_Engine engine;
414 Eina_List *sub_ecore_evas;
418 unsigned char ignore_events : 1;
419 unsigned char manual_render : 1;
420 unsigned char registered : 1;
421 unsigned char no_comp_sync : 1;
422 unsigned char semi_sync : 1;
423 unsigned char deleted : 1;
424 int gl_sync_draw_done; // added by gl77.lee
427 void _ecore_evas_ref(Ecore_Evas *ee);
428 void _ecore_evas_unref(Ecore_Evas *ee);
430 #ifdef BUILD_ECORE_EVAS_X11
431 int _ecore_evas_x_shutdown(void);
433 #ifdef BUILD_ECORE_EVAS_FB
434 int _ecore_evas_fb_shutdown(void);
436 #ifdef BUILD_ECORE_EVAS_SOFTWARE_BUFFER
437 int _ecore_evas_buffer_shutdown(void);
438 int _ecore_evas_buffer_render(Ecore_Evas *ee);
440 #ifdef BUILD_ECORE_EVAS_DIRECTFB
441 int _ecore_evas_directfb_shutdown(void);
443 #ifdef BUILD_ECORE_EVAS_WIN32
444 int _ecore_evas_win32_shutdown(void);
446 #ifdef BUILD_ECORE_EVAS_SOFTWARE_16_WINCE
447 int _ecore_evas_wince_shutdown(void);
449 #ifdef BUILD_ECORE_EVAS_EWS
450 void _ecore_evas_ews_events_init(void);
451 int _ecore_evas_ews_shutdown(void);
454 #ifdef BUILD_ECORE_EVAS_WAYLAND_SHM
455 void _ecore_evas_wayland_shm_resize(Ecore_Evas *ee, int location);
456 void _ecore_evas_wayland_shm_move(Ecore_Evas *ee, int x, int y);
457 void _ecore_evas_wayland_shm_drag_start(Ecore_Evas *ee, Ecore_Evas *drag_ee, void *source);
458 void _ecore_evas_wayland_shm_pointer_set(Ecore_Evas *ee, int hot_x, int hot_y);
459 void _ecore_evas_wayland_shm_type_set(Ecore_Evas *ee, int type);
462 #ifdef BUILD_ECORE_EVAS_WAYLAND_EGL
463 void _ecore_evas_wayland_egl_resize(Ecore_Evas *ee, int location);
464 void _ecore_evas_wayland_egl_move(Ecore_Evas *ee, int x, int y);
465 void _ecore_evas_wayland_egl_drag_start(Ecore_Evas *ee, Ecore_Evas *drag_ee, void *source);
466 void _ecore_evas_wayland_egl_pointer_set(Ecore_Evas *ee, int hot_x, int hot_y);
467 void _ecore_evas_wayland_egl_type_set(Ecore_Evas *ee, int type);
470 void _ecore_evas_fps_debug_init(void);
471 void _ecore_evas_fps_debug_shutdown(void);
472 void _ecore_evas_fps_debug_rendertime_add(double t);
473 void _ecore_evas_register(Ecore_Evas *ee);
474 void _ecore_evas_free(Ecore_Evas *ee);
475 void _ecore_evas_idle_timeout_update(Ecore_Evas *ee);
476 void _ecore_evas_mouse_move_process(Ecore_Evas *ee, int x, int y, unsigned int timestamp);
477 void _ecore_evas_mouse_multi_move_process(Ecore_Evas *ee, int device,
480 double radius_x, double radius_y,
483 double mx, double my,
484 unsigned int timestamp);
485 void _ecore_evas_mouse_multi_down_process(Ecore_Evas *ee, int device,
488 double radius_x, double radius_y,
491 double mx, double my,
492 Evas_Button_Flags flags,
493 unsigned int timestamp);
494 void _ecore_evas_mouse_multi_up_process(Ecore_Evas *ee, int device,
497 double radius_x, double radius_y,
500 double mx, double my,
501 Evas_Button_Flags flags,
502 unsigned int timestamp);
504 extern Eina_Bool _ecore_evas_app_comp_sync;
506 void _ecore_evas_extn_init(void);
507 void _ecore_evas_extn_shutdown(void);