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);
194 struct _Ecore_Evas_Engine
196 Ecore_Evas_Engine_Func *func;
198 /* TODO: UGLY! This should be an union or inheritance! */
199 #ifdef BUILD_ECORE_EVAS_X11
202 Ecore_X_Window win_root;
203 Eina_List *win_extra;
207 Ecore_X_XRegion *damages;
208 Ecore_X_Sync_Counter sync_counter;
209 Ecore_X_Window leader;
210 Ecore_X_Sync_Counter netwm_sync_counter;
211 int netwm_sync_val_hi;
212 unsigned int netwm_sync_val_lo;
213 int sync_val; // bigger! this will screw up at 2 billion frames (414 days of continual rendering @ 60fps)
216 unsigned char direct_resize : 1;
217 unsigned char using_bg_pixmap : 1;
218 unsigned char managed : 1;
219 unsigned char sync_began : 1;
220 unsigned char sync_cancel : 1;
221 unsigned char netwm_sync_set : 1;
222 unsigned char configure_coming : 1;
224 unsigned char modal : 1;
225 unsigned char sticky : 1;
226 unsigned char maximized_v : 1;
227 unsigned char maximized_h : 1;
228 unsigned char shaded : 1;
229 unsigned char skip_taskbar : 1;
230 unsigned char skip_pager : 1;
231 unsigned char fullscreen : 1;
232 unsigned char above : 1;
233 unsigned char below : 1;
235 Ecore_X_Window win_shaped_input;
238 #ifdef BUILD_ECORE_EVAS_FB
244 #ifdef BUILD_ECORE_EVAS_SOFTWARE_BUFFER
248 void (*free_func) (void *data, void *pix);
249 void *(*alloc_func) (void *data, int size);
253 #ifdef BUILD_ECORE_EVAS_DIRECTFB
255 Ecore_DirectFB_Window *window;
258 #ifdef BUILD_ECORE_EVAS_WIN32
260 Ecore_Win32_Window *parent;
262 unsigned char region : 1;
263 unsigned char fullscreen : 1;
267 #ifdef BUILD_ECORE_EVAS_SOFTWARE_16_WINCE
269 Ecore_WinCE_Window *window;
271 unsigned char fullscreen : 1;
275 #ifdef BUILD_ECORE_EVAS_EWS
281 #if defined(BUILD_ECORE_EVAS_WAYLAND_SHM) || defined(BUILD_ECORE_EVAS_WAYLAND_EGL)
284 Ecore_Wl_Window *parent, *win;
287 # if defined(BUILD_ECORE_EVAS_WAYLAND_SHM)
288 struct wl_shm_pool *pool;
291 struct wl_buffer *buffer;
292 Eina_Bool buffer_valid;
298 Ecore_Timer *idle_flush_timer;
310 Eina_Bool shaped : 1;
311 Eina_Bool visible : 1;
312 Eina_Bool draw_ok : 1;
313 Eina_Bool should_be_visible : 1;
315 Eina_Bool transparent : 1;
352 unsigned char avoid_damage;
353 Ecore_Evas *group_ee;
354 Ecore_Window group_ee_win;
364 char request_pos : 1;
369 char demand_attention : 1;
374 void (*fn_resize) (Ecore_Evas *ee);
375 void (*fn_move) (Ecore_Evas *ee);
376 void (*fn_show) (Ecore_Evas *ee);
377 void (*fn_hide) (Ecore_Evas *ee);
378 void (*fn_delete_request) (Ecore_Evas *ee);
379 void (*fn_destroy) (Ecore_Evas *ee);
380 void (*fn_focus_in) (Ecore_Evas *ee);
381 void (*fn_focus_out) (Ecore_Evas *ee);
382 void (*fn_sticky) (Ecore_Evas *ee);
383 void (*fn_unsticky) (Ecore_Evas *ee);
384 void (*fn_mouse_in) (Ecore_Evas *ee);
385 void (*fn_mouse_out) (Ecore_Evas *ee);
386 void (*fn_pre_render) (Ecore_Evas *ee);
387 void (*fn_post_render) (Ecore_Evas *ee);
388 void (*fn_pre_free) (Ecore_Evas *ee);
389 void (*fn_state_change) (Ecore_Evas *ee);
392 Ecore_Evas_Engine engine;
393 Eina_List *sub_ecore_evas;
397 unsigned char ignore_events : 1;
398 unsigned char manual_render : 1;
399 unsigned char registered : 1;
400 unsigned char no_comp_sync : 1;
401 unsigned char semi_sync : 1;
402 unsigned char deleted : 1;
403 int gl_sync_draw_done; // added by gl77.lee
406 void _ecore_evas_ref(Ecore_Evas *ee);
407 void _ecore_evas_unref(Ecore_Evas *ee);
409 #ifdef BUILD_ECORE_EVAS_X11
410 int _ecore_evas_x_shutdown(void);
412 #ifdef BUILD_ECORE_EVAS_FB
413 int _ecore_evas_fb_shutdown(void);
415 #ifdef BUILD_ECORE_EVAS_SOFTWARE_BUFFER
416 int _ecore_evas_buffer_shutdown(void);
417 int _ecore_evas_buffer_render(Ecore_Evas *ee);
419 #ifdef BUILD_ECORE_EVAS_DIRECTFB
420 int _ecore_evas_directfb_shutdown(void);
422 #ifdef BUILD_ECORE_EVAS_WIN32
423 int _ecore_evas_win32_shutdown(void);
425 #ifdef BUILD_ECORE_EVAS_SOFTWARE_16_WINCE
426 int _ecore_evas_wince_shutdown(void);
428 #ifdef BUILD_ECORE_EVAS_EWS
429 void _ecore_evas_ews_events_init(void);
430 int _ecore_evas_ews_shutdown(void);
433 #ifdef BUILD_ECORE_EVAS_WAYLAND_SHM
434 void _ecore_evas_wayland_shm_resize(Ecore_Evas *ee, int location);
435 void _ecore_evas_wayland_shm_move(Ecore_Evas *ee, int x, int y);
436 void _ecore_evas_wayland_shm_drag_start(Ecore_Evas *ee, Ecore_Evas *drag_ee, void *source);
437 void _ecore_evas_wayland_shm_pointer_set(Ecore_Evas *ee, int hot_x, int hot_y);
438 void _ecore_evas_wayland_shm_type_set(Ecore_Evas *ee, int type);
441 #ifdef BUILD_ECORE_EVAS_WAYLAND_EGL
442 void _ecore_evas_wayland_egl_resize(Ecore_Evas *ee, int location);
443 void _ecore_evas_wayland_egl_move(Ecore_Evas *ee, int x, int y);
444 void _ecore_evas_wayland_egl_drag_start(Ecore_Evas *ee, Ecore_Evas *drag_ee, void *source);
445 void _ecore_evas_wayland_egl_pointer_set(Ecore_Evas *ee, int hot_x, int hot_y);
446 void _ecore_evas_wayland_egl_type_set(Ecore_Evas *ee, int type);
449 void _ecore_evas_fps_debug_init(void);
450 void _ecore_evas_fps_debug_shutdown(void);
451 void _ecore_evas_fps_debug_rendertime_add(double t);
452 void _ecore_evas_register(Ecore_Evas *ee);
453 void _ecore_evas_free(Ecore_Evas *ee);
454 void _ecore_evas_idle_timeout_update(Ecore_Evas *ee);
455 void _ecore_evas_mouse_move_process(Ecore_Evas *ee, int x, int y, unsigned int timestamp);
456 void _ecore_evas_mouse_multi_move_process(Ecore_Evas *ee, int device,
459 double radius_x, double radius_y,
462 double mx, double my,
463 unsigned int timestamp);
464 void _ecore_evas_mouse_multi_down_process(Ecore_Evas *ee, int device,
467 double radius_x, double radius_y,
470 double mx, double my,
471 Evas_Button_Flags flags,
472 unsigned int timestamp);
473 void _ecore_evas_mouse_multi_up_process(Ecore_Evas *ee, int device,
476 double radius_x, double radius_y,
479 double mx, double my,
480 Evas_Button_Flags flags,
481 unsigned int timestamp);
483 extern Eina_Bool _ecore_evas_app_comp_sync;
485 void _ecore_evas_extn_init(void);
486 void _ecore_evas_extn_shutdown(void);