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