summaryrefslogtreecommitdiff
path: root/src/lib/ecore_evas/ecore_evas_private.h
diff options
context:
space:
mode:
authorFlavio Vinicius Alvares Ceolin <flavio.ceolin@profusion.mobi>2012-12-05 21:15:42 +0000
committerFlavio Vinicius Alvares Ceolin <flavio.ceolin@profusion.mobi>2012-12-05 21:15:42 +0000
commitad7579c1294222d0647673499f062b137d30d270 (patch)
tree9c2c8e693ee3e74ff3d9a05ef69a0645a541533a /src/lib/ecore_evas/ecore_evas_private.h
parent8783eb70bbaea0a87f7fd4d41d6b062adecf5f67 (diff)
ecore_evas: Make the engines loadable modules
Implementing support for loadables modules. It makes the engines been loaded when they are needed. It not breakes the api, so each engine still has its own api. The implementation basically is: * Functions that creates Ecore_Evas, for example ecore_evas_software_x11_new, request to load its module and then get the module's function to create the Ecore_Evas. * The other functions such as \(.*\)_window_get from the Ecore_Evas its interface and then call the appropriate method. * As there is no unified interface to communicate with the engines (not break api problem), all interfaces were declared in ecore_evas_private.h * Now the data necessary for each module is not declared in the Ecore_Evas_Engine structure, instead of this, the struct has a void pointer that is used by the modules. * In this first moment engines as software_x11 and gl_x11 were put together in the same module, but obviously exporting all the things necessary. SVN revision: 80280
Diffstat (limited to 'src/lib/ecore_evas/ecore_evas_private.h')
-rw-r--r--src/lib/ecore_evas/ecore_evas_private.h300
1 files changed, 96 insertions, 204 deletions
diff --git a/src/lib/ecore_evas/ecore_evas_private.h b/src/lib/ecore_evas/ecore_evas_private.h
index d6cff8f023..7c3a203931 100644
--- a/src/lib/ecore_evas/ecore_evas_private.h
+++ b/src/lib/ecore_evas/ecore_evas_private.h
@@ -1,6 +1,8 @@
1#ifndef _ECORE_EVAS_PRIVATE_H 1#ifndef _ECORE_EVAS_PRIVATE_H
2#define _ECORE_EVAS_PRIVATE_H 2#define _ECORE_EVAS_PRIVATE_H
3 3
4#include "Ecore_Evas_Types.h"
5
4#include <Evas.h> 6#include <Evas.h>
5#include <Ecore.h> 7#include <Ecore.h>
6#include <ecore_private.h> 8#include <ecore_private.h>
@@ -9,67 +11,10 @@
9 11
10#define ECORE_MAGIC_EVAS 0x76543211 12#define ECORE_MAGIC_EVAS 0x76543211
11 13
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#if defined(BUILD_ECORE_EVAS_SOFTWARE_BUFFER) || defined(BUILD_ECORE_EVAS_EWS) 14#if defined(BUILD_ECORE_EVAS_SOFTWARE_BUFFER) || defined(BUILD_ECORE_EVAS_EWS)
37# include <Evas_Engine_Buffer.h> 15# include <Evas_Engine_Buffer.h>
38#endif 16#endif
39 17
40#ifdef BUILD_ECORE_EVAS_WIN32
41# include "Ecore_Win32.h"
42# ifdef BUILD_ECORE_EVAS_SOFTWARE_GDI
43# include <Evas_Engine_Software_Gdi.h>
44# endif
45# ifdef BUILD_ECORE_EVAS_SOFTWARE_DDRAW
46# include <Evas_Engine_Software_DDraw.h>
47# endif
48# ifdef BUILD_ECORE_EVAS_DIRECT3D
49# include <Evas_Engine_Direct3D.h>
50# endif
51# ifdef BUILD_ECORE_EVAS_OPENGL_GLEW
52# include <Evas_Engine_GL_Glew.h>
53# endif
54#endif
55
56#ifdef BUILD_ECORE_EVAS_GL_COCOA
57# include "Ecore_Cocoa.h"
58# include <Evas_Engine_Gl_Cocoa.h>
59#endif
60
61#if defined(BUILD_ECORE_EVAS_WAYLAND_SHM) || defined(BUILD_ECORE_EVAS_WAYLAND_EGL)
62# include "Ecore_Wayland.h"
63#endif
64
65#ifdef BUILD_ECORE_EVAS_WAYLAND_SHM
66# include <Evas_Engine_Wayland_Shm.h>
67#endif
68
69#ifdef BUILD_ECORE_EVAS_WAYLAND_EGL
70# include <Evas_Engine_Wayland_Egl.h>
71#endif
72
73/** Log domain macros and variables **/ 18/** Log domain macros and variables **/
74 19
75extern int _ecore_evas_log_dom; 20extern int _ecore_evas_log_dom;
@@ -109,6 +54,17 @@ typedef void (*Ecore_Evas_Event_Cb) (Ecore_Evas *ee);
109 54
110typedef struct _Ecore_Evas_Engine Ecore_Evas_Engine; 55typedef struct _Ecore_Evas_Engine Ecore_Evas_Engine;
111typedef struct _Ecore_Evas_Engine_Func Ecore_Evas_Engine_Func; 56typedef struct _Ecore_Evas_Engine_Func Ecore_Evas_Engine_Func;
57typedef struct _Ecore_Evas_Interface Ecore_Evas_Interface;
58
59/* Engines interfaces */
60typedef struct _Ecore_Evas_Interface_Buffer Ecore_Evas_Interface_Buffer;
61typedef struct _Ecore_Evas_Interface_Extn Ecore_Evas_Interface_Extn;
62typedef struct _Ecore_Evas_Interface_X11 Ecore_Evas_Interface_X11;
63typedef struct _Ecore_Evas_Interface_Software_X11 Ecore_Evas_Interface_Software_X11;
64typedef struct _Ecore_Evas_Interface_Gl_X11 Ecore_Evas_Interface_Gl_X11;
65typedef struct _Ecore_Evas_Interface_Wayland Ecore_Evas_Interface_Wayland;
66typedef struct _Ecore_Evas_Interface_Win32 Ecore_Evas_Interface_Win32;
67
112 68
113struct _Ecore_Evas_Engine_Func 69struct _Ecore_Evas_Engine_Func
114{ 70{
@@ -173,102 +129,89 @@ struct _Ecore_Evas_Engine_Func
173 void (*fn_screen_dpi_get) (const Ecore_Evas *ee, int *xdpi, int *ydpi); 129 void (*fn_screen_dpi_get) (const Ecore_Evas *ee, int *xdpi, int *ydpi);
174}; 130};
175 131
132struct _Ecore_Evas_Interface
133
134{
135 const char *name;
136 unsigned int version;
137};
138
139struct _Ecore_Evas_Interface_Buffer {
140 Ecore_Evas_Interface base;
141
142 const void* (*pixels_get)(Ecore_Evas *ee);
143 int (*render)(Ecore_Evas *ee);
144};
145
146struct _Ecore_Evas_Interface_X11 {
147 Ecore_Evas_Interface base;
148
149 void (*leader_set)(Ecore_Evas *ee, Ecore_X_Window win);
150 Ecore_X_Window (*leader_get)(Ecore_Evas *ee);
151 void (*leader_default_set)(Ecore_Evas *ee);
152 void (*shape_input_rectangle_set)(Ecore_Evas *ee, int x, int y, int w, int h);
153 void (*shape_input_rectangle_add)(Ecore_Evas *ee, int x, int y, int w, int h);
154 void (*shape_input_rectangle_subtract)(Ecore_Evas *ee, int x, int y, int w, int h);
155 void (*shape_input_empty)(Ecore_Evas *ee);
156 void (*shape_input_reset)(Ecore_Evas *ee);
157 void (*shape_input_apply)(Ecore_Evas *ee);
158};
159
160struct _Ecore_Evas_Interface_Software_X11 {
161 Ecore_Evas_Interface base;
162
163 Ecore_X_Window (*window_get)(const Ecore_Evas *ee);
164 void (*resize_set)(Ecore_Evas *ee, Eina_Bool on);
165 Eina_Bool (*resize_get)(const Ecore_Evas *ee);
166 void (*extra_event_window_add)(Ecore_Evas *ee, Ecore_X_Window win);
167};
168
169struct _Ecore_Evas_Interface_Gl_X11 {
170 Ecore_Evas_Interface base;
171
172 Ecore_X_Window (*window_get)(const Ecore_Evas *ee);
173 void (*resize_set)(Ecore_Evas *ee, Eina_Bool on);
174 Eina_Bool (*resize_get)(const Ecore_Evas *ee);
175 void (*extra_event_window_add)(Ecore_Evas *ee, Ecore_X_Window win);
176 void (*pre_post_swap_callback_set)(const Ecore_Evas *ee, void *data, void (*pre_cb) (void *data, Evas *e), void (*post_cb) (void *data, Evas *e));
177};
178
179struct _Ecore_Evas_Interface_Extn {
180 Ecore_Evas_Interface base;
181
182 void (*data_lock)(Ecore_Evas *ee);
183 void (*data_unlock)(Ecore_Evas *ee);
184 Eina_Bool (*connect)(Ecore_Evas *ee, const char *svcname, int svcnum, Eina_Bool svcsys);
185 Eina_Bool (*listen)(Ecore_Evas *ee, const char *svcname, int svcnum, Eina_Bool svcsys);
186};
187
188struct _Ecore_Evas_Interface_Wayland {
189 Ecore_Evas_Interface base;
190
191 void (*resize)(Ecore_Evas *ee, int location);
192 void (*move)(Ecore_Evas *ee, int x, int y);
193 void (*pointer_set)(Ecore_Evas *ee, int hot_x, int hot_y);
194 void (*type_set)(Ecore_Evas *ee, int type);
195 Ecore_Wl_Window* (*window_get)(const Ecore_Evas *ee);
196};
197
198struct _Ecore_Evas_Interface_Win32 {
199 Ecore_Evas_Interface base;
200
201 Ecore_Win32_Window* (*window_get)(const Ecore_Evas *ee);
202};
203
176struct _Ecore_Evas_Engine 204struct _Ecore_Evas_Engine
177{ 205{
178 Ecore_Evas_Engine_Func *func; 206 Ecore_Evas_Engine_Func *func;
179 207 void *data;
180/* TODO: UGLY! This should be an union or inheritance! */ 208 Eina_List *ifaces;
181#ifdef BUILD_ECORE_EVAS_X11 209 Ecore_Timer *idle_flush_timer;
182 struct
183 {
184 Ecore_X_Window win_root;
185 Eina_List *win_extra;
186 Ecore_X_Pixmap pmap;
187 Ecore_X_Pixmap mask;
188 Ecore_X_GC gc;
189 Ecore_X_XRegion *damages;
190 Ecore_X_Sync_Counter sync_counter;
191 Ecore_X_Window leader;
192 Ecore_X_Sync_Counter netwm_sync_counter;
193 int netwm_sync_val_hi;
194 unsigned int netwm_sync_val_lo;
195 int sync_val; // bigger! this will screw up at 2 billion frames (414 days of continual rendering @ 60fps)
196 int screen_num;
197 int px, py, pw, ph;
198 unsigned char direct_resize : 1;
199 unsigned char using_bg_pixmap : 1;
200 unsigned char managed : 1;
201 unsigned char sync_began : 1;
202 unsigned char sync_cancel : 1;
203 unsigned char netwm_sync_set : 1;
204 unsigned char configure_coming : 1;
205 struct {
206 unsigned char modal : 1;
207 unsigned char sticky : 1;
208 unsigned char maximized_v : 1;
209 unsigned char maximized_h : 1;
210 unsigned char shaded : 1;
211 unsigned char skip_taskbar : 1;
212 unsigned char skip_pager : 1;
213 unsigned char fullscreen : 1;
214 unsigned char above : 1;
215 unsigned char below : 1;
216 } state;
217 struct {
218 unsigned char available : 1; // need to setup available profiles in a window
219 unsigned char change : 1; // need to send change event to the WM
220 unsigned char done : 1; // need to send change done event to the WM
221 } profile;
222 Ecore_X_Window win_shaped_input;
223 } x;
224#endif
225#ifdef BUILD_ECORE_EVAS_FB
226 struct {
227 int real_w;
228 int real_h;
229 } fb;
230#endif
231#ifdef BUILD_ECORE_EVAS_SOFTWARE_BUFFER
232 struct {
233 void *pixels;
234 Evas_Object *image;
235 void (*free_func) (void *data, void *pix);
236 void *(*alloc_func) (void *data, int size);
237 void *data;
238 } buffer;
239#endif
240#ifdef BUILD_ECORE_EVAS_WIN32
241 struct {
242 Ecore_Win32_Window *parent;
243 struct {
244 unsigned char region : 1;
245 unsigned char fullscreen : 1;
246 } state;
247 } win32;
248#endif
249#ifdef BUILD_ECORE_EVAS_EWS 210#ifdef BUILD_ECORE_EVAS_EWS
250 struct { 211 struct {
251 Evas_Object *image; 212 Evas_Object *image;
252 } ews; 213 } ews;
253#endif 214#endif
254
255#if defined(BUILD_ECORE_EVAS_WAYLAND_SHM) || defined(BUILD_ECORE_EVAS_WAYLAND_EGL)
256 struct
257 {
258 Ecore_Wl_Window *parent, *win;
259 Evas_Object *frame;
260
261# if defined(BUILD_ECORE_EVAS_WAYLAND_SHM)
262 struct wl_shm_pool *pool;
263 size_t pool_size;
264 void *pool_data;
265 struct wl_buffer *buffer;
266# endif
267
268 } wl;
269#endif
270
271 Ecore_Timer *idle_flush_timer;
272}; 215};
273 216
274struct _Ecore_Evas 217struct _Ecore_Evas
@@ -383,69 +326,13 @@ struct _Ecore_Evas
383 326
384void _ecore_evas_ref(Ecore_Evas *ee); 327void _ecore_evas_ref(Ecore_Evas *ee);
385void _ecore_evas_unref(Ecore_Evas *ee); 328void _ecore_evas_unref(Ecore_Evas *ee);
329int ecore_evas_buffer_render(Ecore_Evas *ee);
386 330
387#ifdef BUILD_ECORE_EVAS_X11
388int _ecore_evas_x_shutdown(void);
389#endif
390#ifdef BUILD_ECORE_EVAS_FB
391int _ecore_evas_fb_shutdown(void);
392#endif
393#ifdef BUILD_ECORE_EVAS_SOFTWARE_BUFFER
394int _ecore_evas_buffer_shutdown(void);
395int _ecore_evas_buffer_render(Ecore_Evas *ee);
396#endif
397#ifdef BUILD_ECORE_EVAS_WIN32
398int _ecore_evas_win32_shutdown(void);
399#endif
400#ifdef BUILD_ECORE_EVAS_EWS 331#ifdef BUILD_ECORE_EVAS_EWS
401void _ecore_evas_ews_events_init(void); 332void _ecore_evas_ews_events_init(void);
402int _ecore_evas_ews_shutdown(void); 333int _ecore_evas_ews_shutdown(void);
403#endif 334#endif
404 335
405#if defined(BUILD_ECORE_EVAS_WAYLAND_SHM) || defined(BUILD_ECORE_EVAS_WAYLAND_EGL)
406int _ecore_evas_wl_common_init(void);
407int _ecore_evas_wl_common_shutdown(void);
408void _ecore_evas_wl_common_pre_free(Ecore_Evas *ee);
409void _ecore_evas_wl_common_free(Ecore_Evas *ee);
410void _ecore_evas_wl_common_callback_resize_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee));
411void _ecore_evas_wl_common_callback_move_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee));
412void _ecore_evas_wl_common_callback_delete_request_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee));
413void _ecore_evas_wl_common_callback_focus_in_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee));
414void _ecore_evas_wl_common_callback_focus_out_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee));
415void _ecore_evas_wl_common_callback_mouse_in_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee));
416void _ecore_evas_wl_common_callback_mouse_out_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee));
417void _ecore_evas_wl_common_move(Ecore_Evas *ee, int x, int y);
418void _ecore_evas_wl_common_raise(Ecore_Evas *ee);
419void _ecore_evas_wl_common_title_set(Ecore_Evas *ee, const char *title);
420void _ecore_evas_wl_common_name_class_set(Ecore_Evas *ee, const char *n, const char *c);
421void _ecore_evas_wl_common_size_min_set(Ecore_Evas *ee, int w, int h);
422void _ecore_evas_wl_common_size_max_set(Ecore_Evas *ee, int w, int h);
423void _ecore_evas_wl_common_size_base_set(Ecore_Evas *ee, int w, int h);
424void _ecore_evas_wl_common_size_step_set(Ecore_Evas *ee, int w, int h);
425void _ecore_evas_wl_common_object_cursor_set(Ecore_Evas *ee, Evas_Object *obj, int layer, int hot_x, int hot_y);
426void _ecore_evas_wl_common_layer_set(Ecore_Evas *ee, int layer);
427void _ecore_evas_wl_common_iconified_set(Ecore_Evas *ee, int iconify);
428void _ecore_evas_wl_common_maximized_set(Ecore_Evas *ee, int max);
429void _ecore_evas_wl_common_fullscreen_set(Ecore_Evas *ee, int full);
430void _ecore_evas_wl_common_ignore_events_set(Ecore_Evas *ee, int ignore);
431int _ecore_evas_wl_common_pre_render(Ecore_Evas *ee);
432int _ecore_evas_wl_common_render_updates(Ecore_Evas *ee);
433void _ecore_evas_wl_common_post_render(Ecore_Evas *ee);
434int _ecore_evas_wl_common_render(Ecore_Evas *ee);
435void _ecore_evas_wl_common_screen_geometry_get(const Ecore_Evas *ee, int *x, int *y, int *w, int *h);
436void _ecore_evas_wl_common_screen_dpi_get(const Ecore_Evas *ee, int *xdpi, int *ydpi);
437
438Evas_Object * _ecore_evas_wl_common_frame_add(Evas *evas);
439
440#ifdef BUILD_ECORE_EVAS_WAYLAND_SHM
441void _ecore_evas_wayland_shm_resize(Ecore_Evas *ee, int location);
442#endif
443
444#ifdef BUILD_ECORE_EVAS_WAYLAND_EGL
445void _ecore_evas_wayland_egl_resize(Ecore_Evas *ee, int location);
446#endif
447#endif
448
449void _ecore_evas_fps_debug_init(void); 336void _ecore_evas_fps_debug_init(void);
450void _ecore_evas_fps_debug_shutdown(void); 337void _ecore_evas_fps_debug_shutdown(void);
451void _ecore_evas_fps_debug_rendertime_add(double t); 338void _ecore_evas_fps_debug_rendertime_add(double t);
@@ -482,8 +369,12 @@ void _ecore_evas_mouse_multi_up_process(Ecore_Evas *ee, int device,
482 369
483extern Eina_Bool _ecore_evas_app_comp_sync; 370extern Eina_Bool _ecore_evas_app_comp_sync;
484 371
485void _ecore_evas_extn_init(void); 372
486void _ecore_evas_extn_shutdown(void); 373Eina_Module *_ecore_evas_engine_load(const char *engine);
374void _ecore_evas_engine_init();
375void _ecore_evas_engine_shutdown();
376
377Ecore_Evas_Interface *_ecore_evas_interface_get(const Ecore_Evas *ee, const char *iname);
487 378
488/** 379/**
489 * @brief Free the string of the window profile. 380 * @brief Free the string of the window profile.
@@ -500,3 +391,4 @@ void _ecore_evas_window_profile_free(Ecore_Evas *ee);
500void _ecore_evas_window_available_profiles_free(Ecore_Evas *ee); 391void _ecore_evas_window_available_profiles_free(Ecore_Evas *ee);
501 392
502#endif 393#endif
394