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