summaryrefslogtreecommitdiff
path: root/src/lib/ecore_evas/ecore_evas_private.h
diff options
context:
space:
mode:
authorVincent Torri <vincent.torri@gmail.com>2012-12-02 22:35:45 +0000
committerVincent Torri <vincent.torri@gmail.com>2012-12-02 22:35:45 +0000
commit7d6010b12c47a20e492da808e3192c3f87dab619 (patch)
tree26c6fd189e046a76560c0bc740b85f4d767ae399 /src/lib/ecore_evas/ecore_evas_private.h
parent53fc441d5475155965d92da89502fe4634a561b2 (diff)
merge: add escape ecore, fix several bugs
SVN revision: 79995
Diffstat (limited to 'src/lib/ecore_evas/ecore_evas_private.h')
-rw-r--r--src/lib/ecore_evas/ecore_evas_private.h490
1 files changed, 490 insertions, 0 deletions
diff --git a/src/lib/ecore_evas/ecore_evas_private.h b/src/lib/ecore_evas/ecore_evas_private.h
new file mode 100644
index 0000000000..0c7b03043d
--- /dev/null
+++ b/src/lib/ecore_evas/ecore_evas_private.h
@@ -0,0 +1,490 @@
1#ifndef _ECORE_EVAS_PRIVATE_H
2#define _ECORE_EVAS_PRIVATE_H
3
4#include <Evas.h>
5#include <Ecore.h>
6#include <ecore_private.h>
7#include <Ecore_Input.h>
8#include <Ecore_Input_Evas.h>
9
10#define ECORE_MAGIC_EVAS 0x76543211
11
12#ifdef BUILD_ECORE_EVAS_X11
13# include <Ecore_X.h>
14# include <Ecore_X_Atoms.h>
15# ifdef HAVE_ECORE_X_XCB
16# include <xcb/xcb.h>
17# endif
18# ifdef HAVE_ECORE_X_XLIB
19# include <X11/Xlib.h>
20# include <X11/Xutil.h>
21# endif
22#endif
23
24#ifdef BUILD_ECORE_EVAS_SOFTWARE_X11
25# include <Evas_Engine_Software_X11.h>
26#endif
27
28#ifdef BUILD_ECORE_EVAS_OPENGL_X11
29# include <Evas_Engine_GL_X11.h>
30#endif
31
32#ifdef BUILD_ECORE_EVAS_FB
33# include <Evas_Engine_FB.h>
34#endif
35
36#ifdef BUILD_ECORE_EVAS_DIRECTFB
37# include <Evas_Engine_DirectFB.h>
38# include "Ecore_DirectFB.h"
39#endif
40
41#if defined(BUILD_ECORE_EVAS_SOFTWARE_BUFFER) || defined(BUILD_ECORE_EVAS_EWS)
42# include <Evas_Engine_Buffer.h>
43#endif
44
45#ifdef BUILD_ECORE_EVAS_WIN32
46# include "Ecore_Win32.h"
47# ifdef BUILD_ECORE_EVAS_SOFTWARE_GDI
48# include <Evas_Engine_Software_Gdi.h>
49# endif
50# ifdef BUILD_ECORE_EVAS_SOFTWARE_DDRAW
51# include <Evas_Engine_Software_DDraw.h>
52# endif
53# ifdef BUILD_ECORE_EVAS_DIRECT3D
54# include <Evas_Engine_Direct3D.h>
55# endif
56# ifdef BUILD_ECORE_EVAS_OPENGL_GLEW
57# include <Evas_Engine_GL_Glew.h>
58# endif
59#endif
60
61#ifdef BUILD_ECORE_EVAS_GL_COCOA
62# include "Ecore_Cocoa.h"
63# include <Evas_Engine_Gl_Cocoa.h>
64#endif
65
66#if defined(BUILD_ECORE_EVAS_WAYLAND_SHM) || defined(BUILD_ECORE_EVAS_WAYLAND_EGL)
67# include "Ecore_Wayland.h"
68#endif
69
70#ifdef BUILD_ECORE_EVAS_WAYLAND_SHM
71# include <Evas_Engine_Wayland_Shm.h>
72#endif
73
74#ifdef BUILD_ECORE_EVAS_WAYLAND_EGL
75# include <Evas_Engine_Wayland_Egl.h>
76#endif
77
78/** Log domain macros and variables **/
79
80extern int _ecore_evas_log_dom;
81
82#ifdef ECORE_EVAS_DEFAULT_LOG_COLOR
83# undef ECORE_EVAS_DEFAULT_LOG_COLOR
84#endif
85#define ECORE_EVAS_DEFAULT_LOG_COLOR EINA_COLOR_BLUE
86
87#ifdef ERR
88# undef ERR
89#endif
90#define ERR(...) EINA_LOG_DOM_ERR(_ecore_evas_log_dom, __VA_ARGS__)
91#ifdef DBG
92# undef DBG
93#endif
94#define DBG(...) EINA_LOG_DOM_DBG(_ecore_evas_log_dom, __VA_ARGS__)
95#ifdef INF
96# undef INF
97#endif
98#define INF(...) EINA_LOG_DOM_INFO(_ecore_evas_log_dom, __VA_ARGS__)
99#ifdef WRN
100# undef WRN
101#endif
102#define WRN(...) EINA_LOG_DOM_WARN(_ecore_evas_log_dom, __VA_ARGS__)
103#ifdef CRIT
104# undef CRIT
105#endif
106#define CRIT(...) EINA_LOG_DOM_CRIT(_ecore_evas_log_dom, __VA_ARGS__)
107
108
109#define IDLE_FLUSH_TIME 0.5
110#ifndef _ECORE_EVAS_H
111typedef struct _Ecore_Evas Ecore_Evas;
112typedef void (*Ecore_Evas_Event_Cb) (Ecore_Evas *ee);
113#endif
114
115typedef struct _Ecore_Evas_Engine Ecore_Evas_Engine;
116typedef struct _Ecore_Evas_Engine_Func Ecore_Evas_Engine_Func;
117
118struct _Ecore_Evas_Engine_Func
119{
120 void (*fn_free) (Ecore_Evas *ee);
121 void (*fn_callback_resize_set) (Ecore_Evas *ee, Ecore_Evas_Event_Cb func);
122 void (*fn_callback_move_set) (Ecore_Evas *ee, Ecore_Evas_Event_Cb func);
123 void (*fn_callback_show_set) (Ecore_Evas *ee, Ecore_Evas_Event_Cb func);
124 void (*fn_callback_hide_set) (Ecore_Evas *ee, Ecore_Evas_Event_Cb func);
125 void (*fn_callback_delete_request_set) (Ecore_Evas *ee, Ecore_Evas_Event_Cb func);
126 void (*fn_callback_destroy_set) (Ecore_Evas *ee, Ecore_Evas_Event_Cb func);
127 void (*fn_callback_focus_in_set) (Ecore_Evas *ee, Ecore_Evas_Event_Cb func);
128 void (*fn_callback_focus_out_set) (Ecore_Evas *ee, Ecore_Evas_Event_Cb func);
129 void (*fn_callback_mouse_in_set) (Ecore_Evas *ee, Ecore_Evas_Event_Cb func);
130 void (*fn_callback_mouse_out_set) (Ecore_Evas *ee, Ecore_Evas_Event_Cb func);
131 void (*fn_callback_sticky_set) (Ecore_Evas *ee, Ecore_Evas_Event_Cb func);
132 void (*fn_callback_unsticky_set) (Ecore_Evas *ee, Ecore_Evas_Event_Cb func);
133 void (*fn_callback_pre_render_set) (Ecore_Evas *ee, Ecore_Evas_Event_Cb func);
134 void (*fn_callback_post_render_set) (Ecore_Evas *ee, Ecore_Evas_Event_Cb func);
135 void (*fn_move) (Ecore_Evas *ee, int x, int y);
136 void (*fn_managed_move) (Ecore_Evas *ee, int x, int y);
137 void (*fn_resize) (Ecore_Evas *ee, int w, int h);
138 void (*fn_move_resize) (Ecore_Evas *ee, int x, int y, int w, int h);
139 void (*fn_rotation_set) (Ecore_Evas *ee, int rot, int resize);
140 void (*fn_shaped_set) (Ecore_Evas *ee, int shaped);
141 void (*fn_show) (Ecore_Evas *ee);
142 void (*fn_hide) (Ecore_Evas *ee);
143 void (*fn_raise) (Ecore_Evas *ee);
144 void (*fn_lower) (Ecore_Evas *ee);
145 void (*fn_activate) (Ecore_Evas *ee);
146 void (*fn_title_set) (Ecore_Evas *ee, const char *t);
147 void (*fn_name_class_set) (Ecore_Evas *ee, const char *n, const char *c);
148 void (*fn_size_min_set) (Ecore_Evas *ee, int w, int h);
149 void (*fn_size_max_set) (Ecore_Evas *ee, int w, int h);
150 void (*fn_size_base_set) (Ecore_Evas *ee, int w, int h);
151 void (*fn_size_step_set) (Ecore_Evas *ee, int w, int h);
152 void (*fn_object_cursor_set) (Ecore_Evas *ee, Evas_Object *obj, int layer, int hot_x, int hot_y);
153 void (*fn_layer_set) (Ecore_Evas *ee, int layer);
154 void (*fn_focus_set) (Ecore_Evas *ee, int on);
155 void (*fn_iconified_set) (Ecore_Evas *ee, int on);
156 void (*fn_borderless_set) (Ecore_Evas *ee, int on);
157 void (*fn_override_set) (Ecore_Evas *ee, int on);
158 void (*fn_maximized_set) (Ecore_Evas *ee, int on);
159 void (*fn_fullscreen_set) (Ecore_Evas *ee, int on);
160 void (*fn_avoid_damage_set) (Ecore_Evas *ee, int on);
161 void (*fn_withdrawn_set) (Ecore_Evas *ee, int withdrawn);
162 void (*fn_sticky_set) (Ecore_Evas *ee, int sticky);
163 void (*fn_ignore_events_set) (Ecore_Evas *ee, int ignore);
164 void (*fn_alpha_set) (Ecore_Evas *ee, int alpha);
165 void (*fn_transparent_set) (Ecore_Evas *ee, int transparent);
166 void (*fn_profiles_set) (Ecore_Evas *ee, const char **profiles, int num_profiles);
167
168 void (*fn_window_group_set) (Ecore_Evas *ee, const Ecore_Evas *ee_group);
169 void (*fn_aspect_set) (Ecore_Evas *ee, double aspect);
170 void (*fn_urgent_set) (Ecore_Evas *ee, int urgent);
171 void (*fn_modal_set) (Ecore_Evas *ee, int modal);
172 void (*fn_demands_attention_set) (Ecore_Evas *ee, int demand);
173 void (*fn_focus_skip_set) (Ecore_Evas *ee, int skip);
174
175 int (*fn_render) (Ecore_Evas *ee);
176 void (*fn_screen_geometry_get) (const Ecore_Evas *ee, int *x, int *y, int *w, int *h);
177 void (*fn_screen_dpi_get) (const Ecore_Evas *ee, int *xdpi, int *ydpi);
178};
179
180struct _Ecore_Evas_Engine
181{
182 Ecore_Evas_Engine_Func *func;
183
184/* TODO: UGLY! This should be an union or inheritance! */
185#ifdef BUILD_ECORE_EVAS_X11
186 struct
187 {
188 Ecore_X_Window win_root;
189 Eina_List *win_extra;
190 Ecore_X_Pixmap pmap;
191 Ecore_X_Pixmap mask;
192 Ecore_X_GC gc;
193 Ecore_X_XRegion *damages;
194 Ecore_X_Sync_Counter sync_counter;
195 Ecore_X_Window leader;
196 Ecore_X_Sync_Counter netwm_sync_counter;
197 int netwm_sync_val_hi;
198 unsigned int netwm_sync_val_lo;
199 int sync_val; // bigger! this will screw up at 2 billion frames (414 days of continual rendering @ 60fps)
200 int screen_num;
201 int px, py, pw, ph;
202 unsigned char direct_resize : 1;
203 unsigned char using_bg_pixmap : 1;
204 unsigned char managed : 1;
205 unsigned char sync_began : 1;
206 unsigned char sync_cancel : 1;
207 unsigned char netwm_sync_set : 1;
208 unsigned char configure_coming : 1;
209 struct {
210 unsigned char modal : 1;
211 unsigned char sticky : 1;
212 unsigned char maximized_v : 1;
213 unsigned char maximized_h : 1;
214 unsigned char shaded : 1;
215 unsigned char skip_taskbar : 1;
216 unsigned char skip_pager : 1;
217 unsigned char fullscreen : 1;
218 unsigned char above : 1;
219 unsigned char below : 1;
220 } state;
221 Ecore_X_Window win_shaped_input;
222 } x;
223#endif
224#ifdef BUILD_ECORE_EVAS_FB
225 struct {
226 int real_w;
227 int real_h;
228 } fb;
229#endif
230#ifdef BUILD_ECORE_EVAS_SOFTWARE_BUFFER
231 struct {
232 void *pixels;
233 Evas_Object *image;
234 void (*free_func) (void *data, void *pix);
235 void *(*alloc_func) (void *data, int size);
236 void *data;
237 } buffer;
238#endif
239#ifdef BUILD_ECORE_EVAS_DIRECTFB
240 struct {
241 Ecore_DirectFB_Window *window;
242 } directfb;
243#endif
244#ifdef BUILD_ECORE_EVAS_WIN32
245 struct {
246 Ecore_Win32_Window *parent;
247 struct {
248 unsigned char region : 1;
249 unsigned char fullscreen : 1;
250 } state;
251 } win32;
252#endif
253#ifdef BUILD_ECORE_EVAS_EWS
254 struct {
255 Evas_Object *image;
256 } ews;
257#endif
258
259#if defined(BUILD_ECORE_EVAS_WAYLAND_SHM) || defined(BUILD_ECORE_EVAS_WAYLAND_EGL)
260 struct
261 {
262 Ecore_Wl_Window *parent, *win;
263 Evas_Object *frame;
264
265# if defined(BUILD_ECORE_EVAS_WAYLAND_SHM)
266 struct wl_shm_pool *pool;
267 size_t pool_size;
268 void *pool_data;
269 struct wl_buffer *buffer;
270# endif
271
272 } wl;
273#endif
274
275 Ecore_Timer *idle_flush_timer;
276};
277
278struct _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 Eina_Bool in : 1;
294
295 Eina_Hash *data;
296
297 struct {
298 int x, y, w, h;
299 } req;
300
301 struct {
302 int x, y;
303 } mouse;
304
305 struct {
306 int w, h;
307 } expecting_resize;
308
309 struct {
310 char *title;
311 char *name;
312 char *clas;
313 char *profile;
314 struct {
315 int w, h;
316 } min,
317 max,
318 base,
319 step;
320 struct {
321 Evas_Object *object;
322 int layer;
323 struct {
324 int x, y;
325 } hot;
326 } cursor;
327 int layer;
328 Ecore_Window window;
329 unsigned char avoid_damage;
330 Ecore_Evas *group_ee;
331 Ecore_Window group_ee_win;
332 double aspect;
333 char focused : 1;
334 char iconified : 1;
335 char borderless : 1;
336 char override : 1;
337 char maximized : 1;
338 char fullscreen : 1;
339 char withdrawn : 1;
340 char sticky : 1;
341 char request_pos : 1;
342 char draw_frame : 1;
343 char hwsurface : 1;
344 char urgent : 1;
345 char modal : 1;
346 char demand_attention : 1;
347 char focus_skip : 1;
348 } prop;
349
350 struct {
351 void (*fn_resize) (Ecore_Evas *ee);
352 void (*fn_move) (Ecore_Evas *ee);
353 void (*fn_show) (Ecore_Evas *ee);
354 void (*fn_hide) (Ecore_Evas *ee);
355 void (*fn_delete_request) (Ecore_Evas *ee);
356 void (*fn_destroy) (Ecore_Evas *ee);
357 void (*fn_focus_in) (Ecore_Evas *ee);
358 void (*fn_focus_out) (Ecore_Evas *ee);
359 void (*fn_sticky) (Ecore_Evas *ee);
360 void (*fn_unsticky) (Ecore_Evas *ee);
361 void (*fn_mouse_in) (Ecore_Evas *ee);
362 void (*fn_mouse_out) (Ecore_Evas *ee);
363 void (*fn_pre_render) (Ecore_Evas *ee);
364 void (*fn_post_render) (Ecore_Evas *ee);
365 void (*fn_pre_free) (Ecore_Evas *ee);
366 void (*fn_state_change) (Ecore_Evas *ee);
367 } func;
368
369 Ecore_Evas_Engine engine;
370 Eina_List *sub_ecore_evas;
371
372 int refcount;
373
374 unsigned char ignore_events : 1;
375 unsigned char manual_render : 1;
376 unsigned char registered : 1;
377 unsigned char no_comp_sync : 1;
378 unsigned char semi_sync : 1;
379 unsigned char deleted : 1;
380 int gl_sync_draw_done; // added by gl77.lee
381};
382
383void _ecore_evas_ref(Ecore_Evas *ee);
384void _ecore_evas_unref(Ecore_Evas *ee);
385
386#ifdef BUILD_ECORE_EVAS_X11
387int _ecore_evas_x_shutdown(void);
388#endif
389#ifdef BUILD_ECORE_EVAS_FB
390int _ecore_evas_fb_shutdown(void);
391#endif
392#ifdef BUILD_ECORE_EVAS_SOFTWARE_BUFFER
393int _ecore_evas_buffer_shutdown(void);
394int _ecore_evas_buffer_render(Ecore_Evas *ee);
395#endif
396#ifdef BUILD_ECORE_EVAS_DIRECTFB
397int _ecore_evas_directfb_shutdown(void);
398#endif
399#ifdef BUILD_ECORE_EVAS_WIN32
400int _ecore_evas_win32_shutdown(void);
401#endif
402#ifdef BUILD_ECORE_EVAS_EWS
403void _ecore_evas_ews_events_init(void);
404int _ecore_evas_ews_shutdown(void);
405#endif
406
407#if defined(BUILD_ECORE_EVAS_WAYLAND_SHM) || defined(BUILD_ECORE_EVAS_WAYLAND_EGL)
408int _ecore_evas_wl_common_init(void);
409int _ecore_evas_wl_common_shutdown(void);
410void _ecore_evas_wl_common_pre_free(Ecore_Evas *ee);
411void _ecore_evas_wl_common_free(Ecore_Evas *ee);
412void _ecore_evas_wl_common_callback_resize_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee));
413void _ecore_evas_wl_common_callback_move_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee));
414void _ecore_evas_wl_common_callback_delete_request_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee));
415void _ecore_evas_wl_common_callback_focus_in_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee));
416void _ecore_evas_wl_common_callback_focus_out_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee));
417void _ecore_evas_wl_common_callback_mouse_in_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee));
418void _ecore_evas_wl_common_callback_mouse_out_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee));
419void _ecore_evas_wl_common_move(Ecore_Evas *ee, int x, int y);
420void _ecore_evas_wl_common_raise(Ecore_Evas *ee);
421void _ecore_evas_wl_common_title_set(Ecore_Evas *ee, const char *title);
422void _ecore_evas_wl_common_name_class_set(Ecore_Evas *ee, const char *n, const char *c);
423void _ecore_evas_wl_common_size_min_set(Ecore_Evas *ee, int w, int h);
424void _ecore_evas_wl_common_size_max_set(Ecore_Evas *ee, int w, int h);
425void _ecore_evas_wl_common_size_base_set(Ecore_Evas *ee, int w, int h);
426void _ecore_evas_wl_common_size_step_set(Ecore_Evas *ee, int w, int h);
427void _ecore_evas_wl_common_object_cursor_set(Ecore_Evas *ee, Evas_Object *obj, int layer, int hot_x, int hot_y);
428void _ecore_evas_wl_common_layer_set(Ecore_Evas *ee, int layer);
429void _ecore_evas_wl_common_iconified_set(Ecore_Evas *ee, int iconify);
430void _ecore_evas_wl_common_maximized_set(Ecore_Evas *ee, int max);
431void _ecore_evas_wl_common_fullscreen_set(Ecore_Evas *ee, int full);
432void _ecore_evas_wl_common_ignore_events_set(Ecore_Evas *ee, int ignore);
433int _ecore_evas_wl_common_pre_render(Ecore_Evas *ee);
434int _ecore_evas_wl_common_render_updates(Ecore_Evas *ee);
435void _ecore_evas_wl_common_post_render(Ecore_Evas *ee);
436int _ecore_evas_wl_common_render(Ecore_Evas *ee);
437void _ecore_evas_wl_common_screen_geometry_get(const Ecore_Evas *ee, int *x, int *y, int *w, int *h);
438void _ecore_evas_wl_common_screen_dpi_get(const Ecore_Evas *ee, int *xdpi, int *ydpi);
439
440Evas_Object * _ecore_evas_wl_common_frame_add(Evas *evas);
441
442#ifdef BUILD_ECORE_EVAS_WAYLAND_SHM
443void _ecore_evas_wayland_shm_resize(Ecore_Evas *ee, int location);
444#endif
445
446#ifdef BUILD_ECORE_EVAS_WAYLAND_EGL
447void _ecore_evas_wayland_egl_resize(Ecore_Evas *ee, int location);
448#endif
449#endif
450
451void _ecore_evas_fps_debug_init(void);
452void _ecore_evas_fps_debug_shutdown(void);
453void _ecore_evas_fps_debug_rendertime_add(double t);
454void _ecore_evas_register(Ecore_Evas *ee);
455void _ecore_evas_free(Ecore_Evas *ee);
456void _ecore_evas_idle_timeout_update(Ecore_Evas *ee);
457void _ecore_evas_mouse_move_process(Ecore_Evas *ee, int x, int y, unsigned int timestamp);
458void _ecore_evas_mouse_multi_move_process(Ecore_Evas *ee, int device,
459 int x, int y,
460 double radius,
461 double radius_x, double radius_y,
462 double pressure,
463 double angle,
464 double mx, double my,
465 unsigned int timestamp);
466void _ecore_evas_mouse_multi_down_process(Ecore_Evas *ee, int device,
467 int x, int y,
468 double radius,
469 double radius_x, double radius_y,
470 double pressure,
471 double angle,
472 double mx, double my,
473 Evas_Button_Flags flags,
474 unsigned int timestamp);
475void _ecore_evas_mouse_multi_up_process(Ecore_Evas *ee, int device,
476 int x, int y,
477 double radius,
478 double radius_x, double radius_y,
479 double pressure,
480 double angle,
481 double mx, double my,
482 Evas_Button_Flags flags,
483 unsigned int timestamp);
484
485extern Eina_Bool _ecore_evas_app_comp_sync;
486
487void _ecore_evas_extn_init(void);
488void _ecore_evas_extn_shutdown(void);
489
490#endif