* ecore/ecore_pipe.c:
[framework/uifw/ecore.git] / src / lib / ecore_evas / Ecore_Evas.h
1 /*
2  * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
3  */
4
5 #ifndef _ECORE_EVAS_H
6 #define _ECORE_EVAS_H
7
8 #include <Evas.h>
9 #include <Ecore_Getopt.h>
10
11 #ifdef EAPI
12 # undef EAPI
13 #endif
14
15 #ifdef _WIN32
16 # ifdef EFL_ECORE_EVAS_BUILD
17 #  ifdef DLL_EXPORT
18 #   define EAPI __declspec(dllexport)
19 #  else
20 #   define EAPI
21 #  endif /* ! DLL_EXPORT */
22 # else
23 #  define EAPI __declspec(dllimport)
24 # endif /* ! EFL_ECORE_EVAS_BUILD */
25 #else
26 # ifdef __GNUC__
27 #  if __GNUC__ >= 4
28 #   define EAPI __attribute__ ((visibility("default")))
29 #  else
30 #   define EAPI
31 #  endif
32 # else
33 #  define EAPI
34 # endif
35 #endif /* ! _WIN32 */
36
37 /**
38  * @file Ecore_Evas.h
39  * @brief Evas wrapper functions
40  */
41
42 /* FIXME:
43  * to do soon:
44  * - iconfication api needs to work
45  * - maximization api needs to work
46  * - document all calls
47  *
48  * later:
49  * - buffer back-end that renders to an evas_image_object ???
50  * - qt back-end ???
51  * - dfb back-end ??? (dfb's threads make this REALLY HARD)
52  */
53
54 #ifdef __cplusplus
55 extern "C" {
56 #endif
57
58 /* these are dummy and just tell u what API levels ecore_evas supports - not if
59  * the actual support is compiled in. you need to query for that separately.
60  */
61 #define HAVE_ECORE_EVAS_X 1
62 #define HAVE_ECORE_EVAS_FB 1
63 #define HAVE_ECORE_EVAS_X11_GL 1
64 #define HAVE_ECORE_EVAS_X11_16 1
65 #define HAVE_ECORE_EVAS_DIRECTFB 1
66 #define HAVE_ECORE_EVAS_WIN32 1
67 #define HAVE_ECORE_EVAS_SDL 1
68 #define HAVE_ECORE_EVAS_WINCE 1
69
70 typedef enum _Ecore_Evas_Engine_Type
71 {
72    ECORE_EVAS_ENGINE_SOFTWARE_BUFFER,
73    ECORE_EVAS_ENGINE_SOFTWARE_X11,
74    ECORE_EVAS_ENGINE_XRENDER_X11,
75    ECORE_EVAS_ENGINE_OPENGL_X11,
76    ECORE_EVAS_ENGINE_SOFTWARE_XCB,
77    ECORE_EVAS_ENGINE_XRENDER_XCB,
78    ECORE_EVAS_ENGINE_SOFTWARE_DDRAW,
79    ECORE_EVAS_ENGINE_DIRECT3D,
80    ECORE_EVAS_ENGINE_OPENGL_GLEW,
81    ECORE_EVAS_ENGINE_SDL,
82    ECORE_EVAS_ENGINE_DIRECTFB,
83    ECORE_EVAS_ENGINE_SOFTWARE_FB,
84    ECORE_EVAS_ENGINE_SOFTWARE_16_X11,
85    ECORE_EVAS_ENGINE_SOFTWARE_16_DDRAW,
86    ECORE_EVAS_ENGINE_SOFTWARE_16_WINCE
87 } Ecore_Evas_Engine_Type;
88
89 typedef enum _Ecore_Evas_Avoid_Damage_Type
90 {
91    ECORE_EVAS_AVOID_DAMAGE_NONE = 0,
92    ECORE_EVAS_AVOID_DAMAGE_EXPOSE = 1,
93    ECORE_EVAS_AVOID_DAMAGE_BUILT_IN = 2
94 } Ecore_Evas_Avoid_Damage_Type;
95
96 typedef enum _Ecore_Evas_Object_Associate_Flags
97 {
98   ECORE_EVAS_OBJECT_ASSOCIATE_BASE  = 0,
99   ECORE_EVAS_OBJECT_ASSOCIATE_STACK = 1 << 0,
100   ECORE_EVAS_OBJECT_ASSOCIATE_LAYER = 1 << 1,
101   ECORE_EVAS_OBJECT_ASSOCIATE_DEL = 1 << 2
102 } Ecore_Evas_Object_Associate_Flags;
103
104 #ifndef _ECORE_X_H
105 #define _ECORE_X_WINDOW_PREDEF
106 typedef unsigned int Ecore_X_Window;
107 #endif
108
109 #ifndef _ECORE_DIRECTFB_H
110 #define _ECORE_DIRECTFB_WINDOW_PREDEF
111 typedef struct _Ecore_DirectFB_Window Ecore_DirectFB_Window;
112 #endif
113
114 #ifndef __ECORE_WIN32_H__
115 typedef void Ecore_Win32_Window;
116 #endif
117
118 #ifndef __ECORE_WINCE_H__
119 typedef void Ecore_WinCE_Window;
120 #endif
121
122 #ifndef _ECORE_EVAS_PRIVATE_H
123 /* basic data types */
124 typedef struct _Ecore_Evas Ecore_Evas;
125 #endif
126
127 /* module setup/shutdown calls */
128
129 EAPI int         ecore_evas_engine_type_supported_get(Ecore_Evas_Engine_Type engine);
130
131 EAPI int         ecore_evas_init(void);
132 EAPI int         ecore_evas_shutdown(void);
133
134 EAPI Eina_List  *ecore_evas_engines_get(void);
135 EAPI void        ecore_evas_engines_free(Eina_List *engines);
136 EAPI Ecore_Evas *ecore_evas_new(const char *engine_name, int x, int y, int w, int h, const char *extra_options);
137
138
139 /* engine/target specific init calls */
140 EAPI Ecore_Evas     *ecore_evas_software_x11_new(const char *disp_name, Ecore_X_Window parent, int x, int y, int w, int h);
141 EAPI Ecore_X_Window  ecore_evas_software_x11_window_get(const Ecore_Evas *ee);
142 EAPI Ecore_X_Window  ecore_evas_software_x11_subwindow_get(const Ecore_Evas *ee);
143 EAPI void            ecore_evas_software_x11_direct_resize_set(Ecore_Evas *ee, int on);
144 EAPI int             ecore_evas_software_x11_direct_resize_get(const Ecore_Evas *ee);
145 EAPI void            ecore_evas_software_x11_extra_event_window_add(Ecore_Evas *ee, Ecore_X_Window win);
146
147 EAPI Ecore_Evas     *ecore_evas_gl_x11_new(const char *disp_name, Ecore_X_Window parent, int x, int y, int w, int h);
148 EAPI Ecore_X_Window  ecore_evas_gl_x11_window_get(const Ecore_Evas *ee);
149 EAPI Ecore_X_Window  ecore_evas_gl_x11_subwindow_get(const Ecore_Evas *ee);
150 EAPI void            ecore_evas_gl_x11_direct_resize_set(Ecore_Evas *ee, int on);
151 EAPI int             ecore_evas_gl_x11_direct_resize_get(const Ecore_Evas *ee);
152 EAPI void            ecore_evas_gl_x11_extra_event_window_add(Ecore_Evas *ee, Ecore_X_Window win);
153
154 EAPI Ecore_Evas     *ecore_evas_xrender_x11_new(const char *disp_name, Ecore_X_Window parent, int x, int y, int w, int h);
155 EAPI Ecore_X_Window  ecore_evas_xrender_x11_window_get(const Ecore_Evas *ee);
156 EAPI Ecore_X_Window  ecore_evas_xrender_x11_subwindow_get(const Ecore_Evas *ee);
157 EAPI void            ecore_evas_xrender_x11_direct_resize_set(Ecore_Evas *ee, int on);
158 EAPI int             ecore_evas_xrender_x11_direct_resize_get(const Ecore_Evas *ee);
159 EAPI void            ecore_evas_xrender_x11_extra_event_window_add(Ecore_Evas *ee, Ecore_X_Window win);
160
161 EAPI Ecore_Evas     *ecore_evas_software_x11_16_new(const char *disp_name, Ecore_X_Window parent, int x, int y, int w, int h);
162 EAPI Ecore_X_Window  ecore_evas_software_x11_16_window_get(const Ecore_Evas *ee);
163 EAPI Ecore_X_Window  ecore_evas_software_x11_16_subwindow_get(const Ecore_Evas *ee);
164 EAPI void            ecore_evas_software_x11_16_direct_resize_set(Ecore_Evas *ee, int on);
165 EAPI int             ecore_evas_software_x11_16_direct_resize_get(const Ecore_Evas *ee);
166 EAPI void            ecore_evas_software_x11_16_extra_event_window_add(Ecore_Evas *ee, Ecore_X_Window win);
167
168 EAPI Ecore_Evas     *ecore_evas_fb_new(const char *disp_name, int rotation, int w, int h);
169
170 EAPI Ecore_Evas     *ecore_evas_directfb_new(const char *disp_name, int windowed, int x, int y, int w, int h);
171 EAPI Ecore_DirectFB_Window *ecore_evas_directfb_window_get(const Ecore_Evas *ee);
172
173 EAPI Ecore_Evas     *ecore_evas_buffer_new(int w, int h);
174 EAPI const void     *ecore_evas_buffer_pixels_get(Ecore_Evas *ee);
175
176 EAPI Evas_Object    *ecore_evas_object_image_new(Ecore_Evas *ee_target);
177
178 EAPI Ecore_Evas     *ecore_evas_software_ddraw_new(Ecore_Win32_Window *parent,
179                                                    int                 x,
180                                                    int                 y,
181                                                    int                 width,
182                                                    int                 height);
183
184 EAPI Ecore_Evas     *ecore_evas_software_ddraw_16_new(Ecore_Win32_Window *parent,
185                                                       int                 x,
186                                                       int                 y,
187                                                       int                 width,
188                                                       int                 height);
189
190 EAPI Ecore_Evas     *ecore_evas_direct3d_new(Ecore_Win32_Window *parent,
191                                              int                 x,
192                                              int                 y,
193                                              int                 width,
194                                              int                 height);
195
196 EAPI Ecore_Evas *ecore_evas_gl_glew_new(Ecore_Win32_Window *parent,
197                                         int                 x,
198                                         int                 y,
199                                         int                 width,
200                                         int                 height);
201
202 EAPI Ecore_Win32_Window *ecore_evas_win32_window_get(const Ecore_Evas *ee);
203
204 EAPI Ecore_Evas     *ecore_evas_sdl_new(const char* name, int w, int h, int fullscreen, int hwsurface, int noframe, int alpha);
205 EAPI Ecore_Evas     *ecore_evas_sdl16_new(const char* name, int w, int h, int fullscreen, int hwsurface, int noframe, int alpha);
206
207 EAPI Ecore_Evas     *ecore_evas_software_wince_new(Ecore_WinCE_Window *parent,
208                                                    int                 x,
209                                                    int                 y,
210                                                    int                 width,
211                                                    int                 height);
212
213 EAPI Ecore_Evas     *ecore_evas_software_wince_fb_new(Ecore_WinCE_Window *parent,
214                                                       int                 x,
215                                                       int                 y,
216                                                       int                 width,
217                                                       int                 height);
218
219 EAPI Ecore_Evas     *ecore_evas_software_wince_gapi_new(Ecore_WinCE_Window *parent,
220                                                         int                 x,
221                                                         int                 y,
222                                                         int                 width,
223                                                         int                 height);
224
225 EAPI Ecore_Evas     *ecore_evas_software_wince_ddraw_new(Ecore_WinCE_Window *parent,
226                                                          int                 x,
227                                                          int                 y,
228                                                          int                 width,
229                                                          int                 height);
230
231 EAPI Ecore_Evas     *ecore_evas_software_wince_gdi_new(Ecore_WinCE_Window *parent,
232                                                        int                 x,
233                                                        int                 y,
234                                                        int                 width,
235                                                        int                 height);
236
237 EAPI Ecore_WinCE_Window *ecore_evas_software_wince_window_get(const Ecore_Evas *ee);
238
239 /* generic manipulation calls */
240 EAPI const char *ecore_evas_engine_name_get(const Ecore_Evas *ee);
241 EAPI Ecore_Evas *ecore_evas_ecore_evas_get(const Evas *e);
242 EAPI void        ecore_evas_free(Ecore_Evas *ee);
243 EAPI void       *ecore_evas_data_get(const Ecore_Evas *ee, const char *key);
244 EAPI void        ecore_evas_data_set(Ecore_Evas *ee, const char *key, const void *data);
245 EAPI void        ecore_evas_callback_resize_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee));
246 EAPI void        ecore_evas_callback_move_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee));
247 EAPI void        ecore_evas_callback_show_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee));
248 EAPI void        ecore_evas_callback_hide_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee));
249 EAPI void        ecore_evas_callback_delete_request_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee));
250 EAPI void        ecore_evas_callback_destroy_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee));
251 EAPI void        ecore_evas_callback_focus_in_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee));
252 EAPI void        ecore_evas_callback_focus_out_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee));
253 EAPI void        ecore_evas_callback_sticky_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee));
254 EAPI void        ecore_evas_callback_unsticky_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee));
255 EAPI void        ecore_evas_callback_mouse_in_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee));
256 EAPI void        ecore_evas_callback_mouse_out_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee));
257 EAPI void        ecore_evas_callback_pre_render_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee));
258 EAPI void        ecore_evas_callback_post_render_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee));
259 EAPI void        ecore_evas_callback_pre_free_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee));
260 EAPI Evas       *ecore_evas_get(const Ecore_Evas *ee);
261 EAPI void        ecore_evas_move(Ecore_Evas *ee, int x, int y);
262 EAPI void        ecore_evas_managed_move(Ecore_Evas *ee, int x, int y);
263 EAPI void        ecore_evas_resize(Ecore_Evas *ee, int w, int h);
264 EAPI void        ecore_evas_move_resize(Ecore_Evas *ee, int x, int y, int w, int h);
265 EAPI void        ecore_evas_geometry_get(const Ecore_Evas *ee, int *x, int *y, int *w, int *h);
266 EAPI void        ecore_evas_rotation_set(Ecore_Evas *ee, int rot);
267 EAPI int         ecore_evas_rotation_get(const Ecore_Evas *ee);
268 EAPI void        ecore_evas_shaped_set(Ecore_Evas *ee, int shaped);
269 EAPI int         ecore_evas_shaped_get(const Ecore_Evas *ee);
270 EAPI void        ecore_evas_alpha_set(Ecore_Evas *ee, int alpha);
271 EAPI int         ecore_evas_alpha_get(const Ecore_Evas *ee);
272 EAPI void        ecore_evas_show(Ecore_Evas *ee);
273 EAPI void        ecore_evas_hide(Ecore_Evas *ee);
274 EAPI int         ecore_evas_visibility_get(const Ecore_Evas *ee);
275 EAPI void        ecore_evas_raise(Ecore_Evas *ee);
276 EAPI void        ecore_evas_lower(Ecore_Evas *ee);
277 EAPI void        ecore_evas_activate(Ecore_Evas *ee);
278 EAPI void        ecore_evas_title_set(Ecore_Evas *ee, const char *t);
279 EAPI const char *ecore_evas_title_get(const Ecore_Evas *ee);
280 EAPI void        ecore_evas_name_class_set(Ecore_Evas *ee, const char *n, const char *c);
281 EAPI void        ecore_evas_name_class_get(const Ecore_Evas *ee, const char **n, const char **c);
282 EAPI void        ecore_evas_size_min_set(Ecore_Evas *ee, int w, int h);
283 EAPI void        ecore_evas_size_min_get(const Ecore_Evas *ee, int *w, int *h);
284 EAPI void        ecore_evas_size_max_set(Ecore_Evas *ee, int w, int h);
285 EAPI void        ecore_evas_size_max_get(const Ecore_Evas *ee, int *w, int *h);
286 EAPI void        ecore_evas_size_base_set(Ecore_Evas *ee, int w, int h);
287 EAPI void        ecore_evas_size_base_get(const Ecore_Evas *ee, int *w, int *h);
288 EAPI void        ecore_evas_size_step_set(Ecore_Evas *ee, int w, int h);
289 EAPI void        ecore_evas_size_step_get(const Ecore_Evas *ee, int *w, int *h);
290 EAPI void        ecore_evas_cursor_set(Ecore_Evas *ee, const char *file, int layer, int hot_x, int hot_y);
291 EAPI void        ecore_evas_object_cursor_set(Ecore_Evas *ee, Evas_Object *obj, int layer, int hot_x, int hot_y);
292 EAPI void        ecore_evas_cursor_get(const Ecore_Evas *ee, Evas_Object **obj, int *layer, int *hot_x, int *hot_y);
293 EAPI void        ecore_evas_layer_set(Ecore_Evas *ee, int layer);
294 EAPI int         ecore_evas_layer_get(const Ecore_Evas *ee);
295 EAPI void        ecore_evas_focus_set(Ecore_Evas *ee, int on);
296 EAPI int         ecore_evas_focus_get(const Ecore_Evas *ee);
297 EAPI void        ecore_evas_iconified_set(Ecore_Evas *ee, int on);
298 EAPI int         ecore_evas_iconified_get(const Ecore_Evas *ee);
299 EAPI void        ecore_evas_borderless_set(Ecore_Evas *ee, int on);
300 EAPI int         ecore_evas_borderless_get(const Ecore_Evas *ee);
301 EAPI void        ecore_evas_override_set(Ecore_Evas *ee, int on);
302 EAPI int         ecore_evas_override_get(const Ecore_Evas *ee);
303 EAPI void        ecore_evas_maximized_set(Ecore_Evas *ee, int on);
304 EAPI int         ecore_evas_maximized_get(const Ecore_Evas *ee);
305 EAPI void        ecore_evas_fullscreen_set(Ecore_Evas *ee, int on);
306 EAPI int         ecore_evas_fullscreen_get(const Ecore_Evas *ee);
307 EAPI void        ecore_evas_avoid_damage_set(Ecore_Evas *ee, Ecore_Evas_Avoid_Damage_Type on);
308 EAPI Ecore_Evas_Avoid_Damage_Type ecore_evas_avoid_damage_get(const Ecore_Evas *ee);
309 EAPI void        ecore_evas_withdrawn_set(Ecore_Evas *ee, int withdrawn);
310 EAPI int         ecore_evas_withdrawn_get(const Ecore_Evas *ee);
311 EAPI void        ecore_evas_sticky_set(Ecore_Evas *ee, int sticky);
312 EAPI int         ecore_evas_sticky_get(const Ecore_Evas *ee);
313 EAPI void        ecore_evas_ignore_events_set(Ecore_Evas *ee, int ignore);
314 EAPI int         ecore_evas_ignore_events_get(const Ecore_Evas *ee);
315 EAPI void       *ecore_evas_window_get(const Ecore_Evas *ee);
316
317
318 EAPI int          ecore_evas_object_associate(Ecore_Evas *ee, Evas_Object *obj, Ecore_Evas_Object_Associate_Flags flags);
319 EAPI int          ecore_evas_object_dissociate(Ecore_Evas *ee, Evas_Object *obj);
320 EAPI Evas_Object *ecore_evas_object_associate_get(const Ecore_Evas *ee);
321
322 /* helper function to be used with ECORE_GETOPT_CALLBACK_*() */
323 EAPI unsigned char ecore_getopt_callback_ecore_evas_list_engines(const Ecore_Getopt *parser, const Ecore_Getopt_Desc *desc, const char *str, void *data, Ecore_Getopt_Value *storage);
324
325 #ifdef __cplusplus
326 }
327 #endif
328
329 #endif