bf3a52c45f9d6de87f25fd0c6ff5381283a0de44
[profile/ivi/ecore.git] / src / lib / ecore_evas / Ecore_Evas.h
1 #ifndef _ECORE_EVAS_H
2 #define _ECORE_EVAS_H
3
4 #include <Evas.h>
5 #include <Ecore_Getopt.h>
6 #include <Ecore_Input.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  * The following is a list of example that partially exemplify Ecore_Evas's API:
39  * @li @ref ecore_evas_callbacks_example_c
40  * @li @ref ecore_evas_object_example_c
41  * @li @ref ecore_evas_basics_example_c
42  */
43
44 /* FIXME:
45  * to do soon:
46  * - iconfication api needs to work
47  * - maximization api needs to work
48  * - document all calls
49  *
50  * later:
51  * - buffer back-end that renders to an evas_image_object ???
52  * - qt back-end ???
53  * - dfb back-end ??? (dfb's threads make this REALLY HARD)
54  */
55
56 #ifdef __cplusplus
57 extern "C" {
58 #endif
59
60 /**
61  * @defgroup Ecore_Evas_Group Ecore_Evas wrapper/helper set of functions
62  *
63  * This is a list of examples of these functions:
64  * - @ref Ecore_Evas_Window_Sizes_Example_c
65  * - @ref Ecore_Evas_Buffer_Example_01_c
66  * - @ref Ecore_Evas_Buffer_Example_02_c
67  * @{
68  */
69
70 /* these are dummy and just tell u what API levels ecore_evas supports - not if
71  * the actual support is compiled in. you need to query for that separately.
72  */
73 #define HAVE_ECORE_EVAS_X 1
74 #define HAVE_ECORE_EVAS_FB 1
75 #define HAVE_ECORE_EVAS_X11_GL 1
76 #define HAVE_ECORE_EVAS_X11_16 1
77 #define HAVE_ECORE_EVAS_DIRECTFB 1
78 #define HAVE_ECORE_EVAS_WIN32 1
79 #define HAVE_ECORE_EVAS_COCOA 1
80 #define HAVE_ECORE_EVAS_SDL 1
81 #define HAVE_ECORE_EVAS_WINCE 1
82 #define HAVE_ECORE_EVAS_EWS 1
83
84 typedef enum _Ecore_Evas_Engine_Type
85 {
86    ECORE_EVAS_ENGINE_SOFTWARE_BUFFER,
87    ECORE_EVAS_ENGINE_SOFTWARE_XLIB,
88    ECORE_EVAS_ENGINE_XRENDER_X11,
89    ECORE_EVAS_ENGINE_OPENGL_X11,
90    ECORE_EVAS_ENGINE_SOFTWARE_XCB,
91    ECORE_EVAS_ENGINE_XRENDER_XCB,
92    ECORE_EVAS_ENGINE_SOFTWARE_GDI,
93    ECORE_EVAS_ENGINE_SOFTWARE_DDRAW,
94    ECORE_EVAS_ENGINE_DIRECT3D,
95    ECORE_EVAS_ENGINE_OPENGL_GLEW,
96    ECORE_EVAS_ENGINE_COCOA,
97    ECORE_EVAS_ENGINE_SOFTWARE_SDL,
98    ECORE_EVAS_ENGINE_DIRECTFB,
99    ECORE_EVAS_ENGINE_SOFTWARE_FB,
100    ECORE_EVAS_ENGINE_SOFTWARE_8_X11,
101    ECORE_EVAS_ENGINE_SOFTWARE_16_X11,
102    ECORE_EVAS_ENGINE_SOFTWARE_16_DDRAW,
103    ECORE_EVAS_ENGINE_SOFTWARE_16_WINCE,
104    ECORE_EVAS_ENGINE_OPENGL_SDL,
105    ECORE_EVAS_ENGINE_EWS
106 } Ecore_Evas_Engine_Type;
107
108 typedef enum _Ecore_Evas_Avoid_Damage_Type
109 {
110    ECORE_EVAS_AVOID_DAMAGE_NONE = 0,
111    ECORE_EVAS_AVOID_DAMAGE_EXPOSE = 1,
112    ECORE_EVAS_AVOID_DAMAGE_BUILT_IN = 2
113 } Ecore_Evas_Avoid_Damage_Type;
114
115 typedef enum _Ecore_Evas_Object_Associate_Flags
116 {
117   ECORE_EVAS_OBJECT_ASSOCIATE_BASE  = 0,
118   ECORE_EVAS_OBJECT_ASSOCIATE_STACK = 1 << 0,
119   ECORE_EVAS_OBJECT_ASSOCIATE_LAYER = 1 << 1,
120   ECORE_EVAS_OBJECT_ASSOCIATE_DEL = 1 << 2
121 } Ecore_Evas_Object_Associate_Flags;
122
123 #ifndef _ECORE_X_H
124 #define _ECORE_X_WINDOW_PREDEF
125 typedef unsigned int Ecore_X_Window;
126 #endif
127
128 #ifndef _ECORE_DIRECTFB_H
129 #define _ECORE_DIRECTFB_WINDOW_PREDEF
130 typedef struct _Ecore_DirectFB_Window Ecore_DirectFB_Window;
131 #endif
132
133 #ifndef __ECORE_WIN32_H__
134 typedef struct _Ecore_Win32_Window Ecore_Win32_Window;
135 #endif
136
137 #ifndef __ECORE_WINCE_H__
138 typedef struct _Ecore_WinCE_Window Ecore_WinCE_Window;
139 #endif
140
141 #ifndef _ECORE_EVAS_PRIVATE_H
142 /* basic data types */
143 typedef struct _Ecore_Evas Ecore_Evas;
144 #endif
145
146 /* module setup/shutdown calls */
147
148 EAPI int         ecore_evas_engine_type_supported_get(Ecore_Evas_Engine_Type engine);
149
150 /**
151  * @brief Init the Ecore_Evas system.
152  *
153  * @return How many times the lib has been initialized, 0 indicates failure.
154  *
155  * Set up the Evas wrapper system. Init Evas and Ecore libraries.
156  *
157  * @see ecore_evas_shutdown()
158  */
159 EAPI int         ecore_evas_init(void);
160 /**
161  * @brief Shut down the Ecore_Evas system.
162  *
163  * @return 0 if ecore evas is fully shut down, or > 0 if it still being used.
164  *
165  * This closes the Evas wrapper system down. Shut down Evas and Ecore libraries.
166  *
167  * @see ecore_evas_init()
168  */
169 EAPI int         ecore_evas_shutdown(void);
170
171 EAPI void        ecore_evas_app_comp_sync_set(Eina_Bool do_sync);
172 EAPI Eina_Bool   ecore_evas_app_comp_sync_get(void);
173
174 /**
175  * @brief Returns a list of supported engines names.
176  *
177  * @return Newly allocated list with engines names. Engines names
178  * strings are internal and should be considered constants, do not
179  * free or modify them, to free the list use ecore_evas_engines_free().
180  */
181 EAPI Eina_List  *ecore_evas_engines_get(void);
182 /**
183  * @brief Free list returned by ecore_evas_engines_get()
184  */
185 EAPI void        ecore_evas_engines_free(Eina_List *engines);
186 /**
187  * @brief Creates a new Ecore_Evas based on engine name and common parameters.
188  *
189  * @param engine_name engine name as returned by
190  *        ecore_evas_engines_get() or NULL to use environment variable
191  *        ECORE_EVAS_ENGINE, that can be undefined and in this case
192  *        this call will try to find the first working engine.
193  * @param x horizontal position of window (not supported in all engines)
194  * @param y vertical position of window (not supported in all engines)
195  * @param w width of window
196  * @param h height of window
197  * @param extra_options string with extra parameter, dependent on engines
198  *        or NULL. String is usually in the form: 'key1=value1;key2=value2'.
199  *        Pay attention that when getting that from shell commands, most
200  *        consider ';' as the command terminator, so you need to escape
201  *        it or use quotes.
202  *
203  * @return Ecore_Evas instance or NULL if creation failed.
204  */
205 EAPI Ecore_Evas *ecore_evas_new(const char *engine_name, int x, int y, int w, int h, const char *extra_options);
206 /**
207  * @brief Set whether an Ecore_Evas has an alpha channel or not.
208  *
209  * @param ee The Ecore_Evas to shape
210  * @param alpha EINA_TRUE to enable the alpha channel, EINA_FALSE to disable it
211  *
212  * This function allows you to make an Ecore_Evas translucent using an
213  * alpha channel. See ecore_evas_shaped_set() for details. The difference
214  * between a shaped window and a window with an alpha channel is that an
215  * alpha channel supports multiple levels of transpararency, as opposed to
216  * the 1 bit transparency of a shaped window (a pixel is either opaque, or
217  * it's transparent).
218  *
219  * @warning Support for this depends on the underlying windowing system.
220  */
221 EAPI void        ecore_evas_alpha_set(Ecore_Evas *ee, Eina_Bool alpha);
222 /**
223  * @brief Query whether an Ecore_Evas has an alpha channel.
224  * @param ee The Ecore_Evas to query.
225  * @return EINA_TRUE if ee has an alpha channel, EINA_FALSE if it does not.
226  *
227  * This function returns EINA_TRUE if @p ee has an alpha channel, and EINA_FALSE
228  * if it does not.
229  *
230  * @see ecore_evas_alpha_set()
231  */
232 EAPI Eina_Bool   ecore_evas_alpha_get(const Ecore_Evas *ee);
233 /**
234  * @brief Set whether an Ecore_Evas has an transparent window or not.
235  *
236  * @param ee The Ecore_Evas to shape
237  * @param transparent EINA_TRUE to enable the transparent window, EINA_FALSE to
238  * disable it
239  *
240  * This function sets some translucency options, for more complete support see
241  * ecore_evas_alpha_set().
242  *
243  * @warning Support for this depends on the underlying windowing system.
244  *
245  * @see ecore_evas_alpha_set()
246  */
247 EAPI void        ecore_evas_transparent_set(Ecore_Evas *ee, Eina_Bool transparent);
248 /**
249  * @brief  Query whether an Ecore_Evas is transparent.
250  *
251  * @param ee The Ecore_Evas to query.
252  * @return EINA_TRUE if ee is transparent, EINA_FALSE if it isn't.
253  *
254  * @see ecore_evas_transparent_set()
255  */
256 EAPI Eina_Bool   ecore_evas_transparent_get(const Ecore_Evas *ee);
257 /**
258  * @brief  Get the geometry of an Ecore_Evas.
259  *
260  * @param ee The Ecore_Evas whose geometry y
261  * @param x A pointer to an int to place the x coordinate in
262  * @param y A pointer to an int to place the y coordinate in
263  * @param w A pointer to an int to place the w size in
264  * @param h A pointer to an int to place the h size in
265  *
266  * This function takes four pointers to (already allocated) ints, and places
267  * the geometry of @p ee in them. If any of the parameters is not desired you
268  * may pass NULL on them.
269  *
270  * @code
271  * int x, y, w, h;
272  * ecore_evas_geometry_get(ee, &x, &y, &w, &h);
273  * @endcode
274  *
275  * @see ecore_evas_new()
276  * @see ecore_evas_resize()
277  * @see ecore_evas_move()
278  * @see ecore_evas_move_resize()
279  */
280 EAPI void        ecore_evas_geometry_get(const Ecore_Evas *ee, int *x, int *y, int *w, int *h);
281 /**
282  * @brief Set the focus of an Ecore_Evas' window.
283  *
284  * @param ee The Ecore_Evas
285  * @param on EINA_TRUE for focus, EINA_FALSE to defocus.
286  *
287  * This function focuses @p ee if @p on is EINA_TRUE, or unfocuses @p ee if @p
288  * on is EINA_FALSE.
289  *
290  * @warning Support for this depends on the underlying windowing system.
291  */
292 EAPI void        ecore_evas_focus_set(Ecore_Evas *ee, Eina_Bool on);
293 /**
294  * @brief Query whether an Ecore_Evas' window is focused or not.
295  *
296  * @param ee The Ecore_Evas to set
297  * @return EINA_TRUE if @p ee if focused, EINA_FALSE if not.
298  *
299  * @see ecore_evas_focus_set()
300  */
301 EAPI Eina_Bool   ecore_evas_focus_get(const Ecore_Evas *ee);
302 /**
303  * @brief Iconify or uniconify an Ecore_Evas' window.
304  *
305  * @param ee The Ecore_Evas
306  * @param on EINA_TRUE to iconify, EINA_FALSE to uniconify.
307  *
308  * This function iconifies @p ee if @p on is EINA_TRUE, or uniconifies @p ee if
309  * @p on is EINA_FALSE.
310  *
311  * @note Iconify and minize are synonims.
312  *
313  * @warning Support for this depends on the underlying windowing system.
314  */
315 EAPI void        ecore_evas_iconified_set(Ecore_Evas *ee, Eina_Bool on);
316 /**
317  * @brief Query whether an Ecore_Evas' window is iconified or not.
318  *
319  * @param ee The Ecore_Evas to set
320  * @return EINA_TRUE if @p ee is iconified, EINA_FALSE if not.
321  *
322  * @note Iconify and minize are synonims.
323  *
324  * @see ecore_evas_iconified_set()
325  */
326 EAPI Eina_Bool   ecore_evas_iconified_get(const Ecore_Evas *ee);
327 /**
328  * @brief Set whether an Ecore_Evas' window is borderless or not.
329  *
330  * @param ee The Ecore_Evas
331  * @param on EINA_TRUE for borderless, EINA_FALSE for bordered.
332  *
333  * This function makes @p ee borderless if @p on is EINA_TRUE, or bordered if @p
334  * on is EINA_FALSE.
335  *
336  * @warning Support for this depends on the underlying windowing system.
337  */
338 EAPI void        ecore_evas_borderless_set(Ecore_Evas *ee, Eina_Bool on);
339 /**
340  * @brief Query whether an Ecore_Evas' window is borderless or not.
341  *
342  * @param ee The Ecore_Evas to set
343  * @return EINA_TRUE if @p ee is borderless, EINA_FALSE if not.
344  *
345  * @see ecore_evas_borderless_set()
346  */
347 EAPI Eina_Bool   ecore_evas_borderless_get(const Ecore_Evas *ee);
348 /**
349  * @brief Set whether or not an Ecore_Evas' window is fullscreen.
350  *
351  * @param ee The Ecore_Evas
352  * @param on EINA_TRUE fullscreen, EINA_FALSE not.
353  *
354  * This function causes @p ee to be fullscreen if @p on is EINA_TRUE,
355  * or not if @p on is EINA_FALSE.
356  *
357  * @warning Support for this depends on the underlying windowing system.
358  */
359 EAPI void        ecore_evas_fullscreen_set(Ecore_Evas *ee, Eina_Bool on);
360 /**
361  * @brief Query whether an Ecore_Evas' window is fullscreen or not.
362  *
363  * @param ee The Ecore_Evas to set
364  * @return EINA_TRUE if @p ee is fullscreen, EINA_FALSE if not.
365  *
366  * @see ecore_evas_fullscreen_set()
367  */
368 EAPI Eina_Bool   ecore_evas_fullscreen_get(const Ecore_Evas *ee);
369 /**
370  * @brief Set if this evas should ignore @b all events.
371  *
372  * @param ee The Ecore_Evas whose window's to ignore events.
373  * @param ignore The Ecore_Evas new ignore state.
374  *
375  * @warning Support for this depends on the underlying windowing system.
376  */
377 EAPI void        ecore_evas_ignore_events_set(Ecore_Evas *ee, Eina_Bool ignore);
378 /**
379  * @brief Returns the ignore state of an Ecore_Evas' window.
380  *
381  * @param ee The Ecore_Evas whose window's ignore events state is returned.
382  * @return The Ecore_Evas window's ignore state.
383  *
384  * @see ecore_evas_ignore_events_set()
385  */
386 EAPI Eina_Bool   ecore_evas_ignore_events_get(const Ecore_Evas *ee);
387 /**
388  * @brief Query whether an Ecore_Evas' window is visible or not.
389  *
390  * @param ee The Ecore_Evas to query.
391  * @return 1 if visible, 0 if not.
392  *
393  * This function queries @p ee and returns 1 if it is visible, and 0 if not.
394  *
395  * @see ecore_evas_show()
396  * @see ecore_evas_hide()
397  */
398 EAPI int         ecore_evas_visibility_get(const Ecore_Evas *ee);
399 /**
400  * @brief Set the layer of an Ecore_Evas' window.
401  *
402  * @param ee The Ecore_Evas
403  * @param layer The layer to put @p ee on.
404  *
405  * This function moves @p ee to the layer @p layer.
406  *
407  * @warning Support for this depends on the underlying windowing system.
408  *
409  * @see ecore_evas_lower()
410  * @see ecore_evas_raise()
411  */
412 EAPI void        ecore_evas_layer_set(Ecore_Evas *ee, int layer);
413 /**
414  * @brief Get the layer of an Ecore_Evas' window.
415  *
416  * @param ee The Ecore_Evas to set
417  * @return the layer @p ee's window is on.
418  *
419  * @see ecore_evas_layer_set()
420  * @see ecore_evas_lower()
421  * @see ecore_evas_raise()
422  */
423 EAPI int         ecore_evas_layer_get(const Ecore_Evas *ee);
424 /**
425  * @brief Maximize (or unmaximize) an Ecore_Evas' window.
426  *
427  * @param ee The Ecore_Evas
428  * @param on EINA_TRUE to maximize, EINA_FALSE to unmaximize.
429  *
430  * This function maximizes @p ee if @p on is EINA_TRUE, or unmaximizes @p ee
431  * if @p on is EINA_FALSE.
432  *
433  * @warning Support for this depends on the underlying windowing system.
434  */
435 EAPI void        ecore_evas_maximized_set(Ecore_Evas *ee, Eina_Bool on);
436 /**
437  * @brief Query whether an Ecore_Evas' window is maximized or not.
438  *
439  * @param ee The Ecore_Evas to set
440  * @return EINA_TRUE if @p ee is maximized, EINA_FALSE if not.
441  *
442  * @see ecore_evas_maximized_set()
443  */
444 EAPI Eina_Bool   ecore_evas_maximized_get(const Ecore_Evas *ee);
445 /**
446  * @brief Move an Ecore_Evas.
447  *
448  * @param ee The Ecore_Evas to move
449  * @param x The x coordinate to move to
450  * @param y The y coordinate to move to
451  *
452  * This moves @p ee to the screen coordinates (@p x, @p y)
453  *
454  * @warning Support for this depends on the underlying windowing system.
455  *
456  * @see ecore_evas_new()
457  * @see ecore_evas_resize()
458  * @see ecore_evas_move_resize()
459  */
460 EAPI void        ecore_evas_move(Ecore_Evas *ee, int x, int y);
461 /**
462  * @brief Resize an Ecore_Evas.
463  *
464  * @param ee The Ecore_Evas to move
465  * @param w The w coordinate to resize to
466  * @param h The h coordinate to resize to
467  *
468  * This resizes @p ee to @p w x @p h.
469  *
470  * @warning Support for this depends on the underlying windowing system.
471  *
472  * @see ecore_evas_new()
473  * @see ecore_evas_move()
474  * @see ecore_evas_move_resize()
475  */
476 EAPI void        ecore_evas_resize(Ecore_Evas *ee, int w, int h);
477 /**
478  * @brief Move and resize an Ecore_Evas
479  *
480  * @param ee The Ecore_Evas to move and resize
481  * @param x The x coordinate to move to
482  * @param y The y coordinate to move to
483  * @param w The w coordinate to resize to
484  * @param h The h coordinate to resize to
485  *
486  * This moves @p ee to the screen coordinates (@p x, @p y) and  resizes
487  * it to @p w x @p h.
488  *
489  * @warning Support for this depends on the underlying windowing system.
490  *
491  * @see ecore_evas_new()
492  * @see ecore_evas_move()
493  * @see ecore_evas_resize()
494  */
495 EAPI void        ecore_evas_move_resize(Ecore_Evas *ee, int x, int y, int w, int h);
496 /**
497  * @brief Set the rotation of an Ecore_Evas' window.
498  *
499  * @param ee The Ecore_Evas
500  * @param rot the angle (in degrees) of rotation.
501  *
502  * The allowed values of @p rot depend on the engine being used. Most only
503  * allow multiples of 90.
504  *
505  * @warning Support for this depends on the underlying windowing system.
506  *
507  * @see ecore_evas_rotation_with_resize_set()
508  */
509 EAPI void        ecore_evas_rotation_set(Ecore_Evas *ee, int rot);
510 /**
511  * @brief Set the rotation of an Ecore_Evas' window
512  *
513  * @param ee The Ecore_Evas
514  * @param rot the angle (in degrees) of rotation.
515  *
516  * Like ecore_evas_rotation_set(), but it also resizes the window's contents so
517  * that they fit inside the current window geometry.
518  *
519  * @warning Support for this depends on the underlying windowing system.
520  *
521  * @see ecore_evas_rotation_set()
522  */
523 EAPI void        ecore_evas_rotation_with_resize_set(Ecore_Evas *ee, int rot);
524 /**
525  * @brief Get the rotation of an Ecore_Evas' window
526  *
527  * @param ee The Ecore_Evas
528  * @return the angle (in degrees) of rotation.
529  *
530  * @see ecore_evas_rotation_set()
531  * @see ecore_evas_rotation_with_resize_set()
532  */
533 EAPI int         ecore_evas_rotation_get(const Ecore_Evas *ee);
534 /**
535  * @brief Raise an Ecore_Evas' window.
536  *
537  * @param ee The Ecore_Evas to raise.
538  *
539  * This functions raises the Ecore_Evas to the front.
540  *
541  * @warning Support for this depends on the underlying windowing system.
542  *
543  * @see ecore_evas_lower()
544  * @see ecore_evas_layer_set()
545  */
546 EAPI void        ecore_evas_raise(Ecore_Evas *ee);
547 /**
548  * @brief Lower an Ecore_Evas' window.
549  *
550  * @param ee The Ecore_Evas to raise.
551  *
552  * This functions lowers the Ecore_Evas to the back.
553  *
554  * @warning Support for this depends on the underlying windowing system.
555  *
556  * @see ecore_evas_raise()
557  * @see ecore_evas_layer_set()
558  */
559 EAPI void        ecore_evas_lower(Ecore_Evas *ee);
560 /**
561  * @brief Set the title of an Ecore_Evas' window.
562  *
563  * @param ee The Ecore_Evas whose title you wish to set.
564  * @param t The title
565  *
566  * This function sets the title of @p ee to @p t.
567  *
568  * @warning Support for this depends on the underlying windowing system.
569  */
570 EAPI void        ecore_evas_title_set(Ecore_Evas *ee, const char *t);
571 /**
572  * @brief Get the title of an Ecore_Evas' window.
573  *
574  * @param ee The Ecore_Evas whose title you wish to get.
575  * @return The title of @p ee.
576  *
577  * This function returns the title of @p ee.
578  *
579  * @see ecore_evas_title_set()
580  */
581 EAPI const char *ecore_evas_title_get(const Ecore_Evas *ee);
582 /**
583  * @brief Set the name and class of an Ecore_Evas' window.
584  *
585  * @param ee the Ecore_Evas
586  * @param n the name
587  * @param c the class
588  *
589  * This function sets the name of @p ee to @p n, and its class to @p c. The
590  * meaning of @p name and @p class depends on the underlying windowing system.
591  *
592  * @warning Support for this depends on the underlying windowing system.
593  */
594 EAPI void        ecore_evas_name_class_set(Ecore_Evas *ee, const char *n, const char *c);
595 /**
596  * @brief Get the name and class of an Ecore_Evas' window
597  *
598  * @p ee The Ecore_Evas to query
599  * @p n A pointer to a string to place the name in.
600  * @p c A pointer to a string to place the class in.
601  *
602  * This function gets the name of @p ee into @p n, and its class into
603  * @p c.
604  *
605  * @see ecore_evas_name_class_set()
606  */
607 EAPI void        ecore_evas_name_class_get(const Ecore_Evas *ee, const char **n, const char **c);
608 /**
609  * @brief Returns a pointer to the underlying window.
610  *
611  * @param ee The Ecore_Evas whose window is desired.
612  *
613  * @warning Support for this depends on the underlying windowing system.
614  */
615 EAPI Ecore_Window ecore_evas_window_get(const Ecore_Evas *ee);
616
617
618 /* engine/target specific init calls */
619 EAPI Ecore_Evas     *ecore_evas_software_x11_new(const char *disp_name, Ecore_X_Window parent, int x, int y, int w, int h);
620 EAPI Ecore_X_Window  ecore_evas_software_x11_window_get(const Ecore_Evas *ee);
621 EAPI void            ecore_evas_software_x11_direct_resize_set(Ecore_Evas *ee, Eina_Bool on);
622 EAPI Eina_Bool       ecore_evas_software_x11_direct_resize_get(const Ecore_Evas *ee);
623 EAPI void            ecore_evas_software_x11_extra_event_window_add(Ecore_Evas *ee, Ecore_X_Window win);
624
625 #define ECORE_EVAS_GL_X11_OPT_NONE     0
626 #define ECORE_EVAS_GL_X11_OPT_INDIRECT 1
627 #define ECORE_EVAS_GL_X11_OPT_VSYNC    2
628 #define ECORE_EVAS_GL_X11_OPT_LAST     3
629
630 EAPI Ecore_Evas     *ecore_evas_gl_x11_new(const char *disp_name, Ecore_X_Window parent, int x, int y, int w, int h);
631 EAPI Ecore_Evas     *ecore_evas_gl_x11_options_new(const char *disp_name, Ecore_X_Window parent, int x, int y, int w, int h, const int *opt);
632 EAPI Ecore_X_Window  ecore_evas_gl_x11_window_get(const Ecore_Evas *ee);
633 EAPI void            ecore_evas_gl_x11_direct_resize_set(Ecore_Evas *ee, Eina_Bool on);
634 EAPI Eina_Bool       ecore_evas_gl_x11_direct_resize_get(const Ecore_Evas *ee);
635 EAPI void            ecore_evas_gl_x11_extra_event_window_add(Ecore_Evas *ee, Ecore_X_Window win);
636 EAPI void            ecore_evas_gl_x11_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));
637
638 EAPI Ecore_Evas     *ecore_evas_xrender_x11_new(const char *disp_name, Ecore_X_Window parent, int x, int y, int w, int h);
639 EAPI Ecore_X_Window  ecore_evas_xrender_x11_window_get(const Ecore_Evas *ee);
640 EAPI void            ecore_evas_xrender_x11_direct_resize_set(Ecore_Evas *ee, Eina_Bool on);
641 EAPI Eina_Bool       ecore_evas_xrender_x11_direct_resize_get(const Ecore_Evas *ee);
642 EAPI void            ecore_evas_xrender_x11_extra_event_window_add(Ecore_Evas *ee, Ecore_X_Window win);
643
644 EAPI Ecore_Evas     *ecore_evas_software_x11_8_new(const char *disp_name, Ecore_X_Window parent, int x, int y, int w, int h);
645 EAPI Ecore_X_Window  ecore_evas_software_x11_8_window_get(const Ecore_Evas *ee);
646 EAPI Ecore_X_Window  ecore_evas_software_x11_8_subwindow_get(const Ecore_Evas *ee);
647 EAPI void            ecore_evas_software_x11_8_direct_resize_set(Ecore_Evas *ee, Eina_Bool on);
648 EAPI Eina_Bool       ecore_evas_software_x11_8_direct_resize_get(const Ecore_Evas *ee);
649 EAPI void            ecore_evas_software_x11_8_extra_event_window_add(Ecore_Evas *ee, Ecore_X_Window win);
650
651 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);
652 EAPI Ecore_X_Window  ecore_evas_software_x11_16_window_get(const Ecore_Evas *ee);
653 EAPI void            ecore_evas_software_x11_16_direct_resize_set(Ecore_Evas *ee, Eina_Bool on);
654 EAPI Eina_Bool       ecore_evas_software_x11_16_direct_resize_get(const Ecore_Evas *ee);
655 EAPI void            ecore_evas_software_x11_16_extra_event_window_add(Ecore_Evas *ee, Ecore_X_Window win);
656
657 EAPI Ecore_Evas     *ecore_evas_fb_new(const char *disp_name, int rotation, int w, int h);
658
659 EAPI Ecore_Evas     *ecore_evas_directfb_new(const char *disp_name, int windowed, int x, int y, int w, int h);
660 EAPI Ecore_DirectFB_Window *ecore_evas_directfb_window_get(const Ecore_Evas *ee);
661
662 /**
663  * @brief Create a new @c Ecore_Evas canvas bound to the Evas
664  * @b buffer engine
665  *
666  * @param w The width of the canvas, in pixels
667  * @param h The height of the canvas, in pixels
668  * @return A new @c Ecore_Evas instance or @c NULL, on failure
669  *
670  * This creates a new buffer canvas wrapper, with image data array
671  * @b bound to the ARGB format, 8 bits per pixel.
672  *
673  * This function will allocate the needed pixels array with canonical
674  * @c malloc(). If you wish a custom function to allocate it, consider
675  * using ecore_evas_buffer_allocfunc_new(), instead.
676  *
677  * @note This function actually is a wrapper on
678  * ecore_evas_buffer_allocfunc_new(), using the same @a w and @a h
679  * arguments and canonical @c malloc() and @c free() to the memory
680  * allocation and freeing functions. See that function's documentation
681  * for more details.
682  */
683 EAPI Ecore_Evas     *ecore_evas_buffer_new(int w, int h);
684
685 /**
686  * @brief Create a new @c Ecore_Evas canvas bound to the Evas
687  * @b buffer engine, giving custom allocation and freeing functions for
688  * the canvas memory region
689  *
690  * @param w The width of the canvas, in canvas units
691  * @param h The height of the canvas, in canvas units
692  * @param alloc_func Function to be called to allocate the memory
693  * needed for the new buffer canvas. @a data will be passed the same
694  * value as the @p data of this function, while @a size will be passed
695  * @p w times @p h times @c sizeof(int).
696  * @param free_func Function to be called to free the memory used by
697  * the new buffer canvas. @a data will be passed the same value as the
698  * @p data of this function, while @a pix will be passed the canvas
699  * memory pointer.
700  * @param data Custom data to be passed to the allocation and freeing
701  * functions
702  * @return A new @c Ecore_Evas instance or @c NULL, on failure
703  *
704  * This creates a new buffer canvas wrapper, with image data array
705  * @b bound to the ARGB format, 8 bits per pixel.
706  *
707  * This function is useful when one wants an @c Ecore_Evas buffer
708  * canvas with a custom allocation function, like one getting memory
709  * chunks from a memory pool, for example.
710  *
711  * On any resizing of this @c Ecore_Evas buffer canvas, its image data
712  * will be @b freed, to be allocated again with the new size.
713  *
714  * @note @p w and @p h sizes have to greater or equal to 1. Otherwise,
715  * they'll be interpreted as 1, exactly.
716  *
717  * @see ecore_evas_buffer_new()
718  */
719 EAPI Ecore_Evas     *ecore_evas_buffer_allocfunc_new(int w, int h, void *(*alloc_func) (void *data, int size), void (*free_func) (void *data, void *pix), const void *data);
720
721 /**
722  * @brief Grab a pointer to the actual pixels array of a given
723  * @c Ecore_Evas @b buffer canvas/window.
724  *
725  * @param ee An @c Ecore_Evas handle
726  * @return A pointer to the internal pixels array of @p ee
727  *
728  * Besides returning a pointer to the actual pixel array of the given
729  * canvas, this call will force a <b>rendering update on @p ee</b>,
730  * first.
731  *
732  * A common use case for this call is to create an image object, from
733  * @b another canvas, to have as data @p ee's contents, thus
734  * snapshoting the canvas. For that case, one can also use the
735  * ecore_evas_object_image_new() helper function.
736  */
737 EAPI const void     *ecore_evas_buffer_pixels_get(Ecore_Evas *ee);
738
739 /**
740  * @brief Create a new @c Ecore_Evas canvas bound to the Evas
741  * @b ews (Ecore + Evas Single Process Windowing System) engine
742  *
743  * EWS is a simple single process windowing system. The backing store
744  * is also an @c Ecore_Evas that can be setup with
745  * ecore_evas_ews_setup() and retrieved with
746  * ecore_evas_ews_ecore_evas_get(). It will allow window management
747  * using events prefixed with @c ECORE_EVAS_EVENT_EWS_.
748  *
749  * The EWS windows (returned by this function or
750  * ecore_evas_new("ews"...)) will all be software buffer windows
751  * automatic rendered to the backing store.
752  *
753  * @param x horizontal position of window, in pixels
754  * @param y vertical position of window, in pixels
755  * @param w The width of the canvas, in pixels
756  * @param h The height of the canvas, in pixels
757  * @return A new @c Ecore_Evas instance or @c NULL, on failure
758  *
759  * @see ecore_evas_ews_setup()
760  * @see ecore_evas_ews_ecore_evas_get()
761  *
762  * @since 1.1
763  */
764 EAPI Ecore_Evas     *ecore_evas_ews_new(int x, int y, int w, int h);
765
766
767 /**
768  * Returns the backing store image object that represents the given
769  * window in EWS.
770  *
771  * @note This should not be modified anyhow, but may be helpful to
772  *       determine stacking and geometry of it for window managers
773  *       that decorate windows.
774  *
775  * @see ecore_evas_ews_manager_set()
776  * @see ecore_evas_ews_evas_get()
777  * @since 1.1
778  */
779 EAPI Evas_Object *ecore_evas_ews_backing_store_get(const Ecore_Evas *ee);
780
781 /**
782  * Calls the window to be deleted (freed), but can let user decide to
783  * forbid it by using ecore_evas_callback_delete_request_set()
784  *
785  * @since 1.1
786  */
787 EAPI void ecore_evas_ews_delete_request(Ecore_Evas *ee);
788
789 /**
790  * @brief Create an Evas image object with image data <b>bound to an
791  * own, internal @c Ecore_Evas canvas wrapper<b>
792  *
793  * @param ee_target @c Ecore_Evas to have the canvas receiving the new
794  * image object
795  * @return A handle to the new image object
796  *
797  * This will create a @b special Evas image object. The image's pixel
798  * array will get bound to the same image data array of an @b internal
799  * @b buffer @c Ecore_Evas canvas. The user of this function is, then,
800  * supposed to grab that @c Ecore_Evas handle, with
801  * ecore_evas_object_ecore_evas_get(), and use its canvas to render
802  * whichever contents he/she wants, @b independently of the contents
803  * of the canvas owned by @p ee_target. Those contents will reflect on
804  * the canvas of @p ee, though, being exactly the image data of the
805  * object returned by this function.
806  *
807  * This is a helper function for the scenario of one wanting to grab a
808  * buffer canvas' contents (with ecore_evas_buffer_pixels_get()) to be
809  * used on another canvas, for whichever reason. The most common goal
810  * of this setup is to @b save an image file with a whole canvas as
811  * contents, which could not be achieved by using an image file within
812  * the target canvas.
813  *
814  * @warning Always resize the returned image and its underlying
815  * @c Ecore_Evas handle accordingly. They must be kept with same sizes
816  * for things to work as expected. Also, you @b must issue
817  * @c evas_object_image_size_set() on the image with that same size. If
818  * the image is to be shown in a canvas bound to an engine different
819  * than the buffer one, then you must also set this image's @b fill
820  * properties accordingly.
821  *
822  * @note The image returned will always be bound to the
823  * @c EVAS_COLORSPACE_ARGB8888 colorspace, always.
824  *
825  * @note Use ecore_evas_object_evas_get() to grab the image's internal
826  * own canvas directly.
827  *
828  * @note If snapshoting this image's internal canvas, remember to
829  * flush its internal @c Ecore_Evas firstly, with
830  * ecore_evas_manual_render().
831  */
832 EAPI Evas_Object    *ecore_evas_object_image_new(Ecore_Evas *ee_target);
833
834 /**
835  * @brief Retrieve the internal @c Ecore_Evas handle of an image
836  * object created via ecore_evas_object_image_new()
837  *
838  * @param obj A handle to an image object created via
839  * ecore_evas_object_image_new()
840  * @return The underlying @c Ecore_Evas handle in @p obj
841  */
842 EAPI Ecore_Evas     *ecore_evas_object_ecore_evas_get(Evas_Object *obj);
843
844 /**
845  * @brief Retrieve the canvas bound to the internal @c Ecore_Evas
846  * handle of an image object created via ecore_evas_object_image_new()
847  *
848  * @param obj A handle to an image object created via
849  * ecore_evas_object_image_new()
850  * @return A handle to @p obj's underlying @c Ecore_Evas's canvas
851  */
852 EAPI Evas           *ecore_evas_object_evas_get(Evas_Object *obj);
853
854 EAPI Ecore_Evas     *ecore_evas_software_gdi_new(Ecore_Win32_Window *parent,
855                                                  int                 x,
856                                                  int                 y,
857                                                  int                 width,
858                                                  int                 height);
859
860 EAPI Ecore_Evas     *ecore_evas_software_ddraw_new(Ecore_Win32_Window *parent,
861                                                    int                 x,
862                                                    int                 y,
863                                                    int                 width,
864                                                    int                 height);
865
866 EAPI Ecore_Evas     *ecore_evas_software_16_ddraw_new(Ecore_Win32_Window *parent,
867                                                       int                 x,
868                                                       int                 y,
869                                                       int                 width,
870                                                       int                 height);
871
872 EAPI Ecore_Evas     *ecore_evas_direct3d_new(Ecore_Win32_Window *parent,
873                                              int                 x,
874                                              int                 y,
875                                              int                 width,
876                                              int                 height);
877
878 EAPI Ecore_Evas *ecore_evas_gl_glew_new(Ecore_Win32_Window *parent,
879                                         int                 x,
880                                         int                 y,
881                                         int                 width,
882                                         int                 height);
883
884 EAPI Ecore_Win32_Window *ecore_evas_win32_window_get(const Ecore_Evas *ee);
885
886 EAPI Ecore_Evas     *ecore_evas_sdl_new(const char* name, int w, int h, int fullscreen, int hwsurface, int noframe, int alpha);
887 EAPI Ecore_Evas     *ecore_evas_sdl16_new(const char* name, int w, int h, int fullscreen, int hwsurface, int noframe, int alpha);
888 EAPI Ecore_Evas     *ecore_evas_gl_sdl_new(const char* name, int w, int h, int fullscreen, int noframe);
889
890 EAPI Ecore_Evas     *ecore_evas_software_wince_new(Ecore_WinCE_Window *parent,
891                                                    int                 x,
892                                                    int                 y,
893                                                    int                 width,
894                                                    int                 height);
895
896 EAPI Ecore_Evas     *ecore_evas_software_wince_fb_new(Ecore_WinCE_Window *parent,
897                                                       int                 x,
898                                                       int                 y,
899                                                       int                 width,
900                                                       int                 height);
901
902 EAPI Ecore_Evas     *ecore_evas_software_wince_gapi_new(Ecore_WinCE_Window *parent,
903                                                         int                 x,
904                                                         int                 y,
905                                                         int                 width,
906                                                         int                 height);
907
908 EAPI Ecore_Evas     *ecore_evas_software_wince_ddraw_new(Ecore_WinCE_Window *parent,
909                                                          int                 x,
910                                                          int                 y,
911                                                          int                 width,
912                                                          int                 height);
913
914 EAPI Ecore_Evas     *ecore_evas_software_wince_gdi_new(Ecore_WinCE_Window *parent,
915                                                        int                 x,
916                                                        int                 y,
917                                                        int                 width,
918                                                        int                 height);
919
920 EAPI Ecore_WinCE_Window *ecore_evas_software_wince_window_get(const Ecore_Evas *ee);
921
922 EAPI Ecore_Evas *ecore_evas_cocoa_new(const char* name, int w, int h);
923
924 /* generic manipulation calls */
925 /**
926  * @brief Get the engine name used by this Ecore_Evas(window).
927  *
928  * @param ee Ecore_Evas whose engine's name is desired.
929  * @return A string that can(usually) be used in ecore_evas_new()
930  *
931  * @see ecore_evas_free()
932  */
933 EAPI const char *ecore_evas_engine_name_get(const Ecore_Evas *ee);
934 /**
935  * @brief Return the Ecore_Evas for this Evas
936  *
937  * @param e The Evas to get the Ecore_Evas from
938  * @return The Ecore_Evas that holds this Evas, or NULL if not held by one.
939  *
940  * @warning Only use on Evas' created with ecore evas!
941  */
942 EAPI Ecore_Evas *ecore_evas_ecore_evas_get(const Evas *e);
943 /**
944  * @brief Free an Ecore_Evas
945  *
946  * @param ee The Ecore_Evas to free
947  *
948  * This frees up any memory used by the Ecore_Evas.
949  */
950 EAPI void        ecore_evas_free(Ecore_Evas *ee);
951 /**
952  * @brief Retrieve user data associated with an Ecore_Evas.
953  *
954  * @param ee The Ecore_Evas to retrieve the user data from.
955  * @param key The key which the user data to be retrieved is associated with.
956  *
957  * This function retrieves user specific data that has been stored within an
958  * Ecore_Evas structure with ecore_evas_data_set().
959  *
960  * @returns NULL on error or no data found, A pointer to the user data on
961  *     success.
962  *
963  * @see ecore_evas_data_set()
964  */
965 EAPI void       *ecore_evas_data_get(const Ecore_Evas *ee, const char *key);
966 /**
967  * @brief Store user data in an Ecore_Evas structure.
968  *
969  * @param ee The Ecore_Evas to store the user data in.
970  * @param key A unique string to associate the user data against. Cannot
971  * be NULL.
972  * @param data A pointer to the user data to store.
973  *
974  * This function associates the @p data with a @p key which is stored by
975  * the Ecore_Evas @p ee. Be aware that a call to ecore_evas_free() will
976  * not free any memory for the associated user data, this is the responsibility
977  * of the caller.
978  *
979  * @see ecore_evas_callback_pre_free_set()
980  * @see ecore_evas_free()
981  * @see ecore_evas_data_get()
982  */
983 EAPI void        ecore_evas_data_set(Ecore_Evas *ee, const char *key, const void *data);
984 /**
985  * Set a callback for Ecore_Evas resize events.
986  * @param ee The Ecore_Evas to set callbacks on
987  * @param func The function to call
988
989  * A call to this function will set a callback on an Ecore_Evas, causing
990  * @p func to be called whenever @p ee is resized.
991  *
992  * @warning If and when this function is called depends on the underlying
993  * windowing system.
994  */
995 EAPI void        ecore_evas_callback_resize_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee));
996 /**
997  * Set a callback for Ecore_Evas move events.
998  * @param ee The Ecore_Evas to set callbacks on
999  * @param func The function to call
1000
1001  * A call to this function will set a callback on an Ecore_Evas, causing
1002  * @p func to be called whenever @p ee is moved.
1003  *
1004  * @warning If and when this function is called depends on the underlying
1005  * windowing system.
1006  */
1007 EAPI void        ecore_evas_callback_move_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee));
1008 /**
1009  * Set a callback for Ecore_Evas show events.
1010  * @param ee The Ecore_Evas to set callbacks on
1011  * @param func The function to call
1012
1013  * A call to this function will set a callback on an Ecore_Evas, causing
1014  * @p func to be called whenever @p ee is shown.
1015  *
1016  * @warning If and when this function is called depends on the underlying
1017  * windowing system.
1018  */
1019 EAPI void        ecore_evas_callback_show_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee));
1020 /**
1021  * Set a callback for Ecore_Evas hide events.
1022  * @param ee The Ecore_Evas to set callbacks on
1023  * @param func The function to call
1024
1025  * A call to this function will set a callback on an Ecore_Evas, causing
1026  * @p func to be called whenever @p ee is hidden.
1027  *
1028  * @warning If and when this function is called depends on the underlying
1029  * windowing system.
1030  */
1031 EAPI void        ecore_evas_callback_hide_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee));
1032 /**
1033  * Set a callback for Ecore_Evas delete request events.
1034  * @param ee The Ecore_Evas to set callbacks on
1035  * @param func The function to call
1036
1037  * A call to this function will set a callback on an Ecore_Evas, causing
1038  * @p func to be called whenever @p ee gets a delete request.
1039  *
1040  * @warning If and when this function is called depends on the underlying
1041  * windowing system.
1042  */
1043 EAPI void        ecore_evas_callback_delete_request_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee));
1044 /**
1045  * Set a callback for Ecore_Evas destroy events.
1046  * @param ee The Ecore_Evas to set callbacks on
1047  * @param func The function to call
1048
1049  * A call to this function will set a callback on an Ecore_Evas, causing
1050  * @p func to be called whenever @p ee is destroyed.
1051  *
1052  * @warning If and when this function is called depends on the underlying
1053  * windowing system.
1054  */
1055 EAPI void        ecore_evas_callback_destroy_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee));
1056 /**
1057  * Set a callback for Ecore_Evas focus in events.
1058  * @param ee The Ecore_Evas to set callbacks on
1059  * @param func The function to call
1060
1061  * A call to this function will set a callback on an Ecore_Evas, causing
1062  * @p func to be called whenever @p ee gets focus.
1063  *
1064  * @warning If and when this function is called depends on the underlying
1065  * windowing system.
1066  */
1067 EAPI void        ecore_evas_callback_focus_in_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee));
1068 /**
1069  * Set a callback for Ecore_Evas focus out events.
1070  * @param ee The Ecore_Evas to set callbacks on
1071  * @param func The function to call
1072
1073  * A call to this function will set a callback on an Ecore_Evas, causing
1074  * @p func to be called whenever @p ee loses focus.
1075  *
1076  * @warning If and when this function is called depends on the underlying
1077  * windowing system.
1078  */
1079 EAPI void        ecore_evas_callback_focus_out_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee));
1080 /**
1081  * Set a callback for Ecore_Evas sticky events.
1082  * @param ee The Ecore_Evas to set callbacks on
1083  * @param func The function to call
1084
1085  * A call to this function will set a callback on an Ecore_Evas, causing
1086  * @p func to be called whenever @p ee becomes sticky.
1087  *
1088  * @warning If and when this function is called depends on the underlying
1089  * windowing system.
1090  */
1091 EAPI void        ecore_evas_callback_sticky_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee));
1092 /**
1093  * Set a callback for Ecore_Evas un-sticky events.
1094  * @param ee The Ecore_Evas to set callbacks on
1095  * @param func The function to call
1096
1097  * A call to this function will set a callback on an Ecore_Evas, causing
1098  * @p func to be called whenever @p ee becomes un-sticky.
1099  *
1100  * @warning If and when this function is called depends on the underlying
1101  * windowing system.
1102  */
1103 EAPI void        ecore_evas_callback_unsticky_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee));
1104 /**
1105  * Set a callback for Ecore_Evas mouse in events.
1106  * @param ee The Ecore_Evas to set callbacks on
1107  * @param func The function to call
1108
1109  * A call to this function will set a callback on an Ecore_Evas, causing
1110  * @p func to be called whenever the mouse enters @p ee.
1111  *
1112  * @warning If and when this function is called depends on the underlying
1113  * windowing system.
1114  */
1115 EAPI void        ecore_evas_callback_mouse_in_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee));
1116 /**
1117  * Set a callback for Ecore_Evas mouse out events.
1118  * @param ee The Ecore_Evas to set callbacks on
1119  * @param func The function to call
1120
1121  * A call to this function will set a callback on an Ecore_Evas, causing
1122  * @p func to be called whenever the mouse leaves @p ee.
1123  *
1124  * @warning If and when this function is called depends on the underlying
1125  * windowing system.
1126  */
1127 EAPI void        ecore_evas_callback_mouse_out_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee));
1128 /**
1129  * Set a callback for Ecore_Evas pre render events.
1130  * @param ee The Ecore_Evas to set callbacks on
1131  * @param func The function to call
1132
1133  * A call to this function will set a callback on an Ecore_Evas, causing
1134  * @p func to be called just before the evas in @p ee is rendered.
1135  *
1136  * @warning If and when this function is called depends on the underlying
1137  * windowing system.
1138  */
1139 EAPI void        ecore_evas_callback_pre_render_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee));
1140 /**
1141  * Set a callback for Ecore_Evas mouse post render events.
1142  * @param ee The Ecore_Evas to set callbacks on
1143  * @param func The function to call
1144
1145  * A call to this function will set a callback on an Ecore_Evas, causing
1146  * @p func to be called just after the evas in @p ee is rendered.
1147  *
1148  * @warning If and when this function is called depends on the underlying
1149  * windowing system.
1150  */
1151 EAPI void        ecore_evas_callback_post_render_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee));
1152 /**
1153  * Set a callback for Ecore_Evas pre-free event.
1154  * @param ee The Ecore_Evas to set callbacks on
1155  * @param func The function to call
1156  *
1157  * A call to this function will set a callback on an Ecore_Evas, causing
1158  * @p func to be called just before the instance @p ee is freed.
1159  *
1160  * @warning If and when this function is called depends on the underlying
1161  * windowing system.
1162  */
1163 EAPI void        ecore_evas_callback_pre_free_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee));
1164 EAPI Evas       *ecore_evas_get(const Ecore_Evas *ee);
1165 EAPI void        ecore_evas_managed_move(Ecore_Evas *ee, int x, int y);
1166 EAPI void        ecore_evas_shaped_set(Ecore_Evas *ee, Eina_Bool shaped);
1167 EAPI Eina_Bool   ecore_evas_shaped_get(const Ecore_Evas *ee);
1168 /**
1169  * @brief Show an Ecore_Evas' window
1170  *
1171  * @param ee The Ecore_Evas to show.
1172  *
1173  * This function makes @p ee visible.
1174  */
1175 EAPI void        ecore_evas_show(Ecore_Evas *ee);
1176 /**
1177  * @brief Hide an Ecore_Evas' window
1178  *
1179  * @param ee The Ecore_Evas to hide.
1180  *
1181  * This function makes @p ee hidden(not visible).
1182  */
1183 EAPI void        ecore_evas_hide(Ecore_Evas *ee);
1184 EAPI void        ecore_evas_activate(Ecore_Evas *ee);
1185
1186
1187 /**
1188  * Set the minimum size of a given @c Ecore_Evas window
1189  *
1190  * @param ee An @c Ecore_Evas window's handle
1191  * @param w The minimum width
1192  * @param h The minimum height
1193  *
1194  * This function sets the minimum size of @p ee to be @p w x @p h.
1195  * One won't be able to resize that window to dimensions smaller than
1196  * the ones set.
1197  *
1198  * @note When base sizes are set, via ecore_evas_size_base_set(),
1199  * they'll be used to calculate a window's minimum size, instead of
1200  * those set by this function.
1201  *
1202  * @see ecore_evas_size_min_get()
1203  */
1204 EAPI void        ecore_evas_size_min_set(Ecore_Evas *ee, int w, int h);
1205
1206 /**
1207  * Get the minimum size set for a given @c Ecore_Evas window
1208  *
1209  * @param ee An @c Ecore_Evas window's handle
1210  * @param w A pointer to an int to place the minimum width in.
1211  * @param h A pointer to an int to place the minimum height in.
1212  *
1213  * @note Use @c NULL pointers on the size components you're not
1214  * interested in: they'll be ignored by the function.
1215  *
1216  * @see ecore_evas_size_min_set() for more details
1217  */
1218 EAPI void        ecore_evas_size_min_get(const Ecore_Evas *ee, int *w, int *h);
1219
1220 /**
1221  * Set the maximum size of a given @c Ecore_Evas window
1222  *
1223  * @param ee An @c Ecore_Evas window's handle
1224  * @param w The maximum width
1225  * @param h The maximum height
1226  *
1227  * This function sets the maximum size of @p ee to be @p w x @p h.
1228  * One won't be able to resize that window to dimensions bigger than
1229  * the ones set.
1230  *
1231  * @see ecore_evas_size_max_get()
1232  */
1233 EAPI void        ecore_evas_size_max_set(Ecore_Evas *ee, int w, int h);
1234
1235 /**
1236  * Get the maximum size set for a given @c Ecore_Evas window
1237  *
1238  * @param ee An @c Ecore_Evas window's handle
1239  * @param w A pointer to an int to place the maximum width in.
1240  * @param h A pointer to an int to place the maximum height in.
1241  *
1242  * @note Use @c NULL pointers on the size components you're not
1243  * interested in: they'll be ignored by the function.
1244  *
1245  * @see ecore_evas_size_max_set() for more details
1246  */
1247 EAPI void        ecore_evas_size_max_get(const Ecore_Evas *ee, int *w, int *h);
1248
1249 /**
1250  * Set the base size for a given @c Ecore_Evas window
1251  *
1252  * @param ee An @c Ecore_Evas window's handle
1253  * @param w The base width
1254  * @param h The base height
1255  *
1256  * This function sets the @b base size of @p ee to be @p w x @p h.
1257  * When base sizes are set, they'll be used to calculate a window's
1258  * @b minimum size, instead of those set by ecore_evas_size_min_get().
1259  *
1260  * @see ecore_evas_size_base_get()
1261  */
1262 EAPI void        ecore_evas_size_base_set(Ecore_Evas *ee, int w, int h);
1263
1264 /**
1265  * Get the base size set for a given @c Ecore_Evas window
1266  *
1267  * @param ee An @c Ecore_Evas window's handle
1268  * @param w A pointer to an int to place the base width in.
1269  * @param h A pointer to an int to place the base height in.
1270  *
1271  * @note Use @c NULL pointers on the size components you're not
1272  * interested in: they'll be ignored by the function.
1273  *
1274  * @see ecore_evas_size_base_set() for more details
1275  */
1276 EAPI void        ecore_evas_size_base_get(const Ecore_Evas *ee, int *w, int *h);
1277
1278 /**
1279  * Set the "size step" for a given @c Ecore_Evas window
1280  *
1281  * @param ee An @c Ecore_Evas window's handle
1282  * @param w The step width
1283  * @param h The step height
1284  *
1285  * This function sets the size steps of @p ee to be @p w x @p h. This
1286  * limits the size of this @cEcore_Evas window to be @b always an
1287  * integer multiple of the step size, for each axis.
1288  */
1289 EAPI void        ecore_evas_size_step_set(Ecore_Evas *ee, int w, int h);
1290
1291 /**
1292  * Get the "size step" set for a given @c Ecore_Evas window
1293  *
1294  * @param ee An @c Ecore_Evas window's handle
1295  * @param w A pointer to an int to place the step width in.
1296  * @param h A pointer to an int to place the step height in.
1297  *
1298  * @note Use @c NULL pointers on the size components you're not
1299  * interested in: they'll be ignored by the function.
1300  *
1301  * @see ecore_evas_size_base_set() for more details
1302  */
1303 EAPI void        ecore_evas_size_step_get(const Ecore_Evas *ee, int *w, int *h);
1304
1305 /**
1306  * @brief Set the cursor of an Ecore_Evas.
1307  *
1308  * @param ee The Ecore_Evas
1309  * @param file  The path to an image file for the cursor.
1310  * @param layer The layer in which the cursor will appear.
1311  * @param hot_x The x coordinate of the cursor's hot spot.
1312  * @param hot_y The y coordinate of the cursor's hot spot.
1313  *
1314  * This function makes the mouse cursor over @p ee be the image specified by
1315  * @p file. The actual point within the image that the mouse is at is specified
1316  * by @p hot_x and @p hot_y, which are coordinates with respect to the top left
1317  * corner of the cursor image.
1318  *
1319  * @note This function creates an object from the image and uses
1320  * ecore_evas_object_cursor_set().
1321  *
1322  * @see ecore_evas_object_cursor_set()
1323  */
1324 EAPI void        ecore_evas_cursor_set(Ecore_Evas *ee, const char *file, int layer, int hot_x, int hot_y);
1325 /**
1326  * @brief Get information about an Ecore_Evas' cursor
1327  *
1328  * @param ee The Ecore_Evas to set
1329  * @param obj A pointer to an Evas_Object to place the cursor Evas_Object.
1330  * @param layer A pointer to an int to place the cursor's layer in.
1331  * @param hot_x A pointer to an int to place the cursor's hot_x coordinate in.
1332  * @param hot_y A pointer to an int to place the cursor's hot_y coordinate in.
1333  *
1334  * This function queries information about an Ecore_Evas' cursor.
1335  *
1336  * @see ecore_evas_cursor_set()
1337  * @see ecore_evas_object_cursor_set()
1338  */
1339 EAPI void        ecore_evas_cursor_get(const Ecore_Evas *ee, Evas_Object **obj, int *layer, int *hot_x, int *hot_y);
1340 /**
1341  * @brief Set the cursor of an Ecore_Evas
1342  *
1343  * @param ee The Ecore_Evas
1344  *
1345  * @param obj The Evas_Object which will be the cursor.
1346  * @param layer The layer in which the cursor will appear.
1347  * @param hot_x The x coordinate of the cursor's hot spot.
1348  * @param hot_y The y coordinate of the cursor's hot spot.
1349  *
1350  * This function makes the mouse cursor over @p ee be the object specified by
1351  * @p obj. The actual point within the object that the mouse is at is specified
1352  * by @p hot_x and @p hot_y, which are coordinates with respect to the top left
1353  * corner of the cursor object.
1354  *
1355  * @see ecore_evas_cursor_set()
1356  */
1357 EAPI void        ecore_evas_object_cursor_set(Ecore_Evas *ee, Evas_Object *obj, int layer, int hot_x, int hot_y);
1358 EAPI void        ecore_evas_override_set(Ecore_Evas *ee, Eina_Bool on);
1359 EAPI Eina_Bool   ecore_evas_override_get(const Ecore_Evas *ee);
1360 EAPI void        ecore_evas_avoid_damage_set(Ecore_Evas *ee, Ecore_Evas_Avoid_Damage_Type on);
1361 EAPI Ecore_Evas_Avoid_Damage_Type ecore_evas_avoid_damage_get(const Ecore_Evas *ee);
1362 EAPI void        ecore_evas_withdrawn_set(Ecore_Evas *ee, Eina_Bool withdrawn);
1363 EAPI Eina_Bool   ecore_evas_withdrawn_get(const Ecore_Evas *ee);
1364 EAPI void        ecore_evas_sticky_set(Ecore_Evas *ee, Eina_Bool sticky);
1365 EAPI Eina_Bool   ecore_evas_sticky_get(const Ecore_Evas *ee);
1366 EAPI void        ecore_evas_manual_render_set(Ecore_Evas *ee, Eina_Bool manual_render);
1367 EAPI Eina_Bool   ecore_evas_manual_render_get(const Ecore_Evas *ee);
1368
1369 /**
1370  * @brief Registers an @c Ecore_Evas to receive events through ecore_input_evas.
1371  *
1372  * @param ee The @c Ecore_Evas handle.
1373  *
1374  * This function calls ecore_event_window_register() with the @p ee as its @c
1375  * id argument, @c window argument, and uses its @c Evas too. It is useful when
1376  * no @c window information is available on a given @c Ecore_Evas backend.
1377  *
1378  * @see ecore_evas_input_event_unregister()
1379  * @since 1.1
1380  */
1381 EAPI void        ecore_evas_input_event_register(Ecore_Evas *ee);
1382 /**
1383  * @brief Unregisters an @c Ecore_Evas receiving events through ecore_input_evas.
1384  *
1385  * @param ee The @c Ecore_Evas handle.
1386  *
1387  * @see ecore_evas_input_event_register()
1388  * @since 1.1
1389  */
1390 EAPI void        ecore_evas_input_event_unregister(Ecore_Evas *ee);
1391
1392 /**
1393  * @brief Force immediate rendering on a given @c Ecore_Evas window
1394  *
1395  * @param ee An @c Ecore_Evas handle
1396  *
1397  * Use this call to forcefully flush the @p ee's canvas rendering
1398  * pipeline, thus bring its window to an up to date state.
1399  */
1400 EAPI void        ecore_evas_manual_render(Ecore_Evas *ee);
1401 EAPI void        ecore_evas_comp_sync_set(Ecore_Evas *ee, Eina_Bool do_sync);
1402 EAPI Eina_Bool   ecore_evas_comp_sync_get(const Ecore_Evas *ee);
1403 /**
1404  * @brief Get geometry of screen associated with this Ecore_Evas.
1405  *
1406  * @param ee The Ecore_Evas whose window's to query container screen geometry.
1407  * @param x where to return the horizontal offset value. May be NULL.
1408  * @param y where to return the vertical offset value. May be NULL.
1409  * @param w where to return the width value. May be NULL.
1410  * @param h where to return the height value. May be NULL.
1411  *
1412  * @since 1.1
1413  */
1414 EAPI void        ecore_evas_screen_geometry_get(const Ecore_Evas *ee, int *x, int *y, int *w, int *h);
1415
1416 /**
1417  * @brief Associate the given object to this ecore evas.
1418  *
1419  * @param ee The Ecore_Evas to associate to @a obj
1420  * @param obj The object to associate to @a ee
1421  * @param flags The association flags.
1422  * @return EINA_TRUE on success, EINA_FALSE otherwise.
1423  *
1424  * Association means that operations on one will affect the other, for
1425  * example moving the object will move the window, resize the object will
1426  * also affect the ecore evas window, hide and show applies as well.
1427  *
1428  * This is meant to simplify development, since you often need to associate
1429  * these events with your "base" objects, background or bottom-most object.
1430  *
1431  * Be aware that some methods might not be what you would like, deleting
1432  * either the window or the object will delete the other. If you want to
1433  * change that behavior, let's say to hide window when it's closed, you
1434  * must use ecore_evas_callback_delete_request_set() and set your own code,
1435  * like ecore_evas_hide(). Just remember that if you override delete_request
1436  * and still want to delete the window/object, you must do that yourself.
1437  *
1438  * Since we now define delete_request, deleting windows will not quit
1439  * main loop, if you wish to do so, you should listen for EVAS_CALLBACK_FREE
1440  * on the object, that way you get notified and you can call
1441  * ecore_main_loop_quit().
1442  *
1443  * Flags can be OR'ed of:
1444  * @li ECORE_EVAS_OBJECT_ASSOCIATE_BASE (or 0): to listen to basic events
1445  *     like delete, resize and move, but no stacking or layer are used.
1446  * @li ECORE_EVAS_OBJECT_ASSOCIATE_STACK: stacking operations will act
1447  *     on the Ecore_Evas, not the object. So evas_object_raise() will
1448  *     call ecore_evas_raise(). Relative operations (stack_above, stack_below)
1449  *     are still not implemented.
1450  * @li ECORE_EVAS_OBJECT_ASSOCIATE_LAYER: stacking operations will act
1451  *     on the Ecore_Evas, not the object. So evas_object_layer_set() will
1452  *     call ecore_evas_layer_set().
1453  * @li ECORE_EVAS_OBJECT_ASSOCIATE_DEL: the object delete will delete the
1454  *     ecore_evas as well as delete_requests on the ecore_evas will delete
1455  *     etc.
1456  */
1457 EAPI Eina_Bool    ecore_evas_object_associate(Ecore_Evas *ee, Evas_Object *obj, Ecore_Evas_Object_Associate_Flags flags);
1458 /**
1459  * @brief Cancel the association set with ecore_evas_object_associate().
1460  *
1461  * @param ee The Ecore_Evas to dissociate from @a obj
1462  * @param obj The object to dissociate from @a ee
1463  * @return EINA_TRUE on success, EINA_FALSE otherwise.
1464  */
1465 EAPI Eina_Bool    ecore_evas_object_dissociate(Ecore_Evas *ee, Evas_Object *obj);
1466 /**
1467  * @brief Get the object associated with @p ee
1468  *
1469  * @param ee The Ecore_Evas to get the object from.
1470  * @return The associated object, or NULL if there is no associated object.
1471  */
1472 EAPI Evas_Object *ecore_evas_object_associate_get(const Ecore_Evas *ee);
1473
1474 /* helper function to be used with ECORE_GETOPT_CALLBACK_*() */
1475 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);
1476
1477 /**
1478  * @brief Get a list of all the ecore_evases.
1479  *
1480  * @return A list of ecore_evases.
1481  *
1482  * The returned list of ecore evases is only valid until the canvases are
1483  * destroyed (and should not be cached for instance). The list can be freed by
1484  * just deleting the list.
1485  */
1486 EAPI Eina_List   *ecore_evas_ecore_evas_list_get(void);
1487
1488 /* specific calls to an x11 environment ecore_evas */
1489 EAPI void           ecore_evas_x11_leader_set(Ecore_Evas *ee, Ecore_X_Window win);
1490 EAPI Ecore_X_Window ecore_evas_x11_leader_get(Ecore_Evas *ee);
1491 EAPI void           ecore_evas_x11_leader_default_set(Ecore_Evas *ee);
1492 EAPI void           ecore_evas_x11_shape_input_rectangle_set(Ecore_Evas *ee, int x, int y, int w, int h);
1493 EAPI void           ecore_evas_x11_shape_input_rectangle_add(Ecore_Evas *ee, int x, int y, int w, int h);
1494 EAPI void           ecore_evas_x11_shape_input_rectangle_subtract(Ecore_Evas *ee, int x, int y, int w, int h);
1495 EAPI void           ecore_evas_x11_shape_input_empty(Ecore_Evas *ee);
1496 EAPI void           ecore_evas_x11_shape_input_reset(Ecore_Evas *ee);
1497 EAPI void           ecore_evas_x11_shape_input_apply(Ecore_Evas *ee);
1498
1499 /**
1500  * @defgroup Ecore_Evas_Ews Ecore_Evas Single Process Windowing System.
1501  *
1502  * These are global scope functions to manage the EWS to be used by
1503  * ecore_evas_ews_new().
1504  *
1505  * @since 1.1
1506  * @{
1507  */
1508
1509 /**
1510  * Sets the engine to be used by the backing store engine.
1511  *
1512  * @return EINA_TRUE on success, EINA_FALSE if ews is already in use.
1513  * @since 1.1
1514  */
1515 EAPI Eina_Bool ecore_evas_ews_engine_set(const char *engine, const char *options);
1516
1517 /**
1518  * Reconfigure the backing store used.
1519  * @since 1.1
1520  */
1521 EAPI Eina_Bool ecore_evas_ews_setup(int x, int y, int w, int h);
1522
1523 /**
1524  * Return the internal backing store in use.
1525  *
1526  * @note this will foced it to be created, making future calls to
1527  * ecore_evas_ews_engine_set() void.
1528  *
1529  * @see ecore_evas_ews_evas_get()
1530  * @since 1.1
1531  */
1532 EAPI Ecore_Evas *ecore_evas_ews_ecore_evas_get(void);
1533
1534 /**
1535  * Return the internal backing store in use.
1536  *
1537  * @note this will foced it to be created, making future calls to
1538  * ecore_evas_ews_engine_set() void.
1539  *
1540  * @see ecore_evas_ews_ecore_evas_get()
1541  * @since 1.1
1542  */
1543 EAPI Evas *ecore_evas_ews_evas_get(void);
1544
1545 /**
1546  * Get the current background.
1547  */
1548 EAPI Evas_Object *ecore_evas_ews_background_get(void);
1549
1550 /**
1551  * Set the current background, must be created at evas ecore_evas_ews_evas_get()
1552  *
1553  * It will be kept at lowest layer (EVAS_LAYER_MIN) and below
1554  * everything else. You can set any object, default is a black
1555  * rectangle.
1556  *
1557  * @note previous object will be deleted!
1558  */
1559 EAPI void ecore_evas_ews_background_set(Evas_Object *o);
1560
1561 /**
1562  * Return all Ecore_Evas* created by EWS.
1563  *
1564  * @note do not change the returned list or its contents.
1565  * @since 1.1
1566  */
1567 EAPI const Eina_List *ecore_evas_ews_children_get(void);
1568
1569 /**
1570  * Set the identifier of the manager taking care of internal windows.
1571  *
1572  * The ECORE_EVAS_EWS_EVENT_MANAGER_CHANGE event is issued. Consider
1573  * handling it to know if you should stop handling events yourself
1574  * (ie: another manager took over)
1575  *
1576  * @param manager any unique identifier address.
1577  *
1578  * @see ecore_evas_ews_manager_get()
1579  * @since 1.1
1580  */
1581 EAPI void        ecore_evas_ews_manager_set(const void *manager);
1582
1583 /**
1584  * Get the identifier of the manager taking care of internal windows.
1585  *
1586  * @return the value set by ecore_evas_ews_manager_set()
1587  * @since 1.1
1588  */
1589 EAPI const void *ecore_evas_ews_manager_get(void);
1590
1591 EAPI extern int ECORE_EVAS_EWS_EVENT_MANAGER_CHANGE; /**< manager was changed */
1592 EAPI extern int ECORE_EVAS_EWS_EVENT_ADD; /**< window was created */
1593 EAPI extern int ECORE_EVAS_EWS_EVENT_DEL; /**< window was deleted, pointer is already invalid but may be used as reference for further cleanup work. */
1594 EAPI extern int ECORE_EVAS_EWS_EVENT_RESIZE; /**< window was resized */
1595 EAPI extern int ECORE_EVAS_EWS_EVENT_MOVE; /**< window was moved */
1596 EAPI extern int ECORE_EVAS_EWS_EVENT_SHOW; /**< window become visible */
1597 EAPI extern int ECORE_EVAS_EWS_EVENT_HIDE; /**< window become hidden */
1598 EAPI extern int ECORE_EVAS_EWS_EVENT_FOCUS; /**< window was focused */
1599 EAPI extern int ECORE_EVAS_EWS_EVENT_UNFOCUS; /**< window lost focus */
1600 EAPI extern int ECORE_EVAS_EWS_EVENT_RAISE; /**< window was raised */
1601 EAPI extern int ECORE_EVAS_EWS_EVENT_LOWER; /**< window was lowered */
1602 EAPI extern int ECORE_EVAS_EWS_EVENT_ACTIVATE; /**< window was activated */
1603
1604 EAPI extern int ECORE_EVAS_EWS_EVENT_ICONIFIED_CHANGE; /**< window minimized/iconified changed */
1605 EAPI extern int ECORE_EVAS_EWS_EVENT_MAXIMIZED_CHANGE; /**< window maximized changed */
1606 EAPI extern int ECORE_EVAS_EWS_EVENT_LAYER_CHANGE; /**< window layer changed */
1607 EAPI extern int ECORE_EVAS_EWS_EVENT_FULLSCREEN_CHANGE; /**< window fullscreen changed */
1608 EAPI extern int ECORE_EVAS_EWS_EVENT_CONFIG_CHANGE; /**< some other window property changed (title, name, class, alpha, transparent, shaped...) */
1609
1610 /**
1611  * @}
1612  */
1613
1614
1615 /**
1616  * @}
1617  */
1618
1619 #ifdef __cplusplus
1620 }
1621 #endif
1622
1623 #endif