summaryrefslogtreecommitdiff
path: root/src/lib/ecore_evas
diff options
context:
space:
mode:
authorVincent Torri <vincent.torri@gmail.com>2012-12-02 22:35:45 +0000
committerVincent Torri <vincent.torri@gmail.com>2012-12-02 22:35:45 +0000
commit7d6010b12c47a20e492da808e3192c3f87dab619 (patch)
tree26c6fd189e046a76560c0bc740b85f4d767ae399 /src/lib/ecore_evas
parent53fc441d5475155965d92da89502fe4634a561b2 (diff)
merge: add escape ecore, fix several bugs
SVN revision: 79995
Diffstat (limited to 'src/lib/ecore_evas')
-rw-r--r--src/lib/ecore_evas/Ecore_Evas.h2256
-rw-r--r--src/lib/ecore_evas/ecore_evas.c2781
-rw-r--r--src/lib/ecore_evas/ecore_evas_buffer.c836
-rw-r--r--src/lib/ecore_evas/ecore_evas_cocoa.c584
-rw-r--r--src/lib/ecore_evas/ecore_evas_directfb.c606
-rw-r--r--src/lib/ecore_evas/ecore_evas_ews.c1469
-rw-r--r--src/lib/ecore_evas/ecore_evas_extn.c2266
-rw-r--r--src/lib/ecore_evas/ecore_evas_fb.c678
-rw-r--r--src/lib/ecore_evas/ecore_evas_private.h490
-rw-r--r--src/lib/ecore_evas/ecore_evas_psl1ght.c515
-rw-r--r--src/lib/ecore_evas/ecore_evas_sdl.c665
-rw-r--r--src/lib/ecore_evas/ecore_evas_util.c451
-rw-r--r--src/lib/ecore_evas/ecore_evas_wayland_common.c785
-rw-r--r--src/lib/ecore_evas/ecore_evas_wayland_egl.c434
-rw-r--r--src/lib/ecore_evas/ecore_evas_wayland_shm.c656
-rw-r--r--src/lib/ecore_evas/ecore_evas_win32.c1524
-rw-r--r--src/lib/ecore_evas/ecore_evas_wince.c67
-rw-r--r--src/lib/ecore_evas/ecore_evas_x.c3663
18 files changed, 20726 insertions, 0 deletions
diff --git a/src/lib/ecore_evas/Ecore_Evas.h b/src/lib/ecore_evas/Ecore_Evas.h
new file mode 100644
index 0000000000..3c59c80c84
--- /dev/null
+++ b/src/lib/ecore_evas/Ecore_Evas.h
@@ -0,0 +1,2256 @@
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 * @li @ref Ecore_Evas_Window_Sizes_Example_c
43 * @li @ref Ecore_Evas_Buffer_Example_01_c
44 * @li @ref Ecore_Evas_Buffer_Example_02_c
45 */
46
47/* FIXME:
48 * to do soon:
49 * - iconfication api needs to work
50 * - maximization api needs to work
51 * - document all calls
52 *
53 * later:
54 * - buffer back-end that renders to an evas_image_object ???
55 * - qt back-end ???
56 * - dfb back-end ??? (dfb's threads make this REALLY HARD)
57 */
58
59#ifdef __cplusplus
60extern "C" {
61#endif
62
63/**
64 * @defgroup Ecore_Evas_Group Ecore_Evas wrapper/helper set of functions
65 *
66 * Ecore evas is a set of functions that makes it easy to tie together ecore's
67 * main loop and input handling to evas. As such it's a natural base for EFL
68 * applications. While this combination makes it easy to create the basic
69 * aspects all applications need, for normal applications(ones with buttons,
70 * checkboxes and layouts) one should consider using Elementary.
71 *
72 * Ecore evas is extremely well suited for applications that are not based on
73 * widgets. It has a main loop that delivers events, does basic window handling
74 * and leaves all of the drawing up to the user. This works very well if used
75 * in conjunction with Edje or if doing custom drawing as, for example, is done
76 * in games.
77 *
78 * This is a list of examples of these functions:
79 * @li @ref ecore_evas_basics_example_c
80 * @li @ref ecore_evas_object_example_c
81 * @li @ref ecore_evas_callbacks_example_c
82 * @li @ref Ecore_Evas_Window_Sizes_Example_c
83 * @li @ref Ecore_Evas_Buffer_Example_01_c
84 * @li @ref Ecore_Evas_Buffer_Example_02_c
85 *
86 * @{
87 */
88
89/* these are dummy and just tell u what API levels ecore_evas supports - not if
90 * the actual support is compiled in. you need to query for that separately.
91 */
92#define HAVE_ECORE_EVAS_X 1
93#define HAVE_ECORE_EVAS_FB 1
94#define HAVE_ECORE_EVAS_X11_GL 1
95//#define HAVE_ECORE_EVAS_X11_16 1
96#define HAVE_ECORE_EVAS_DIRECTFB 1
97#define HAVE_ECORE_EVAS_WIN32 1
98#define HAVE_ECORE_EVAS_COCOA 1
99#define HAVE_ECORE_EVAS_SDL 1
100//#define HAVE_ECORE_EVAS_WINCE 1
101#define HAVE_ECORE_EVAS_EWS 1
102#define HAVE_ECORE_EVAS_PSL1GHT 1
103#define HAVE_ECORE_EVAS_WAYLAND_SHM 1
104#define HAVE_ECORE_EVAS_WAYLAND_EGL 1
105
106typedef enum _Ecore_Evas_Engine_Type
107{
108 ECORE_EVAS_ENGINE_SOFTWARE_BUFFER,
109 ECORE_EVAS_ENGINE_SOFTWARE_XLIB,
110 ECORE_EVAS_ENGINE_XRENDER_X11,
111 ECORE_EVAS_ENGINE_OPENGL_X11,
112 ECORE_EVAS_ENGINE_SOFTWARE_XCB,
113 ECORE_EVAS_ENGINE_XRENDER_XCB,
114 ECORE_EVAS_ENGINE_SOFTWARE_GDI,
115 ECORE_EVAS_ENGINE_SOFTWARE_DDRAW,
116 ECORE_EVAS_ENGINE_DIRECT3D,
117 ECORE_EVAS_ENGINE_OPENGL_GLEW,
118 ECORE_EVAS_ENGINE_OPENGL_COCOA,
119 ECORE_EVAS_ENGINE_SOFTWARE_SDL,
120 ECORE_EVAS_ENGINE_DIRECTFB,
121 ECORE_EVAS_ENGINE_SOFTWARE_FB,
122 ECORE_EVAS_ENGINE_SOFTWARE_8_X11,
123 ECORE_EVAS_ENGINE_SOFTWARE_16_X11,
124 ECORE_EVAS_ENGINE_SOFTWARE_16_DDRAW,
125 ECORE_EVAS_ENGINE_SOFTWARE_16_WINCE,
126 ECORE_EVAS_ENGINE_OPENGL_SDL,
127 ECORE_EVAS_ENGINE_EWS,
128 ECORE_EVAS_ENGINE_PSL1GHT,
129 ECORE_EVAS_ENGINE_WAYLAND_SHM,
130 ECORE_EVAS_ENGINE_WAYLAND_EGL
131} Ecore_Evas_Engine_Type;
132
133typedef enum _Ecore_Evas_Avoid_Damage_Type
134{
135 ECORE_EVAS_AVOID_DAMAGE_NONE = 0,
136 ECORE_EVAS_AVOID_DAMAGE_EXPOSE = 1,
137 ECORE_EVAS_AVOID_DAMAGE_BUILT_IN = 2
138} Ecore_Evas_Avoid_Damage_Type;
139
140typedef enum _Ecore_Evas_Object_Associate_Flags
141{
142 ECORE_EVAS_OBJECT_ASSOCIATE_BASE = 0,
143 ECORE_EVAS_OBJECT_ASSOCIATE_STACK = 1 << 0,
144 ECORE_EVAS_OBJECT_ASSOCIATE_LAYER = 1 << 1,
145 ECORE_EVAS_OBJECT_ASSOCIATE_DEL = 1 << 2
146} Ecore_Evas_Object_Associate_Flags;
147
148#ifndef _ECORE_X_H
149#define _ECORE_X_WINDOW_PREDEF
150typedef unsigned int Ecore_X_Window;
151#endif
152
153#ifndef _ECORE_DIRECTFB_H
154#define _ECORE_DIRECTFB_WINDOW_PREDEF
155typedef struct _Ecore_DirectFB_Window Ecore_DirectFB_Window;
156#endif
157
158#ifndef __ECORE_WIN32_H__
159typedef struct _Ecore_Win32_Window Ecore_Win32_Window;
160#endif
161
162#ifndef __ECORE_WINCE_H__
163typedef struct _Ecore_WinCE_Window Ecore_WinCE_Window;
164#endif
165
166#ifndef __ECORE_COCOA_H__
167typedef struct _Ecore_Cocoa_Window Ecore_Cocoa_Window;
168#endif
169
170#ifndef _ECORE_EVAS_PRIVATE_H
171/* basic data types */
172typedef struct _Ecore_Evas Ecore_Evas;
173typedef void (*Ecore_Evas_Event_Cb) (Ecore_Evas *ee); /**< Callback used for several ecore evas events @since 1.2 */
174#endif
175
176#ifndef _ECORE_WAYLAND_H_
177#define _ECORE_WAYLAND_WINDOW_PREDEF
178typedef struct _Ecore_Wl_Window Ecore_Wl_Window;
179#endif
180
181/* module setup/shutdown calls */
182
183EAPI int ecore_evas_engine_type_supported_get(Ecore_Evas_Engine_Type engine);
184
185/**
186 * @brief Init the Ecore_Evas system.
187 *
188 * @return How many times the lib has been initialized, 0 indicates failure.
189 *
190 * Set up the Evas wrapper system. Init Evas and Ecore libraries.
191 *
192 * @see ecore_evas_shutdown()
193 */
194EAPI int ecore_evas_init(void);
195/**
196 * @brief Shut down the Ecore_Evas system.
197 *
198 * @return 0 if ecore evas is fully shut down, or > 0 if it still being used.
199 *
200 * This closes the Evas wrapper system down. Shut down Evas and Ecore libraries.
201 *
202 * @see ecore_evas_init()
203 */
204EAPI int ecore_evas_shutdown(void);
205
206EAPI void ecore_evas_app_comp_sync_set(Eina_Bool do_sync);
207EAPI Eina_Bool ecore_evas_app_comp_sync_get(void);
208
209/**
210 * @brief Returns a list of supported engines names.
211 *
212 * @return Newly allocated list with engines names. Engines names
213 * strings are internal and should be considered constants, do not
214 * free or modify them, to free the list use ecore_evas_engines_free().
215 */
216EAPI Eina_List *ecore_evas_engines_get(void);
217/**
218 * @brief Free list returned by ecore_evas_engines_get()
219 *
220 * @param engines list with engines names
221 */
222EAPI void ecore_evas_engines_free(Eina_List *engines);
223/**
224 * @brief Creates a new Ecore_Evas based on engine name and common parameters.
225 *
226 * @param engine_name engine name as returned by
227 * ecore_evas_engines_get() or @c NULL to use environment variable
228 * ECORE_EVAS_ENGINE, that can be undefined and in this case
229 * this call will try to find the first working engine.
230 * @param x horizontal position of window (not supported in all engines)
231 * @param y vertical position of window (not supported in all engines)
232 * @param w width of window
233 * @param h height of window
234 * @param extra_options string with extra parameter, dependent on engines
235 * or @ NULL. String is usually in the form: 'key1=value1;key2=value2'.
236 * Pay attention that when getting that from shell commands, most
237 * consider ';' as the command terminator, so you need to escape
238 * it or use quotes.
239 *
240 * @return Ecore_Evas instance or @c NULL if creation failed.
241 */
242EAPI Ecore_Evas *ecore_evas_new(const char *engine_name, int x, int y, int w, int h, const char *extra_options);
243/**
244 * @brief Set whether an Ecore_Evas has an alpha channel or not.
245 *
246 * @param ee The Ecore_Evas to shape
247 * @param alpha @c EINA_TRUE to enable the alpha channel, @c EINA_FALSE to
248 * disable it
249 *
250 * This function allows you to make an Ecore_Evas translucent using an
251 * alpha channel. See ecore_evas_shaped_set() for details. The difference
252 * between a shaped window and a window with an alpha channel is that an
253 * alpha channel supports multiple levels of transparency, as opposed to
254 * the 1 bit transparency of a shaped window (a pixel is either opaque, or
255 * it's transparent).
256 *
257 * @warning Support for this depends on the underlying windowing system.
258 */
259EAPI void ecore_evas_alpha_set(Ecore_Evas *ee, Eina_Bool alpha);
260/**
261 * @brief Query whether an Ecore_Evas has an alpha channel.
262 * @param ee The Ecore_Evas to query.
263 * @return @c EINA_TRUE if ee has an alpha channel, @c EINA_FALSE if it does
264 * not.
265 *
266 * This function returns @c EINA_TRUE if @p ee has an alpha channel, and
267 * @c EINA_FALSE if it does not.
268 *
269 * @see ecore_evas_alpha_set()
270 */
271EAPI Eina_Bool ecore_evas_alpha_get(const Ecore_Evas *ee);
272/**
273 * @brief Set whether an Ecore_Evas has an transparent window or not.
274 *
275 * @param ee The Ecore_Evas to shape
276 * @param transparent @c EINA_TRUE to enable the transparent window,
277 * @c EINA_FALSE to disable it
278 *
279 * This function sets some translucency options, for more complete support see
280 * ecore_evas_alpha_set().
281 *
282 * @warning Support for this depends on the underlying windowing system.
283 *
284 * @see ecore_evas_alpha_set()
285 */
286EAPI void ecore_evas_transparent_set(Ecore_Evas *ee, Eina_Bool transparent);
287/**
288 * @brief Query whether an Ecore_Evas is transparent.
289 *
290 * @param ee The Ecore_Evas to query.
291 * @return @c EINA_TRUE if ee is transparent, @c EINA_FALSE if it isn't.
292 *
293 * @see ecore_evas_transparent_set()
294 */
295EAPI Eina_Bool ecore_evas_transparent_get(const Ecore_Evas *ee);
296/**
297 * @brief Get the geometry of an Ecore_Evas.
298 *
299 * @param ee The Ecore_Evas whose geometry y
300 * @param x A pointer to an int to place the x coordinate in
301 * @param y A pointer to an int to place the y coordinate in
302 * @param w A pointer to an int to place the w size in
303 * @param h A pointer to an int to place the h size in
304 *
305 * This function takes four pointers to (already allocated) ints, and places
306 * the geometry of @p ee in them. If any of the parameters is not desired you
307 * may pass @c NULL on them.
308 *
309 * @code
310 * int x, y, w, h;
311 * ecore_evas_geometry_get(ee, &x, &y, &w, &h);
312 * @endcode
313 *
314 * @see ecore_evas_new()
315 * @see ecore_evas_resize()
316 * @see ecore_evas_move()
317 * @see ecore_evas_move_resize()
318 */
319EAPI void ecore_evas_geometry_get(const Ecore_Evas *ee, int *x, int *y, int *w, int *h);
320/**
321 * @brief Get the geometry which an Ecore_Evas was latest recently requested.
322 *
323 * @param ee The Ecore_Evas whose geometry y
324 * @param x A pointer to an int to place the x coordinate in
325 * @param y A pointer to an int to place the y coordinate in
326 * @param w A pointer to an int to place the w size in
327 * @param h A pointer to an int to place the h size in
328 *
329 * This function takes four pointers to (already allocated) ints, and places
330 * the geometry which @p ee was latest recently requested . If any of the
331 * parameters is not desired you may pass @c NULL on them.
332 * This function can represent recently requested geometry.
333 * ecore_evas_geometry_get function returns the value is updated after engine
334 * finished request. By comparison, ecore_evas_request_geometry_get returns
335 * recently requested value.
336 *
337 * @code
338 * int x, y, w, h;
339 * ecore_evas_request_geometry_get(ee, &x, &y, &w, &h);
340 * @endcode
341 *
342 * @since 1.1
343 */
344EAPI void ecore_evas_request_geometry_get(const Ecore_Evas *ee, int *x, int *y, int *w, int *h);
345/**
346 * @brief Set the focus of an Ecore_Evas' window.
347 *
348 * @param ee The Ecore_Evas
349 * @param on @c EINA_TRUE for focus, @c EINA_FALSE to defocus.
350 *
351 * This function focuses @p ee if @p on is @c EINA_TRUE, or unfocuses @p ee if
352 * @p on is @c EINA_FALSE.
353 *
354 * @warning Support for this depends on the underlying windowing system.
355 */
356EAPI void ecore_evas_focus_set(Ecore_Evas *ee, Eina_Bool on);
357/**
358 * @brief Query whether an Ecore_Evas' window is focused or not.
359 *
360 * @param ee The Ecore_Evas to set
361 * @return @c EINA_TRUE if @p ee if focused, @c EINA_FALSE if not.
362 *
363 * @see ecore_evas_focus_set()
364 */
365EAPI Eina_Bool ecore_evas_focus_get(const Ecore_Evas *ee);
366/**
367 * @brief Iconify or uniconify an Ecore_Evas' window.
368 *
369 * @param ee The Ecore_Evas
370 * @param on @c EINA_TRUE to iconify, @c EINA_FALSE to uniconify.
371 *
372 * This function iconifies @p ee if @p on is @c EINA_TRUE, or uniconifies @p ee
373 * if @p on is @c EINA_FALSE.
374 *
375 * @note Iconify and minimize are synonyms.
376 *
377 * @warning Support for this depends on the underlying windowing system.
378 */
379EAPI void ecore_evas_iconified_set(Ecore_Evas *ee, Eina_Bool on);
380/**
381 * @brief Query whether an Ecore_Evas' window is iconified or not.
382 *
383 * @param ee The Ecore_Evas to set
384 * @return @c EINA_TRUE if @p ee is iconified, @c EINA_FALSE if not.
385 *
386 * @note Iconify and minimize are synonyms.
387 *
388 * @see ecore_evas_iconified_set()
389 */
390EAPI Eina_Bool ecore_evas_iconified_get(const Ecore_Evas *ee);
391/**
392 * @brief Set whether an Ecore_Evas' window is borderless or not.
393 *
394 * @param ee The Ecore_Evas
395 * @param on @c EINA_TRUE for borderless, @c EINA_FALSE for bordered.
396 *
397 * This function makes @p ee borderless if @p on is @c EINA_TRUE, or bordered
398 * if @p on is @c EINA_FALSE.
399 *
400 * @warning Support for this depends on the underlying windowing system.
401 */
402EAPI void ecore_evas_borderless_set(Ecore_Evas *ee, Eina_Bool on);
403/**
404 * @brief Query whether an Ecore_Evas' window is borderless or not.
405 *
406 * @param ee The Ecore_Evas to set
407 * @return @c EINA_TRUE if @p ee is borderless, @c EINA_FALSE if not.
408 *
409 * @see ecore_evas_borderless_set()
410 */
411EAPI Eina_Bool ecore_evas_borderless_get(const Ecore_Evas *ee);
412/**
413 * @brief Set whether or not an Ecore_Evas' window is fullscreen.
414 *
415 * @param ee The Ecore_Evas
416 * @param on @c EINA_TRUE fullscreen, @c EINA_FALSE not.
417 *
418 * This function causes @p ee to be fullscreen if @p on is @c EINA_TRUE, or
419 * not if @p on is @c EINA_FALSE.
420 *
421 * @warning Support for this depends on the underlying windowing system.
422 */
423EAPI void ecore_evas_fullscreen_set(Ecore_Evas *ee, Eina_Bool on);
424/**
425 * @brief Query whether an Ecore_Evas' window is fullscreen or not.
426 *
427 * @param ee The Ecore_Evas to set
428 * @return @c EINA_TRUE if @p ee is fullscreen, @c EINA_FALSE if not.
429 *
430 * @see ecore_evas_fullscreen_set()
431 */
432EAPI Eina_Bool ecore_evas_fullscreen_get(const Ecore_Evas *ee);
433/**
434 * @brief Set another window that this window is a group member of
435 *
436 * @param ee The Ecore_Evas
437 * @param ee_group The other group member
438 *
439 * If @p ee_group is @c NULL, @p ee is removed from the group, otherwise it is
440 * added. Note that if you free the @p ee_group canvas before @p ee, then
441 * getting the group canvas with ecore_evas_window_group_get() will return
442 * an invalid handle.
443 *
444 * @warning Support for this depends on the underlying windowing system.
445 * @since 1.2
446 */
447EAPI void ecore_evas_window_group_set(Ecore_Evas *ee, const Ecore_Evas *ee_group);
448/**
449 * @brief Get the canvas group set.
450 *
451 * This returns the handle set by ecore_evas_window_group_set().
452 *
453 * @param ee The Ecore_Evas to set
454 * @return The Canvas group handle
455 *
456 * @see ecore_evas_window_group_set()
457 * @since 1.2
458 */
459EAPI const Ecore_Evas *ecore_evas_window_group_get(const Ecore_Evas *ee);
460/**
461 * @brief Set the aspect ratio of a canvas window
462 *
463 * @param ee The Ecore_Evas
464 * @param aspect The aspect ratio (width divided by height), or 0 to disable
465 *
466 * This sets the desired aspect ratio of a canvas window
467 *
468 * @warning Support for this depends on the underlying windowing system.
469 * @since 1.2
470 */
471EAPI void ecore_evas_aspect_set(Ecore_Evas *ee, double aspect);
472/**
473 * @brief Get the aspect ratio of a canvas window
474 *
475 * This returns the value set by ecore_evas_aspect_set().
476 *
477 * @param ee The Ecore_Evas to set
478 * @return The aspect ratio
479 *
480 * @see ecore_evas_aspect_set()
481 * @since 1.2
482 */
483EAPI double ecore_evas_aspect_get(const Ecore_Evas *ee);
484/**
485 * @brief Set The urgent hint flag
486 *
487 * @param ee The Ecore_Evas
488 * @param urgent The urgent state flag
489 *
490 * This sets the "urgent" state hint on a window so the desktop environment
491 * can highlight it somehow.
492 *
493 * @warning Support for this depends on the underlying windowing system.
494 * @since 1.2
495 */
496EAPI void ecore_evas_urgent_set(Ecore_Evas *ee, Eina_Bool urgent);
497/**
498 * @brief Get the urgent state on the cavas window
499 *
500 * This returns the value set by ecore_evas_urgent_set()
501 *
502 * @param ee The Ecore_Evas to set
503 * @return The urgent state set
504 *
505 * @see ecore_evas_urgent_set()
506 * @since 1.2
507 */
508EAPI Eina_Bool ecore_evas_urgent_get(const Ecore_Evas *ee);
509/**
510 * @brief Set the modal state flag on the canvas window
511 *
512 * @param ee The Ecore_Evas
513 * @param modal The modal hint flag
514 *
515 * This hints if the window should be modal (eg if it is also transient
516 * for another window, the other window will maybe be denied focus by
517 * the desktop window manager).
518 *
519 * @warning Support for this depends on the underlying windowing system.
520 * @since 1.2
521 */
522EAPI void ecore_evas_modal_set(Ecore_Evas *ee, Eina_Bool modal);
523/**
524 * @brief Get The modal flag
525 *
526 * This returns the value set by ecore_evas_modal_set().
527 *
528 * @param ee The Ecore_Evas to set
529 * @return The modal flag
530 *
531 * @see ecore_evas_modal_set()
532 * @since 1.2
533 */
534EAPI Eina_Bool ecore_evas_modal_get(const Ecore_Evas *ee);
535/**
536 * @brief Set the "i demand attention" flag on a canvas window
537 *
538 * @param ee The Ecore_Evas
539 * @param demand The flag state to set
540 *
541 * A window may demand attention now (eg you must enter a password before
542 * continuing), and so it may flag a window with this.
543 *
544 * @warning Support for this depends on the underlying windowing system.
545 * @since 1.2
546 */
547EAPI void ecore_evas_demand_attention_set(Ecore_Evas *ee, Eina_Bool demand);
548/**
549 * @brief Get the "i demand attention" flag
550 *
551 * This returns the value set by ecore_evas_demand_attention_set().
552 *
553 * @param ee The Ecore_Evas to set
554 * @return The "i demand attention" flag.
555 *
556 * @see ecore_evas_demand_attention_set()
557 * @since 1.2
558 */
559EAPI Eina_Bool ecore_evas_demand_attention_get(const Ecore_Evas *ee);
560/**
561 * @brief Set the "focus skip" flag
562 *
563 * @param ee The Ecore_Evas
564 * @param skip The "focus skip" state to set.
565 *
566 * A window may not want to accept focus, be in the taskbar, pager etc.
567 * sometimes (example for a small notification window that hovers around
568 * a taskbar or panel, or hovers around a window until some activity
569 * dismisses it).
570 *
571 * @warning Support for this depends on the underlying windowing system.
572 * @since 1.2
573 */
574EAPI void ecore_evas_focus_skip_set(Ecore_Evas *ee, Eina_Bool skip);
575/**
576 * @brief Get the "focus skip" flag
577 *
578 * This returns the value set by ecore_evas_focus_skip_set().
579 *
580 * @param ee The Ecore_Evas to set
581 * @return The "focus skip" flag.
582 *
583 * @see ecore_evas_focus_skip_set()
584 * @since 1.2
585 */
586EAPI Eina_Bool ecore_evas_focus_skip_get(const Ecore_Evas *ee);
587
588/**
589 * @brief Set if this evas should ignore @b all events.
590 *
591 * @param ee The Ecore_Evas whose window's to ignore events.
592 * @param ignore The Ecore_Evas new ignore state.
593 *
594 * @warning Support for this depends on the underlying windowing system.
595 */
596EAPI void ecore_evas_ignore_events_set(Ecore_Evas *ee, Eina_Bool ignore);
597/**
598 * @brief Returns the ignore state of an Ecore_Evas' window.
599 *
600 * @param ee The Ecore_Evas whose window's ignore events state is returned.
601 * @return The Ecore_Evas window's ignore state.
602 *
603 * @see ecore_evas_ignore_events_set()
604 */
605EAPI Eina_Bool ecore_evas_ignore_events_get(const Ecore_Evas *ee);
606/**
607 * @brief Query whether an Ecore_Evas' window is visible or not.
608 *
609 * @param ee The Ecore_Evas to query.
610 * @return 1 if visible, 0 if not.
611 *
612 * This function queries @p ee and returns 1 if it is visible, and 0 if not.
613 *
614 * @see ecore_evas_show()
615 * @see ecore_evas_hide()
616 */
617EAPI int ecore_evas_visibility_get(const Ecore_Evas *ee);
618/**
619 * @brief Set the layer of an Ecore_Evas' window.
620 *
621 * @param ee The Ecore_Evas
622 * @param layer The layer to put @p ee on.
623 *
624 * This function moves @p ee to the layer @p layer.
625 *
626 * @warning Support for this depends on the underlying windowing system.
627 *
628 * @see ecore_evas_lower()
629 * @see ecore_evas_raise()
630 */
631EAPI void ecore_evas_layer_set(Ecore_Evas *ee, int layer);
632/**
633 * @brief Get the layer of an Ecore_Evas' window.
634 *
635 * @param ee The Ecore_Evas to set
636 * @return the layer @p ee's window is on.
637 *
638 * @see ecore_evas_layer_set()
639 * @see ecore_evas_lower()
640 * @see ecore_evas_raise()
641 */
642EAPI int ecore_evas_layer_get(const Ecore_Evas *ee);
643/**
644 * @brief Maximize (or unmaximize) an Ecore_Evas' window.
645 *
646 * @param ee The Ecore_Evas
647 * @param on @c EINA_TRUE to maximize, @c EINA_FALSE to unmaximize.
648 *
649 * This function maximizes @p ee if @p on is @c EINA_TRUE, or unmaximizes @p ee
650 * if @p on is @c EINA_FALSE.
651 *
652 * @warning Support for this depends on the underlying windowing system.
653 */
654EAPI void ecore_evas_maximized_set(Ecore_Evas *ee, Eina_Bool on);
655/**
656 * @brief Query whether an Ecore_Evas' window is maximized or not.
657 *
658 * @param ee The Ecore_Evas to set
659 * @return @c EINA_TRUE if @p ee is maximized, @c EINA_FALSE if not.
660 *
661 * @see ecore_evas_maximized_set()
662 */
663EAPI Eina_Bool ecore_evas_maximized_get(const Ecore_Evas *ee);
664/**
665 * @brief Move an Ecore_Evas.
666 *
667 * @param ee The Ecore_Evas to move
668 * @param x The x coordinate to move to
669 * @param y The y coordinate to move to
670 *
671 * This moves @p ee to the screen coordinates (@p x, @p y)
672 *
673 * @warning Support for this depends on the underlying windowing system.
674 *
675 * @see ecore_evas_new()
676 * @see ecore_evas_resize()
677 * @see ecore_evas_move_resize()
678 */
679EAPI void ecore_evas_move(Ecore_Evas *ee, int x, int y);
680/**
681 * @brief Resize an Ecore_Evas.
682 *
683 * @param ee The Ecore_Evas to move
684 * @param w The w coordinate to resize to
685 * @param h The h coordinate to resize to
686 *
687 * This resizes @p ee to @p w x @p h.
688 *
689 * @warning Support for this depends on the underlying windowing system.
690 *
691 * @see ecore_evas_new()
692 * @see ecore_evas_move()
693 * @see ecore_evas_move_resize()
694 */
695EAPI void ecore_evas_resize(Ecore_Evas *ee, int w, int h);
696/**
697 * @brief Move and resize an Ecore_Evas
698 *
699 * @param ee The Ecore_Evas to move and resize
700 * @param x The x coordinate to move to
701 * @param y The y coordinate to move to
702 * @param w The w coordinate to resize to
703 * @param h The h coordinate to resize to
704 *
705 * This moves @p ee to the screen coordinates (@p x, @p y) and resizes
706 * it to @p w x @p h.
707 *
708 * @warning Support for this depends on the underlying windowing system.
709 *
710 * @see ecore_evas_new()
711 * @see ecore_evas_move()
712 * @see ecore_evas_resize()
713 */
714EAPI void ecore_evas_move_resize(Ecore_Evas *ee, int x, int y, int w, int h);
715/**
716 * @brief Set the rotation of an Ecore_Evas' window.
717 *
718 * @param ee The Ecore_Evas
719 * @param rot the angle (in degrees) of rotation.
720 *
721 * The allowed values of @p rot depend on the engine being used. Most only
722 * allow multiples of 90.
723 *
724 * @warning Support for this depends on the underlying windowing system.
725 *
726 * @see ecore_evas_rotation_with_resize_set()
727 */
728EAPI void ecore_evas_rotation_set(Ecore_Evas *ee, int rot);
729/**
730 * @brief Set the rotation of an Ecore_Evas' window
731 *
732 * @param ee The Ecore_Evas
733 * @param rot the angle (in degrees) of rotation.
734 *
735 * Like ecore_evas_rotation_set(), but it also resizes the window's contents so
736 * that they fit inside the current window geometry.
737 *
738 * @warning Support for this depends on the underlying windowing system.
739 *
740 * @see ecore_evas_rotation_set()
741 */
742EAPI void ecore_evas_rotation_with_resize_set(Ecore_Evas *ee, int rot);
743/**
744 * @brief Get the rotation of an Ecore_Evas' window
745 *
746 * @param ee The Ecore_Evas
747 * @return the angle (in degrees) of rotation.
748 *
749 * @see ecore_evas_rotation_set()
750 * @see ecore_evas_rotation_with_resize_set()
751 */
752EAPI int ecore_evas_rotation_get(const Ecore_Evas *ee);
753/**
754 * @brief Raise an Ecore_Evas' window.
755 *
756 * @param ee The Ecore_Evas to raise.
757 *
758 * This functions raises the Ecore_Evas to the front.
759 *
760 * @warning Support for this depends on the underlying windowing system.
761 *
762 * @see ecore_evas_lower()
763 * @see ecore_evas_layer_set()
764 */
765EAPI void ecore_evas_raise(Ecore_Evas *ee);
766/**
767 * @brief Lower an Ecore_Evas' window.
768 *
769 * @param ee The Ecore_Evas to raise.
770 *
771 * This functions lowers the Ecore_Evas to the back.
772 *
773 * @warning Support for this depends on the underlying windowing system.
774 *
775 * @see ecore_evas_raise()
776 * @see ecore_evas_layer_set()
777 */
778EAPI void ecore_evas_lower(Ecore_Evas *ee);
779/**
780 * @brief Set the title of an Ecore_Evas' window.
781 *
782 * @param ee The Ecore_Evas whose title you wish to set.
783 * @param t The title
784 *
785 * This function sets the title of @p ee to @p t.
786 *
787 * @warning Support for this depends on the underlying windowing system.
788 */
789EAPI void ecore_evas_title_set(Ecore_Evas *ee, const char *t);
790/**
791 * @brief Get the title of an Ecore_Evas' window.
792 *
793 * @param ee The Ecore_Evas whose title you wish to get.
794 * @return The title of @p ee.
795 *
796 * This function returns the title of @p ee.
797 *
798 * @see ecore_evas_title_set()
799 */
800EAPI const char *ecore_evas_title_get(const Ecore_Evas *ee);
801/**
802 * @brief Set the name and class of an Ecore_Evas' window.
803 *
804 * @param ee the Ecore_Evas
805 * @param n the name
806 * @param c the class
807 *
808 * This function sets the name of @p ee to @p n, and its class to @p c. The
809 * meaning of @p name and @p class depends on the underlying windowing system.
810 *
811 * @warning Support for this depends on the underlying windowing system.
812 */
813EAPI void ecore_evas_name_class_set(Ecore_Evas *ee, const char *n, const char *c);
814/**
815 * @brief Get the name and class of an Ecore_Evas' window
816 *
817 * This function gets the name of @p ee into @p n, and its class into
818 * @p c.
819 *
820 * @param ee The Ecore_Evas to query.
821 * @param n A pointer to a string to place the name in.
822 * @param c A pointer to a string to place the class in.
823 * @see ecore_evas_name_class_set()
824 */
825EAPI void ecore_evas_name_class_get(const Ecore_Evas *ee, const char **n, const char **c);
826/**
827 * @brief Returns a pointer to the underlying window.
828 *
829 * @param ee The Ecore_Evas whose window is desired.
830 * @return A pointer to the underlying window.
831 *
832 * @warning Support for this depends on the underlying windowing system.
833 */
834EAPI Ecore_Window ecore_evas_window_get(const Ecore_Evas *ee);
835
836
837/* engine/target specific init calls */
838EAPI Ecore_Evas *ecore_evas_software_x11_new(const char *disp_name, Ecore_X_Window parent, int x, int y, int w, int h);
839EAPI Ecore_X_Window ecore_evas_software_x11_window_get(const Ecore_Evas *ee);
840EAPI void ecore_evas_software_x11_direct_resize_set(Ecore_Evas *ee, Eina_Bool on);
841EAPI Eina_Bool ecore_evas_software_x11_direct_resize_get(const Ecore_Evas *ee);
842EAPI void ecore_evas_software_x11_extra_event_window_add(Ecore_Evas *ee, Ecore_X_Window win);
843
844#define ECORE_EVAS_GL_X11_OPT_NONE 0
845#define ECORE_EVAS_GL_X11_OPT_INDIRECT 1
846#define ECORE_EVAS_GL_X11_OPT_VSYNC 2
847#define ECORE_EVAS_GL_X11_OPT_SWAP_MODE 3
848#define ECORE_EVAS_GL_X11_OPT_LAST 4
849
850#define ECORE_EVAS_GL_X11_SWAP_MODE_AUTO 0
851#define ECORE_EVAS_GL_X11_SWAP_MODE_FULL 1
852#define ECORE_EVAS_GL_X11_SWAP_MODE_COPY 2
853#define ECORE_EVAS_GL_X11_SWAP_MODE_DOUBLE 3
854#define ECORE_EVAS_GL_X11_SWAP_MODE_TRIPLE 4
855
856EAPI Ecore_Evas *ecore_evas_gl_x11_new(const char *disp_name, Ecore_X_Window parent, int x, int y, int w, int h);
857EAPI 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);
858EAPI Ecore_X_Window ecore_evas_gl_x11_window_get(const Ecore_Evas *ee);
859EAPI void ecore_evas_gl_x11_direct_resize_set(Ecore_Evas *ee, Eina_Bool on);
860EAPI Eina_Bool ecore_evas_gl_x11_direct_resize_get(const Ecore_Evas *ee);
861EAPI void ecore_evas_gl_x11_extra_event_window_add(Ecore_Evas *ee, Ecore_X_Window win);
862EAPI 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));
863
864EAPI Ecore_Evas *ecore_evas_xrender_x11_new(const char *disp_name, Ecore_X_Window parent, int x, int y, int w, int h);
865EAPI Ecore_X_Window ecore_evas_xrender_x11_window_get(const Ecore_Evas *ee);
866EAPI void ecore_evas_xrender_x11_direct_resize_set(Ecore_Evas *ee, Eina_Bool on);
867EAPI Eina_Bool ecore_evas_xrender_x11_direct_resize_get(const Ecore_Evas *ee);
868EAPI void ecore_evas_xrender_x11_extra_event_window_add(Ecore_Evas *ee, Ecore_X_Window win);
869
870EAPI Ecore_Evas *ecore_evas_software_x11_8_new(const char *disp_name, Ecore_X_Window parent, int x, int y, int w, int h);
871EAPI Ecore_X_Window ecore_evas_software_x11_8_window_get(const Ecore_Evas *ee);
872EAPI Ecore_X_Window ecore_evas_software_x11_8_subwindow_get(const Ecore_Evas *ee);
873EAPI void ecore_evas_software_x11_8_direct_resize_set(Ecore_Evas *ee, Eina_Bool on);
874EAPI Eina_Bool ecore_evas_software_x11_8_direct_resize_get(const Ecore_Evas *ee);
875EAPI void ecore_evas_software_x11_8_extra_event_window_add(Ecore_Evas *ee, Ecore_X_Window win);
876
877EAPI Ecore_Evas *ecore_evas_software_x11_16_new(const char *disp_name, Ecore_X_Window parent, int x, int y, int w, int h);
878EAPI Ecore_X_Window ecore_evas_software_x11_16_window_get(const Ecore_Evas *ee);
879EAPI void ecore_evas_software_x11_16_direct_resize_set(Ecore_Evas *ee, Eina_Bool on);
880EAPI Eina_Bool ecore_evas_software_x11_16_direct_resize_get(const Ecore_Evas *ee);
881EAPI void ecore_evas_software_x11_16_extra_event_window_add(Ecore_Evas *ee, Ecore_X_Window win);
882
883EAPI Ecore_Evas *ecore_evas_fb_new(const char *disp_name, int rotation, int w, int h);
884
885EAPI Ecore_Evas *ecore_evas_directfb_new(const char *disp_name, int windowed, int x, int y, int w, int h);
886EAPI Ecore_DirectFB_Window *ecore_evas_directfb_window_get(const Ecore_Evas *ee);
887
888
889EAPI Ecore_Evas *ecore_evas_wayland_shm_new(const char *disp_name, unsigned int parent, int x, int y, int w, int h, Eina_Bool frame);
890EAPI Ecore_Evas *ecore_evas_wayland_egl_new(const char *disp_name, unsigned int parent, int x, int y, int w, int h, Eina_Bool frame);
891EAPI void ecore_evas_wayland_resize(Ecore_Evas *ee, int location);
892EAPI void ecore_evas_wayland_move(Ecore_Evas *ee, int x, int y);
893
894EAPI void ecore_evas_wayland_pointer_set(Ecore_Evas *ee, int hot_x, int hot_y);
895EAPI void ecore_evas_wayland_type_set(Ecore_Evas *ee, int type);
896EAPI Ecore_Wl_Window *ecore_evas_wayland_window_get(const Ecore_Evas *ee);
897
898/**
899 * @brief Create a new @c Ecore_Evas canvas bound to the Evas
900 * @b buffer engine
901 *
902 * @param w The width of the canvas, in pixels
903 * @param h The height of the canvas, in pixels
904 * @return A new @c Ecore_Evas instance or @c NULL, on failure
905 *
906 * This creates a new buffer canvas wrapper, with image data array
907 * @b bound to the ARGB format, 8 bits per pixel.
908 *
909 * This function will allocate the needed pixels array with canonical
910 * @c malloc(). If you wish a custom function to allocate it, consider
911 * using ecore_evas_buffer_allocfunc_new(), instead.
912 *
913 * @note This function actually is a wrapper on
914 * ecore_evas_buffer_allocfunc_new(), using the same @a w and @a h
915 * arguments and canonical @c malloc() and @c free() to the memory
916 * allocation and freeing functions. See that function's documentation
917 * for more details.
918 */
919EAPI Ecore_Evas *ecore_evas_buffer_new(int w, int h);
920
921/**
922 * @brief Create a new @c Ecore_Evas canvas bound to the Evas
923 * @b buffer engine, giving custom allocation and freeing functions for
924 * the canvas memory region
925 *
926 * @param w The width of the canvas, in canvas units
927 * @param h The height of the canvas, in canvas units
928 * @param alloc_func Function to be called to allocate the memory
929 * needed for the new buffer canvas. @a data will be passed the same
930 * value as the @p data of this function, while @a size will be passed
931 * @p w times @p h times @c sizeof(int).
932 * @param free_func Function to be called to free the memory used by
933 * the new buffer canvas. @a data will be passed the same value as the
934 * @p data of this function, while @a pix will be passed the canvas
935 * memory pointer.
936 * @param data Custom data to be passed to the allocation and freeing
937 * functions
938 * @return A new @c Ecore_Evas instance or @c NULL, on failure
939 *
940 * This creates a new buffer canvas wrapper, with image data array
941 * @b bound to the ARGB format, 8 bits per pixel.
942 *
943 * This function is useful when one wants an @c Ecore_Evas buffer
944 * canvas with a custom allocation function, like one getting memory
945 * chunks from a memory pool, for example.
946 *
947 * On any resizing of this @c Ecore_Evas buffer canvas, its image data
948 * will be @b freed, to be allocated again with the new size.
949 *
950 * @note @p w and @p h sizes have to greater or equal to 1. Otherwise,
951 * they'll be interpreted as 1, exactly.
952 *
953 * @see ecore_evas_buffer_new()
954 */
955EAPI 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);
956
957/**
958 * @brief Grab a pointer to the actual pixels array of a given
959 * @c Ecore_Evas @b buffer canvas/window.
960 *
961 * @param ee An @c Ecore_Evas handle
962 * @return A pointer to the internal pixels array of @p ee
963 *
964 * Besides returning a pointer to the actual pixel array of the given
965 * canvas, this call will force a <b>rendering update on @p ee</b>,
966 * first.
967 *
968 * A common use case for this call is to create an image object, from
969 * @b another canvas, to have as data @p ee's contents, thus
970 * snapshoting the canvas. For that case, one can also use the
971 * ecore_evas_object_image_new() helper function.
972 */
973EAPI const void *ecore_evas_buffer_pixels_get(Ecore_Evas *ee);
974
975/**
976 * @brief Create a new @c Ecore_Evas canvas bound to the Evas
977 * @b ews (Ecore + Evas Single Process Windowing System) engine
978 *
979 * EWS is a simple single process windowing system. The backing store
980 * is also an @c Ecore_Evas that can be setup with
981 * ecore_evas_ews_setup() and retrieved with
982 * ecore_evas_ews_ecore_evas_get(). It will allow window management
983 * using events prefixed with @c ECORE_EVAS_EVENT_EWS_.
984 *
985 * The EWS windows (returned by this function or
986 * ecore_evas_new("ews"...)) will all be software buffer windows
987 * automatic rendered to the backing store.
988 *
989 * @param x horizontal position of window, in pixels
990 * @param y vertical position of window, in pixels
991 * @param w The width of the canvas, in pixels
992 * @param h The height of the canvas, in pixels
993 * @return A new @c Ecore_Evas instance or @c NULL, on failure
994 *
995 * @see ecore_evas_ews_setup()
996 * @see ecore_evas_ews_ecore_evas_get()
997 *
998 * @since 1.1
999 */
1000EAPI Ecore_Evas *ecore_evas_ews_new(int x, int y, int w, int h);
1001
1002
1003/**
1004 * Returns the backing store image object that represents the given
1005 * window in EWS.
1006 * @return The evas object of EWS backing store.
1007 *
1008 * @note This should not be modified anyhow, but may be helpful to
1009 * determine stacking and geometry of it for window managers
1010 * that decorate windows.
1011 *
1012 * @param ee The Ecore_Evas from which to get the backing store.
1013 * @see ecore_evas_ews_manager_set()
1014 * @see ecore_evas_ews_evas_get()
1015 * @since 1.1
1016 */
1017EAPI Evas_Object *ecore_evas_ews_backing_store_get(const Ecore_Evas *ee);
1018
1019/**
1020 * Calls the window to be deleted (freed), but can let user decide to
1021 * forbid it by using ecore_evas_callback_delete_request_set()
1022 *
1023 * @param ee The Ecore_Evas for which window will be deleted.
1024 * @since 1.1
1025 */
1026EAPI void ecore_evas_ews_delete_request(Ecore_Evas *ee);
1027
1028/**
1029 * @brief Create an Evas image object with image data <b>bound to an
1030 * own, internal @c Ecore_Evas canvas wrapper</b>
1031 *
1032 * @param ee_target @c Ecore_Evas to have the canvas receiving the new
1033 * image object
1034 * @return A handle to the new image object
1035 *
1036 * This will create a @b special Evas image object. The image's pixel
1037 * array will get bound to the same image data array of an @b internal
1038 * @b buffer @c Ecore_Evas canvas. The user of this function is, then,
1039 * supposed to grab that @c Ecore_Evas handle, with
1040 * ecore_evas_object_ecore_evas_get(), and use its canvas to render
1041 * whichever contents he/she wants, @b independently of the contents
1042 * of the canvas owned by @p ee_target. Those contents will reflect on
1043 * the canvas of @p ee, though, being exactly the image data of the
1044 * object returned by this function.
1045 *
1046 * This is a helper function for the scenario of one wanting to grab a
1047 * buffer canvas' contents (with ecore_evas_buffer_pixels_get()) to be
1048 * used on another canvas, for whichever reason. The most common goal
1049 * of this setup is to @b save an image file with a whole canvas as
1050 * contents, which could not be achieved by using an image file within
1051 * the target canvas.
1052 *
1053 * @warning Always resize the returned image and its underlying
1054 * @c Ecore_Evas handle accordingly. They must be kept with same sizes
1055 * for things to work as expected. Also, you @b must issue
1056 * @c evas_object_image_size_set() on the image with that same size. If
1057 * the image is to be shown in a canvas bound to an engine different
1058 * than the buffer one, then you must also set this image's @b fill
1059 * properties accordingly.
1060 *
1061 * @note The image returned will always be bound to the
1062 * @c EVAS_COLORSPACE_ARGB8888 colorspace, always.
1063 *
1064 * @note Use ecore_evas_object_evas_get() to grab the image's internal
1065 * own canvas directly.
1066 *
1067 * @note If snapshoting this image's internal canvas, remember to
1068 * flush its internal @c Ecore_Evas firstly, with
1069 * ecore_evas_manual_render().
1070 */
1071EAPI Evas_Object *ecore_evas_object_image_new(Ecore_Evas *ee_target);
1072
1073/**
1074 * @brief Retrieve the internal @c Ecore_Evas handle of an image
1075 * object created via ecore_evas_object_image_new()
1076 *
1077 * @param obj A handle to an image object created via
1078 * ecore_evas_object_image_new()
1079 * @return The underlying @c Ecore_Evas handle in @p obj
1080 */
1081EAPI Ecore_Evas *ecore_evas_object_ecore_evas_get(Evas_Object *obj);
1082
1083/**
1084 * @brief Retrieve the canvas bound to the internal @c Ecore_Evas
1085 * handle of an image object created via ecore_evas_object_image_new()
1086 *
1087 * @param obj A handle to an image object created via
1088 * ecore_evas_object_image_new()
1089 * @return A handle to @p obj's underlying @c Ecore_Evas's canvas
1090 */
1091EAPI Evas *ecore_evas_object_evas_get(Evas_Object *obj);
1092
1093EAPI Ecore_Evas *ecore_evas_software_gdi_new(Ecore_Win32_Window *parent,
1094 int x,
1095 int y,
1096 int width,
1097 int height);
1098
1099EAPI Ecore_Evas *ecore_evas_software_ddraw_new(Ecore_Win32_Window *parent,
1100 int x,
1101 int y,
1102 int width,
1103 int height);
1104
1105EAPI Ecore_Evas *ecore_evas_software_16_ddraw_new(Ecore_Win32_Window *parent,
1106 int x,
1107 int y,
1108 int width,
1109 int height);
1110
1111EAPI Ecore_Evas *ecore_evas_direct3d_new(Ecore_Win32_Window *parent,
1112 int x,
1113 int y,
1114 int width,
1115 int height);
1116
1117EAPI Ecore_Evas *ecore_evas_gl_glew_new(Ecore_Win32_Window *parent,
1118 int x,
1119 int y,
1120 int width,
1121 int height);
1122
1123EAPI Ecore_Win32_Window *ecore_evas_win32_window_get(const Ecore_Evas *ee);
1124
1125EAPI Ecore_Evas *ecore_evas_sdl_new(const char* name, int w, int h, int fullscreen, int hwsurface, int noframe, int alpha);
1126EAPI Ecore_Evas *ecore_evas_sdl16_new(const char* name, int w, int h, int fullscreen, int hwsurface, int noframe, int alpha);
1127EAPI Ecore_Evas *ecore_evas_gl_sdl_new(const char* name, int w, int h, int fullscreen, int noframe);
1128
1129EAPI Ecore_Evas *ecore_evas_software_wince_new(Ecore_WinCE_Window *parent,
1130 int x,
1131 int y,
1132 int width,
1133 int height);
1134
1135EAPI Ecore_Evas *ecore_evas_software_wince_fb_new(Ecore_WinCE_Window *parent,
1136 int x,
1137 int y,
1138 int width,
1139 int height);
1140
1141EAPI Ecore_Evas *ecore_evas_software_wince_gapi_new(Ecore_WinCE_Window *parent,
1142 int x,
1143 int y,
1144 int width,
1145 int height);
1146
1147EAPI Ecore_Evas *ecore_evas_software_wince_ddraw_new(Ecore_WinCE_Window *parent,
1148 int x,
1149 int y,
1150 int width,
1151 int height);
1152
1153EAPI Ecore_Evas *ecore_evas_software_wince_gdi_new(Ecore_WinCE_Window *parent,
1154 int x,
1155 int y,
1156 int width,
1157 int height);
1158
1159EAPI Ecore_WinCE_Window *ecore_evas_software_wince_window_get(const Ecore_Evas *ee);
1160
1161EAPI Ecore_Evas *ecore_evas_cocoa_new(Ecore_Cocoa_Window *parent,
1162 int x,
1163 int y,
1164 int w,
1165 int h);
1166
1167EAPI Ecore_Evas *ecore_evas_psl1ght_new(const char* name, int w, int h);
1168
1169
1170/* generic manipulation calls */
1171/**
1172 * @brief Get the engine name used by this Ecore_Evas(window).
1173 *
1174 * @param ee Ecore_Evas whose engine's name is desired.
1175 * @return A string that can(usually) be used in ecore_evas_new()
1176 *
1177 * @see ecore_evas_free()
1178 */
1179EAPI const char *ecore_evas_engine_name_get(const Ecore_Evas *ee);
1180/**
1181 * @brief Return the Ecore_Evas for this Evas
1182 *
1183 * @param e The Evas to get the Ecore_Evas from
1184 * @return The Ecore_Evas that holds this Evas, or @c NULL if not held by one.
1185 *
1186 * @warning Only use on Evas' created with ecore evas!
1187 */
1188EAPI Ecore_Evas *ecore_evas_ecore_evas_get(const Evas *e);
1189/**
1190 * @brief Free an Ecore_Evas
1191 *
1192 * @param ee The Ecore_Evas to free
1193 *
1194 * This frees up any memory used by the Ecore_Evas.
1195 */
1196EAPI void ecore_evas_free(Ecore_Evas *ee);
1197/**
1198 * @brief Retrieve user data associated with an Ecore_Evas.
1199 *
1200 * @param ee The Ecore_Evas to retrieve the user data from.
1201 * @param key The key which the user data to be retrieved is associated with.
1202 *
1203 * This function retrieves user specific data that has been stored within an
1204 * Ecore_Evas structure with ecore_evas_data_set().
1205 *
1206 * @returns @c NULL on error or no data found, A pointer to the user data on
1207 * success.
1208 *
1209 * @see ecore_evas_data_set()
1210 */
1211EAPI void *ecore_evas_data_get(const Ecore_Evas *ee, const char *key);
1212/**
1213 * @brief Store user data in an Ecore_Evas structure.
1214 *
1215 * @param ee The Ecore_Evas to store the user data in.
1216 * @param key A unique string to associate the user data against. Cannot
1217 * be NULL.
1218 * @param data A pointer to the user data to store.
1219 *
1220 * This function associates the @p data with a @p key which is stored by
1221 * the Ecore_Evas @p ee. Be aware that a call to ecore_evas_free() will
1222 * not free any memory for the associated user data, this is the responsibility
1223 * of the caller.
1224 *
1225 * @see ecore_evas_callback_pre_free_set()
1226 * @see ecore_evas_free()
1227 * @see ecore_evas_data_get()
1228 */
1229EAPI void ecore_evas_data_set(Ecore_Evas *ee, const char *key, const void *data);
1230/**
1231 * Set a callback for Ecore_Evas resize events.
1232 * @param ee The Ecore_Evas to set callbacks on
1233 * @param func The function to call
1234
1235 * A call to this function will set a callback on an Ecore_Evas, causing
1236 * @p func to be called whenever @p ee is resized.
1237 *
1238 * @warning If and when this function is called depends on the underlying
1239 * windowing system.
1240 */
1241EAPI void ecore_evas_callback_resize_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func);
1242/**
1243 * Set a callback for Ecore_Evas move events.
1244 * @param ee The Ecore_Evas to set callbacks on
1245 * @param func The function to call
1246
1247 * A call to this function will set a callback on an Ecore_Evas, causing
1248 * @p func to be called whenever @p ee is moved.
1249 *
1250 * @warning If and when this function is called depends on the underlying
1251 * windowing system.
1252 */
1253EAPI void ecore_evas_callback_move_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func);
1254/**
1255 * Set a callback for Ecore_Evas show events.
1256 * @param ee The Ecore_Evas to set callbacks on
1257 * @param func The function to call
1258
1259 * A call to this function will set a callback on an Ecore_Evas, causing
1260 * @p func to be called whenever @p ee is shown.
1261 *
1262 * @warning If and when this function is called depends on the underlying
1263 * windowing system.
1264 */
1265EAPI void ecore_evas_callback_show_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func);
1266/**
1267 * Set a callback for Ecore_Evas hide events.
1268 * @param ee The Ecore_Evas to set callbacks on
1269 * @param func The function to call
1270
1271 * A call to this function will set a callback on an Ecore_Evas, causing
1272 * @p func to be called whenever @p ee is hidden.
1273 *
1274 * @warning If and when this function is called depends on the underlying
1275 * windowing system.
1276 */
1277EAPI void ecore_evas_callback_hide_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func);
1278/**
1279 * Set a callback for Ecore_Evas delete request events.
1280 * @param ee The Ecore_Evas to set callbacks on
1281 * @param func The function to call
1282
1283 * A call to this function will set a callback on an Ecore_Evas, causing
1284 * @p func to be called whenever @p ee gets a delete request.
1285 *
1286 * @warning If and when this function is called depends on the underlying
1287 * windowing system.
1288 */
1289EAPI void ecore_evas_callback_delete_request_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func);
1290/**
1291 * Set a callback for Ecore_Evas destroy events.
1292 * @param ee The Ecore_Evas to set callbacks on
1293 * @param func The function to call
1294
1295 * A call to this function will set a callback on an Ecore_Evas, causing
1296 * @p func to be called whenever @p ee is destroyed.
1297 *
1298 * @warning If and when this function is called depends on the underlying
1299 * windowing system.
1300 */
1301EAPI void ecore_evas_callback_destroy_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func);
1302/**
1303 * Set a callback for Ecore_Evas focus in events.
1304 * @param ee The Ecore_Evas to set callbacks on
1305 * @param func The function to call
1306
1307 * A call to this function will set a callback on an Ecore_Evas, causing
1308 * @p func to be called whenever @p ee gets focus.
1309 *
1310 * @warning If and when this function is called depends on the underlying
1311 * windowing system.
1312 */
1313EAPI void ecore_evas_callback_focus_in_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func);
1314/**
1315 * Set a callback for Ecore_Evas focus out events.
1316 * @param ee The Ecore_Evas to set callbacks on
1317 * @param func The function to call
1318
1319 * A call to this function will set a callback on an Ecore_Evas, causing
1320 * @p func to be called whenever @p ee loses focus.
1321 *
1322 * @warning If and when this function is called depends on the underlying
1323 * windowing system.
1324 */
1325EAPI void ecore_evas_callback_focus_out_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func);
1326/**
1327 * Set a callback for Ecore_Evas sticky events.
1328 * @param ee The Ecore_Evas to set callbacks on
1329 * @param func The function to call
1330
1331 * A call to this function will set a callback on an Ecore_Evas, causing
1332 * @p func to be called whenever @p ee becomes sticky.
1333 *
1334 * @warning If and when this function is called depends on the underlying
1335 * windowing system.
1336 */
1337EAPI void ecore_evas_callback_sticky_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func);
1338/**
1339 * Set a callback for Ecore_Evas un-sticky events.
1340 * @param ee The Ecore_Evas to set callbacks on
1341 * @param func The function to call
1342
1343 * A call to this function will set a callback on an Ecore_Evas, causing
1344 * @p func to be called whenever @p ee becomes un-sticky.
1345 *
1346 * @warning If and when this function is called depends on the underlying
1347 * windowing system.
1348 */
1349EAPI void ecore_evas_callback_unsticky_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func);
1350/**
1351 * Set a callback for Ecore_Evas mouse in events.
1352 * @param ee The Ecore_Evas to set callbacks on
1353 * @param func The function to call
1354
1355 * A call to this function will set a callback on an Ecore_Evas, causing
1356 * @p func to be called whenever the mouse enters @p ee.
1357 *
1358 * @warning If and when this function is called depends on the underlying
1359 * windowing system.
1360 */
1361EAPI void ecore_evas_callback_mouse_in_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func);
1362/**
1363 * Set a callback for Ecore_Evas mouse out events.
1364 * @param ee The Ecore_Evas to set callbacks on
1365 * @param func The function to call
1366
1367 * A call to this function will set a callback on an Ecore_Evas, causing
1368 * @p func to be called whenever the mouse leaves @p ee.
1369 *
1370 * @warning If and when this function is called depends on the underlying
1371 * windowing system.
1372 */
1373EAPI void ecore_evas_callback_mouse_out_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func);
1374/**
1375 * Set a callback for Ecore_Evas pre render events.
1376 * @param ee The Ecore_Evas to set callbacks on
1377 * @param func The function to call
1378
1379 * A call to this function will set a callback on an Ecore_Evas, causing
1380 * @p func to be called just before the evas in @p ee is rendered.
1381 *
1382 * @warning If and when this function is called depends on the underlying
1383 * windowing system.
1384 */
1385EAPI void ecore_evas_callback_pre_render_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func);
1386/**
1387 * Set a callback for Ecore_Evas mouse post render events.
1388 * @param ee The Ecore_Evas to set callbacks on
1389 * @param func The function to call
1390
1391 * A call to this function will set a callback on an Ecore_Evas, causing
1392 * @p func to be called just after the evas in @p ee is rendered.
1393 *
1394 * @warning If and when this function is called depends on the underlying
1395 * windowing system.
1396 */
1397EAPI void ecore_evas_callback_post_render_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func);
1398/**
1399 * Set a callback for Ecore_Evas pre-free event.
1400 * @param ee The Ecore_Evas to set callbacks on
1401 * @param func The function to call
1402 *
1403 * A call to this function will set a callback on an Ecore_Evas, causing
1404 * @p func to be called just before the instance @p ee is freed.
1405 *
1406 * @warning If and when this function is called depends on the underlying
1407 * windowing system.
1408 */
1409EAPI void ecore_evas_callback_pre_free_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func);
1410/**
1411 * Set a callback for Ecore_Evas state changes.
1412 * @param ee The Ecore_Evas to set callbacks on
1413 * @param func The function to call
1414
1415 * A call to this function will set a callback on an Ecore_Evas, causing
1416 * @p func to be called whenever @p ee changes state.
1417 *
1418 * @since 1.2
1419 * @warning If and when this function is called depends on the underlying
1420 * windowing system.
1421 */
1422EAPI void ecore_evas_callback_state_change_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func);
1423
1424/**
1425 * Get an Ecore_Evas's Evas
1426 * @param ee The Ecore_Evas whose Evas you wish to get
1427 * @return The Evas wrapped by @p ee
1428 *
1429 * This function returns the Evas contained within @p ee.
1430 */
1431EAPI Evas *ecore_evas_get(const Ecore_Evas *ee);
1432
1433/**
1434 * Provide Managed move co-ordinates for an Ecore_Evas
1435 * @param ee The Ecore_Evas to move
1436 * @param x The x coordinate to set as the managed location
1437 * @param y The y coordinate to set as the managed location
1438 *
1439 * This sets the managed geometry position of the @p ee to (@p x, @p y)
1440 */
1441EAPI void ecore_evas_managed_move(Ecore_Evas *ee, int x, int y);
1442
1443/**
1444 * Set whether an Ecore_Evas is shaped or not.
1445 *
1446 * @param ee The Ecore_Evas to shape.
1447 * @param shaped @c EINA_TRUE to shape, @c EINA_FALSE to not.
1448 *
1449 * This function allows one to make an Ecore_Evas shaped to the contents of the
1450 * evas. If @p shaped is @c EINA_TRUE, @p ee will be transparent in parts of
1451 * the evas that contain no objects. If @p shaped is @c EINA_FALSE, then @p ee
1452 * will be rectangular, and parts with no data will show random framebuffer
1453 * artifacting. For non-shaped Ecore_Evases, it is recommended to cover the
1454 * entire evas with a background object.
1455 */
1456EAPI void ecore_evas_shaped_set(Ecore_Evas *ee, Eina_Bool shaped);
1457
1458/**
1459 * Query whether an Ecore_Evas is shaped or not.
1460 *
1461 * @param ee The Ecore_Evas to query.
1462 * @return @c EINA_TRUE if shaped, @c EINA_FALSE if not.
1463 *
1464 * This function returns @c EINA_TRUE if @p ee is shaped, and @c EINA_FALSE if not.
1465 */
1466EAPI Eina_Bool ecore_evas_shaped_get(const Ecore_Evas *ee);
1467/**
1468 * @brief Show an Ecore_Evas' window
1469 *
1470 * @param ee The Ecore_Evas to show.
1471 *
1472 * This function makes @p ee visible.
1473 */
1474EAPI void ecore_evas_show(Ecore_Evas *ee);
1475/**
1476 * @brief Hide an Ecore_Evas' window
1477 *
1478 * @param ee The Ecore_Evas to hide.
1479 *
1480 * This function makes @p ee hidden(not visible).
1481 */
1482EAPI void ecore_evas_hide(Ecore_Evas *ee);
1483
1484/**
1485 * Activate (set focus to, via the window manager) an Ecore_Evas' window.
1486 * @param ee The Ecore_Evas to activate.
1487 *
1488 * This functions activates the Ecore_Evas.
1489 */
1490EAPI void ecore_evas_activate(Ecore_Evas *ee);
1491
1492
1493/**
1494 * Set the minimum size of a given @c Ecore_Evas window
1495 *
1496 * @param ee An @c Ecore_Evas window's handle
1497 * @param w The minimum width
1498 * @param h The minimum height
1499 *
1500 * This function sets the minimum size of @p ee to be @p w x @p h.
1501 * One won't be able to resize that window to dimensions smaller than
1502 * the ones set.
1503 *
1504 * @note When base sizes are set, via ecore_evas_size_base_set(),
1505 * they'll be used to calculate a window's minimum size, instead of
1506 * those set by this function.
1507 *
1508 * @see ecore_evas_size_min_get()
1509 */
1510EAPI void ecore_evas_size_min_set(Ecore_Evas *ee, int w, int h);
1511
1512/**
1513 * Get the minimum size set for a given @c Ecore_Evas window
1514 *
1515 * @param ee An @c Ecore_Evas window's handle
1516 * @param w A pointer to an int to place the minimum width in.
1517 * @param h A pointer to an int to place the minimum height in.
1518 *
1519 * @note Use @c NULL pointers on the size components you're not
1520 * interested in: they'll be ignored by the function.
1521 *
1522 * @see ecore_evas_size_min_set() for more details
1523 */
1524EAPI void ecore_evas_size_min_get(const Ecore_Evas *ee, int *w, int *h);
1525
1526/**
1527 * Set the maximum size of a given @c Ecore_Evas window
1528 *
1529 * @param ee An @c Ecore_Evas window's handle
1530 * @param w The maximum width
1531 * @param h The maximum height
1532 *
1533 * This function sets the maximum size of @p ee to be @p w x @p h.
1534 * One won't be able to resize that window to dimensions bigger than
1535 * the ones set.
1536 *
1537 * @see ecore_evas_size_max_get()
1538 */
1539EAPI void ecore_evas_size_max_set(Ecore_Evas *ee, int w, int h);
1540
1541/**
1542 * Get the maximum size set for a given @c Ecore_Evas window
1543 *
1544 * @param ee An @c Ecore_Evas window's handle
1545 * @param w A pointer to an int to place the maximum width in.
1546 * @param h A pointer to an int to place the maximum height in.
1547 *
1548 * @note Use @c NULL pointers on the size components you're not
1549 * interested in: they'll be ignored by the function.
1550 *
1551 * @see ecore_evas_size_max_set() for more details
1552 */
1553EAPI void ecore_evas_size_max_get(const Ecore_Evas *ee, int *w, int *h);
1554
1555/**
1556 * Set the base size for a given @c Ecore_Evas window
1557 *
1558 * @param ee An @c Ecore_Evas window's handle
1559 * @param w The base width
1560 * @param h The base height
1561 *
1562 * This function sets the @b base size of @p ee to be @p w x @p h.
1563 * When base sizes are set, they'll be used to calculate a window's
1564 * @b minimum size, instead of those set by ecore_evas_size_min_get().
1565 *
1566 * @see ecore_evas_size_base_get()
1567 */
1568EAPI void ecore_evas_size_base_set(Ecore_Evas *ee, int w, int h);
1569
1570/**
1571 * Get the base size set for a given @c Ecore_Evas window
1572 *
1573 * @param ee An @c Ecore_Evas window's handle
1574 * @param w A pointer to an int to place the base width in.
1575 * @param h A pointer to an int to place the base height in.
1576 *
1577 * @note Use @c NULL pointers on the size components you're not
1578 * interested in: they'll be ignored by the function.
1579 *
1580 * @see ecore_evas_size_base_set() for more details
1581 */
1582EAPI void ecore_evas_size_base_get(const Ecore_Evas *ee, int *w, int *h);
1583
1584/**
1585 * Set the "size step" for a given @c Ecore_Evas window
1586 *
1587 * @param ee An @c Ecore_Evas window's handle
1588 * @param w The step width
1589 * @param h The step height
1590 *
1591 * This function sets the size steps of @p ee to be @p w x @p h. This
1592 * limits the size of this @c Ecore_Evas window to be @b always an
1593 * integer multiple of the step size, for each axis.
1594 */
1595EAPI void ecore_evas_size_step_set(Ecore_Evas *ee, int w, int h);
1596
1597/**
1598 * Get the "size step" set for a given @c Ecore_Evas window
1599 *
1600 * @param ee An @c Ecore_Evas window's handle
1601 * @param w A pointer to an int to place the step width in.
1602 * @param h A pointer to an int to place the step height in.
1603 *
1604 * @note Use @c NULL pointers on the size components you're not
1605 * interested in: they'll be ignored by the function.
1606 *
1607 * @see ecore_evas_size_base_set() for more details
1608 */
1609EAPI void ecore_evas_size_step_get(const Ecore_Evas *ee, int *w, int *h);
1610
1611/**
1612 * @brief Set the cursor of an Ecore_Evas.
1613 *
1614 * @param ee The Ecore_Evas
1615 * @param file The path to an image file for the cursor.
1616 * @param layer The layer in which the cursor will appear.
1617 * @param hot_x The x coordinate of the cursor's hot spot.
1618 * @param hot_y The y coordinate of the cursor's hot spot.
1619 *
1620 * This function makes the mouse cursor over @p ee be the image specified by
1621 * @p file. The actual point within the image that the mouse is at is specified
1622 * by @p hot_x and @p hot_y, which are coordinates with respect to the top left
1623 * corner of the cursor image.
1624 *
1625 * @note This function creates an object from the image and uses
1626 * ecore_evas_object_cursor_set().
1627 *
1628 * @see ecore_evas_object_cursor_set()
1629 */
1630EAPI void ecore_evas_cursor_set(Ecore_Evas *ee, const char *file, int layer, int hot_x, int hot_y);
1631/**
1632 * @brief Get information about an Ecore_Evas' cursor
1633 *
1634 * @param ee The Ecore_Evas to set
1635 * @param obj A pointer to an Evas_Object to place the cursor Evas_Object.
1636 * @param layer A pointer to an int to place the cursor's layer in.
1637 * @param hot_x A pointer to an int to place the cursor's hot_x coordinate in.
1638 * @param hot_y A pointer to an int to place the cursor's hot_y coordinate in.
1639 *
1640 * This function queries information about an Ecore_Evas' cursor.
1641 *
1642 * @see ecore_evas_cursor_set()
1643 * @see ecore_evas_object_cursor_set()
1644 */
1645EAPI void ecore_evas_cursor_get(const Ecore_Evas *ee, Evas_Object **obj, int *layer, int *hot_x, int *hot_y);
1646/**
1647 * @brief Set the cursor of an Ecore_Evas
1648 *
1649 * @param ee The Ecore_Evas
1650 *
1651 * @param obj The Evas_Object which will be the cursor.
1652 * @param layer The layer in which the cursor will appear.
1653 * @param hot_x The x coordinate of the cursor's hot spot.
1654 * @param hot_y The y coordinate of the cursor's hot spot.
1655 *
1656 * This function makes the mouse cursor over @p ee be the object specified by
1657 * @p obj. The actual point within the object that the mouse is at is specified
1658 * by @p hot_x and @p hot_y, which are coordinates with respect to the top left
1659 * corner of the cursor object.
1660 *
1661 * @see ecore_evas_cursor_set()
1662 */
1663EAPI void ecore_evas_object_cursor_set(Ecore_Evas *ee, Evas_Object *obj, int layer, int hot_x, int hot_y);
1664
1665/**
1666 * Tell the WM whether or not to ignore an Ecore_Evas' window
1667 *
1668 * @param ee The Ecore_Evas.
1669 * @param on @c EINA_TRUE to ignore, @c EINA_FALSE to not.
1670 *
1671 * This function causes the window manager to ignore @p ee if @p on is
1672 * @c EINA_TRUE, or not ignore @p ee if @p on is @c EINA_FALSE.
1673 */
1674EAPI void ecore_evas_override_set(Ecore_Evas *ee, Eina_Bool on);
1675
1676/**
1677 * Query whether an Ecore_Evas' window is overridden or not
1678 *
1679 * @param ee The Ecore_Evas to set.
1680 * @return @c EINA_TRUE if @p ee is overridden, @c EINA_FALSE if not.
1681 */
1682EAPI Eina_Bool ecore_evas_override_get(const Ecore_Evas *ee);
1683
1684/**
1685 * Set whether or not an Ecore_Evas' window should avoid damage
1686 *
1687 * @param ee The Ecore_Evas
1688 * @param on The type of the damage management
1689 *
1690 * This option causes updates of the Ecore_Evas to be done on a pixmap, and
1691 * then copied to the window, or the pixmap used directly on the window,
1692 * depending on the setting. Possible options are:
1693 *
1694 * @li @ref ECORE_EVAS_AVOID_DAMAGE_NONE - every expose event triggers a new
1695 * damage and consequently render of the affected area. The rendering of things
1696 * happens directly on the window;
1697 *
1698 * @li @ref ECORE_EVAS_AVOID_DAMAGE_EXPOSE - there's a pixmap where everything
1699 * is rendered into, and then copied to the window. On expose events, there's
1700 * no need to render things again, just to copy the exposed region to the
1701 * window;
1702 *
1703 * @li @ref ECORE_EVAS_AVOID_DAMAGE_BUILT_IN - there's the same pixmap as the
1704 * previous one, but it is set as a "background pixmap" of the window. The
1705 * rendered things appear directly on the window, with no need to copy
1706 * anything, but would stay stored on the pixmap, so there's no need to render
1707 * things again on expose events. This option can be faster than the previous
1708 * one, but may lead to artifacts during resize of the window.
1709 */
1710EAPI void ecore_evas_avoid_damage_set(Ecore_Evas *ee, Ecore_Evas_Avoid_Damage_Type on);
1711
1712/**
1713 * Query whether an Ecore_Evas' window avoids damage or not
1714 * @param ee The Ecore_Evas to set
1715 * @return The type of the damage management
1716 *
1717 */
1718EAPI Ecore_Evas_Avoid_Damage_Type ecore_evas_avoid_damage_get(const Ecore_Evas *ee);
1719
1720/**
1721 * Set the withdrawn state of an Ecore_Evas' window.
1722 * @param ee The Ecore_Evas whose window's withdrawn state is set.
1723 * @param withdrawn The Ecore_Evas window's new withdrawn state.
1724 *
1725 */
1726EAPI void ecore_evas_withdrawn_set(Ecore_Evas *ee, Eina_Bool withdrawn);
1727
1728/**
1729 * Returns the withdrawn state of an Ecore_Evas' window.
1730 * @param ee The Ecore_Evas whose window's withdrawn state is returned.
1731 * @return The Ecore_Evas window's withdrawn state.
1732 *
1733 */
1734EAPI Eina_Bool ecore_evas_withdrawn_get(const Ecore_Evas *ee);
1735
1736/**
1737 * Set the sticky state of an Ecore_Evas window.
1738 *
1739 * @param ee The Ecore_Evas whose window's sticky state is set.
1740 * @param sticky The Ecore_Evas window's new sticky state.
1741 *
1742 */
1743EAPI void ecore_evas_sticky_set(Ecore_Evas *ee, Eina_Bool sticky);
1744
1745/**
1746 * Returns the sticky state of an Ecore_Evas' window.
1747 *
1748 * @param ee The Ecore_Evas whose window's sticky state is returned.
1749 * @return The Ecore_Evas window's sticky state.
1750 *
1751 */
1752EAPI Eina_Bool ecore_evas_sticky_get(const Ecore_Evas *ee);
1753EAPI void ecore_evas_manual_render_set(Ecore_Evas *ee, Eina_Bool manual_render);
1754EAPI Eina_Bool ecore_evas_manual_render_get(const Ecore_Evas *ee);
1755
1756/**
1757 * @brief Registers an @c Ecore_Evas to receive events through ecore_input_evas.
1758 *
1759 * @param ee The @c Ecore_Evas handle.
1760 *
1761 * This function calls ecore_event_window_register() with the @p ee as its @c
1762 * id argument, @c window argument, and uses its @c Evas too. It is useful when
1763 * no @c window information is available on a given @c Ecore_Evas backend.
1764 *
1765 * @see ecore_evas_input_event_unregister()
1766 * @since 1.1
1767 */
1768EAPI void ecore_evas_input_event_register(Ecore_Evas *ee);
1769/**
1770 * @brief Unregisters an @c Ecore_Evas receiving events through ecore_input_evas.
1771 *
1772 * @param ee The @c Ecore_Evas handle.
1773 *
1774 * @see ecore_evas_input_event_register()
1775 * @since 1.1
1776 */
1777EAPI void ecore_evas_input_event_unregister(Ecore_Evas *ee);
1778
1779/**
1780 * @brief Force immediate rendering on a given @c Ecore_Evas window
1781 *
1782 * @param ee An @c Ecore_Evas handle
1783 *
1784 * Use this call to forcefully flush the @p ee's canvas rendering
1785 * pipeline, thus bring its window to an up to date state.
1786 */
1787EAPI void ecore_evas_manual_render(Ecore_Evas *ee);
1788EAPI void ecore_evas_comp_sync_set(Ecore_Evas *ee, Eina_Bool do_sync);
1789EAPI Eina_Bool ecore_evas_comp_sync_get(const Ecore_Evas *ee);
1790
1791/**
1792 * @brief Get geometry of screen associated with this Ecore_Evas.
1793 *
1794 * @param ee The Ecore_Evas whose window's to query container screen geometry.
1795 * @param x where to return the horizontal offset value. May be @c NULL.
1796 * @param y where to return the vertical offset value. May be @c NULL.
1797 * @param w where to return the width value. May be @c NULL.
1798 * @param h where to return the height value. May be @c NULL.
1799 *
1800 * @since 1.1
1801 */
1802EAPI void ecore_evas_screen_geometry_get(const Ecore_Evas *ee, int *x, int *y, int *w, int *h);
1803
1804/**
1805 * @brief Get the dpi of the screen the Ecore_Evas is primarily on.
1806 *
1807 * @param ee The Ecore_Evas whose window's to query.
1808 * @param xdpi Pointer to integer to store horizontal DPI. May be @c NULL.
1809 * @param ydpi Pointer to integer to store vertical DPI. May be @c NULL.
1810 *
1811 * @since 1.7
1812 */
1813EAPI void ecore_evas_screen_dpi_get(const Ecore_Evas *ee, int *xdpi, int *ydpi);
1814
1815EAPI void ecore_evas_draw_frame_set(Ecore_Evas *ee, Eina_Bool draw_frame);
1816EAPI Eina_Bool ecore_evas_draw_frame_get(const Ecore_Evas *ee);
1817
1818/**
1819 * @brief Associate the given object to this ecore evas.
1820 *
1821 * @param ee The Ecore_Evas to associate to @a obj
1822 * @param obj The object to associate to @a ee
1823 * @param flags The association flags.
1824 * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
1825 *
1826 * Association means that operations on one will affect the other, for
1827 * example moving the object will move the window, resize the object will
1828 * also affect the ecore evas window, hide and show applies as well.
1829 *
1830 * This is meant to simplify development, since you often need to associate
1831 * these events with your "base" objects, background or bottom-most object.
1832 *
1833 * Be aware that some methods might not be what you would like, deleting
1834 * either the window or the object will delete the other. If you want to
1835 * change that behavior, let's say to hide window when it's closed, you
1836 * must use ecore_evas_callback_delete_request_set() and set your own code,
1837 * like ecore_evas_hide(). Just remember that if you override delete_request
1838 * and still want to delete the window/object, you must do that yourself.
1839 *
1840 * Since we now define delete_request, deleting windows will not quit
1841 * main loop, if you wish to do so, you should listen for EVAS_CALLBACK_FREE
1842 * on the object, that way you get notified and you can call
1843 * ecore_main_loop_quit().
1844 *
1845 * Flags can be OR'ed of:
1846 * @li ECORE_EVAS_OBJECT_ASSOCIATE_BASE (or 0): to listen to basic events
1847 * like delete, resize and move, but no stacking or layer are used.
1848 * @li ECORE_EVAS_OBJECT_ASSOCIATE_STACK: stacking operations will act
1849 * on the Ecore_Evas, not the object. So evas_object_raise() will
1850 * call ecore_evas_raise(). Relative operations (stack_above, stack_below)
1851 * are still not implemented.
1852 * @li ECORE_EVAS_OBJECT_ASSOCIATE_LAYER: stacking operations will act
1853 * on the Ecore_Evas, not the object. So evas_object_layer_set() will
1854 * call ecore_evas_layer_set().
1855 * @li ECORE_EVAS_OBJECT_ASSOCIATE_DEL: the object delete will delete the
1856 * ecore_evas as well as delete_requests on the ecore_evas will delete
1857 * etc.
1858 */
1859EAPI Eina_Bool ecore_evas_object_associate(Ecore_Evas *ee, Evas_Object *obj, Ecore_Evas_Object_Associate_Flags flags);
1860/**
1861 * @brief Cancel the association set with ecore_evas_object_associate().
1862 *
1863 * @param ee The Ecore_Evas to dissociate from @a obj
1864 * @param obj The object to dissociate from @a ee
1865 * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
1866 */
1867EAPI Eina_Bool ecore_evas_object_dissociate(Ecore_Evas *ee, Evas_Object *obj);
1868/**
1869 * @brief Get the object associated with @p ee
1870 *
1871 * @param ee The Ecore_Evas to get the object from.
1872 * @return The associated object, or @c NULL if there is no associated object.
1873 */
1874EAPI Evas_Object *ecore_evas_object_associate_get(const Ecore_Evas *ee);
1875
1876/* helper function to be used with ECORE_GETOPT_CALLBACK_*() */
1877EAPI 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);
1878
1879/**
1880 * @brief Get a list of all the ecore_evases.
1881 *
1882 * @return A list of ecore_evases.
1883 *
1884 * The returned list of ecore evases is only valid until the canvases are
1885 * destroyed (and should not be cached for instance). The list can be freed by
1886 * just deleting the list.
1887 */
1888EAPI Eina_List *ecore_evas_ecore_evas_list_get(void);
1889
1890/* specific calls to an x11 environment ecore_evas */
1891EAPI void ecore_evas_x11_leader_set(Ecore_Evas *ee, Ecore_X_Window win);
1892EAPI Ecore_X_Window ecore_evas_x11_leader_get(Ecore_Evas *ee);
1893EAPI void ecore_evas_x11_leader_default_set(Ecore_Evas *ee);
1894EAPI void ecore_evas_x11_shape_input_rectangle_set(Ecore_Evas *ee, int x, int y, int w, int h);
1895EAPI void ecore_evas_x11_shape_input_rectangle_add(Ecore_Evas *ee, int x, int y, int w, int h);
1896EAPI void ecore_evas_x11_shape_input_rectangle_subtract(Ecore_Evas *ee, int x, int y, int w, int h);
1897EAPI void ecore_evas_x11_shape_input_empty(Ecore_Evas *ee);
1898EAPI void ecore_evas_x11_shape_input_reset(Ecore_Evas *ee);
1899EAPI void ecore_evas_x11_shape_input_apply(Ecore_Evas *ee);
1900
1901/**
1902 * @defgroup Ecore_Evas_Ews Ecore_Evas Single Process Windowing System.
1903 *
1904 * These are global scope functions to manage the EWS to be used by
1905 * ecore_evas_ews_new().
1906 *
1907 * @since 1.1
1908 * @{
1909 */
1910
1911/**
1912 * Sets the engine to be used by the backing store engine.
1913 *
1914 * @param engine The engine to be set.
1915 * @param options The options of the engine to be set.
1916 * @return @c EINA_TRUE on success, @c EINA_FALSE if ews is already in use.
1917 * @since 1.1
1918 */
1919EAPI Eina_Bool ecore_evas_ews_engine_set(const char *engine, const char *options);
1920
1921/**
1922 * Reconfigure the backing store used.
1923 *
1924 * @param x The X coordinate to be used.
1925 * @param y The Y coordinate to be used.
1926 * @param w The width of the Ecore_Evas to setup.
1927 * @param h The height of the Ecore_Evas to setup.
1928 * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
1929 * @since 1.1
1930 */
1931EAPI Eina_Bool ecore_evas_ews_setup(int x, int y, int w, int h);
1932
1933/**
1934 * Return the internal backing store in use.
1935 *
1936 * @return The internal backing store in use.
1937 * @note this will forced it to be created, making future calls to
1938 * ecore_evas_ews_engine_set() void.
1939 *
1940 * @see ecore_evas_ews_evas_get()
1941 * @since 1.1
1942 */
1943EAPI Ecore_Evas *ecore_evas_ews_ecore_evas_get(void);
1944
1945/**
1946 * Return the internal backing store in use.
1947 *
1948 * @return The internal backing store in use.
1949 * @note this will forced it to be created, making future calls to
1950 * ecore_evas_ews_engine_set() void.
1951 *
1952 * @see ecore_evas_ews_ecore_evas_get()
1953 * @since 1.1
1954 */
1955EAPI Evas *ecore_evas_ews_evas_get(void);
1956
1957/**
1958 * Get the current background.
1959 */
1960EAPI Evas_Object *ecore_evas_ews_background_get(void);
1961
1962/**
1963 * Set the current background, must be created at evas ecore_evas_ews_evas_get()
1964 *
1965 * It will be kept at lowest layer (EVAS_LAYER_MIN) and below
1966 * everything else. You can set any object, default is a black
1967 * rectangle.
1968 *
1969 * @note previous object will be deleted!
1970 * @param o The Evas_Object for which to set the background.
1971 */
1972EAPI void ecore_evas_ews_background_set(Evas_Object *o);
1973
1974/**
1975 * Return all Ecore_Evas* created by EWS.
1976 *
1977 * @return An eina list of Ecore_evases.
1978 e @note Do not change the returned list or its contents.
1979 * @since 1.1
1980 */
1981EAPI const Eina_List *ecore_evas_ews_children_get(void);
1982
1983/**
1984 * Set the identifier of the manager taking care of internal windows.
1985 *
1986 * The ECORE_EVAS_EWS_EVENT_MANAGER_CHANGE event is issued. Consider
1987 * handling it to know if you should stop handling events yourself
1988 * (ie: another manager took over)
1989 *
1990 * @param manager any unique identifier address.
1991 *
1992 * @see ecore_evas_ews_manager_get()
1993 * @since 1.1
1994 */
1995EAPI void ecore_evas_ews_manager_set(const void *manager);
1996
1997/**
1998 * Get the identifier of the manager taking care of internal windows.
1999 *
2000 * @return the value set by ecore_evas_ews_manager_set()
2001 * @since 1.1
2002 */
2003EAPI const void *ecore_evas_ews_manager_get(void);
2004
2005EAPI extern int ECORE_EVAS_EWS_EVENT_MANAGER_CHANGE; /**< manager was changed @since 1.1 */
2006EAPI extern int ECORE_EVAS_EWS_EVENT_ADD; /**< window was created @since 1.1 */
2007EAPI 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 */
2008EAPI extern int ECORE_EVAS_EWS_EVENT_RESIZE; /**< window was resized @since 1.1 */
2009EAPI extern int ECORE_EVAS_EWS_EVENT_MOVE; /**< window was moved @since 1.1 */
2010EAPI extern int ECORE_EVAS_EWS_EVENT_SHOW; /**< window become visible @since 1.1 */
2011EAPI extern int ECORE_EVAS_EWS_EVENT_HIDE; /**< window become hidden @since 1.1 */
2012EAPI extern int ECORE_EVAS_EWS_EVENT_FOCUS; /**< window was focused @since 1.1 */
2013EAPI extern int ECORE_EVAS_EWS_EVENT_UNFOCUS; /**< window lost focus @since 1.1 */
2014EAPI extern int ECORE_EVAS_EWS_EVENT_RAISE; /**< window was raised @since 1.1 */
2015EAPI extern int ECORE_EVAS_EWS_EVENT_LOWER; /**< window was lowered @since 1.1 */
2016EAPI extern int ECORE_EVAS_EWS_EVENT_ACTIVATE; /**< window was activated @since 1.1 */
2017
2018EAPI extern int ECORE_EVAS_EWS_EVENT_ICONIFIED_CHANGE; /**< window minimized/iconified changed @since 1.1 */
2019EAPI extern int ECORE_EVAS_EWS_EVENT_MAXIMIZED_CHANGE; /**< window maximized changed @since 1.1 */
2020EAPI extern int ECORE_EVAS_EWS_EVENT_LAYER_CHANGE; /**< window layer changed @since 1.1 */
2021EAPI extern int ECORE_EVAS_EWS_EVENT_FULLSCREEN_CHANGE; /**< window fullscreen changed @since 1.1 */
2022EAPI extern int ECORE_EVAS_EWS_EVENT_CONFIG_CHANGE; /**< some other window property changed (title, name, class, alpha, transparent, shaped...) @since 1.1 */
2023
2024/**
2025 * @}
2026 */
2027
2028/**
2029 * @defgroup Ecore_Evas_Extn External plug/socket infrastructure to remote canvases
2030 *
2031 * These functions allow 1 process to create a "socket" was pluged into which another
2032 * process can create a "plug" remotely to plug into.
2033 * Socket can provides content for several plugs.
2034 * This is best for small sized objects (about the size range
2035 * of a small icon up to a few large icons). Sine the plug is actually an
2036 * image object, you can fetch the pixel data
2037 *
2038 * @since 1.2
2039 * @{
2040 */
2041
2042EAPI extern int ECORE_EVAS_EXTN_CLIENT_ADD; /**< this event is received when a plug has connected to an extn socket @since 1.2 */
2043EAPI extern int ECORE_EVAS_EXTN_CLIENT_DEL; /**< this event is received when a plug has disconnected from an extn socket @since 1.2 */
2044
2045/**
2046 * @brief Create a new Ecore_Evas canvas for the new external ecore evas socket
2047 *
2048 * @param w The width of the canvas, in pixels
2049 * @param h The height of the canvas, in pixels
2050 * @return A new @c Ecore_Evas instance or @c NULL, on failure
2051 *
2052 * This creates a new extn_socket canvas wrapper, with image data array
2053 * @b bound to the ARGB format, 8 bits per pixel.
2054 *
2055 * If creation is successful, an Ecore_Evas handle is returned or @c NULL if
2056 * creation fails. Also focus, show, hide etc. callbacks will also be called
2057 * if the plug object is shown, or already visible on connect, or if it is
2058 * hidden later, focused or unfocused.
2059 *
2060 * This function has to be flowed by ecore_evas_extn_socket_listen(),
2061 * for starting ecore ipc service.
2062 *
2063 * @code
2064 * Eina_Bool res = EINA_FALSE;
2065 * Ecore_Evas *ee = ecore_evas_extn_socket_new(1, 1);
2066 *
2067 * res = ecore_evas_extn_socket_listen("svcname", 1, EINA_FALSE);
2068 * if (!res) return;
2069 * ecore_evas_resize(ee, 240, 400);
2070 * @endcode
2071 *
2072 * or
2073 *
2074 * @code
2075 * Eina_Bool res = EINA_FALSE;
2076 * Ecore_Evas *ee = ecore_evas_extn_socket_new(240, 400);
2077 *
2078 * res = ecore_evas_extn_socket_listen("svcname", 1, EINA_FALSE);
2079 * if (!res) return;
2080 * @endcode
2081 *
2082 * When a client(plug) connects, you will get the ECORE_EVAS_EXTN_CLIENT_ADD event
2083 * in the ecore event queue, with event_info being the image object pointer
2084 * passed as a void pointer. When a client disconnects you will get the
2085 * ECORE_EVAS_EXTN_CLIENT_DEL event.
2086 *
2087 * You can set up event handles for these events as follows:
2088 *
2089 * @code
2090 * static void client_add_cb(void *data, int event, void *event_info)
2091 * {
2092 * Evas_Object *obj = event_info;
2093 * printf("client added to image object %p\n", obj);
2094 * evas_object_show(obj);
2095 * }
2096 *
2097 * static void client_del_cb(void *data, int event, void *event_info)
2098 * {
2099 * Evas_Object *obj = event_info;
2100 * printf("client deleted from image object %p\n", obj);
2101 * evas_object_hide(obj);
2102 * }
2103 *
2104 * void setup(void)
2105 * {
2106 * ecore_event_handler_add(ECORE_EVAS_EXTN_CLIENT_ADD,
2107 * client_add_cb, NULL);
2108 * ecore_event_handler_add(ECORE_EVAS_EXTN_CLIENT_DEL,
2109 * client_del_cb, NULL);
2110 * }
2111 * @endcode
2112 *
2113 * Note that events come in later after the event happened. You may want to be
2114 * careful as data structures you had associated with the image object
2115 * may have been freed after deleting, but the object may still be around
2116 * awating cleanup and thus still be valid.You can change the size with something like:
2117 *
2118 * @see ecore_evas_extn_socket_listen()
2119 * @see ecore_evas_extn_plug_new()
2120 * @see ecore_evas_extn_plug_object_data_lock()
2121 * @see ecore_evas_extn_plug_object_data_unlock()
2122 *
2123 * @since 1.2
2124 */
2125EAPI Ecore_Evas *ecore_evas_extn_socket_new(int w, int h);
2126
2127/**
2128 * @brief Create a socket to provide the service for external ecore evas
2129 * socket.
2130 *
2131 * @param ee The Ecore_Evas.
2132 * @param svcname The name of the service to be advertised. ensure that it is
2133 * unique (when combined with @p svcnum) otherwise creation may fail.
2134 * @param svcnum A number (any value, @c 0 being the common default) to
2135 * differentiate multiple instances of services with the same name.
2136 * @param svcsys A boolean that if true, specifies to create a system-wide
2137 * service all users can connect to, otherwise the service is private to the
2138 * user ide that created the service.
2139 * @return @c EINA_TRUE if creation is successful, @c EINA_FALSE if it does
2140 * not.
2141 *
2142 * This creates socket specified by @p svcname, @p svcnum and @p svcsys. If
2143 * creation is successful, @c EINA_TRUE is returned or @c EINA_FALSE if
2144 * creation fails.
2145 *
2146 * @see ecore_evas_extn_socket_new()
2147 * @see ecore_evas_extn_plug_new()
2148 * @see ecore_evas_extn_plug_object_data_lock()
2149 * @see ecore_evas_extn_plug_object_data_unlock()
2150 *
2151 * @since 1.2
2152 */
2153EAPI Eina_Bool ecore_evas_extn_socket_listen(Ecore_Evas *ee, const char *svcname, int svcnum, Eina_Bool svcsys);
2154
2155/**
2156 * @brief Lock the pixel data so the socket cannot change it
2157 *
2158 * @param obj The image object returned by ecore_evas_extn_plug_new() to lock
2159 *
2160 * You may need to get the image pixel data with evas_object_image_data_get()
2161 * from the image object, but need to ensure that it does not change while
2162 * you are using the data. This function lets you set an advisory lock on the
2163 * image data so the external plug process will not render to it or alter it.
2164 *
2165 * You should only hold the lock for just as long as you need to read out the
2166 * image data or otherwise deal with it, and then unlock it with
2167 * ecore_evas_extn_plug_object_data_unlock(). Keeping a lock over more than
2168 * 1 iteration of the main ecore loop will be problematic, so avoid it. Also
2169 * forgetting to unlock may cause the socket process to freeze and thus create
2170 * odd behavior.
2171 *
2172 * @see ecore_evas_extn_plug_new()
2173 * @see ecore_evas_extn_plug_object_data_unlock()
2174 *
2175 * @since 1.2
2176 */
2177EAPI void ecore_evas_extn_plug_object_data_lock(Evas_Object *obj);
2178
2179/**
2180 * @brief Unlock the pixel data so the socket can change it again.
2181 *
2182 * @param obj The image object returned by ecore_evas_extn_plug_new() to unlock
2183 *
2184 * This unlocks after an advisor lock has been taken by
2185 * ecore_evas_extn_plug_object_data_lock().
2186 *
2187 * @see ecore_evas_extn_plug_new()
2188 * @see ecore_evas_extn_plug_object_data_lock()
2189 *
2190 * @since 1.2
2191 */
2192EAPI void ecore_evas_extn_plug_object_data_unlock(Evas_Object *obj);
2193
2194/**
2195 * @brief Create a new external ecore evas plug
2196 *
2197 * @param ee_target The Ecore_Evas containing the canvas in which the new image object will live.
2198 * @return An evas image object that will contain the image output of a socket.
2199 *
2200 * This creates an image object that will contain the output of another
2201 * processes socket canvas when it connects. All input will be sent back to
2202 * this process as well, effectively swallowing or placing the socket process
2203 * in the canvas of the plug process in place of the image object. The image
2204 * object by default is created to be filled (equivalent of
2205 * evas_object_image_filled_add() on creation) so image content will scale
2206 * to fill the image unless otherwise reconfigured. The Ecore_Evas size
2207 * of the plug is the master size and determines size in pixels of the
2208 * plug canvas. You can change the size with something like:
2209 *
2210 * @code
2211 * Eina_Bool res = EINA_FALSE;
2212 * Evas_Object *obj = ecore_evas_extn_plug_new(ee);
2213 *
2214 * res = ecore_evas_extn_plug_connect("svcname", 1, EINA_FALSE);
2215 * if (!res) return;
2216 * ecore_evas_resize(ee, 240, 400);
2217 * @endcode
2218 *
2219 * @see ecore_evas_extn_socket_new()
2220 * @see ecore_evas_extn_plug_connect()
2221 * @since 1.2
2222 */
2223EAPI Evas_Object *ecore_evas_extn_plug_new(Ecore_Evas *ee_target);
2224
2225/**
2226 * @brief Connect an external ecore evas plug to service provided by external
2227 * ecore evas socket.
2228 *
2229 * @param obj The Ecore_Evas containing the canvas in which the new image
2230 * object will live.
2231 * @param svcname The service name to connect to set up by the socket.
2232 * @param svcnum The service number to connect to (set up by socket).
2233 * @param svcsys Boolean to set if the service is a system one or not (set up
2234 * by socket).
2235 * @return @c EINA_TRUE if creation is successful, @c EINA_FALSE if it does
2236 * not.
2237 *
2238 * @see ecore_evas_extn_plug_new()
2239 *
2240 * @since 1.2
2241 */
2242EAPI Eina_Bool ecore_evas_extn_plug_connect(Evas_Object *obj, const char *svcname, int svcnum, Eina_Bool svcsys);
2243
2244/**
2245 * @}
2246 */
2247
2248/**
2249 * @}
2250 */
2251
2252#ifdef __cplusplus
2253}
2254#endif
2255
2256#endif
diff --git a/src/lib/ecore_evas/ecore_evas.c b/src/lib/ecore_evas/ecore_evas.c
new file mode 100644
index 0000000000..3d841e7db6
--- /dev/null
+++ b/src/lib/ecore_evas/ecore_evas.c
@@ -0,0 +1,2781 @@
1#ifdef HAVE_CONFIG_H
2# include <config.h>
3#endif
4
5#include <stdlib.h>
6#include <string.h>
7#include <sys/types.h>
8#include <errno.h>
9#include <sys/stat.h>
10#include <fcntl.h>
11
12#ifndef _MSC_VER
13# include <unistd.h>
14#endif
15
16#ifdef HAVE_SYS_MMAN_H
17# include <sys/mman.h>
18#endif
19
20#ifdef HAVE_EVIL
21# include <Evil.h>
22#endif
23
24#include "Ecore.h"
25#include "ecore_private.h"
26#include "Ecore_Input.h"
27
28#include "ecore_evas_private.h"
29#include "Ecore_Evas.h"
30
31Eina_Bool _ecore_evas_app_comp_sync = 1;
32int _ecore_evas_log_dom = -1;
33static int _ecore_evas_init_count = 0;
34static Ecore_Fd_Handler *_ecore_evas_async_events_fd = NULL;
35static Eina_Bool _ecore_evas_async_events_fd_handler(void *data, Ecore_Fd_Handler *fd_handler);
36
37static Ecore_Idle_Enterer *ecore_evas_idle_enterer = NULL;
38static Ecore_Evas *ecore_evases = NULL;
39static int _ecore_evas_fps_debug = 0;
40
41static Eina_Bool
42_ecore_evas_idle_enter(void *data EINA_UNUSED)
43{
44 Ecore_Evas *ee;
45 double t1 = 0.0;
46 double t2 = 0.0;
47 int rend = 0;
48
49 if (!ecore_evases) return ECORE_CALLBACK_RENEW;
50 if (_ecore_evas_fps_debug)
51 {
52 t1 = ecore_time_get();
53 }
54 EINA_INLIST_FOREACH(ecore_evases, ee)
55 {
56 if (!ee->manual_render)
57 {
58 if (ee->engine.func->fn_render)
59 rend |= ee->engine.func->fn_render(ee);
60 }
61 }
62 if (_ecore_evas_fps_debug)
63 {
64 t2 = ecore_time_get();
65 if (rend)
66 _ecore_evas_fps_debug_rendertime_add(t2 - t1);
67 }
68 return ECORE_CALLBACK_RENEW;
69}
70
71/**
72 * Query if a particular rendering engine target has support
73 * @param engine The engine to check support for
74 * @return 1 if the particular engine is supported, 0 if it is not
75 *
76 * Query if engine @param engine is supported by ecore_evas. 1 is returned if
77 * it is, and 0 is returned if it is not supported.
78 */
79EAPI int
80ecore_evas_engine_type_supported_get(Ecore_Evas_Engine_Type engine)
81{
82 switch (engine)
83 {
84 case ECORE_EVAS_ENGINE_SOFTWARE_BUFFER:
85#ifdef BUILD_ECORE_EVAS_SOFTWARE_BUFFER
86 return EINA_TRUE;
87#else
88 return EINA_FALSE;
89#endif
90 case ECORE_EVAS_ENGINE_SOFTWARE_XLIB:
91#ifdef BUILD_ECORE_EVAS_SOFTWARE_XLIB
92 return EINA_TRUE;
93#else
94 return EINA_FALSE;
95#endif
96 case ECORE_EVAS_ENGINE_XRENDER_X11:
97 return EINA_FALSE;
98 case ECORE_EVAS_ENGINE_OPENGL_X11:
99#ifdef BUILD_ECORE_EVAS_OPENGL_X11
100 return EINA_TRUE;
101#else
102 return EINA_FALSE;
103#endif
104 case ECORE_EVAS_ENGINE_SOFTWARE_XCB:
105#ifdef BUILD_ECORE_EVAS_SOFTWARE_XCB
106 return EINA_TRUE;
107#else
108 return EINA_FALSE;
109#endif
110 case ECORE_EVAS_ENGINE_XRENDER_XCB:
111 return EINA_FALSE;
112 case ECORE_EVAS_ENGINE_SOFTWARE_GDI:
113#ifdef BUILD_ECORE_EVAS_SOFTWARE_GDI
114 return EINA_TRUE;
115#else
116 return EINA_FALSE;
117#endif
118 case ECORE_EVAS_ENGINE_SOFTWARE_DDRAW:
119#ifdef BUILD_ECORE_EVAS_SOFTWARE_DDRAW
120 return EINA_TRUE;
121#else
122 return EINA_FALSE;
123#endif
124 case ECORE_EVAS_ENGINE_DIRECT3D:
125#ifdef BUILD_ECORE_EVAS_DIRECT3D
126 return EINA_TRUE;
127#else
128 return EINA_FALSE;
129#endif
130 case ECORE_EVAS_ENGINE_OPENGL_GLEW:
131#ifdef BUILD_ECORE_EVAS_OPENGL_GLEW
132 return EINA_TRUE;
133#else
134 return EINA_FALSE;
135#endif
136 case ECORE_EVAS_ENGINE_SOFTWARE_SDL:
137#ifdef BUILD_ECORE_EVAS_SOFTWARE_SDL
138 return EINA_TRUE;
139#else
140 return EINA_FALSE;
141#endif
142 case ECORE_EVAS_ENGINE_OPENGL_SDL:
143#ifdef BUILD_ECORE_EVAS_OPENGL_SDL
144 return EINA_TRUE;
145#else
146 return EINA_FALSE;
147#endif
148 case ECORE_EVAS_ENGINE_DIRECTFB:
149#ifdef BUILD_ECORE_EVAS_DIRECTFB
150 return EINA_TRUE;
151#else
152 return EINA_FALSE;
153#endif
154 case ECORE_EVAS_ENGINE_SOFTWARE_FB:
155#ifdef BUILD_ECORE_EVAS_FB
156 return EINA_TRUE;
157#else
158 return EINA_FALSE;
159#endif
160
161 case ECORE_EVAS_ENGINE_SOFTWARE_8_X11:
162#ifdef BUILD_ECORE_EVAS_SOFTWARE_8_X11
163 return EINA_TRUE;
164#else
165 return EINA_FALSE;
166#endif
167
168 case ECORE_EVAS_ENGINE_SOFTWARE_16_X11:
169 return EINA_FALSE;
170 case ECORE_EVAS_ENGINE_SOFTWARE_16_DDRAW:
171 return EINA_FALSE;
172 case ECORE_EVAS_ENGINE_SOFTWARE_16_WINCE:
173 return EINA_FALSE;
174
175 case ECORE_EVAS_ENGINE_OPENGL_COCOA:
176#ifdef BUILD_ECORE_EVAS_OPENGL_COCOA
177 return EINA_TRUE;
178#else
179 return EINA_FALSE;
180#endif
181 case ECORE_EVAS_ENGINE_EWS:
182#ifdef BUILD_ECORE_EVAS_EWS
183 return EINA_TRUE;
184#else
185 return EINA_FALSE;
186#endif
187 case ECORE_EVAS_ENGINE_PSL1GHT:
188#ifdef BUILD_ECORE_EVAS_PSL1GHT
189 return EINA_TRUE;
190#else
191 return EINA_FALSE;
192#endif
193 case ECORE_EVAS_ENGINE_WAYLAND_SHM:
194#ifdef BUILD_ECORE_EVAS_WAYLAND_SHM
195 return EINA_TRUE;
196#else
197 return EINA_FALSE;
198#endif
199 case ECORE_EVAS_ENGINE_WAYLAND_EGL:
200#ifdef BUILD_ECORE_EVAS_WAYLAND_EGL
201 return EINA_TRUE;
202#else
203 return EINA_FALSE;
204#endif
205 default:
206 return EINA_FALSE;
207 };
208}
209
210static void
211_ecore_evas_fork_cb(void *data EINA_UNUSED)
212{
213 int fd;
214
215 if (_ecore_evas_async_events_fd)
216 ecore_main_fd_handler_del(_ecore_evas_async_events_fd);
217 fd = evas_async_events_fd_get();
218 if (fd >= 0)
219 _ecore_evas_async_events_fd =
220 ecore_main_fd_handler_add(fd, ECORE_FD_READ,
221 _ecore_evas_async_events_fd_handler, NULL,
222 NULL, NULL);
223}
224
225EAPI int
226ecore_evas_init(void)
227{
228 int fd;
229
230 if (++_ecore_evas_init_count != 1)
231 return _ecore_evas_init_count;
232
233 if (!evas_init())
234 return --_ecore_evas_init_count;
235
236 if (!ecore_init())
237 goto shutdown_evas;
238
239 _ecore_evas_log_dom = eina_log_domain_register
240 ("ecore_evas", ECORE_EVAS_DEFAULT_LOG_COLOR);
241 if(_ecore_evas_log_dom < 0)
242 {
243 EINA_LOG_ERR("Impossible to create a log domain for Ecore_Evas.");
244 goto shutdown_ecore;
245 }
246
247 ecore_fork_reset_callback_add(_ecore_evas_fork_cb, NULL);
248 fd = evas_async_events_fd_get();
249 if (fd >= 0)
250 _ecore_evas_async_events_fd =
251 ecore_main_fd_handler_add(fd, ECORE_FD_READ,
252 _ecore_evas_async_events_fd_handler, NULL,
253 NULL, NULL);
254
255 ecore_evas_idle_enterer =
256 ecore_idle_enterer_add(_ecore_evas_idle_enter, NULL);
257 if (getenv("ECORE_EVAS_FPS_DEBUG")) _ecore_evas_fps_debug = 1;
258 if (_ecore_evas_fps_debug) _ecore_evas_fps_debug_init();
259
260#ifdef BUILD_ECORE_EVAS_EWS
261 _ecore_evas_ews_events_init();
262#endif
263
264 _ecore_evas_extn_init();
265
266 if (getenv("ECORE_EVAS_COMP_NOSYNC"))
267 _ecore_evas_app_comp_sync = 0;
268 return _ecore_evas_init_count;
269
270 shutdown_ecore:
271 ecore_shutdown();
272 shutdown_evas:
273 evas_shutdown();
274
275 return --_ecore_evas_init_count;
276}
277
278EAPI int
279ecore_evas_shutdown(void)
280{
281 if (--_ecore_evas_init_count != 0)
282 return _ecore_evas_init_count;
283
284 while (ecore_evases) _ecore_evas_free(ecore_evases);
285
286 _ecore_evas_extn_shutdown();
287
288 if (_ecore_evas_fps_debug) _ecore_evas_fps_debug_shutdown();
289 ecore_idle_enterer_del(ecore_evas_idle_enterer);
290 ecore_evas_idle_enterer = NULL;
291
292#ifdef BUILD_ECORE_EVAS_X11
293 while (_ecore_evas_x_shutdown());
294#endif
295#ifdef BUILD_ECORE_EVAS_WIN32
296 while (_ecore_evas_win32_shutdown());
297#endif
298#ifdef BUILD_ECORE_EVAS_FB
299 while (_ecore_evas_fb_shutdown());
300#endif
301#ifdef BUILD_ECORE_EVAS_EWS
302 while (_ecore_evas_ews_shutdown());
303#endif
304#ifdef BUILD_ECORE_EVAS_SOFTWARE_BUFFER
305 while (_ecore_evas_buffer_shutdown());
306#endif
307#ifdef BUILD_ECORE_EVAS_DIRECTFB
308 while (_ecore_evas_directfb_shutdown());
309#endif
310
311 if (_ecore_evas_async_events_fd)
312 ecore_main_fd_handler_del(_ecore_evas_async_events_fd);
313
314 ecore_fork_reset_callback_del(_ecore_evas_fork_cb, NULL);
315
316 eina_log_domain_unregister(_ecore_evas_log_dom);
317 _ecore_evas_log_dom = -1;
318 ecore_shutdown();
319 evas_shutdown();
320
321 return _ecore_evas_init_count;
322}
323
324EAPI void
325ecore_evas_app_comp_sync_set(Eina_Bool do_sync)
326{
327 _ecore_evas_app_comp_sync = do_sync;
328}
329
330EAPI Eina_Bool
331ecore_evas_app_comp_sync_get(void)
332{
333 return _ecore_evas_app_comp_sync;
334}
335
336struct ecore_evas_engine {
337 const char *name;
338 Ecore_Evas *(*constructor)(int x, int y, int w, int h, const char *extra_options);
339};
340
341/* inline is just to avoid need to ifdef around it */
342static inline const char *
343_ecore_evas_parse_extra_options_str(const char *extra_options, const char *key, char **value)
344{
345 int len = strlen(key);
346
347 while (extra_options)
348 {
349 const char *p;
350
351 if (strncmp(extra_options, key, len) != 0)
352 {
353 extra_options = strchr(extra_options, ';');
354 if (extra_options)
355 extra_options++;
356 continue;
357 }
358
359 extra_options += len;
360 p = strchr(extra_options, ';');
361 if (p)
362 {
363 len = p - extra_options;
364 *value = malloc(len + 1);
365 memcpy(*value, extra_options, len);
366 (*value)[len] = '\0';
367 extra_options = p + 1;
368 }
369 else
370 {
371 *value = strdup(extra_options);
372 extra_options = NULL;
373 }
374 }
375 return extra_options;
376}
377
378/* inline is just to avoid need to ifdef around it */
379static inline const char *
380_ecore_evas_parse_extra_options_uint(const char *extra_options, const char *key, unsigned int *value)
381{
382 int len = strlen(key);
383
384 while (extra_options)
385 {
386 const char *p;
387
388 if (strncmp(extra_options, key, len) != 0)
389 {
390 extra_options = strchr(extra_options, ';');
391 if (extra_options)
392 extra_options++;
393 continue;
394 }
395
396 extra_options += len;
397 *value = strtol(extra_options, NULL, 0);
398
399 p = strchr(extra_options, ';');
400 if (p)
401 extra_options = p + 1;
402 else
403 extra_options = NULL;
404 }
405 return extra_options;
406}
407
408/* inline is just to avoid need to ifdef around it */
409static inline const char *
410_ecore_evas_parse_extra_options_x(const char *extra_options, char **disp_name, unsigned int *parent)
411{
412 _ecore_evas_parse_extra_options_str(extra_options, "display=", disp_name);
413 _ecore_evas_parse_extra_options_uint(extra_options, "parent=", parent);
414 return extra_options;
415}
416
417#ifdef BUILD_ECORE_EVAS_SOFTWARE_X11
418static Ecore_Evas *
419_ecore_evas_constructor_software_x11(int x, int y, int w, int h, const char *extra_options)
420{
421 unsigned int parent = 0;
422 char *disp_name = NULL;
423 Ecore_Evas *ee;
424
425 _ecore_evas_parse_extra_options_x(extra_options, &disp_name, &parent);
426 ee = ecore_evas_software_x11_new(disp_name, parent, x, y, w, h);
427 free(disp_name);
428
429 return ee;
430}
431#endif
432
433#ifdef BUILD_ECORE_EVAS_OPENGL_COCOA
434static Ecore_Evas *
435_ecore_evas_constructor_cocoa(int x, int y, int w, int h, const char *extra_options)
436{
437 char *name = NULL;
438 Ecore_Evas *ee;
439
440 _ecore_evas_parse_extra_options_str(extra_options, "name=", &name);
441 ee = ecore_evas_cocoa_new(NULL, x, y, w, h);
442 free(name);
443
444 if (ee) ecore_evas_move(ee, x, y);
445 return ee;
446}
447#endif
448
449#ifdef BUILD_ECORE_EVAS_OPENGL_X11
450static Ecore_Evas *
451_ecore_evas_constructor_opengl_x11(int x, int y, int w, int h, const char *extra_options)
452{
453 Ecore_X_Window parent = 0;
454 char *disp_name = NULL;
455 Ecore_Evas *ee;
456
457 _ecore_evas_parse_extra_options_x(extra_options, &disp_name, &parent);
458 ee = ecore_evas_gl_x11_new(disp_name, parent, x, y, w, h);
459 free(disp_name);
460
461 return ee;
462}
463#endif
464
465#ifdef BUILD_ECORE_EVAS_SOFTWARE_8_X11
466static Ecore_Evas *
467_ecore_evas_constructor_software_8_x11(int x, int y, int w, int h, const char *extra_options)
468{
469 Ecore_X_Window parent = 0;
470 char *disp_name = NULL;
471 Ecore_Evas *ee;
472
473 _ecore_evas_parse_extra_options_x(extra_options, &disp_name, &parent);
474 ee = ecore_evas_software_x11_8_new(disp_name, parent, x, y, w, h);
475 free(disp_name);
476
477 return ee;
478}
479#endif
480
481#ifdef BUILD_ECORE_EVAS_SOFTWARE_SDL
482static Ecore_Evas *
483_ecore_evas_constructor_sdl(int x EINA_UNUSED, int y EINA_UNUSED, int w, int h, const char *extra_options)
484{
485 Ecore_Evas *ee;
486 unsigned int fullscreen = 0, hwsurface = 0, noframe = 0, alpha = 0;
487 char *name = NULL;
488
489 _ecore_evas_parse_extra_options_str(extra_options, "name=", &name);
490 _ecore_evas_parse_extra_options_uint(extra_options, "fullscreen=", &fullscreen);
491 _ecore_evas_parse_extra_options_uint(extra_options, "hwsurface=", &hwsurface);
492 _ecore_evas_parse_extra_options_uint(extra_options, "noframe=", &noframe);
493 _ecore_evas_parse_extra_options_uint(extra_options, "alpha=", &alpha);
494
495 ee = ecore_evas_sdl_new(name, w, h, fullscreen, hwsurface, noframe, alpha);
496 free(name);
497
498 return ee;
499}
500#endif
501
502#ifdef BUILD_ECORE_EVAS_OPENGL_SDL
503static Ecore_Evas *
504_ecore_evas_constructor_opengl_sdl(int x EINA_UNUSED, int y EINA_UNUSED, int w, int h, const char *extra_options)
505{
506 Ecore_Evas *ee;
507 unsigned int fullscreen = 0, noframe = 0;
508 char *name = NULL;
509
510 _ecore_evas_parse_extra_options_str(extra_options, "name=", &name);
511 _ecore_evas_parse_extra_options_uint(extra_options, "fullscreen=", &fullscreen);
512 _ecore_evas_parse_extra_options_uint(extra_options, "noframe=", &noframe);
513
514 ee = ecore_evas_gl_sdl_new(name, w, h, fullscreen, noframe);
515 free(name);
516
517 return ee;
518}
519#endif
520
521#ifdef BUILD_ECORE_EVAS_DIRECTFB
522static Ecore_Evas *
523_ecore_evas_constructor_directfb(int x, int y, int w, int h, const char *extra_options)
524{
525 Ecore_Evas *ee;
526 char *disp_name = NULL;
527 unsigned int windowed = 1;
528
529 _ecore_evas_parse_extra_options_str(extra_options, "display=", &disp_name);
530 _ecore_evas_parse_extra_options_uint(extra_options, "windowed=", &windowed);
531
532 ee = ecore_evas_directfb_new(disp_name, windowed, x, y, w, h);
533 free(disp_name);
534
535 return ee;
536}
537#endif
538
539#ifdef BUILD_ECORE_EVAS_FB
540static Ecore_Evas *
541_ecore_evas_constructor_fb(int x EINA_UNUSED, int y EINA_UNUSED, int w, int h, const char *extra_options)
542{
543 Ecore_Evas *ee;
544 char *disp_name = NULL;
545 unsigned int rotation = 0;
546
547 _ecore_evas_parse_extra_options_str(extra_options, "display=", &disp_name);
548 _ecore_evas_parse_extra_options_uint(extra_options, "rotation=", &rotation);
549
550 ee = ecore_evas_fb_new(disp_name, rotation, w, h);
551 free(disp_name);
552
553 return ee;
554}
555#endif
556
557
558#ifdef BUILD_ECORE_EVAS_PSL1GHT
559static Ecore_Evas *
560_ecore_evas_constructor_psl1ght(int x EINA_UNUSED, int y EINA_UNUSED, int w, int h, const char *extra_options)
561{
562 Ecore_Evas *ee;
563 char *name = NULL;
564
565 _ecore_evas_parse_extra_options_str(extra_options, "name=", &name);
566 ee = ecore_evas_psl1ght_new(name, w, h);
567 free(name);
568
569 if (ee) ecore_evas_move(ee, x, y);
570 return ee;
571}
572#endif
573
574#ifdef BUILD_ECORE_EVAS_WAYLAND_SHM
575static Ecore_Evas *
576_ecore_evas_constructor_wayland_shm(int x, int y, int w, int h, const char *extra_options)
577{
578 char *disp_name = NULL;
579 unsigned int frame = 1, parent = 0;
580 Ecore_Evas *ee;
581
582 _ecore_evas_parse_extra_options_str(extra_options, "display=", &disp_name);
583 _ecore_evas_parse_extra_options_uint(extra_options, "frame=", &frame);
584 _ecore_evas_parse_extra_options_uint(extra_options, "parent=", &parent);
585 ee = ecore_evas_wayland_shm_new(disp_name, parent, x, y, w, h, frame);
586 free(disp_name);
587
588 return ee;
589}
590#endif
591
592#ifdef BUILD_ECORE_EVAS_WAYLAND_EGL
593static Ecore_Evas *
594_ecore_evas_constructor_wayland_egl(int x, int y, int w, int h, const char *extra_options)
595{
596 char *disp_name = NULL;
597 unsigned int frame = 1, parent = 0;
598 Ecore_Evas *ee;
599
600 _ecore_evas_parse_extra_options_str(extra_options, "display=", &disp_name);
601 _ecore_evas_parse_extra_options_uint(extra_options, "frame=", &frame);
602 _ecore_evas_parse_extra_options_uint(extra_options, "parent=", &parent);
603 ee = ecore_evas_wayland_egl_new(disp_name, parent, x, y, w, h, frame);
604 free(disp_name);
605
606 return ee;
607}
608#endif
609
610#ifdef BUILD_ECORE_EVAS_SOFTWARE_GDI
611static Ecore_Evas *
612_ecore_evas_constructor_software_gdi(int x, int y, int w, int h, const char *extra_options)
613{
614 return ecore_evas_software_gdi_new(NULL, x, y, w, h);
615}
616#endif
617
618#ifdef BUILD_ECORE_EVAS_SOFTWARE_DDRAW
619static Ecore_Evas *
620_ecore_evas_constructor_software_ddraw(int x, int y, int w, int h, const char *extra_options)
621{
622 return ecore_evas_software_ddraw_new(NULL, x, y, w, h);
623}
624#endif
625
626#ifdef BUILD_ECORE_EVAS_DIRECT3D
627static Ecore_Evas *
628_ecore_evas_constructor_direct3d(int x, int y, int w, int h, const char *extra_options)
629{
630 return ecore_evas_direct3d_new(NULL, x, y, w, h);
631}
632#endif
633
634#ifdef BUILD_ECORE_EVAS_OPENGL_GLEW
635static Ecore_Evas *
636_ecore_evas_constructor_opengl_glew(int x, int y, int w, int h, const char *extra_options)
637{
638 return ecore_evas_gl_glew_new(NULL, x, y, w, h);
639}
640#endif
641
642#ifdef BUILD_ECORE_EVAS_SOFTWARE_BUFFER
643static Ecore_Evas *
644_ecore_evas_constructor_buffer(int x EINA_UNUSED, int y EINA_UNUSED, int w, int h, const char *extra_options EINA_UNUSED)
645{
646 return ecore_evas_buffer_new(w, h);
647}
648#endif
649
650#ifdef BUILD_ECORE_EVAS_EWS
651static Ecore_Evas *
652_ecore_evas_constructor_ews(int x, int y, int w, int h, const char *extra_options EINA_UNUSED)
653{
654 return ecore_evas_ews_new(x, y, w, h);
655}
656#endif
657
658/* note: keep sorted by priority, highest first */
659static const struct ecore_evas_engine _engines[] = {
660 /* unix */
661#ifdef BUILD_ECORE_EVAS_SOFTWARE_X11
662 {"software_x11", _ecore_evas_constructor_software_x11},
663#endif
664#ifdef BUILD_ECORE_EVAS_OPENGL_X11
665 {"opengl_x11", _ecore_evas_constructor_opengl_x11},
666#endif
667#ifdef BUILD_ECORE_EVAS_SOFTWARE_8_X11
668 {"software_8_x11", _ecore_evas_constructor_software_8_x11},
669#endif
670#ifdef BUILD_ECORE_EVAS_DIRECTFB
671 {"directfb", _ecore_evas_constructor_directfb},
672#endif
673#ifdef BUILD_ECORE_EVAS_FB
674 {"fb", _ecore_evas_constructor_fb},
675#endif
676
677 /* windows */
678#ifdef BUILD_ECORE_EVAS_SOFTWARE_GDI
679 {"software_gdi", _ecore_evas_constructor_software_gdi},
680#endif
681#ifdef BUILD_ECORE_EVAS_SOFTWARE_DDRAW
682 {"software_ddraw", _ecore_evas_constructor_software_ddraw},
683#endif
684#ifdef BUILD_ECORE_EVAS_DIRECT3D
685 {"direct3d", _ecore_evas_constructor_direct3d},
686#endif
687#ifdef BUILD_ECORE_EVAS_OPENGL_GLEW
688 {"opengl_glew", _ecore_evas_constructor_opengl_glew},
689#endif
690
691 /* Apple */
692#ifdef BUILD_ECORE_EVAS_OPENGL_COCOA
693 {"opengl_cocoa", _ecore_evas_constructor_cocoa},
694#endif
695
696 /* PS3 support */
697#ifdef BUILD_ECORE_EVAS_PSL1GHT
698 {"psl1ght", _ecore_evas_constructor_psl1ght},
699#endif
700
701 /* Wayland */
702#ifdef BUILD_ECORE_EVAS_WAYLAND_SHM
703 {"wayland_shm", _ecore_evas_constructor_wayland_shm},
704#endif
705
706#ifdef BUILD_ECORE_EVAS_WAYLAND_EGL
707 {"wayland_egl", _ecore_evas_constructor_wayland_egl},
708#endif
709
710 /* Last chance to have a window */
711#ifdef BUILD_ECORE_EVAS_OPENGL_SDL
712 {"opengl_sdl", _ecore_evas_constructor_opengl_sdl},
713#endif
714
715#ifdef BUILD_ECORE_EVAS_SOFTWARE_SDL
716 {"sdl", _ecore_evas_constructor_sdl},
717#endif
718
719 /* independent */
720#ifdef BUILD_ECORE_EVAS_SOFTWARE_BUFFER
721 {"buffer", _ecore_evas_constructor_buffer},
722#endif
723
724#ifdef BUILD_ECORE_EVAS_EWS
725 {"ews", _ecore_evas_constructor_ews},
726#endif
727 {NULL, NULL}
728};
729
730EAPI Eina_List *
731ecore_evas_engines_get(void)
732{
733 const struct ecore_evas_engine *itr;
734 Eina_List *lst = NULL;
735
736 for (itr = _engines; itr->name; itr++)
737 lst = eina_list_append(lst, itr->name);
738
739 return lst;
740}
741
742EAPI void
743ecore_evas_engines_free(Eina_List *engines)
744{
745 eina_list_free(engines);
746}
747
748static Ecore_Evas *
749_ecore_evas_new_auto_discover(int x, int y, int w, int h, const char *extra_options)
750{
751 const struct ecore_evas_engine *itr;
752
753 DBG("auto discover engine");
754
755 for (itr = _engines; itr->constructor; itr++)
756 {
757 Ecore_Evas *ee = itr->constructor(x, y, w, h, extra_options);
758 if (ee)
759 {
760 INF("auto discovered '%s'", itr->name);
761 return ee;
762 }
763 }
764
765 WRN("could not auto discover.");
766 return NULL;
767}
768
769EAPI Ecore_Evas *
770ecore_evas_new(const char *engine_name, int x, int y, int w, int h, const char *extra_options)
771{
772 const struct ecore_evas_engine *itr;
773
774 if (!engine_name)
775 {
776 engine_name = getenv("ECORE_EVAS_ENGINE");
777 if (engine_name)
778 DBG("no engine_name provided, using ECORE_EVAS_ENGINE='%s'",
779 engine_name);
780 }
781 if (!engine_name)
782 return _ecore_evas_new_auto_discover(x, y, w, h, extra_options);
783
784 for (itr = _engines; itr->name; itr++)
785 if (strcmp(itr->name, engine_name) == 0)
786 {
787 INF("using engine '%s', extra_options=%s",
788 engine_name, extra_options ? extra_options : "(null)");
789 return itr->constructor(x, y, w, h, extra_options);
790 }
791
792 WRN("unknown engine '%s'", engine_name);
793 return NULL;
794}
795
796EAPI const char *
797ecore_evas_engine_name_get(const Ecore_Evas *ee)
798{
799 if (!ee)
800 return NULL;
801 return ee->driver;
802}
803
804EAPI Ecore_Evas *
805ecore_evas_ecore_evas_get(const Evas *e)
806{
807 Ecore_Evas *ee = evas_data_attach_get(e);
808 if (!ee) return NULL;
809 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
810 {
811 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS, "ecore_evas_ecore_evas_get");
812 return NULL;
813 }
814 return ee;
815}
816
817EAPI void
818ecore_evas_free(Ecore_Evas *ee)
819{
820 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
821 {
822 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
823 "ecore_evas_free");
824 return;
825 }
826 _ecore_evas_free(ee);
827 return;
828}
829
830EAPI void *
831ecore_evas_data_get(const Ecore_Evas *ee, const char *key)
832{
833 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
834 {
835 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
836 "ecore_evas_data_get");
837 return NULL;
838 }
839
840 if (!key) return NULL;
841 if (!ee->data) return NULL;
842
843 return eina_hash_find(ee->data, key);
844}
845
846EAPI void
847ecore_evas_data_set(Ecore_Evas *ee, const char *key, const void *data)
848{
849 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
850 {
851 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
852 "ecore_evas_data_set");
853 return;
854 }
855
856 if (!key) return;
857
858 if (ee->data)
859 eina_hash_del(ee->data, key, NULL);
860 if (data)
861 {
862 if (!ee->data)
863 ee->data = eina_hash_string_superfast_new(NULL);
864 eina_hash_add(ee->data, key, data);
865 }
866}
867
868#define IFC(_ee, _fn) if (_ee->engine.func->_fn) {_ee->engine.func->_fn
869#define IFE return;}
870
871EAPI void
872ecore_evas_callback_resize_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func)
873{
874 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
875 {
876 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
877 "ecore_evas_callback_resize_set");
878 return;
879 }
880 IFC(ee, fn_callback_resize_set) (ee, func);
881 IFE;
882 ee->func.fn_resize = func;
883}
884
885EAPI void
886ecore_evas_callback_move_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func)
887{
888 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
889 {
890 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
891 "ecore_evas_callback_move_set");
892 return;
893 }
894 IFC(ee, fn_callback_move_set) (ee, func);
895 IFE;
896 ee->func.fn_move = func;
897}
898
899EAPI void
900ecore_evas_callback_show_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func)
901{
902 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
903 {
904 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
905 "ecore_evas_callback_show_set");
906 return;
907 }
908 IFC(ee, fn_callback_show_set) (ee, func);
909 IFE;
910 ee->func.fn_show = func;
911}
912
913EAPI void
914ecore_evas_callback_hide_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func)
915{
916 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
917 {
918 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
919 "ecore_evas_callback_hide_set");
920 return;
921 }
922 IFC(ee, fn_callback_hide_set) (ee, func);
923 IFE;
924 ee->func.fn_hide = func;
925}
926
927EAPI void
928ecore_evas_callback_delete_request_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func)
929{
930 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
931 {
932 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
933 "ecore_evas_callback_delete_request_set");
934 return;
935 }
936 IFC(ee, fn_callback_delete_request_set) (ee, func);
937 IFE;
938 ee->func.fn_delete_request = func;
939}
940
941EAPI void
942ecore_evas_callback_destroy_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func)
943{
944 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
945 {
946 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
947 "ecore_evas_callback_destroy_set");
948 return;
949 }
950 IFC(ee, fn_callback_destroy_set) (ee, func);
951 IFE;
952 ee->func.fn_destroy = func;
953}
954
955EAPI void
956ecore_evas_callback_focus_in_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func)
957{
958 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
959 {
960 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
961 "ecore_evas_callback_focus_in_set");
962 return;
963 }
964 IFC(ee, fn_callback_focus_in_set) (ee, func);
965 IFE;
966 ee->func.fn_focus_in = func;
967}
968
969EAPI void
970ecore_evas_callback_focus_out_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func)
971{
972 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
973 {
974 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
975 "ecore_evas_callback_focus_out_set");
976 return;
977 }
978 IFC(ee, fn_callback_focus_out_set) (ee, func);
979 IFE;
980 ee->func.fn_focus_out = func;
981}
982
983EAPI void
984ecore_evas_callback_sticky_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func)
985{
986 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
987 {
988 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
989 "ecore_evas_callback_sticky_set");
990 return;
991 }
992 IFC(ee, fn_callback_sticky_set) (ee, func);
993 IFE;
994 ee->func.fn_sticky = func;
995}
996
997EAPI void
998ecore_evas_callback_unsticky_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func)
999{
1000 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1001 {
1002 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1003 "ecore_evas_callback_unsticky_set");
1004 return;
1005 }
1006 IFC(ee, fn_callback_unsticky_set) (ee, func);
1007 IFE;
1008 ee->func.fn_unsticky = func;
1009}
1010
1011EAPI void
1012ecore_evas_callback_mouse_in_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func)
1013{
1014 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1015 {
1016 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1017 "ecore_evas_callback_mouse_in_set");
1018 return;
1019 }
1020 IFC(ee, fn_callback_mouse_in_set) (ee, func);
1021 IFE;
1022 ee->func.fn_mouse_in = func;
1023}
1024
1025EAPI void
1026ecore_evas_callback_mouse_out_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func)
1027{
1028 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1029 {
1030 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1031 "ecore_evas_callback_mouse_out_set");
1032 return;
1033 }
1034 IFC(ee, fn_callback_mouse_out_set) (ee, func);
1035 IFE;
1036 ee->func.fn_mouse_out = func;
1037}
1038
1039EAPI void
1040ecore_evas_callback_pre_render_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func)
1041{
1042 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1043 {
1044 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1045 "ecore_evas_callback_pre_render_set");
1046 return;
1047 }
1048 IFC(ee, fn_callback_pre_render_set) (ee, func);
1049 IFE;
1050 ee->func.fn_pre_render = func;
1051}
1052
1053EAPI void
1054ecore_evas_callback_post_render_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func)
1055{
1056 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1057 {
1058 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1059 "ecore_evas_callback_post_render_set");
1060 return;
1061 }
1062 IFC(ee, fn_callback_post_render_set) (ee, func);
1063 IFE;
1064 ee->func.fn_post_render = func;
1065}
1066
1067EAPI void
1068ecore_evas_callback_pre_free_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func)
1069{
1070 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1071 {
1072 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1073 "ecore_evas_callback_pre_free_set");
1074 return;
1075 }
1076 ee->func.fn_pre_free = func;
1077}
1078
1079EAPI void
1080ecore_evas_callback_state_change_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func)
1081{
1082 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1083 {
1084 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1085 "ecore_evas_callback_state_change_set");
1086 return;
1087 }
1088 ee->func.fn_state_change = func;
1089}
1090
1091EAPI Evas *
1092ecore_evas_get(const Ecore_Evas *ee)
1093{
1094 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1095 {
1096 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1097 "ecore_evas_get");
1098 return NULL;
1099 }
1100 return ee->evas;
1101}
1102
1103EAPI void
1104ecore_evas_move(Ecore_Evas *ee, int x, int y)
1105{
1106 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1107 {
1108 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1109 "ecore_evas_move");
1110 return;
1111 }
1112 if (ee->prop.fullscreen) return;
1113 IFC(ee, fn_move) (ee, x, y);
1114 IFE;
1115}
1116
1117EAPI void
1118ecore_evas_managed_move(Ecore_Evas *ee, int x, int y)
1119{
1120 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1121 {
1122 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1123 "ecore_evas_move");
1124 return;
1125 }
1126 IFC(ee, fn_managed_move) (ee, x, y);
1127 IFE;
1128}
1129
1130EAPI void
1131ecore_evas_resize(Ecore_Evas *ee, int w, int h)
1132{
1133 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1134 {
1135 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1136 "ecore_evas_resize");
1137 return;
1138 }
1139 if (ee->prop.fullscreen) return;
1140 if (w < 1) w = 1;
1141 if (h < 1) h = 1;
1142 if ((ee->rotation == 90) || (ee->rotation == 270))
1143 {
1144 IFC(ee, fn_resize) (ee, h, w);
1145 IFE;
1146 }
1147 else
1148 {
1149 IFC(ee, fn_resize) (ee, w, h);
1150 IFE;
1151 }
1152}
1153
1154EAPI void
1155ecore_evas_move_resize(Ecore_Evas *ee, int x, int y, int w, int h)
1156{
1157 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1158 {
1159 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1160 "ecore_evas_move_resize");
1161 return;
1162 }
1163 if (ee->prop.fullscreen) return;
1164 if (w < 1) w = 1;
1165 if (h < 1) h = 1;
1166 if ((ee->rotation == 90) || (ee->rotation == 270))
1167 {
1168 IFC(ee, fn_move_resize) (ee, x, y, h, w);
1169 IFE;
1170 }
1171 else
1172 {
1173 IFC(ee, fn_move_resize) (ee, x, y, w, h);
1174 IFE;
1175 }
1176}
1177
1178EAPI void
1179ecore_evas_geometry_get(const Ecore_Evas *ee, int *x, int *y, int *w, int *h)
1180{
1181 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1182 {
1183 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1184 "ecore_evas_geometry_get");
1185 return;
1186 }
1187 if ((ee->rotation == 90) || (ee->rotation == 270))
1188 {
1189 if (x) *x = ee->x;
1190 if (y) *y = ee->y;
1191 if (w) *w = ee->h;
1192 if (h) *h = ee->w;
1193 }
1194 else
1195 {
1196 if (x) *x = ee->x;
1197 if (y) *y = ee->y;
1198 if (w) *w = ee->w;
1199 if (h) *h = ee->h;
1200 }
1201}
1202
1203EAPI void
1204ecore_evas_request_geometry_get(const Ecore_Evas *ee, int *x, int *y, int *w, int *h)
1205{
1206 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1207 {
1208 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1209 "ecore_evas_request_geometry_get");
1210 return;
1211 }
1212 if ((ee->rotation == 90) || (ee->rotation == 270))
1213 {
1214 if (x) *x = ee->req.x;
1215 if (y) *y = ee->req.y;
1216 if (w) *w = ee->req.h;
1217 if (h) *h = ee->req.w;
1218 }
1219 else
1220 {
1221 if (x) *x = ee->req.x;
1222 if (y) *y = ee->req.y;
1223 if (w) *w = ee->req.w;
1224 if (h) *h = ee->req.h;
1225 }
1226}
1227
1228EAPI void
1229ecore_evas_rotation_set(Ecore_Evas *ee, int rot)
1230{
1231 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1232 {
1233 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1234 "ecore_evas_rotation_set");
1235 return;
1236 }
1237 rot = rot % 360;
1238 while (rot < 0) rot += 360;
1239 while (rot >= 360) rot -= 360;
1240 IFC(ee, fn_rotation_set) (ee, rot, 0);
1241 /* make sure everything gets redrawn */
1242 evas_damage_rectangle_add(ee->evas, 0, 0, ee->w, ee->h);
1243 evas_damage_rectangle_add(ee->evas, 0, 0, ee->h, ee->w);
1244 IFE;
1245}
1246
1247EAPI void
1248ecore_evas_rotation_with_resize_set(Ecore_Evas *ee, int rot)
1249{
1250 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1251 {
1252 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1253 "ecore_evas_rotation_set");
1254 return;
1255 }
1256 rot = rot % 360;
1257 while (rot < 0) rot += 360;
1258 while (rot >= 360) rot -= 360;
1259 IFC(ee, fn_rotation_set) (ee, rot, 1);
1260 /* make sure everything gets redrawn */
1261 evas_damage_rectangle_add(ee->evas, 0, 0, ee->w, ee->h);
1262 evas_damage_rectangle_add(ee->evas, 0, 0, ee->h, ee->w);
1263 IFE;
1264}
1265
1266EAPI int
1267ecore_evas_rotation_get(const Ecore_Evas *ee)
1268{
1269 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1270 {
1271 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1272 "ecore_evas_rotation_get");
1273 return 0;
1274 }
1275 return ee->rotation;
1276}
1277
1278EAPI void
1279ecore_evas_shaped_set(Ecore_Evas *ee, Eina_Bool shaped)
1280{
1281 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1282 {
1283 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1284 "ecore_evas_shaped_set");
1285 return;
1286 }
1287 IFC(ee, fn_shaped_set) (ee, shaped);
1288 IFE;
1289}
1290
1291EAPI Eina_Bool
1292ecore_evas_shaped_get(const Ecore_Evas *ee)
1293{
1294 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1295 {
1296 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1297 "ecore_evas_shaped_get");
1298 return EINA_FALSE;
1299 }
1300 return ee->shaped ? EINA_TRUE : EINA_FALSE;
1301}
1302
1303EAPI void
1304ecore_evas_alpha_set(Ecore_Evas *ee, Eina_Bool alpha)
1305{
1306 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1307 {
1308 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1309 "ecore_evas_alpha_set");
1310 return;
1311 }
1312 IFC(ee, fn_alpha_set) (ee, alpha);
1313 IFE;
1314}
1315
1316EAPI Eina_Bool
1317ecore_evas_alpha_get(const Ecore_Evas *ee)
1318{
1319 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1320 {
1321 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1322 "ecore_evas_alpha_get");
1323 return EINA_FALSE;
1324 }
1325 return ee->alpha ? EINA_TRUE : EINA_FALSE;
1326}
1327
1328EAPI void
1329ecore_evas_transparent_set(Ecore_Evas *ee, Eina_Bool transparent)
1330{
1331 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1332 {
1333 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1334 "ecore_evas_transparent_set");
1335 return;
1336 }
1337 IFC(ee, fn_transparent_set) (ee, transparent);
1338 IFE;
1339}
1340
1341EAPI Eina_Bool
1342ecore_evas_transparent_get(const Ecore_Evas *ee)
1343{
1344 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1345 {
1346 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1347 "ecore_evas_transparent_get");
1348 return EINA_FALSE;
1349 }
1350 return ee->transparent ? EINA_TRUE : 0;
1351}
1352
1353EAPI void
1354ecore_evas_show(Ecore_Evas *ee)
1355{
1356 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1357 {
1358 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1359 "ecore_evas_show");
1360 return;
1361 }
1362 IFC(ee, fn_show) (ee);
1363 IFE;
1364}
1365
1366EAPI void
1367ecore_evas_hide(Ecore_Evas *ee)
1368{
1369 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1370 {
1371 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1372 "ecore_evas_hide");
1373 return;
1374 }
1375 IFC(ee, fn_hide) (ee);
1376 IFE;
1377}
1378
1379 EAPI int
1380ecore_evas_visibility_get(const Ecore_Evas *ee)
1381{
1382 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1383 {
1384 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1385 "ecore_evas_visibility_get");
1386 return 0;
1387 }
1388 return ee->visible ? 1:0;
1389}
1390
1391EAPI void
1392ecore_evas_raise(Ecore_Evas *ee)
1393{
1394 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1395 {
1396 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1397 "ecore_evas_raise");
1398 return;
1399 }
1400 IFC(ee, fn_raise) (ee);
1401 IFE;
1402}
1403
1404EAPI void
1405ecore_evas_lower(Ecore_Evas *ee)
1406{
1407 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1408 {
1409 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1410 "ecore_evas_lower");
1411 return;
1412 }
1413 IFC(ee, fn_lower) (ee);
1414 IFE;
1415}
1416
1417EAPI void
1418ecore_evas_activate(Ecore_Evas *ee)
1419{
1420 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1421 {
1422 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1423 "ecore_evas_activate");
1424 return;
1425 }
1426 IFC(ee, fn_activate) (ee);
1427 IFE;
1428}
1429
1430EAPI void
1431ecore_evas_title_set(Ecore_Evas *ee, const char *t)
1432{
1433 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1434 {
1435 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1436 "ecore_evas_title_set");
1437 return;
1438 }
1439 IFC(ee, fn_title_set) (ee, t);
1440 IFE;
1441}
1442
1443EAPI const char *
1444ecore_evas_title_get(const Ecore_Evas *ee)
1445{
1446 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1447 {
1448 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1449 "ecore_evas_title_get");
1450 return NULL;
1451 }
1452 return ee->prop.title;
1453}
1454
1455EAPI void
1456ecore_evas_name_class_set(Ecore_Evas *ee, const char *n, const char *c)
1457{
1458 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1459 {
1460 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1461 "ecore_evas_name_class_set");
1462 return;
1463 }
1464 IFC(ee, fn_name_class_set) (ee, n, c);
1465 IFE;
1466}
1467
1468EAPI void
1469ecore_evas_name_class_get(const Ecore_Evas *ee, const char **n, const char **c)
1470{
1471 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1472 {
1473 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1474 "ecore_evas_name_class_get");
1475 return;
1476 }
1477 if (n) *n = ee->prop.name;
1478 if (c) *c = ee->prop.clas;
1479}
1480
1481EAPI void
1482ecore_evas_size_min_set(Ecore_Evas *ee, int w, int h)
1483{
1484 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1485 {
1486 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1487 "ecore_evas_size_min_set");
1488 return;
1489 }
1490 if (w < 0) w = 0;
1491 if (h < 0) h = 0;
1492 if ((ee->rotation == 90) || (ee->rotation == 270))
1493 {
1494 IFC(ee, fn_size_min_set) (ee, h, w);
1495 IFE;
1496 }
1497 else
1498 {
1499 IFC(ee, fn_size_min_set) (ee, w, h);
1500 IFE;
1501 }