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