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 #if defined(BUILD_ECORE_EVAS_WAYLAND_SHM) || defined(BUILD_ECORE_EVAS_WAYLAND_EGL)
83 # include "Ecore_Wayland.h"
86 #ifdef BUILD_ECORE_EVAS_WAYLAND_SHM
87 # include <Evas_Engine_Wayland_Shm.h>
90 #ifdef BUILD_ECORE_EVAS_WAYLAND_EGL
91 # include <Evas_Engine_Wayland_Egl.h>
94 /** Log domain macros and variables **/
96 extern int _ecore_evas_log_dom;
98 #ifdef ECORE_EVAS_DEFAULT_LOG_COLOR
99 # undef ECORE_EVAS_DEFAULT_LOG_COLOR
101 #define ECORE_EVAS_DEFAULT_LOG_COLOR EINA_COLOR_BLUE
106 #define ERR(...) EINA_LOG_DOM_ERR(_ecore_evas_log_dom, __VA_ARGS__)
110 #define DBG(...) EINA_LOG_DOM_DBG(_ecore_evas_log_dom, __VA_ARGS__)
114 #define INF(...) EINA_LOG_DOM_INFO(_ecore_evas_log_dom, __VA_ARGS__)
118 #define WRN(...) EINA_LOG_DOM_WARN(_ecore_evas_log_dom, __VA_ARGS__)
122 #define CRIT(...) EINA_LOG_DOM_CRIT(_ecore_evas_log_dom, __VA_ARGS__)
125 #define IDLE_FLUSH_TIME 0.5
126 #ifndef _ECORE_EVAS_H
127 typedef struct _Ecore_Evas Ecore_Evas;
128 typedef void (*Ecore_Evas_Event_Cb) (Ecore_Evas *ee);
131 typedef struct _Ecore_Evas_Engine Ecore_Evas_Engine;
132 typedef struct _Ecore_Evas_Engine_Func Ecore_Evas_Engine_Func;
134 struct _Ecore_Evas_Engine_Func
136 void (*fn_free) (Ecore_Evas *ee);
137 void (*fn_callback_resize_set) (Ecore_Evas *ee, Ecore_Evas_Event_Cb func);
138 void (*fn_callback_move_set) (Ecore_Evas *ee, Ecore_Evas_Event_Cb func);
139 void (*fn_callback_show_set) (Ecore_Evas *ee, Ecore_Evas_Event_Cb func);
140 void (*fn_callback_hide_set) (Ecore_Evas *ee, Ecore_Evas_Event_Cb func);
141 void (*fn_callback_delete_request_set) (Ecore_Evas *ee, Ecore_Evas_Event_Cb func);
142 void (*fn_callback_destroy_set) (Ecore_Evas *ee, Ecore_Evas_Event_Cb func);
143 void (*fn_callback_focus_in_set) (Ecore_Evas *ee, Ecore_Evas_Event_Cb func);
144 void (*fn_callback_focus_out_set) (Ecore_Evas *ee, Ecore_Evas_Event_Cb func);
145 void (*fn_callback_mouse_in_set) (Ecore_Evas *ee, Ecore_Evas_Event_Cb func);
146 void (*fn_callback_mouse_out_set) (Ecore_Evas *ee, Ecore_Evas_Event_Cb func);
147 void (*fn_callback_sticky_set) (Ecore_Evas *ee, Ecore_Evas_Event_Cb func);
148 void (*fn_callback_unsticky_set) (Ecore_Evas *ee, Ecore_Evas_Event_Cb func);
149 void (*fn_callback_pre_render_set) (Ecore_Evas *ee, Ecore_Evas_Event_Cb func);
150 void (*fn_callback_post_render_set) (Ecore_Evas *ee, Ecore_Evas_Event_Cb func);
151 void (*fn_move) (Ecore_Evas *ee, int x, int y);
152 void (*fn_managed_move) (Ecore_Evas *ee, int x, int y);
153 void (*fn_resize) (Ecore_Evas *ee, int w, int h);
154 void (*fn_move_resize) (Ecore_Evas *ee, int x, int y, int w, int h);
155 void (*fn_rotation_set) (Ecore_Evas *ee, int rot, int resize);
156 void (*fn_shaped_set) (Ecore_Evas *ee, int shaped);
157 void (*fn_show) (Ecore_Evas *ee);
158 void (*fn_hide) (Ecore_Evas *ee);
159 void (*fn_raise) (Ecore_Evas *ee);
160 void (*fn_lower) (Ecore_Evas *ee);
161 void (*fn_activate) (Ecore_Evas *ee);
162 void (*fn_title_set) (Ecore_Evas *ee, const char *t);
163 void (*fn_name_class_set) (Ecore_Evas *ee, const char *n, const char *c);
164 void (*fn_size_min_set) (Ecore_Evas *ee, int w, int h);
165 void (*fn_size_max_set) (Ecore_Evas *ee, int w, int h);
166 void (*fn_size_base_set) (Ecore_Evas *ee, int w, int h);
167 void (*fn_size_step_set) (Ecore_Evas *ee, int w, int h);
168 void (*fn_object_cursor_set) (Ecore_Evas *ee, Evas_Object *obj, int layer, int hot_x, int hot_y);
169 void (*fn_layer_set) (Ecore_Evas *ee, int layer);
170 void (*fn_focus_set) (Ecore_Evas *ee, int on);
171 void (*fn_iconified_set) (Ecore_Evas *ee, int on);
172 void (*fn_borderless_set) (Ecore_Evas *ee, int on);
173 void (*fn_override_set) (Ecore_Evas *ee, int on);
174 void (*fn_maximized_set) (Ecore_Evas *ee, int on);
175 void (*fn_fullscreen_set) (Ecore_Evas *ee, int on);
176 void (*fn_avoid_damage_set) (Ecore_Evas *ee, int on);
177 void (*fn_withdrawn_set) (Ecore_Evas *ee, int withdrawn);
178 void (*fn_sticky_set) (Ecore_Evas *ee, int sticky);
179 void (*fn_ignore_events_set) (Ecore_Evas *ee, int ignore);
180 void (*fn_alpha_set) (Ecore_Evas *ee, int alpha);
181 void (*fn_transparent_set) (Ecore_Evas *ee, int transparent);
182 void (*fn_profiles_set) (Ecore_Evas *ee, const char **profiles, int num_profiles);
184 void (*fn_window_group_set) (Ecore_Evas *ee, const Ecore_Evas *ee_group);
185 void (*fn_aspect_set) (Ecore_Evas *ee, double aspect);
186 void (*fn_urgent_set) (Ecore_Evas *ee, int urgent);
187 void (*fn_modal_set) (Ecore_Evas *ee, int modal);
188 void (*fn_demands_attention_set) (Ecore_Evas *ee, int demand);
189 void (*fn_focus_skip_set) (Ecore_Evas *ee, int skip);
191 int (*fn_render) (Ecore_Evas *ee);
192 void (*fn_screen_geometry_get) (const Ecore_Evas *ee, int *x, int *y, int *w, int *h);
193 void (*fn_screen_dpi_get) (const Ecore_Evas *ee, int *xdpi, int *ydpi);
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 modal : 1;
227 unsigned char sticky : 1;
228 unsigned char maximized_v : 1;
229 unsigned char maximized_h : 1;
230 unsigned char shaded : 1;
231 unsigned char skip_taskbar : 1;
232 unsigned char skip_pager : 1;
233 unsigned char fullscreen : 1;
234 unsigned char above : 1;
235 unsigned char below : 1;
237 Ecore_X_Window win_shaped_input;
240 #ifdef BUILD_ECORE_EVAS_FB
246 #ifdef BUILD_ECORE_EVAS_SOFTWARE_BUFFER
250 void (*free_func) (void *data, void *pix);
251 void *(*alloc_func) (void *data, int size);
255 #ifdef BUILD_ECORE_EVAS_DIRECTFB
257 Ecore_DirectFB_Window *window;
260 #ifdef BUILD_ECORE_EVAS_WIN32
262 Ecore_Win32_Window *parent;
264 unsigned char region : 1;
265 unsigned char fullscreen : 1;
269 #ifdef BUILD_ECORE_EVAS_SOFTWARE_16_WINCE
271 Ecore_WinCE_Window *window;
273 unsigned char fullscreen : 1;
277 #ifdef BUILD_ECORE_EVAS_EWS
283 #if defined(BUILD_ECORE_EVAS_WAYLAND_SHM) || defined(BUILD_ECORE_EVAS_WAYLAND_EGL)
286 Ecore_Wl_Window *parent, *win;
289 # if defined(BUILD_ECORE_EVAS_WAYLAND_SHM)
290 struct wl_shm_pool *pool;
293 struct wl_buffer *buffer;
299 Ecore_Timer *idle_flush_timer;
311 Eina_Bool shaped : 1;
312 Eina_Bool visible : 1;
313 Eina_Bool draw_ok : 1;
314 Eina_Bool should_be_visible : 1;
316 Eina_Bool transparent : 1;
353 unsigned char avoid_damage;
354 Ecore_Evas *group_ee;
355 Ecore_Window group_ee_win;
365 char request_pos : 1;
370 char demand_attention : 1;
375 void (*fn_resize) (Ecore_Evas *ee);
376 void (*fn_move) (Ecore_Evas *ee);
377 void (*fn_show) (Ecore_Evas *ee);
378 void (*fn_hide) (Ecore_Evas *ee);
379 void (*fn_delete_request) (Ecore_Evas *ee);
380 void (*fn_destroy) (Ecore_Evas *ee);
381 void (*fn_focus_in) (Ecore_Evas *ee);
382 void (*fn_focus_out) (Ecore_Evas *ee);
383 void (*fn_sticky) (Ecore_Evas *ee);
384 void (*fn_unsticky) (Ecore_Evas *ee);
385 void (*fn_mouse_in) (Ecore_Evas *ee);
386 void (*fn_mouse_out) (Ecore_Evas *ee);
387 void (*fn_pre_render) (Ecore_Evas *ee);
388 void (*fn_post_render) (Ecore_Evas *ee);
389 void (*fn_pre_free) (Ecore_Evas *ee);
390 void (*fn_state_change) (Ecore_Evas *ee);
393 Ecore_Evas_Engine engine;
394 Eina_List *sub_ecore_evas;
398 unsigned char ignore_events : 1;
399 unsigned char manual_render : 1;
400 unsigned char registered : 1;
401 unsigned char no_comp_sync : 1;
402 unsigned char semi_sync : 1;
403 unsigned char deleted : 1;
404 int gl_sync_draw_done; // added by gl77.lee
407 void _ecore_evas_ref(Ecore_Evas *ee);
408 void _ecore_evas_unref(Ecore_Evas *ee);
410 #ifdef BUILD_ECORE_EVAS_X11
411 int _ecore_evas_x_shutdown(void);
413 #ifdef BUILD_ECORE_EVAS_FB
414 int _ecore_evas_fb_shutdown(void);
416 #ifdef BUILD_ECORE_EVAS_SOFTWARE_BUFFER
417 int _ecore_evas_buffer_shutdown(void);
418 int _ecore_evas_buffer_render(Ecore_Evas *ee);
420 #ifdef BUILD_ECORE_EVAS_DIRECTFB
421 int _ecore_evas_directfb_shutdown(void);
423 #ifdef BUILD_ECORE_EVAS_WIN32
424 int _ecore_evas_win32_shutdown(void);
426 #ifdef BUILD_ECORE_EVAS_SOFTWARE_16_WINCE
427 int _ecore_evas_wince_shutdown(void);
429 #ifdef BUILD_ECORE_EVAS_EWS
430 void _ecore_evas_ews_events_init(void);
431 int _ecore_evas_ews_shutdown(void);
434 #if defined(BUILD_ECORE_EVAS_WAYLAND_SHM) || defined(BUILD_ECORE_EVAS_WAYLAND_EGL)
435 int _ecore_evas_wl_common_init(void);
436 int _ecore_evas_wl_common_shutdown(void);
437 void _ecore_evas_wl_common_pre_free(Ecore_Evas *ee);
438 void _ecore_evas_wl_common_free(Ecore_Evas *ee);
439 void _ecore_evas_wl_common_callback_resize_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee));
440 void _ecore_evas_wl_common_callback_move_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee));
441 void _ecore_evas_wl_common_callback_delete_request_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee));
442 void _ecore_evas_wl_common_callback_focus_in_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee));
443 void _ecore_evas_wl_common_callback_focus_out_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee));
444 void _ecore_evas_wl_common_callback_mouse_in_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee));
445 void _ecore_evas_wl_common_callback_mouse_out_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee));
446 void _ecore_evas_wl_common_move(Ecore_Evas *ee, int x, int y);
447 void _ecore_evas_wl_common_raise(Ecore_Evas *ee);
448 void _ecore_evas_wl_common_title_set(Ecore_Evas *ee, const char *title);
449 void _ecore_evas_wl_common_name_class_set(Ecore_Evas *ee, const char *n, const char *c);
450 void _ecore_evas_wl_common_size_min_set(Ecore_Evas *ee, int w, int h);
451 void _ecore_evas_wl_common_size_max_set(Ecore_Evas *ee, int w, int h);
452 void _ecore_evas_wl_common_size_base_set(Ecore_Evas *ee, int w, int h);
453 void _ecore_evas_wl_common_size_step_set(Ecore_Evas *ee, int w, int h);
454 void _ecore_evas_wl_common_layer_set(Ecore_Evas *ee, int layer);
455 void _ecore_evas_wl_common_iconified_set(Ecore_Evas *ee, int iconify);
456 void _ecore_evas_wl_common_maximized_set(Ecore_Evas *ee, int max);
457 void _ecore_evas_wl_common_fullscreen_set(Ecore_Evas *ee, int full);
458 void _ecore_evas_wl_common_ignore_events_set(Ecore_Evas *ee, int ignore);
459 int _ecore_evas_wl_common_pre_render(Ecore_Evas *ee);
460 int _ecore_evas_wl_common_render_updates(Ecore_Evas *ee);
461 void _ecore_evas_wl_common_post_render(Ecore_Evas *ee);
462 int _ecore_evas_wl_common_render(Ecore_Evas *ee);
463 void _ecore_evas_wl_common_screen_geometry_get(const Ecore_Evas *ee, int *x, int *y, int *w, int *h);
464 void _ecore_evas_wl_common_screen_dpi_get(const Ecore_Evas *ee, int *xdpi, int *ydpi);
466 Evas_Object * _ecore_evas_wl_common_frame_add(Evas *evas);
468 #ifdef BUILD_ECORE_EVAS_WAYLAND_SHM
469 void _ecore_evas_wayland_shm_resize(Ecore_Evas *ee, int location);
472 #ifdef BUILD_ECORE_EVAS_WAYLAND_EGL
473 void _ecore_evas_wayland_egl_resize(Ecore_Evas *ee, int location);
477 void _ecore_evas_fps_debug_init(void);
478 void _ecore_evas_fps_debug_shutdown(void);
479 void _ecore_evas_fps_debug_rendertime_add(double t);
480 void _ecore_evas_register(Ecore_Evas *ee);
481 void _ecore_evas_free(Ecore_Evas *ee);
482 void _ecore_evas_idle_timeout_update(Ecore_Evas *ee);
483 void _ecore_evas_mouse_move_process(Ecore_Evas *ee, int x, int y, unsigned int timestamp);
484 void _ecore_evas_mouse_multi_move_process(Ecore_Evas *ee, int device,
487 double radius_x, double radius_y,
490 double mx, double my,
491 unsigned int timestamp);
492 void _ecore_evas_mouse_multi_down_process(Ecore_Evas *ee, int device,
495 double radius_x, double radius_y,
498 double mx, double my,
499 Evas_Button_Flags flags,
500 unsigned int timestamp);
501 void _ecore_evas_mouse_multi_up_process(Ecore_Evas *ee, int device,
504 double radius_x, double radius_y,
507 double mx, double my,
508 Evas_Button_Flags flags,
509 unsigned int timestamp);
511 extern Eina_Bool _ecore_evas_app_comp_sync;
513 void _ecore_evas_extn_init(void);
514 void _ecore_evas_extn_shutdown(void);