and in a fit of rage... i'm removing those EINA_PURE's - one of them i
[profile/ivi/evas.git] / src / lib / Evas.h
1 /**
2 @mainpage Evas
3
4 @version 1.1
5 @date 2000-2011
6
7 Please see the @ref authors page for contact details.
8
9 @link Evas.h Evas API @endlink
10
11 @section toc Table of Contents
12
13 @li @ref intro
14 @li @ref work
15 @li @ref compiling
16 @li @ref install
17 @li @ref next_steps
18 @li @ref intro_example
19
20
21 @section intro What is Evas?
22
23 Evas is a clean display canvas API for several target display systems
24 that can draw anti-aliased text, smooth super and sub-sampled scaled
25 images, alpha-blend objects and much more.
26
27 It abstracts any need to know much about what the characteristics of
28 your display system are or what graphics calls are used to draw them
29 and how. It deals on an object level where all you do is create and
30 manipulate objects in a canvas, set their properties, and the rest is
31 done for you.
32
33 Evas optimises the rendering pipeline to minimise effort in redrawing
34 changes made to the canvas and so takes this work out of the
35 programmers hand, saving a lot of time and energy.
36
37 It's small and lean, designed to work on embedded systems all the way
38 to large and powerful multi-cpu workstations. It can be compiled to
39 only have the features you need for your target platform if you so
40 wish, thus keeping it small and lean. It has several display
41 back-ends, letting it display on several display systems, making it
42 portable for cross-device and cross-platform development.
43
44 @subsection intro_not_evas What Evas is not?
45
46 Evas is not a widget set or widget toolkit, however it is their
47 base. See Elementary (http://docs.enlightenment.org/auto/elementary/)
48 for a toolkit based on Evas, Edje, Ecore and other Enlightenment
49 technologies.
50
51 It is not dependent or aware of main loops, input or output
52 systems. Input should be polled from various sources and fed to
53 Evas. Similarly, it will not create windows or report windows updates
54 to your system, rather just drawing the pixels and reporting to the
55 user the areas that were changed. Of course these operations are quite
56 common and thus they are ready to use in Ecore, particularly in
57 Ecore_Evas (http://docs.enlightenment.org/auto/ecore/).
58
59
60 @section work How does Evas work?
61
62 Evas is a canvas display library. This is markedly different from most
63 display and windowing systems as a canvas is structural and is also a
64 state engine, whereas most display and windowing systems are immediate
65 mode display targets. Evas handles the logic between a structural
66 display via its state engine, and controls the target windowing system
67 in order to produce rendered results of the current canvas' state on
68 the display.
69
70 Immediate mode display systems retain very little, or no state. A
71 program will execute a series of commands, as in the pseudo code:
72
73 @verbatim
74 draw line from position (0, 0) to position (100, 200);
75
76 draw rectangle from position (10, 30) to position (50, 500);
77
78 bitmap_handle = create_bitmap();
79 scale bitmap_handle to size 100 x 100;
80 draw image bitmap_handle at position (10, 30);
81 @endverbatim
82
83 The series of commands is executed by the windowing system and the
84 results are displayed on the screen (normally). Once the commands are
85 executed the display system has little or no idea of how to reproduce
86 this image again, and so has to be instructed by the application how
87 to redraw sections of the screen whenever needed. Each successive
88 command will be executed as instructed by the application and either
89 emulated by software or sent to the graphics hardware on the device to
90 be performed.
91
92 The advantage of such a system is that it is simple, and gives a
93 program tight control over how something looks and is drawn. Given the
94 increasing complexity of displays and demands by users to have better
95 looking interfaces, more and more work is needing to be done at this
96 level by the internals of widget sets, custom display widgets and
97 other programs. This means more and more logic and display rendering
98 code needs to be written time and time again, each time the
99 application needs to figure out how to minimise redraws so that
100 display is fast and interactive, and keep track of redraw logic. The
101 power comes at a high-price, lots of extra code and work.  Programmers
102 not very familiar with graphics programming will often make mistakes
103 at this level and produce code that is sub optimal. Those familiar
104 with this kind of programming will simply get bored by writing the
105 same code again and again.
106
107 For example, if in the above scene, the windowing system requires the
108 application to redraw the area from 0, 0 to 50, 50 (also referred as
109 "expose event"), then the programmer must calculate manually the
110 updates and repaint it again:
111
112 @verbatim
113 Redraw from position (0, 0) to position (50, 50):
114
115 // what was in area (0, 0, 50, 50)?
116
117 // 1. intersection part of line (0, 0) to (100, 200)?
118       draw line from position (0, 0) to position (25, 50);
119
120 // 2. intersection part of rectangle (10, 30) to (50, 500)?
121       draw rectangle from position (10, 30) to position (50, 50)
122
123 // 3. intersection part of image at (10, 30), size 100 x 100?
124       bitmap_subimage = subregion from position (0, 0) to position (40, 20)
125       draw image bitmap_subimage at position (10, 30);
126 @endverbatim
127
128 The clever reader might have noticed that, if all elements in the
129 above scene are opaque, then the system is doing useless paints: part
130 of the line is behind the rectangle, and part of the rectangle is
131 behind the image. These useless paints tend to be very costly, as
132 pixels tend to be 4 bytes in size, thus an overlapping region of 100 x
133 100 pixels is around 40000 useless writes! The developer could write
134 code to calculate the overlapping areas and avoid painting then, but
135 then it should be mixed with the "expose event" handling mentioned
136 above and quickly one realizes the initially simpler method became
137 really complex.
138
139 Evas is a structural system in which the programmer creates and
140 manages display objects and their properties, and as a result of this
141 higher level state management, the canvas is able to redraw the set of
142 objects when needed to represent the current state of the canvas.
143
144 For example, the pseudo code:
145
146 @verbatim
147 line_handle = create_line();
148 set line_handle from position (0, 0) to position (100, 200);
149 show line_handle;
150
151 rectangle_handle = create_rectangle();
152 move rectangle_handle to position (10, 30);
153 resize rectangle_handle to size 40 x 470;
154 show rectangle_handle;
155
156 bitmap_handle = create_bitmap();
157 scale bitmap_handle to size 100 x 100;
158 move bitmap_handle to position (10, 30);
159 show bitmap_handle;
160
161 render scene;
162 @endverbatim
163
164 This may look longer, but when the display needs to be refreshed or
165 updated, the programmer only moves, resizes, shows, hides etc. the
166 objects that need to change. The programmer simply thinks at the
167 object logic level, and the canvas software does the rest of the work
168 for them, figuring out what actually changed in the canvas since it
169 was last drawn, how to most efficiently redraw the canvas and its
170 contents to reflect the current state, and then it can go off and do
171 the actual drawing of the canvas.
172
173 This lets the programmer think in a more natural way when dealing with
174 a display, and saves time and effort of working out how to load and
175 display images, render given the current display system etc. Since
176 Evas also is portable across different display systems, this also
177 gives the programmer the ability to have their code ported and
178 displayed on different display systems with very little work.
179
180 Evas can be seen as a display system that stands somewhere between a
181 widget set and an immediate mode display system. It retains basic
182 display logic, but does very little high-level logic such as
183 scrollbars, sliders, push buttons etc.
184
185
186 @section compiling How to compile using Evas ?
187
188 Evas is a library your application links to. The procedure for this is
189 very simple. You simply have to compile your application with the
190 appropriate compiler flags that the @c pkg-config script outputs. For
191 example:
192
193 Compiling C or C++ files into object files:
194
195 @verbatim
196 gcc -c -o main.o main.c `pkg-config --cflags evas`
197 @endverbatim
198
199 Linking object files into a binary executable:
200
201 @verbatim
202 gcc -o my_application main.o `pkg-config --libs evas`
203 @endverbatim
204
205 You simply have to make sure that @c pkg-config is in your shell's @c
206 PATH (see the manual page for your appropriate shell) and @c evas.pc
207 in @c /usr/lib/pkgconfig or its path in the @c PKG_CONFIG_PATH
208 environment variable. It's that simple to link and use Evas once you
209 have written your code to use it.
210
211 Since the program is linked to Evas, it is now able to use any
212 advertised API calls to display graphics in a canvas managed by it, as
213 well as use the API calls provided to manage data.
214
215 You should make sure you add any extra compile and link flags to your
216 compile commands that your application may need as well. The above
217 example is only guaranteed to make Evas add it's own requirements.
218
219
220 @section install How is it installed?
221
222 Simple:
223
224 @verbatim
225 ./configure
226 make
227 su -
228 ...
229 make install
230 @endverbatim
231
232 @section next_steps Next Steps
233
234 After you understood what Evas is and installed it in your system you
235 should proceed understanding the programming interface for all
236 objects, then see the specific for the most used elements. We'd
237 recommend you to take a while to learn Ecore
238 (http://docs.enlightenment.org/auto/ecore/) and Edje
239 (http://docs.enlightenment.org/auto/edje/) as they will likely save
240 you tons of work compared to using just Evas directly.
241
242 Recommended reading:
243
244 @li @ref Evas_Object_Group, where you'll get how to basically
245     manipulate generic objects lying on an Evas canvas, handle canvas
246     and object events, etc.
247 @li @ref Evas_Object_Rectangle, to learn about the most basic object
248     type on Evas -- the rectangle.
249 @li @ref Evas_Object_Polygon, to learn how to create polygon elements
250     on the canvas.
251 @li @ref Evas_Line_Group, to learn how to create line elements on the
252     canvas.
253 @li @ref Evas_Object_Image, to learn about image objects, over which
254     Evas can do a plethora of operations.
255 @li @ref Evas_Object_Text, to learn how to create textual elements on
256     the canvas.
257 @li @ref Evas_Object_Textblock, to learn how to create multiline
258     textual elements on the canvas.
259 @li @ref Evas_Smart_Object_Group and @ref Evas_Smart_Group, to define
260     new objects that provide @b custom functions to handle clipping,
261     hiding, moving, resizing, color setting and more. These could
262     be as simple as a group of objects that move together (see @ref
263     Evas_Smart_Object_Clipped) up to implementations of what
264     ends to be a widget, providing some intelligence (thus the name)
265     to Evas objects -- like a button or check box, for example.
266
267 @section intro_example Introductory Example
268
269 @include evas-buffer-simple.c
270 */
271
272 /**
273 @page authors Authors
274 @author Carsten Haitzler <raster@@rasterman.com>
275 @author Till Adam <till@@adam-lilienthal.de>
276 @author Steve Ireland <sireland@@pobox.com>
277 @author Brett Nash <nash@@nash.id.au>
278 @author Tilman Sauerbeck <tilman@@code-monkey.de>
279 @author Corey Donohoe <atmos@@atmos.org>
280 @author Yuri Hudobin <glassy_ape@@users.sourceforge.net>
281 @author Nathan Ingersoll <ningerso@@d.umn.edu>
282 @author Willem Monsuwe <willem@@stack.nl>
283 @author Jose O Gonzalez <jose_ogp@@juno.com>
284 @author Bernhard Nemec <Bernhard.Nemec@@viasyshc.com>
285 @author Jorge Luis Zapata Muga <jorgeluis.zapata@@gmail.com>
286 @author Cedric Bail <cedric.bail@@free.fr>
287 @author Gustavo Sverzut Barbieri <barbieri@@profusion.mobi>
288 @author Vincent Torri <vtorri@@univ-evry.fr>
289 @author Tim Horton <hortont424@@gmail.com>
290 @author Tom Hacohen <tom@@stosb.com>
291 @author Mathieu Taillefumier <mathieu.taillefumier@@free.fr>
292 @author Iván Briano <ivan@@profusion.mobi>
293 @author Gustavo Lima Chaves <glima@@profusion.mobi>
294 @author Samsung Electronics <tbd>
295 @author Samsung SAIT <tbd>
296 @author Sung W. Park <sungwoo@@gmail.com>
297 @author Jiyoun Park <jy0703.park@@samsung.com>
298 @author Myoungwoon Roy Kim(roy_kim) <myoungwoon.kim@@samsung.com> <myoungwoon@@gmail.com>
299 @author Thierry el Borgi <thierry@@substantiel.fr>
300 @author ChunEon Park <hermet@@hermet.pe.kr>
301 @author Christopher 'devilhorns' Michael <cpmichael1@comcast.net>
302 @author Seungsoo Woo <om101.woo@samsung.com>
303
304 Please contact <enlightenment-devel@lists.sourceforge.net> to get in
305 contact with the developers and maintainers.
306 */
307
308 #ifndef _EVAS_H
309 #define _EVAS_H
310
311 #include <time.h>
312
313 #include <Eina.h>
314
315 #ifdef EAPI
316 # undef EAPI
317 #endif
318
319 #ifdef _WIN32
320 # ifdef EFL_EVAS_BUILD
321 #  ifdef DLL_EXPORT
322 #   define EAPI __declspec(dllexport)
323 #  else
324 #   define EAPI
325 #  endif /* ! DLL_EXPORT */
326 # else
327 #  define EAPI __declspec(dllimport)
328 # endif /* ! EFL_EVAS_BUILD */
329 #else
330 # ifdef __GNUC__
331 #  if __GNUC__ >= 4
332 #   define EAPI __attribute__ ((visibility("default")))
333 #  else
334 #   define EAPI
335 #  endif
336 # else
337 #  define EAPI
338 # endif
339 #endif /* ! _WIN32 */
340
341 #ifdef __cplusplus
342 extern "C" {
343 #endif
344
345 #define EVAS_VERSION_MAJOR 1
346 #define EVAS_VERSION_MINOR 0
347
348 typedef struct _Evas_Version
349 {
350    int major;
351    int minor;
352    int micro;
353    int revision;
354 } Evas_Version;
355
356 EAPI extern Evas_Version *evas_version;
357
358 /**
359  * @file
360  * @brief These routines are used for Evas library interaction.
361  *
362  * @todo check boolean return values and convert to Eina_Bool
363  * @todo change all api to use EINA_SAFETY_*
364  * @todo finish api documentation
365  */
366
367 /* BiDi exposed stuff */
368    /*FIXME: document */
369 typedef enum _Evas_BiDi_Direction
370 {
371    EVAS_BIDI_DIRECTION_NATURAL,
372    EVAS_BIDI_DIRECTION_NEUTRAL = EVAS_BIDI_DIRECTION_NATURAL,
373    EVAS_BIDI_DIRECTION_LTR,
374    EVAS_BIDI_DIRECTION_RTL
375 } Evas_BiDi_Direction;
376
377 /**
378  * Identifier of callbacks to be set for Evas canvases or Evas
379  * objects.
380  *
381  * The following figure illustrates some Evas callbacks:
382  *
383  * @image html evas-callbacks.png
384  * @image rtf evas-callbacks.png
385  * @image latex evas-callbacks.eps
386  *
387  * @see evas_object_event_callback_add()
388  * @see evas_event_callback_add()
389  */
390 typedef enum _Evas_Callback_Type
391 {
392    /*
393     * The following events are only for use with Evas objects, with
394     * evas_object_event_callback_add():
395     */
396    EVAS_CALLBACK_MOUSE_IN, /**< Mouse In Event */
397    EVAS_CALLBACK_MOUSE_OUT, /**< Mouse Out Event */
398    EVAS_CALLBACK_MOUSE_DOWN, /**< Mouse Button Down Event */
399    EVAS_CALLBACK_MOUSE_UP, /**< Mouse Button Up Event */
400    EVAS_CALLBACK_MOUSE_MOVE, /**< Mouse Move Event */
401    EVAS_CALLBACK_MOUSE_WHEEL, /**< Mouse Wheel Event */
402    EVAS_CALLBACK_MULTI_DOWN, /**< Multi-touch Down Event */
403    EVAS_CALLBACK_MULTI_UP, /**< Multi-touch Up Event */
404    EVAS_CALLBACK_MULTI_MOVE, /**< Multi-touch Move Event */
405    EVAS_CALLBACK_FREE, /**< Object Being Freed (Called after Del) */
406    EVAS_CALLBACK_KEY_DOWN, /**< Key Press Event */
407    EVAS_CALLBACK_KEY_UP, /**< Key Release Event */
408    EVAS_CALLBACK_FOCUS_IN, /**< Focus In Event */
409    EVAS_CALLBACK_FOCUS_OUT, /**< Focus Out Event */
410    EVAS_CALLBACK_SHOW, /**< Show Event */
411    EVAS_CALLBACK_HIDE, /**< Hide Event */
412    EVAS_CALLBACK_MOVE, /**< Move Event */
413    EVAS_CALLBACK_RESIZE, /**< Resize Event */
414    EVAS_CALLBACK_RESTACK, /**< Restack Event */
415    EVAS_CALLBACK_DEL, /**< Object Being Deleted (called before Free) */
416    EVAS_CALLBACK_HOLD, /**< Events go on/off hold */
417    EVAS_CALLBACK_CHANGED_SIZE_HINTS, /**< Size hints changed event */
418    EVAS_CALLBACK_IMAGE_PRELOADED, /**< Image has been preloaded */
419
420    /*
421     * The following events are only for use with Evas canvases, with
422     * evas_event_callback_add():
423     */
424    EVAS_CALLBACK_CANVAS_FOCUS_IN, /**< Canvas got focus as a whole */
425    EVAS_CALLBACK_CANVAS_FOCUS_OUT, /**< Canvas lost focus as a whole */
426    EVAS_CALLBACK_RENDER_FLUSH_PRE, /**< Called just before rendering is updated on the canvas target */
427    EVAS_CALLBACK_RENDER_FLUSH_POST, /**< Called just after rendering is updated on the canvas target */
428    EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_IN, /**< Canvas object got focus */
429    EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_OUT, /**< Canvas object lost focus */
430
431    /*
432     * More Evas object event types - see evas_object_event_callback_add():
433     */
434    EVAS_CALLBACK_IMAGE_UNLOADED, /**< Image data has been unloaded (by some mechanims in Evas that throw out original image data) */
435
436    EVAS_CALLBACK_RENDER_PRE, /**< Called just before rendering starts on the canvas target @since 1.2 */
437    EVAS_CALLBACK_RENDER_POST, /**< Called just after rendering stops on the canvas target @since 1.2 */
438      
439    EVAS_CALLBACK_LAST /**< kept as last element/sentinel -- not really an event */
440 } Evas_Callback_Type; /**< The types of events triggering a callback */
441
442 /**
443  * @def EVAS_CALLBACK_PRIORITY_BEFORE
444  * Slightly more prioritized than default.
445  * @since 1.1.0
446  */
447 #define EVAS_CALLBACK_PRIORITY_BEFORE -100
448 /**
449  * @def EVAS_CALLBACK_PRIORITY_DEFAULT
450  * Default callback priority level
451  * @since 1.1.0
452  */
453 #define EVAS_CALLBACK_PRIORITY_DEFAULT 0
454 /**
455  * @def EVAS_CALLBACK_PRIORITY_AFTER
456  * Slightly less prioritized than default.
457  * @since 1.1.0
458  */
459 #define EVAS_CALLBACK_PRIORITY_AFTER 100
460
461 /**
462  * @typedef Evas_Callback_Priority
463  *
464  * Callback priority value. Range is -32k - 32k. The lower the number, the
465  * bigger the priority.
466  *
467  * @see EVAS_CALLBACK_PRIORITY_AFTER
468  * @see EVAS_CALLBACK_PRIORITY_BEFORE
469  * @see EVAS_CALLBACK_PRIORITY_DEFAULT
470  *
471  * @since 1.1.0
472  */
473 typedef short Evas_Callback_Priority;
474
475 /**
476  * Flags for Mouse Button events
477  */
478 typedef enum _Evas_Button_Flags
479 {
480    EVAS_BUTTON_NONE = 0, /**< No extra mouse button data */
481    EVAS_BUTTON_DOUBLE_CLICK = (1 << 0), /**< This mouse button press was the 2nd press of a double click */
482    EVAS_BUTTON_TRIPLE_CLICK = (1 << 1) /**< This mouse button press was the 3rd press of a triple click */
483 } Evas_Button_Flags; /**< Flags for Mouse Button events */
484
485 /**
486  * Flags for Events
487  */
488 typedef enum _Evas_Event_Flags
489 {
490    EVAS_EVENT_FLAG_NONE = 0, /**< No fancy flags set */
491    EVAS_EVENT_FLAG_ON_HOLD = (1 << 0), /**< This event is being delivered but should be put "on hold" until the on hold flag is unset. the event should be used for informational purposes and maybe some indications visually, but not actually perform anything */
492    EVAS_EVENT_FLAG_ON_SCROLL = (1 << 1) /**< This event flag indicates the event occurs while scrolling; for exameple, DOWN event occurs during scrolling; the event should be used for informational purposes and maybe some indications visually, but not actually perform anything */
493 } Evas_Event_Flags; /**< Flags for Events */
494
495 /**
496  * State of Evas_Coord_Touch_Point
497  */
498 typedef enum _Evas_Touch_Point_State
499 {
500    EVAS_TOUCH_POINT_DOWN, /**< Touch point is pressed down */
501    EVAS_TOUCH_POINT_UP, /**< Touch point is released */
502    EVAS_TOUCH_POINT_MOVE, /**< Touch point is moved */
503    EVAS_TOUCH_POINT_STILL, /**< Touch point is not moved after pressed */
504    EVAS_TOUCH_POINT_CANCEL /**< Touch point is calcelled */
505 } Evas_Touch_Point_State;
506
507 /**
508  * Flags for Font Hinting
509  * @ingroup Evas_Font_Group
510  */
511 typedef enum _Evas_Font_Hinting_Flags
512 {
513    EVAS_FONT_HINTING_NONE, /**< No font hinting */
514    EVAS_FONT_HINTING_AUTO, /**< Automatic font hinting */
515    EVAS_FONT_HINTING_BYTECODE /**< Bytecode font hinting */
516 } Evas_Font_Hinting_Flags; /**< Flags for Font Hinting */
517
518 /**
519  * Colorspaces for pixel data supported by Evas
520  * @ingroup Evas_Object_Image
521  */
522 typedef enum _Evas_Colorspace
523 {
524    EVAS_COLORSPACE_ARGB8888, /**< ARGB 32 bits per pixel, high-byte is Alpha, accessed 1 32bit word at a time */
525      /* these are not currently supported - but planned for the future */
526    EVAS_COLORSPACE_YCBCR422P601_PL, /**< YCbCr 4:2:2 Planar, ITU.BT-601 specifications. The data pointed to is just an array of row pointer, pointing to the Y rows, then the Cb, then Cr rows */
527    EVAS_COLORSPACE_YCBCR422P709_PL,/**< YCbCr 4:2:2 Planar, ITU.BT-709 specifications. The data pointed to is just an array of row pointer, pointing to the Y rows, then the Cb, then Cr rows */
528    EVAS_COLORSPACE_RGB565_A5P, /**< 16bit rgb565 + Alpha plane at end - 5 bits of the 8 being used per alpha byte */
529    EVAS_COLORSPACE_GRY8, /**< 8bit grayscale */
530    EVAS_COLORSPACE_YCBCR422601_PL, /**<  YCbCr 4:2:2, ITU.BT-601 specifications. The data poitned to is just an array of row pointer, pointing to line of Y,Cb,Y,Cr bytes */
531    EVAS_COLORSPACE_YCBCR420NV12601_PL, /**< YCbCr 4:2:0, ITU.BT-601 specification. The data pointed to is just an array of row pointer, pointing to the Y rows, then the Cb,Cr rows. */
532    EVAS_COLORSPACE_YCBCR420TM12601_PL, /**< YCbCr 4:2:0, ITU.BT-601 specification. The data pointed to is just an array of tiled row pointer, pointing to the Y rows, then the Cb,Cr rows. */
533 } Evas_Colorspace; /**< Colorspaces for pixel data supported by Evas */
534
535 /**
536  * How to pack items into cells in a table.
537  * @ingroup Evas_Object_Table
538  *
539  * @see evas_object_table_homogeneous_set() for an explanation of the funcion of
540  * each one.
541  */
542 typedef enum _Evas_Object_Table_Homogeneous_Mode
543 {
544   EVAS_OBJECT_TABLE_HOMOGENEOUS_NONE = 0,
545   EVAS_OBJECT_TABLE_HOMOGENEOUS_TABLE = 1,
546   EVAS_OBJECT_TABLE_HOMOGENEOUS_ITEM = 2
547 } Evas_Object_Table_Homogeneous_Mode; /**< Table cell pack mode. */
548
549 typedef struct _Evas_Coord_Rectangle  Evas_Coord_Rectangle; /**< A generic rectangle handle */
550 typedef struct _Evas_Point                   Evas_Point; /**< integer point */
551
552 typedef struct _Evas_Coord_Point             Evas_Coord_Point;  /**< Evas_Coord point */
553 typedef struct _Evas_Coord_Precision_Point   Evas_Coord_Precision_Point; /**< Evas_Coord point with sub-pixel precision */
554
555 typedef struct _Evas_Position                Evas_Position; /**< associates given point in Canvas and Output */
556 typedef struct _Evas_Precision_Position      Evas_Precision_Position; /**< associates given point in Canvas and Output, with sub-pixel precision */
557
558 /**
559  * @typedef Evas_Smart_Class
560  *
561  * A smart object's @b base class definition
562  *
563  * @ingroup Evas_Smart_Group
564  */
565 typedef struct _Evas_Smart_Class             Evas_Smart_Class;
566
567 /**
568  * @typedef Evas_Smart_Cb_Description
569  *
570  * A smart object callback description, used to provide introspection
571  *
572  * @ingroup Evas_Smart_Group
573  */
574 typedef struct _Evas_Smart_Cb_Description    Evas_Smart_Cb_Description;
575
576 /**
577  * @typedef Evas_Map
578  *
579  * An opaque handle to map points
580  *
581  * @see evas_map_new()
582  * @see evas_map_free()
583  * @see evas_map_dup()
584  *
585  * @ingroup Evas_Object_Group_Map
586  */
587 typedef struct _Evas_Map            Evas_Map;
588
589 /**
590  * @typedef Evas
591  *
592  * An opaque handle to an Evas canvas.
593  *
594  * @see evas_new()
595  * @see evas_free()
596  *
597  * @ingroup Evas_Canvas
598  */
599 typedef struct _Evas                Evas;
600
601 /**
602  * @typedef Evas_Object
603  * An Evas Object handle.
604  * @ingroup Evas_Object_Group
605  */
606 typedef struct _Evas_Object         Evas_Object;
607
608 typedef void                        Evas_Performance; /**< An Evas Performance handle */
609 typedef struct _Evas_Modifier       Evas_Modifier; /**< An opaque type containing information on which modifier keys are registered in an Evas canvas */
610 typedef struct _Evas_Lock           Evas_Lock; /**< An opaque type containing information on which lock keys are registered in an Evas canvas */
611 typedef struct _Evas_Smart          Evas_Smart; /**< An Evas Smart Object handle */
612 typedef struct _Evas_Native_Surface Evas_Native_Surface; /**< A generic datatype for engine specific native surface information */
613
614  /**
615   * @typedef Evas_Video_Surface
616   *
617   * A generic datatype for video specific surface information
618   * @see evas_object_image_video_surface_set
619   * @see evas_object_image_video_surface_get
620   * @since 1.1.0
621   */
622 typedef struct _Evas_Video_Surface  Evas_Video_Surface;
623
624 typedef unsigned long long          Evas_Modifier_Mask; /**< An Evas modifier mask type */
625
626 typedef int                         Evas_Coord;
627 typedef int                         Evas_Font_Size;
628 typedef int                         Evas_Angle;
629
630 struct _Evas_Coord_Rectangle /**< A rectangle in Evas_Coord */
631 {
632    Evas_Coord x; /**< top-left x co-ordinate of rectangle */
633    Evas_Coord y; /**< top-left y co-ordinate of rectangle */
634    Evas_Coord w; /**< width of rectangle */
635    Evas_Coord h; /**< height of rectangle */
636 };
637
638 struct _Evas_Point
639 {
640    int x, y;
641 };
642
643 struct _Evas_Coord_Point
644 {
645    Evas_Coord x, y;
646 };
647
648 struct _Evas_Coord_Precision_Point
649 {
650    Evas_Coord x, y;
651    double xsub, ysub;
652 };
653
654 struct _Evas_Position
655 {
656     Evas_Point output;
657     Evas_Coord_Point canvas;
658 };
659
660 struct _Evas_Precision_Position
661 {
662     Evas_Point output;
663     Evas_Coord_Precision_Point canvas;
664 };
665
666 typedef enum _Evas_Aspect_Control
667 {
668    EVAS_ASPECT_CONTROL_NONE = 0, /**< Preference on scaling unset */
669    EVAS_ASPECT_CONTROL_NEITHER = 1, /**< Same effect as unset preference on scaling */
670    EVAS_ASPECT_CONTROL_HORIZONTAL = 2, /**< Use all horizontal container space to place an object, using the given aspect */
671    EVAS_ASPECT_CONTROL_VERTICAL = 3, /**< Use all vertical container space to place an object, using the given aspect */
672    EVAS_ASPECT_CONTROL_BOTH = 4 /**< Use all horizontal @b and vertical container spaces to place an object (never growing it out of those bounds), using the given aspect */
673 } Evas_Aspect_Control; /**< Aspect types/policies for scaling size hints, used for evas_object_size_hint_aspect_set() */
674
675 typedef struct _Evas_Pixel_Import_Source Evas_Pixel_Import_Source; /**< A source description of pixels for importing pixels */
676 typedef struct _Evas_Engine_Info      Evas_Engine_Info; /**< A generic Evas Engine information structure */
677 typedef struct _Evas_Device           Evas_Device; /**< A source device handle - where the event came from */
678 typedef struct _Evas_Event_Mouse_Down Evas_Event_Mouse_Down; /**< Event structure for #EVAS_CALLBACK_MOUSE_DOWN event callbacks */
679 typedef struct _Evas_Event_Mouse_Up   Evas_Event_Mouse_Up; /**< Event structure for #EVAS_CALLBACK_MOUSE_UP event callbacks */
680 typedef struct _Evas_Event_Mouse_In   Evas_Event_Mouse_In; /**< Event structure for #EVAS_CALLBACK_MOUSE_IN event callbacks */
681 typedef struct _Evas_Event_Mouse_Out  Evas_Event_Mouse_Out; /**< Event structure for #EVAS_CALLBACK_MOUSE_OUT event callbacks */
682 typedef struct _Evas_Event_Mouse_Move Evas_Event_Mouse_Move; /**< Event structure for #EVAS_CALLBACK_MOUSE_MOVE event callbacks */
683 typedef struct _Evas_Event_Mouse_Wheel Evas_Event_Mouse_Wheel; /**< Event structure for #EVAS_CALLBACK_MOUSE_WHEEL event callbacks */
684 typedef struct _Evas_Event_Multi_Down Evas_Event_Multi_Down; /**< Event structure for #EVAS_CALLBACK_MULTI_DOWN event callbacks */
685 typedef struct _Evas_Event_Multi_Up   Evas_Event_Multi_Up; /**< Event structure for #EVAS_CALLBACK_MULTI_UP event callbacks */
686 typedef struct _Evas_Event_Multi_Move Evas_Event_Multi_Move; /**< Event structure for #EVAS_CALLBACK_MULTI_MOVE event callbacks */
687 typedef struct _Evas_Event_Key_Down   Evas_Event_Key_Down; /**< Event structure for #EVAS_CALLBACK_KEY_DOWN event callbacks */
688 typedef struct _Evas_Event_Key_Up     Evas_Event_Key_Up; /**< Event structure for #EVAS_CALLBACK_KEY_UP event callbacks */
689 typedef struct _Evas_Event_Hold       Evas_Event_Hold; /**< Event structure for #EVAS_CALLBACK_HOLD event callbacks */
690
691 typedef enum _Evas_Load_Error
692 {
693    EVAS_LOAD_ERROR_NONE = 0, /**< No error on load */
694    EVAS_LOAD_ERROR_GENERIC = 1, /**< A non-specific error occurred */
695    EVAS_LOAD_ERROR_DOES_NOT_EXIST = 2, /**< File (or file path) does not exist */
696    EVAS_LOAD_ERROR_PERMISSION_DENIED = 3, /**< Permission deinied to an existing file (or path) */
697    EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED = 4, /**< Allocation of resources failure prevented load */
698    EVAS_LOAD_ERROR_CORRUPT_FILE = 5, /**< File corrupt (but was detected as a known format) */
699    EVAS_LOAD_ERROR_UNKNOWN_FORMAT = 6 /**< File is not a known format */
700 } Evas_Load_Error; /**< Evas image load error codes one can get - see evas_load_error_str() too. */
701
702
703 typedef enum _Evas_Alloc_Error
704 {
705    EVAS_ALLOC_ERROR_NONE = 0, /**< No allocation error */
706    EVAS_ALLOC_ERROR_FATAL = 1, /**< Allocation failed despite attempts to free up memory */
707    EVAS_ALLOC_ERROR_RECOVERED = 2 /**< Allocation succeeded, but extra memory had to be found by freeing up speculative resources */
708 } Evas_Alloc_Error; /**< Possible allocation errors returned by evas_alloc_error() */
709
710 typedef enum _Evas_Fill_Spread
711 {
712    EVAS_TEXTURE_REFLECT = 0, /**< image fill tiling mode - tiling reflects */
713    EVAS_TEXTURE_REPEAT = 1, /**< tiling repeats */
714    EVAS_TEXTURE_RESTRICT = 2, /**< tiling clamps - range offset ignored */
715    EVAS_TEXTURE_RESTRICT_REFLECT = 3, /**< tiling clamps and any range offset reflects */
716    EVAS_TEXTURE_RESTRICT_REPEAT = 4, /**< tiling clamps and any range offset repeats */
717    EVAS_TEXTURE_PAD = 5 /**< tiling extends with end values */
718 } Evas_Fill_Spread; /**< Fill types used for evas_object_image_fill_spread_set() */
719
720 typedef enum _Evas_Pixel_Import_Pixel_Format
721 {
722    EVAS_PIXEL_FORMAT_NONE = 0, /**< No pixel format */
723    EVAS_PIXEL_FORMAT_ARGB32 = 1, /**< ARGB 32bit pixel format with A in the high byte per 32bit pixel word */
724    EVAS_PIXEL_FORMAT_YUV420P_601 = 2 /**< YUV 420 Planar format with CCIR 601 color encoding wuth contiguous planes in the order Y, U and V */
725 } Evas_Pixel_Import_Pixel_Format; /**< Pixel format for import call. See evas_object_image_pixels_import() */
726
727 struct _Evas_Pixel_Import_Source
728 {
729    Evas_Pixel_Import_Pixel_Format format; /**< pixel format type ie ARGB32, YUV420P_601 etc. */
730    int w, h; /**< width and height of source in pixels */
731    void **rows; /**< an array of pointers (size depends on format) pointing to left edge of each scanline */
732 };
733
734 /* magic version number to know what the native surf struct looks like */
735 #define EVAS_NATIVE_SURFACE_VERSION 2
736
737 typedef enum _Evas_Native_Surface_Type
738 {
739    EVAS_NATIVE_SURFACE_NONE,
740    EVAS_NATIVE_SURFACE_X11,
741    EVAS_NATIVE_SURFACE_OPENGL
742 } Evas_Native_Surface_Type;
743
744 struct _Evas_Native_Surface
745 {
746    int                         version;
747    Evas_Native_Surface_Type    type;
748    union {
749      struct {
750        void          *visual; /**< visual of the pixmap to use (Visual) */
751        unsigned long  pixmap; /**< pixmap id to use (Pixmap) */
752      } x11;
753      struct {
754        unsigned int   texture_id; /**< opengl texture id to use from glGenTextures() */
755        unsigned int   framebuffer_id; /**< 0 if not a FBO, FBO id otherwise from glGenFramebuffers() */
756        unsigned int   internal_format; /**< same as 'internalFormat' for glTexImage2D() */
757        unsigned int   format; /**< same as 'format' for glTexImage2D() */
758        unsigned int   x, y, w, h; /**< region inside the texture to use (image size is assumed as texture size, with 0, 0 being the top-left and co-ordinates working down to the right and bottom being positive) */
759      } opengl;
760    } data;
761 };
762
763 /**
764  * @def EVAS_VIDEO_SURFACE_VERSION
765  * Magic version number to know what the video surf struct looks like
766  * @since 1.1.0
767  */
768 #define EVAS_VIDEO_SURFACE_VERSION 1
769
770 typedef void (*Evas_Video_Cb)(void *data, Evas_Object *obj, const Evas_Video_Surface *surface);
771 typedef void (*Evas_Video_Coord_Cb)(void *data, Evas_Object *obj, const Evas_Video_Surface *surface, Evas_Coord a, Evas_Coord b);
772
773 struct _Evas_Video_Surface
774 {
775    int version;
776
777    Evas_Video_Coord_Cb move; /**< Move the video surface to this position */
778    Evas_Video_Coord_Cb resize; /**< Resize the video surface to that size */
779    Evas_Video_Cb show; /**< Show the video overlay surface */
780    Evas_Video_Cb hide; /**< Hide the video overlay surface */
781    Evas_Video_Cb update_pixels; /**< Please update the Evas_Object_Image pixels when called */
782
783    Evas_Object   *parent;
784    void          *data;
785 };
786
787 #define EVAS_LAYER_MIN -32768 /**< bottom-most layer number */
788 #define EVAS_LAYER_MAX 32767  /**< top-most layer number */
789
790 #define EVAS_COLOR_SPACE_ARGB 0 /**< Not used for anything */
791 #define EVAS_COLOR_SPACE_AHSV 1 /**< Not used for anything */
792 #define EVAS_TEXT_INVALID -1 /**< Not used for anything */
793 #define EVAS_TEXT_SPECIAL -2 /**< Not used for anything */
794
795 #define EVAS_HINT_EXPAND  1.0 /**< Use with evas_object_size_hint_weight_set(), evas_object_size_hint_weight_get(), evas_object_size_hint_expand_set(), evas_object_size_hint_expand_get() */
796 #define EVAS_HINT_FILL   -1.0 /**< Use with evas_object_size_hint_align_set(), evas_object_size_hint_align_get(), evas_object_size_hint_fill_set(), evas_object_size_hint_fill_get() */
797 #define evas_object_size_hint_fill_set evas_object_size_hint_align_set /**< Convenience macro to make it easier to understand that align is also used for fill properties (as fill is mutually exclusive to align) */
798 #define evas_object_size_hint_fill_get evas_object_size_hint_align_get /**< Convenience macro to make it easier to understand that align is also used for fill properties (as fill is mutually exclusive to align) */
799 #define evas_object_size_hint_expand_set evas_object_size_hint_weight_set /**< Convenience macro to make it easier to understand that weight is also used for expand properties */
800 #define evas_object_size_hint_expand_get evas_object_size_hint_weight_get /**< Convenience macro to make it easier to understand that weight is also used for expand properties */
801
802 /**
803  * How the object should be rendered to output.
804  * @ingroup Evas_Object_Group_Extras
805  */
806 typedef enum _Evas_Render_Op
807 {
808    EVAS_RENDER_BLEND = 0, /**< default op: d = d*(1-sa) + s */
809    EVAS_RENDER_BLEND_REL = 1, /**< d = d*(1 - sa) + s*da */
810    EVAS_RENDER_COPY = 2, /**< d = s */
811    EVAS_RENDER_COPY_REL = 3, /**< d = s*da */
812    EVAS_RENDER_ADD = 4, /**< d = d + s */
813    EVAS_RENDER_ADD_REL = 5, /**< d = d + s*da */
814    EVAS_RENDER_SUB = 6, /**< d = d - s */
815    EVAS_RENDER_SUB_REL = 7, /**< d = d - s*da */
816    EVAS_RENDER_TINT = 8, /**< d = d*s + d*(1 - sa) + s*(1 - da) */
817    EVAS_RENDER_TINT_REL = 9, /**< d = d*(1 - sa + s) */
818    EVAS_RENDER_MASK = 10, /**< d = d*sa */
819    EVAS_RENDER_MUL = 11 /**< d = d*s */
820 } Evas_Render_Op; /**< How the object should be rendered to output. */
821
822 typedef enum _Evas_Border_Fill_Mode
823 {
824    EVAS_BORDER_FILL_NONE = 0, /**< Image's center region is @b not to be rendered */
825    EVAS_BORDER_FILL_DEFAULT = 1, /**< Image's center region is to be @b blended with objects underneath it, if it has transparency. This is the default behavior for image objects */
826    EVAS_BORDER_FILL_SOLID = 2 /**< Image's center region is to be made solid, even if it has transparency on it */
827 } Evas_Border_Fill_Mode; /**< How an image's center region (the complement to the border region) should be rendered by Evas */
828
829 typedef enum _Evas_Image_Scale_Hint
830 {
831    EVAS_IMAGE_SCALE_HINT_NONE = 0, /**< No scale hint at all */
832    EVAS_IMAGE_SCALE_HINT_DYNAMIC = 1, /**< Image is being re-scaled over time, thus turning scaling cache @b off for its data */
833    EVAS_IMAGE_SCALE_HINT_STATIC = 2 /**< Image is not being re-scaled over time, thus turning scaling cache @b on for its data */
834 } Evas_Image_Scale_Hint; /**< How an image's data is to be treated by Evas, with regard to scaling cache */
835
836 typedef enum _Evas_Image_Animated_Loop_Hint
837 {
838    EVAS_IMAGE_ANIMATED_HINT_NONE = 0,
839    EVAS_IMAGE_ANIMATED_HINT_LOOP = 1, /**< Image's animation mode is loop like 1->2->3->1->2->3 */
840    EVAS_IMAGE_ANIMATED_HINT_PINGPONG = 2 /**< Image's animation mode is pingpong like 1->2->3->2->1-> ... */
841 } Evas_Image_Animated_Loop_Hint;
842
843 typedef enum _Evas_Engine_Render_Mode
844 {
845    EVAS_RENDER_MODE_BLOCKING = 0,
846    EVAS_RENDER_MODE_NONBLOCKING = 1,
847 } Evas_Engine_Render_Mode;
848
849 typedef enum _Evas_Image_Content_Hint
850 {
851    EVAS_IMAGE_CONTENT_HINT_NONE = 0, /**< No hint at all */
852    EVAS_IMAGE_CONTENT_HINT_DYNAMIC = 1, /**< The contents will change over time */
853    EVAS_IMAGE_CONTENT_HINT_STATIC = 2 /**< The contents won't change over time */
854 } Evas_Image_Content_Hint; /**< How an image's data is to be treated by Evas, for optimization */
855
856 struct _Evas_Engine_Info /** Generic engine information. Generic info is useless */
857 {
858    int magic; /**< Magic number */
859 };
860
861 struct _Evas_Event_Mouse_Down /** Mouse button press event */
862 {
863    int button; /**< Mouse button number that went down (1 - 32) */
864
865    Evas_Point output; /**< The X/Y location of the cursor */
866    Evas_Coord_Point canvas; /**< The X/Y location of the cursor */
867
868    void          *data;
869    Evas_Modifier *modifiers; /**< modifier keys pressed during the event */
870    Evas_Lock     *locks;
871
872    Evas_Button_Flags flags; /**< button flags set during the event */
873    unsigned int      timestamp;
874    Evas_Event_Flags  event_flags;
875    Evas_Device      *dev;
876 };
877
878 struct _Evas_Event_Mouse_Up /** Mouse button release event */
879 {
880    int button; /**< Mouse button number that was raised (1 - 32) */
881
882    Evas_Point output;
883    Evas_Coord_Point canvas;
884
885    void          *data;
886    Evas_Modifier *modifiers;
887    Evas_Lock     *locks;
888
889    Evas_Button_Flags flags;
890    unsigned int      timestamp;
891    Evas_Event_Flags  event_flags;
892    Evas_Device      *dev;
893 };
894
895 struct _Evas_Event_Mouse_In /** Mouse enter event */
896 {
897    int buttons; /**< Button pressed mask, Bits set to 1 are buttons currently pressed (bit 0 = mouse button 1, bit 1 = mouse button 2 etc.) */
898
899    Evas_Point output;
900    Evas_Coord_Point canvas;
901
902    void          *data;
903    Evas_Modifier *modifiers;
904    Evas_Lock     *locks;
905    unsigned int   timestamp;
906    Evas_Event_Flags  event_flags;
907    Evas_Device      *dev;
908 };
909
910 struct _Evas_Event_Mouse_Out /** Mouse leave event */
911 {
912    int buttons; /**< Button pressed mask, Bits set to 1 are buttons currently pressed (bit 0 = mouse button 1, bit 1 = mouse button 2 etc.) */
913
914
915    Evas_Point output;
916    Evas_Coord_Point canvas;
917
918    void          *data;
919    Evas_Modifier *modifiers;
920    Evas_Lock     *locks;
921    unsigned int   timestamp;
922    Evas_Event_Flags  event_flags;
923    Evas_Device      *dev;
924 };
925
926 struct _Evas_Event_Mouse_Move /** Mouse button down event */
927 {
928    int buttons; /**< Button pressed mask, Bits set to 1 are buttons currently pressed (bit 0 = mouse button 1, bit 1 = mouse button 2 etc.) */
929
930    Evas_Position cur, prev;
931
932    void          *data;
933    Evas_Modifier *modifiers;
934    Evas_Lock     *locks;
935    unsigned int   timestamp;
936    Evas_Event_Flags  event_flags;
937    Evas_Device      *dev;
938 };
939
940 struct _Evas_Event_Mouse_Wheel /** Wheel event */
941 {
942    int direction; /* 0 = default up/down wheel FIXME: more wheel types */
943    int z; /* ...,-2,-1 = down, 1,2,... = up */
944
945    Evas_Point output;
946    Evas_Coord_Point canvas;
947
948    void          *data;
949    Evas_Modifier *modifiers;
950    Evas_Lock     *locks;
951    unsigned int   timestamp;
952    Evas_Event_Flags  event_flags;
953    Evas_Device      *dev;
954 };
955
956 struct _Evas_Event_Multi_Down /** Multi button press event */
957 {
958    int device; /**< Multi device number that went down (1 or more for extra touches) */
959    double radius, radius_x, radius_y;
960    double pressure, angle;
961
962    Evas_Point output;
963    Evas_Coord_Precision_Point canvas;
964
965    void          *data;
966    Evas_Modifier *modifiers;
967    Evas_Lock     *locks;
968
969    Evas_Button_Flags flags;
970    unsigned int      timestamp;
971    Evas_Event_Flags  event_flags;
972    Evas_Device      *dev;
973 };
974
975 struct _Evas_Event_Multi_Up /** Multi button release event */
976 {
977    int device; /**< Multi device number that went up (1 or more for extra touches) */
978    double radius, radius_x, radius_y;
979    double pressure, angle;
980
981    Evas_Point output;
982    Evas_Coord_Precision_Point canvas;
983
984    void          *data;
985    Evas_Modifier *modifiers;
986    Evas_Lock     *locks;
987
988    Evas_Button_Flags flags;
989    unsigned int      timestamp;
990    Evas_Event_Flags  event_flags;
991    Evas_Device      *dev;
992 };
993
994 struct _Evas_Event_Multi_Move /** Multi button down event */
995 {
996    int device; /**< Multi device number that moved (1 or more for extra touches) */
997    double radius, radius_x, radius_y;
998    double pressure, angle;
999
1000    Evas_Precision_Position cur;
1001
1002    void          *data;
1003    Evas_Modifier *modifiers;
1004    Evas_Lock     *locks;
1005    unsigned int   timestamp;
1006    Evas_Event_Flags  event_flags;
1007    Evas_Device      *dev;
1008 };
1009
1010 struct _Evas_Event_Key_Down /** Key press event */
1011 {
1012    char          *keyname; /**< the name string of the key pressed */
1013    void          *data;
1014    Evas_Modifier *modifiers;
1015    Evas_Lock     *locks;
1016
1017    const char    *key; /**< The logical key : (eg shift+1 == exclamation) */
1018    const char    *string; /**< A UTF8 string if this keystroke has produced a visible string to be ADDED */
1019    const char    *compose; /**< A UTF8 string if this keystroke has modified a string in the middle of being composed - this string replaces the previous one */
1020    unsigned int   timestamp;
1021    Evas_Event_Flags  event_flags;
1022    Evas_Device      *dev;
1023 };
1024
1025 struct _Evas_Event_Key_Up /** Key release event */
1026 {
1027    char          *keyname; /**< the name string of the key released */
1028    void          *data;
1029    Evas_Modifier *modifiers;
1030    Evas_Lock     *locks;
1031
1032    const char    *key; /**< The logical key : (eg shift+1 == exclamation) */
1033    const char    *string; /**< A UTF8 string if this keystroke has produced a visible string to be ADDED */
1034    const char    *compose; /**< A UTF8 string if this keystroke has modified a string in the middle of being composed - this string replaces the previous one */
1035    unsigned int   timestamp;
1036    Evas_Event_Flags  event_flags;
1037    Evas_Device      *dev;
1038 };
1039
1040 struct _Evas_Event_Hold /** Hold change event */
1041 {
1042    int            hold; /**< The hold flag */
1043    void          *data;
1044
1045    unsigned int   timestamp;
1046    Evas_Event_Flags  event_flags;
1047    Evas_Device      *dev;
1048 };
1049
1050 /**
1051  * How the mouse pointer should be handled by Evas.
1052  *
1053  * In the mode #EVAS_OBJECT_POINTER_MODE_AUTOGRAB, when a mouse button
1054  * is pressed down over an object and held, with the mouse pointer
1055  * being moved outside of it, the pointer still behaves as being bound
1056  * to that object, albeit out of its drawing region. When the button
1057  * is released, the event will be fed to the object, that may check if
1058  * the final position is over it or not and do something about it.
1059  *
1060  * In the mode #EVAS_OBJECT_POINTER_MODE_NOGRAB, the pointer will
1061  * always be bound to the object right below it.
1062  *
1063  * @ingroup Evas_Object_Group_Extras
1064  */
1065 typedef enum _Evas_Object_Pointer_Mode
1066 {
1067    EVAS_OBJECT_POINTER_MODE_AUTOGRAB, /**< default, X11-like */
1068    EVAS_OBJECT_POINTER_MODE_NOGRAB, /**< pointer always bound to the object right below it */
1069    EVAS_OBJECT_POINTER_MODE_NOGRAB_NO_REPEAT_UPDOWN /**< useful on object with "repeat events" enabled, where mouse/touch up and down events WONT be repeated to objects and these objects wont be auto-grabbed. @since 1.2 */
1070 } Evas_Object_Pointer_Mode; /**< How the mouse pointer should be handled by Evas. */
1071
1072 typedef void      (*Evas_Smart_Cb) (void *data, Evas_Object *obj, void *event_info); /**< Evas smart objects' "smart callback" function signature */
1073 typedef void      (*Evas_Event_Cb) (void *data, Evas *e, void *event_info); /**< Evas event callback function signature */
1074 typedef Eina_Bool (*Evas_Object_Event_Post_Cb) (void *data, Evas *e);
1075 typedef void      (*Evas_Object_Event_Cb) (void *data, Evas *e, Evas_Object *obj, void *event_info); /**< Evas object event callback function signature */
1076 typedef void      (*Evas_Async_Events_Put_Cb)(void *target, Evas_Callback_Type type, void *event_info);
1077
1078 /**
1079  * @defgroup Evas_Group Top Level Functions
1080  *
1081  * Functions that affect Evas as a whole.
1082  */
1083
1084 /**
1085  * Initialize Evas
1086  *
1087  * @return The init counter value.
1088  *
1089  * This function initializes Evas and increments a counter of the
1090  * number of calls to it. It returns the new counter's value.
1091  *
1092  * @see evas_shutdown().
1093  *
1094  * Most EFL users wouldn't be using this function directly, because
1095  * they wouldn't access Evas directly by themselves. Instead, they
1096  * would be using higher level helpers, like @c ecore_evas_init().
1097  * See http://docs.enlightenment.org/auto/ecore/.
1098  *
1099  * You should be using this if your use is something like the
1100  * following. The buffer engine is just one of the many ones Evas
1101  * provides.
1102  *
1103  * @dontinclude evas-buffer-simple.c
1104  * @skip int main
1105  * @until return -1;
1106  * And being the canvas creation something like:
1107  * @skip static Evas *create_canvas
1108  * @until    evas_output_viewport_set(canvas,
1109  *
1110  * Note that this is code creating an Evas canvas with no usage of
1111  * Ecore helpers at all -- no linkage with Ecore on this scenario,
1112  * thus. Again, this wouldn't be on Evas common usage for most
1113  * developers. See the full @ref Example_Evas_Buffer_Simple "example".
1114  *
1115  * @ingroup Evas_Group
1116  */
1117 EAPI int               evas_init                         (void);
1118
1119 /**
1120  * Shutdown Evas
1121  *
1122  * @return Evas' init counter value.
1123  *
1124  * This function finalizes Evas, decrementing the counter of the
1125  * number of calls to the function evas_init(). This new value for the
1126  * counter is returned.
1127  *
1128  * @see evas_init().
1129  *
1130  * If you were the sole user of Evas, by means of evas_init(), you can
1131  * check if it's being properly shut down by expecting a return value
1132  * of 0.
1133  *
1134  * Example code follows.
1135  * @dontinclude evas-buffer-simple.c
1136  * @skip // NOTE: use ecore_evas_buffer_new
1137  * @until evas_shutdown
1138  * Where that function would contain:
1139  * @skip   evas_free(canvas)
1140  * @until   evas_free(canvas)
1141  *
1142  * Most users would be using ecore_evas_shutdown() instead, like told
1143  * in evas_init(). See the full @ref Example_Evas_Buffer_Simple
1144  * "example".
1145  *
1146  * @ingroup Evas_Group
1147  */
1148 EAPI int               evas_shutdown                     (void);
1149
1150
1151 /**
1152  * Return if any allocation errors have occurred during the prior function
1153  * @return The allocation error flag
1154  *
1155  * This function will return if any memory allocation errors occurred during,
1156  * and what kind they were. The return value will be one of
1157  * EVAS_ALLOC_ERROR_NONE, EVAS_ALLOC_ERROR_FATAL or EVAS_ALLOC_ERROR_RECOVERED
1158  * with each meaning something different.
1159  *
1160  * EVAS_ALLOC_ERROR_NONE means that no errors occurred at all and the function
1161  * worked as expected.
1162  *
1163  * EVAS_ALLOC_ERROR_FATAL means the function was completely unable to perform
1164  * its job and will  have  exited as cleanly as possible. The programmer
1165  * should consider this as a sign of very low memory and should try and safely
1166  * recover from the prior functions failure (or try free up memory elsewhere
1167  * and try again after more memory is freed).
1168  *
1169  * EVAS_ALLOC_ERROR_RECOVERED means that an allocation error occurred, but was
1170  * recovered from by evas finding memory of its own it has allocated and
1171  * freeing what it sees as not really usefully allocated memory. What is freed
1172  * may vary. Evas may reduce the resolution of images, free cached images or
1173  * fonts, trhow out pre-rendered data, reduce the complexity of change lists
1174  * etc. Evas and the program will function as per normal after this, but this
1175  * is a sign of low memory, and it is suggested that the program try and
1176  * identify memory it doesn't need, and free it.
1177  *
1178  * Example:
1179  * @code
1180  * extern Evas_Object *object;
1181  * void callback (void *data, Evas *e, Evas_Object *obj, void *event_info);
1182  *
1183  * evas_object_event_callback_add(object, EVAS_CALLBACK_MOUSE_DOWN, callback, NULL);
1184  * if (evas_alloc_error() == EVAS_ALLOC_ERROR_FATAL)
1185  *   {
1186  *     fprintf(stderr, "ERROR: Completely unable to attach callback. Must\n");
1187  *     fprintf(stderr, "       destroy object now as it cannot be used.\n");
1188  *     evas_object_del(object);
1189  *     object = NULL;
1190  *     fprintf(stderr, "WARNING: Memory is really low. Cleaning out RAM.\n");
1191  *     my_memory_cleanup();
1192  *   }
1193  * if (evas_alloc_error() == EVAS_ALLOC_ERROR_RECOVERED)
1194  *   {
1195  *     fprintf(stderr, "WARNING: Memory is really low. Cleaning out RAM.\n");
1196  *     my_memory_cleanup();
1197  *   }
1198  * @endcode
1199  *
1200  * @ingroup Evas_Group
1201  */
1202 EAPI Evas_Alloc_Error  evas_alloc_error                  (void);
1203
1204
1205 /**
1206  * @brief Get evas' internal asynchronous events read file descriptor.
1207  *
1208  * @return The canvas' asynchronous events read file descriptor.
1209  *
1210  * Evas' asynchronous events are meant to be dealt with internally,
1211  * i. e., when building stuff to be glued together into the EFL
1212  * infrastructure -- a module, for example. The context which demands
1213  * its use is when calculations need to be done out of the main
1214  * thread, asynchronously, and some action must be performed after
1215  * that.
1216  *
1217  * An example of actual use of this API is for image asynchronous
1218  * preload inside evas. If the canvas was instantiated through
1219  * ecore-evas usage, ecore itself will take care of calling those
1220  * events' processing.
1221  *
1222  * This function returns the read file descriptor where to get the
1223  * asynchronous events of the canvas. Naturally, other mainloops,
1224  * apart from ecore, may make use of it.
1225  *
1226  * @ingroup Evas_Group
1227  */
1228 EAPI int               evas_async_events_fd_get          (void) EINA_WARN_UNUSED_RESULT;
1229
1230 /**
1231  * @brief Trigger the processing of all events waiting on the file
1232  * descriptor returned by evas_async_events_fd_get().
1233  *
1234  * @return The number of events processed.
1235  *
1236  * All asynchronous events queued up by evas_async_events_put() are
1237  * processed here. More precisely, the callback functions, informed
1238  * together with other event parameters, when queued, get called (with
1239  * those parameters), in that order.
1240  *
1241  * @ingroup Evas_Group
1242  */
1243 EAPI int               evas_async_events_process         (void);
1244
1245 /**
1246 * Insert asynchronous events on the canvas.
1247  *
1248  * @param target The target to be affected by the events.
1249  * @param type The type of callback function.
1250  * @param event_info Information about the event.
1251  * @param func The callback function pointer.
1252  *
1253  * This is the way, for a routine running outside evas' main thread,
1254  * to report an asynchronous event. A callback function is informed,
1255  * whose call is to happen after evas_async_events_process() is
1256  * called.
1257  *
1258  * @ingroup Evas_Group
1259  */
1260 EAPI Eina_Bool         evas_async_events_put             (const void *target, Evas_Callback_Type type, void *event_info, Evas_Async_Events_Put_Cb func) EINA_ARG_NONNULL(1, 4);
1261
1262 /**
1263  * @defgroup Evas_Canvas Canvas Functions
1264  *
1265  * Low level Evas canvas functions. Sub groups will present more high
1266  * level ones, though.
1267  *
1268  * Most of these functions deal with low level Evas actions, like:
1269  * @li create/destroy raw canvases, not bound to any displaying engine
1270  * @li tell a canvas i got focused (in a windowing context, for example)
1271  * @li tell a canvas a region should not be calculated anymore in rendering
1272  * @li tell a canvas to render its contents, immediately
1273  *
1274  * Most users will be using Evas by means of the @c Ecore_Evas
1275  * wrapper, which deals with all the above mentioned issues
1276  * automatically for them. Thus, you'll be looking at this section
1277  * only if you're building low level stuff.
1278  *
1279  * The groups within present you functions that deal with the canvas
1280  * directly, too, and not yet with its @b objects. They are the
1281  * functions you need to use at a minimum to get a working canvas.
1282  *
1283  * Some of the funcions in this group are exemplified @ref
1284  * Example_Evas_Events "here".
1285  */
1286
1287 /**
1288  * Creates a new empty evas.
1289  *
1290  * Note that before you can use the evas, you will to at a minimum:
1291  * @li Set its render method with @ref evas_output_method_set .
1292  * @li Set its viewport size with @ref evas_output_viewport_set .
1293  * @li Set its size of the canvas with @ref evas_output_size_set .
1294  * @li Ensure that the render engine is given the correct settings
1295  *     with @ref evas_engine_info_set .
1296  *
1297  * This function should only fail if the memory allocation fails
1298  *
1299  * @note this function is very low level. Instead of using it
1300  *       directly, consider using the high level functions in
1301  *       Ecore_Evas such as @c ecore_evas_new(). See
1302  *       http://docs.enlightenment.org/auto/ecore/.
1303  *
1304  * @attention it is recommended that one calls evas_init() before
1305  *       creating new canvas.
1306  *
1307  * @return A new uninitialised Evas canvas on success.  Otherwise, @c
1308  * NULL.
1309  * @ingroup Evas_Canvas
1310  */
1311 EAPI Evas             *evas_new                          (void) EINA_WARN_UNUSED_RESULT EINA_MALLOC;
1312
1313 /**
1314  * Frees the given evas and any objects created on it.
1315  *
1316  * Any objects with 'free' callbacks will have those callbacks called
1317  * in this function.
1318  *
1319  * @param   e The given evas.
1320  *
1321  * @ingroup Evas_Canvas
1322  */
1323 EAPI void              evas_free                         (Evas *e)  EINA_ARG_NONNULL(1);
1324
1325 /**
1326  * Inform to the evas that it got the focus.
1327  *
1328  * @param e The evas to change information.
1329  * @ingroup Evas_Canvas
1330  */
1331 EAPI void              evas_focus_in                     (Evas *e);
1332
1333 /**
1334  * Inform to the evas that it lost the focus.
1335  *
1336  * @param e The evas to change information.
1337  * @ingroup Evas_Canvas
1338  */
1339 EAPI void              evas_focus_out                    (Evas *e);
1340
1341 /**
1342  * Get the focus state known by the given evas
1343  *
1344  * @param e The evas to query information.
1345  * @ingroup Evas_Canvas
1346  */
1347 EAPI Eina_Bool         evas_focus_state_get              (const Evas *e);
1348
1349 /**
1350  * Push the nochange flag up 1
1351  *
1352  * This tells evas, that while the nochange flag is greater than 0, do not
1353  * mark objects as "changed" when making changes.
1354  *
1355  * @param e The evas to change information.
1356  * @ingroup Evas_Canvas
1357  */
1358 EAPI void              evas_nochange_push                (Evas *e);
1359
1360 /**
1361  * Pop the nochange flag down 1
1362  *
1363  * This tells evas, that while the nochange flag is greater than 0, do not
1364  * mark objects as "changed" when making changes.
1365  *
1366  * @param e The evas to change information.
1367  * @ingroup Evas_Canvas
1368  */
1369 EAPI void              evas_nochange_pop                 (Evas *e);
1370
1371
1372 /**
1373  * Attaches a specific pointer to the evas for fetching later
1374  *
1375  * @param e The canvas to attach the pointer to
1376  * @param data The pointer to attach
1377  * @ingroup Evas_Canvas
1378  */
1379 EAPI void              evas_data_attach_set              (Evas *e, void *data) EINA_ARG_NONNULL(1);
1380
1381 /**
1382  * Returns the pointer attached by evas_data_attach_set()
1383  *
1384  * @param e The canvas to attach the pointer to
1385  * @return The pointer attached
1386  * @ingroup Evas_Canvas
1387  */
1388 EAPI void             *evas_data_attach_get              (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
1389
1390
1391 /**
1392  * Add a damage rectangle.
1393  *
1394  * @param e The given canvas pointer.
1395  * @param x The rectangle's left position.
1396  * @param y The rectangle's top position.
1397  * @param w The rectangle's width.
1398  * @param h The rectangle's height.
1399  *
1400  * This is the function by which one tells evas that a part of the
1401  * canvas has to be repainted.
1402  *
1403  * @ingroup Evas_Canvas
1404  */
1405 EAPI void              evas_damage_rectangle_add         (Evas *e, int x, int y, int w, int h) EINA_ARG_NONNULL(1);
1406
1407 /**
1408  * Add an "obscured region" to an Evas canvas.
1409  *
1410  * @param e The given canvas pointer.
1411  * @param x The rectangle's top left corner's horizontal coordinate.
1412  * @param y The rectangle's top left corner's vertical coordinate
1413  * @param w The rectangle's width.
1414  * @param h The rectangle's height.
1415  *
1416  * This is the function by which one tells an Evas canvas that a part
1417  * of it <b>must not</b> be repainted. The region must be
1418  * rectangular and its coordinates inside the canvas viewport are
1419  * passed in the call. After this call, the region specified won't
1420  * participate in any form in Evas' calculations and actions during
1421  * its rendering updates, having its displaying content frozen as it
1422  * was just after this function took place.
1423  *
1424  * We call it "obscured region" because the most common use case for
1425  * this rendering (partial) freeze is something else (most problaby
1426  * other canvas) being on top of the specified rectangular region,
1427  * thus shading it completely from the user's final scene in a
1428  * display. To avoid unnecessary processing, one should indicate to the
1429  * obscured canvas not to bother about the non-important area.
1430  *
1431  * The majority of users won't have to worry about this funcion, as
1432  * they'll be using just one canvas in their applications, with
1433  * nothing inset or on top of it in any form.
1434  *
1435  * To make this region one that @b has to be repainted again, call the
1436  * function evas_obscured_clear().
1437  *
1438  * @note This is a <b>very low level function</b>, which most of
1439  * Evas' users wouldn't care about.
1440  *
1441  * @note This function does @b not flag the canvas as having its state
1442  * changed. If you want to re-render it afterwards expecting new
1443  * contents, you have to add "damage" regions yourself (see
1444  * evas_damage_rectangle_add()).
1445  *
1446  * @see evas_obscured_clear()
1447  * @see evas_render_updates()
1448  *
1449  * Example code follows.
1450  * @dontinclude evas-events.c
1451  * @skip add an obscured
1452  * @until evas_obscured_clear(evas);
1453  *
1454  * In that example, pressing the "Ctrl" and "o" keys will impose or
1455  * remove an obscured region in the middle of the canvas. You'll get
1456  * the same contents at the time the key was pressed, if toggling it
1457  * on, until you toggle it off again (make sure the animation is
1458  * running on to get the idea better). See the full @ref
1459  * Example_Evas_Events "example".
1460  *
1461  * @ingroup Evas_Canvas
1462  */
1463 EAPI void              evas_obscured_rectangle_add       (Evas *e, int x, int y, int w, int h) EINA_ARG_NONNULL(1);
1464
1465 /**
1466  * Remove all "obscured regions" from an Evas canvas.
1467  *
1468  * @param e The given canvas pointer.
1469  *
1470  * This function removes all the rectangles from the obscured regions
1471  * list of the canvas @p e. It takes obscured areas added with
1472  * evas_obscured_rectangle_add() and make them again a regions that @b
1473  * have to be repainted on rendering updates.
1474  *
1475  * @note This is a <b>very low level function</b>, which most of
1476  * Evas' users wouldn't care about.
1477  *
1478  * @note This function does @b not flag the canvas as having its state
1479  * changed. If you want to re-render it afterwards expecting new
1480  * contents, you have to add "damage" regions yourself (see
1481  * evas_damage_rectangle_add()).
1482  *
1483  * @see evas_obscured_rectangle_add() for an example
1484  * @see evas_render_updates()
1485  *
1486  * @ingroup Evas_Canvas
1487  */
1488 EAPI void              evas_obscured_clear               (Evas *e) EINA_ARG_NONNULL(1);
1489
1490 /**
1491  * Force immediate renderization of the given Evas canvas.
1492  *
1493  * @param e The given canvas pointer.
1494  * @return A newly allocated list of updated rectangles of the canvas
1495  *        (@c Eina_Rectangle structs). Free this list with
1496  *        evas_render_updates_free().
1497  *
1498  * This function forces an immediate renderization update of the given
1499  * canvas @e.
1500  *
1501  * @note This is a <b>very low level function</b>, which most of
1502  * Evas' users wouldn't care about. One would use it, for example, to
1503  * grab an Evas' canvas update regions and paint them back, using the
1504  * canvas' pixmap, on a displaying system working below Evas.
1505  *
1506  * @note Evas is a stateful canvas. If no operations changing its
1507  * state took place since the last rendering action, you won't see no
1508  * changes and this call will be a no-op.
1509  *
1510  * Example code follows.
1511  * @dontinclude evas-events.c
1512  * @skip add an obscured
1513  * @until d.obscured = !d.obscured;
1514  *
1515  * See the full @ref Example_Evas_Events "example".
1516  *
1517  * @ingroup Evas_Canvas
1518  */
1519 EAPI Eina_List        *evas_render_updates               (Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
1520
1521 /**
1522  * Free the rectangles returned by evas_render_updates().
1523  *
1524  * @param updates The list of updated rectangles of the canvas.
1525  *
1526  * This function removes the region from the render updates list. It
1527  * makes the region doesn't be render updated anymore.
1528  *
1529  * @see evas_render_updates() for an example
1530  *
1531  * @ingroup Evas_Canvas
1532  */
1533 EAPI void              evas_render_updates_free          (Eina_List *updates);
1534
1535 /**
1536  * Force renderization of the given canvas.
1537  *
1538  * @param e The given canvas pointer.
1539  *
1540  * @ingroup Evas_Canvas
1541  */
1542 EAPI void              evas_render                       (Evas *e) EINA_ARG_NONNULL(1);
1543
1544 /**
1545  * Update the canvas internal objects but not triggering immediate
1546  * renderization.
1547  *
1548  * @param e The given canvas pointer.
1549  *
1550  * This function updates the canvas internal objects not triggering
1551  * renderization. To force renderization function evas_render() should
1552  * be used.
1553  *
1554  * @see evas_render.
1555  *
1556  * @ingroup Evas_Canvas
1557  */
1558 EAPI void              evas_norender                     (Evas *e) EINA_ARG_NONNULL(1);
1559
1560 /**
1561  * Make the canvas discard internally cached data used for rendering.
1562  *
1563  * @param e The given canvas pointer.
1564  *
1565  * This function flushes the arrays of delete, active and render objects.
1566  * Other things it may also discard are: shared memory segments,
1567  * temporary scratch buffers, cached data to avoid re-compute of that data etc.
1568  *
1569  * @ingroup Evas_Canvas
1570  */
1571 EAPI void              evas_render_idle_flush            (Evas *e) EINA_ARG_NONNULL(1);
1572
1573 /**
1574  * Make the canvas discard as much data as possible used by the engine at
1575  * runtime.
1576  *
1577  * @param e The given canvas pointer.
1578  *
1579  * This function will unload images, delete textures and much more, where
1580  * possible. You may also want to call evas_render_idle_flush() immediately
1581  * prior to this to perhaps discard a little more, though evas_render_dump()
1582  * should implicitly delete most of what evas_render_idle_flush() might
1583  * discard too.
1584  *
1585  * @ingroup Evas_Canvas
1586  */
1587 EAPI void              evas_render_dump                  (Evas *e) EINA_ARG_NONNULL(1);
1588
1589 /**
1590  * @defgroup Evas_Output_Method Render Engine Functions
1591  *
1592  * Functions that are used to set the render engine for a given
1593  * function, and then get that engine working.
1594  *
1595  * The following code snippet shows how they can be used to
1596  * initialise an evas that uses the X11 software engine:
1597  * @code
1598  * Evas *evas;
1599  * Evas_Engine_Info_Software_X11 *einfo;
1600  * extern Display *display;
1601  * extern Window win;
1602  *
1603  * evas_init();
1604  *
1605  * evas = evas_new();
1606  * evas_output_method_set(evas, evas_render_method_lookup("software_x11"));
1607  * evas_output_size_set(evas, 640, 480);
1608  * evas_output_viewport_set(evas, 0, 0, 640, 480);
1609  * einfo = (Evas_Engine_Info_Software_X11 *)evas_engine_info_get(evas);
1610  * einfo->info.display = display;
1611  * einfo->info.visual = DefaultVisual(display, DefaultScreen(display));
1612  * einfo->info.colormap = DefaultColormap(display, DefaultScreen(display));
1613  * einfo->info.drawable = win;
1614  * einfo->info.depth = DefaultDepth(display, DefaultScreen(display));
1615  * evas_engine_info_set(evas, (Evas_Engine_Info *)einfo);
1616  * @endcode
1617  *
1618  * @ingroup Evas_Canvas
1619  */
1620
1621 /**
1622  * Look up a numeric ID from a string name of a rendering engine.
1623  *
1624  * @param name the name string of an engine
1625  * @return A numeric (opaque) ID for the rendering engine
1626  * @ingroup Evas_Output_Method
1627  *
1628  * This function looks up a numeric return value for the named engine
1629  * in the string @p name. This is a normal C string, NUL byte
1630  * terminated. The name is case sensitive. If the rendering engine is
1631  * available, a numeric ID for that engine is returned that is not
1632  * 0. If the engine is not available, 0 is returned, indicating an
1633  * invalid engine.
1634  *
1635  * The programmer should NEVER rely on the numeric ID of an engine
1636  * unless it is returned by this function. Programs should NOT be
1637  * written accessing render method ID's directly, without first
1638  * obtaining it from this function.
1639  *
1640  * @attention it is mandatory that one calls evas_init() before
1641  *       looking up the render method.
1642  *
1643  * Example:
1644  * @code
1645  * int engine_id;
1646  * Evas *evas;
1647  *
1648  * evas_init();
1649  *
1650  * evas = evas_new();
1651  * if (!evas)
1652  *   {
1653  *     fprintf(stderr, "ERROR: Canvas creation failed. Fatal error.\n");
1654  *     exit(-1);
1655  *   }
1656  * engine_id = evas_render_method_lookup("software_x11");
1657  * if (!engine_id)
1658  *   {
1659  *     fprintf(stderr, "ERROR: Requested rendering engine is absent.\n");
1660  *     exit(-1);
1661  *   }
1662  * evas_output_method_set(evas, engine_id);
1663  * @endcode
1664  */
1665 EAPI int               evas_render_method_lookup         (const char *name) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
1666
1667 /**
1668  * List all the rendering engines compiled into the copy of the Evas library
1669  *
1670  * @return A linked list whose data members are C strings of engine names
1671  * @ingroup Evas_Output_Method
1672  *
1673  * Calling this will return a handle (pointer) to an Evas linked
1674  * list. Each node in the linked list will have the data pointer be a
1675  * (char *) pointer to the name string of the rendering engine
1676  * available. The strings should never be modified, neither should the
1677  * list be modified. This list should be cleaned up as soon as the
1678  * program no longer needs it using evas_render_method_list_free(). If
1679  * no engines are available from Evas, NULL will be returned.
1680  *
1681  * Example:
1682  * @code
1683  * Eina_List *engine_list, *l;
1684  * char *engine_name;
1685  *
1686  * engine_list = evas_render_method_list();
1687  * if (!engine_list)
1688  *   {
1689  *     fprintf(stderr, "ERROR: Evas supports no engines! Exit.\n");
1690  *     exit(-1);
1691  *   }
1692  * printf("Available Evas Engines:\n");
1693  * EINA_LIST_FOREACH(engine_list, l, engine_name)
1694  *     printf("%s\n", engine_name);
1695  * evas_render_method_list_free(engine_list);
1696  * @endcode
1697  */
1698 EAPI Eina_List        *evas_render_method_list           (void) EINA_WARN_UNUSED_RESULT;
1699
1700 /**
1701  * This function should be called to free a list of engine names
1702  *
1703  * @param list The Eina_List base pointer for the engine list to be freed
1704  * @ingroup Evas_Output_Method
1705  *
1706  * When this function is called it will free the engine list passed in
1707  * as @p list. The list should only be a list of engines generated by
1708  * calling evas_render_method_list(). If @p list is NULL, nothing will
1709  * happen.
1710  *
1711  * Example:
1712  * @code
1713  * Eina_List *engine_list, *l;
1714  * char *engine_name;
1715  *
1716  * engine_list = evas_render_method_list();
1717  * if (!engine_list)
1718  *   {
1719  *     fprintf(stderr, "ERROR: Evas supports no engines! Exit.\n");
1720  *     exit(-1);
1721  *   }
1722  * printf("Available Evas Engines:\n");
1723  * EINA_LIST_FOREACH(engine_list, l, engine_name)
1724  *     printf("%s\n", engine_name);
1725  * evas_render_method_list_free(engine_list);
1726  * @endcode
1727  */
1728 EAPI void              evas_render_method_list_free      (Eina_List *list);
1729
1730
1731 /**
1732  * Sets the output engine for the given evas.
1733  *
1734  * Once the output engine for an evas is set, any attempt to change it
1735  * will be ignored.  The value for @p render_method can be found using
1736  * @ref evas_render_method_lookup .
1737  *
1738  * @param   e             The given evas.
1739  * @param   render_method The numeric engine value to use.
1740  *
1741  * @attention it is mandatory that one calls evas_init() before
1742  *       setting the output method.
1743  *
1744  * @ingroup Evas_Output_Method
1745  */
1746 EAPI void              evas_output_method_set            (Evas *e, int render_method) EINA_ARG_NONNULL(1);
1747
1748 /**
1749  * Retrieves the number of the output engine used for the given evas.
1750  * @param   e The given evas.
1751  * @return  The ID number of the output engine being used.  @c 0 is
1752  *          returned if there is an error.
1753  * @ingroup Evas_Output_Method
1754  */
1755 EAPI int               evas_output_method_get            (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
1756
1757
1758 /**
1759  * Retrieves the current render engine info struct from the given evas.
1760  *
1761  * The returned structure is publicly modifiable.  The contents are
1762  * valid until either @ref evas_engine_info_set or @ref evas_render
1763  * are called.
1764  *
1765  * This structure does not need to be freed by the caller.
1766  *
1767  * @param   e The given evas.
1768  * @return  A pointer to the Engine Info structure.  @c NULL is returned if
1769  *          an engine has not yet been assigned.
1770  * @ingroup Evas_Output_Method
1771  */
1772 EAPI Evas_Engine_Info *evas_engine_info_get              (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
1773
1774 /**
1775  * Applies the engine settings for the given evas from the given @c
1776  * Evas_Engine_Info structure.
1777  *
1778  * To get the Evas_Engine_Info structure to use, call @ref
1779  * evas_engine_info_get .  Do not try to obtain a pointer to an
1780  * @c Evas_Engine_Info structure in any other way.
1781  *
1782  * You will need to call this function at least once before you can
1783  * create objects on an evas or render that evas.  Some engines allow
1784  * their settings to be changed more than once.
1785  *
1786  * Once called, the @p info pointer should be considered invalid.
1787  *
1788  * @param   e    The pointer to the Evas Canvas
1789  * @param   info The pointer to the Engine Info to use
1790  * @return  1 if no error occurred, 0 otherwise
1791  * @ingroup Evas_Output_Method
1792  */
1793 EAPI Eina_Bool         evas_engine_info_set              (Evas *e, Evas_Engine_Info *info) EINA_ARG_NONNULL(1);
1794
1795 /**
1796  * @defgroup Evas_Output_Size Output and Viewport Resizing Functions
1797  *
1798  * Functions that set and retrieve the output and viewport size of an
1799  * evas.
1800  *
1801  * @ingroup Evas_Canvas
1802  */
1803
1804 /**
1805  * Sets the output size of the render engine of the given evas.
1806  *
1807  * The evas will render to a rectangle of the given size once this
1808  * function is called.  The output size is independent of the viewport
1809  * size.  The viewport will be stretched to fill the given rectangle.
1810  *
1811  * The units used for @p w and @p h depend on the engine used by the
1812  * evas.
1813  *
1814  * @param   e The given evas.
1815  * @param   w The width in output units, usually pixels.
1816  * @param   h The height in output units, usually pixels.
1817  * @ingroup Evas_Output_Size
1818  */
1819 EAPI void              evas_output_size_set              (Evas *e, int w, int h) EINA_ARG_NONNULL(1);
1820
1821 /**
1822  * Retrieve the output size of the render engine of the given evas.
1823  *
1824  * The output size is given in whatever the output units are for the
1825  * engine.
1826  *
1827  * If either @p w or @p h is @c NULL, then it is ignored.  If @p e is
1828  * invalid, the returned results are undefined.
1829  *
1830  * @param   e The given evas.
1831  * @param   w The pointer to an integer to store the width in.
1832  * @param   h The pointer to an integer to store the height in.
1833  * @ingroup Evas_Output_Size
1834  */
1835 EAPI void              evas_output_size_get              (const Evas *e, int *w, int *h) EINA_ARG_NONNULL(1);
1836
1837 /**
1838  * Sets the output viewport of the given evas in evas units.
1839  *
1840  * The output viewport is the area of the evas that will be visible to
1841  * the viewer.  The viewport will be stretched to fit the output
1842  * target of the evas when rendering is performed.
1843  *
1844  * @note The coordinate values do not have to map 1-to-1 with the output
1845  *       target.  However, it is generally advised that it is done for ease
1846  *       of use.
1847  *
1848  * @param   e The given evas.
1849  * @param   x The top-left corner x value of the viewport.
1850  * @param   y The top-left corner y value of the viewport.
1851  * @param   w The width of the viewport.  Must be greater than 0.
1852  * @param   h The height of the viewport.  Must be greater than 0.
1853  * @ingroup Evas_Output_Size
1854  */
1855 EAPI void              evas_output_viewport_set          (Evas *e, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h) EINA_ARG_NONNULL(1);
1856
1857 /**
1858  * Get the render engine's output viewport co-ordinates in canvas units.
1859  * @param e The pointer to the Evas Canvas
1860  * @param x The pointer to a x variable to be filled in
1861  * @param y The pointer to a y variable to be filled in
1862  * @param w The pointer to a width variable to be filled in
1863  * @param h The pointer to a height variable to be filled in
1864  * @ingroup Evas_Output_Size
1865  *
1866  * Calling this function writes the current canvas output viewport
1867  * size and location values into the variables pointed to by @p x, @p
1868  * y, @p w and @p h.  On success the variables have the output
1869  * location and size values written to them in canvas units. Any of @p
1870  * x, @p y, @p w or @p h that are NULL will not be written to. If @p e
1871  * is invalid, the results are undefined.
1872  *
1873  * Example:
1874  * @code
1875  * extern Evas *evas;
1876  * Evas_Coord x, y, width, height;
1877  *
1878  * evas_output_viewport_get(evas, &x, &y, &w, &h);
1879  * @endcode
1880  */
1881 EAPI void              evas_output_viewport_get          (const Evas *e, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h) EINA_ARG_NONNULL(1);
1882
1883 /**
1884  * Sets the output framespace size of the render engine of the given evas.
1885  *
1886  * The framespace size is used in the Wayland engines to denote space where 
1887  * the output is not drawn. This is mainly used in ecore_evas to draw borders
1888  *
1889  * The units used for @p w and @p h depend on the engine used by the
1890  * evas.
1891  *
1892  * @param   e The given evas.
1893  * @param   x The left coordinate in output units, usually pixels.
1894  * @param   y The top coordinate in output units, usually pixels.
1895  * @param   w The width in output units, usually pixels.
1896  * @param   h The height in output units, usually pixels.
1897  * @ingroup Evas_Output_Size
1898  * @since 1.1.0
1899  */
1900 EAPI void              evas_output_framespace_set        (Evas *e, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h);
1901
1902 /**
1903  * Get the render engine's output framespace co-ordinates in canvas units.
1904  * 
1905  * @param e The pointer to the Evas Canvas
1906  * @param x The pointer to a x variable to be filled in
1907  * @param y The pointer to a y variable to be filled in
1908  * @param w The pointer to a width variable to be filled in
1909  * @param h The pointer to a height variable to be filled in
1910  * @ingroup Evas_Output_Size
1911  * @since 1.1.0
1912  */
1913 EAPI void              evas_output_framespace_get        (const Evas *e, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h);
1914
1915 /**
1916  * @defgroup Evas_Coord_Mapping_Group Coordinate Mapping Functions
1917  *
1918  * Functions that are used to map coordinates from the canvas to the
1919  * screen or the screen to the canvas.
1920  *
1921  * @ingroup Evas_Canvas
1922  */
1923
1924 /**
1925  * Convert/scale an ouput screen co-ordinate into canvas co-ordinates
1926  *
1927  * @param e The pointer to the Evas Canvas
1928  * @param x The screen/output x co-ordinate
1929  * @return The screen co-ordinate translated to canvas unit co-ordinates
1930  * @ingroup Evas_Coord_Mapping_Group
1931  *
1932  * This function takes in a horizontal co-ordinate as the @p x
1933  * parameter and converts it into canvas units, accounting for output
1934  * size, viewport size and location, returning it as the function
1935  * return value. If @p e is invalid, the results are undefined.
1936  *
1937  * Example:
1938  * @code
1939  * extern Evas *evas;
1940  * extern int screen_x;
1941  * Evas_Coord canvas_x;
1942  *
1943  * canvas_x = evas_coord_screen_x_to_world(evas, screen_x);
1944  * @endcode
1945  */
1946 EAPI Evas_Coord        evas_coord_screen_x_to_world      (const Evas *e, int x) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
1947
1948 /**
1949  * Convert/scale an ouput screen co-ordinate into canvas co-ordinates
1950  *
1951  * @param e The pointer to the Evas Canvas
1952  * @param y The screen/output y co-ordinate
1953  * @return The screen co-ordinate translated to canvas unit co-ordinates
1954  * @ingroup Evas_Coord_Mapping_Group
1955  *
1956  * This function takes in a vertical co-ordinate as the @p y parameter
1957  * and converts it into canvas units, accounting for output size,
1958  * viewport size and location, returning it as the function return
1959  * value. If @p e is invalid, the results are undefined.
1960  *
1961  * Example:
1962  * @code
1963  * extern Evas *evas;
1964  * extern int screen_y;
1965  * Evas_Coord canvas_y;
1966  *
1967  * canvas_y = evas_coord_screen_y_to_world(evas, screen_y);
1968  * @endcode
1969  */
1970 EAPI Evas_Coord        evas_coord_screen_y_to_world      (const Evas *e, int y) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
1971
1972 /**
1973  * Convert/scale a canvas co-ordinate into output screen co-ordinates
1974  *
1975  * @param e The pointer to the Evas Canvas
1976  * @param x The canvas x co-ordinate
1977  * @return The output/screen co-ordinate translated to output co-ordinates
1978  * @ingroup Evas_Coord_Mapping_Group
1979  *
1980  * This function takes in a horizontal co-ordinate as the @p x
1981  * parameter and converts it into output units, accounting for output
1982  * size, viewport size and location, returning it as the function
1983  * return value. If @p e is invalid, the results are undefined.
1984  *
1985  * Example:
1986  * @code
1987  * extern Evas *evas;
1988  * int screen_x;
1989  * extern Evas_Coord canvas_x;
1990  *
1991  * screen_x = evas_coord_world_x_to_screen(evas, canvas_x);
1992  * @endcode
1993  */
1994 EAPI int               evas_coord_world_x_to_screen      (const Evas *e, Evas_Coord x) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
1995
1996 /**
1997  * Convert/scale a canvas co-ordinate into output screen co-ordinates
1998  *
1999  * @param e The pointer to the Evas Canvas
2000  * @param y The canvas y co-ordinate
2001  * @return The output/screen co-ordinate translated to output co-ordinates
2002  * @ingroup Evas_Coord_Mapping_Group
2003  *
2004  * This function takes in a vertical co-ordinate as the @p x parameter
2005  * and converts it into output units, accounting for output size,
2006  * viewport size and location, returning it as the function return
2007  * value. If @p e is invalid, the results are undefined.
2008  *
2009  * Example:
2010  * @code
2011  * extern Evas *evas;
2012  * int screen_y;
2013  * extern Evas_Coord canvas_y;
2014  *
2015  * screen_y = evas_coord_world_y_to_screen(evas, canvas_y);
2016  * @endcode
2017  */
2018 EAPI int               evas_coord_world_y_to_screen      (const Evas *e, Evas_Coord y) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
2019
2020 /**
2021  * @defgroup Evas_Pointer_Group Pointer (Mouse) Functions
2022  *
2023  * Functions that deal with the status of the pointer (mouse cursor).
2024  *
2025  * @ingroup Evas_Canvas
2026  */
2027
2028 /**
2029  * This function returns the current known pointer co-ordinates
2030  *
2031  * @param e The pointer to the Evas Canvas
2032  * @param x The pointer to an integer to be filled in
2033  * @param y The pointer to an integer to be filled in
2034  * @ingroup Evas_Pointer_Group
2035  *
2036  * This function returns the current known screen/output co-ordinates
2037  * of the mouse pointer and sets the contents of the integers pointed
2038  * to by @p x and @p y to contain these co-ordinates. If @p e is not a
2039  * valid canvas the results of this function are undefined.
2040  *
2041  * Example:
2042  * @code
2043  * extern Evas *evas;
2044  * int mouse_x, mouse_y;
2045  *
2046  * evas_pointer_output_xy_get(evas, &mouse_x, &mouse_y);
2047  * printf("Mouse is at screen position %i, %i\n", mouse_x, mouse_y);
2048  * @endcode
2049  */
2050 EAPI void              evas_pointer_output_xy_get        (const Evas *e, int *x, int *y) EINA_ARG_NONNULL(1);
2051
2052 /**
2053  * This function returns the current known pointer co-ordinates
2054  *
2055  * @param e The pointer to the Evas Canvas
2056  * @param x The pointer to a Evas_Coord to be filled in
2057  * @param y The pointer to a Evas_Coord to be filled in
2058  * @ingroup Evas_Pointer_Group
2059  *
2060  * This function returns the current known canvas unit co-ordinates of
2061  * the mouse pointer and sets the contents of the Evas_Coords pointed
2062  * to by @p x and @p y to contain these co-ordinates. If @p e is not a
2063  * valid canvas the results of this function are undefined.
2064  *
2065  * Example:
2066  * @code
2067  * extern Evas *evas;
2068  * Evas_Coord mouse_x, mouse_y;
2069  *
2070  * evas_pointer_output_xy_get(evas, &mouse_x, &mouse_y);
2071  * printf("Mouse is at canvas position %f, %f\n", mouse_x, mouse_y);
2072  * @endcode
2073  */
2074 EAPI void              evas_pointer_canvas_xy_get        (const Evas *e, Evas_Coord *x, Evas_Coord *y) EINA_ARG_NONNULL(1);
2075
2076 /**
2077  * Returns a bitmask with the mouse buttons currently pressed, set to 1
2078  *
2079  * @param e The pointer to the Evas Canvas
2080  * @return A bitmask of the currently depressed buttons on the cavas
2081  * @ingroup Evas_Pointer_Group
2082  *
2083  * Calling this function will return a 32-bit integer with the
2084  * appropriate bits set to 1 that correspond to a mouse button being
2085  * depressed. This limits Evas to a mouse devices with a maximum of 32
2086  * buttons, but that is generally in excess of any host system's
2087  * pointing device abilities.
2088  *
2089  * A canvas by default begins with no mouse buttons being pressed and
2090  * only calls to evas_event_feed_mouse_down(),
2091  * evas_event_feed_mouse_down_data(), evas_event_feed_mouse_up() and
2092  * evas_event_feed_mouse_up_data() will alter that.
2093  *
2094  * The least significant bit corresponds to the first mouse button
2095  * (button 1) and the most significant bit corresponds to the last
2096  * mouse button (button 32).
2097  *
2098  * If @p e is not a valid canvas, the return value is undefined.
2099  *
2100  * Example:
2101  * @code
2102  * extern Evas *evas;
2103  * int button_mask, i;
2104  *
2105  * button_mask = evas_pointer_button_down_mask_get(evas);
2106  * printf("Buttons currently pressed:\n");
2107  * for (i = 0; i < 32; i++)
2108  *   {
2109  *     if ((button_mask & (1 << i)) != 0) printf("Button %i\n", i + 1);
2110  *   }
2111  * @endcode
2112  */
2113 EAPI int               evas_pointer_button_down_mask_get (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
2114
2115 /**
2116  * Returns whether the mouse pointer is logically inside the canvas
2117  *
2118  * @param e The pointer to the Evas Canvas
2119  * @return An integer that is 1 if the mouse is inside the canvas, 0 otherwise
2120  * @ingroup Evas_Pointer_Group
2121  *
2122  * When this function is called it will return a value of either 0 or
2123  * 1, depending on if evas_event_feed_mouse_in(),
2124  * evas_event_feed_mouse_in_data(), or evas_event_feed_mouse_out(),
2125  * evas_event_feed_mouse_out_data() have been called to feed in a
2126  * mouse enter event into the canvas.
2127  *
2128  * A return value of 1 indicates the mouse is logically inside the
2129  * canvas, and 0 implies it is logically outside the canvas.
2130  *
2131  * A canvas begins with the mouse being assumed outside (0).
2132  *
2133  * If @p e is not a valid canvas, the return value is undefined.
2134  *
2135  * Example:
2136  * @code
2137  * extern Evas *evas;
2138  *
2139  * if (evas_pointer_inside_get(evas)) printf("Mouse is in!\n");
2140  * else printf("Mouse is out!\n");
2141  * @endcode
2142  */
2143 EAPI Eina_Bool         evas_pointer_inside_get           (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
2144    EAPI void              evas_sync(Evas *e) EINA_ARG_NONNULL(1);
2145
2146 /**
2147  * @defgroup Evas_Canvas_Events Canvas Events
2148  *
2149  * Functions relating to canvas events, which are mainly reports on
2150  * its internal states changing (an object got focused, the rendering
2151  * is updated, etc).
2152  *
2153  * Some of the funcions in this group are exemplified @ref
2154  * Example_Evas_Events "here".
2155  *
2156  * @ingroup Evas_Canvas
2157  */
2158
2159 /**
2160  * @addtogroup Evas_Canvas_Events
2161  * @{
2162  */
2163
2164 /**
2165  * Add (register) a callback function to a given canvas event.
2166  *
2167  * @param e Canvas to attach a callback to
2168  * @param type The type of event that will trigger the callback
2169  * @param func The (callback) function to be called when the event is
2170  *        triggered
2171  * @param data The data pointer to be passed to @p func
2172  *
2173  * This function adds a function callback to the canvas @p e when the
2174  * event of type @p type occurs on it. The function pointer is @p
2175  * func.
2176  *
2177  * In the event of a memory allocation error during the addition of
2178  * the callback to the canvas, evas_alloc_error() should be used to
2179  * determine the nature of the error, if any, and the program should
2180  * sensibly try and recover.
2181  *
2182  * A callback function must have the ::Evas_Event_Cb prototype
2183  * definition. The first parameter (@p data) in this definition will
2184  * have the same value passed to evas_event_callback_add() as the @p
2185  * data parameter, at runtime. The second parameter @p e is the canvas
2186  * pointer on which the event occurred. The third parameter @p
2187  * event_info is a pointer to a data structure that may or may not be
2188  * passed to the callback, depending on the event type that triggered
2189  * the callback. This is so because some events don't carry extra
2190  * context with them, but others do.
2191  *
2192  * The event type @p type to trigger the function may be one of
2193  * #EVAS_CALLBACK_RENDER_FLUSH_PRE, #EVAS_CALLBACK_RENDER_FLUSH_POST,
2194  * #EVAS_CALLBACK_CANVAS_FOCUS_IN, #EVAS_CALLBACK_CANVAS_FOCUS_OUT,
2195  * #EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_IN and
2196  * #EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_OUT. This determines the kind of
2197  * event that will trigger the callback to be called. Only the last
2198  * two of the event types listed here provide useful event information
2199  * data -- a pointer to the recently focused Evas object. For the
2200  * others the @p event_info pointer is going to be @c NULL.
2201  *
2202  * Example:
2203  * @dontinclude evas-events.c
2204  * @skip evas_event_callback_add(d.canvas, EVAS_CALLBACK_RENDER_FLUSH_PRE
2205  * @until two canvas event callbacks
2206  *
2207  * Looking to the callbacks registered above,
2208  * @dontinclude evas-events.c
2209  * @skip called when our rectangle gets focus
2210  * @until let's have our events back
2211  *
2212  * we see that the canvas flushes its rendering pipeline
2213  * (#EVAS_CALLBACK_RENDER_FLUSH_PRE) whenever the @c _resize_cb
2214  * routine takes place: it has to redraw that image at a different
2215  * size. Also, the callback on an object being focused comes just
2216  * after we focus it explicitly, on code.
2217  *
2218  * See the full @ref Example_Evas_Events "example".
2219  *
2220  * @note Be careful not to add the same callback multiple times, if
2221  * that's not what you want, because Evas won't check if a callback
2222  * existed before exactly as the one being registered (and thus, call
2223  * it more than once on the event, in this case). This would make
2224  * sense if you passed different functions and/or callback data, only.
2225  */
2226 EAPI void              evas_event_callback_add              (Evas *e, Evas_Callback_Type type, Evas_Event_Cb func, const void *data) EINA_ARG_NONNULL(1, 3);
2227
2228 /**
2229  * Add (register) a callback function to a given canvas event with a
2230  * non-default priority set. Except for the priority field, it's exactly the
2231  * same as @ref evas_event_callback_add
2232  *
2233  * @param e Canvas to attach a callback to
2234  * @param type The type of event that will trigger the callback
2235  * @param priority The priority of the callback, lower values called first.
2236  * @param func The (callback) function to be called when the event is
2237  *        triggered
2238  * @param data The data pointer to be passed to @p func
2239  *
2240  * @see evas_event_callback_add
2241  * @since 1.1.0
2242  */
2243 EAPI void              evas_event_callback_priority_add(Evas *e, Evas_Callback_Type type, Evas_Callback_Priority priority, Evas_Event_Cb func, const void *data) EINA_ARG_NONNULL(1, 4);
2244
2245 /**
2246  * Delete a callback function from the canvas.
2247  *
2248  * @param e Canvas to remove a callback from
2249  * @param type The type of event that was triggering the callback
2250  * @param func The function that was to be called when the event was triggered
2251  * @return The data pointer that was to be passed to the callback
2252  *
2253  * This function removes the most recently added callback from the
2254  * canvas @p e which was triggered by the event type @p type and was
2255  * calling the function @p func when triggered. If the removal is
2256  * successful it will also return the data pointer that was passed to
2257  * evas_event_callback_add() when the callback was added to the
2258  * canvas. If not successful NULL will be returned.
2259  *
2260  * Example:
2261  * @code
2262  * extern Evas *e;
2263  * void *my_data;
2264  * void focus_in_callback(void *data, Evas *e, void *event_info);
2265  *
2266  * my_data = evas_event_callback_del(ebject, EVAS_CALLBACK_CANVAS_FOCUS_IN, focus_in_callback);
2267  * @endcode
2268  */
2269 EAPI void             *evas_event_callback_del              (Evas *e, Evas_Callback_Type type, Evas_Event_Cb func) EINA_ARG_NONNULL(1, 3);
2270
2271 /**
2272  * Delete (unregister) a callback function registered to a given
2273  * canvas event.
2274  *
2275  * @param e Canvas to remove an event callback from
2276  * @param type The type of event that was triggering the callback
2277  * @param func The function that was to be called when the event was
2278  *        triggered
2279  * @param data The data pointer that was to be passed to the callback
2280  * @return The data pointer that was to be passed to the callback
2281  *
2282  * This function removes <b>the first</b> added callback from the
2283  * canvas @p e matching the event type @p type, the registered
2284  * function pointer @p func and the callback data pointer @p data. If
2285  * the removal is successful it will also return the data pointer that
2286  * was passed to evas_event_callback_add() (that will be the same as
2287  * the parameter) when the callback(s) was(were) added to the
2288  * canvas. If not successful @c NULL will be returned. A common use
2289  * would be to remove an exact match of a callback.
2290  *
2291  * Example:
2292  * @dontinclude evas-events.c
2293  * @skip evas_event_callback_del_full(evas, EVAS_CALLBACK_RENDER_FLUSH_PRE,
2294  * @until _object_focus_in_cb, NULL);
2295  *
2296  * See the full @ref Example_Evas_Events "example".
2297  *
2298  * @note For deletion of canvas events callbacks filtering by just
2299  * type and function pointer, user evas_event_callback_del().
2300  */
2301 EAPI void             *evas_event_callback_del_full         (Evas *e, Evas_Callback_Type type, Evas_Event_Cb func, const void *data) EINA_ARG_NONNULL(1, 3);
2302
2303 /**
2304  * Push a callback on the post-event callback stack
2305  *
2306  * @param e Canvas to push the callback on
2307  * @param func The function that to be called when the stack is unwound
2308  * @param data The data pointer to be passed to the callback
2309  *
2310  * Evas has a stack of callbacks that get called after all the callbacks for
2311  * an event have triggered (all the objects it triggers on and al the callbacks
2312  * in each object triggered). When all these have been called, the stack is
2313  * unwond from most recently to least recently pushed item and removed from the
2314  * stack calling the callback set for it.
2315  *
2316  * This is intended for doing reverse logic-like processing, example - when a
2317  * child object that happens to get the event later is meant to be able to
2318  * "steal" functions from a parent and thus on unwind of this stack hav its
2319  * function called first, thus being able to set flags, or return 0 from the
2320  * post-callback that stops all other post-callbacks in the current stack from
2321  * being called (thus basically allowing a child to take control, if the event
2322  * callback prepares information ready for taking action, but the post callback
2323  * actually does the action).
2324  *
2325  */
2326 EAPI void              evas_post_event_callback_push        (Evas *e, Evas_Object_Event_Post_Cb func, const void *data);
2327
2328 /**
2329  * Remove a callback from the post-event callback stack
2330  *
2331  * @param e Canvas to push the callback on
2332  * @param func The function that to be called when the stack is unwound
2333  *
2334  * This removes a callback from the stack added with
2335  * evas_post_event_callback_push(). The first instance of the function in
2336  * the callback stack is removed from being executed when the stack is
2337  * unwound. Further instances may still be run on unwind.
2338  */
2339 EAPI void              evas_post_event_callback_remove      (Evas *e, Evas_Object_Event_Post_Cb func);
2340
2341 /**
2342  * Remove a callback from the post-event callback stack
2343  *
2344  * @param e Canvas to push the callback on
2345  * @param func The function that to be called when the stack is unwound
2346  * @param data The data pointer to be passed to the callback
2347  *
2348  * This removes a callback from the stack added with
2349  * evas_post_event_callback_push(). The first instance of the function and data
2350  * in the callback stack is removed from being executed when the stack is
2351  * unwound. Further instances may still be run on unwind.
2352  */
2353 EAPI void              evas_post_event_callback_remove_full (Evas *e, Evas_Object_Event_Post_Cb func, const void *data);
2354
2355 /**
2356  * @defgroup Evas_Event_Freezing_Group Input Events Freezing Functions
2357  *
2358  * Functions that deal with the freezing of input event processing of
2359  * an Evas canvas.
2360  *
2361  * There might be scenarios during a graphical user interface
2362  * program's use when the developer whishes the users wouldn't be able
2363  * to deliver input events to this application. It may, for example,
2364  * be the time for it to populate a view or to change some
2365  * layout. Assuming proper behavior with user interaction during this
2366  * exact time would be hard, as things are in a changing state. The
2367  * programmer can then tell the canvas to ignore input events,
2368  * bringing it back to normal behavior when he/she wants.
2369  *
2370  * Some of the funcions in this group are exemplified @ref
2371  * Example_Evas_Events "here".
2372  *
2373  * @ingroup Evas_Canvas_Events
2374  */
2375
2376 /**
2377  * @addtogroup Evas_Event_Freezing_Group
2378  * @{
2379  */
2380
2381 /**
2382  * Set the default set of flags an event begins with
2383  * 
2384  * @param e The canvas to set the default event flags of
2385  * @param flags The default flags to use
2386  * 
2387  * Events in evas can have an event_flags member. This starts out with
2388  * and initial value (no flags). this lets you set the default flags that
2389  * an event begins with to be @p flags
2390  * 
2391  * @since 1.2
2392  */
2393 EAPI void              evas_event_default_flags_set      (Evas *e, Evas_Event_Flags flags) EINA_ARG_NONNULL(1);
2394
2395 /**
2396  * Get the defaulty set of flags an event begins with
2397  * 
2398  * @param e The canvas to get the default event flags from
2399  * @return The default event flags for that canvas
2400  * 
2401  * This gets the default event flags events are produced with when fed in.
2402  * 
2403  * @see evas_event_default_flags_set()
2404  * @since 1.2
2405  */
2406 EAPI Evas_Event_Flags  evas_event_default_flags_get      (const Evas *e) EINA_ARG_NONNULL(1);
2407
2408 /**
2409  * Freeze all input events processing.
2410  *
2411  * @param e The canvas to freeze input events processing on.
2412  *
2413  * This function will indicate to Evas that the canvas @p e is to have
2414  * all input event processing frozen until a matching
2415  * evas_event_thaw() function is called on the same canvas. All events
2416  * of this kind during the freeze will get @b discarded. Every freeze
2417  * call must be matched by a thaw call in order to completely thaw out
2418  * a canvas (i.e. these calls may be nested). The most common use is
2419  * when you don't want the user to interect with your user interface
2420  * when you're populating a view or changing the layout.
2421  *
2422  * Example:
2423  * @dontinclude evas-events.c
2424  * @skip freeze input for 3 seconds
2425  * @until }
2426  * @dontinclude evas-events.c
2427  * @skip let's have our events back
2428  * @until }
2429  *
2430  * See the full @ref Example_Evas_Events "example".
2431  *
2432  * If you run that example, you'll see the canvas ignoring all input
2433  * events for 3 seconds, when the "f" key is pressed. In a more
2434  * realistic code we would be freezing while a toolkit or Edje was
2435  * doing some UI changes, thawing it back afterwards.
2436  */
2437 EAPI void              evas_event_freeze                 (Evas *e) EINA_ARG_NONNULL(1);
2438
2439 /**
2440  * Thaw a canvas out after freezing (for input events).
2441  *
2442  * @param e The canvas to thaw out.
2443  *
2444  * This will thaw out a canvas after a matching evas_event_freeze()
2445  * call. If this call completely thaws out a canvas, i.e., there's no
2446  * other unbalanced call to evas_event_freeze(), events will start to
2447  * be processed again, but any "missed" events will @b not be
2448  * evaluated.
2449  *
2450  * See evas_event_freeze() for an example.
2451  */
2452 EAPI void              evas_event_thaw                   (Evas *e) EINA_ARG_NONNULL(1);
2453
2454 /**
2455  * Return the freeze count on input events of a given canvas.
2456  *
2457  * @param e The canvas to fetch the freeze count from.
2458  *
2459  * This returns the number of times the canvas has been told to freeze
2460  * input events. It is possible to call evas_event_freeze() multiple
2461  * times, and these must be matched by evas_event_thaw() calls. This
2462  * call allows the program to discover just how many times things have
2463  * been frozen in case it may want to break out of a deep freeze state
2464  * where the count is high.
2465  *
2466  * Example:
2467  * @code
2468  * extern Evas *evas;
2469  *
2470  * while (evas_event_freeze_get(evas) > 0) evas_event_thaw(evas);
2471  * @endcode
2472  *
2473  */
2474 EAPI int               evas_event_freeze_get             (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
2475
2476 /**
2477  * After thaw of a canvas, re-evaluate the state of objects and call callbacks
2478  *
2479  * @param e The canvas to evaluate after a thaw
2480  *
2481  * This is normally called after evas_event_thaw() to re-evaluate mouse
2482  * containment and other states and thus also call callbacks for mouse in and
2483  * out on new objects if the state change demands it.
2484  */
2485 EAPI void              evas_event_thaw_eval              (Evas *e) EINA_ARG_NONNULL(1);
2486
2487 /**
2488  * @}
2489  */
2490
2491 /**
2492  * @defgroup Evas_Event_Feeding_Group Input Events Feeding Functions
2493  *
2494  * Functions to tell Evas that input events happened and should be
2495  * processed.
2496  *
2497  * As explained in @ref intro_not_evas, Evas does not know how to poll
2498  * for input events, so the developer should do it and then feed such
2499  * events to the canvas to be processed. This is only required if
2500  * operating Evas directly. Modules such as Ecore_Evas do that for
2501  * you.
2502  *
2503  * Some of the funcions in this group are exemplified @ref
2504  * Example_Evas_Events "here".
2505  *
2506  * @ingroup Evas_Canvas_Events
2507  */
2508
2509 /**
2510  * @addtogroup Evas_Event_Feeding_Group
2511  * @{
2512  */
2513
2514 /**
2515  * Get the number of mouse or multi presses currently active
2516  *
2517  * @p e The given canvas pointer.
2518  * @return The numer of presses (0 if none active).
2519  *
2520  * @since 1.2
2521  */
2522 EAPI int               evas_event_down_count_get         (const Evas *e) EINA_ARG_NONNULL(1);
2523
2524 /**
2525  * Mouse down event feed.
2526  *
2527  * @param e The given canvas pointer.
2528  * @param b The button number.
2529  * @param flags The evas button flags.
2530  * @param timestamp The timestamp of the mouse down event.
2531  * @param data The data for canvas.
2532  *
2533  * This function will set some evas properties that is necessary when
2534  * the mouse button is pressed. It prepares information to be treated
2535  * by the callback function.
2536  *
2537  */
2538 EAPI void              evas_event_feed_mouse_down        (Evas *e, int b, Evas_Button_Flags flags, unsigned int timestamp, const void *data) EINA_ARG_NONNULL(1);
2539
2540 /**
2541  * Mouse up event feed.
2542  *
2543  * @param e The given canvas pointer.
2544  * @param b The button number.
2545  * @param flags evas button flags.
2546  * @param timestamp The timestamp of the mouse up event.
2547  * @param data The data for canvas.
2548  *
2549  * This function will set some evas properties that is necessary when
2550  * the mouse button is released. It prepares information to be treated
2551  * by the callback function.
2552  *
2553  */
2554 EAPI void              evas_event_feed_mouse_up          (Evas *e, int b, Evas_Button_Flags flags, unsigned int timestamp, const void *data) EINA_ARG_NONNULL(1);
2555
2556 /**
2557  * Mouse move event feed.
2558  *
2559  * @param e The given canvas pointer.
2560  * @param x The horizontal position of the mouse pointer.
2561  * @param y The vertical position of the mouse pointer.
2562  * @param timestamp The timestamp of the mouse up event.
2563  * @param data The data for canvas.
2564  *
2565  * This function will set some evas properties that is necessary when
2566  * the mouse is moved from its last position. It prepares information
2567  * to be treated by the callback function.
2568  *
2569  */
2570 EAPI void              evas_event_feed_mouse_move        (Evas *e, int x, int y, unsigned int timestamp, const void *data) EINA_ARG_NONNULL(1);
2571
2572 /**
2573  * Mouse in event feed.
2574  *
2575  * @param e The given canvas pointer.
2576  * @param timestamp The timestamp of the mouse up event.
2577  * @param data The data for canvas.
2578  *
2579  * This function will set some evas properties that is necessary when
2580  * the mouse in event happens. It prepares information to be treated
2581  * by the callback function.
2582  *
2583  */
2584 EAPI void              evas_event_feed_mouse_in          (Evas *e, unsigned int timestamp, const void *data) EINA_ARG_NONNULL(1);
2585
2586 /**
2587  * Mouse out event feed.
2588  *
2589  * @param e The given canvas pointer.
2590  * @param timestamp Timestamp of the mouse up event.
2591  * @param data The data for canvas.
2592  *
2593  * This function will set some evas properties that is necessary when
2594  * the mouse out event happens. It prepares information to be treated
2595  * by the callback function.
2596  *
2597  */
2598 EAPI void              evas_event_feed_mouse_out         (Evas *e, unsigned int timestamp, const void *data) EINA_ARG_NONNULL(1);
2599    EAPI void              evas_event_feed_multi_down        (Evas *e, int d, int x, int y, double rad, double radx, double rady, double pres, double ang, double fx, double fy, Evas_Button_Flags flags, unsigned int timestamp, const void *data);
2600    EAPI void              evas_event_feed_multi_up          (Evas *e, int d, int x, int y, double rad, double radx, double rady, double pres, double ang, double fx, double fy, Evas_Button_Flags flags, unsigned int timestamp, const void *data);
2601    EAPI void              evas_event_feed_multi_move        (Evas *e, int d, int x, int y, double rad, double radx, double rady, double pres, double ang, double fx, double fy, unsigned int timestamp, const void *data);
2602
2603 /**
2604  * Mouse cancel event feed.
2605  *
2606  * @param e The given canvas pointer.
2607  * @param timestamp The timestamp of the mouse up event.
2608  * @param data The data for canvas.
2609  *
2610  * This function will call evas_event_feed_mouse_up() when a
2611  * mouse cancel event happens.
2612  *
2613  */
2614 EAPI void              evas_event_feed_mouse_cancel      (Evas *e, unsigned int timestamp, const void *data) EINA_ARG_NONNULL(1);
2615
2616 /**
2617  * Mouse wheel event feed.
2618  *
2619  * @param e The given canvas pointer.
2620  * @param direction The wheel mouse direction.
2621  * @param z How much mouse wheel was scrolled up or down.
2622  * @param timestamp The timestamp of the mouse up event.
2623  * @param data The data for canvas.
2624  *
2625  * This function will set some evas properties that is necessary when
2626  * the mouse wheel is scrolled up or down. It prepares information to
2627  * be treated by the callback function.
2628  *
2629  */
2630 EAPI void              evas_event_feed_mouse_wheel       (Evas *e, int direction, int z, unsigned int timestamp, const void *data) EINA_ARG_NONNULL(1);
2631
2632 /**
2633  * Key down event feed
2634  *
2635  * @param e The canvas to thaw out
2636  * @param keyname  Name of the key
2637  * @param key The key pressed.
2638  * @param string A String
2639  * @param compose The compose string
2640  * @param timestamp Timestamp of the mouse up event
2641  * @param data Data for canvas.
2642  *
2643  * This function will set some evas properties that is necessary when
2644  * a key is pressed. It prepares information to be treated by the
2645  * callback function.
2646  *
2647  */
2648 EAPI void              evas_event_feed_key_down          (Evas *e, const char *keyname, const char *key, const char *string, const char *compose, unsigned int timestamp, const void *data) EINA_ARG_NONNULL(1);
2649
2650 /**
2651  * Key up event feed
2652  *
2653  * @param e The canvas to thaw out
2654  * @param keyname  Name of the key
2655  * @param key The key released.
2656  * @param string string
2657  * @param compose compose
2658  * @param timestamp Timestamp of the mouse up event
2659  * @param data Data for canvas.
2660  *
2661  * This function will set some evas properties that is necessary when
2662  * a key is released. It prepares information to be treated by the
2663  * callback function.
2664  *
2665  */
2666 EAPI void              evas_event_feed_key_up            (Evas *e, const char *keyname, const char *key, const char *string, const char *compose, unsigned int timestamp, const void *data) EINA_ARG_NONNULL(1);
2667
2668 /**
2669  * Hold event feed
2670  *
2671  * @param e The given canvas pointer.
2672  * @param hold The hold.
2673  * @param timestamp The timestamp of the mouse up event.
2674  * @param data The data for canvas.
2675  *
2676  * This function makes the object to stop sending events.
2677  *
2678  */
2679 EAPI void              evas_event_feed_hold              (Evas *e, int hold, unsigned int timestamp, const void *data) EINA_ARG_NONNULL(1);
2680
2681 /**
2682  * Re feed event.
2683  *
2684  * @param e The given canvas pointer.
2685  * @param event_copy the event to refeed
2686  * @param event_type Event type
2687  *
2688  * This function re-feeds the event pointed by event_copy
2689  *
2690  * This function call evas_event_feed_* functions, so it can
2691  * cause havoc if not used wisely. Please use it responsibly.
2692  */
2693 EAPI void              evas_event_refeed_event           (Evas *e, void *event_copy, Evas_Callback_Type event_type) EINA_ARG_NONNULL(1);
2694
2695
2696 /**
2697  * @}
2698  */
2699
2700 /**
2701  * @}
2702  */
2703
2704 /**
2705  * @defgroup Evas_Image_Group Image Functions
2706  *
2707  * Functions that deals with images at canvas level.
2708  *
2709  * @ingroup Evas_Canvas
2710  */
2711
2712 /**
2713  * @addtogroup Evas_Image_Group
2714  * @{
2715  */
2716
2717 /**
2718  * Flush the image cache of the canvas.
2719  *
2720  * @param e The given evas pointer.
2721  *
2722  * This function flushes image cache of canvas.
2723  *
2724  */
2725 EAPI void              evas_image_cache_flush            (Evas *e) EINA_ARG_NONNULL(1);
2726
2727 /**
2728  * Reload the image cache
2729  *
2730  * @param e The given evas pointer.
2731  *
2732  * This function reloads the image cache of canvas.
2733  *
2734  */
2735 EAPI void              evas_image_cache_reload           (Evas *e) EINA_ARG_NONNULL(1);
2736
2737 /**
2738  * Set the image cache.
2739  *
2740  * @param e The given evas pointer.
2741  * @param size The cache size.
2742  *
2743  * This function sets the image cache of canvas in bytes.
2744  *
2745  */
2746 EAPI void              evas_image_cache_set              (Evas *e, int size) EINA_ARG_NONNULL(1);
2747
2748 /**
2749  * Get the image cache
2750  *
2751  * @param e The given evas pointer.
2752  *
2753  * This function returns the image cache size of canvas in bytes.
2754  *
2755  */
2756 EAPI int               evas_image_cache_get              (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
2757
2758 /**
2759  * Get the maximum image size evas can possibly handle
2760  *
2761  * @param e The given evas pointer.
2762  * @param maxw Pointer to hold the return value in pixels of the maxumum width
2763  * @param maxh Pointer to hold the return value in pixels of the maximum height
2764  *
2765  * This function returns the larges image or surface size that evas can handle
2766  * in pixels, and if there is one, returns EINA_TRUE. It returns EINA_FALSE
2767  * if no extra constraint on maximum image size exists. You still should
2768  * check the return values of @p maxw and @p maxh as there may still be a
2769  * limit, just a much higher one.
2770  *
2771  * @since 1.1
2772  */
2773 EAPI Eina_Bool         evas_image_max_size_get           (const Evas *e, int *maxw, int *maxh) EINA_ARG_NONNULL(1);
2774
2775 /**
2776  * @}
2777  */
2778
2779 /**
2780  * @defgroup Evas_Font_Group Font Functions
2781  *
2782  * Functions that deals with fonts.
2783  *
2784  * @ingroup Evas_Canvas
2785  */
2786
2787 /**
2788  * Changes the font hinting for the given evas.
2789  *
2790  * @param e The given evas.
2791  * @param hinting The hinting to use, one of #EVAS_FONT_HINTING_NONE,
2792  *        #EVAS_FONT_HINTING_AUTO, #EVAS_FONT_HINTING_BYTECODE.
2793  * @ingroup Evas_Font_Group
2794  */
2795 EAPI void                     evas_font_hinting_set        (Evas *e, Evas_Font_Hinting_Flags hinting) EINA_ARG_NONNULL(1);
2796
2797 /**
2798  * Retrieves the font hinting used by the given evas.
2799  *
2800  * @param e The given evas to query.
2801  * @return The hinting in use, one of #EVAS_FONT_HINTING_NONE,
2802  *         #EVAS_FONT_HINTING_AUTO, #EVAS_FONT_HINTING_BYTECODE.
2803  * @ingroup Evas_Font_Group
2804  */
2805 EAPI Evas_Font_Hinting_Flags  evas_font_hinting_get        (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
2806
2807 /**
2808  * Checks if the font hinting is supported by the given evas.
2809  *
2810  * @param e The given evas to query.
2811  * @param hinting The hinting to use, one of #EVAS_FONT_HINTING_NONE,
2812  *        #EVAS_FONT_HINTING_AUTO, #EVAS_FONT_HINTING_BYTECODE.
2813  * @return @c EINA_TRUE if it is supported, @c EINA_FALSE otherwise.
2814  * @ingroup Evas_Font_Group
2815  */
2816 EAPI Eina_Bool                evas_font_hinting_can_hint   (const Evas *e, Evas_Font_Hinting_Flags hinting) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
2817
2818
2819 /**
2820  * Force the given evas and associated engine to flush its font cache.
2821  *
2822  * @param e The given evas to flush font cache.
2823  * @ingroup Evas_Font_Group
2824  */
2825 EAPI void                     evas_font_cache_flush        (Evas *e) EINA_ARG_NONNULL(1);
2826
2827 /**
2828  * Changes the size of font cache of the given evas.
2829  *
2830  * @param e The given evas to flush font cache.
2831  * @param size The size, in bytes.
2832  *
2833  * @ingroup Evas_Font_Group
2834  */
2835 EAPI void                     evas_font_cache_set          (Evas *e, int size) EINA_ARG_NONNULL(1);
2836
2837 /**
2838  * Changes the size of font cache of the given evas.
2839  *
2840  * @param e The given evas to flush font cache.
2841  * @return The size, in bytes.
2842  *
2843  * @ingroup Evas_Font_Group
2844  */
2845 EAPI int                      evas_font_cache_get          (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
2846
2847
2848 /**
2849  * List of available font descriptions known or found by this evas.
2850  *
2851  * The list depends on Evas compile time configuration, such as
2852  * fontconfig support, and the paths provided at runtime as explained
2853  * in @ref Evas_Font_Path_Group.
2854  *
2855  * @param e The evas instance to query.
2856  * @return a newly allocated list of strings. Do not change the
2857  *         strings.  Be sure to call evas_font_available_list_free()
2858  *         after you're done.
2859  *
2860  * @ingroup Evas_Font_Group
2861  */
2862 EAPI Eina_List               *evas_font_available_list     (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
2863
2864 /**
2865  * Free list of font descriptions returned by evas_font_dir_available_list().
2866  *
2867  * @param e The evas instance that returned such list.
2868  * @param available the list returned by evas_font_dir_available_list().
2869  *
2870  * @ingroup Evas_Font_Group
2871  */
2872 EAPI void                     evas_font_available_list_free(Evas *e, Eina_List *available) EINA_ARG_NONNULL(1);
2873
2874 /**
2875  * @defgroup Evas_Font_Path_Group Font Path Functions
2876  *
2877  * Functions that edit the paths being used to load fonts.
2878  *
2879  * @ingroup Evas_Font_Group
2880  */
2881
2882 /**
2883  * Removes all font paths loaded into memory for the given evas.
2884  * @param   e The given evas.
2885  * @ingroup Evas_Font_Path_Group
2886  */
2887 EAPI void              evas_font_path_clear              (Evas *e) EINA_ARG_NONNULL(1);
2888
2889 /**
2890  * Appends a font path to the list of font paths used by the given evas.
2891  * @param   e    The given evas.
2892  * @param   path The new font path.
2893  * @ingroup Evas_Font_Path_Group
2894  */
2895 EAPI void              evas_font_path_append             (Evas *e, const char *path) EINA_ARG_NONNULL(1, 2);
2896
2897 /**
2898  * Prepends a font path to the list of font paths used by the given evas.
2899  * @param   e The given evas.
2900  * @param   path The new font path.
2901  * @ingroup Evas_Font_Path_Group
2902  */
2903 EAPI void              evas_font_path_prepend            (Evas *e, const char *path) EINA_ARG_NONNULL(1, 2);
2904
2905 /**
2906  * Retrieves the list of font paths used by the given evas.
2907  * @param   e The given evas.
2908  * @return  The list of font paths used.
2909  * @ingroup Evas_Font_Path_Group
2910  */
2911 EAPI const Eina_List  *evas_font_path_list               (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
2912
2913 /**
2914  * @defgroup Evas_Object_Group Generic Object Functions
2915  *
2916  * Functions that manipulate generic Evas objects.
2917  *
2918  * All Evas displaying units are Evas objects. One handles them all by
2919  * means of the handle ::Evas_Object. Besides Evas treats their
2920  * objects equally, they have @b types, which define their specific
2921  * behavior (and individual API).
2922  *
2923  * Evas comes with a set of built-in object types:
2924  *   - rectangle,
2925  *   - line,
2926  *   - polygon,
2927  *   - text,
2928  *   - textblock and
2929  *   - image.
2930  *
2931  * These functions apply to @b any Evas object, whichever type thay
2932  * may have.
2933  *
2934  * @note The built-in types which are most used are rectangles, text
2935  * and images. In fact, with these ones one can create 2D interfaces
2936  * of arbitrary complexity and EFL makes it easy.
2937  */
2938
2939 /**
2940  * @defgroup Evas_Object_Group_Basic Basic Object Manipulation
2941  *
2942  * Methods that are broadly used, like those that change the color,
2943  * clippers and geometry of an Evas object.
2944  *
2945  * An example on the most used functions in this group can be seen @ref
2946  * Example_Evas_Object_Manipulation "here".
2947  *
2948  * For function dealing with stacking, the examples are gathered  @ref
2949  * Example_Evas_Stacking "here".
2950  *
2951  * @ingroup Evas_Object_Group
2952  */
2953
2954 /**
2955  * @addtogroup Evas_Object_Group_Basic
2956  * @{
2957  */
2958
2959 /**
2960  * Clip one object to another.
2961  *
2962  * @param obj The object to be clipped
2963  * @param clip The object to clip @p obj by
2964  *
2965  * This function will clip the object @p obj to the area occupied by
2966  * the object @p clip. This means the object @p obj will only be
2967  * visible within the area occupied by the clipping object (@p clip).
2968  *
2969  * The color of the object being clipped will be multiplied by the
2970  * color of the clipping one, so the resulting color for the former
2971  * will be <code>RESULT = (OBJ * CLIP) / (255 * 255)</code>, per color
2972  * element (red, green, blue and alpha).
2973  *
2974  * Clipping is recursive, so clipping objects may be clipped by
2975  * others, and their color will in term be multiplied. You may @b not
2976  * set up circular clipping lists (i.e. object 1 clips object 2, which
2977  * clips object 1): the behavior of Evas is undefined in this case.
2978  *
2979  * Objects which do not clip others are visible in the canvas as
2980  * normal; <b>those that clip one or more objects become invisible
2981  * themselves</b>, only affecting what they clip. If an object ceases
2982  * to have other objects being clipped by it, it will become visible
2983  * again.
2984  *
2985  * The visibility of an object affects the objects that are clipped by
2986  * it, so if the object clipping others is not shown (as in
2987  * evas_object_show()), the objects clipped by it will not be shown
2988  * either.
2989  *
2990  * If @p obj was being clipped by another object when this function is
2991  * called, it gets implicitly removed from the old clipper's domain
2992  * and is made now to be clipped by its new clipper.
2993  *
2994  * The following figure illustrates some clipping in Evas:
2995  *
2996  * @image html clipping.png
2997  * @image rtf clipping.png
2998  * @image latex clipping.eps
2999  *
3000  * @note At the moment the <b>only objects that can validly be used to
3001  * clip other objects are rectangle objects</b>. All other object
3002  * types are invalid and the result of using them is undefined. The
3003  * clip object @p clip must be a valid object, but can also be @c
3004  * NULL, in which case the effect of this function is the same as
3005  * calling evas_object_clip_unset() on the @p obj object.
3006  *
3007  * Example:
3008  * @dontinclude evas-object-manipulation.c
3009  * @skip solid white clipper (note that it's the default color for a
3010  * @until evas_object_show(d.clipper);
3011  *
3012  * See the full @ref Example_Evas_Object_Manipulation "example".
3013  */
3014 EAPI void              evas_object_clip_set              (Evas_Object *obj, Evas_Object *clip) EINA_ARG_NONNULL(1, 2);
3015
3016 /**
3017  * Get the object clipping @p obj (if any).
3018  *
3019  * @param obj The object to get the clipper from
3020  *
3021  * This function returns the object clipping @p obj. If @p obj is
3022  * not being clipped at all, @c NULL is returned. The object @p obj
3023  * must be a valid ::Evas_Object.
3024  *
3025  * See also evas_object_clip_set(), evas_object_clip_unset() and
3026  * evas_object_clipees_get().
3027  *
3028  * Example:
3029  * @dontinclude evas-object-manipulation.c
3030  * @skip if (evas_object_clip_get(d.img) == d.clipper)
3031  * @until return
3032  *
3033  * See the full @ref Example_Evas_Object_Manipulation "example".
3034  */
3035 EAPI Evas_Object      *evas_object_clip_get              (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
3036
3037 /**
3038  * Disable/cease clipping on a clipped @p obj object.
3039  *
3040  * @param obj The object to cease clipping on
3041  *
3042  * This function disables clipping for the object @p obj, if it was
3043  * already clipped, i.e., its visibility and color get detached from
3044  * the previous clipper. If it wasn't, this has no effect. The object
3045  * @p obj must be a valid ::Evas_Object.
3046  *
3047  * See also evas_object_clip_set() (for an example),
3048  * evas_object_clipees_get() and evas_object_clip_get().
3049  *
3050  */
3051 EAPI void              evas_object_clip_unset            (Evas_Object *obj);
3052
3053 /**
3054  * Return a list of objects currently clipped by @p obj.
3055  *
3056  * @param obj The object to get a list of clippees from
3057  * @return a list of objects being clipped by @p obj
3058  *
3059  * This returns the internal list handle that contains all objects
3060  * clipped by the object @p obj. If none are clipped by it, the call
3061  * returns @c NULL. This list is only valid until the clip list is
3062  * changed and should be fetched again with another call to
3063  * evas_object_clipees_get() if any objects being clipped by this
3064  * object are unclipped, clipped by a new object, deleted or get the
3065  * clipper deleted. These operations will invalidate the list
3066  * returned, so it should not be used anymore after that point. Any
3067  * use of the list after this may have undefined results, possibly
3068  * leading to crashes. The object @p obj must be a valid
3069  * ::Evas_Object.
3070  *
3071  * See also evas_object_clip_set(), evas_object_clip_unset() and
3072  * evas_object_clip_get().
3073  *
3074  * Example:
3075  * @code
3076  * extern Evas_Object *obj;
3077  * Evas_Object *clipper;
3078  *
3079  * clipper = evas_object_clip_get(obj);
3080  * if (clipper)
3081  *   {
3082  *     Eina_List *clippees, *l;
3083  *     Evas_Object *obj_tmp;
3084  *
3085  *     clippees = evas_object_clipees_get(clipper);
3086  *     printf("Clipper clips %i objects\n", eina_list_count(clippees));
3087  *     EINA_LIST_FOREACH(clippees, l, obj_tmp)
3088  *         evas_object_show(obj_tmp);
3089  *   }
3090  * @endcode
3091  */
3092 EAPI const Eina_List  *evas_object_clipees_get           (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
3093
3094
3095 /**
3096  * Sets or unsets a given object as the currently focused one on its
3097  * canvas.
3098  *
3099  * @param obj The object to be focused or unfocused.
3100  * @param focus @c EINA_TRUE, to set it as focused or @c EINA_FALSE,
3101  * to take away the focus from it.
3102  *
3103  * Changing focus only affects where (key) input events go. There can
3104  * be only one object focused at any time. If @p focus is @c
3105  * EINA_TRUE, @p obj will be set as the currently focused object and
3106  * it will receive all keyboard events that are not exclusive key
3107  * grabs on other objects.
3108  *
3109  * Example:
3110  * @dontinclude evas-events.c
3111  * @skip evas_object_focus_set
3112  * @until evas_object_focus_set
3113  *
3114  * See the full example @ref Example_Evas_Events "here".
3115  *
3116  * @see evas_object_focus_get
3117  * @see evas_focus_get
3118  * @see evas_object_key_grab
3119  * @see evas_object_key_ungrab
3120  */
3121 EAPI void              evas_object_focus_set             (Evas_Object *obj, Eina_Bool focus) EINA_ARG_NONNULL(1);
3122
3123 /**
3124  * Retrieve whether an object has the focus.
3125  *
3126  * @param obj The object to retrieve focus information from.
3127  * @return @c EINA_TRUE if the object has the focus, @c EINA_FALSE
3128  * otherwise.
3129  *
3130  * If the passed object is the currently focused one, @c EINA_TRUE is
3131  * returned. @c EINA_FALSE is returned, otherwise.
3132  *
3133  * Example:
3134  * @dontinclude evas-events.c
3135  * @skip And again
3136  * @until something is bad
3137  *
3138  * See the full example @ref Example_Evas_Events "here".
3139  *
3140  * @see evas_object_focus_set
3141  * @see evas_focus_get
3142  * @see evas_object_key_grab
3143  * @see evas_object_key_ungrab
3144  */
3145 EAPI Eina_Bool         evas_object_focus_get             (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
3146
3147
3148 /**
3149  * Sets the layer of the its canvas that the given object will be part
3150  * of.
3151  *
3152  * @param   obj The given Evas object.
3153  * @param   l   The number of the layer to place the object on.
3154  *          Must be between #EVAS_LAYER_MIN and #EVAS_LAYER_MAX.
3155  *
3156  * If you don't use this function, you'll be dealing with an @b unique
3157  * layer of objects, the default one. Additional layers are handy when
3158  * you don't want a set of objects to interfere with another set with
3159  * regard to @b stacking. Two layers are completely disjoint in that
3160  * matter.
3161  *
3162  * This is a low-level function, which you'd be using when something
3163  * should be always on top, for example.
3164  *
3165  * @warning Be careful, it doesn't make sense to change the layer of
3166  * smart objects' children. Smart objects have a layer of their own,
3167  * which should contain all their children objects.
3168  *
3169  * @see evas_object_layer_get()
3170  */
3171 EAPI void              evas_object_layer_set             (Evas_Object *obj, short l) EINA_ARG_NONNULL(1);
3172
3173 /**
3174  * Retrieves the layer of its canvas that the given object is part of.
3175  *
3176  * @param   obj The given Evas object to query layer from
3177  * @return  Number of the its layer
3178  *
3179  * @see evas_object_layer_set()
3180  */
3181 EAPI short             evas_object_layer_get             (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
3182
3183
3184 /**
3185  * Sets the name of the given Evas object to the given name.
3186  *
3187  * @param   obj  The given object.
3188  * @param   name The given name.
3189  *
3190  * There might be occasions where one would like to name his/her
3191  * objects.
3192  *
3193  * Example:
3194  * @dontinclude evas-events.c
3195  * @skip d.bg = evas_object_rectangle_add(d.canvas);
3196  * @until evas_object_name_set(d.bg, "our dear rectangle");
3197  *
3198  * See the full @ref Example_Evas_Events "example".
3199  */
3200 EAPI void              evas_object_name_set              (Evas_Object *obj, const char *name) EINA_ARG_NONNULL(1);
3201
3202 /**
3203  * Retrieves the name of the given Evas object.
3204  *
3205  * @param   obj The given object.
3206  * @return  The name of the object or @c NULL, if no name has been given
3207  *          to it.
3208  *
3209  * Example:
3210  * @dontinclude evas-events.c
3211  * @skip fprintf(stdout, "An object got focused: %s\n",
3212  * @until evas_focus_get
3213  *
3214  * See the full @ref Example_Evas_Events "example".
3215  */
3216 EAPI const char       *evas_object_name_get              (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
3217
3218
3219 /**
3220  * Increments object reference count to defer its deletion.
3221  *
3222  * @param obj The given Evas object to reference
3223  *
3224  * This increments the reference count of an object, which if greater
3225  * than 0 will defer deletion by evas_object_del() until all
3226  * references are released back (counter back to 0). References cannot
3227  * go below 0 and unreferencing past that will result in the reference
3228  * count being limited to 0. References are limited to <c>2^32 - 1</c>
3229  * for an object. Referencing it more than this will result in it
3230  * being limited to this value.
3231  *
3232  * @see evas_object_unref()
3233  * @see evas_object_del()
3234  *
3235  * @note This is a <b>very simple<b> reference counting mechanism! For
3236  * instance, Evas is not ready to check for pending references on a
3237  * canvas deletion, or things like that. This is useful on scenarios
3238  * where, inside a code block, callbacks exist which would possibly
3239  * delete an object we are operating on afterwards. Then, one would
3240  * evas_object_ref() it on the beginning of the block and
3241  * evas_object_unref() it on the end. It would then be deleted at this
3242  * point, if it should be.
3243  *
3244  * Example:
3245  * @code
3246  *  evas_object_ref(obj);
3247  *
3248  *  // action here...
3249  *  evas_object_smart_callback_call(obj, SIG_SELECTED, NULL);
3250  *  // more action here...
3251  *  evas_object_unref(obj);
3252  * @endcode
3253  *
3254  * @ingroup Evas_Object_Group_Basic
3255  * @since 1.1.0
3256  */
3257 EAPI void              evas_object_ref                   (Evas_Object *obj);
3258
3259 /**
3260  * Decrements object reference count.
3261  *
3262  * @param obj The given Evas object to unreference
3263  *
3264  * This decrements the reference count of an object. If the object has
3265  * had evas_object_del() called on it while references were more than
3266  * 0, it will be deleted at the time this function is called and puts
3267  * the counter back to 0. See evas_object_ref() for more information.
3268  *
3269  * @see evas_object_ref() (for an example)
3270  * @see evas_object_del()
3271  *
3272  * @ingroup Evas_Object_Group_Basic
3273  * @since 1.1.0
3274  */
3275 EAPI void              evas_object_unref                 (Evas_Object *obj);
3276
3277
3278 /**
3279  * Marks the given Evas object for deletion (when Evas will free its
3280  * memory).
3281  *
3282  * @param obj The given Evas object.
3283  *
3284  * This call will mark @p obj for deletion, which will take place
3285  * whenever it has no more references to it (see evas_object_ref() and
3286  * evas_object_unref()).
3287  *
3288  * At actual deletion time, which may or may not be just after this
3289  * call, ::EVAS_CALLBACK_DEL and ::EVAS_CALLBACK_FREE callbacks will
3290  * be called. If the object currently had the focus, its
3291  * ::EVAS_CALLBACK_FOCUS_OUT callback will also be called.
3292  *
3293  * @see evas_object_ref()
3294  * @see evas_object_unref()
3295  *
3296  * @ingroup Evas_Object_Group_Basic
3297  */
3298 EAPI void              evas_object_del                   (Evas_Object *obj) EINA_ARG_NONNULL(1);
3299
3300 /**
3301  * Move the given Evas object to the given location inside its
3302  * canvas' viewport.
3303  *
3304  * @param obj The given Evas object.
3305  * @param x   X position to move the object to, in canvas units.
3306  * @param y   Y position to move the object to, in canvas units.
3307  *
3308  * Besides being moved, the object's ::EVAS_CALLBACK_MOVE callback
3309  * will be called.
3310  *
3311  * @note Naturally, newly created objects are placed at the canvas'
3312  * origin: <code>0, 0</code>.
3313  *
3314  * Example:
3315  * @dontinclude evas-object-manipulation.c
3316  * @skip evas_object_image_border_set(d.clipper_border, 3, 3, 3, 3);
3317  * @until evas_object_show
3318  *
3319  * See the full @ref Example_Evas_Object_Manipulation "example".
3320  *
3321  * @ingroup Evas_Object_Group_Basic
3322  */
3323 EAPI void              evas_object_move                  (Evas_Object *obj, Evas_Coord x, Evas_Coord y) EINA_ARG_NONNULL(1);
3324
3325 /**
3326  * Changes the size of the given Evas object.
3327  *
3328  * @param obj The given Evas object.
3329  * @param w   The new width of the Evas object.
3330  * @param h   The new height of the Evas object.
3331  *
3332  * Besides being resized, the object's ::EVAS_CALLBACK_RESIZE callback
3333  * will be called.
3334  *
3335  * @note Newly created objects have zeroed dimensions. Then, you most
3336  * probably want to use evas_object_resize() on them after they are
3337  * created.
3338  *
3339  * @note Be aware that resizing an object changes its drawing area,
3340  * but that does imply the object is rescaled! For instance, images
3341  * are filled inside their drawing area using the specifications of
3342  * evas_object_image_fill_set(). Thus to scale the image to match
3343  * exactly your drawing area, you need to change the
3344  * evas_object_image_fill_set() as well.
3345  *
3346  * @note This is more evident in images, but text, textblock, lines
3347  * and polygons will behave similarly. Check their specific APIs to
3348  * know how to achieve your desired behavior. Consider the following
3349  * example:
3350  *
3351  * @code
3352  * // rescale image to fill exactly its area without tiling:
3353  * evas_object_resize(img, w, h);
3354  * evas_object_image_fill_set(img, 0, 0, w, h);
3355  * @endcode
3356  *
3357  * @ingroup Evas_Object_Group_Basic
3358  */
3359 EAPI void              evas_object_resize                (Evas_Object *obj, Evas_Coord w, Evas_Coord h) EINA_ARG_NONNULL(1);
3360
3361 /**
3362  * Retrieves the position and (rectangular) size of the given Evas
3363  * object.
3364  *
3365  * @param obj The given Evas object.
3366  * @param x Pointer to an integer in which to store the X coordinate
3367  *          of the object.
3368  * @param y Pointer to an integer in which to store the Y coordinate
3369  *          of the object.
3370  * @param w Pointer to an integer in which to store the width of the
3371  *          object.
3372  * @param h Pointer to an integer in which to store the height of the
3373  *          object.
3374  *
3375  * The position, naturally, will be relative to the top left corner of
3376  * the canvas' viewport.
3377  *
3378  * @note Use @c NULL pointers on the geometry components you're not
3379  * interested in: they'll be ignored by the function.
3380  *
3381  * Example:
3382  * @dontinclude evas-events.c
3383  * @skip int w, h, cw, ch;
3384  * @until return
3385  *
3386  * See the full @ref Example_Evas_Events "example".
3387  *
3388  * @ingroup Evas_Object_Group_Basic
3389  */
3390 EAPI void              evas_object_geometry_get          (const Evas_Object *obj, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h) EINA_ARG_NONNULL(1);
3391
3392
3393 /**
3394  * Makes the given Evas object visible.
3395  *
3396  * @param obj The given Evas object.
3397  *
3398  * Besides becoming visible, the object's ::EVAS_CALLBACK_SHOW
3399  * callback will be called.
3400  *
3401  * @see evas_object_hide() for more on object visibility.
3402  * @see evas_object_visible_get()
3403  *
3404  * @ingroup Evas_Object_Group_Basic
3405  */
3406 EAPI void              evas_object_show                  (Evas_Object *obj) EINA_ARG_NONNULL(1);
3407
3408 /**
3409  * Makes the given Evas object invisible.
3410  *
3411  * @param obj The given Evas object.
3412  *
3413  * Hidden objects, besides not being shown at all in your canvas,
3414  * won't be checked for changes on the canvas rendering
3415  * process. Furthermore, they will not catch input events. Thus, they
3416  * are much ligher (in processing needs) than an object that is
3417  * invisible due to indirect causes, such as being clipped or out of
3418  * the canvas' viewport.
3419  *
3420  * Besides becoming hidden, @p obj object's ::EVAS_CALLBACK_SHOW
3421  * callback will be called.
3422  *
3423  * @note All objects are created in the hidden state! If you want them
3424  * shown, use evas_object_show() after their creation.
3425  *
3426  * @see evas_object_show()
3427  * @see evas_object_visible_get()
3428  *
3429  * Example:
3430  * @dontinclude evas-object-manipulation.c
3431  * @skip if (evas_object_visible_get(d.clipper))
3432  * @until return
3433  *
3434  * See the full @ref Example_Evas_Object_Manipulation "example".
3435  *
3436  * @ingroup Evas_Object_Group_Basic
3437  */
3438 EAPI void              evas_object_hide                  (Evas_Object *obj) EINA_ARG_NONNULL(1);
3439
3440 /**
3441  * Retrieves whether or not the given Evas object is visible.
3442  *
3443  * @param   obj The given Evas object.
3444  * @return @c EINA_TRUE if the object is visible, @c EINA_FALSE
3445  * otherwise.
3446  *
3447  * This retrieves an object's visibily as the one enforced by
3448  * evas_object_show() and evas_object_hide().
3449  *
3450  * @note The value returned isn't, by any means, influenced by
3451  * clippers covering @obj, it being out of its canvas' viewport or
3452  * stacked below other object.
3453  *
3454  * @see evas_object_show()
3455  * @see evas_object_hide() (for an example)
3456  *
3457  * @ingroup Evas_Object_Group_Basic
3458  */
3459 EAPI Eina_Bool         evas_object_visible_get           (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
3460
3461
3462 /**
3463  * Sets the general/main color of the given Evas object to the given
3464  * one.
3465  *
3466  * @param obj The given Evas object.
3467  * @param r   The red component of the given color.
3468  * @param g   The green component of the given color.
3469  * @param b   The blue component of the given color.
3470  * @param a   The alpha component of the given color.
3471  *
3472  * @see evas_object_color_get() (for an example)
3473  * @note These color values are expected to be premultiplied by @p a.
3474  *
3475  * @ingroup Evas_Object_Group_Basic
3476  */
3477 EAPI void              evas_object_color_set             (Evas_Object *obj, int r, int g, int b, int a) EINA_ARG_NONNULL(1);
3478
3479 /**
3480  * Retrieves the general/main color of the given Evas object.
3481  *
3482  * @param obj The given Evas object to retrieve color from.
3483  * @param r Pointer to an integer in which to store the red component
3484  *          of the color.
3485  * @param g Pointer to an integer in which to store the green
3486  *          component of the color.
3487  * @param b Pointer to an integer in which to store the blue component
3488  *          of the color.
3489  * @param a Pointer to an integer in which to store the alpha
3490  *          component of the color.
3491  *
3492  * Retrieves the “main” color's RGB component (and alpha channel)
3493  * values, <b>which range from 0 to 255</b>. For the alpha channel,
3494  * which defines the object's transparency level, 0 means totally
3495  * trasparent, while 255 means opaque. These color values are
3496  * premultiplied by the alpha value.
3497  *
3498  * Usually you’ll use this attribute for text and rectangle objects,
3499  * where the “main” color is their unique one. If set for objects
3500  * which themselves have colors, like the images one, those colors get
3501  * modulated by this one.
3502  *
3503  * @note All newly created Evas rectangles get the default color
3504  * values of <code>255 255 255 255</code> (opaque white).
3505  *
3506  * @note Use @c NULL pointers on the components you're not interested
3507  * in: they'll be ignored by the function.
3508  *
3509  * Example:
3510  * @dontinclude evas-object-manipulation.c
3511  * @skip int alpha, r, g, b;
3512  * @until return
3513  *
3514  * See the full @ref Example_Evas_Object_Manipulation "example".
3515  *
3516  * @ingroup Evas_Object_Group_Basic
3517  */
3518 EAPI void              evas_object_color_get             (const Evas_Object *obj, int *r, int *g, int *b, int *a) EINA_ARG_NONNULL(1);
3519
3520
3521 /**
3522  * Retrieves the Evas canvas that the given object lives on.
3523  *
3524  * @param   obj The given Evas object.
3525  * @return  A pointer to the canvas where the object is on.
3526  *
3527  * This function is most useful at code contexts where you need to
3528  * operate on the canvas but have only the object pointer.
3529  *
3530  * @ingroup Evas_Object_Group_Basic
3531  */
3532 EAPI Evas             *evas_object_evas_get              (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
3533
3534 /**
3535  * Retrieves the type of the given Evas object.
3536  *
3537  * @param obj The given object.
3538  * @return The type of the object.
3539  *
3540  * For Evas' builtin types, the return strings will be one of:
3541  *   - <c>"rectangle"</c>,
3542  *   - <c>"line"</c>,
3543  *   - <c>"polygon"</c>,
3544  *   - <c>"text"</c>,
3545  *   - <c>"textblock"</c> and
3546  *   - <c>"image"</c>.
3547  *
3548  * For Evas smart objects (see @ref Evas_Smart_Group), the name of the
3549  * smart class itself is returned on this call. For the built-in smart
3550  * objects, these names are:
3551  *   - <c>"EvasObjectSmartClipped"</c>, for the clipped smart object
3552  *   - <c>"Evas_Object_Box"</c>, for the box object and
3553  *   - <c>"Evas_Object_Table"</c>, for the table object.
3554  *
3555  * Example:
3556  * @dontinclude evas-object-manipulation.c
3557  * @skip d.img = evas_object_image_filled_add(d.canvas);
3558  * @until border on the
3559  *
3560  * See the full @ref Example_Evas_Object_Manipulation "example".
3561  */
3562 EAPI const char       *evas_object_type_get              (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
3563
3564 /**
3565  * Raise @p obj to the top of its layer.
3566  *
3567  * @param obj the object to raise
3568  *
3569  * @p obj will, then, be the highest one in the layer it belongs
3570  * to. Object on other layers won't get touched.
3571  *
3572  * @see evas_object_stack_above()
3573  * @see evas_object_stack_below()
3574  * @see evas_object_lower()
3575  */
3576 EAPI void              evas_object_raise                 (Evas_Object *obj) EINA_ARG_NONNULL(1);
3577
3578 /**
3579  * Lower @p obj to the bottom of its layer.
3580  *
3581  * @param obj the object to lower
3582  *
3583  * @p obj will, then, be the lowest one in the layer it belongs
3584  * to. Objects on other layers won't get touched.
3585  *
3586  * @see evas_object_stack_above()
3587  * @see evas_object_stack_below()
3588  * @see evas_object_raise()
3589  */
3590 EAPI void              evas_object_lower                 (Evas_Object *obj) EINA_ARG_NONNULL(1);
3591
3592 /**
3593  * Stack @p obj immediately above @p above
3594  *
3595  * @param obj the object to stack
3596  * @param above the object above which to stack
3597  *
3598  * Objects, in a given canvas, are stacked in the order they get added
3599  * to it.  This means that, if they overlap, the highest ones will
3600  * cover the lowest ones, in that order. This function is a way to
3601  * change the stacking order for the objects.
3602  *
3603  * This function is intended to be used with <b>objects belonging to
3604  * the same layer</b> in a given canvas, otherwise it will fail (and
3605  * accomplish nothing).
3606  *
3607  * If you have smart objects on your canvas and @p obj is a member of
3608  * one of them, then @p above must also be a member of the same
3609  * smart object.
3610  *
3611  * Similarly, if @p obj is not a member of a smart object, @p above
3612  * must not be either.
3613  *
3614  * @see evas_object_layer_get()
3615  * @see evas_object_layer_set()
3616  * @see evas_object_stack_below()
3617  */
3618 EAPI void              evas_object_stack_above           (Evas_Object *obj, Evas_Object *above) EINA_ARG_NONNULL(1, 2);
3619
3620 /**
3621  * Stack @p obj immediately below @p below
3622  *
3623  * @param obj the object to stack
3624  * @param below the object below which to stack
3625  *
3626  * Objects, in a given canvas, are stacked in the order they get added
3627  * to it.  This means that, if they overlap, the highest ones will
3628  * cover the lowest ones, in that order. This function is a way to
3629  * change the stacking order for the objects.
3630  *
3631  * This function is intended to be used with <b>objects belonging to
3632  * the same layer</b> in a given canvas, otherwise it will fail (and
3633  * accomplish nothing).
3634  *
3635  * If you have smart objects on your canvas and @p obj is a member of
3636  * one of them, then @p below must also be a member of the same
3637  * smart object.
3638  *
3639  * Similarly, if @p obj is not a member of a smart object, @p below
3640  * must not be either.
3641  *
3642  * @see evas_object_layer_get()
3643  * @see evas_object_layer_set()
3644  * @see evas_object_stack_below()
3645  */
3646 EAPI void              evas_object_stack_below           (Evas_Object *obj, Evas_Object *below) EINA_ARG_NONNULL(1, 2);
3647
3648 /**
3649  * Get the Evas object stacked right above @p obj
3650  *
3651  * @param obj an #Evas_Object
3652  * @return the #Evas_Object directly above @p obj, if any, or @c NULL,
3653  * if none
3654  *
3655  * This function will traverse layers in its search, if there are
3656  * objects on layers above the one @p obj is placed at.
3657  *
3658  * @see evas_object_layer_get()
3659  * @see evas_object_layer_set()
3660  * @see evas_object_below_get()
3661  *
3662  */
3663 EAPI Evas_Object      *evas_object_above_get             (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
3664
3665 /**
3666  * Get the Evas object stacked right below @p obj
3667  *
3668  * @param obj an #Evas_Object
3669  * @return the #Evas_Object directly below @p obj, if any, or @c NULL,
3670  * if none
3671  *
3672  * This function will traverse layers in its search, if there are
3673  * objects on layers below the one @p obj is placed at.
3674  *
3675  * @see evas_object_layer_get()
3676  * @see evas_object_layer_set()
3677  * @see evas_object_below_get()
3678  */
3679 EAPI Evas_Object      *evas_object_below_get             (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
3680
3681 /**
3682  * @}
3683  */
3684
3685 /**
3686  * @defgroup Evas_Object_Group_Events Object Events
3687  *
3688  * Objects generate events when they are moved, resized, when their
3689  * visibility change, when they are deleted and so on. These methods
3690  * allow one to be notified about and to handle such events.
3691  *
3692  * Objects also generate events on input (keyboard and mouse), if they
3693  * accept them (are visible, focused, etc).
3694  *
3695  * For each of those events, Evas provides a way for one to register
3696  * callback functions to be issued just after they happen.
3697  *
3698  * The following figure illustrates some Evas (event) callbacks:
3699  *
3700  * @image html evas-callbacks.png
3701  * @image rtf evas-callbacks.png
3702  * @image latex evas-callbacks.eps
3703  *
3704  * Thees events have their values in the #Evas_Callback_Type
3705  * enumeration, which has also ones happening on the canvas level (se
3706  * #Evas_Canvas_Events).
3707  *
3708  * Examples on this group of functions can be found @ref
3709  * Example_Evas_Stacking "here" and @ref Example_Evas_Events "here".
3710  *
3711  * @ingroup Evas_Object_Group
3712  */
3713
3714 /**
3715  * @addtogroup Evas_Object_Group_Events
3716  * @{
3717  */
3718
3719 /**
3720  * Add (register) a callback function to a given Evas object event.
3721  *
3722  * @param obj Object to attach a callback to
3723  * @param type The type of event that will trigger the callback
3724  * @param func The function to be called when the event is triggered
3725  * @param data The data pointer to be passed to @p func
3726  *
3727  * This function adds a function callback to an object when the event
3728  * of type @p type occurs on object @p obj. The function is @p func.
3729  *
3730  * In the event of a memory allocation error during addition of the
3731  * callback to the object, evas_alloc_error() should be used to
3732  * determine the nature of the error, if any, and the program should
3733  * sensibly try and recover.
3734  *
3735  * A callback function must have the ::Evas_Object_Event_Cb prototype
3736  * definition. The first parameter (@p data) in this definition will
3737  * have the same value passed to evas_object_event_callback_add() as
3738  * the @p data parameter, at runtime. The second parameter @p e is the
3739  * canvas pointer on which the event occurred. The third parameter is
3740  * a pointer to the object on which event occurred. Finally, the
3741  * fourth parameter @p event_info is a pointer to a data structure
3742  * that may or may not be passed to the callback, depending on the
3743  * event type that triggered the callback. This is so because some
3744  * events don't carry extra context with them, but others do.
3745  *
3746  * The event type @p type to trigger the function may be one of
3747  * #EVAS_CALLBACK_MOUSE_IN, #EVAS_CALLBACK_MOUSE_OUT,
3748  * #EVAS_CALLBACK_MOUSE_DOWN, #EVAS_CALLBACK_MOUSE_UP,
3749  * #EVAS_CALLBACK_MOUSE_MOVE, #EVAS_CALLBACK_MOUSE_WHEEL,
3750  * #EVAS_CALLBACK_MULTI_DOWN, #EVAS_CALLBACK_MULTI_UP,
3751  * #EVAS_CALLBACK_MULTI_MOVE, #EVAS_CALLBACK_FREE,
3752  * #EVAS_CALLBACK_KEY_DOWN, #EVAS_CALLBACK_KEY_UP,
3753  * #EVAS_CALLBACK_FOCUS_IN, #EVAS_CALLBACK_FOCUS_OUT,
3754  * #EVAS_CALLBACK_SHOW, #EVAS_CALLBACK_HIDE, #EVAS_CALLBACK_MOVE,
3755  * #EVAS_CALLBACK_RESIZE, #EVAS_CALLBACK_RESTACK, #EVAS_CALLBACK_DEL,
3756  * #EVAS_CALLBACK_HOLD, #EVAS_CALLBACK_CHANGED_SIZE_HINTS,
3757  * #EVAS_CALLBACK_IMAGE_PRELOADED or #EVAS_CALLBACK_IMAGE_UNLOADED.
3758  *
3759  * This determines the kind of event that will trigger the callback.
3760  * What follows is a list explaining better the nature of each type of
3761  * event, along with their associated @p event_info pointers:
3762  *
3763  * - #EVAS_CALLBACK_MOUSE_IN: @p event_info is a pointer to an
3764  *   #Evas_Event_Mouse_In struct\n\n
3765  *   This event is triggered when the mouse pointer enters the area
3766  *   (not shaded by other objects) of the object @p obj. This may
3767  *   occur by the mouse pointer being moved by
3768  *   evas_event_feed_mouse_move() calls, or by the object being shown,
3769  *   raised, moved, resized, or other objects being moved out of the
3770  *   way, hidden or lowered, whatever may cause the mouse pointer to
3771  *   get on top of @p obj, having been on top of another object
3772  *   previously.
3773  *
3774  * - #EVAS_CALLBACK_MOUSE_OUT: @p event_info is a pointer to an
3775  *   #Evas_Event_Mouse_Out struct\n\n
3776  *   This event is triggered exactly like #EVAS_CALLBACK_MOUSE_IN is,
3777  *   but it occurs when the mouse pointer exits an object's area. Note
3778  *   that no mouse out events will be reported if the mouse pointer is
3779  *   implicitly grabbed to an object (mouse buttons are down, having
3780  *   been pressed while the pointer was over that object). In these
3781  *   cases, mouse out events will be reported once all buttons are
3782  *   released, if the mouse pointer has left the object's area. The
3783  *   indirect ways of taking off the mouse pointer from an object,
3784  *   like cited above, for #EVAS_CALLBACK_MOUSE_IN, also apply here,
3785  *   naturally.
3786  *
3787  * - #EVAS_CALLBACK_MOUSE_DOWN: @p event_info is a pointer to an
3788  *   #Evas_Event_Mouse_Down struct\n\n
3789  *   This event is triggered by a mouse button being pressed while the
3790  *   mouse pointer is over an object. If the pointer mode for Evas is
3791  *   #EVAS_OBJECT_POINTER_MODE_AUTOGRAB (default), this causes this
3792  *   object to <b>passively grab the mouse</b> until all mouse buttons
3793  *   have been released: all future mouse events will be reported to
3794  *   only this object until no buttons are down. That includes mouse
3795  *   move events, mouse in and mouse out events, and further button
3796  *   presses. When all buttons are released, event propagation will
3797  *   occur as normal (see #Evas_Object_Pointer_Mode).
3798  *
3799  * - #EVAS_CALLBACK_MOUSE_UP: @p event_info is a pointer to an
3800  *   #Evas_Event_Mouse_Up struct\n\n
3801  *   This event is triggered by a mouse button being released while
3802  *   the mouse pointer is over an object's area (or when passively
3803  *   grabbed to an object).
3804  *
3805  * - #EVAS_CALLBACK_MOUSE_MOVE: @p event_info is a pointer to an
3806  *   #Evas_Event_Mouse_Move struct\n\n
3807  *   This event is triggered by the mouse pointer being moved while
3808  *   over an object's area (or while passively grabbed to an object).
3809  *
3810  * - #EVAS_CALLBACK_MOUSE_WHEEL: @p event_info is a pointer to an
3811  *   #Evas_Event_Mouse_Wheel struct\n\n
3812  *   This event is triggered by the mouse wheel being rolled while the
3813  *   mouse pointer is over an object (or passively grabbed to an
3814  *   object).
3815  *
3816  * - #EVAS_CALLBACK_MULTI_DOWN: @p event_info is a pointer to an
3817  *   #Evas_Event_Multi_Down struct
3818  *
3819  * - #EVAS_CALLBACK_MULTI_UP: @p event_info is a pointer to an
3820  *   #Evas_Event_Multi_Up struct
3821  *
3822  * - #EVAS_CALLBACK_MULTI_MOVE: @p event_info is a pointer to an
3823  *   #Evas_Event_Multi_Move struct
3824  *
3825  * - #EVAS_CALLBACK_FREE: @p event_info is @c NULL \n\n
3826  *   This event is triggered just before Evas is about to free all
3827  *   memory used by an object and remove all references to it. This is
3828  *   useful for programs to use if they attached data to an object and
3829  *   want to free it when the object is deleted. The object is still
3830  *   valid when this callback is called, but after it returns, there
3831  *   is no guarantee on the object's validity.
3832  *
3833  * - #EVAS_CALLBACK_KEY_DOWN: @p event_info is a pointer to an
3834  *   #Evas_Event_Key_Down struct\n\n
3835  *   This callback is called when a key is pressed and the focus is on
3836  *   the object, or a key has been grabbed to a particular object
3837  *   which wants to intercept the key press regardless of what object
3838  *   has the focus.
3839  *
3840  * - #EVAS_CALLBACK_KEY_UP: @p event_info is a pointer to an
3841  *   #Evas_Event_Key_Up struct \n\n
3842  *   This callback is called when a key is released and the focus is
3843  *   on the object, or a key has been grabbed to a particular object
3844  *   which wants to intercept the key release regardless of what
3845  *   object has the focus.
3846  *
3847  * - #EVAS_CALLBACK_FOCUS_IN: @p event_info is @c NULL \n\n
3848  *   This event is called when an object gains the focus. When it is
3849  *   called the object has already gained the focus.
3850  *
3851  * - #EVAS_CALLBACK_FOCUS_OUT: @p event_info is @c NULL \n\n
3852  *   This event is triggered when an object loses the focus. When it
3853  *   is called the object has already lost the focus.
3854  *
3855  * - #EVAS_CALLBACK_SHOW: @p event_info is @c NULL \n\n
3856  *   This event is triggered by the object being shown by
3857  *   evas_object_show().
3858  *
3859  * - #EVAS_CALLBACK_HIDE: @p event_info is @c NULL \n\n
3860  *   This event is triggered by an object being hidden by
3861  *   evas_object_hide().
3862  *
3863  * - #EVAS_CALLBACK_MOVE: @p event_info is @c NULL \n\n
3864  *   This event is triggered by an object being
3865  *   moved. evas_object_move() can trigger this, as can any
3866  *   object-specific manipulations that would mean the object's origin
3867  *   could move.
3868  *
3869  * - #EVAS_CALLBACK_RESIZE: @p event_info is @c NULL \n\n
3870  *   This event is triggered by an object being resized. Resizes can
3871  *   be triggered by evas_object_resize() or by any object-specific
3872  *   calls that may cause the object to resize.
3873  *
3874  * - #EVAS_CALLBACK_RESTACK: @p event_info is @c NULL \n\n
3875  *   This event is triggered by an object being re-stacked. Stacking
3876  *   changes can be triggered by
3877  *   evas_object_stack_below()/evas_object_stack_above() and others.
3878  *
3879  * - #EVAS_CALLBACK_DEL: @p event_info is @c NULL.
3880  *
3881  * - #EVAS_CALLBACK_HOLD: @p event_info is a pointer to an
3882  *   #Evas_Event_Hold struct
3883  *
3884  * - #EVAS_CALLBACK_CHANGED_SIZE_HINTS: @p event_info is @c NULL.
3885  *
3886  * - #EVAS_CALLBACK_IMAGE_PRELOADED: @p event_info is @c NULL.
3887  *
3888  * - #EVAS_CALLBACK_IMAGE_UNLOADED: @p event_info is @c NULL.
3889  *
3890  * @note Be careful not to add the same callback multiple times, if
3891  * that's not what you want, because Evas won't check if a callback
3892  * existed before exactly as the one being registered (and thus, call
3893  * it more than once on the event, in this case). This would make
3894  * sense if you passed different functions and/or callback data, only.
3895  *
3896  * Example:
3897  * @dontinclude evas-events.c
3898  * @skip evas_object_event_callback_add(
3899  * @until }
3900  *
3901  * See the full example @ref Example_Evas_Events "here".
3902  *
3903  */
3904    EAPI void              evas_object_event_callback_add     (Evas_Object *obj, Evas_Callback_Type type, Evas_Object_Event_Cb func, const void *data) EINA_ARG_NONNULL(1, 3);
3905
3906 /**
3907  * Add (register) a callback function to a given Evas object event with a
3908  * non-default priority set. Except for the priority field, it's exactly the
3909  * same as @ref evas_object_event_callback_add
3910  *
3911  * @param obj Object to attach a callback to
3912  * @param type The type of event that will trigger the callback
3913  * @param priority The priority of the callback, lower values called first.
3914  * @param func The function to be called when the event is triggered
3915  * @param data The data pointer to be passed to @p func
3916  *
3917  * @see evas_object_event_callback_add
3918  * @since 1.1.0
3919  */
3920 EAPI void                 evas_object_event_callback_priority_add(Evas_Object *obj, Evas_Callback_Type type, Evas_Callback_Priority priority, Evas_Object_Event_Cb func, const void *data) EINA_ARG_NONNULL(1, 4);
3921
3922 /**
3923  * Delete a callback function from an object
3924  *
3925  * @param obj Object to remove a callback from
3926  * @param type The type of event that was triggering the callback
3927  * @param func The function that was to be called when the event was triggered
3928  * @return The data pointer that was to be passed to the callback
3929  *
3930  * This function removes the most recently added callback from the
3931  * object @p obj which was triggered by the event type @p type and was
3932  * calling the function @p func when triggered. If the removal is
3933  * successful it will also return the data pointer that was passed to
3934  * evas_object_event_callback_add() when the callback was added to the
3935  * object. If not successful NULL will be returned.
3936  *
3937  * Example:
3938  * @code
3939  * extern Evas_Object *object;
3940  * void *my_data;
3941  * void up_callback(void *data, Evas *e, Evas_Object *obj, void *event_info);
3942  *
3943  * my_data = evas_object_event_callback_del(object, EVAS_CALLBACK_MOUSE_UP, up_callback);
3944  * @endcode
3945  */
3946 EAPI void             *evas_object_event_callback_del     (Evas_Object *obj, Evas_Callback_Type type, Evas_Object_Event_Cb func) EINA_ARG_NONNULL(1, 3);
3947
3948 /**
3949  * Delete (unregister) a callback function registered to a given
3950  * Evas object event.
3951  *
3952  * @param obj Object to remove a callback from
3953  * @param type The type of event that was triggering the callback
3954  * @param func The function that was to be called when the event was
3955  * triggered
3956  * @param data The data pointer that was to be passed to the callback
3957  * @return The data pointer that was to be passed to the callback
3958  *
3959  * This function removes the most recently added callback from the
3960  * object @p obj, which was triggered by the event type @p type and was
3961  * calling the function @p func with data @p data, when triggered. If
3962  * the removal is successful it will also return the data pointer that
3963  * was passed to evas_object_event_callback_add() (that will be the
3964  * same as the parameter) when the callback was added to the
3965  * object. In errors, @c NULL will be returned.
3966  *
3967  * @note For deletion of Evas object events callbacks filtering by
3968  * just type and function pointer, user
3969  * evas_object_event_callback_del().
3970  *
3971  * Example:
3972  * @code
3973  * extern Evas_Object *object;
3974  * void *my_data;
3975  * void up_callback(void *data, Evas *e, Evas_Object *obj, void *event_info);
3976  *
3977  * my_data = evas_object_event_callback_del_full(object, EVAS_CALLBACK_MOUSE_UP, up_callback, data);
3978  * @endcode
3979  */
3980 EAPI void             *evas_object_event_callback_del_full(Evas_Object *obj, Evas_Callback_Type type, Evas_Object_Event_Cb func, const void *data) EINA_ARG_NONNULL(1, 3);
3981
3982
3983 /**
3984  * Set whether an Evas object is to pass (ignore) events.
3985  *
3986  * @param obj the Evas object to operate on
3987  * @param pass whether @p obj is to pass events (@c EINA_TRUE) or not
3988  * (@c EINA_FALSE)
3989  *
3990  * If @p pass is @c EINA_TRUE, it will make events on @p obj to be @b
3991  * ignored. They will be triggered on the @b next lower object (that
3992  * is not set to pass events), instead (see evas_object_below_get()).
3993  *
3994  * If @p pass is @c EINA_FALSE, events will be processed on that
3995  * object as normal.
3996  *
3997  * @see evas_object_pass_events_get() for an example
3998  * @see evas_object_repeat_events_set()
3999  * @see evas_object_propagate_events_set()
4000  * @see evas_object_freeze_events_set()
4001  */
4002 EAPI void              evas_object_pass_events_set        (Evas_Object *obj, Eina_Bool pass) EINA_ARG_NONNULL(1);
4003
4004 /**
4005  * Determine whether an object is set to pass (ignore) events.
4006  *
4007  * @param obj the Evas object to get information from.
4008  * @return pass whether @p obj is set to pass events (@c EINA_TRUE) or not
4009  * (@c EINA_FALSE)
4010  *
4011  * Example:
4012  * @dontinclude evas-stacking.c
4013  * @skip if (strcmp(ev->keyname, "p") == 0)
4014  * @until }
4015  *
4016  * See the full @ref Example_Evas_Stacking "example".
4017  *
4018  * @see evas_object_pass_events_set()
4019  * @see evas_object_repeat_events_get()
4020  * @see evas_object_propagate_events_get()
4021  * @see evas_object_freeze_events_get()
4022  */
4023 EAPI Eina_Bool         evas_object_pass_events_get        (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
4024
4025 /**
4026  * Set whether an Evas object is to repeat events.
4027  *
4028  * @param obj the Evas object to operate on
4029  * @param repeat whether @p obj is to repeat events (@c EINA_TRUE) or not
4030  * (@c EINA_FALSE)
4031  *
4032  * If @p repeat is @c EINA_TRUE, it will make events on @p obj to also
4033  * be repeated for the @b next lower object in the objects' stack (see
4034  * see evas_object_below_get()).
4035  *
4036  * If @p repeat is @c EINA_FALSE, events occurring on @p obj will be
4037  * processed only on it.
4038  *
4039  * Example:
4040  * @dontinclude evas-stacking.c
4041  * @skip if (strcmp(ev->keyname, "r") == 0)
4042  * @until }
4043  *
4044  * See the full @ref Example_Evas_Stacking "example".
4045  *
4046  * @see evas_object_repeat_events_get()
4047  * @see evas_object_pass_events_set()
4048  * @see evas_object_propagate_events_set()
4049  * @see evas_object_freeze_events_set()
4050  */
4051 EAPI void              evas_object_repeat_events_set      (Evas_Object *obj, Eina_Bool repeat) EINA_ARG_NONNULL(1);
4052
4053 /**
4054  * Determine whether an object is set to repeat events.
4055  *
4056  * @param obj the given Evas object pointer
4057  * @retrieve whether @p obj is set to repeat events (@c EINA_TRUE)
4058  * or not (@c EINA_FALSE)
4059  *
4060  * @see evas_object_repeat_events_set() for an example
4061  * @see evas_object_pass_events_get()
4062  * @see evas_object_propagate_events_get()
4063  * @see evas_object_freeze_events_get()
4064  */
4065 EAPI Eina_Bool         evas_object_repeat_events_get      (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
4066
4067 /**
4068  * Set whether events on a smart object's member should get propagated
4069  * up to its parent.
4070  *
4071  * @param obj the smart object's child to operate on
4072  * @param prop whether to propagate events (@c EINA_TRUE) or not (@c
4073  * EINA_FALSE)
4074  *
4075  * This function has @b no effect if @p obj is not a member of a smart
4076  * object.
4077  *
4078  * If @p prop is @c EINA_TRUE, events occurring on this object will be
4079  * propagated on to the smart object of which @p obj is a member.  If
4080  * @p prop is @c EINA_FALSE, events occurring on this object will @b
4081  * not be propagated on to the smart object of which @p obj is a
4082  * member.  The default value is @c EINA_TRUE.
4083  *
4084  * @see evas_object_propagate_events_get()
4085  * @see evas_object_repeat_events_set()
4086  * @see evas_object_pass_events_set()
4087  * @see evas_object_freeze_events_set()
4088  */
4089 EAPI void              evas_object_propagate_events_set   (Evas_Object *obj, Eina_Bool prop) EINA_ARG_NONNULL(1);
4090
4091 /**
4092  * Retrieve whether an Evas object is set to propagate events.
4093  *
4094  * @param obj the given Evas object pointer
4095  * @return whether @p obj is set to propagate events (@c EINA_TRUE)
4096  * or not (@c EINA_FALSE)
4097  *
4098  * @see evas_object_propagate_events_set()
4099  * @see evas_object_repeat_events_get()
4100  * @see evas_object_pass_events_get()
4101  * @see evas_object_freeze_events_get()
4102  */
4103 EAPI Eina_Bool         evas_object_propagate_events_get   (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
4104
4105 /**
4106  * Set whether an Evas object is to freeze (discard) events.
4107  *
4108  * @param obj the Evas object to operate on
4109  * @param pass whether @p obj is to freeze events (@c EINA_TRUE) or not
4110  * (@c EINA_FALSE)
4111  *
4112  * If @p freeze is @c EINA_TRUE, it will make events on @p obj to be @b
4113  * discarded. Unlike evas_object_pass_events_set(), events will not be
4114  * passed to @b next lower object. This API can be used for blocking 
4115  * events while @p obj is on transiting. 
4116  *
4117  * If @p freeze is @c EINA_FALSE, events will be processed on that
4118  * object as normal.
4119  *
4120  * @see evas_object_freeze_events_get()
4121  * @see evas_object_pass_events_set()
4122  * @see evas_object_repeat_events_set()
4123  * @see evas_object_propagate_events_set()
4124  * @since 1.1.0
4125  */
4126 EAPI void              evas_object_freeze_events_set(Evas_Object *obj, Eina_Bool freeze) EINA_ARG_NONNULL(1);
4127
4128 /**
4129  * Determine whether an object is set to freeze (discard) events.
4130  *
4131  * @param obj the Evas object to get information from.
4132  * @return freeze whether @p obj is set to freeze events (@c EINA_TRUE) or
4133  * not (@c EINA_FALSE)
4134  *
4135  * @see evas_object_freeze_events_set()
4136  * @see evas_object_pass_events_get()
4137  * @see evas_object_repeat_events_get()
4138  * @see evas_object_propagate_events_get()
4139  * @since 1.1.0
4140  */
4141 EAPI Eina_Bool         evas_object_freeze_events_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
4142
4143 /**
4144  * @}
4145  */
4146
4147 /**
4148  * @defgroup Evas_Object_Group_Map UV Mapping (Rotation, Perspective, 3D...)
4149  *
4150  * Evas allows different transformations to be applied to all kinds of
4151  * objects. These are applied by means of UV mapping.
4152  *
4153  * With UV mapping, one maps points in the source object to a 3D space
4154  * positioning at target. This allows rotation, perspective, scale and
4155  * lots of other effects, depending on the map that is used.
4156  *
4157  * Each map point may carry a multiplier color. If properly
4158  * calculated, these can do shading effects on the object, producing
4159  * 3D effects.
4160  *
4161  * As usual, Evas provides both the raw and easy to use methods. The
4162  * raw methods allow developer to create its maps somewhere else,
4163  * maybe load them from some file format. The easy to use methods,
4164  * calculate the points given some high-level parameters, such as
4165  * rotation angle, ambient light and so on.
4166  *
4167  * @note applying mapping will reduce performance, so use with
4168  *       care. The impact on performance depends on engine in
4169  *       use. Software is quite optimized, but not as fast as OpenGL.
4170  *
4171  * @section sec-map-points Map points
4172  * @subsection subsec-rotation Rotation
4173  *
4174  * A map consists of a set of points, currently only four are supported. Each
4175  * of these points contains a set of canvas coordinates @c x and @c y that
4176  * can be used to alter the geometry of the mapped object, and a @c z
4177  * coordinate that indicates the depth of that point. This last coordinate
4178  * does not normally affect the map, but it's used by several of the utility
4179  * functions to calculate the right position of the point given other
4180  * parameters.
4181  *
4182  * The coordinates for each point are set with evas_map_point_coord_set().
4183  * The following image shows a map set to match the geometry of an existing
4184  * object.
4185  *
4186  * @image html map-set-map-points-1.png
4187  * @image rtf map-set-map-points-1.png
4188  * @image latex map-set-map-points-1.eps
4189  *
4190  * This is a common practice, so there are a few functions that help make it
4191  * easier.
4192  *
4193  * evas_map_util_points_populate_from_geometry() sets the coordinates of each
4194  * point in the given map to match the rectangle defined by the function
4195  * parameters.
4196  *
4197  * evas_map_util_points_populate_from_object() and
4198  * evas_map_util_points_populate_from_object_full() both take an object and
4199  * set the map points to match its geometry. The difference between the two
4200  * is that the first function sets the @c z value of all points to 0, while
4201  * the latter receives the value to set in said coordinate as a parameter.
4202  *
4203  * The following lines of code all produce the same result as in the image
4204  * above.
4205  * @code
4206  * evas_map_util_points_populate_from_geometry(m, 100, 100, 200, 200, 0);
4207  * // Assuming o is our original object
4208  * evas_object_move(o, 100, 100);
4209  * evas_object_resize(o, 200, 200);
4210  * evas_map_util_points_populate_from_object(m, o);
4211  * evas_map_util_points_populate_from_object_full(m, o, 0);
4212  * @endcode
4213  *
4214  * Several effects can be applied to an object by simply setting each point
4215  * of the map to the right coordinates. For example, a simulated perspective
4216  * could be achieve as follows.
4217  *
4218  * @image html map-set-map-points-2.png
4219  * @image rtf map-set-map-points-2.png
4220  * @image latex map-set-map-points-2.eps
4221  *
4222  * As said before, the @c z coordinate is unused here so when setting points
4223  * by hand, its value is of no importance.
4224  *
4225  * @image html map-set-map-points-3.png
4226  * @image rtf map-set-map-points-3.png
4227  * @image latex map-set-map-points-3.eps
4228  *
4229  * In all three cases above, setting the map to be used by the object is the
4230  * same.
4231  * @code
4232  * evas_object_map_set(o, m);
4233  * evas_object_map_enable_set(o, EINA_TRUE);
4234  * @endcode
4235  *
4236  * Doing things this way, however, is a lot of work that can be avoided by
4237  * using the provided utility functions, as described in the next section.
4238  *
4239  * @section map-utils Utility functions
4240  *
4241  * Utility functions take an already set up map and alter it to produce a
4242  * specific effect. For example, to rotate an object around its own center
4243  * you would need to take the rotation angle, the coordinates of each corner
4244  * of the object and do all the math to get the new set of coordinates that
4245  * need to tbe set in the map.
4246  *
4247  * Or you can use this code:
4248  * @code
4249  * evas_object_geometry_get(o, &x, &y, &w, &h);
4250  * m = evas_map_new(4);
4251  * evas_map_util_points_populate_from_object(m, o);
4252  * evas_map_util_rotate(m, 45, x + (w / 2), y + (h / 2));
4253  * evas_object_map_set(o, m);
4254  * evas_object_map_enable_set(o, EINA_TRUE);
4255  * evas_map_free(m);
4256  * @endcode
4257  *
4258  * Which will rotate the object around its center point in a 45 degree angle
4259  * in the clockwise direction, taking it from this
4260  *
4261  * @image html map-rotation-2d-1.png
4262  * @image rtf map-rotation-2d-1.png
4263  * @image latex map-rotation-2d-1.eps
4264  *
4265  * to this
4266  *
4267  * @image html map-rotation-2d-2.png
4268  * @image rtf map-rotation-2d-2.png
4269  * @image latex map-rotation-2d-2.eps
4270  *
4271  * Objects may be rotated around any other point just by setting the last two
4272  * paramaters of the evas_map_util_rotate() function to the right values. A
4273  * circle of roughly the diameter of the object overlaid on each image shows
4274  * where the center of rotation is set for each example.
4275  *
4276  * For example, this code
4277  * @code
4278  * evas_object_geometry_get(o, &x, &y, &w, &h);
4279  * m = evas_map_new(4);
4280  * evas_map_util_points_populate_from_object(m, o);
4281  * evas_map_util_rotate(m, 45, x + w - 20, y + h - 20);
4282  * evas_object_map_set(o, m);
4283  * evas_object_map_enable_set(o, EINA_TRUE);
4284  * evas_map_free(m);
4285  * @endcode
4286  *
4287  * produces something like
4288  *
4289  * @image html map-rotation-2d-3.png
4290  * @image rtf map-rotation-2d-3.png
4291  * @image latex map-rotation-2d-3.eps
4292  *
4293  * And the following
4294  * @code
4295  * evas_output_size_get(evas, &w, &h);
4296  * m = evas_map_new(4);
4297  * evas_map_util_points_populate_from_object(m, o);
4298  * evas_map_util_rotate(m, 45, w, h);
4299  * evas_object_map_set(o, m);
4300  * evas_object_map_enable_set(o, EINA_TRUE);
4301  * evas_map_free(m);
4302  * @endcode
4303  *
4304  * rotates the object around the center of the window
4305  *
4306  * @image html map-rotation-2d-4.png
4307  * @image rtf map-rotation-2d-4.png
4308  * @image latex map-rotation-2d-4.eps
4309  *
4310  * @subsection subsec-3d 3D Maps
4311  *
4312  * Maps can also be used to achieve the effect of 3-dimensionality. When doing
4313  * this, the @c z coordinate of each point counts, with higher values meaning
4314  * the point is further into the screen, and smaller values (negative, usually)
4315  * meaning the point is closwer towards the user.
4316  *
4317  * Thinking in 3D also introduces the concept of back-face of an object. An
4318  * object is said to be facing the user when all its points are placed in a
4319  * clockwise fashion. The next image shows this, with each point showing the
4320  * with which is identified within the map.
4321  *
4322  * @image html map-point-order-face.png
4323  * @image rtf map-point-order-face.png
4324  * @image latex map-point-order-face.eps
4325  *
4326  * Rotating this map around the @c Y axis would leave the order of the points
4327  * in a counter-clockwise fashion, as seen in the following image.
4328  *
4329  * @image html map-point-order-back.png
4330  * @image rtf map-point-order-back.png
4331  * @image latex map-point-order-back.eps
4332  *
4333  * This way we can say that we are looking at the back face of the object.
4334  * This will have stronger implications later when we talk about lighting.
4335  *
4336  * To know if a map is facing towards the user or not it's enough to use
4337  * the evas_map_util_clockwise_get() function, but this is normally done
4338  * after all the other operations are applied on the map.
4339  *
4340  * @subsection subsec-3d-rot 3D rotation and perspective
4341  *
4342  * Much like evas_map_util_rotate(), there's the function
4343  * evas_map_util_3d_rotate() that transforms the map to apply a 3D rotation
4344  * to an object. As in its 2D counterpart, the rotation can be applied around
4345  * any point in the canvas, this time with a @c z coordinate too. The rotation
4346  * can also be around any of the 3 axis.
4347  *
4348  * Starting from this simple setup
4349  *
4350  * @image html map-3d-basic-1.png
4351  * @image rtf map-3d-basic-1.png
4352  * @image latex map-3d-basic-1.eps
4353  *
4354  * and setting maps so that the blue square to rotate on all axis around a
4355  * sphere that uses the object as its center, and the red square to rotate
4356  * around the @c Y axis, we get the following. A simple overlay over the image
4357  * shows the original geometry of each object and the axis around which they
4358  * are being rotated, with the @c Z one not appearing due to being orthogonal
4359  * to the screen.
4360  *
4361  * @image html map-3d-basic-2.png
4362  * @image rtf map-3d-basic-2.png
4363  * @image latex map-3d-basic-2.eps
4364  *
4365  * which doesn't look very real. This can be helped by adding perspective
4366  * to the transformation, which can be simply done by calling
4367  * evas_map_util_3d_perspective() on the map after its position has been set.
4368  * The result in this case, making the vanishing point the center of each
4369  * object:
4370  *
4371  * @image html map-3d-basic-3.png
4372  * @image rtf map-3d-basic-3.png
4373  * @image latex map-3d-basic-3.eps
4374  *
4375  * @section sec-color Color and lighting
4376  *
4377  * Each point in a map can be set to a color, which will be multiplied with
4378  * the objects own color and linearly interpolated in between adjacent points.
4379  * This is done with evas_map_point_color_set() for each point of the map,
4380  * or evas_map_util_points_color_set() to set every point to the same color.
4381  *
4382  * When using 3D effects, colors can be used to improve the looks of them by
4383  * simulating a light source. The evas_map_util_3d_lighting() function makes
4384  * this task easier by taking the coordinates of the light source and its
4385  * color, along with the color of the ambient light. Evas then sets the color
4386  * of each point based on the distance to the light source, the angle with
4387  * which the object is facing the light and the ambient light. Here, the
4388  * orientation of each point as explained before, becomes more important.
4389  * If the map is defined counter-clockwise, the object will be facing away
4390  * from the user and thus become obscured, since no light would be reflecting
4391  * from it.
4392  *
4393  * @image html map-light.png
4394  * @image rtf map-light.png
4395  * @image latex map-light.eps
4396  * @note Object facing the light source
4397  *
4398  * @image html map-light2.png
4399  * @image rtf map-light2.png
4400  * @image latex map-light2.eps
4401  * @note Same object facing away from the user
4402  *
4403  * @section Image mapping
4404  *
4405  * @image html map-uv-mapping-1.png
4406  * @image rtf map-uv-mapping-1.png
4407  * @image latex map-uv-mapping-1.eps
4408  *
4409  * Images need some special handlign when mapped. Evas can easily take care
4410  * of objects and do almost anything with them, but it's completely oblivious
4411  * to the content of images, so each point in the map needs to be told to what
4412  * pixel in the source image it belongs. Failing to do may sometimes result
4413  * in the expected behavior, or it may look like a partial work.
4414  *
4415  * The next image illustrates one possibility of a map being set to an image
4416  * object, without setting the right UV mapping for each point. The objects
4417  * themselves are mapped properly to their new geometry, but the image content
4418  * may not be displayed correctly within the mapped object.
4419  *
4420  * @image html map-uv-mapping-2.png
4421  * @image rtf map-uv-mapping-2.png
4422  * @image latex map-uv-mapping-2.eps
4423  *
4424  * Once Evas knows how to handle the source image within the map, it will
4425  * transform it as needed. This is done with evas_map_point_image_uv_set(),
4426  * which tells the map to which pixel in image it maps.
4427  *
4428  * To match our example images to the maps above all we need is the size of
4429  * each image, which can always be found with evas_object_image_size_get().
4430  *
4431  * @code
4432  * evas_map_point_image_uv_set(m, 0, 0, 0);
4433  * evas_map_point_image_uv_set(m, 1, 150, 0);
4434  * evas_map_point_image_uv_set(m, 2, 150, 200);
4435  * evas_map_point_image_uv_set(m, 3, 0, 200);
4436  * evas_object_map_set(o, m);
4437  * evas_object_map_enable_set(o, EINA_TRUE);
4438  *
4439  * evas_map_point_image_uv_set(m, 0, 0, 0);
4440  * evas_map_point_image_uv_set(m, 1, 120, 0);
4441  * evas_map_point_image_uv_set(m, 2, 120, 160);
4442  * evas_map_point_image_uv_set(m, 3, 0, 160);
4443  * evas_object_map_set(o2, m);
4444  * evas_object_map_enable_set(o2, EINA_TRUE);
4445  * @endcode
4446  *
4447  * To get
4448  *
4449  * @image html map-uv-mapping-3.png
4450  * @image rtf map-uv-mapping-3.png
4451  * @image latex map-uv-mapping-3.eps
4452  *
4453  * Maps can also be set to use part of an image only, or even map them inverted,
4454  * and combined with evas_object_image_source_set() it can be used to achieve
4455  * more interesting results.
4456  *
4457  * @code
4458  * evas_object_image_size_get(evas_object_image_source_get(o), &w, &h);
4459  * evas_map_point_image_uv_set(m, 0, 0, h);
4460  * evas_map_point_image_uv_set(m, 1, w, h);
4461  * evas_map_point_image_uv_set(m, 2, w, h / 3);
4462  * evas_map_point_image_uv_set(m, 3, 0, h / 3);
4463  * evas_object_map_set(o, m);
4464  * evas_object_map_enable_set(o, EINA_TRUE);
4465  * @endcode
4466  *
4467  * @image html map-uv-mapping-4.png
4468  * @image rtf map-uv-mapping-4.png
4469  * @image latex map-uv-mapping-4.eps
4470  *
4471  * Examples:
4472  * @li @ref Example_Evas_Map_Overview
4473  *
4474  * @ingroup Evas_Object_Group
4475  *
4476  * @{
4477  */
4478
4479 /**
4480  * Enable or disable the map that is set.
4481  *
4482  * Enable or disable the use of map for the object @p obj.
4483  * On enable, the object geometry will be saved, and the new geometry will
4484  * change (position and size) to reflect the map geometry set.
4485  *
4486  * If the object doesn't have a map set (with evas_object_map_set()), the
4487  * initial geometry will be undefined. It is advised to always set a map
4488  * to the object first, and then call this function to enable its use.
4489  *
4490  * @param obj object to enable the map on
4491  * @param enabled enabled state
4492  */
4493 EAPI void              evas_object_map_enable_set        (Evas_Object *obj, Eina_Bool enabled);
4494
4495 /**
4496  * Get the map enabled state
4497  *
4498  * This returns the currently enabled state of the map on the object indicated.
4499  * The default map enable state is off. You can enable and disable it with
4500  * evas_object_map_enable_set().
4501  *
4502  * @param obj object to get the map enabled state from
4503  * @return the map enabled state
4504  */
4505 EAPI Eina_Bool         evas_object_map_enable_get        (const Evas_Object *obj);
4506
4507 /**
4508  * Set the map source object
4509  *
4510  * This sets the object from which the map is taken - can be any object that
4511  * has map enabled on it.
4512  *
4513  * Currently not implemented. for future use.
4514  *
4515  * @param obj object to set the map source of
4516  * @param src the source object from which the map is taken
4517  */
4518 EAPI void              evas_object_map_source_set        (Evas_Object *obj, Evas_Object *src);
4519
4520 /**
4521  * Get the map source object
4522  *
4523  * @param obj object to set the map source of
4524  * @return the object set as the source
4525  *
4526  * @see evas_object_map_source_set()
4527  */
4528 EAPI Evas_Object      *evas_object_map_source_get        (const Evas_Object *obj);
4529
4530 /**
4531  * Set current object transformation map.
4532  *
4533  * This sets the map on a given object. It is copied from the @p map pointer,
4534  * so there is no need to keep the @p map object if you don't need it anymore.
4535  *
4536  * A map is a set of 4 points which have canvas x, y coordinates per point,
4537  * with an optional z point value as a hint for perspective correction, if it
4538  * is available. As well each point has u and v coordinates. These are like
4539  * "texture coordinates" in OpenGL in that they define a point in the source
4540  * image that is mapped to that map vertex/point. The u corresponds to the x
4541  * coordinate of this mapped point and v, the y coordinate. Note that these
4542  * coordinates describe a bounding region to sample. If you have a 200x100
4543  * source image and want to display it at 200x100 with proper pixel
4544  * precision, then do:
4545  *
4546  * @code
4547  * Evas_Map *m = evas_map_new(4);
4548  * evas_map_point_coord_set(m, 0,   0,   0, 0);
4549  * evas_map_point_coord_set(m, 1, 200,   0, 0);
4550  * evas_map_point_coord_set(m, 2, 200, 100, 0);
4551  * evas_map_point_coord_set(m, 3,   0, 100, 0);
4552  * evas_map_point_image_uv_set(m, 0,   0,   0);
4553  * evas_map_point_image_uv_set(m, 1, 200,   0);
4554  * evas_map_point_image_uv_set(m, 2, 200, 100);
4555  * evas_map_point_image_uv_set(m, 3,   0, 100);
4556  * evas_object_map_set(obj, m);
4557  * evas_map_free(m);
4558  * @endcode
4559  *
4560  * Note that the map points a uv coordinates match the image geometry. If
4561  * the @p map parameter is NULL, the stored map will be freed and geometry
4562  * prior to enabling/setting a map will be restored.
4563  *
4564  * @param obj object to change transformation map
4565  * @param map new map to use
4566  *
4567  * @see evas_map_new()
4568  */
4569 EAPI void              evas_object_map_set               (Evas_Object *obj, const Evas_Map *map);
4570
4571 /**
4572  * Get current object transformation map.
4573  *
4574  * This returns the current internal map set on the indicated object. It is
4575  * intended for read-only acces and is only valid as long as the object is
4576  * not deleted or the map on the object is not changed. If you wish to modify
4577  * the map and set it back do the following:
4578  *
4579  * @code
4580  * const Evas_Map *m = evas_object_map_get(obj);
4581  * Evas_Map *m2 = evas_map_dup(m);
4582  * evas_map_util_rotate(m2, 30.0, 0, 0);
4583  * evas_object_map_set(obj);
4584  * evas_map_free(m2);
4585  * @endcode
4586  *
4587  * @param obj object to query transformation map.
4588  * @return map reference to map in use. This is an internal data structure, so
4589  * do not modify it.
4590  *
4591  * @see evas_object_map_set()
4592  */
4593 EAPI const Evas_Map   *evas_object_map_get               (const Evas_Object *obj);
4594
4595
4596 /**
4597  * Populate source and destination map points to match exactly object.
4598  *
4599  * Usually one initialize map of an object to match it's original
4600  * position and size, then transform these with evas_map_util_*
4601  * functions, such as evas_map_util_rotate() or
4602  * evas_map_util_3d_rotate(). The original set is done by this
4603  * function, avoiding code duplication all around.
4604  *
4605  * @param m map to change all 4 points (must be of size 4).
4606  * @param obj object to use unmapped geometry to populate map coordinates.
4607  * @param z Point Z Coordinate hint (pre-perspective transform). This value
4608  *        will be used for all four points.
4609  *
4610  * @see evas_map_util_points_populate_from_object()
4611  * @see evas_map_point_coord_set()
4612  * @see evas_map_point_image_uv_set()
4613  */
4614 EAPI void              evas_map_util_points_populate_from_object_full(Evas_Map *m, const Evas_Object *obj, Evas_Coord z);
4615
4616 /**
4617  * Populate source and destination map points to match exactly object.
4618  *
4619  * Usually one initialize map of an object to match it's original
4620  * position and size, then transform these with evas_map_util_*
4621  * functions, such as evas_map_util_rotate() or
4622  * evas_map_util_3d_rotate(). The original set is done by this
4623  * function, avoiding code duplication all around.
4624  *
4625  * Z Point coordinate is assumed as 0 (zero).
4626  *
4627  * @param m map to change all 4 points (must be of size 4).
4628  * @param obj object to use unmapped geometry to populate map coordinates.
4629  *
4630  * @see evas_map_util_points_populate_from_object_full()
4631  * @see evas_map_util_points_populate_from_geometry()
4632  * @see evas_map_point_coord_set()
4633  * @see evas_map_point_image_uv_set()
4634  */
4635 EAPI void              evas_map_util_points_populate_from_object     (Evas_Map *m, const Evas_Object *obj);
4636
4637 /**
4638  * Populate source and destination map points to match given geometry.
4639  *
4640  * Similar to evas_map_util_points_populate_from_object_full(), this
4641  * call takes raw values instead of querying object's unmapped
4642  * geometry. The given width will be used to calculate destination
4643  * points (evas_map_point_coord_set()) and set the image uv
4644  * (evas_map_point_image_uv_set()).
4645  *
4646  * @param m map to change all 4 points (must be of size 4).
4647  * @param x Point X Coordinate
4648  * @param y Point Y Coordinate
4649  * @param w width to use to calculate second and third points.
4650  * @param h height to use to calculate third and fourth points.
4651  * @param z Point Z Coordinate hint (pre-perspective transform). This value
4652  *        will be used for all four points.
4653  *
4654  * @see evas_map_util_points_populate_from_object()
4655  * @see evas_map_point_coord_set()
4656  * @see evas_map_point_image_uv_set()
4657  */
4658 EAPI void              evas_map_util_points_populate_from_geometry   (Evas_Map *m, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h, Evas_Coord z);
4659
4660 /**
4661  * Set color of all points to given color.
4662  *
4663  * This call is useful to reuse maps after they had 3d lightning or
4664  * any other colorization applied before.
4665  *
4666  * @param m map to change the color of.
4667  * @param r red (0 - 255)
4668  * @param g green (0 - 255)
4669  * @param b blue (0 - 255)
4670  * @param a alpha (0 - 255)
4671  *
4672  * @see evas_map_point_color_set()
4673  */
4674 EAPI void              evas_map_util_points_color_set                (Evas_Map *m, int r, int g, int b, int a);
4675
4676 /**
4677  * Change the map to apply the given rotation.
4678  *
4679  * This rotates the indicated map's coordinates around the center coordinate
4680  * given by @p cx and @p cy as the rotation center. The points will have their
4681  * X and Y coordinates rotated clockwise by @p degrees degress (360.0 is a
4682  * full rotation). Negative values for degrees will rotate counter-clockwise
4683  * by that amount. All coordinates are canvas global coordinates.
4684  *
4685  * @param m map to change.
4686  * @param degrees amount of degrees from 0.0 to 360.0 to rotate.
4687  * @param cx rotation's center horizontal position.
4688  * @param cy rotation's center vertical position.
4689  *
4690  * @see evas_map_point_coord_set()
4691  * @see evas_map_util_zoom()
4692  */
4693 EAPI void              evas_map_util_rotate                          (Evas_Map *m, double degrees, Evas_Coord cx, Evas_Coord cy);
4694
4695 /**
4696  * Change the map to apply the given zooming.
4697  *
4698  * Like evas_map_util_rotate(), this zooms the points of the map from a center
4699  * point. That center is defined by @p cx and @p cy. The @p zoomx and @p zoomy
4700  * parameters specify how much to zoom in the X and Y direction respectively.
4701  * A value of 1.0 means "don't zoom". 2.0 means "dobule the size". 0.5 is
4702  * "half the size" etc. All coordinates are canvas global coordinates.
4703  *
4704  * @param m map to change.
4705  * @param zoomx horizontal zoom to use.
4706  * @param zoomy vertical zoom to use.
4707  * @param cx zooming center horizontal position.
4708  * @param cy zooming center vertical position.
4709  *
4710  * @see evas_map_point_coord_set()
4711  * @see evas_map_util_rotate()
4712  */
4713 EAPI void              evas_map_util_zoom                            (Evas_Map *m, double zoomx, double zoomy, Evas_Coord cx, Evas_Coord cy);
4714
4715 /**
4716  * Rotate the map around 3 axes in 3D
4717  *
4718  * This will rotate not just around the "Z" axis as in evas_map_util_rotate()
4719  * (which is a convenience call for those only wanting 2D). This will rotate
4720  * around the X, Y and Z axes. The Z axis points "into" the screen with low
4721  * values at the screen and higher values further away. The X axis runs from
4722  * left to right on the screen and the Y axis from top to bottom. Like with
4723  * evas_map_util_rotate() you provide a center point to rotate around (in 3D).
4724  *
4725  * @param m map to change.
4726  * @param dx amount of degrees from 0.0 to 360.0 to rotate arount X axis.
4727  * @param dy amount of degrees from 0.0 to 360.0 to rotate arount Y axis.
4728  * @param dz amount of degrees from 0.0 to 360.0 to rotate arount Z axis.
4729  * @param cx rotation's center horizontal position.
4730  * @param cy rotation's center vertical position.
4731  * @param cz rotation's center vertical position.
4732  */
4733 EAPI void              evas_map_util_3d_rotate                       (Evas_Map *m, double dx, double dy, double dz, Evas_Coord cx, Evas_Coord cy, Evas_Coord cz);
4734
4735 /**
4736  * Perform lighting calculations on the given Map
4737  *
4738  * This is used to apply lighting calculations (from a single light source)
4739  * to a given map. The R, G and B values of each vertex will be modified to
4740  * reflect the lighting based on the lixth point coordinates, the light
4741  * color and the ambient color, and at what angle the map is facing the
4742  * light source. A surface should have its points be declared in a
4743  * clockwise fashion if the face is "facing" towards you (as opposed to
4744  * away from you) as faces have a "logical" side for lighting.
4745  *
4746  * @image html map-light3.png
4747  * @image rtf map-light3.png
4748  * @image latex map-light3.eps
4749  * @note Grey object, no lighting used
4750  *
4751  * @image html map-light4.png
4752  * @image rtf map-light4.png
4753  * @image latex map-light4.eps
4754  * @note Lights out! Every color set to 0
4755  *
4756  * @image html map-light5.png
4757  * @image rtf map-light5.png
4758  * @image latex map-light5.eps
4759  * @note Ambient light to full black, red light coming from close at the
4760  * bottom-left vertex
4761  *
4762  * @image html map-light6.png
4763  * @image rtf map-light6.png
4764  * @image latex map-light6.eps
4765  * @note Same light as before, but not the light is set to 0 and ambient light
4766  * is cyan
4767  *
4768  * @image html map-light7.png
4769  * @image rtf map-light7.png
4770  * @image latex map-light7.eps
4771  * @note Both lights are on
4772  *
4773  * @image html map-light8.png
4774  * @image rtf map-light8.png
4775  * @image latex map-light8.eps
4776  * @note Both lights again, but this time both are the same color.
4777  *
4778  * @param m map to change.
4779  * @param lx X coordinate in space of light point
4780  * @param ly Y coordinate in space of light point
4781  * @param lz Z coordinate in space of light point
4782  * @param lr light red value (0 - 255)
4783  * @param lg light green value (0 - 255)
4784  * @param lb light blue value (0 - 255)
4785  * @param ar ambient color red value (0 - 255)
4786  * @param ag ambient color green value (0 - 255)
4787  * @param ab ambient color blue value (0 - 255)
4788  */
4789 EAPI void              evas_map_util_3d_lighting                     (Evas_Map *m, Evas_Coord lx, Evas_Coord ly, Evas_Coord lz, int lr, int lg, int lb, int ar, int ag, int ab);
4790
4791 /**
4792  * Apply a perspective transform to the map
4793  *
4794  * This applies a given perspective (3D) to the map coordinates. X, Y and Z
4795  * values are used. The px and py points specify the "infinite distance" point
4796  * in the 3D conversion (where all lines converge to like when artists draw
4797  * 3D by hand). The @p z0 value specifis the z value at which there is a 1:1
4798  * mapping between spatial coorinates and screen coordinates. Any points
4799  * on this z value will not have their X and Y values modified in the transform.
4800  * Those further away (Z value higher) will shrink into the distance, and
4801  * those less than this value will expand and become bigger. The @p foc value
4802  * determines the "focal length" of the camera. This is in reality the distance
4803  * between the camera lens plane itself (at or closer than this rendering
4804  * results are undefined) and the "z0" z value. This allows for some "depth"
4805  * control and @p foc must be greater than 0.
4806  *
4807  * @param m map to change.
4808  * @param px The pespective distance X coordinate
4809  * @param py The pespective distance Y coordinate
4810  * @param z0 The "0" z plane value
4811  * @param foc The focal distance
4812  */
4813 EAPI void              evas_map_util_3d_perspective                  (Evas_Map *m, Evas_Coord px, Evas_Coord py, Evas_Coord z0, Evas_Coord foc);
4814
4815 /**
4816  * Get the clockwise state of a map
4817  *
4818  * This determines if the output points (X and Y. Z is not used) are
4819  * clockwise or anti-clockwise. This can be used for "back-face culling". This
4820  * is where you hide objects that "face away" from you. In this case objects
4821  * that are not clockwise.
4822  *
4823  * @param m map to query.
4824  * @return 1 if clockwise, 0 otherwise
4825  */
4826 EAPI Eina_Bool         evas_map_util_clockwise_get                   (Evas_Map *m);
4827
4828
4829 /**
4830  * Create map of transformation points to be later used with an Evas object.
4831  *
4832  * This creates a set of points (currently only 4 is supported. no other
4833  * number for @p count will work). That is empty and ready to be modified
4834  * with evas_map calls.
4835  *
4836  * @param count number of points in the map.
4837  * @return a newly allocated map or @c NULL on errors.
4838  *
4839  * @see evas_map_free()
4840  * @see evas_map_dup()
4841  * @see evas_map_point_coord_set()
4842  * @see evas_map_point_image_uv_set()
4843  * @see evas_map_util_points_populate_from_object_full()
4844  * @see evas_map_util_points_populate_from_object()
4845  *
4846  * @see evas_object_map_set()
4847  */
4848 EAPI Evas_Map         *evas_map_new                      (int count);
4849
4850 /**
4851  * Set the smoothing for map rendering
4852  *
4853  * This sets smoothing for map rendering. If the object is a type that has
4854  * its own smoothing settings, then both the smooth settings for this object
4855  * and the map must be turned off. By default smooth maps are enabled.
4856  *
4857  * @param m map to modify. Must not be NULL.
4858  * @param enabled enable or disable smooth map rendering
4859  */
4860 EAPI void              evas_map_smooth_set               (Evas_Map *m, Eina_Bool enabled);
4861
4862 /**
4863  * get the smoothing for map rendering
4864  *
4865  * This gets smoothing for map rendering.
4866  *
4867  * @param m map to get the smooth from. Must not be NULL.
4868  */
4869 EAPI Eina_Bool         evas_map_smooth_get               (const Evas_Map *m);
4870
4871 /**
4872  * Set the alpha flag for map rendering
4873  *
4874  * This sets alpha flag for map rendering. If the object is a type that has
4875  * its own alpha settings, then this will take precedence. Only image objects
4876  * have this currently.
4877  * Setting this off stops alpha blending of the map area, and is
4878  * useful if you know the object and/or all sub-objects is 100% solid.
4879  *
4880  * @param m map to modify. Must not be NULL.
4881  * @param enabled enable or disable alpha map rendering
4882  */
4883 EAPI void              evas_map_alpha_set                (Evas_Map *m, Eina_Bool enabled);
4884
4885 /**
4886  * get the alpha flag for map rendering
4887  *
4888  * This gets the alph flag for map rendering.
4889  *
4890  * @param m map to get the alpha from. Must not be NULL.
4891  */
4892 EAPI Eina_Bool         evas_map_alpha_get                (const Evas_Map *m);
4893
4894 /**
4895  * Copy a previously allocated map.
4896  *
4897  * This makes a duplicate of the @p m object and returns it.
4898  *
4899  * @param m map to copy. Must not be NULL.
4900  * @return newly allocated map with the same count and contents as @p m.
4901  */
4902 EAPI Evas_Map         *evas_map_dup                      (const Evas_Map *m);
4903
4904 /**
4905  * Free a previously allocated map.
4906  *
4907  * This frees a givem map @p m and all memory associated with it. You must NOT
4908  * free a map returned by evas_object_map_get() as this is internal.
4909  *
4910  * @param m map to free.
4911  */
4912 EAPI void              evas_map_free                     (Evas_Map *m);
4913
4914 /**
4915  * Get a maps size.
4916  *
4917  * Returns the number of points in a map.  Should be at least 4.
4918  *
4919  * @param m map to get size.
4920  * @return -1 on error, points otherwise.
4921  */
4922 EAPI int               evas_map_count_get               (const Evas_Map *m) EINA_CONST;
4923
4924 /**
4925  * Change the map point's coordinate.
4926  *
4927  * This sets the fixed point's coordinate in the map. Note that points
4928  * describe the outline of a quadrangle and are ordered either clockwise
4929  * or anit-clock-wise. It is suggested to keep your quadrangles concave and
4930  * non-complex, though these polygon modes may work, they may not render
4931  * a desired set of output. The quadrangle will use points 0 and 1 , 1 and 2,
4932  * 2 and 3, and 3 and 0 to describe the edges of the quandrangle.
4933  *
4934  * The X and Y and Z coordinates are in canvas units. Z is optional and may
4935  * or may not be honored in drawing. Z is a hint and does not affect the
4936  * X and Y rendered coordinates. It may be used for calculating fills with
4937  * perspective correct rendering.
4938  *
4939  * Remember all coordinates are canvas global ones like with move and reize
4940  * in evas.
4941  *
4942  * @param m map to change point. Must not be @c NULL.
4943  * @param idx index of point to change. Must be smaller than map size.
4944  * @param x Point X Coordinate
4945  * @param y Point Y Coordinate
4946  * @param z Point Z Coordinate hint (pre-perspective transform)
4947  *
4948  * @see evas_map_util_rotate()
4949  * @see evas_map_util_zoom()
4950  * @see evas_map_util_points_populate_from_object_full()
4951  * @see evas_map_util_points_populate_from_object()
4952  */
4953 EAPI void              evas_map_point_coord_set          (Evas_Map *m, int idx, Evas_Coord x, Evas_Coord y, Evas_Coord z);
4954
4955 /**
4956  * Get the map point's coordinate.
4957  *
4958  * This returns the coordinates of the given point in the map.
4959  *
4960  * @param m map to query point.
4961  * @param idx index of point to query. Must be smaller than map size.
4962  * @param x where to return the X coordinate.
4963  * @param y where to return the Y coordinate.
4964  * @param z where to return the Z coordinate.
4965  */
4966 EAPI void              evas_map_point_coord_get          (const Evas_Map *m, int idx, Evas_Coord *x, Evas_Coord *y, Evas_Coord *z);
4967
4968 /**
4969  * Change the map point's U and V texture source point
4970  *
4971  * This sets the U and V coordinates for the point. This determines which
4972  * coordinate in the source image is mapped to the given point, much like
4973  * OpenGL and textures. Notes that these points do select the pixel, but
4974  * are double floating point values to allow for accuracy and sub-pixel
4975  * selection.
4976  *
4977  * @param m map to change the point of.
4978  * @param idx index of point to change. Must be smaller than map size.
4979  * @param u the X coordinate within the image/texture source
4980  * @param v the Y coordinate within the image/texture source
4981  *
4982  * @see evas_map_point_coord_set()
4983  * @see evas_object_map_set()
4984  * @see evas_map_util_points_populate_from_object_full()
4985  * @see evas_map_util_points_populate_from_object()
4986  */
4987 EAPI void              evas_map_point_image_uv_set       (Evas_Map *m, int idx, double u, double v);
4988
4989 /**
4990  * Get the map point's U and V texture source points
4991  *
4992  * This returns the texture points set by evas_map_point_image_uv_set().
4993  *
4994  * @param m map to query point.
4995  * @param idx index of point to query. Must be smaller than map size.
4996  * @param u where to write the X coordinate within the image/texture source
4997  * @param v where to write the Y coordinate within the image/texture source
4998  */
4999 EAPI void              evas_map_point_image_uv_get       (const Evas_Map *m, int idx, double *u, double *v);
5000
5001 /**
5002  * Set the color of a vertex in the map
5003  *
5004  * This sets the color of the vertex in the map. Colors will be linearly
5005  * interpolated between vertex points through the map. Color will multiply
5006  * the "texture" pixels (like GL_MODULATE in OpenGL). The default color of
5007  * a vertex in a map is white solid (255, 255, 255, 255) which means it will
5008  * have no affect on modifying the texture pixels.
5009  *
5010  * @param m map to change the color of.
5011  * @param idx index of point to change. Must be smaller than map size.
5012  * @param r red (0 - 255)
5013  * @param g green (0 - 255)
5014  * @param b blue (0 - 255)
5015  * @param a alpha (0 - 255)
5016  *
5017  * @see evas_map_util_points_color_set()
5018  * @see evas_map_point_coord_set()
5019  * @see evas_object_map_set()
5020  */
5021 EAPI void              evas_map_point_color_set          (Evas_Map *m, int idx, int r, int g, int b, int a);
5022
5023 /**
5024  * Get the color set on a vertex in the map
5025  *
5026  * This gets the color set by evas_map_point_color_set() on the given vertex
5027  * of the map.
5028  *
5029  * @param m map to get the color of the vertex from.
5030  * @param idx index of point get. Must be smaller than map size.
5031  * @param r pointer to red return
5032  * @param g pointer to green return
5033  * @param b pointer to blue return
5034  * @param a pointer to alpha return (0 - 255)
5035  *
5036  * @see evas_map_point_coord_set()
5037  * @see evas_object_map_set()
5038  */
5039 EAPI void              evas_map_point_color_get          (const Evas_Map *m, int idx, int *r, int *g, int *b, int *a);
5040 /**
5041  * @}
5042  */
5043
5044 /**
5045  * @defgroup Evas_Object_Group_Size_Hints Size Hints
5046  *
5047  * Objects may carry hints, so that another object that acts as a
5048  * manager (see @ref Evas_Smart_Object_Group) may know how to properly
5049  * position and resize its subordinate objects. The Size Hints provide
5050  * a common interface that is recommended as the protocol for such
5051  * information.
5052  *
5053  * For example, box objects use alignment hints to align its
5054  * lines/columns inside its container, padding hints to set the
5055  * padding between each individual child, etc.
5056  *
5057  * Examples on their usage:
5058  * - @ref Example_Evas_Size_Hints "evas-hints.c"
5059  * - @ref Example_Evas_Aspect_Hints "evas-aspect-hints.c"
5060  *
5061  * @ingroup Evas_Object_Group
5062  */
5063
5064 /**
5065  * @addtogroup Evas_Object_Group_Size_Hints
5066  * @{
5067  */
5068
5069 /**
5070  * Retrieves the hints for an object's minimum size.
5071  *
5072  * @param obj The given Evas object to query hints from.
5073  * @param w Pointer to an integer in which to store the minimum width.
5074  * @param h Pointer to an integer in which to store the minimum height.
5075  *
5076  * These are hints on the minimim sizes @p obj should have. This is
5077  * not a size enforcement in any way, it's just a hint that should be
5078  * used whenever appropriate.
5079  *
5080  * @note Use @c NULL pointers on the hint components you're not
5081  * interested in: they'll be ignored by the function.
5082  *
5083  * @see evas_object_size_hint_min_set() for an example
5084  */
5085 EAPI void              evas_object_size_hint_min_get     (const Evas_Object *obj, Evas_Coord *w, Evas_Coord *h) EINA_ARG_NONNULL(1);
5086
5087 /**
5088  * Sets the hints for an object's minimum size.
5089  *
5090  * @param obj The given Evas object to query hints from.
5091  * @param w Integer to use as the minimum width hint.
5092  * @param h Integer to use as the minimum height hint.
5093  *
5094  * This is not a size enforcement in any way, it's just a hint that
5095  * should be used whenever appropriate.
5096  *
5097  * Values @c 0 will be treated as unset hint components, when queried
5098  * by managers.
5099  *
5100  * Example:
5101  * @dontinclude evas-hints.c
5102  * @skip evas_object_size_hint_min_set
5103  * @until return
5104  *
5105  * In this example the minimum size hints change the behavior of an
5106  * Evas box when layouting its children. See the full @ref
5107  * Example_Evas_Size_Hints "example".
5108  *
5109  * @see evas_object_size_hint_min_get()
5110  */
5111 EAPI void              evas_object_size_hint_min_set     (Evas_Object *obj, Evas_Coord w, Evas_Coord h) EINA_ARG_NONNULL(1);
5112
5113 /**
5114  * Retrieves the hints for an object's maximum size.
5115  *
5116  * @param obj The given Evas object to query hints from.
5117  * @param w Pointer to an integer in which to store the maximum width.
5118  * @param h Pointer to an integer in which to store the maximum height.
5119  *
5120  * These are hints on the maximum sizes @p obj should have. This is
5121  * not a size enforcement in any way, it's just a hint that should be
5122  * used whenever appropriate.
5123  *
5124  * @note Use @c NULL pointers on the hint components you're not
5125  * interested in: they'll be ignored by the function.
5126  *
5127  * @see evas_object_size_hint_max_set()
5128  */
5129 EAPI void              evas_object_size_hint_max_get     (const Evas_Object *obj, Evas_Coord *w, Evas_Coord *h) EINA_ARG_NONNULL(1);
5130
5131 /**
5132  * Sets the hints for an object's maximum size.
5133  *
5134  * @param obj The given Evas object to query hints from.
5135  * @param w Integer to use as the maximum width hint.
5136  * @param h Integer to use as the maximum height hint.
5137  *
5138  * This is not a size enforcement in any way, it's just a hint that
5139  * should be used whenever appropriate.
5140  *
5141  * Values @c -1 will be treated as unset hint components, when queried
5142  * by managers.
5143  *
5144  * Example:
5145  * @dontinclude evas-hints.c
5146  * @skip evas_object_size_hint_max_set
5147  * @until return
5148  *
5149  * In this example the maximum size hints change the behavior of an
5150  * Evas box when layouting its children. See the full @ref
5151  * Example_Evas_Size_Hints "example".
5152  *
5153  * @see evas_object_size_hint_max_get()
5154  */
5155 EAPI void              evas_object_size_hint_max_set     (Evas_Object *obj, Evas_Coord w, Evas_Coord h) EINA_ARG_NONNULL(1);
5156
5157 /**
5158  * Retrieves the hints for an object's optimum size.
5159  *
5160  * @param obj The given Evas object to query hints from.
5161  * @param w Pointer to an integer in which to store the requested width.
5162  * @param h Pointer to an integer in which to store the requested height.
5163  *
5164  * These are hints on the optimum sizes @p obj should have. This is
5165  * not a size enforcement in any way, it's just a hint that should be
5166  * used whenever appropriate.
5167  *
5168  * @note Use @c NULL pointers on the hint components you're not
5169  * interested in: they'll be ignored by the function.
5170  *
5171  * @see evas_object_size_hint_request_set()
5172  */
5173 EAPI void              evas_object_size_hint_request_get (const Evas_Object *obj, Evas_Coord *w, Evas_Coord *h) EINA_ARG_NONNULL(1);
5174
5175 /**
5176  * Sets the hints for an object's optimum size.
5177  *
5178  * @param obj The given Evas object to query hints from.
5179  * @param w Integer to use as the preferred width hint.
5180  * @param h Integer to use as the preferred height hint.
5181  *
5182  * This is not a size enforcement in any way, it's just a hint that
5183  * should be used whenever appropriate.
5184  *
5185  * Values @c 0 will be treated as unset hint components, when queried
5186  * by managers.
5187  *
5188  * @see evas_object_size_hint_request_get()
5189  */
5190 EAPI void              evas_object_size_hint_request_set (Evas_Object *obj, Evas_Coord w, Evas_Coord h) EINA_ARG_NONNULL(1);
5191
5192 /**
5193  * Retrieves the hints for an object's aspect ratio.
5194  *
5195  * @param obj The given Evas object to query hints from.
5196  * @param aspect Returns the policy/type of aspect ratio applied to @p obj.
5197  * @param w Pointer to an integer in which to store the aspect's width
5198  * ratio term.
5199  * @param h Pointer to an integer in which to store the aspect's
5200  * height ratio term.
5201  *
5202  * The different aspect ratio policies are documented in the
5203  * #Evas_Aspect_Control type. A container respecting these size hints
5204  * would @b resize its children accordingly to those policies.
5205  *
5206  * For any policy, if any of the given aspect ratio terms are @c 0,
5207  * the object's container should ignore the aspect and scale @p obj to
5208  * occupy the whole available area. If they are both positive
5209  * integers, that proportion will be respected, under each scaling
5210  * policy.
5211  *
5212  * These images illustrate some of the #Evas_Aspect_Control policies:
5213  *
5214  * @image html any-policy.png
5215  * @image rtf any-policy.png
5216  * @image latex any-policy.eps
5217  *
5218  * @image html aspect-control-none-neither.png
5219  * @image rtf aspect-control-none-neither.png
5220  * @image latex aspect-control-none-neither.eps
5221  *
5222  * @image html aspect-control-both.png
5223  * @image rtf aspect-control-both.png
5224  * @image latex aspect-control-both.eps
5225  *
5226  * @image html aspect-control-horizontal.png
5227  * @image rtf aspect-control-horizontal.png
5228  * @image latex aspect-control-horizontal.eps
5229  *
5230  * This is not a size enforcement in any way, it's just a hint that
5231  * should be used whenever appropriate.
5232  *
5233  * @note Use @c NULL pointers on the hint components you're not
5234  * interested in: they'll be ignored by the function.
5235  *
5236  * Example:
5237  * @dontinclude evas-aspect-hints.c
5238  * @skip if (strcmp(ev->keyname, "c") == 0)
5239  * @until }
5240  *
5241  * See the full @ref Example_Evas_Aspect_Hints "example".
5242  *
5243  * @see evas_object_size_hint_aspect_set()
5244  */
5245 EAPI void              evas_object_size_hint_aspect_get  (const Evas_Object *obj, Evas_Aspect_Control *aspect, Evas_Coord *w, Evas_Coord *h) EINA_ARG_NONNULL(1);
5246
5247 /**
5248  * Sets the hints for an object's aspect ratio.
5249  *
5250  * @param obj The given Evas object to query hints from.
5251  * @param aspect The policy/type of aspect ratio to apply to @p obj.
5252  * @param w Integer to use as aspect width ratio term.
5253  * @param h Integer to use as aspect height ratio term.
5254  *
5255  * This is not a size enforcement in any way, it's just a hint that should
5256  * be used whenever appropriate.
5257  *
5258  * If any of the given aspect ratio terms are @c 0,
5259  * the object's container will ignore the aspect and scale @p obj to
5260  * occupy the whole available area, for any given policy.
5261  *
5262  * @see evas_object_size_hint_aspect_get() for more information.
5263  */
5264 EAPI void              evas_object_size_hint_aspect_set  (Evas_Object *obj, Evas_Aspect_Control aspect, Evas_Coord w, Evas_Coord h) EINA_ARG_NONNULL(1);
5265
5266 /**
5267  * Retrieves the hints for on object's alignment.
5268  *
5269  * @param obj The given Evas object to query hints from.
5270  * @param x Pointer to a double in which to store the horizontal
5271  * alignment hint.
5272  * @param y Pointer to a double in which to store the vertical
5273  * alignment hint.
5274  *
5275  * This is not a size enforcement in any way, it's just a hint that
5276  * should be used whenever appropriate.
5277  *
5278  * @note Use @c NULL pointers on the hint components you're not
5279  * interested in: they'll be ignored by the function.
5280  *
5281  * @see evas_object_size_hint_align_set() for more information
5282  */
5283 EAPI void              evas_object_size_hint_align_get   (const Evas_Object *obj, double *x, double *y) EINA_ARG_NONNULL(1);
5284
5285 /**
5286  * Sets the hints for an object's alignment.
5287  *
5288  * @param obj The given Evas object to query hints from.
5289  * @param x Double, ranging from @c 0.0 to @c 1.0 or with the
5290  * special value #EVAS_HINT_FILL, to use as horizontal alignment hint.
5291  * @param y Double, ranging from @c 0.0 to @c 1.0 or with the
5292  * special value #EVAS_HINT_FILL, to use as vertical alignment hint.
5293  *
5294  * These are hints on how to align an object <b>inside the boundaries
5295  * of a container/manager</b>. Accepted values are in the @c 0.0 to @c
5296  * 1.0 range, with the special value #EVAS_HINT_FILL used to specify
5297  * "justify" or "fill" by some users. In this case, maximum size hints
5298  * should be enforced with higher priority, if they are set. Also, any
5299  * padding hint set on objects should add up to the alignment space on
5300  * the final scene composition.
5301  *
5302  * See documentation of possible users: in Evas, they are the @ref
5303  * Evas_Object_Box "box" and @ref Evas_Object_Table "table" smart
5304  * objects.
5305  *
5306  * For the horizontal component, @c 0.0 means to the left, @c 1.0
5307  * means to the right. Analogously, for the vertical component, @c 0.0
5308  * to the top, @c 1.0 means to the bottom.
5309  *
5310  * See the following figure:
5311  *
5312  * @image html alignment-hints.png
5313  * @image rtf alignment-hints.png
5314  * @image latex alignment-hints.eps
5315  *
5316  * This is not a size enforcement in any way, it's just a hint that
5317  * should be used whenever appropriate.
5318  *
5319  * Example:
5320  * @dontinclude evas-hints.c
5321  * @skip evas_object_size_hint_align_set
5322  * @until return
5323  *
5324  * In this example the alignment hints change the behavior of an Evas
5325  * box when layouting its children. See the full @ref
5326  * Example_Evas_Size_Hints "example".
5327  *
5328  * @see evas_object_size_hint_align_get()
5329  * @see evas_object_size_hint_max_set()
5330  * @see evas_object_size_hint_padding_set()
5331  */
5332 EAPI void              evas_object_size_hint_align_set   (Evas_Object *obj, double x, double y) EINA_ARG_NONNULL(1);
5333
5334 /**
5335  * Retrieves the hints for an object's weight.
5336  *
5337  * @param obj The given Evas object to query hints from.
5338  * @param x Pointer to a double in which to store the horizontal weight.
5339  * @param y Pointer to a double in which to store the vertical weight.
5340  *
5341  * Accepted values are zero or positive values. Some users might use
5342  * this hint as a boolean, but some might consider it as a @b
5343  * proportion, see documentation of possible users, which in Evas are
5344  * the @ref Evas_Object_Box "box" and @ref Evas_Object_Table "table"
5345  * smart objects.
5346  *
5347  * This is not a size enforcement in any way, it's just a hint that
5348  * should be used whenever appropriate.
5349  *
5350  * @note Use @c NULL pointers on the hint components you're not
5351  * interested in: they'll be ignored by the function.
5352  *
5353  * @see evas_object_size_hint_weight_set() for an example
5354  */
5355 EAPI void              evas_object_size_hint_weight_get  (const Evas_Object *obj, double *x, double *y) EINA_ARG_NONNULL(1);
5356
5357 /**
5358  * Sets the hints for an object's weight.
5359  *
5360  * @param obj The given Evas object to query hints from.
5361  * @param x Nonnegative double value to use as horizontal weight hint.
5362  * @param y Nonnegative double value to use as vertical weight hint.
5363  *
5364  * This is not a size enforcement in any way, it's just a hint that
5365  * should be used whenever appropriate.
5366  *
5367  * This is a hint on how a container object should @b resize a given
5368  * child within its area. Containers may adhere to the simpler logic
5369  * of just expanding the child object's dimensions to fit its own (see
5370  * the #EVAS_HINT_EXPAND helper weight macro) or the complete one of
5371  * taking each child's weight hint as real @b weights to how much of
5372  * its size to allocate for them in each axis. A container is supposed
5373  * to, after @b normalizing the weights of its children (with weight
5374  * hints), distribute the space it has to layout them by those factors
5375  * -- most weighted children get larger in this process than the least
5376  * ones.
5377  *
5378  * Example:
5379  * @dontinclude evas-hints.c
5380  * @skip evas_object_size_hint_weight_set
5381  * @until return
5382  *
5383  * In this example the weight hints change the behavior of an Evas box
5384  * when layouting its children. See the full @ref
5385  * Example_Evas_Size_Hints "example".
5386  *
5387  * @see evas_object_size_hint_weight_get() for more information
5388  */
5389 EAPI void              evas_object_size_hint_weight_set  (Evas_Object *obj, double x, double y) EINA_ARG_NONNULL(1);
5390
5391 /**
5392  * Retrieves the hints for an object's padding space.
5393  *
5394  * @param obj The given Evas object to query hints from.
5395  * @param l Pointer to an integer in which to store left padding.
5396  * @param r Pointer to an integer in which to store right padding.
5397  * @param t Pointer to an integer in which to store top padding.
5398  * @param b Pointer to an integer in which to store bottom padding.
5399  *
5400  * Padding is extra space an object takes on each of its delimiting
5401  * rectangle sides, in canvas units. This space will be rendered
5402  * transparent, naturally, as in the following figure:
5403  *
5404  * @image html padding-hints.png
5405  * @image rtf padding-hints.png
5406  * @image latex padding-hints.eps
5407  *
5408  * This is not a size enforcement in any way, it's just a hint that
5409  * should be used whenever appropriate.
5410  *
5411  * @note Use @c NULL pointers on the hint components you're not
5412  * interested in: they'll be ignored by the function.
5413  *
5414  * Example:
5415  * @dontinclude evas-hints.c
5416  * @skip evas_object_size_hint_padding_set
5417  * @until return
5418  *
5419  * In this example the padding hints change the behavior of an Evas box
5420  * when layouting its children. See the full @ref
5421  * Example_Evas_Size_Hints "example".
5422  *
5423  * @see evas_object_size_hint_padding_set()
5424  */
5425 EAPI void              evas_object_size_hint_padding_get (const Evas_Object *obj, Evas_Coord *l, Evas_Coord *r, Evas_Coord *t, Evas_Coord *b) EINA_ARG_NONNULL(1);
5426
5427 /**
5428  * Sets the hints for an object's padding space.
5429  *
5430  * @param obj The given Evas object to query hints from.
5431  * @param l Integer to specify left padding.
5432  * @param r Integer to specify right padding.
5433  * @param t Integer to specify top padding.
5434  * @param b Integer to specify bottom padding.
5435  *
5436  * This is not a size enforcement in any way, it's just a hint that
5437  * should be used whenever appropriate.
5438  *
5439  * @see evas_object_size_hint_padding_get() for more information
5440  */
5441 EAPI void              evas_object_size_hint_padding_set (Evas_Object *obj, Evas_Coord l, Evas_Coord r, Evas_Coord t, Evas_Coord b) EINA_ARG_NONNULL(1);
5442
5443 /**
5444  * @}
5445  */
5446
5447 /**
5448  * @defgroup Evas_Object_Group_Extras Extra Object Manipulation
5449  *
5450  * Miscellaneous functions that also apply to any object, but are less
5451  * used or not implemented by all objects.
5452  *
5453  * Examples on this group of functions can be found @ref
5454  * Example_Evas_Stacking "here" and @ref Example_Evas_Events "here".
5455  *
5456  * @ingroup Evas_Object_Group
5457  */
5458
5459 /**
5460  * @addtogroup Evas_Object_Group_Extras
5461  * @{
5462  */
5463
5464 /**
5465  * Set an attached data pointer to an object with a given string key.
5466  *
5467  * @param obj The object to attach the data pointer to
5468  * @param key The string key for the data to access it
5469  * @param data The ponter to the data to be attached
5470  *
5471  * This attaches the pointer @p data to the object @p obj, given the
5472  * access string @p key. This pointer will stay "hooked" to the object
5473  * until a new pointer with the same string key is attached with
5474  * evas_object_data_set() or it is deleted with
5475  * evas_object_data_del(). On deletion of the object @p obj, the
5476  * pointers will not be accessible from the object anymore.
5477  *
5478  * You can find the pointer attached under a string key using
5479  * evas_object_data_get(). It is the job of the calling application to
5480  * free any data pointed to by @p data when it is no longer required.
5481  *
5482  * If @p data is @c NULL, the old value stored at @p key will be
5483  * removed but no new value will be stored. This is synonymous with
5484  * calling evas_object_data_del() with @p obj and @p key.
5485  *
5486  * @note This function is very handy when you have data associated
5487  * specifically to an Evas object, being of use only when dealing with
5488  * it. Than you don't have the burden to a pointer to it elsewhere,
5489  * using this family of functions.
5490  *
5491  * Example:
5492  *
5493  * @code
5494  * int *my_data;
5495  * extern Evas_Object *obj;
5496  *
5497  * my_data = malloc(500);
5498  * evas_object_data_set(obj, "name_of_data", my_data);
5499  * printf("The data that was attached was %p\n", evas_object_data_get(obj, "name_of_data"));
5500  * @endcode
5501  */
5502 EAPI void                      evas_object_data_set             (Evas_Object *obj, const char *key, const void *data) EINA_ARG_NONNULL(1, 2);
5503
5504 /**
5505  * Return an attached data pointer on an Evas object by its given
5506  * string key.
5507  *
5508  * @param obj The object to which the data was attached
5509  * @param key The string key the data was stored under
5510  * @return The data pointer stored, or @c NULL if none was stored
5511  *
5512  * This function will return the data pointer attached to the object
5513  * @p obj, stored using the string key @p key. If the object is valid
5514  * and a data pointer was stored under the given key, that pointer
5515  * will be returned. If this is not the case, @c NULL will be
5516  * returned, signifying an invalid object or a non-existent key. It is
5517  * possible that a @c NULL pointer was stored given that key, but this
5518  * situation is non-sensical and thus can be considered an error as
5519  * well. @c NULL pointers are never stored as this is the return value
5520  * if an error occurs.
5521  *
5522  * Example:
5523  *
5524  * @code
5525  * int *my_data;
5526  * extern Evas_Object *obj;
5527  *
5528  * my_data = evas_object_data_get(obj, "name_of_my_data");
5529  * if (my_data) printf("Data stored was %p\n", my_data);
5530  * else printf("No data was stored on the object\n");
5531  * @endcode
5532  */
5533 EAPI void                     *evas_object_data_get             (const Evas_Object *obj, const char *key) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2);
5534
5535 /**
5536  * Delete an attached data pointer from an object.
5537  *
5538  * @param obj The object to delete the data pointer from
5539  * @param key The string key the data was stored under
5540  * @return The original data pointer stored at @p key on @p obj
5541  *
5542  * This will remove the stored data pointer from @p obj stored under
5543  * @p key and return this same pointer, if actually there was data
5544  * there, or @c NULL, if nothing was stored under that key.
5545  *
5546  * Example:
5547  *
5548  * @code
5549  * int *my_data;
5550  * extern Evas_Object *obj;
5551  *
5552  * my_data = evas_object_data_del(obj, "name_of_my_data");
5553  * @endcode
5554  */
5555 EAPI void                     *evas_object_data_del             (Evas_Object *obj, const char *key) EINA_ARG_NONNULL(1, 2);
5556
5557
5558 /**
5559  * Set pointer behavior.
5560  *
5561  * @param obj
5562  * @param setting desired behavior.
5563  *
5564  * This function has direct effect on event callbacks related to
5565  * mouse.
5566  *
5567  * If @p setting is EVAS_OBJECT_POINTER_MODE_AUTOGRAB, then when mouse
5568  * is down at this object, events will be restricted to it as source,
5569  * mouse moves, for example, will be emitted even if outside this
5570  * object area.
5571  *
5572  * If @p setting is EVAS_OBJECT_POINTER_MODE_NOGRAB, then events will
5573  * be emitted just when inside this object area.
5574  *
5575  * The default value is EVAS_OBJECT_POINTER_MODE_AUTOGRAB.
5576  *
5577  * @ingroup Evas_Object_Group_Extras
5578  */
5579 EAPI void                      evas_object_pointer_mode_set     (Evas_Object *obj, Evas_Object_Pointer_Mode setting) EINA_ARG_NONNULL(1);
5580
5581 /**
5582  * Determine how pointer will behave.
5583  * @param obj
5584  * @return pointer behavior.
5585  * @ingroup Evas_Object_Group_Extras
5586  */
5587 EAPI Evas_Object_Pointer_Mode  evas_object_pointer_mode_get     (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
5588
5589
5590 /**
5591  * Sets whether or not the given Evas object is to be drawn anti-aliased.
5592  *
5593  * @param   obj The given Evas object.
5594  * @param   anti_alias 1 if the object is to be anti_aliased, 0 otherwise.
5595  * @ingroup Evas_Object_Group_Extras
5596  */
5597 EAPI void                      evas_object_anti_alias_set       (Evas_Object *obj, Eina_Bool antialias) EINA_ARG_NONNULL(1);
5598
5599 /**
5600  * Retrieves whether or not the given Evas object is to be drawn anti_aliased.
5601  * @param   obj The given Evas object.
5602  * @return  @c 1 if the object is to be anti_aliased.  @c 0 otherwise.
5603  * @ingroup Evas_Object_Group_Extras
5604  */
5605 EAPI Eina_Bool                 evas_object_anti_alias_get       (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
5606
5607
5608 /**
5609  * Sets the scaling factor for an Evas object. Does not affect all
5610  * objects.
5611  *
5612  * @param obj The given Evas object.
5613  * @param scale The scaling factor. <c>1.0</c> means no scaling,
5614  *        default size.
5615  *
5616  * This will multiply the object's dimension by the given factor, thus
5617  * altering its geometry (width and height). Useful when you want
5618  * scalable UI elements, possibly at run time.
5619  *
5620  * @note Only text and textblock objects have scaling change
5621  * handlers. Other objects won't change visually on this call.
5622  *
5623  * @see evas_object_scale_get()
5624  *
5625  * @ingroup Evas_Object_Group_Extras
5626  */
5627 EAPI void                      evas_object_scale_set            (Evas_Object *obj, double scale) EINA_ARG_NONNULL(1);
5628
5629 /**
5630  * Retrieves the scaling factor for the given Evas object.
5631  *
5632  * @param   obj The given Evas object.
5633  * @return  The scaling factor.
5634  *
5635  * @ingroup Evas_Object_Group_Extras
5636  *
5637  * @see evas_object_scale_set()
5638  */
5639 EAPI double                    evas_object_scale_get            (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
5640
5641
5642 /**
5643  * Sets the render_op to be used for rendering the Evas object.
5644  * @param   obj The given Evas object.
5645  * @param   render_op one of the Evas_Render_Op values.
5646  * @ingroup Evas_Object_Group_Extras
5647  */
5648 EAPI void                      evas_object_render_op_set        (Evas_Object *obj, Evas_Render_Op op) EINA_ARG_NONNULL(1);
5649
5650 /**
5651  * Retrieves the current value of the operation used for rendering the Evas object.
5652  * @param   obj The given Evas object.
5653  * @return  one of the enumerated values in Evas_Render_Op.
5654  * @ingroup Evas_Object_Group_Extras
5655  */
5656 EAPI Evas_Render_Op            evas_object_render_op_get        (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
5657
5658 /**
5659  * Set whether to use precise (usually expensive) point collision
5660  * detection for a given Evas object.
5661  *
5662  * @param obj The given object.
5663  * @param precise whether to use precise point collision detection or
5664  * not The default value is false.
5665  *
5666  * Use this function to make Evas treat objects' transparent areas as
5667  * @b not belonging to it with regard to mouse pointer events. By
5668  * default, all of the object's boundary rectangle will be taken in
5669  * account for them.
5670  *
5671  * @warning By using precise point collision detection you'll be
5672  * making Evas more resource intensive.
5673  *
5674  * Example code follows.
5675  * @dontinclude evas-events.c
5676  * @skip if (strcmp(ev->keyname, "p") == 0)
5677  * @until }
5678  *
5679  * See the full example @ref Example_Evas_Events "here".
5680  *
5681  * @see evas_object_precise_is_inside_get()
5682  * @ingroup Evas_Object_Group_Extras
5683  */
5684    EAPI void                      evas_object_precise_is_inside_set(Evas_Object *obj, Eina_Bool precise) EINA_ARG_NONNULL(1);
5685
5686 /**
5687  * Determine whether an object is set to use precise point collision
5688  * detection.
5689  *
5690  * @param obj The given object.
5691  * @return whether @p obj is set to use precise point collision
5692  * detection or not The default value is false.
5693  *
5694  * @see evas_object_precise_is_inside_set() for an example
5695  *
5696  * @ingroup Evas_Object_Group_Extras
5697  */
5698    EAPI Eina_Bool                 evas_object_precise_is_inside_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
5699
5700 /**
5701  * Set a hint flag on the given Evas object that it's used as a "static
5702  * clipper".
5703  *
5704  * @param obj The given object.
5705  * @param is_static_clip @c EINA_TRUE if it's to be used as a static
5706  * clipper, @c EINA_FALSE otherwise
5707  *
5708  * This is a hint to Evas that this object is used as a big static
5709  * clipper and shouldn't be moved with children and otherwise
5710  * considered specially. The default value for new objects is @c
5711  * EINA_FALSE.
5712  *
5713  * @see evas_object_static_clip_get()
5714  *
5715  * @ingroup Evas_Object_Group_Extras
5716  */
5717    EAPI void                      evas_object_static_clip_set      (Evas_Object *obj, Eina_Bool is_static_clip) EINA_ARG_NONNULL(1);
5718
5719 /**
5720  * Get the "static clipper" hint flag for a given Evas object.
5721  *
5722  * @param obj The given object.
5723  * @returrn @c EINA_TRUE if it's set as a static clipper, @c
5724  * EINA_FALSE otherwise
5725  *
5726  * @see evas_object_static_clip_set() for more details
5727  *
5728  * @ingroup Evas_Object_Group_Extras
5729  */
5730    EAPI Eina_Bool                 evas_object_static_clip_get      (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
5731
5732 /**
5733  * @}
5734  */
5735
5736 /**
5737  * @defgroup Evas_Object_Group_Find Finding Objects
5738  *
5739  * Functions that allows finding objects by their position, name or
5740  * other properties.
5741  *
5742  * @ingroup Evas_Object_Group
5743  */
5744
5745 /**
5746  * @addtogroup Evas_Object_Group_Find
5747  * @{
5748  */
5749
5750 /**
5751  * Retrieve the object that currently has focus.
5752  *
5753  * @param e The Evas canvas to query for focused object on.
5754  * @return The object that has focus or @c NULL if there is not one.
5755  *
5756  * Evas can have (at most) one of its objects focused at a time.
5757  * Focused objects will be the ones having <b>key events</b> delivered
5758  * to, which the programmer can act upon by means of
5759  * evas_object_event_callback_add() usage.
5760  *
5761  * @note Most users wouldn't be dealing directly with Evas' focused
5762  * objects. Instead, they would be using a higher level library for
5763  * that (like a toolkit, as Elementary) to handle focus and who's
5764  * receiving input for them.
5765  *
5766  * This call returns the object that currently has focus on the canvas
5767  * @p e or @c NULL, if none.
5768  *
5769  * @see evas_object_focus_set
5770  * @see evas_object_focus_get
5771  * @see evas_object_key_grab
5772  * @see evas_object_key_ungrab
5773  *
5774  * Example:
5775  * @dontinclude evas-events.c
5776  * @skip evas_event_callback_add(d.canvas, EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_IN,
5777  * @until evas_object_focus_set(d.bg, EINA_TRUE);
5778  * @dontinclude evas-events.c
5779  * @skip called when our rectangle gets focus
5780  * @until }
5781  *
5782  * In this example the @c event_info is exactly a pointer to that
5783  * focused rectangle. See the full @ref Example_Evas_Events "example".
5784  *
5785  * @ingroup Evas_Object_Group_Find
5786  */
5787 EAPI Evas_Object      *evas_focus_get                    (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
5788
5789 /**
5790  * Retrieves the object on the given evas with the given name.
5791  * @param   e    The given evas.
5792  * @param   name The given name.
5793  * @return  If successful, the Evas object with the given name.  Otherwise,
5794  *          @c NULL.
5795  * 
5796  * This looks for the evas object given a name by evas_object_name_set(). If
5797  * the name is not unique canvas-wide, then which one of the many objects
5798  * with that name is returned is undefined, so only use this if you can ensure
5799  * the object name is unique.
5800  * 
5801  * @ingroup Evas_Object_Group_Find
5802  */
5803 EAPI Evas_Object      *evas_object_name_find             (const Evas *e, const char *name) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
5804
5805 /**
5806  * Retrieves the object from children of the given object with the given name.
5807  * @param   obj  The parent (smart) object whose children to search.
5808  * @param   name The given name.
5809  * @param   recurse Set to the number of child levels to recurse (0 == don't recurse, 1 == only look at the children of @p obj or their immediate children, but no further etc.).
5810  * @return  If successful, the Evas object with the given name.  Otherwise,
5811  *          @c NULL.
5812  * 
5813  * This looks for the evas object given a name by evas_object_name_set(), but
5814  * it ONLY looks at the children of the object *p obj, and will only recurse
5815  * into those children if @p recurse is greater than 0. If the name is not
5816  * unique within immediate children (or the whole child tree) then it is not
5817  * defined which child object will be returned. If @p recurse is set to -1 then
5818  * it will recurse without limit.
5819  * 
5820  * @since 1.2
5821  * 
5822  * @ingroup Evas_Object_Group_Find
5823  */
5824 EAPI Evas_Object      *evas_object_name_child_find        (const Evas_Object *obj, const char *name, int recurse) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
5825
5826 /**
5827  * Retrieve the Evas object stacked at the top of a given position in
5828  * a canvas
5829  *
5830  * @param   e A handle to the canvas.
5831  * @param   x The horizontal coordinate of the position
5832  * @param   y The vertical coordinate of the position
5833  * @param   include_pass_events_objects Boolean flag to include or not
5834  * objects which pass events in this calculation
5835  * @param   include_hidden_objects Boolean flag to include or not hidden
5836  * objects in this calculation
5837  * @return  The Evas object that is over all other objects at the given
5838  * position.
5839  *
5840  * This function will traverse all the layers of the given canvas,
5841  * from top to bottom, querying for objects with areas covering the
5842  * given position. The user can remove from from the query
5843  * objects which are hidden and/or which are set to pass events.
5844  *
5845  * @warning This function will @b skip objects parented by smart
5846  * objects, acting only on the ones at the "top level", with regard to
5847  * object parenting.
5848  */
5849 EAPI Evas_Object      *evas_object_top_at_xy_get         (const Evas *e, Evas_Coord x, Evas_Coord y, Eina_Bool include_pass_events_objects, Eina_Bool include_hidden_objects) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
5850
5851 /**
5852  * Retrieve the Evas object stacked at the top at the position of the
5853  * mouse cursor, over a given canvas
5854  *
5855  * @param   e A handle to the canvas.
5856  * @return  The Evas object that is over all other objects at the mouse
5857  * pointer's position
5858  *
5859  * This function will traverse all the layers of the given canvas,
5860  * from top to bottom, querying for objects with areas covering the
5861  * mouse pointer's position, over @p e.
5862  *
5863  * @warning This function will @b skip objects parented by smart
5864  * objects, acting only on the ones at the "top level", with regard to
5865  * object parenting.
5866  */
5867 EAPI Evas_Object      *evas_object_top_at_pointer_get    (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
5868
5869 /**
5870  * Retrieve the Evas object stacked at the top of a given rectangular
5871  * region in a canvas
5872  *
5873  * @param   e A handle to the canvas.
5874  * @param   x The top left corner's horizontal coordinate for the
5875  * rectangular region
5876  * @param   y The top left corner's vertical coordinate for the
5877  * rectangular region
5878  * @param   w The width of the rectangular region
5879  * @param   h The height of the rectangular region
5880  * @param   include_pass_events_objects Boolean flag to include or not
5881  * objects which pass events in this calculation
5882  * @param   include_hidden_objects Boolean flag to include or not hidden
5883  * objects in this calculation
5884  * @return  The Evas object that is over all other objects at the given
5885  * rectangular region.
5886  *
5887  * This function will traverse all the layers of the given canvas,
5888  * from top to bottom, querying for objects with areas overlapping
5889  * with the given rectangular region inside @p e. The user can remove
5890  * from the query objects which are hidden and/or which are set to
5891  * pass events.
5892  *
5893  * @warning This function will @b skip objects parented by smart
5894  * objects, acting only on the ones at the "top level", with regard to
5895  * object parenting.
5896  */
5897 EAPI Evas_Object      *evas_object_top_in_rectangle_get  (const Evas *e, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h, Eina_Bool include_pass_events_objects, Eina_Bool include_hidden_objects) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
5898
5899 /**
5900  * Retrieve a list of Evas objects lying over a given position in
5901  * a canvas
5902  *
5903  * @param   e A handle to the canvas.
5904  * @param   x The horizontal coordinate of the position
5905  * @param   y The vertical coordinate of the position
5906  * @param   include_pass_events_objects Boolean flag to include or not
5907  * objects which pass events in this calculation
5908  * @param   include_hidden_objects Boolean flag to include or not hidden
5909  * objects in this calculation
5910  * @return  The list of Evas objects that are over the given position
5911  * in @p e
5912  *
5913  * This function will traverse all the layers of the given canvas,
5914  * from top to bottom, querying for objects with areas covering the
5915  * given position. The user can remove from from the query
5916  * objects which are hidden and/or which are set to pass events.
5917  *
5918  * @warning This function will @b skip objects parented by smart
5919  * objects, acting only on the ones at the "top level", with regard to
5920  * object parenting.
5921  */
5922 EAPI Eina_List        *evas_objects_at_xy_get            (const Evas *e, Evas_Coord x, Evas_Coord y, Eina_Bool include_pass_events_objects, Eina_Bool include_hidden_objects) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
5923    EAPI Eina_List        *evas_objects_in_rectangle_get     (const Evas *e, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h, Eina_Bool include_pass_events_objects, Eina_Bool include_hidden_objects) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
5924
5925 /**
5926  * Get the lowest (stacked) Evas object on the canvas @p
5927  *
5928  * @param e a valid canvas pointer
5929  * @return a pointer to the lowest object on it, if any, or @c NULL,
5930  * otherwise
5931  *
5932  * This function will take all populated layers in the canvas into
5933  * account, getting the lowest object for the lowest layer, naturally.
5934  *
5935  * @see evas_object_layer_get()
5936  * @see evas_object_layer_set()
5937  * @see evas_object_below_get()
5938  * @see evas_object_above_get()
5939  *
5940  * @warning This function will @b skip objects parented by smart
5941  * objects, acting only on the ones at the "top level", with regard to
5942  * object parenting.
5943  */
5944 EAPI Evas_Object      *evas_object_bottom_get            (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
5945
5946 /**
5947  * Get the highest (stacked) Evas object on the canvas @p
5948  *
5949  * @param e a valid canvas pointer
5950  * @return a pointer to the highest object on it, if any, or @c NULL,
5951  * otherwise
5952  *
5953  * This function will take all populated layers in the canvas into
5954  * account, getting the highest object for the highest layer,
5955  * naturally.
5956  *
5957  * @see evas_object_layer_get()
5958  * @see evas_object_layer_set()
5959  * @see evas_object_below_get()
5960  * @see evas_object_above_get()
5961  *
5962  * @warning This function will @b skip objects parented by smart
5963  * objects, acting only on the ones at the "top level", with regard to
5964  * object parenting.
5965  */
5966 EAPI Evas_Object      *evas_object_top_get               (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
5967
5968 /**
5969  * @}
5970  */
5971
5972 /**
5973  * @defgroup Evas_Object_Group_Interceptors Object Method Interceptors
5974  *
5975  * Evas provides a way to intercept method calls. The interceptor
5976  * callback may opt to completely deny the call, or may check and
5977  * change the parameters before continuing. The continuation of an
5978  * intercepted call is done by calling the intercepted call again,
5979  * from inside the interceptor callback.
5980  *
5981  * @ingroup Evas_Object_Group
5982  */
5983
5984 /**
5985  * @addtogroup Evas_Object_Group_Interceptors
5986  * @{
5987  */
5988
5989 typedef void (*Evas_Object_Intercept_Show_Cb) (void *data, Evas_Object *obj);
5990 typedef void (*Evas_Object_Intercept_Hide_Cb) (void *data, Evas_Object *obj);
5991 typedef void (*Evas_Object_Intercept_Move_Cb) (void *data, Evas_Object *obj, Evas_Coord x, Evas_Coord y);
5992 typedef void (*Evas_Object_Intercept_Resize_Cb) (void *data, Evas_Object *obj, Evas_Coord w, Evas_Coord h);
5993 typedef void (*Evas_Object_Intercept_Raise_Cb) (void *data, Evas_Object *obj);
5994 typedef void (*Evas_Object_Intercept_Lower_Cb) (void *data, Evas_Object *obj);
5995 typedef void (*Evas_Object_Intercept_Stack_Above_Cb) (void *data, Evas_Object *obj, Evas_Object *above);
5996 typedef void (*Evas_Object_Intercept_Stack_Below_Cb) (void *data, Evas_Object *obj, Evas_Object *above);
5997 typedef void (*Evas_Object_Intercept_Layer_Set_Cb) (void *data, Evas_Object *obj, int l);
5998 typedef void (*Evas_Object_Intercept_Color_Set_Cb) (void *data, Evas_Object *obj, int r, int g, int b, int a);
5999 typedef void (*Evas_Object_Intercept_Clip_Set_Cb) (void *data, Evas_Object *obj, Evas_Object *clip);
6000 typedef void (*Evas_Object_Intercept_Clip_Unset_Cb) (void *data, Evas_Object *obj);
6001
6002 /**
6003  * Set the callback function that intercepts a show event of a object.
6004  *
6005  * @param obj The given canvas object pointer.
6006  * @param func The given function to be the callback function.
6007  * @param data The data passed to the callback function.
6008  *
6009  * This function sets a callback function to intercepts a show event
6010  * of a canvas object.
6011  *
6012  * @see evas_object_intercept_show_callback_del().
6013  *
6014  */
6015 EAPI void              evas_object_intercept_show_callback_add        (Evas_Object *obj, Evas_Object_Intercept_Show_Cb func, const void *data) EINA_ARG_NONNULL(1, 2);
6016
6017 /**
6018  * Unset the callback function that intercepts a show event of a
6019  * object.
6020  *
6021  * @param obj The given canvas object pointer.
6022  * @param func The given callback function.
6023  *
6024  * This function sets a callback function to intercepts a show event
6025  * of a canvas object.
6026  *
6027  * @see evas_object_intercept_show_callback_add().
6028  *
6029  */
6030 EAPI void             *evas_object_intercept_show_callback_del        (Evas_Object *obj, Evas_Object_Intercept_Show_Cb func) EINA_ARG_NONNULL(1, 2);
6031
6032 /**
6033  * Set the callback function that intercepts a hide event of a object.
6034  *
6035  * @param obj The given canvas object pointer.
6036  * @param func The given function to be the callback function.
6037  * @param data The data passed to the callback function.
6038  *
6039  * This function sets a callback function to intercepts a hide event
6040  * of a canvas object.
6041  *
6042  * @see evas_object_intercept_hide_callback_del().
6043  *
6044  */
6045 EAPI void              evas_object_intercept_hide_callback_add        (Evas_Object *obj, Evas_Object_Intercept_Hide_Cb func, const void *data) EINA_ARG_NONNULL(1, 2);
6046
6047 /**
6048  * Unset the callback function that intercepts a hide event of a
6049  * object.
6050  *
6051  * @param obj The given canvas object pointer.
6052  * @param func The given callback function.
6053  *
6054  * This function sets a callback function to intercepts a hide event
6055  * of a canvas object.
6056  *
6057  * @see evas_object_intercept_hide_callback_add().
6058  *
6059  */
6060 EAPI void             *evas_object_intercept_hide_callback_del        (Evas_Object *obj, Evas_Object_Intercept_Hide_Cb func) EINA_ARG_NONNULL(1, 2);
6061
6062 /**
6063  * Set the callback function that intercepts a move event of a object.
6064  *
6065  * @param obj The given canvas object pointer.
6066  * @param func The given function to be the callback function.
6067  * @param data The data passed to the callback function.
6068  *
6069  * This function sets a callback function to intercepts a move event
6070  * of a canvas object.
6071  *
6072  * @see evas_object_intercept_move_callback_del().
6073  *
6074  */
6075 EAPI void              evas_object_intercept_move_callback_add        (Evas_Object *obj, Evas_Object_Intercept_Move_Cb func, const void *data) EINA_ARG_NONNULL(1, 2);
6076
6077 /**
6078  * Unset the callback function that intercepts a move event of a
6079  * object.
6080  *
6081  * @param obj The given canvas object pointer.
6082  * @param func The given callback function.
6083  *
6084  * This function sets a callback function to intercepts a move event
6085  * of a canvas object.
6086  *
6087  * @see evas_object_intercept_move_callback_add().
6088  *
6089  */
6090 EAPI void             *evas_object_intercept_move_callback_del        (Evas_Object *obj, Evas_Object_Intercept_Move_Cb func) EINA_ARG_NONNULL(1, 2);
6091
6092    EAPI void              evas_object_intercept_resize_callback_add      (Evas_Object *obj, Evas_Object_Intercept_Resize_Cb func, const void *data) EINA_ARG_NONNULL(1, 2);
6093    EAPI void             *evas_object_intercept_resize_callback_del      (Evas_Object *obj, Evas_Object_Intercept_Resize_Cb func) EINA_ARG_NONNULL(1, 2);
6094    EAPI void              evas_object_intercept_raise_callback_add       (Evas_Object *obj, Evas_Object_Intercept_Raise_Cb func, const void *data) EINA_ARG_NONNULL(1, 2);
6095    EAPI void             *evas_object_intercept_raise_callback_del       (Evas_Object *obj, Evas_Object_Intercept_Raise_Cb func) EINA_ARG_NONNULL(1, 2);
6096    EAPI void              evas_object_intercept_lower_callback_add       (Evas_Object *obj, Evas_Object_Intercept_Lower_Cb func, const void *data) EINA_ARG_NONNULL(1, 2);
6097    EAPI void             *evas_object_intercept_lower_callback_del       (Evas_Object *obj, Evas_Object_Intercept_Lower_Cb func) EINA_ARG_NONNULL(1, 2);
6098    EAPI void              evas_object_intercept_stack_above_callback_add (Evas_Object *obj, Evas_Object_Intercept_Stack_Above_Cb func, const void *data) EINA_ARG_NONNULL(1, 2);
6099    EAPI void             *evas_object_intercept_stack_above_callback_del (Evas_Object *obj, Evas_Object_Intercept_Stack_Above_Cb func) EINA_ARG_NONNULL(1, 2);
6100    EAPI void              evas_object_intercept_stack_below_callback_add (Evas_Object *obj, Evas_Object_Intercept_Stack_Below_Cb func, const void *data) EINA_ARG_NONNULL(1, 2);
6101    EAPI void             *evas_object_intercept_stack_below_callback_del (Evas_Object *obj, Evas_Object_Intercept_Stack_Below_Cb func) EINA_ARG_NONNULL(1, 2);
6102    EAPI void              evas_object_intercept_layer_set_callback_add   (Evas_Object *obj, Evas_Object_Intercept_Layer_Set_Cb func, const void *data) EINA_ARG_NONNULL(1, 2);
6103    EAPI void             *evas_object_intercept_layer_set_callback_del   (Evas_Object *obj, Evas_Object_Intercept_Layer_Set_Cb func) EINA_ARG_NONNULL(1, 2);
6104    EAPI void              evas_object_intercept_color_set_callback_add   (Evas_Object *obj, Evas_Object_Intercept_Color_Set_Cb func, const void *data) EINA_ARG_NONNULL(1, 2);
6105    EAPI void             *evas_object_intercept_color_set_callback_del   (Evas_Object *obj, Evas_Object_Intercept_Color_Set_Cb func) EINA_ARG_NONNULL(1, 2);
6106    EAPI void              evas_object_intercept_clip_set_callback_add    (Evas_Object *obj, Evas_Object_Intercept_Clip_Set_Cb func, const void *data) EINA_ARG_NONNULL(1, 2);
6107    EAPI void             *evas_object_intercept_clip_set_callback_del    (Evas_Object *obj, Evas_Object_Intercept_Clip_Set_Cb func) EINA_ARG_NONNULL(1, 2);
6108    EAPI void              evas_object_intercept_clip_unset_callback_add  (Evas_Object *obj, Evas_Object_Intercept_Clip_Unset_Cb func, const void *data) EINA_ARG_NONNULL(1, 2);
6109    EAPI void             *evas_object_intercept_clip_unset_callback_del  (Evas_Object *obj, Evas_Object_Intercept_Clip_Unset_Cb func) EINA_ARG_NONNULL(1, 2);
6110
6111 /**
6112  * @}
6113  */
6114
6115 /**
6116  * @defgroup Evas_Object_Specific Specific Object Functions
6117  *
6118  * Functions that work on specific objects.
6119  *
6120  */
6121
6122 /**
6123  * @defgroup Evas_Object_Rectangle Rectangle Object Functions
6124  *
6125  * @brief Function to create evas rectangle objects.
6126  *
6127  * This function may seem useless given there are no functions to manipulate
6128  * the created rectangle, however the rectangle is actually very useful and can
6129  * be manipulate using the generic @ref Evas_Object_Group
6130  * "evas object functions".
6131  *
6132  * For an example of use of an evas_object_rectangle see @ref
6133  * Example_Evas_Object_Manipulation "here".
6134  *
6135  * @ingroup Evas_Object_Specific
6136  */
6137
6138 /**
6139  * Adds a rectangle to the given evas.
6140  * @param   e The given evas.
6141  * @return  The new rectangle object.
6142  *
6143  * @ingroup Evas_Object_Rectangle
6144  */
6145 EAPI Evas_Object      *evas_object_rectangle_add         (Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
6146
6147 /**
6148  * @defgroup Evas_Object_Image Image Object Functions
6149  *
6150  * Here are grouped together functions used to create and manipulate
6151  * image objects. They are available to whichever occasion one needs
6152  * complex imagery on a GUI that could not be achieved by the other
6153  * Evas' primitive object types, or to make image manipulations.
6154  *
6155  * Evas will support whichever image file types it was compiled with
6156  * support to (its image loaders) -- check your software packager for
6157  * that information and see
6158  * evas_object_image_extension_can_load_get().
6159  *
6160  * @section Evas_Object_Image_Basics Image object basics
6161  *
6162  * The most common use of image objects -- to display an image on the
6163  * canvas -- is achieved by a common function triplet:
6164  * @code
6165  * img = evas_object_image_add(canvas);
6166  * evas_object_image_file_set(img, "path/to/img", NULL);
6167  * evas_object_image_fill_set(img, 0, 0, w, h);
6168  * @endcode
6169  * The first function, naturally, is creating the image object. Then,
6170  * one must set an source file on it, so that it knows where to fetch
6171  * image data from. Next, one must set <b>how to fill the image
6172  * object's area</b> with that given pixel data. One could use just a
6173  * sub-region of the original image or even have it tiled repeatedly
6174  * on the image object. For the common case of having the whole source
6175  * image to be displayed on the image object, streched to the
6176  * destination's size, there's also a function helper, to be used
6177  * instead of evas_object_image_fill_set():
6178  * @code
6179  * evas_object_image_filled_set(img, EINA_TRUE);
6180  * @endcode
6181  * See those functions' documentation for more details.
6182  *
6183  * @section Evas_Object_Image_Scale Scale and resizing
6184  *
6185  * Resizing of image objects will scale their respective source images
6186  * to their areas, if they are set to "fill" the object's area
6187  * (evas_object_image_filled_set()). If the user wants any control on
6188  * the aspect ratio of an image for different sizes, he/she has to
6189  * take care of that themselves. There are functions to make images to
6190  * get loaded scaled (up or down) in memory, already, if the user is
6191  * going to use them at pre-determined sizes and wants to save
6192  * computations.
6193  *
6194  * Evas has even a scale cache, which will take care of caching scaled
6195  * versions of images with more often usage/hits. Finally, one can
6196  * have images being rescaled @b smoothly by Evas (more
6197  * computationally expensive) or not.
6198  *
6199  * @section Evas_Object_Image_Performance Performance hints
6200  *
6201  * When dealing with image objects, there are some tricks to boost the
6202  * performance of your application, if it does intense image loading
6203  * and/or manipulations, as in animations on a UI.
6204  *
6205  * @subsection Evas_Object_Image_Load Load hints
6206  *
6207  * In image viewer applications, for example, the user will be looking
6208  * at a given image, at full size, and will desire that the navigation
6209  * to the adjacent images on his/her album be fluid and fast. Thus,
6210  * while displaying a given image, the program can be on the
6211  * background loading the next and previous imagens already, so that
6212  * displaying them on the sequence is just a matter of repainting the
6213  * screen (and not decoding image data).
6214  *
6215  * Evas addresses this issue with <b>image pre-loading</b>. The code
6216  * for the situation above would be something like the following:
6217  * @code
6218  * prev = evas_object_image_filled_add(canvas);
6219  * evas_object_image_file_set(prev, "/path/to/prev", NULL);
6220  * evas_object_image_preload(prev, EINA_TRUE);
6221  *
6222  * next = evas_object_image_filled_add(canvas);
6223  * evas_object_image_file_set(next, "/path/to/next", NULL);
6224  * evas_object_image_preload(next, EINA_TRUE);
6225  * @endcode
6226  *
6227  * If you're loading images which are too big, consider setting
6228  * previously it's loading size to something smaller, in case you
6229  * won't expose them in real size. It may speed up the loading
6230  * considerably:
6231  * @code
6232  * //to load a scaled down version of the image in memory, if that's
6233  * //the size you'll be displaying it anyway
6234  * evas_object_image_load_scale_down_set(img, zoom);
6235  *
6236  * //optional: if you know you'll be showing a sub-set of the image's
6237  * //pixels, you can avoid loading the complementary data
6238  * evas_object_image_load_region_set(img, x, y, w, h);
6239  * @endcode
6240  * Refer to Elementary's Photocam widget for a high level (smart)
6241  * object which does lots of loading speed-ups for you.
6242  *
6243  * @subsection Evas_Object_Image_Animation Animation hints
6244  *
6245  * If you want to animate image objects on a UI (what you'd get by
6246  * concomitant usage of other libraries, like Ecore and Edje), there
6247  * are also some tips on how to boost the performance of your
6248  * application. If the animation involves resizing of an image (thus,
6249  * re-scaling), you'd better turn off smooth scaling on it @b during
6250  * the animation, turning it back on afterwrads, for less
6251  * computations. Also, in this case you'd better flag the image object
6252  * in question not to cache scaled versions of it:
6253  * @code
6254  * evas_object_image_scale_hint_set(wd->img, EVAS_IMAGE_SCALE_HINT_DYNAMIC);
6255  *
6256  * // resizing takes place in between
6257  *
6258  * evas_object_image_scale_hint_set(wd->img, EVAS_IMAGE_SCALE_HINT_STATIC);
6259  * @endcode
6260  *
6261  * Finally, movement of opaque images through the canvas is less
6262  * expensive than of translucid ones, because of blending
6263  * computations.
6264  *
6265  * @section Evas_Object_Image_Borders Borders
6266  *
6267  * Evas provides facilities for one to specify an image's region to be
6268  * treated specially -- as "borders". This will make those regions be
6269  * treated specially on resizing scales, by keeping their aspect. This
6270  * makes setting frames around other objects on UIs easy.
6271  * See the following figures for a visual explanation:\n
6272  * @htmlonly
6273  * <img src="image-borders.png" style="max-width: 100%;" />
6274  * <a href="image-borders.png">Full-size</a>
6275  * @endhtmlonly
6276  * @image rtf image-borders.png
6277  * @image latex image-borders.eps width=\textwidth
6278  * @htmlonly
6279  * <img src="border-effect.png" style="max-width: 100%;" />
6280  * <a href="border-effect.png">Full-size</a>
6281  * @endhtmlonly
6282  * @image rtf border-effect.png
6283  * @image latex border-effect.eps width=\textwidth
6284  *
6285  * @section Evas_Object_Image_Manipulation Manipulating pixels
6286  *
6287  * Evas image objects can be used to manipulate raw pixels in many
6288  * ways.  The meaning of the data in the pixel arrays will depend on
6289  * the image's color space, be warned (see next section). You can set
6290  * your own data as an image's pixel data, fetch an image's pixel data
6291  * for saving/altering, convert images between different color spaces
6292  * and even advanced operations like setting a native surface as image
6293  * objecs' data.
6294  *
6295  * @section Evas_Object_Image_Color_Spaces Color spaces
6296  *
6297  * Image objects may return or accept "image data" in multiple
6298  * formats. This is based on the color space of an object. Here is a
6299  * rundown on formats:
6300  *
6301  * - #EVAS_COLORSPACE_ARGB8888:
6302  *   .
6303  *   This pixel format is a linear block of pixels, starting at the
6304  *   top-left row by row until the bottom right of the image or pixel
6305  *   region. All pixels are 32-bit unsigned int's with the high-byte
6306  *   being alpha and the low byte being blue in the format ARGB. Alpha
6307  *   may or may not be used by evas depending on the alpha flag of the
6308  *   image, but if not used, should be set to 0xff anyway.
6309  *   \n\n
6310  *   This colorspace uses premultiplied alpha. That means that R, G
6311  *   and B cannot exceed A in value. The conversion from
6312  *   non-premultiplied colorspace is:
6313  *   \n\n
6314  *   R = (r * a) / 255; G = (g * a) / 255; B = (b * a) / 255;
6315  *   \n\n
6316  *   So 50% transparent blue will be: 0x80000080. This will not be
6317  *   "dark" - just 50% transparent. Values are 0 == black, 255 ==
6318  *   solid or full red, green or blue.
6319  *
6320  * - #EVAS_COLORSPACE_YCBCR422P601_PL:
6321  *   .
6322  *   This is a pointer-list indirected set of YUV (YCbCr) pixel
6323  *   data. This means that the data returned or set is not actual
6324  *   pixel data, but pointers TO lines of pixel data. The list of
6325  *   pointers will first be N rows of pointers to the Y plane -
6326  *   pointing to the first pixel at the start of each row in the Y
6327  *   plane. N is the height of the image data in pixels. Each pixel in
6328  *   the Y, U and V planes is 1 byte exactly, packed. The next N / 2
6329  *   pointers will point to rows in the U plane, and the next N / 2
6330  *   pointers will point to the V plane rows. U and V planes are half
6331  *   the horizontal and vertical resolution of the Y plane.
6332  *   \n\n
6333  *   Row order is top to bottom and row pixels are stored left to
6334  *   right.
6335  *   \n\n
6336  *   There is a limitation that these images MUST be a multiple of 2
6337  *   pixels in size horizontally or vertically. This is due to the U
6338  *   and V planes being half resolution. Also note that this assumes
6339  *   the itu601 YUV colorspace specification. This is defined for
6340  *   standard television and mpeg streams. HDTV may use the itu709
6341  *   specification.
6342  *   \n\n
6343  *   Values are 0 to 255, indicating full or no signal in that plane
6344  *   respectively.
6345  *
6346  * - #EVAS_COLORSPACE_YCBCR422P709_PL:
6347  *   .
6348  *   Not implemented yet.
6349  *
6350  * - #EVAS_COLORSPACE_RGB565_A5P:
6351  *   .
6352  *   In the process of being implemented in 1 engine only. This may
6353  *   change.
6354  *   \n\n
6355  *   This is a pointer to image data for 16-bit half-word pixel data
6356  *   in 16bpp RGB 565 format (5 bits red, 6 bits green, 5 bits blue),
6357  *   with the high-byte containing red and the low byte containing
6358  *   blue, per pixel. This data is packed row by row from the top-left
6359  *   to the bottom right.
6360  *   \n\n
6361  *   If the image has an alpha channel enabled there will be an extra
6362  *   alpha plane after the color pixel plane. If not, then this data
6363  *   will not exist and should not be accessed in any way. This plane
6364  *   is a set of pixels with 1 byte per pixel defining the alpha
6365  *   values of all pixels in the image from the top-left to the bottom
6366  *   right of the image, row by row. Even though the values of the
6367  *   alpha pixels can be 0 to 255, only values 0 through to 32 are
6368  *   used, 32 being solid and 0 being transparent.
6369  *   \n\n
6370  *   RGB values can be 0 to 31 for red and blue and 0 to 63 for green,
6371  *   with 0 being black and 31 or 63 being full red, green or blue
6372  *   respectively. This colorspace is also pre-multiplied like
6373  *   EVAS_COLORSPACE_ARGB8888 so:
6374  *   \n\n
6375  *   R = (r * a) / 32; G = (g * a) / 32; B = (b * a) / 32;
6376  *
6377  * - #EVAS_COLORSPACE_GRY8:
6378  *   .
6379  *   The image is just a alpha mask (8 bit's per pixel). This is used
6380  *   for alpha masking.
6381  *
6382  * Some examples on this group of functions can be found @ref
6383  * Example_Evas_Images "here".
6384  *
6385  * @ingroup Evas_Object_Specific
6386  */
6387
6388 /**
6389  * @addtogroup Evas_Object_Image
6390  * @{
6391  */
6392
6393 typedef void (*Evas_Object_Image_Pixels_Get_Cb) (void *data, Evas_Object *o);
6394
6395
6396 /**
6397  * Creates a new image object on the given Evas @p e canvas.
6398  *
6399  * @param e The given canvas.
6400  * @return The created image object handle.
6401  *
6402  * @note If you intend to @b display an image somehow in a GUI,
6403  * besides binding it to a real image file/source (with
6404  * evas_object_image_file_set(), for example), you'll have to tell
6405  * this image object how to fill its space with the pixels it can get
6406  * from the source. See evas_object_image_filled_add(), for a helper
6407  * on the common case of scaling up an image source to the whole area
6408  * of the image object.
6409  *
6410  * @see evas_object_image_fill_set()
6411  *
6412  * Example:
6413  * @code
6414  * img = evas_object_image_add(canvas);
6415  * evas_object_image_file_set(img, "/path/to/img", NULL);
6416  * @endcode
6417  */
6418 EAPI Evas_Object             *evas_object_image_add                    (Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
6419
6420 /**
6421  * Creates a new image object that @b automatically scales its bound
6422  * image to the object's area, on both axis.
6423  *
6424  * @param e The given canvas.
6425  * @return The created image object handle.
6426  *
6427  * This is a helper function around evas_object_image_add() and
6428  * evas_object_image_filled_set(). It has the same effect of applying
6429  * those functions in sequence, which is a very common use case.
6430  *
6431  * @note Whenever this object gets resized, the bound image will be
6432  * rescaled, too.
6433  *
6434  * @see evas_object_image_add()
6435  * @see evas_object_image_filled_set()
6436  * @see evas_object_image_fill_set()
6437  */
6438 EAPI Evas_Object             *evas_object_image_filled_add             (Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
6439
6440
6441 /**
6442  * Sets the data for an image from memory to be loaded
6443  *
6444  * This is the same as evas_object_image_file_set() but the file to be loaded
6445  * may exist at an address in memory (the data for the file, not the filename
6446  * itself). The @p data at the address is copied and stored for future use, so
6447  * no @p data needs to be kept after this call is made. It will be managed and
6448  * freed for you when no longer needed. The @p size is limited to 2 gigabytes
6449  * in size, and must be greater than 0. A NULL @p data pointer is also invalid.
6450  * Set the filename to NULL to reset to empty state and have the image file
6451  * data freed from memory using evas_object_image_file_set().
6452  *
6453  * The @p format is optional (pass NULL if you don't need/use it). It is used
6454  * to help Evas guess better which loader to use for the data. It may simply
6455  * be the "extension" of the file as it would normally be on disk such as
6456  * "jpg" or "png" or "gif" etc.
6457  *
6458  * @param obj The given image object.
6459  * @param data The image file data address
6460  * @param size The size of the image file data in bytes
6461  * @param format The format of the file (optional), or @c NULL if not needed
6462  * @param key The image key in file, or @c NULL.
6463  */
6464 EAPI void                     evas_object_image_memfile_set            (Evas_Object *obj, void *data, int size, char *format, char *key) EINA_ARG_NONNULL(1, 2);
6465
6466 /**
6467  * Set the source file from where an image object must fetch the real
6468  * image data (it may be an Eet file, besides pure image ones).
6469  *
6470  * @param obj The given image object.
6471  * @param file The image file path.
6472  * @param key The image key in @p file (if its an Eet one), or @c
6473  * NULL, otherwise.
6474  *
6475  * If the file supports multiple data stored in it (as Eet files do),
6476  * you can specify the key to be used as the index of the image in
6477  * this file.
6478  *
6479  * Example:
6480  * @code
6481  * img = evas_object_image_add(canvas);
6482  * evas_object_image_file_set(img, "/path/to/img", NULL);
6483  * err = evas_object_image_load_error_get(img);
6484  * if (err != EVAS_LOAD_ERROR_NONE)
6485  *   {
6486  *      fprintf(stderr, "could not load image '%s'. error string is \"%s\"\n",
6487  *              valid_path, evas_load_error_str(err));
6488  *   }
6489  * else
6490  *   {
6491  *      evas_object_image_fill_set(img, 0, 0, w, h);
6492  *      evas_object_resize(img, w, h);
6493  *      evas_object_show(img);
6494  *   }
6495  * @endcode
6496  */
6497 EAPI void                     evas_object_image_file_set               (Evas_Object *obj, const char *file, const char *key) EINA_ARG_NONNULL(1);
6498
6499 /**
6500  * Retrieve the source file from where an image object is to fetch the
6501  * real image data (it may be an Eet file, besides pure image ones).
6502  *
6503  * @param obj The given image object.
6504  * @param file Location to store the image file path.
6505  * @param key Location to store the image key (if @p file is an Eet
6506  * one).
6507  *
6508  * You must @b not modify the strings on the returned pointers.
6509  *
6510  * @note Use @c NULL pointers on the file components you're not
6511  * interested in: they'll be ignored by the function.
6512  */
6513 EAPI void                     evas_object_image_file_get               (const Evas_Object *obj, const char **file, const char **key) EINA_ARG_NONNULL(1, 2);
6514
6515 /**
6516  * Set the dimensions for an image object's border, a region which @b
6517  * won't ever be scaled together with its center.
6518  *
6519  * @param obj The given image object.
6520  * @param l The border's left width.
6521  * @param r The border's right width.
6522  * @param t The border's top width.
6523  * @param b The border's bottom width.
6524  *
6525  * When Evas is rendering, an image source may be scaled to fit the
6526  * size of its image object. This function sets an area from the
6527  * borders of the image inwards which is @b not to be scaled. This
6528  * function is useful for making frames and for widget theming, where,
6529  * for example, buttons may be of varying sizes, but their border size
6530  * must remain constant.
6531  *
6532  * The units used for @p l, @p r, @p t and @p b are canvas units.
6533  *
6534  * @note The border region itself @b may be scaled by the
6535  * evas_object_image_border_scale_set() function.
6536  *
6537  * @note By default, image objects have no borders set, i. e. @c l, @c
6538  * r, @c t and @c b start as @c 0.
6539  *
6540  * See the following figures for visual explanation:\n
6541  * @htmlonly
6542  * <img src="image-borders.png" style="max-width: 100%;" />
6543  * <a href="image-borders.png">Full-size</a>
6544  * @endhtmlonly
6545  * @image rtf image-borders.png
6546  * @image latex image-borders.eps width=\textwidth
6547  * @htmlonly
6548  * <img src="border-effect.png" style="max-width: 100%;" />
6549  * <a href="border-effect.png">Full-size</a>
6550  * @endhtmlonly
6551  * @image rtf border-effect.png
6552  * @image latex border-effect.eps width=\textwidth
6553  *
6554  * @see evas_object_image_border_get()
6555  * @see evas_object_image_border_center_fill_set()
6556  */
6557 EAPI void                     evas_object_image_border_set             (Evas_Object *obj, int l, int r, int t, int b) EINA_ARG_NONNULL(1);
6558
6559 /**
6560  * Retrieve the dimensions for an image object's border, a region
6561  * which @b won't ever be scaled together with its center.
6562  *
6563  * @param obj The given image object.
6564  * @param l Location to store the border's left width in.
6565  * @param r Location to store the border's right width in.
6566  * @param t Location to store the border's top width in.
6567  * @param b Location to store the border's bottom width in.
6568  *
6569  * @note Use @c NULL pointers on the border components you're not
6570  * interested in: they'll be ignored by the function.
6571  *
6572  * See @ref evas_object_image_border_set() for more details.
6573  */
6574 EAPI void                     evas_object_image_border_get             (const Evas_Object *obj, int *l, int *r, int *t, int *b) EINA_ARG_NONNULL(1);
6575
6576 /**
6577  * Sets @b how the center part of the given image object (not the
6578  * borders) should be drawn when Evas is rendering it.
6579  *
6580  * @param obj The given image object.
6581  * @param fill Fill mode of the center region of @p obj (a value in
6582  * #Evas_Border_Fill_Mode).
6583  *
6584  * This function sets how the center part of the image object's source
6585  * image is to be drawn, which must be one of the values in
6586  * #Evas_Border_Fill_Mode. By center we mean the complementary part of
6587  * that defined by evas_object_image_border_set(). This one is very
6588  * useful for making frames and decorations. You would most probably
6589  * also be using a filled image (as in evas_object_image_filled_set())
6590  * to use as a frame.
6591  *
6592  * @see evas_object_image_border_center_fill_get()
6593  */
6594 EAPI void                     evas_object_image_border_center_fill_set (Evas_Object *obj, Evas_Border_Fill_Mode fill) EINA_ARG_NONNULL(1);
6595
6596 /**
6597  * Retrieves @b how the center part of the given image object (not the
6598  * borders) is to be drawn when Evas is rendering it.
6599  *
6600  * @param obj The given image object.
6601  * @return fill Fill mode of the center region of @p obj (a value in
6602  * #Evas_Border_Fill_Mode).
6603  *
6604  * See @ref evas_object_image_fill_set() for more details.
6605  */
6606 EAPI Evas_Border_Fill_Mode    evas_object_image_border_center_fill_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
6607
6608 /**
6609  * Set whether the image object's fill property should track the
6610  * object's size.
6611  *
6612  * @param obj The given image object.
6613  * @param setting @c EINA_TRUE, to make the fill property follow
6614  *        object size or @c EINA_FALSE, otherwise
6615  *
6616  * If @p setting is @c EINA_TRUE, then every evas_object_resize() will
6617  * @b automatically trigger a call to evas_object_image_fill_set()
6618  * with the that new size (and @c 0, @c 0 as source image's origin),
6619  * so the bound image will fill the whole object's area.
6620  *
6621  * @see evas_object_image_filled_add()
6622  * @see evas_object_image_fill_get()
6623  */
6624 EAPI void                     evas_object_image_filled_set             (Evas_Object *obj, Eina_Bool setting) EINA_ARG_NONNULL(1);
6625
6626 /**
6627  * Retrieve whether the image object's fill property should track the
6628  * object's size.
6629  *
6630  * @param obj The given image object.
6631  * @return @c EINA_TRUE if it is tracking, @c EINA_FALSE, if not (and
6632  *         evas_object_fill_set() must be called manually).
6633  *
6634  * @see evas_object_image_filled_set() for more information
6635  */
6636 EAPI Eina_Bool                evas_object_image_filled_get             (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
6637
6638 /**
6639  * Sets the scaling factor (multiplier) for the borders of an image
6640  * object.
6641  *
6642  * @param obj The given image object.
6643  * @param scale The scale factor (default is @c 1.0 - i.e. no scaling)
6644  *
6645  * @see evas_object_image_border_set()
6646  * @see evas_object_image_border_scale_get()
6647  */
6648 EAPI void                     evas_object_image_border_scale_set       (Evas_Object *obj, double scale);
6649
6650 /**
6651  * Retrieves the scaling factor (multiplier) for the borders of an
6652  * image object.
6653  *
6654  * @param obj The given image object.
6655  * @return The scale factor set for its borders
6656  *
6657  * @see evas_object_image_border_set()
6658  * @see evas_object_image_border_scale_set()
6659  */
6660 EAPI double                   evas_object_image_border_scale_get       (const Evas_Object *obj);
6661
6662 /**
6663  * Set how to fill an image object's drawing rectangle given the
6664  * (real) image bound to it.
6665  *
6666  * @param obj The given image object to operate on.
6667  * @param x The x coordinate (from the top left corner of the bound
6668  *          image) to start drawing from.
6669  * @param y The y coordinate (from the top left corner of the bound
6670  *          image) to start drawing from.
6671  * @param w The width the bound image will be displayed at.
6672  * @param h The height the bound image will be displayed at.
6673  *
6674  * Note that if @p w or @p h are smaller than the dimensions of
6675  * @p obj, the displayed image will be @b tiled around the object's
6676  * area. To have only one copy of the bound image drawn, @p x and @p y
6677  * must be 0 and @p w and @p h need to be the exact width and height
6678  * of the image object itself, respectively.
6679  *
6680  * See the following image to better understand the effects of this
6681  * call. On this diagram, both image object and original image source
6682  * have @c a x @c a dimentions and the image itself is a circle, with
6683  * empty space around it:
6684  *
6685  * @image html image-fill.png
6686  * @image rtf image-fill.png
6687  * @image latex image-fill.eps
6688  *
6689  * @warning The default values for the fill parameters are @p x = 0,
6690  * @p y = 0, @p w = 0 and @p h = 0. Thus, if you're not using the
6691  * evas_object_image_filled_add() helper and want your image
6692  * displayed, you'll have to set valid values with this fuction on
6693  * your object.
6694  *
6695  * @note evas_object_image_filled_set() is a helper function which
6696  * will @b override the values set here automatically, for you, in a
6697  * given way.
6698  */
6699 EAPI void                     evas_object_image_fill_set               (Evas_Object *obj, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h) EINA_ARG_NONNULL(1);
6700
6701 /**
6702  * Retrieve how an image object is to fill its drawing rectangle,
6703  * given the (real) image bound to it.
6704  *
6705  * @param obj The given image object.
6706  * @param x Location to store the x coordinate (from the top left
6707  *          corner of the bound image) to start drawing from.
6708  * @param y Location to store the y coordinate (from the top left
6709  *          corner of the bound image) to start drawing from.
6710  * @param w Location to store the width the bound image is to be
6711  *          displayed at.
6712  * @param h Location to store the height the bound image is to be
6713  *          displayed at.
6714  *
6715  * @note Use @c NULL pointers on the fill components you're not
6716  * interested in: they'll be ignored by the function.
6717  *
6718  * See @ref evas_object_image_fill_set() for more details.
6719  */
6720 EAPI void                     evas_object_image_fill_get               (const Evas_Object *obj, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h) EINA_ARG_NONNULL(1);
6721
6722 /**
6723  * Sets the tiling mode for the given evas image object's fill.
6724  * @param   obj   The given evas image object.
6725  * @param   spread One of EVAS_TEXTURE_REFLECT, EVAS_TEXTURE_REPEAT,
6726  * EVAS_TEXTURE_RESTRICT, or EVAS_TEXTURE_PAD.
6727  */
6728 EAPI void                     evas_object_image_fill_spread_set        (Evas_Object *obj, Evas_Fill_Spread spread) EINA_ARG_NONNULL(1);
6729
6730 /**
6731  * Retrieves the spread (tiling mode) for the given image object's
6732  * fill.
6733  *
6734  * @param   obj The given evas image object.
6735  * @return  The current spread mode of the image object.
6736  */
6737 EAPI Evas_Fill_Spread         evas_object_image_fill_spread_get        (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
6738
6739 /**
6740  * Sets the size of the given image object.
6741  *
6742  * @param obj The given image object.
6743  * @param w The new width of the image.
6744  * @param h The new height of the image.
6745  *
6746  * This function will scale down or crop the image so that it is
6747  * treated as if it were at the given size. If the size given is
6748  * smaller than the image, it will be cropped. If the size given is
6749  * larger, then the image will be treated as if it were in the upper
6750  * left hand corner of a larger image that is otherwise transparent.
6751  */
6752 EAPI void                     evas_object_image_size_set               (Evas_Object *obj, int w, int h) EINA_ARG_NONNULL(1);
6753
6754 /**
6755  * Retrieves the size of the given image object.
6756  *
6757  * @param obj The given image object.
6758  * @param w Location to store the width of the image in, or @c NULL.
6759  * @param h Location to store the height of the image in, or @c NULL.
6760  *
6761  * See @ref evas_object_image_size_set() for more details.
6762  */
6763 EAPI void                     evas_object_image_size_get               (const Evas_Object *obj, int *w, int *h) EINA_ARG_NONNULL(1);
6764
6765 /**
6766  * Retrieves the row stride of the given image object.
6767  *
6768  * @param obj The given image object.
6769  * @return The stride of the image (<b>in bytes</b>).
6770  *
6771  * The row stride is the number of bytes between the start of a row
6772  * and the start of the next row for image data.
6773  */
6774 EAPI int                      evas_object_image_stride_get             (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
6775
6776 /**
6777  * Retrieves a number representing any error that occurred during the
6778  * last loading of the given image object's source image.
6779  *
6780  * @param obj The given image object.
6781  * @return A value giving the last error that occurred. It should be
6782  *         one of the #Evas_Load_Error values. #EVAS_LOAD_ERROR_NONE
6783  *         is returned if there was no error.
6784  */
6785 EAPI Evas_Load_Error          evas_object_image_load_error_get         (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
6786
6787 /**
6788  * Sets the raw image data of the given image object.
6789  *
6790  * @param obj The given image object.
6791  * @param data The raw data, or @c NULL.
6792  *
6793  * Note that the raw data must be of the same size (see
6794  * evas_object_image_size_set(), which has to be called @b before this
6795  * one) and colorspace (see evas_object_image_colorspace_set()) of the
6796  * image. If data is @c NULL, the current image data will be
6797  * freed. Naturally, if one does not set an image object's data
6798  * manually, it will still have one, allocated by Evas.
6799  *
6800  * @see evas_object_image_data_get()
6801  */
6802 EAPI void                     evas_object_image_data_set               (Evas_Object *obj, void *data) EINA_ARG_NONNULL(1);
6803
6804 /**
6805  * Get a pointer to the raw image data of the given image object.
6806  *
6807  * @param obj The given image object.
6808  * @param for_writing Whether the data being retrieved will be
6809  *        modified (@c EINA_TRUE) or not (@c EINA_FALSE).
6810  * @return The raw image data.
6811  *
6812  * This function returns a pointer to an image object's internal pixel
6813  * buffer, for reading only or read/write. If you request it for
6814  * writing, the image will be marked dirty so that it gets redrawn at
6815  * the next update.
6816  *
6817  * Each time you call this function on an image object, its data
6818  * buffer will have an internal reference counter
6819  * incremented. Decrement it back by using
6820  * evas_object_image_data_set(). This is specially important for the
6821  * directfb Evas engine.
6822  *
6823  * This is best suited for when you want to modify an existing image,
6824  * without changing its dimensions.
6825  *
6826  * @note The contents' formart returned by it depend on the color
6827  * space of the given image object.
6828  *
6829  * @note You may want to use evas_object_image_data_update_add() to
6830  * inform data changes, if you did any.
6831  *
6832  * @see evas_object_image_data_set()
6833  */
6834 EAPI void                    *evas_object_image_data_get               (const Evas_Object *obj, Eina_Bool for_writing) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
6835
6836 /**
6837  * Converts the raw image data of the given image object to the
6838  * specified colorspace.
6839  *
6840  * Note that this function does not modify the raw image data.  If the
6841  * requested colorspace is the same as the image colorspace nothing is
6842  * done and NULL is returned. You should use
6843  * evas_object_image_colorspace_get() to check the current image
6844  * colorspace.
6845  *
6846  * See @ref evas_object_image_colorspace_get.
6847  *
6848  * @param obj The given image object.
6849  * @param to_cspace The colorspace to which the image raw data will be converted.
6850  * @return data A newly allocated data in the format specified by to_cspace.
6851  */
6852 EAPI void                    *evas_object_image_data_convert           (Evas_Object *obj, Evas_Colorspace to_cspace) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
6853
6854 /**
6855  * Replaces the raw image data of the given image object.
6856  *
6857  * @param obj The given image object.
6858  * @param data The raw data to replace.
6859  *
6860  * This function lets the application replace an image object's
6861  * internal pixel buffer with an user-allocated one. For best results,
6862  * you should generally first call evas_object_image_size_set() with
6863  * the width and height for the new buffer.
6864  *
6865  * This call is best suited for when you will be using image data with
6866  * different dimensions than the existing image data, if any. If you
6867  * only need to modify the existing image in some fashion, then using
6868  * evas_object_image_data_get() is probably what you are after.
6869  *
6870  * Note that the caller is responsible for freeing the buffer when
6871  * finished with it, as user-set image data will not be automatically
6872  * freed when the image object is deleted.
6873  *
6874  * See @ref evas_object_image_data_get() for more details.
6875  *
6876  */
6877 EAPI void                     evas_object_image_data_copy_set          (Evas_Object *obj, void *data) EINA_ARG_NONNULL(1);
6878
6879 /**
6880  * Mark a sub-region of the given image object to be redrawn.
6881  *
6882  * @param obj The given image object.
6883  * @param x X-offset of the region to be updated.
6884  * @param y Y-offset of the region to be updated.
6885  * @param w Width of the region to be updated.
6886  * @param h Height of the region to be updated.
6887  *
6888  * This function schedules a particular rectangular region of an image
6889  * object to be updated (redrawn) at the next rendering cycle.
6890  */
6891 EAPI void                     evas_object_image_data_update_add        (Evas_Object *obj, int x, int y, int w, int h) EINA_ARG_NONNULL(1);
6892
6893 /**
6894  * Enable or disable alpha channel usage on the given image object.
6895  *
6896  * @param obj The given image object.
6897  * @param has_alpha Whether to use alpha channel (@c EINA_TRUE) data
6898  * or not (@c EINA_FALSE).
6899  *
6900  * This function sets a flag on an image object indicating whether or
6901  * not to use alpha channel data. A value of @c EINA_TRUE makes it use
6902  * alpha channel data, and @c EINA_FALSE makes it ignore that
6903  * data. Note that this has nothing to do with an object's color as
6904  * manipulated by evas_object_color_set().
6905  *
6906  * @see evas_object_image_alpha_get()
6907  */
6908 EAPI void                     evas_object_image_alpha_set              (Evas_Object *obj, Eina_Bool has_alpha) EINA_ARG_NONNULL(1);
6909
6910 /**
6911  * Retrieve whether alpha channel data is being used on the given
6912  * image object.
6913  *
6914  * @param obj The given image object.
6915  * @return Whether the alpha channel data is being used (@c EINA_TRUE)
6916  * or not (@c EINA_FALSE).
6917  *
6918  * This function returns @c EINA_TRUE if the image object's alpha
6919  * channel is being used, or @c EINA_FALSE otherwise.
6920  *
6921  * See @ref evas_object_image_alpha_set() for more details.
6922  */
6923 EAPI Eina_Bool                evas_object_image_alpha_get              (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
6924
6925 /**
6926  * Sets whether to use high-quality image scaling algorithm on the
6927  * given image object.
6928  *
6929  * @param obj The given image object.
6930  * @param smooth_scale Whether to use smooth scale or not.
6931  *
6932  * When enabled, a higher quality image scaling algorithm is used when
6933  * scaling images to sizes other than the source image's original
6934  * one. This gives better results but is more computationally
6935  * expensive.
6936  *
6937  * @note Image objects get created originally with smooth scaling @b
6938  * on.
6939  *
6940  * @see evas_object_image_smooth_scale_get()
6941  */
6942 EAPI void                     evas_object_image_smooth_scale_set       (Evas_Object *obj, Eina_Bool smooth_scale) EINA_ARG_NONNULL(1);
6943
6944 /**
6945  * Retrieves whether the given image object is using high-quality
6946  * image scaling algorithm.
6947  *
6948  * @param obj The given image object.
6949  * @return Whether smooth scale is being used.
6950  *
6951  * See @ref evas_object_image_smooth_scale_set() for more details.
6952  */
6953 EAPI Eina_Bool                evas_object_image_smooth_scale_get       (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
6954
6955 /**
6956  * Preload an image object's image data in the background
6957  *
6958  * @param obj The given image object.
6959  * @param cancel @c EINA_FALSE will add it the preloading work queue,
6960  *               @c EINA_TRUE will remove it (if it was issued before).
6961  *
6962  * This function requests the preload of the data image in the
6963  * background. The work is queued before being processed (because
6964  * there might be other pending requests of this type).
6965  *
6966  * Whenever the image data gets loaded, Evas will call
6967  * #EVAS_CALLBACK_IMAGE_PRELOADED registered callbacks on @p obj (what
6968  * may be immediately, if the data was already preloaded before).
6969  *
6970  * Use @c EINA_TRUE for @p cancel on scenarios where you don't need
6971  * the image data preloaded anymore.
6972  *
6973  * @note Any evas_object_show() call after evas_object_image_preload()
6974  * will make the latter to be @b cancelled, with the loading process
6975  * now taking place @b synchronously (and, thus, blocking the return
6976  * of the former until the image is loaded). It is highly advisable,
6977  * then, that the user preload an image with it being @b hidden, just
6978  * to be shown on the #EVAS_CALLBACK_IMAGE_PRELOADED event's callback.
6979  */
6980 EAPI void                     evas_object_image_preload                (Evas_Object *obj, Eina_Bool cancel) EINA_ARG_NONNULL(1);
6981
6982 /**
6983  * Reload an image object's image data.
6984  *
6985  * @param obj The given image object pointer.
6986  *
6987  * This function reloads the image data bound to image object @p obj.
6988  */
6989 EAPI void                     evas_object_image_reload                 (Evas_Object *obj) EINA_ARG_NONNULL(1);
6990
6991 /**
6992  * Save the given image object's contents to an (image) file.
6993  *
6994  * @param obj The given image object.
6995  * @param file The filename to be used to save the image (extension
6996  *        obligatory).
6997  * @param key The image key in the file (if an Eet one), or @c NULL,
6998  *        otherwise.
6999  * @param flags String containing the flags to be used (@c NULL for
7000  *        none).
7001  *
7002  * The extension suffix on @p file will determine which <b>saver
7003  * module</b> Evas is to use when saving, thus the final file's
7004  * format. If the file supports multiple data stored in it (Eet ones),
7005  * you can specify the key to be used as the index of the image in it.
7006  *
7007  * You can specify some flags when saving the image.  Currently
7008  * acceptable flags are @c quality and @c compress. Eg.: @c
7009  * "quality=100 compress=9"
7010  */
7011 EAPI Eina_Bool                evas_object_image_save                   (const Evas_Object *obj, const char *file, const char *key, const char *flags)  EINA_ARG_NONNULL(1, 2);
7012
7013 /**
7014  * Import pixels from given source to a given canvas image object.
7015  *
7016  * @param obj The given canvas object.
7017  * @param pixels The pixel's source to be imported.
7018  *
7019  * This function imports pixels from a given source to a given canvas image.
7020  *
7021  */
7022 EAPI Eina_Bool                evas_object_image_pixels_import          (Evas_Object *obj, Evas_Pixel_Import_Source *pixels) EINA_ARG_NONNULL(1, 2);
7023
7024 /**
7025  * Set the callback function to get pixels from a canva's image.
7026  *
7027  * @param obj The given canvas pointer.
7028  * @param func The callback function.
7029  * @param data The data pointer to be passed to @a func.
7030  *
7031  * This functions sets a function to be the callback function that get
7032  * pixes from a image of the canvas.
7033  *
7034  */
7035 EAPI void                     evas_object_image_pixels_get_callback_set(Evas_Object *obj, Evas_Object_Image_Pixels_Get_Cb func, void *data) EINA_ARG_NONNULL(1, 2);
7036
7037 /**
7038  * Mark whether the given image object is dirty (needs to be redrawn).
7039  *
7040  * @param obj The given image object.
7041  * @param dirty Whether the image is dirty.
7042  */
7043 EAPI void                     evas_object_image_pixels_dirty_set       (Evas_Object *obj, Eina_Bool dirty) EINA_ARG_NONNULL(1);
7044
7045 /**
7046  * Retrieves whether the given image object is dirty (needs to be redrawn).
7047  *
7048  * @param obj The given image object.
7049  * @return Whether the image is dirty.
7050  */
7051 EAPI Eina_Bool                evas_object_image_pixels_dirty_get       (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
7052
7053 /**
7054  * Set the DPI resolution of an image object's source image.
7055  *
7056  * @param obj The given canvas pointer.
7057  * @param dpi The new DPI resolution.
7058  *
7059  * This function sets the DPI resolution of a given loaded canvas
7060  * image. Most useful for the SVG image loader.
7061  *
7062  * @see evas_object_image_load_dpi_get()
7063  */
7064 EAPI void                     evas_object_image_load_dpi_set           (Evas_Object *obj, double dpi) EINA_ARG_NONNULL(1);
7065
7066 /**
7067  * Get the DPI resolution of a loaded image object in the canvas.
7068  *
7069  * @param obj The given canvas pointer.
7070  * @return The DPI resolution of the given canvas image.
7071  *
7072  * This function returns the DPI resolution of the given canvas image.
7073  *
7074  * @see evas_object_image_load_dpi_set() for more details
7075  */
7076 EAPI double                   evas_object_image_load_dpi_get           (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
7077
7078 /**
7079  * Set the size of a given image object's source image, when loading
7080  * it.
7081  *
7082  * @param obj The given canvas object.
7083  * @param w The new width of the image's load size.
7084  * @param h The new height of the image's load size.
7085  *
7086  * This function sets a new (loading) size for the given canvas
7087  * image.
7088  *
7089  * @see evas_object_image_load_size_get()
7090  */
7091 EAPI void                     evas_object_image_load_size_set          (Evas_Object *obj, int w, int h) EINA_ARG_NONNULL(1);
7092
7093 /**
7094  * Get the size of a given image object's source image, when loading
7095  * it.
7096  *
7097  * @param obj The given image object.
7098  * @param w Where to store the new width of the image's load size.
7099  * @param h Where to store the new height of the image's load size.
7100  *
7101  * @note Use @c NULL pointers on the size components you're not
7102  * interested in: they'll be ignored by the function.
7103  *
7104  * @see evas_object_image_load_size_set() for more details
7105  */
7106 EAPI void                     evas_object_image_load_size_get          (const Evas_Object *obj, int *w, int *h) EINA_ARG_NONNULL(1);
7107
7108 /**
7109  * Set the scale down factor of a given image object's source image,
7110  * when loading it.
7111  *
7112  * @param obj The given image object pointer.
7113  * @param scale_down The scale down factor.
7114  *
7115  * This function sets the scale down factor of a given canvas
7116  * image. Most useful for the SVG image loader.
7117  *
7118  * @see evas_object_image_load_scale_down_get()
7119  */
7120 EAPI void                     evas_object_image_load_scale_down_set    (Evas_Object *obj, int scale_down) EINA_ARG_NONNULL(1);
7121
7122 /**
7123  * get the scale down factor of a given image object's source image,
7124  * when loading it.
7125  *
7126  * @param obj The given image object pointer.
7127  *
7128  * @see evas_object_image_load_scale_down_set() for more details
7129  */
7130 EAPI int                      evas_object_image_load_scale_down_get    (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
7131
7132 /**
7133  * Inform a given image object to load a selective region of its
7134  * source image.
7135  *
7136  * @param obj The given image object pointer.
7137  * @param x X-offset of the region to be loaded.
7138  * @param y Y-offset of the region to be loaded.
7139  * @param w Width of the region to be loaded.
7140  * @param h Height of the region to be loaded.
7141  *
7142  * This function is useful when one is not showing all of an image's
7143  * area on its image object.
7144  *
7145  * @note The image loader for the image format in question has to
7146  * support selective region loading in order to this function to take
7147  * effect.
7148  *
7149  * @see evas_object_image_load_region_get()
7150  */
7151 EAPI void                     evas_object_image_load_region_set        (Evas_Object *obj, int x, int y, int w, int h) EINA_ARG_NONNULL(1);
7152
7153 /**
7154  * Retrieve the coordinates of a given image object's selective
7155  * (source image) load region.
7156  *
7157  * @param obj The given image object pointer.
7158  * @param x Where to store the X-offset of the region to be loaded.
7159  * @param y Where to store the Y-offset of the region to be loaded.
7160  * @param w Where to store the width of the region to be loaded.
7161  * @param h Where to store the height of the region to be loaded.
7162  *
7163  * @note Use @c NULL pointers on the coordinates you're not interested
7164  * in: they'll be ignored by the function.
7165  *
7166  * @see evas_object_image_load_region_get()
7167  */
7168 EAPI void                     evas_object_image_load_region_get        (const Evas_Object *obj, int *x, int *y, int *w, int *h) EINA_ARG_NONNULL(1);
7169
7170 /**
7171  * Define if the orientation information in the image file should be honored.
7172  *
7173  * @param obj The given image object pointer.
7174  * @param enable @p EINA_TRUE means that it should honor the orientation information
7175  * @since 1.1
7176  */
7177 EAPI void                     evas_object_image_load_orientation_set        (Evas_Object *obj, Eina_Bool enable) EINA_ARG_NONNULL(1);
7178
7179 /**
7180  * Get if the orientation information in the image file should be honored.
7181  *
7182  * @param obj The given image object pointer.
7183  * @since 1.1
7184  */
7185 EAPI Eina_Bool                evas_object_image_load_orientation_get        (const Evas_Object *obj) EINA_ARG_NONNULL(1);
7186
7187 /**
7188  * Set the colorspace of a given image of the canvas.
7189  *
7190  * @param obj The given image object pointer.
7191  * @param cspace The new color space.
7192  *
7193  * This function sets the colorspace of given canvas image.
7194  *
7195  */
7196 EAPI void                     evas_object_image_colorspace_set         (Evas_Object *obj, Evas_Colorspace cspace) EINA_ARG_NONNULL(1);
7197
7198 /**
7199  * Get the colorspace of a given image of the canvas.
7200  *
7201  * @param obj The given image object pointer.
7202  * @return The colorspace of the image.
7203  *
7204  * This function returns the colorspace of given canvas image.
7205  *
7206  */
7207 EAPI Evas_Colorspace          evas_object_image_colorspace_get         (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
7208
7209 /**
7210  * Get the support state of a given image
7211  *
7212  * @param obj The given image object pointer
7213  * @return The region support state
7214  * @since 1.2.0
7215  *
7216  * This function returns the state of the region support of given image
7217  */
7218 EAPI Eina_Bool          evas_object_image_region_support_get         (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
7219
7220 /**
7221  * Set the native surface of a given image of the canvas
7222  *
7223  * @param obj The given canvas pointer.
7224  * @param surf The new native surface.
7225  *
7226  * This function sets a native surface of a given canvas image.
7227  *
7228  */
7229 EAPI void                     evas_object_image_native_surface_set     (Evas_Object *obj, Evas_Native_Surface *surf) EINA_ARG_NONNULL(1, 2);
7230
7231 /**
7232  * Get the native surface of a given image of the canvas
7233  *
7234  * @param obj The given canvas pointer.
7235  * @return The native surface of the given canvas image.
7236  *
7237  * This function returns the native surface of a given canvas image.
7238  *
7239  */
7240 EAPI Evas_Native_Surface     *evas_object_image_native_surface_get     (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
7241
7242 /**
7243  * Set the video surface linked to a given image of the canvas
7244  *
7245  * @param obj The given canvas pointer.
7246  * @param surf The new video surface.
7247  * @since 1.1.0
7248  *
7249  * This function link a video surface to a given canvas image.
7250  *
7251  */
7252 EAPI void                     evas_object_image_video_surface_set      (Evas_Object *obj, Evas_Video_Surface *surf) EINA_ARG_NONNULL(1);
7253
7254 /**
7255  * Get the video surface linekd to a given image of the canvas
7256  *
7257  * @param obj The given canvas pointer.
7258  * @return The video surface of the given canvas image.
7259  * @since 1.1.0
7260  *
7261  * This function returns the video surface linked to a given canvas image.
7262  *
7263  */
7264 EAPI const Evas_Video_Surface *evas_object_image_video_surface_get      (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
7265
7266 /**
7267  * Set the scale hint of a given image of the canvas.
7268  *
7269  * @param obj The given image object pointer.
7270  * @param hint The scale hint, a value in
7271  * #Evas_Image_Scale_Hint.
7272  *
7273  * This function sets the scale hint value of the given image object
7274  * in the canvas, which will affect how Evas is to cache scaled
7275  * versions of its original source image.
7276  *
7277  * @see evas_object_image_scale_hint_get()
7278  */
7279 EAPI void                     evas_object_image_scale_hint_set         (Evas_Object *obj, Evas_Image_Scale_Hint hint) EINA_ARG_NONNULL(1);
7280
7281 /**
7282  * Get the scale hint of a given image of the canvas.
7283  *
7284  * @param obj The given image object pointer.
7285  * @return The scale hint value set on @p obj, a value in
7286  * #Evas_Image_Scale_Hint.
7287  *
7288  * This function returns the scale hint value of the given image
7289  * object of the canvas.
7290  *
7291  * @see evas_object_image_scale_hint_set() for more details.
7292  */
7293 EAPI Evas_Image_Scale_Hint    evas_object_image_scale_hint_get         (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
7294
7295 /**
7296  * Set the content hint setting of a given image object of the canvas.
7297  *
7298  * @param obj The given canvas pointer.
7299  * @param hint The content hint value, one of the
7300  * #Evas_Image_Content_Hint ones.
7301  *
7302  * This function sets the content hint value of the given image of the
7303  * canvas. For example, if you're on the GL engine and your driver
7304  * implementation supports it, setting this hint to
7305  * #EVAS_IMAGE_CONTENT_HINT_DYNAMIC will make it need @b zero copies
7306  * at texture upload time, which is an "expensive" operation.
7307  *
7308  * @see evas_object_image_content_hint_get()
7309  */
7310 EAPI void                     evas_object_image_content_hint_set       (Evas_Object *obj, Evas_Image_Content_Hint hint) EINA_ARG_NONNULL(1);
7311
7312 /**
7313  * Get the content hint setting of a given image object of the canvas.
7314  *
7315  * @param obj The given canvas pointer.
7316  * @return hint The content hint value set on it, one of the
7317  * #Evas_Image_Content_Hint ones (#EVAS_IMAGE_CONTENT_HINT_NONE means
7318  * an error).
7319  *
7320  * This function returns the content hint value of the given image of
7321  * the canvas.
7322  *
7323  * @see evas_object_image_content_hint_set()
7324  */
7325 EAPI Evas_Image_Content_Hint  evas_object_image_content_hint_get       (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
7326
7327
7328 /**
7329  * Enable an image to be used as an alpha mask.
7330  *
7331  * This will set any flags, and discard any excess image data not used as an
7332  * alpha mask.
7333  *
7334  * Note there is little point in using a image as alpha mask unless it has an
7335  * alpha channel.
7336  *
7337  * @param obj Object to use as an alpha mask.
7338  * @param ismask Use image as alphamask, must be true.
7339  */
7340 EAPI void                     evas_object_image_alpha_mask_set         (Evas_Object *obj, Eina_Bool ismask) EINA_ARG_NONNULL(1);
7341
7342 /**
7343  * Set the source object on an image object to used as a @b proxy.
7344  *
7345  * @param obj Proxy (image) object.
7346  * @param src Source object to use for the proxy.
7347  * @return @c EINA_TRUE on success, @c EINA_FALSE on error.
7348  *
7349  * If an image object is set to behave as a @b proxy, it will mirror
7350  * the rendering contents of a given @b source object in its drawing
7351  * region, without affecting that source in any way. The source must
7352  * be another valid Evas object. Other effects may be applied to the
7353  * proxy, such as a map (see evas_object_map_set()) to create a
7354  * reflection of the original object (for example).
7355  *
7356  * Any existing source object on @p obj will be removed after this
7357  * call. Setting @p src to @c NULL clears the proxy object (not in
7358  * "proxy state" anymore).
7359  *
7360  * @warning You cannot set a proxy as another proxy's source.
7361  *
7362  * @see evas_object_image_source_get()
7363  * @see evas_object_image_source_unset()
7364  */
7365 EAPI Eina_Bool                evas_object_image_source_set             (Evas_Object *obj, Evas_Object *src) EINA_ARG_NONNULL(1);
7366
7367 /**
7368  * Get the current source object of an image object.
7369  *
7370  * @param obj Image object
7371  * @return Source object (if any), or @c NULL, if not in "proxy mode"
7372  * (or on errors).
7373  *
7374  * @see evas_object_image_source_set() for more details
7375  */
7376 EAPI Evas_Object             *evas_object_image_source_get             (Evas_Object *obj) EINA_ARG_NONNULL(1);
7377
7378 /**
7379  * Clear the source object on a proxy image object.
7380  *
7381  * @param obj Image object to clear source of.
7382  * @return @c EINA_TRUE on success, @c EINA_FALSE on error.
7383  *
7384  * This is equivalent to calling evas_object_image_source_set() with a
7385  * @c NULL source.
7386  */
7387 EAPI Eina_Bool                evas_object_image_source_unset           (Evas_Object *obj) EINA_ARG_NONNULL(1);
7388
7389 /**
7390  * Check if a file extension may be supported by @ref Evas_Object_Image.
7391  *
7392  * @param file The file to check
7393  * @return EINA_TRUE if we may be able to opeen it, EINA_FALSE if it's unlikely.
7394  * @since 1.1.0
7395  *
7396  * If file is a Eina_Stringshare, use directly @ref evas_object_image_extension_can_load_fast_get.
7397  *
7398  * This functions is threadsafe.
7399  */
7400 EAPI Eina_Bool evas_object_image_extension_can_load_get(const char *file);
7401
7402 /**
7403  * Check if a file extension may be supported by @ref Evas_Object_Image.
7404  *
7405  * @param file The file to check, it should be an Eina_Stringshare.
7406  * @return EINA_TRUE if we may be able to opeen it, EINA_FALSE if it's unlikely.
7407  * @since 1.1.0
7408  *
7409  * This functions is threadsafe.
7410  */
7411 EAPI Eina_Bool evas_object_image_extension_can_load_fast_get(const char *file);
7412
7413 /**
7414  * Check if an image object can be animated (have multiple frames)
7415  *
7416  * @param obj Image object
7417  * @return whether obj support animation
7418  *
7419  * This returns if the image file of an image object is capable of animation
7420  * such as an animated gif file might. This is only useful to be called once
7421  * the image object file has been set.
7422  * 
7423  * Example:
7424  * @code
7425  * extern Evas_Object *obj;
7426  *
7427  * if (evas_object_image_animated_get(obj))
7428  *   {
7429  *     int frame_count;
7430  *     int loop_count;
7431  *     Evas_Image_Animated_Loop_Hint loop_type;
7432  *     double duration;
7433  *
7434  *     frame_count = evas_object_image_animated_frame_count_get(obj);
7435  *     printf("This image has %d frames\n",frame_count);
7436  *
7437  *     duration = evas_object_image_animated_frame_duration_get(obj,1,0); 
7438  *     printf("Frame 1's duration is %f. You had better set object's frame to 2 after this duration using timer\n");
7439  *     
7440  *     loop_count = evas_object_image_animated_loop_count_get(obj);
7441  *     printf("loop count is %d. You had better run loop %d times\n",loop_count,loop_count);
7442  *
7443  *     loop_type = evas_object_image_animated_loop_type_get(obj);
7444  *     if (loop_type == EVAS_IMAGE_ANIMATED_HINT_LOOP)
7445  *       printf("You had better set frame like 1->2->3->1->2->3...\n");
7446  *     else if (loop_type == EVAS_IMAGE_ANIMATED_HINT_PINGPONG)
7447  *       printf("You had better set frame like 1->2->3->2->1->2...\n");
7448  *     else
7449  *       printf("Unknown loop type\n");
7450  *
7451  *     evas_object_image_animated_frame_set(obj,1);
7452  *     printf("You set image object's frame to 1. You can see frame 1\n");
7453  *   }
7454  * @endcode
7455  * 
7456  * @see evas_object_image_animated_get()
7457  * @see evas_object_image_animated_frame_count_get() 
7458  * @see evas_object_image_animated_loop_type_get()
7459  * @see evas_object_image_animated_loop_count_get()
7460  * @see evas_object_image_animated_frame_duration_get()
7461  * @see evas_object_image_animated_frame_set()
7462  * @since 1.1.0
7463  */
7464 EAPI Eina_Bool evas_object_image_animated_get(const Evas_Object *obj);
7465
7466 /**
7467  * Get the total number of frames of the image object.
7468  *
7469  * @param obj Image object
7470  * @return The number of frames
7471  *
7472  * This returns total number of frames the image object supports (if animated)
7473  * 
7474  * @see evas_object_image_animated_get()
7475  * @see evas_object_image_animated_frame_count_get() 
7476  * @see evas_object_image_animated_loop_type_get()
7477  * @see evas_object_image_animated_loop_count_get()
7478  * @see evas_object_image_animated_frame_duration_get()
7479  * @see evas_object_image_animated_frame_set()
7480  * @since 1.1.0
7481  */
7482 EAPI int evas_object_image_animated_frame_count_get(const Evas_Object *obj);
7483
7484 /**
7485  * Get the kind of looping the image object does.
7486  *
7487  * @param obj Image object
7488  * @return Loop type of the image object
7489  *
7490  * This returns the kind of looping the image object wants to do.
7491  * 
7492  * If it returns EVAS_IMAGE_ANIMATED_HINT_LOOP, you should display frames in a sequence like:
7493  * 1->2->3->1->2->3->1...
7494  * If it returns EVAS_IMAGE_ANIMATED_HINT_PINGPONG, it is better to
7495  * display frames in a sequence like: 1->2->3->2->1->2->3->1...
7496  * 
7497  * The default type is EVAS_IMAGE_ANIMATED_HINT_LOOP.
7498  *
7499  * @see evas_object_image_animated_get()
7500  * @see evas_object_image_animated_frame_count_get() 
7501  * @see evas_object_image_animated_loop_type_get()
7502  * @see evas_object_image_animated_loop_count_get()
7503  * @see evas_object_image_animated_frame_duration_get()
7504  * @see evas_object_image_animated_frame_set()
7505  * @since 1.1.0
7506  */
7507 EAPI Evas_Image_Animated_Loop_Hint evas_object_image_animated_loop_type_get(const Evas_Object *obj);
7508
7509 /**
7510  * Get the number times the animation of the object loops.
7511  *
7512  * @param obj Image object
7513  * @return The number of loop of an animated image object
7514  *
7515  * This returns loop count of image. The loop count is the number of times
7516  * the animation will play fully from first to last frame until the animation
7517  * should stop (at the final frame).
7518  * 
7519  * If 0 is returned, then looping should happen indefinitely (no limit to
7520  * the number of times it loops).
7521  *
7522  * @see evas_object_image_animated_get()
7523  * @see evas_object_image_animated_frame_count_get() 
7524  * @see evas_object_image_animated_loop_type_get()
7525  * @see evas_object_image_animated_loop_count_get()
7526  * @see evas_object_image_animated_frame_duration_get()
7527  * @see evas_object_image_animated_frame_set()
7528  * @since 1.1.0
7529  */
7530 EAPI int evas_object_image_animated_loop_count_get(const Evas_Object *obj);
7531
7532 /**
7533  * Get the duration of a sequence of frames.
7534  *
7535  * @param obj Image object
7536  * @param start_frame The first frame
7537  * @param fram_num Number of frames in the sequence
7538  *
7539  * This returns total duration that the specified sequence of frames should
7540  * take in seconds.
7541  * 
7542  * If you set start_frame to 1 and frame_num 0, you get frame 1's duration
7543  * If you set start_frame to 1 and frame_num 1, you get frame 1's duration + 
7544  * frame2's duration
7545  *
7546  * @see evas_object_image_animated_get()
7547  * @see evas_object_image_animated_frame_count_get() 
7548  * @see evas_object_image_animated_loop_type_get()
7549  * @see evas_object_image_animated_loop_count_get()
7550  * @see evas_object_image_animated_frame_duration_get()
7551  * @see evas_object_image_animated_frame_set()
7552  * @since 1.1.0
7553  */
7554 EAPI double evas_object_image_animated_frame_duration_get(const Evas_Object *obj, int start_frame, int fram_num);
7555
7556 /**
7557  * Set the frame to current frame of an image object
7558  *
7559  * @param obj The given image object.
7560  * @param frame_num The index of current frame
7561  *
7562  * This set image object's current frame to frame_num with 1 being the first
7563  * frame.
7564  *
7565  * @see evas_object_image_animated_get()
7566  * @see evas_object_image_animated_frame_count_get() 
7567  * @see evas_object_image_animated_loop_type_get()
7568  * @see evas_object_image_animated_loop_count_get()
7569  * @see evas_object_image_animated_frame_duration_get()
7570  * @see evas_object_image_animated_frame_set()
7571  * @since 1.1.0
7572  */
7573 EAPI void evas_object_image_animated_frame_set(Evas_Object *obj, int frame_num);
7574 /**
7575  * @}
7576  */
7577
7578 /**
7579  * @defgroup Evas_Object_Text Text Object Functions
7580  *
7581  * Functions that operate on single line, single style text objects.
7582  *
7583  * For multiline and multiple style text, see @ref Evas_Object_Textblock.
7584  *
7585  * See some @ref Example_Evas_Text "examples" on this group of functions.
7586  *
7587  * @ingroup Evas_Object_Specific
7588  */
7589
7590 /**
7591  * @addtogroup Evas_Object_Text
7592  * @{
7593  */
7594
7595 /* basic styles (4 bits allocated use 0->10 now, 5 left) */
7596 #define EVAS_TEXT_STYLE_MASK_BASIC 0xf
7597
7598 /**
7599  * Text style type creation macro. Use style types on the 's'
7600  * arguments, being 'x' your style variable.
7601  */
7602 #define EVAS_TEXT_STYLE_BASIC_SET(x, s) \
7603    do { x = ((x) & ~EVAS_TEXT_STYLE_MASK_BASIC) | (s); } while (0)
7604
7605 #define EVAS_TEXT_STYLE_MASK_SHADOW_DIRECTION (0x7 << 4)
7606
7607 /**
7608  * Text style type creation macro. This one will impose shadow
7609  * directions on the style type variable -- use the @c
7610  * EVAS_TEXT_STYLE_SHADOW_DIRECTION_* values on 's', incremmentally.
7611  */
7612 #define EVAS_TEXT_STYLE_SHADOW_DIRECTION_SET(x, s) \
7613    do { x = ((x) & ~EVAS_TEXT_STYLE_MASK_SHADOW_DIRECTION) | (s); } while (0)
7614
7615    typedef enum _Evas_Text_Style_Type
7616      {
7617         EVAS_TEXT_STYLE_PLAIN, /**< plain, standard text */
7618         EVAS_TEXT_STYLE_SHADOW, /**< text with shadow underneath */
7619         EVAS_TEXT_STYLE_OUTLINE, /**< text with an outline */
7620         EVAS_TEXT_STYLE_SOFT_OUTLINE, /**< text with a soft outline */
7621         EVAS_TEXT_STYLE_GLOW, /**< text with a glow effect */
7622         EVAS_TEXT_STYLE_OUTLINE_SHADOW, /**< text with both outline and shadow effects */
7623         EVAS_TEXT_STYLE_FAR_SHADOW, /**< text with (far) shadow underneath */
7624         EVAS_TEXT_STYLE_OUTLINE_SOFT_SHADOW, /**< text with outline and soft shadow effects combined */
7625         EVAS_TEXT_STYLE_SOFT_SHADOW, /**< text with (soft) shadow underneath */
7626         EVAS_TEXT_STYLE_FAR_SOFT_SHADOW, /**< text with (far soft) shadow underneath */
7627
7628         /* OR these to modify shadow direction (3 bits needed) */
7629         EVAS_TEXT_STYLE_SHADOW_DIRECTION_BOTTOM_RIGHT = (0x0 << 4), /**< shadow growing to bottom right */
7630         EVAS_TEXT_STYLE_SHADOW_DIRECTION_BOTTOM       = (0x1 << 4), /**< shadow growing to the bottom */
7631         EVAS_TEXT_STYLE_SHADOW_DIRECTION_BOTTOM_LEFT  = (0x2 << 4), /**< shadow growing to bottom left */
7632         EVAS_TEXT_STYLE_SHADOW_DIRECTION_LEFT         = (0x3 << 4), /**< shadow growing to the left */
7633         EVAS_TEXT_STYLE_SHADOW_DIRECTION_TOP_LEFT     = (0x4 << 4), /**< shadow growing to top left */
7634         EVAS_TEXT_STYLE_SHADOW_DIRECTION_TOP          = (0x5 << 4), /**< shadow growing to the top */
7635         EVAS_TEXT_STYLE_SHADOW_DIRECTION_TOP_RIGHT    = (0x6 << 4), /**< shadow growing to top right */
7636         EVAS_TEXT_STYLE_SHADOW_DIRECTION_RIGHT        = (0x7 << 4) /**< shadow growing to the right */
7637      } Evas_Text_Style_Type; /**< Types of styles to be applied on text objects. The @c EVAS_TEXT_STYLE_SHADOW_DIRECTION_* ones are to be ORed together with others imposing shadow, to change shadow's direction */
7638
7639 /**
7640  * Creates a new text object on the provided canvas.
7641  *
7642  * @param e The canvas to create the text object on.
7643  * @return @c NULL on error, a pointer to a new text object on
7644  * success.
7645  *
7646  * Text objects are for simple, single line text elements. If you want
7647  * more elaborated text blocks, see @ref Evas_Object_Textblock.
7648  *
7649  * @see evas_object_text_font_source_set()
7650  * @see evas_object_text_font_set()
7651  * @see evas_object_text_text_set()
7652  */
7653 EAPI Evas_Object      *evas_object_text_add              (Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
7654
7655 /**
7656  * Set the font (source) file to be used on a given text object.
7657  *
7658  * @param obj The text object to set font for.
7659  * @param font The font file's path.
7660  *
7661  * This function allows the font file to be explicitly set for a given
7662  * text object, overriding system lookup, which will first occur in
7663  * the given file's contents.
7664  *
7665  * @see evas_object_text_font_get()
7666  */
7667 EAPI void              evas_object_text_font_source_set  (Evas_Object *obj, const char *font) EINA_ARG_NONNULL(1);
7668
7669 /**
7670  * Get the font file's path which is being used on a given text
7671  * object.
7672  *
7673  * @param obj The text object to set font for.
7674  * @param font The font file's path.
7675  *
7676  * @see evas_object_text_font_get() for more details
7677  */
7678 EAPI const char       *evas_object_text_font_source_get  (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
7679
7680 /**
7681  * Set the font family and size on a given text object.
7682  *
7683  * @param obj The text object to set font for.
7684  * @param font The font (family) name.
7685  * @param size The font size, in points.
7686  *
7687  * This function allows the font name and size of a text object to be
7688  * set. The @p font string has to follow fontconfig's convention on
7689  * naming fonts, as it's the underlying lybrary used to query system
7690  * fonts by Evas (see the @c fc-list command's output, on your system,
7691  * to get an idea).
7692  *
7693  * @see evas_object_text_font_get()
7694  * @see evas_object_text_font_source_set()
7695  */
7696    EAPI void              evas_object_text_font_set         (Evas_Object *obj, const char *font, Evas_Font_Size size) EINA_ARG_NONNULL(1);
7697
7698 /**
7699  * Retrieve the font family and size in use on a given text object.
7700  *
7701  * @param obj The evas text object to query for font information.
7702  * @param font A pointer to the location to store the font name in.
7703  * @param size A pointer to the location to store the font size in.
7704  *
7705  * This function allows the font name and size of a text object to be
7706  * queried. Be aware that the font name string is still owned by Evas
7707  * and should @b not have free() called on it by the caller of the
7708  * function.
7709  *
7710  * @see evas_object_text_font_set()
7711  */
7712 EAPI void              evas_object_text_font_get         (const Evas_Object *obj, const char **font, Evas_Font_Size *size) EINA_ARG_NONNULL(1);
7713
7714 /**
7715  * Sets the text string to be displayed by the given text object.
7716  *
7717  * @param obj The text object to set text string on.
7718  * @param text Text string to display on it.
7719  *
7720  * @see evas_object_text_text_get()
7721  */
7722 EAPI void              evas_object_text_text_set         (Evas_Object *obj, const char *text) EINA_ARG_NONNULL(1);
7723
7724 /**
7725  * Retrieves the text string currently being displayed by the given
7726  * text object.
7727  *
7728  * @param  obj The given text object.
7729  * @return The text string currently being displayed on it.
7730  *
7731  * @note Do not free() the return value.
7732  *
7733  * @see evas_object_text_text_set()
7734  */
7735 EAPI const char       *evas_object_text_text_get         (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
7736
7737 /**
7738  * @brief Sets the BiDi delimiters used in the textblock.
7739  *
7740  * BiDi delimiters are use for in-paragraph separation of bidi segments. This
7741  * is useful for example in recipients fields of e-mail clients where bidi
7742  * oddities can occur when mixing rtl and ltr.
7743  *
7744  * @param obj The given text object.
7745  * @param delim A null terminated string of delimiters, e.g ",|".
7746  * @since 1.1.0
7747  */
7748 EAPI void              evas_object_text_bidi_delimiters_set(Evas_Object *obj, const char *delim);
7749
7750 /**
7751  * @brief Gets the BiDi delimiters used in the textblock.
7752  *
7753  * BiDi delimiters are use for in-paragraph separation of bidi segments. This
7754  * is useful for example in recipients fields of e-mail clients where bidi
7755  * oddities can occur when mixing rtl and ltr.
7756  *
7757  * @param obj The given text object.
7758  * @return A null terminated string of delimiters, e.g ",|". If empty, returns NULL.
7759  * @since 1.1.0
7760  */
7761 EAPI const char       *evas_object_text_bidi_delimiters_get(const Evas_Object *obj);
7762
7763    EAPI Evas_Coord        evas_object_text_ascent_get       (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
7764    EAPI Evas_Coord        evas_object_text_descent_get      (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
7765    EAPI Evas_Coord        evas_object_text_max_ascent_get   (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
7766    EAPI Evas_Coord        evas_object_text_max_descent_get  (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
7767    EAPI Evas_Coord        evas_object_text_horiz_advance_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
7768    EAPI Evas_Coord        evas_object_text_vert_advance_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
7769    EAPI Evas_Coord        evas_object_text_inset_get        (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
7770
7771 /**
7772  * Retrieve position and dimension information of a character within a text @c Evas_Object.
7773  *
7774  * This function is used to obtain the X, Y, width and height of a the character
7775  * located at @p pos within the @c Evas_Object @p obj. @p obj must be a text object
7776  * as created with evas_object_text_add(). Any of the @c Evas_Coord parameters (@p cx,
7777  * @p cy, @p cw, @p ch) may be NULL in which case no value will be assigned to that
7778  * parameter.
7779  *
7780  * @param obj   The text object to retrieve position information for.
7781  * @param pos   The character position to request co-ordinates for.
7782  * @param cx    A pointer to an @c Evas_Coord to store the X value in (can be NULL).
7783  * @param cy    A pointer to an @c Evas_Coord to store the Y value in (can be NULL).
7784  * @param cw    A pointer to an @c Evas_Coord to store the Width value in (can be NULL).
7785  * @param ch    A pointer to an @c Evas_Coord to store the Height value in (can be NULL).
7786  *
7787  * @returns EINA_FALSE on success, EINA_TRUE on error.
7788  */
7789 EAPI Eina_Bool         evas_object_text_char_pos_get     (const Evas_Object *obj, int pos, Evas_Coord *cx, Evas_Coord *cy, Evas_Coord *cw, Evas_Coord *ch) EINA_ARG_NONNULL(1);
7790    EAPI int               evas_object_text_char_coords_get  (const Evas_Object *obj, Evas_Coord x, Evas_Coord y, Evas_Coord *cx, Evas_Coord *cy, Evas_Coord *cw, Evas_Coord *ch) EINA_ARG_NONNULL(1);
7791
7792 /**
7793  * Returns the logical position of the last char in the text
7794  * up to the pos given. this is NOT the position of the last char
7795  * because of the possibility of RTL in the text.
7796  */
7797 EAPI int               evas_object_text_last_up_to_pos   (const Evas_Object *obj, Evas_Coord x, Evas_Coord y) EINA_ARG_NONNULL(1);
7798
7799 /**
7800  * Retrieves the style on use on the given text object.
7801  *
7802  * @param obj the given text object to set style on.
7803  * @return the style type in use.
7804  *
7805  * @see evas_object_text_style_set() for more details.
7806  */
7807 EAPI Evas_Text_Style_Type evas_object_text_style_get     (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
7808
7809 /**
7810  * Sets the style to apply on the given text object.
7811  *
7812  * @param obj the given text object to set style on.
7813  * @param type a style type.
7814  *
7815  * Text object styles are one of the values in
7816  * #Evas_Text_Style_Type. Some of those values are combinations of
7817  * more than one style, and some account for the direction of the
7818  * rendering of shadow effects.
7819  *
7820  * @note One may use the helper macros #EVAS_TEXT_STYLE_BASIC_SET and
7821  * #EVAS_TEXT_STYLE_SHADOW_DIRECTION_SET to assemble a style value.
7822  *
7823  * The following figure illustrates the text styles:
7824  *
7825  * @image html text-styles.png
7826  * @image rtf text-styles.png
7827  * @image latex text-styles.eps
7828  *
7829  * @see evas_object_text_style_get()
7830  * @see evas_object_text_shadow_color_set()
7831  * @see evas_object_text_outline_color_set()
7832  * @see evas_object_text_glow_color_set()
7833  * @see evas_object_text_glow2_color_set()
7834  */
7835 EAPI void              evas_object_text_style_set        (Evas_Object *obj, Evas_Text_Style_Type type) EINA_ARG_NONNULL(1);
7836
7837 /**
7838  * Sets the shadow color for the given text object.
7839  *
7840  * @param obj The given Evas text object.
7841  * @param r The red component of the given color.
7842  * @param g The green component of the given color.
7843  * @param b The blue component of the given color.
7844  * @param a The alpha component of the given color.
7845  *
7846  * Shadow effects, which are fading colors decorating the text
7847  * underneath it, will just be shown if the object is set to one of
7848  * the following styles:
7849  *
7850  * - #EVAS_TEXT_STYLE_SHADOW
7851  * - #EVAS_TEXT_STYLE_OUTLINE_SHADOW
7852  * - #EVAS_TEXT_STYLE_FAR_SHADOW
7853  * - #EVAS_TEXT_STYLE_OUTLINE_SOFT_SHADOW
7854  * - #EVAS_TEXT_STYLE_SOFT_SHADOW
7855  * - #EVAS_TEXT_STYLE_FAR_SOFT_SHADOW
7856  *
7857  * One can also change the direction where the shadow grows to, with
7858  * evas_object_text_style_set().
7859  *
7860  * @see evas_object_text_shadow_color_get()
7861  */
7862 EAPI void              evas_object_text_shadow_color_set (Evas_Object *obj, int r, int g, int b, int a) EINA_ARG_NONNULL(1);
7863
7864 /**
7865  * Retrieves the shadow color for the given text object.
7866  *
7867  * @param obj The given Evas text object.
7868  * @param r Pointer to variable to hold the red component of the given
7869  * color.
7870  * @param g Pointer to variable to hold the green component of the
7871  * given color.
7872  * @param b Pointer to variable to hold the blue component of the
7873  * given color.
7874  * @param a Pointer to variable to hold the alpha component of the
7875  * given color.
7876  *
7877  * @note Use @c NULL pointers on the color components you're not
7878  * interested in: they'll be ignored by the function.
7879  *
7880  * @see evas_object_text_shadow_color_set() for more details.
7881  */
7882 EAPI void              evas_object_text_shadow_color_get (const Evas_Object *obj, int *r, int *g, int *b, int *a) EINA_ARG_NONNULL(1);
7883
7884 /**
7885  * Sets the glow color for the given text object.
7886  *
7887  * @param obj The given Evas text object.
7888  * @param r The red component of the given color.
7889  * @param g The green component of the given color.
7890  * @param b The blue component of the given color.
7891  * @param a The alpha component of the given color.
7892  *
7893  * Glow effects, which are glowing colors decorating the text's
7894  * surroundings, will just be shown if the object is set to the
7895  * #EVAS_TEXT_STYLE_GLOW style.
7896  *
7897  * @note Glow effects are placed from a short distance of the text
7898  * itself, but no touching it. For glowing effects right on the
7899  * borders of the glyphs, see 'glow 2' effects
7900  * (evas_object_text_glow2_color_set()).
7901  *
7902  * @see evas_object_text_glow_color_get()
7903  */
7904 EAPI void              evas_object_text_glow_color_set   (Evas_Object *obj, int r, int g, int b, int a) EINA_ARG_NONNULL(1);
7905
7906 /**
7907  * Retrieves the glow color for the given text object.
7908  *
7909  * @param obj The given Evas text object.
7910  * @param r Pointer to variable to hold the red component of the given
7911  * color.
7912  * @param g Pointer to variable to hold the green component of the
7913  * given color.
7914  * @param b Pointer to variable to hold the blue component of the
7915  * given color.
7916  * @param a Pointer to variable to hold the alpha component of the
7917  * given color.
7918  *
7919  * @note Use @c NULL pointers on the color components you're not
7920  * interested in: they'll be ignored by the function.
7921  *
7922  * @see evas_object_text_glow_color_set() for more details.
7923  */
7924 EAPI void              evas_object_text_glow_color_get   (const Evas_Object *obj, int *r, int *g, int *b, int *a) EINA_ARG_NONNULL(1);
7925
7926 /**
7927  * Sets the 'glow 2' color for the given text object.
7928  *
7929  * @param obj The given Evas text object.
7930  * @param r The red component of the given color.
7931  * @param g The green component of the given color.
7932  * @param b The blue component of the given color.
7933  * @param a The alpha component of the given color.
7934  *
7935  * 'Glow 2' effects, which are glowing colors decorating the text's
7936  * (immediate) surroundings, will just be shown if the object is set
7937  * to the #EVAS_TEXT_STYLE_GLOW style. See also
7938  * evas_object_text_glow_color_set().
7939  *
7940  * @see evas_object_text_glow2_color_get()
7941  */
7942 EAPI void              evas_object_text_glow2_color_set  (Evas_Object *obj, int r, int g, int b, int a) EINA_ARG_NONNULL(1);
7943
7944 /**
7945  * Retrieves the 'glow 2' color for the given text object.
7946  *
7947  * @param obj The given Evas text object.
7948  * @param r Pointer to variable to hold the red component of the given
7949  * color.
7950  * @param g Pointer to variable to hold the green component of the
7951  * given color.
7952  * @param b Pointer to variable to hold the blue component of the
7953  * given color.
7954  * @param a Pointer to variable to hold the alpha component of the
7955  * given color.
7956  *
7957  * @note Use @c NULL pointers on the color components you're not
7958  * interested in: they'll be ignored by the function.
7959  *
7960  * @see evas_object_text_glow2_color_set() for more details.
7961  */
7962 EAPI void              evas_object_text_glow2_color_get  (const Evas_Object *obj, int *r, int *g, int *b, int *a) EINA_ARG_NONNULL(1);
7963
7964 /**
7965  * Sets the outline color for the given text object.
7966  *
7967  * @param obj The given Evas text object.
7968  * @param r The red component of the given color.
7969  * @param g The green component of the given color.
7970  * @param b The blue component of the given color.
7971  * @param a The alpha component of the given color.
7972  *
7973  * Outline effects (colored lines around text glyphs) will just be
7974  * shown if the object is set to one of the following styles:
7975  * - #EVAS_TEXT_STYLE_OUTLINE
7976  * - #EVAS_TEXT_STYLE_SOFT_OUTLINE
7977  * - #EVAS_TEXT_STYLE_OUTLINE_SHADOW
7978  * - #EVAS_TEXT_STYLE_OUTLINE_SOFT_SHADOW
7979  *
7980  * @see evas_object_text_outline_color_get()
7981  */
7982 EAPI void              evas_object_text_outline_color_set(Evas_Object *obj, int r, int g, int b, int a) EINA_ARG_NONNULL(1);
7983
7984 /**
7985  * Retrieves the outline color for the given text object.
7986  *
7987  * @param obj The given Evas text object.
7988  * @param r Pointer to variable to hold the red component of the given
7989  * color.
7990  * @param g Pointer to variable to hold the green component of the
7991  * given color.
7992  * @param b Pointer to variable to hold the blue component of the
7993  * given color.
7994  * @param a Pointer to variable to hold the alpha component of the
7995  * given color.
7996  *
7997  * @note Use @c NULL pointers on the color components you're not
7998  * interested in: they'll be ignored by the function.
7999  *
8000  * @see evas_object_text_outline_color_set() for more details.
8001  */
8002 EAPI void              evas_object_text_outline_color_get(const Evas_Object *obj, int *r, int *g, int *b, int *a) EINA_ARG_NONNULL(1);
8003
8004 /**
8005  * Gets the text style pad of a text object.
8006  *
8007  * @param obj The given text object.
8008  * @param l The left pad (or @c NULL).
8009  * @param r The right pad (or @c NULL).
8010  * @param t The top pad (or @c NULL).
8011  * @param b The bottom pad (or @c NULL).
8012  *
8013  */
8014 EAPI void              evas_object_text_style_pad_get    (const Evas_Object *obj, int *l, int *r, int *t, int *b) EINA_ARG_NONNULL(1);
8015
8016 /**
8017  * Retrieves the direction of the text currently being displayed in the
8018  * text object.
8019  * @param  obj The given evas text object.
8020  * @return the direction of the text
8021  */
8022 EAPI Evas_BiDi_Direction evas_object_text_direction_get  (const Evas_Object *obj) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
8023
8024 /**
8025  * @}
8026  */
8027
8028 /**
8029  * @defgroup Evas_Object_Textblock Textblock Object Functions
8030  *
8031  * Functions used to create and manipulate textblock objects. Unlike
8032  * @ref Evas_Object_Text, these handle complex text, doing multiple
8033  * styles and multiline text based on HTML-like tags. Of these extra
8034  * features will be heavier on memory and processing cost.
8035  *
8036  * @section Evas_Object_Textblock_Tutorial Textblock Object Tutorial
8037  *
8038  * This part explains about the textblock object's API and proper usage.
8039  * If you want to develop textblock, you should also refer to @ref Evas_Object_Textblock_Internal.
8040  * The main user of the textblock object is the edje entry object in Edje, so
8041  * that's a good place to learn from, but I think this document is more than
8042  * enough, if it's not, please contact me and I'll update it.
8043  *
8044  * @subsection textblock_intro Introduction
8045  * The textblock objects is, as implied, an object that can show big chunks of
8046  * text. Textblock supports many features including: Text formatting, automatic
8047  * and manual text alignment, embedding items (for example icons) and more.
8048  * Textblock has three important parts, the text paragraphs, the format nodes
8049  * and the cursors.
8050  *
8051  * You can use markup to format text, for example: "<font_size=50>Big!</font_size>".
8052  * You can also put more than one style directive in one tag:
8053  * "<font_size=50 color=#F00>Big and Red!</font_size>".
8054  * Please notice that we used "</font_size>" although the format also included
8055  * color, this is because the first format determines the matching closing tag's
8056  * name. You can also use anonymous tags, like: "<font_size=30>Big</>" which
8057  * just pop any type of format, but it's advised to use the named alternatives
8058  * instead.
8059  *
8060  * @subsection textblock_cursors Textblock Object Cursors
8061  * A textblock Cursor @ref Evas_Textblock_Cursor is data type that represents
8062  * a position in a textblock. Each cursor contains information about the
8063  * paragraph it points to, the position in that paragraph and the object itself.
8064  * Cursors register to textblock objects upon creation, this means that once
8065  * you created a cursor, it belongs to a specific obj and you can't for example
8066  * copy a cursor "into" a cursor of a different object. Registered cursors
8067  * also have the added benefit of updating automatically upon textblock changes,
8068  * this means that if you have a cursor pointing to a specific character, it'll
8069  * still point to it even after you change the whole object completely (as long
8070  * as the char was not deleted), this is not possible without updating, because
8071  * as mentioned, each cursor holds a character position. There are many
8072  * functions that handle cursors, just check out the evas_textblock_cursor*
8073  * functions. For creation and deletion of cursors check out:
8074  * @see evas_object_textblock_cursor_new()
8075  * @see evas_textblock_cursor_free()
8076  * @note Cursors are generally the correct way to handle text in the textblock object, and there are enough functions to do everything you need with them (no need to get big chunks of text and processing them yourself).
8077  *
8078  * @subsection textblock_paragraphs Textblock Object Paragraphs
8079  * The textblock object is made out of text splitted to paragraphs (delimited
8080  * by the paragraph separation character). Each paragraph has many (or none)
8081  * format nodes associated with it which are responsible for the formatting
8082  * of that paragraph.
8083  *
8084  * @subsection textblock_format_nodes Textblock Object Format Nodes
8085  * As explained in @ref textblock_paragraphs each one of the format nodes
8086  * is associated with a paragraph.
8087  * There are two types of format nodes, visible and invisible:
8088  * Visible: formats that a cursor can point to, i.e formats that
8089  * occupy space, for example: newlines, tabs, items and etc. Some visible items
8090  * are made of two parts, in this case, only the opening tag is visible.
8091  * A closing tag (i.e a </tag> tag) should NEVER be visible.
8092  * Invisible: formats that don't occupy space, for example: bold and underline.
8093  * Being able to access format nodes is very important for some uses. For
8094  * example, edje uses the "<a>" format to create links in the text (and pop
8095  * popups above them when clicked). For the textblock object a is just a
8096  * formatting instruction (how to color the text), but edje utilizes the access
8097  * to the format nodes to make it do more.
8098  * For more information, take a look at all the evas_textblock_node_format_*
8099  * functions.
8100  * The translation of "<tag>" tags to actual format is done according to the
8101  * tags defined in the style, see @ref evas_textblock_style_set
8102  *
8103  * @subsection textblock_special_formats Special Formats
8104  * Textblock supports various format directives that can be used either in
8105  * markup, or by calling @ref evas_object_textblock_format_append or
8106  * @ref evas_object_textblock_format_prepend. In addition to the mentioned
8107  * format directives, textblock allows creating additional format directives
8108  * using "tags" that can be set in the style see @ref evas_textblock_style_set .
8109  *
8110  * Textblock supports the following formats:
8111  * @li font - Font description in fontconfig like format, e.g: "Sans:style=Italic:lang=hi". or "Serif:style=Bold".
8112  * @li font_weight - Overrides the weight defined in "font". E.g: "font_weight=Bold" is the same as "font=:style=Bold". Supported weights: "normal", "thin", "ultralight", "light", "book", "medium", "semibold", "bold", "ultrabold", "black", and "extrablack".
8113  * @li font_style - Overrides the style defined in "font". E.g: "font_style=Italic" is the same as "font=:style=Italic". Supported styles: "normal", "oblique", and "italic".
8114  * @li font_width - Overrides the width defined in "font". E.g: "font_width=Condensed" is the same as "font=:style=Condensed". Supported widths: "normal", "ultracondensed", "extracondensed", "condensed", "semicondensed", "semiexpanded", "expanded", "extraexpanded", and "ultraexpanded".
8115  * @li lang - Overrides the language defined in "font". E.g: "lang=he" is the same as "font=:lang=he".
8116  * @li font_fallbacks - A comma delimited list of fonts to try if finding the main font fails.
8117  * @li font_size - The font size in points.
8118  * @li font_source - The source of the font, e.g an eet file.
8119  * @li color - Text color in one of the following formats: "#RRGGBB", "#RRGGBBAA", "#RGB", and "#RGBA".
8120  * @li underline_color - color in one of the following formats: "#RRGGBB", "#RRGGBBAA", "#RGB", and "#RGBA".
8121  * @li underline2_color - color in one of the following formats: "#RRGGBB", "#RRGGBBAA", "#RGB", and "#RGBA".
8122  * @li outline_color - color in one of the following formats: "#RRGGBB", "#RRGGBBAA", "#RGB", and "#RGBA".
8123  * @li shadow_color - color in one of the following formats: "#RRGGBB", "#RRGGBBAA", "#RGB", and "#RGBA".
8124  * @li glow_color - color in one of the following formats: "#RRGGBB", "#RRGGBBAA", "#RGB", and "#RGBA".
8125  * @li glow2_color - color in one of the following formats: "#RRGGBB", "#RRGGBBAA", "#RGB", and "#RGBA".
8126  * @li backing_color - color in one of the following formats: "#RRGGBB", "#RRGGBBAA", "#RGB", and "#RGBA".
8127  * @li strikethrough_color - color in one of the following formats: "#RRGGBB", "#RRGGBBAA", "#RGB", and "#RGBA".
8128  * @li align - Either "auto" (meaning according to text direction), "left", "right", "center", "middle", a value between 0.0 and 1.0, or a value between 0% to 100%.
8129  * @li valign - Either "top", "bottom", "middle", "center", "baseline", "base", a value between 0.0 and 1.0, or a value between 0% to 100%.
8130  * @li wrap - "word", "char", "mixed", or "none".
8131  * @li left_margin - Either "reset", or a pixel value indicating the margin.
8132  * @li right_margin - Either "reset", or a pixel value indicating the margin.
8133  * @li underline - "on", "off", "single", or "double".
8134  * @li strikethrough - "on" or "off"
8135  * @li backing - "on" or "off"
8136  * @li style - Either "off", "none", "plain", "shadow", "outline", "soft_outline", "outline_shadow", "outline_soft_shadow", "glow", "far_shadow", "soft_shadow", or "far_soft_shadow".
8137  * @li tabstops - Pixel value for tab width.
8138  * @li linesize - Force a line size in pixels.
8139  * @li linerelsize - Either a floating point value or a percentage indicating the wanted size of the line relative to the calculated size.
8140  * @li linegap - Force a line gap in pixels.
8141  * @li linerelgap - Either a floating point value or a percentage indicating the wanted size of the line relative to the calculated size.
8142  * @li item - Creates an empty space that should be filled by an upper layer. Use "size", "abssize", or "relsize". To define the items size, and an optional: vsize=full/ascent to define the item's position in the line.
8143  * @li linefill - Either a float value or percentage indicating how much to fill the line.
8144  * @li ellipsis - Value between 0.0-1.0 to indicate the type of ellipsis, or -1.0 to indicate ellipsis isn't wanted.
8145  * @li password - "on" or "off". This is used to specifically turn replacing chars with the replacement char (i.e password mode) on and off.
8146  *
8147  *
8148  * @todo put here some usage examples
8149  *
8150  * @ingroup Evas_Object_Specific
8151  *
8152  * @{
8153  */
8154
8155    typedef struct _Evas_Textblock_Style                 Evas_Textblock_Style;
8156    typedef struct _Evas_Textblock_Cursor                Evas_Textblock_Cursor;
8157    /**
8158     * @typedef Evas_Object_Textblock_Node_Format
8159     * A format node.
8160     */
8161    typedef struct _Evas_Object_Textblock_Node_Format    Evas_Object_Textblock_Node_Format;
8162    typedef struct _Evas_Textblock_Rectangle             Evas_Textblock_Rectangle;
8163
8164    struct _Evas_Textblock_Rectangle
8165      {
8166         Evas_Coord x, y, w, h;
8167      };
8168
8169    typedef enum _Evas_Textblock_Text_Type
8170      {
8171         EVAS_TEXTBLOCK_TEXT_RAW,
8172         EVAS_TEXTBLOCK_TEXT_PLAIN,
8173         EVAS_TEXTBLOCK_TEXT_MARKUP
8174      } Evas_Textblock_Text_Type;
8175
8176    typedef enum _Evas_Textblock_Cursor_Type
8177      {
8178         EVAS_TEXTBLOCK_CURSOR_UNDER,
8179         EVAS_TEXTBLOCK_CURSOR_BEFORE
8180      } Evas_Textblock_Cursor_Type;
8181
8182
8183 /**
8184  * Adds a textblock to the given evas.
8185  * @param   e The given evas.
8186  * @return  The new textblock object.
8187  */
8188 EAPI Evas_Object                 *evas_object_textblock_add(Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
8189
8190
8191 /**
8192  * Returns the unescaped version of escape.
8193  * @param escape the string to be escaped
8194  * @return the unescaped version of escape
8195  */
8196 EAPI const char                  *evas_textblock_escape_string_get(const char *escape) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
8197
8198 /**
8199  * Returns the escaped version of the string.
8200  * @param string to escape
8201  * @param len_ret the len of the part of the string that was used.
8202  * @return the escaped string.
8203  */
8204 EAPI const char                  *evas_textblock_string_escape_get(const char *string, int *len_ret) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
8205
8206 /**
8207  * Return the unescaped version of the string between start and end.
8208  *
8209  * @param escape_start the start of the string.
8210  * @param escape_end the end of the string.
8211  * @return the unescaped version of the range
8212  */
8213 EAPI const char                  *evas_textblock_escape_string_range_get(const char *escape_start, const char *escape_end) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2);
8214
8215 /**
8216  * Return the plain version of the markup.
8217  *
8218  * Works as if you set the markup to a textblock and then retrieve the plain
8219  * version of the text. i.e: <br> and <\n> will be replaced with \n, &...; with
8220  * the actual char and etc.
8221  *
8222  * @param obj the textblock object to work with. (if NULL, tries the default)
8223  * @param text the markup text (if NULL, return NULL)
8224  * @return an allocated plain text version of the markup
8225  * @since 1.2.0
8226  */
8227 EAPI char                        *evas_textblock_text_markup_to_utf8(const Evas_Object *obj, const char *text) EINA_WARN_UNUSED_RESULT EINA_MALLOC;
8228
8229 /**
8230  * Return the markup version of the plain text.
8231  *
8232  * Replaces \n -> <br/> \t -> <tab/> and etc. Generally needed before you pass
8233  * plain text to be set in a textblock.
8234  *
8235  * @param obj the textblock object to work with (if NULL, it just does the
8236  * default behaviour, i.e with no extra object information).
8237  * @param text the markup text (if NULL, return NULL)
8238  * @return an allocated plain text version of the markup
8239  * @since 1.2.0
8240  */
8241 EAPI char                        *evas_textblock_text_utf8_to_markup(const Evas_Object *obj, const char *text) EINA_WARN_UNUSED_RESULT EINA_MALLOC;
8242
8243 /**
8244  * Creates a new textblock style.
8245  * @return  The new textblock style.
8246  */
8247 EAPI Evas_Textblock_Style        *evas_textblock_style_new(void) EINA_WARN_UNUSED_RESULT EINA_MALLOC;
8248
8249 /**
8250  * Destroys a textblock style.
8251  * @param ts The textblock style to free.
8252  */
8253 EAPI void                         evas_textblock_style_free(Evas_Textblock_Style *ts) EINA_ARG_NONNULL(1);
8254
8255 /**
8256  * Sets the style ts to the style passed as text by text.
8257  * Expected a string consisting of many (or none) tag='format' pairs.
8258  *
8259  * @param ts  the style to set.
8260  * @param text the text to parse - NOT NULL.
8261  * @return Returns no value.
8262  */
8263 EAPI void                         evas_textblock_style_set(Evas_Textblock_Style *ts, const char *text) EINA_ARG_NONNULL(1);
8264
8265 /**
8266  * Return the text of the style ts.
8267  * @param ts  the style to get it's text.
8268  * @return the text of the style or null on error.
8269  */
8270 EAPI const char                  *evas_textblock_style_get(const Evas_Textblock_Style *ts) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
8271
8272
8273 /**
8274  * Set the objects style to ts.
8275  * @param obj the Evas object to set the style to.
8276  * @param ts  the style to set.
8277  * @return Returns no value.
8278  */
8279 EAPI void                         evas_object_textblock_style_set(Evas_Object *obj, Evas_Textblock_Style *ts) EINA_ARG_NONNULL(1);
8280
8281 /**
8282  * Return the style of an object.
8283  * @param obj  the object to get the style from.
8284  * @return the style of the object.
8285  */
8286 EAPI const Evas_Textblock_Style  *evas_object_textblock_style_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
8287
8288 /**
8289  * @brief Set the "replacement character" to use for the given textblock object.
8290  *
8291  * @param obj The given textblock object.
8292  * @param ch The charset name.
8293  */
8294 EAPI void                         evas_object_textblock_replace_char_set(Evas_Object *obj, const char *ch) EINA_ARG_NONNULL(1);
8295
8296 /**
8297  * @brief Get the "replacement character" for given textblock object. Returns
8298  * NULL if no replacement character is in use.
8299  *
8300  * @param obj The given textblock object
8301  * @return replacement character or @c NULL
8302  */
8303 EAPI const char                  *evas_object_textblock_replace_char_get(Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
8304
8305 /**
8306  * @brief Sets the vertical alignment of text within the textblock object
8307  * as a whole.
8308  *
8309  * Normally alignment is 0.0 (top of object). Values given should be
8310  * between 0.0 and 1.0 (1.0 bottom of object, 0.5 being vertically centered
8311  * etc.).
8312  *
8313  * @param obj The given textblock object.
8314  * @param align A value between 0.0 and 1.0
8315  * @since 1.1.0
8316  */
8317 EAPI void                         evas_object_textblock_valign_set(Evas_Object *obj, double align);
8318
8319 /**
8320  * @brief Gets the vertical alignment of a textblock
8321  *
8322  * @param obj The given textblock object.
8323  * @return The elignment set for the object
8324  * @since 1.1.0
8325  */
8326 EAPI double                       evas_object_textblock_valign_get(const Evas_Object *obj);
8327
8328 /**
8329  * @brief Sets the BiDi delimiters used in the textblock.
8330  *
8331  * BiDi delimiters are use for in-paragraph separation of bidi segments. This
8332  * is useful for example in recipients fields of e-mail clients where bidi
8333  * oddities can occur when mixing rtl and ltr.
8334  *
8335  * @param obj The given textblock object.
8336  * @param delim A null terminated string of delimiters, e.g ",|".
8337  * @since 1.1.0
8338  */
8339 EAPI void                         evas_object_textblock_bidi_delimiters_set(Evas_Object *obj, const char *delim);
8340
8341 /**
8342  * @brief Gets the BiDi delimiters used in the textblock.
8343  *
8344  * BiDi delimiters are use for in-paragraph separation of bidi segments. This
8345  * is useful for example in recipients fields of e-mail clients where bidi
8346  * oddities can occur when mixing rtl and ltr.
8347  *
8348  * @param obj The given textblock object.
8349  * @return A null terminated string of delimiters, e.g ",|". If empty, returns NULL.
8350  * @since 1.1.0
8351  */
8352 EAPI const char                  *evas_object_textblock_bidi_delimiters_get(const Evas_Object *obj);
8353
8354 /**
8355  * @brief Sets newline mode. When true, newline character will behave
8356  * as a paragraph separator.
8357  *
8358  * @param obj The given textblock object.
8359  * @param mode EINA_TRUE for legacy mode, EINA_FALSE otherwise.
8360  * @since 1.1.0
8361  */
8362 EAPI void                         evas_object_textblock_legacy_newline_set(Evas_Object *obj, Eina_Bool mode) EINA_ARG_NONNULL(1);
8363
8364 /**
8365  * @brief Gets newline mode. When true, newline character behaves
8366  * as a paragraph separator.
8367  *
8368  * @param obj The given textblock object.
8369  * @return EINA_TRUE if in legacy mode, EINA_FALSE otherwise.
8370  * @since 1.1.0
8371  */
8372 EAPI Eina_Bool                    evas_object_textblock_legacy_newline_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
8373
8374
8375 /**
8376  * Sets the tetxblock's text to the markup text.
8377  *
8378  * @note assumes text does not include the unicode object replacement char (0xFFFC)
8379  *
8380  * @param obj  the textblock object.
8381  * @param text the markup text to use.
8382  * @return Return no value.
8383  */
8384 EAPI void                         evas_object_textblock_text_markup_set(Evas_Object *obj, const char *text) EINA_ARG_NONNULL(1);
8385
8386 /**
8387  * Prepends markup to the cursor cur.
8388  *
8389  * @note assumes text does not include the unicode object replacement char (0xFFFC)
8390  *
8391  * @param cur  the cursor to prepend to.
8392  * @param text the markup text to prepend.
8393  * @return Return no value.
8394  */
8395 EAPI void                         evas_object_textblock_text_markup_prepend(Evas_Textblock_Cursor *cur, const char *text) EINA_ARG_NONNULL(1, 2);
8396
8397 /**
8398  * Return the markup of the object.
8399  *
8400  * @param obj the Evas object.
8401  * @return the markup text of the object.
8402  */
8403 EAPI const char                  *evas_object_textblock_text_markup_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
8404
8405
8406 /**
8407  * Return the object's main cursor.
8408  *
8409  * @param obj the object.
8410  * @return the obj's main cursor.
8411  */
8412 EAPI Evas_Textblock_Cursor *evas_object_textblock_cursor_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
8413
8414 /**
8415  * Create a new cursor, associate it to the obj and init it to point
8416  * to the start of the textblock. Association to the object means the cursor
8417  * will be updated when the object will change.
8418  *
8419  * @note if you need speed and you know what you are doing, it's slightly faster to just allocate the cursor yourself and not associate it. (only people developing the actual object, and not users of the object).
8420  *
8421  * @param obj the object to associate to.
8422  * @return the new cursor.
8423  */
8424 EAPI Evas_Textblock_Cursor       *evas_object_textblock_cursor_new(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
8425
8426
8427 /**
8428  * Free the cursor and unassociate it from the object.
8429  * @note do not use it to free unassociated cursors.
8430  *
8431  * @param cur the cursor to free.
8432  * @return Returns no value.
8433  */
8434 EAPI void                         evas_textblock_cursor_free(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8435
8436
8437 /**
8438  * Sets the cursor to the start of the first text node.
8439  *
8440  * @param cur the cursor to update.
8441  * @return Returns no value.
8442  */
8443 EAPI void                         evas_textblock_cursor_paragraph_first(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8444
8445 /**
8446  * sets the cursor to the end of the last text node.
8447  *
8448  * @param cur the cursor to set.
8449  * @return Returns no value.
8450  */
8451 EAPI void                         evas_textblock_cursor_paragraph_last(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8452
8453 /**
8454  * Advances to the start of the next text node
8455  *
8456  * @param cur the cursor to update
8457  * @return #EINA_TRUE if it managed to advance a paragraph, #EINA_FALSE otherwise.
8458  */
8459 EAPI Eina_Bool                    evas_textblock_cursor_paragraph_next(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8460
8461 /**
8462  * Advances to the end of the previous text node
8463  *
8464  * @param cur the cursor to update
8465  * @return #EINA_TRUE if it managed to advance a paragraph, #EINA_FALSE otherwise.
8466  */
8467 EAPI Eina_Bool                    evas_textblock_cursor_paragraph_prev(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8468
8469 /**
8470  * Returns the
8471  *
8472  * @param obj The evas, must not be NULL.
8473  * @param anchor the anchor name to get
8474  * @return Returns the list format node corresponding to the anchor, may be null if there are none.
8475  */
8476 EAPI const Eina_List             *evas_textblock_node_format_list_get(const Evas_Object *obj, const char *anchor) EINA_ARG_NONNULL(1, 2);
8477
8478 /**
8479  * Returns the first format node.
8480  *
8481  * @param obj The evas, must not be NULL.
8482  * @return Returns the first format node, may be null if there are none.
8483  */
8484 EAPI const Evas_Object_Textblock_Node_Format *evas_textblock_node_format_first_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
8485
8486 /**
8487  * Returns the last format node.
8488  *
8489  * @param obj The evas textblock, must not be NULL.
8490  * @return Returns the first format node, may be null if there are none.
8491  */
8492 EAPI const Evas_Object_Textblock_Node_Format *evas_textblock_node_format_last_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
8493
8494 /**
8495  * Returns the next format node (after n)
8496  *
8497  * @param n the current format node - not null.
8498  * @return Returns the next format node, may be null.
8499  */
8500 EAPI const Evas_Object_Textblock_Node_Format *evas_textblock_node_format_next_get(const Evas_Object_Textblock_Node_Format *n) EINA_ARG_NONNULL(1);
8501
8502 /**
8503  * Returns the prev format node (after n)
8504  *
8505  * @param n the current format node - not null.
8506  * @return Returns the prev format node, may be null.
8507  */
8508 EAPI const Evas_Object_Textblock_Node_Format *evas_textblock_node_format_prev_get(const Evas_Object_Textblock_Node_Format *n) EINA_ARG_NONNULL(1);
8509
8510 /**
8511  * Remove a format node and it's match. i.e, removes a <tag> </tag> pair.
8512  * Assumes the node is the first part of <tag> i.e, this won't work if
8513  * n is a closing tag.
8514  *
8515  * @param obj the Evas object of the textblock - not null.
8516  * @param n the current format node - not null.
8517  */
8518 EAPI void                         evas_textblock_node_format_remove_pair(Evas_Object *obj, Evas_Object_Textblock_Node_Format *n) EINA_ARG_NONNULL(1, 2);
8519
8520 /**
8521  * Sets the cursor to point to the place where format points to.
8522  *
8523  * @param cur the cursor to update.
8524  * @param n the format node to update according.
8525  * @deprecated duplicate of evas_textblock_cursor_at_format_set
8526  */
8527 EINA_DEPRECATED EAPI void                         evas_textblock_cursor_set_at_format(Evas_Textblock_Cursor *cur, const Evas_Object_Textblock_Node_Format *n) EINA_ARG_NONNULL(1, 2);
8528
8529 /**
8530  * Return the format node at the position pointed by cur.
8531  *
8532  * @param cur the position to look at.
8533  * @return the format node if found, NULL otherwise.
8534  * @see evas_textblock_cursor_format_is_visible_get()
8535  */
8536 EAPI const Evas_Object_Textblock_Node_Format *evas_textblock_cursor_format_get(const Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8537
8538 /**
8539  * Get the text format representation of the format node.
8540  *
8541  * @param fmt the format node.
8542  * @return the textual format of the format node.
8543  */
8544 EAPI const char                  *evas_textblock_node_format_text_get(const Evas_Object_Textblock_Node_Format *fnode) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
8545
8546 /**
8547  * Set the cursor to point to the position of fmt.
8548  *
8549  * @param cur the cursor to update
8550  * @param fmt the format to update according to.
8551  */
8552 EAPI void                         evas_textblock_cursor_at_format_set(Evas_Textblock_Cursor *cur, const Evas_Object_Textblock_Node_Format *fmt) EINA_ARG_NONNULL(1, 2);
8553
8554 /**
8555  * Check if the current cursor position is a visible format. This way is more
8556  * efficient than evas_textblock_cursor_format_get() to check for the existence
8557  * of a visible format.
8558  *
8559  * @param cur the cursor to look at.
8560  * @return #EINA_TRUE if the cursor points to a visible format, #EINA_FALSE otherwise.
8561  * @see evas_textblock_cursor_format_get()
8562  */
8563 EAPI Eina_Bool                    evas_textblock_cursor_format_is_visible_get(const Evas_Textblock_Cursor *cur) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
8564
8565 /**
8566  * Advances to the next format node
8567  *
8568  * @param cur the cursor to be updated.
8569  * @return #EINA_TRUE on success #EINA_FALSE otherwise.
8570  */
8571 EAPI Eina_Bool                    evas_textblock_cursor_format_next(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8572
8573 /**
8574  * Advances to the previous format node.
8575  *
8576  * @param cur the cursor to update.
8577  * @return #EINA_TRUE on success #EINA_FALSE otherwise.
8578  */
8579 EAPI Eina_Bool                    evas_textblock_cursor_format_prev(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8580
8581 /**
8582  * Returns true if the cursor points to a format.
8583  *
8584  * @param cur the cursor to check.
8585  * @return Returns #EINA_TRUE if a cursor points to a format #EINA_FALSE otherwise.
8586  */
8587 EAPI Eina_Bool                    evas_textblock_cursor_is_format(const Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8588
8589 /**
8590  * Advances 1 char forward.
8591  *
8592  * @param cur the cursor to advance.
8593  * @return #EINA_TRUE on success #EINA_FALSE otherwise.
8594  */
8595 EAPI Eina_Bool                    evas_textblock_cursor_char_next(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8596
8597 /**
8598  * Advances 1 char backward.
8599  *
8600  * @param cur the cursor to advance.
8601  * @return #EINA_TRUE on success #EINA_FALSE otherwise.
8602  */
8603 EAPI Eina_Bool                    evas_textblock_cursor_char_prev(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8604
8605 /**
8606  * Moves the cursor to the start of the word under the cursor.
8607  *
8608  * @param cur the cursor to move.
8609  * @return #EINA_TRUE on success #EINA_FALSE otherwise.
8610  * @since 1.2.0
8611  */
8612 EAPI Eina_Bool                    evas_textblock_cursor_word_start(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8613
8614 /**
8615  * Moves the cursor to the end of the word under the cursor.
8616  *
8617  * @param cur the cursor to move.
8618  * @return #EINA_TRUE on success #EINA_FALSE otherwise.
8619  * @since 1.2.0
8620  */
8621 EAPI Eina_Bool                    evas_textblock_cursor_word_end(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8622
8623 /**
8624  * Go to the first char in the node the cursor is pointing on.
8625  *
8626  * @param cur the cursor to update.
8627  * @return Returns no value.
8628  */
8629 EAPI void                         evas_textblock_cursor_paragraph_char_first(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8630
8631 /**
8632  * Go to the last char in a text node.
8633  *
8634  * @param cur the cursor to update.
8635  * @return Returns no value.
8636  */
8637 EAPI void                         evas_textblock_cursor_paragraph_char_last(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8638
8639 /**
8640  * Go to the start of the current line
8641  *
8642  * @param cur the cursor to update.
8643  * @return Returns no value.
8644  */
8645 EAPI void                         evas_textblock_cursor_line_char_first(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8646
8647 /**
8648  * Go to the end of the current line.
8649  *
8650  * @param cur the cursor to update.
8651  * @return Returns no value.
8652  */
8653 EAPI void                         evas_textblock_cursor_line_char_last(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8654
8655 /**
8656  * Return the current cursor pos.
8657  *
8658  * @param cur the cursor to take the position from.
8659  * @return the position or -1 on error
8660  */
8661 EAPI int                          evas_textblock_cursor_pos_get(const Evas_Textblock_Cursor *cur) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
8662
8663 /**
8664  * Set the cursor pos.
8665  *
8666  * @param cur the cursor to be set.
8667  * @param pos the pos to set.
8668  */
8669 EAPI void                         evas_textblock_cursor_pos_set(Evas_Textblock_Cursor *cur, int pos) EINA_ARG_NONNULL(1);
8670
8671 /**
8672  * Go to the start of the line passed
8673  *
8674  * @param cur cursor to update.
8675  * @param line numer to set.
8676  * @return #EINA_TRUE on success, #EINA_FALSE on error.
8677  */
8678 EAPI Eina_Bool                    evas_textblock_cursor_line_set(Evas_Textblock_Cursor *cur, int line) EINA_ARG_NONNULL(1);
8679
8680 /**
8681  * Compare two cursors.
8682  *
8683  * @param cur1 the first cursor.
8684  * @param cur2 the second cursor.
8685  * @return -1 if cur1 < cur2, 0 if cur1 == cur2 and 1 otherwise.
8686  */
8687 EAPI int                          evas_textblock_cursor_compare(const Evas_Textblock_Cursor *cur1, const Evas_Textblock_Cursor *cur2) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2);
8688
8689 /**
8690  * Make cur_dest point to the same place as cur. Does not work if they don't
8691  * point to the same object.
8692  *
8693  * @param cur the source cursor.
8694  * @param cur_dest destination cursor.
8695  * @return Returns no value.
8696  */
8697 EAPI void                         evas_textblock_cursor_copy(const Evas_Textblock_Cursor *cur, Evas_Textblock_Cursor *cur_dest) EINA_ARG_NONNULL(1, 2);
8698
8699
8700 /**
8701  * Adds text to the current cursor position and set the cursor to *before*
8702  * the start of the text just added.
8703  *
8704  * @param cur the cursor to where to add text at.
8705  * @param _text the text to add.
8706  * @return Returns the len of the text added.
8707  * @see evas_textblock_cursor_text_prepend()
8708  */
8709 EAPI int                          evas_textblock_cursor_text_append(Evas_Textblock_Cursor *cur, const char *text) EINA_ARG_NONNULL(1, 2);
8710
8711 /**
8712  * Adds text to the current cursor position and set the cursor to *after*
8713  * the start of the text just added.
8714  *
8715  * @param cur the cursor to where to add text at.
8716  * @param _text the text to add.
8717  * @return Returns the len of the text added.
8718  * @see evas_textblock_cursor_text_append()
8719  */
8720 EAPI int                          evas_textblock_cursor_text_prepend(Evas_Textblock_Cursor *cur, const char *text) EINA_ARG_NONNULL(1, 2);
8721
8722
8723 /**
8724  * Adds format to the current cursor position. If the format being added is a
8725  * visible format, add it *before* the cursor position, otherwise, add it after.
8726  * This behavior is because visible formats are like characters and invisible
8727  * should be stacked in a way that the last one is added last.
8728  *
8729  * This function works with native formats, that means that style defined
8730  * tags like <br> won't work here. For those kind of things use markup prepend.
8731  *
8732  * @param cur the cursor to where to add format at.
8733  * @param format the format to add.
8734  * @return Returns true if a visible format was added, false otherwise.
8735  * @see evas_textblock_cursor_format_prepend()
8736  */
8737
8738 /**
8739  * Check if the current cursor position points to the terminating null of the
8740  * last paragraph. (shouldn't be allowed to point to the terminating null of
8741  * any previous paragraph anyway.
8742  *
8743  * @param cur the cursor to look at.
8744  * @return #EINA_TRUE if the cursor points to the terminating null, #EINA_FALSE otherwise.
8745  */
8746 EAPI Eina_Bool                    evas_textblock_cursor_format_append(Evas_Textblock_Cursor *cur, const char *format) EINA_ARG_NONNULL(1, 2);
8747
8748 /**
8749  * Adds format to the current cursor position. If the format being added is a
8750  * visible format, add it *before* the cursor position, otherwise, add it after.
8751  * This behavior is because visible formats are like characters and invisible
8752  * should be stacked in a way that the last one is added last.
8753  * If the format is visible the cursor is advanced after it.
8754  *
8755  * This function works with native formats, that means that style defined
8756  * tags like <br> won't work here. For those kind of things use markup prepend.
8757  *
8758  * @param cur the cursor to where to add format at.
8759  * @param format the format to add.
8760  * @return Returns true if a visible format was added, false otherwise.
8761  * @see evas_textblock_cursor_format_prepend()
8762  */
8763 EAPI Eina_Bool                    evas_textblock_cursor_format_prepend(Evas_Textblock_Cursor *cur, const char *format) EINA_ARG_NONNULL(1, 2);
8764
8765 /**
8766  * Delete the character at the location of the cursor. If there's a format
8767  * pointing to this position, delete it as well.
8768  *
8769  * @param cur the cursor pointing to the current location.
8770  * @return Returns no value.
8771  */
8772 EAPI void                         evas_textblock_cursor_char_delete(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8773
8774 /**
8775  * Delete the range between cur1 and cur2.
8776  *
8777  * @param cur1 one side of the range.
8778  * @param cur2 the second side of the range
8779  * @return Returns no value.
8780  */
8781 EAPI void                         evas_textblock_cursor_range_delete(Evas_Textblock_Cursor *cur1, Evas_Textblock_Cursor *cur2) EINA_ARG_NONNULL(1, 2);
8782
8783
8784 /**
8785  * Return the text of the paragraph cur points to - returns the text in markup..
8786  *
8787  * @param cur the cursor pointing to the paragraph.
8788  * @return the text on success, NULL otherwise.
8789  */
8790 EAPI const char                  *evas_textblock_cursor_paragraph_text_get(const Evas_Textblock_Cursor *cur) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
8791
8792 /**
8793  * Return the length of the paragraph, cheaper the eina_unicode_strlen()
8794  *
8795  * @param cur the position of the paragraph.
8796  * @return the length of the paragraph on success, -1 otehrwise.
8797  */
8798 EAPI int                          evas_textblock_cursor_paragraph_text_length_get(const Evas_Textblock_Cursor *cur) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
8799
8800 /**
8801  * Return the currently visible range.
8802  *
8803  * @param start the start of the range.
8804  * @param end the end of the range.
8805  * @return EINA_TRUE on success. EINA_FALSE otherwise.
8806  * @since 1.1.0
8807  */
8808 EAPI Eina_Bool                         evas_textblock_cursor_visible_range_get(Evas_Textblock_Cursor *start, Evas_Textblock_Cursor *end) EINA_ARG_NONNULL(1, 2);
8809
8810 /**
8811  * Return the format nodes in the range between cur1 and cur2.
8812  *
8813  * @param cur1 one side of the range.
8814  * @param cur2 the other side of the range
8815  * @return the foramt nodes in the range. You have to free it.
8816  * @since 1.1.0
8817  */
8818 EAPI Eina_List *                 evas_textblock_cursor_range_formats_get(const Evas_Textblock_Cursor *cur1, const Evas_Textblock_Cursor *cur2) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2);
8819
8820 /**
8821  * Return the text in the range between cur1 and cur2
8822  *
8823  * @param cur1 one side of the range.
8824  * @param cur2 the other side of the range
8825  * @param format The form on which to return the text. Markup - in textblock markup. Plain - UTF8.
8826  * @return the text in the range
8827  * @see elm_entry_markup_to_utf8()
8828  */
8829 EAPI char                        *evas_textblock_cursor_range_text_get(const Evas_Textblock_Cursor *cur1, const Evas_Textblock_Cursor *cur2, Evas_Textblock_Text_Type format) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2);
8830
8831 /**
8832  * Return the content of the cursor.
8833  *
8834  * Free the returned string pointer when done (if it is not NULL).
8835  * 
8836  * @param cur the cursor
8837  * @return the text in the range, terminated by a nul byte (may be utf8).
8838  */
8839 EAPI char                        *evas_textblock_cursor_content_get(const Evas_Textblock_Cursor *cur) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
8840
8841
8842 /**
8843  * Returns the geometry of the cursor. Depends on the type of cursor requested.
8844  * This should be used instead of char_geometry_get because there are weird
8845  * special cases with BiDi text.
8846  * in '_' cursor mode (i.e a line below the char) it's the same as char_geometry
8847  * get, except for the case of the last char of a line which depends on the
8848  * paragraph direction.
8849  *
8850  * in '|' cursor mode (i.e a line between two chars) it is very varyable.
8851  * For example consider the following visual string:
8852  * "abcCBA" (ABC are rtl chars), a cursor pointing on A should actually draw
8853  * a '|' between the c and the C.
8854  *
8855  * @param cur the cursor.
8856  * @param cx the x of the cursor
8857  * @param cy the y of the cursor
8858  * @param cw the width of the cursor
8859  * @param ch the height of the cursor
8860  * @param dir the direction of the cursor, can be NULL.
8861  * @param ctype the type of the cursor.
8862  * @return line number of the char on success, -1 on error.
8863  */
8864 EAPI int                          evas_textblock_cursor_geometry_get(const Evas_Textblock_Cursor *cur, Evas_Coord *cx, Evas_Coord *cy, Evas_Coord *cw, Evas_Coord *ch, Evas_BiDi_Direction *dir, Evas_Textblock_Cursor_Type ctype) EINA_ARG_NONNULL(1);
8865
8866 /**
8867  * Returns the geometry of the char at cur.
8868  *
8869  * @param cur the position of the char.
8870  * @param cx the x of the char.
8871  * @param cy the y of the char.
8872  * @param cw the w of the char.
8873  * @param ch the h of the char.
8874  * @return line number of the char on success, -1 on error.
8875  */
8876 EAPI int                          evas_textblock_cursor_char_geometry_get(const Evas_Textblock_Cursor *cur, Evas_Coord *cx, Evas_Coord *cy, Evas_Coord *cw, Evas_Coord *ch) EINA_ARG_NONNULL(1);
8877
8878 /**
8879  * Returns the geometry of the pen at cur.
8880  *
8881  * @param cur the position of the char.
8882  * @param cpen_x the pen_x of the char.
8883  * @param cy the y of the char.
8884  * @param cadv the adv of the char.
8885  * @param ch the h of the char.
8886  * @return line number of the char on success, -1 on error.
8887  */
8888 EAPI int                          evas_textblock_cursor_pen_geometry_get(const Evas_Textblock_Cursor *cur, Evas_Coord *cpen_x, Evas_Coord *cy, Evas_Coord *cadv, Evas_Coord *ch) EINA_ARG_NONNULL(1);
8889
8890 /**
8891  * Returns the geometry of the line at cur.
8892  *
8893  * @param cur the position of the line.
8894  * @param cx the x of the line.
8895  * @param cy the y of the line.
8896  * @param cw the width of the line.
8897  * @param ch the height of the line.
8898  * @return line number of the line on success, -1 on error.
8899  */
8900 EAPI int                          evas_textblock_cursor_line_geometry_get(const Evas_Textblock_Cursor *cur, Evas_Coord *cx, Evas_Coord *cy, Evas_Coord *cw, Evas_Coord *ch) EINA_ARG_NONNULL(1);
8901
8902 /**
8903  * Set the position of the cursor according to the X and Y coordinates.
8904  *
8905  * @param cur the cursor to set.
8906  * @param x coord to set by.
8907  * @param y coord to set by.
8908  * @return #EINA_TRUE on success, #EINA_FALSE otherwise.
8909  */
8910 EAPI Eina_Bool                    evas_textblock_cursor_char_coord_set(Evas_Textblock_Cursor *cur, Evas_Coord x, Evas_Coord y) EINA_ARG_NONNULL(1);
8911
8912 /**
8913  * Set the cursor position according to the y coord.
8914  *
8915  * @param cur the cur to be set.
8916  * @param y the coord to set by.
8917  * @return the line number found, -1 on error.
8918  */
8919 EAPI int                          evas_textblock_cursor_line_coord_set(Evas_Textblock_Cursor *cur, Evas_Coord y) EINA_ARG_NONNULL(1);
8920
8921 /**
8922  * Get the geometry of a range.
8923  *
8924  * @param cur1 one side of the range.
8925  * @param cur2 other side of the range.
8926  * @return a list of Rectangles representing the geometry of the range.
8927  */
8928 EAPI Eina_List                   *evas_textblock_cursor_range_geometry_get(const Evas_Textblock_Cursor *cur1, const Evas_Textblock_Cursor *cur2) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2);
8929    EAPI Eina_Bool                    evas_textblock_cursor_format_item_geometry_get(const Evas_Textblock_Cursor *cur, Evas_Coord *cx, Evas_Coord *cy, Evas_Coord *cw, Evas_Coord *ch) EINA_ARG_NONNULL(1);
8930
8931
8932 /**
8933  * Checks if the cursor points to the end of the line.
8934  *
8935  * @param cur the cursor to check.
8936  * @return #EINA_TRUE if true, #EINA_FALSE otherwise.
8937  */
8938 EAPI Eina_Bool                    evas_textblock_cursor_eol_get(const Evas_Textblock_Cursor *cur) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
8939
8940
8941 /**
8942  * Get the geometry of a line number.
8943  *
8944  * @param obj the object.
8945  * @param line the line number.
8946  * @param cx x coord of the line.
8947  * @param cy y coord of the line.
8948  * @param cw w coord of the line.
8949  * @param ch h coord of the line.
8950  * @return #EINA_TRUE on success, #EINA_FALSE otherwise.
8951  */
8952 EAPI Eina_Bool                    evas_object_textblock_line_number_geometry_get(const Evas_Object *obj, int line, Evas_Coord *cx, Evas_Coord *cy, Evas_Coord *cw, Evas_Coord *ch) EINA_ARG_NONNULL(1);
8953
8954 /**
8955  * Clear the textblock object.
8956  * @note Does *NOT* free the Evas object itself.
8957  *
8958  * @param obj the object to clear.
8959  * @return nothing.
8960  */
8961 EAPI void                         evas_object_textblock_clear(Evas_Object *obj) EINA_ARG_NONNULL(1);
8962
8963 /**
8964  * Get the formatted width and height. This calculates the actual size after restricting
8965  * the textblock to the current size of the object.
8966  * The main difference between this and @ref evas_object_textblock_size_native_get
8967  * is that the "native" function does not wrapping into account
8968  * it just calculates the real width of the object if it was placed on an
8969  * infinite canvas, while this function gives the size after wrapping
8970  * according to the size restrictions of the object.
8971  *
8972  * For example for a textblock containing the text: "You shall not pass!"
8973  * with no margins or padding and assuming a monospace font and a size of
8974  * 7x10 char widths (for simplicity) has a native size of 19x1
8975  * and a formatted size of 5x4.
8976  *
8977  *
8978  * @param obj the Evas object.
8979  * @param w[out] the width of the object.
8980  * @param h[out] the height of the object
8981  * @return Returns no value.
8982  * @see evas_object_textblock_size_native_get
8983  */
8984 EAPI void                         evas_object_textblock_size_formatted_get(const Evas_Object *obj, Evas_Coord *w, Evas_Coord *h) EINA_ARG_NONNULL(1);
8985
8986 /**
8987  * Get the native width and height. This calculates the actual size without taking account
8988  * the current size of the object.
8989  * The main difference between this and @ref evas_object_textblock_size_formatted_get
8990  * is that the "native" function does not take wrapping into account
8991  * it just calculates the real width of the object if it was placed on an
8992  * infinite canvas, while the "formatted" function gives the size after
8993  * wrapping text according to the size restrictions of the object.
8994  *
8995  * For example for a textblock containing the text: "You shall not pass!"
8996  * with no margins or padding and assuming a monospace font and a size of
8997  * 7x10 char widths (for simplicity) has a native size of 19x1
8998  * and a formatted size of 5x4.
8999  *
9000  * @param obj the Evas object of the textblock
9001  * @param w[out] the width returned
9002  * @param h[out] the height returned
9003  * @return Returns no value.
9004  */
9005 EAPI void                         evas_object_textblock_size_native_get(const Evas_Object *obj, Evas_Coord *w, Evas_Coord *h) EINA_ARG_NONNULL(1);
9006    EAPI void                         evas_object_textblock_style_insets_get(const Evas_Object *obj, Evas_Coord *l, Evas_Coord *r, Evas_Coord *t, Evas_Coord *b) EINA_ARG_NONNULL(1);
9007 /**
9008  * @}
9009  */
9010
9011 /**
9012  * @defgroup Evas_Line_Group Line Object Functions
9013  *
9014  * Functions used to deal with evas line objects.
9015  *
9016  * @ingroup Evas_Object_Specific
9017  *
9018  * @{
9019  */
9020
9021 /**
9022  * Adds a new evas line object to the given evas.
9023  * @param   e The given evas.
9024  * @return  The new evas line object.
9025  */
9026 EAPI Evas_Object      *evas_object_line_add              (Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
9027
9028 /**
9029  * Sets the coordinates of the end points of the given evas line object.
9030  * @param   obj The given evas line object.
9031  * @param   x1  The X coordinate of the first point.
9032  * @param   y1  The Y coordinate of the first point.
9033  * @param   x2  The X coordinate of the second point.
9034  * @param   y2  The Y coordinate of the second point.
9035  */
9036 EAPI void              evas_object_line_xy_set           (Evas_Object *obj, Evas_Coord x1, Evas_Coord y1, Evas_Coord x2, Evas_Coord y2);
9037
9038 /**
9039  * Retrieves the coordinates of the end points of the given evas line object.
9040  * @param obj The given line object.
9041  * @param x1  Pointer to an integer in which to store the X coordinate of the
9042  *            first end point.
9043  * @param y1  Pointer to an integer in which to store the Y coordinate of the
9044  *            first end point.
9045  * @param x2  Pointer to an integer in which to store the X coordinate of the
9046  *            second end point.
9047  * @param y2  Pointer to an integer in which to store the Y coordinate of the
9048  *            second end point.
9049  */
9050 EAPI void              evas_object_line_xy_get           (const Evas_Object *obj, Evas_Coord *x1, Evas_Coord *y1, Evas_Coord *x2, Evas_Coord *y2);
9051 /**
9052  * @}
9053  */
9054
9055 /**
9056  * @defgroup Evas_Object_Polygon Polygon Object Functions
9057  *
9058  * Functions that operate on evas polygon objects.
9059  *
9060  * Hint: as evas does not provide ellipse, smooth paths or circle, one
9061  * can calculate points and convert these to a polygon.
9062  *
9063  * @ingroup Evas_Object_Specific
9064  *
9065  * @{
9066  */
9067
9068 /**
9069  * Adds a new evas polygon object to the given evas.
9070  * @param   e The given evas.
9071  * @return  A new evas polygon object.
9072  */
9073 EAPI Evas_Object      *evas_object_polygon_add           (Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
9074
9075 /**
9076  * Adds the given point to the given evas polygon object.
9077  * @param obj The given evas polygon object.
9078  * @param x   The X coordinate of the given point.
9079  * @param y   The Y coordinate of the given point.
9080  * @ingroup Evas_Polygon_Group
9081  */
9082 EAPI void              evas_object_polygon_point_add     (Evas_Object *obj, Evas_Coord x, Evas_Coord y) EINA_ARG_NONNULL(1);
9083
9084 /**
9085  * Removes all of the points from the given evas polygon object.
9086  * @param   obj The given polygon object.
9087  */
9088 EAPI void              evas_object_polygon_points_clear  (Evas_Object *obj) EINA_ARG_NONNULL(1);
9089 /**
9090  * @}
9091  */
9092
9093 /* @since 1.2.0 */
9094 EAPI void              evas_object_is_frame_object_set(Evas_Object *obj, Eina_Bool is_frame);
9095
9096 /* @since 1.2.0 */
9097 EAPI Eina_Bool         evas_object_is_frame_object_get(Evas_Object *obj);
9098
9099 /**
9100  * @defgroup Evas_Smart_Group Smart Functions
9101  *
9102  * Functions that deal with #Evas_Smart structs, creating definition
9103  * (classes) of objects that will have customized behavior for methods
9104  * like evas_object_move(), evas_object_resize(),
9105  * evas_object_clip_set() and others.
9106  *
9107  * These objects will accept the generic methods defined in @ref
9108  * Evas_Object_Group and the extensions defined in @ref
9109  * Evas_Smart_Object_Group. There are a couple of existent smart
9110  * objects in Evas itself (see @ref Evas_Object_Box, @ref
9111  * Evas_Object_Table and @ref Evas_Smart_Object_Clipped).
9112  *
9113  * See also some @ref Example_Evas_Smart_Objects "examples" of this
9114  * group of functions.
9115  */
9116
9117 /**
9118  * @addtogroup Evas_Smart_Group
9119  * @{
9120  */
9121
9122 /**
9123  * @def EVAS_SMART_CLASS_VERSION
9124  *
9125  * The version you have to put into the version field in the
9126  * #Evas_Smart_Class struct. Used to safeguard from binaries with old
9127  * smart object intefaces running with newer ones.
9128  *
9129  * @ingroup Evas_Smart_Group
9130  */
9131 #define EVAS_SMART_CLASS_VERSION 4
9132 /**
9133  * @struct _Evas_Smart_Class
9134  *
9135  * A smart object's @b base class definition
9136  *
9137  * @ingroup Evas_Smart_Group
9138  */
9139 struct _Evas_Smart_Class
9140 {
9141    const char *name; /**< the name string of the class */
9142    int         version;
9143    void  (*add)         (Evas_Object *o); /**< code to be run when adding object to a canvas */
9144    void  (*del)         (Evas_Object *o); /**< code to be run when removing object to a canvas */
9145    void  (*move)        (Evas_Object *o, Evas_Coord x, Evas_Coord y); /**< code to be run when moving object on a canvas */
9146    void  (*resize)      (Evas_Object *o, Evas_Coord w, Evas_Coord h); /**< code to be run when resizing object on a canvas */
9147    void  (*show)        (Evas_Object *o); /**< code to be run when showing object on a canvas */
9148    void  (*hide)        (Evas_Object *o); /**< code to be run when hiding object on a canvas */
9149    void  (*color_set)   (Evas_Object *o, int r, int g, int b, int a); /**< code to be run when setting color of object on a canvas */
9150    void  (*clip_set)    (Evas_Object *o, Evas_Object *clip); /**< code to be run when setting clipper of object on a canvas */
9151    void  (*clip_unset)  (Evas_Object *o); /**< code to be run when unsetting clipper of object on a canvas */
9152    void  (*calculate)   (Evas_Object *o); /**< code to be run when object has rendering updates on a canvas */
9153    void  (*member_add)  (Evas_Object *o, Evas_Object *child); /**< code to be run when child member is added to object */
9154    void  (*member_del)  (Evas_Object *o, Evas_Object *child); /**< code to be run when child member is removed from object */
9155
9156    const Evas_Smart_Class          *parent; /**< this class inherits from this parent */
9157    const Evas_Smart_Cb_Description *callbacks; /**< callbacks at this level, @c NULL terminated */
9158    void                            *interfaces; /**< to be used in a future near you */
9159    const void                      *data;
9160 };
9161
9162 /**
9163  * @struct _Evas_Smart_Cb_Description
9164  *
9165  * Describes a callback issued by a smart object
9166  * (evas_object_smart_callback_call()), as defined in its smart object
9167  * class. This is particularly useful to explain to end users and
9168  * their code (i.e., introspection) what the parameter @c event_info
9169  * will point to.
9170  *
9171  * @ingroup Evas_Smart_Group
9172  */
9173 struct _Evas_Smart_Cb_Description
9174 {
9175    const char *name; /**< callback name ("changed", for example) */
9176
9177    /**
9178     * @brief Hint on the type of @c event_info parameter's contents on
9179     * a #Evas_Smart_Cb callback.
9180     *
9181     * The type string uses the pattern similar to
9182     * http://dbus.freedesktop.org/doc/dbus-specification.html#message-protocol-signatures,
9183     * but extended to optionally include variable names within
9184     * brackets preceding types. Example:
9185     *
9186     * @li Structure with two integers:
9187     *     @c "(ii)"
9188     *
9189     * @li Structure called 'x' with two integers named 'a' and 'b':
9190     *     @c "[x]([a]i[b]i)"
9191     *
9192     * @li Array of integers:
9193     *     @c "ai"
9194     *
9195     * @li Array called 'x' of struct with two integers:
9196     *     @c "[x]a(ii)"
9197     *
9198     * @note This type string is used as a hint and is @b not validated
9199     *       or enforced in any way. Implementors should make the best
9200     *       use of it to help bindings, documentation and other users
9201     *       of introspection features.
9202     */
9203    const char *type;
9204 };
9205
9206 /**
9207  * @def EVAS_SMART_CLASS_INIT_NULL
9208  * Initializer to zero a whole Evas_Smart_Class structure.
9209  *
9210  * @see EVAS_SMART_CLASS_INIT_VERSION
9211  * @see EVAS_SMART_CLASS_INIT_NAME_VERSION
9212  * @see EVAS_SMART_CLASS_INIT_NAME_VERSION_PARENT
9213  * @see EVAS_SMART_CLASS_INIT_NAME_VERSION_PARENT_CALLBACKS
9214  * @ingroup Evas_Smart_Group
9215  */
9216 #define EVAS_SMART_CLASS_INIT_NULL {NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL}
9217
9218 /**
9219  * @def EVAS_SMART_CLASS_INIT_VERSION
9220  * Initializer to zero a whole Evas_Smart_Class structure and set version.
9221  *
9222  * Similar to EVAS_SMART_CLASS_INIT_NULL, but will set version field to
9223  * latest EVAS_SMART_CLASS_VERSION.
9224  *
9225  * @see EVAS_SMART_CLASS_INIT_NULL
9226  * @see EVAS_SMART_CLASS_INIT_NAME_VERSION
9227  * @see EVAS_SMART_CLASS_INIT_NAME_VERSION_PARENT
9228  * @see EVAS_SMART_CLASS_INIT_NAME_VERSION_PARENT_CALLBACKS
9229  * @ingroup Evas_Smart_Group
9230  */
9231 #define EVAS_SMART_CLASS_INIT_VERSION {NULL, EVAS_SMART_CLASS_VERSION, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL}
9232
9233 /**
9234  * @def EVAS_SMART_CLASS_INIT_NAME_VERSION
9235  * Initializer to zero a whole Evas_Smart_Class structure and set name
9236  * and version.
9237  *
9238  * Similar to EVAS_SMART_CLASS_INIT_NULL, but will set version field to
9239  * latest EVAS_SMART_CLASS_VERSION and name to the specified value.
9240  *
9241  * It will keep a reference to name field as a "const char *", that is,
9242  * name must be available while the structure is used (hint: static or global!)
9243  * and will not be modified.
9244  *
9245  * @see EVAS_SMART_CLASS_INIT_NULL
9246  * @see EVAS_SMART_CLASS_INIT_VERSION
9247  * @see EVAS_SMART_CLASS_INIT_NAME_VERSION_PARENT
9248  * @see EVAS_SMART_CLASS_INIT_NAME_VERSION_PARENT_CALLBACKS
9249  * @ingroup Evas_Smart_Group
9250  */
9251 #define EVAS_SMART_CLASS_INIT_NAME_VERSION(name) {name, EVAS_SMART_CLASS_VERSION, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL}
9252
9253 /**
9254  * @def EVAS_SMART_CLASS_INIT_NAME_VERSION_PARENT
9255  * Initializer to zero a whole Evas_Smart_Class structure and set name,
9256  * version and parent class.
9257  *
9258  * Similar to EVAS_SMART_CLASS_INIT_NULL, but will set version field to
9259  * latest EVAS_SMART_CLASS_VERSION, name to the specified value and
9260  * parent class.
9261  *
9262  * It will keep a reference to name field as a "const char *", that is,
9263  * name must be available while the structure is used (hint: static or global!)
9264  * and will not be modified. Similarly, parent reference will be kept.
9265  *
9266  * @see EVAS_SMART_CLASS_INIT_NULL
9267  * @see EVAS_SMART_CLASS_INIT_VERSION
9268  * @see EVAS_SMART_CLASS_INIT_NAME_VERSION
9269  * @see EVAS_SMART_CLASS_INIT_NAME_VERSION_PARENT_CALLBACKS
9270  * @ingroup Evas_Smart_Group
9271  */
9272 #define EVAS_SMART_CLASS_INIT_NAME_VERSION_PARENT(name, parent) {name, EVAS_SMART_CLASS_VERSION, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, parent, NULL, NULL}
9273
9274 /**
9275  * @def EVAS_SMART_CLASS_INIT_NAME_VERSION_PARENT_CALLBACKS
9276  * Initializer to zero a whole Evas_Smart_Class structure and set name,
9277  * version, parent class and callbacks definition.
9278  *
9279  * Similar to EVAS_SMART_CLASS_INIT_NULL, but will set version field to
9280  * latest EVAS_SMART_CLASS_VERSION, name to the specified value, parent
9281  * class and callbacks at this level.
9282  *
9283  * It will keep a reference to name field as a "const char *", that is,
9284  * name must be available while the structure is used (hint: static or global!)
9285  * and will not be modified. Similarly, parent and callbacks reference
9286  * will be kept.
9287  *
9288  * @see EVAS_SMART_CLASS_INIT_NULL
9289  * @see EVAS_SMART_CLASS_INIT_VERSION
9290  * @see EVAS_SMART_CLASS_INIT_NAME_VERSION
9291  * @see EVAS_SMART_CLASS_INIT_NAME_VERSION_PARENT
9292  * @ingroup Evas_Smart_Group
9293  */
9294 #define EVAS_SMART_CLASS_INIT_NAME_VERSION_PARENT_CALLBACKS(name, parent, callbacks) {name, EVAS_SMART_CLASS_VERSION, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, parent, callbacks, NULL}
9295
9296 /**
9297  * @def EVAS_SMART_SUBCLASS_NEW
9298  *
9299  * Convenience macro to subclass a given Evas smart class.
9300  *
9301  * @param smart_name The name used for the smart class. e.g:
9302  * @c "Evas_Object_Box".
9303  * @param prefix Prefix used for all variables and functions defined
9304  * and referenced by this macro.
9305  * @param api_type Type of the structure used as API for the smart
9306  * class. Either #Evas_Smart_Class or something derived from it.
9307  * @param parent_type Type of the parent class API.
9308  * @param parent_func Function that gets the parent class. e.g:
9309  * evas_object_box_smart_class_get().
9310  * @param cb_desc Array of callback descriptions for this smart class.
9311  *
9312  * This macro saves some typing when writing a smart class derived
9313  * from another one. In order to work, the user @b must provide some
9314  * functions adhering to the following guidelines:
9315  *  - @<prefix@>_smart_set_user(): the @b internal @c _smart_set
9316  *    function (defined by this macro) will call this one, provided by
9317  *    the user, after inheriting everything from the parent, which
9318  *    should <b>take care of setting the right member functions for
9319  *    the class</b>, both overrides and extensions, if any.
9320  *  - If this new class should be subclassable as well, a @b public @c
9321  *    _smart_set() function is desirable to fill in the class used as
9322  *    parent by the children. It's up to the user to provide this
9323  *    interface, which will most likely call @<prefix@>_smart_set() to
9324  *    get the job done.
9325  *
9326  * After the macro's usage, the following will be defined for use:
9327  *  - @<prefix@>_parent_sc: A pointer to the @b parent smart
9328  *    class. When calling parent functions from overloaded ones, use
9329  *    this global variable.
9330  *  - @<prefix@>_smart_class_new(): this function returns the
9331  *    #Evas_Smart needed to create smart objects with this class,
9332  *    which should be passed to evas_object_smart_add().
9333  *
9334  * @warning @p smart_name has to be a pointer to a globally available
9335  * string! The smart class created here will just have a pointer set
9336  * to that, and all object instances will depend on it for smart class
9337  * name lookup.
9338  *
9339  * @ingroup Evas_Smart_Group
9340  */
9341 #define EVAS_SMART_SUBCLASS_NEW(smart_name, prefix, api_type, parent_type, parent_func, cb_desc) \
9342   static const parent_type * prefix##_parent_sc = NULL;                 \
9343   static void prefix##_smart_set_user(api_type *api);                   \
9344   static void prefix##_smart_set(api_type *api)                         \
9345   {                                                                     \
9346      Evas_Smart_Class *sc;                                              \
9347      if (!(sc = (Evas_Smart_Class *)api))                               \
9348        return;                                                          \
9349      if (!prefix##_parent_sc)                                           \
9350        prefix##_parent_sc = parent_func();                              \
9351      evas_smart_class_inherit(sc, (const Evas_Smart_Class *)prefix##_parent_sc); \
9352      prefix##_smart_set_user(api);                                      \
9353   }                                                                     \
9354   static Evas_Smart * prefix##_smart_class_new(void)                    \
9355   {                                                                     \
9356      static Evas_Smart *smart = NULL;                                   \
9357      static api_type api;                                               \
9358      if (!smart)                                                        \
9359        {                                                                \
9360           Evas_Smart_Class *sc = (Evas_Smart_Class *)&api;              \
9361           memset(&api, 0, sizeof(api_type));                            \
9362           sc->version = EVAS_SMART_CLASS_VERSION;                       \
9363           sc->name = smart_name;                                        \
9364           sc->callbacks = cb_desc;                                      \
9365           prefix##_smart_set(&api);                                     \
9366           smart = evas_smart_class_new(sc);                             \
9367        }                                                                \
9368      return smart;                                                      \
9369   }
9370
9371 /**
9372  * @def EVAS_SMART_DATA_ALLOC
9373  *
9374  * Convenience macro to allocate smart data only if needed.
9375  *
9376  * When writing a subclassable smart object, the @c .add() function
9377  * will need to check if the smart private data was already allocated
9378  * by some child object or not. This macro makes it easier to do it.
9379  *
9380  * @note This is an idiom used when one calls the parent's @c. add()
9381  * after the specialized code. Naturally, the parent's base smart data
9382  * has to be contemplated as the specialized one's first member, for
9383  * things to work.
9384  *
9385  * @param o Evas object passed to the @c .add() function
9386  * @param priv_type The type of the data to allocate
9387  *
9388  * @ingroup Evas_Smart_Group
9389  */
9390 #define EVAS_SMART_DATA_ALLOC(o, priv_type) \
9391    priv_type *priv; \
9392    priv = evas_object_smart_data_get(o); \
9393    if (!priv) { \
9394       priv = (priv_type *)calloc(1, sizeof(priv_type)); \
9395       if (!priv) return; \
9396       evas_object_smart_data_set(o, priv); \
9397    }
9398
9399
9400 /**
9401  * Free an #Evas_Smart struct
9402  *
9403  * @param s the #Evas_Smart struct to free
9404  *
9405  * @warning If this smart handle was created using
9406  * evas_smart_class_new(), the associated #Evas_Smart_Class will not
9407  * be freed.
9408  *
9409  * @note If you're using the #EVAS_SMART_SUBCLASS_NEW schema to create your
9410  * smart object, note that an #Evas_Smart handle will be shared amongst all
9411  * instances of the given smart class, through a static variable.
9412  * Evas will internally count references on #Evas_Smart handles and free them
9413  * when they are not referenced anymore. Thus, this function is of no use
9414  * for Evas users, most probably.
9415  */
9416 EAPI void                             evas_smart_free                     (Evas_Smart *s) EINA_ARG_NONNULL(1);
9417
9418 /**
9419  * Creates a new #Evas_Smart from a given #Evas_Smart_Class struct
9420  *
9421  * @param sc the smart class definition
9422  * @return a new #Evas_Smart pointer
9423  *
9424  * #Evas_Smart handles are necessary to create new @b instances of
9425  * smart objects belonging to the class described by @p sc. That
9426  * handle will contain, besides the smart class interface definition,
9427  * all its smart callbacks infrastructure set, too.
9428  *
9429  * @note If you are willing to subclass a given smart class to
9430  * construct yours, consider using the #EVAS_SMART_SUBCLASS_NEW macro,
9431  * which will make use of this function automatically for you.
9432  */
9433 EAPI Evas_Smart                      *evas_smart_class_new                (const Evas_Smart_Class *sc) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
9434
9435 /**
9436  * Get the #Evas_Smart_Class handle of an #Evas_Smart struct
9437  *
9438  * @param s a valid #Evas_Smart pointer
9439  * @return the #Evas_Smart_Class in it
9440  */
9441 EAPI const Evas_Smart_Class          *evas_smart_class_get                (const Evas_Smart *s) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
9442
9443
9444 /**
9445  * @brief Get the data pointer set on an #Evas_Smart struct
9446  *
9447  * @param s a valid #Evas_Smart handle
9448  *
9449  * This data pointer is set as the data field in the #Evas_Smart_Class
9450  * passed in to evas_smart_class_new().
9451  */
9452 EAPI void                            *evas_smart_data_get                 (const Evas_Smart *s) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
9453
9454 /**
9455  * Get the smart callbacks known by this #Evas_Smart handle's smart
9456  * class hierarchy.
9457  *
9458  * @param s A valid #Evas_Smart handle.
9459  * @param[out] count Returns the number of elements in the returned
9460  * array.
9461  * @return The array with callback descriptions known by this smart
9462  *         class, with its size returned in @a count parameter. It
9463  *         should not be modified in any way. If no callbacks are
9464  *         known, @c NULL is returned. The array is sorted by event
9465  *         names and elements refer to the original values given to
9466  *         evas_smart_class_new()'s #Evas_Smart_Class::callbacks
9467  *         (pointer to them).
9468  *
9469  * This is likely different from
9470  * evas_object_smart_callbacks_descriptions_get() as it will contain
9471  * the callbacks of @b all this class hierarchy sorted, while the
9472  * direct smart class member refers only to that specific class and
9473  * should not include parent's.
9474  *
9475  * If no callbacks are known, this function returns @c NULL.
9476  *
9477  * The array elements and thus their contents will be @b references to
9478  * original values given to evas_smart_class_new() as
9479  * Evas_Smart_Class::callbacks.
9480  *
9481  * The array is sorted by Evas_Smart_Cb_Description::name. The last
9482  * array element is a @c NULL pointer and is not accounted for in @a
9483  * count. Loop iterations can check any of these size indicators.
9484  *
9485  * @note objects may provide per-instance callbacks, use
9486  *       evas_object_smart_callbacks_descriptions_get() to get those
9487  *       as well.
9488  * @see evas_object_smart_callbacks_descriptions_get()
9489  */
9490 EAPI const Evas_Smart_Cb_Description **evas_smart_callbacks_descriptions_get(const Evas_Smart *s, unsigned int *count) EINA_ARG_NONNULL(1, 1);
9491
9492
9493 /**
9494  * Find a callback description for the callback named @a name.
9495  *
9496  * @param s The #Evas_Smart where to search for class registered smart
9497  * event callbacks.
9498  * @param name Name of the desired callback, which must @b not be @c
9499  *        NULL. The search has a special case for @a name being the
9500  *        same pointer as registered with #Evas_Smart_Cb_Description.
9501  *        One can use it to avoid excessive use of strcmp().
9502  * @return A reference to the description if found, or @c NULL, otherwise
9503  *
9504  * @see evas_smart_callbacks_descriptions_get()
9505  */
9506 EAPI const Evas_Smart_Cb_Description *evas_smart_callback_description_find(const Evas_Smart *s, const char *name) EINA_ARG_NONNULL(1, 2);
9507
9508
9509 /**
9510  * Sets one class to inherit from the other.
9511  *
9512  * Copy all function pointers, set @c parent to @a parent_sc and copy
9513  * everything after sizeof(Evas_Smart_Class) present in @a parent_sc,
9514  * using @a parent_sc_size as reference.
9515  *
9516  * This is recommended instead of a single memcpy() since it will take
9517  * care to not modify @a sc name, version, callbacks and possible
9518  * other members.
9519  *
9520  * @param sc child class.
9521  * @param parent_sc parent class, will provide attributes.
9522  * @param parent_sc_size size of parent_sc structure, child should be at least
9523  *        this size. Everything after @c Evas_Smart_Class size is copied
9524  *        using regular memcpy().
9525  */
9526 EAPI Eina_Bool                        evas_smart_class_inherit_full       (Evas_Smart_Class *sc, const Evas_Smart_Class *parent_sc, unsigned int parent_sc_size) EINA_ARG_NONNULL(1, 2);
9527
9528 /**
9529  * Get the number of users of the smart instance
9530  *
9531  * @param s The Evas_Smart to get the usage count of
9532  * @return The number of uses of the smart instance
9533  *
9534  * This function tells you how many more uses of the smart instance are in
9535  * existence. This should be used before freeing/clearing any of the
9536  * Evas_Smart_Class that was used to create the smart instance. The smart
9537  * instance will refer to data in the Evas_Smart_Class used to create it and
9538  * thus you cannot remove the original data until all users of it are gone.
9539  * When the usage count goes to 0, you can evas_smart_free() the smart
9540  * instance @p s and remove from memory any of the Evas_Smart_Class that
9541  * was used to create the smart instance, if you desire. Removing it from
9542  * memory without doing this will cause problems (crashes, undefined
9543  * behavior etc. etc.), so either never remove the original
9544  * Evas_Smart_Class data from memory (have it be a constant structure and
9545  * data), or use this API call and be very careful.
9546  */
9547 EAPI int                              evas_smart_usage_get(const Evas_Smart *s);
9548
9549   /**
9550    * @def evas_smart_class_inherit
9551    * Easy to use version of evas_smart_class_inherit_full().
9552    *
9553    * This version will use sizeof(parent_sc), copying everything.
9554    *
9555    * @param sc child class, will have methods copied from @a parent_sc
9556    * @param parent_sc parent class, will provide contents to be copied.
9557    * @return 1 on success, 0 on failure.
9558    * @ingroup Evas_Smart_Group
9559    */
9560 #define evas_smart_class_inherit(sc, parent_sc) evas_smart_class_inherit_full(sc, parent_sc, sizeof(*parent_sc))
9561
9562 /**
9563  * @}
9564  */
9565
9566 /**
9567  * @defgroup Evas_Smart_Object_Group Smart Object Functions
9568  *
9569  * Functions dealing with Evas smart objects (instances).
9570  *
9571  * Smart objects are groupings of primitive Evas objects that behave
9572  * as a cohesive group. For instance, a file manager icon may be a
9573  * smart object composed of an image object, a text label and two
9574  * rectangles that appear behind the image and text when the icon is
9575  * selected. As a smart object, the normal Evas object API could be
9576  * used on the icon object.
9577  *
9578  * Besides that, generally smart objects implement a <b>specific
9579  * API</b>, so that users interect with its own custom features. The
9580  * API takes form of explicit exported functions one may call and
9581  * <b>smart callbacks</b>.
9582  *
9583  * @section Evas_Smart_Object_Group_Callbacks Smart events and callbacks
9584  *
9585  * Smart objects can elect events (smart events, from now on) ocurring
9586  * inside of them to be reported back to their users via callback
9587  * functions (smart callbacks). This way, you can extend Evas' own
9588  * object events. They are defined by an <b>event string</b>, which
9589  * identifies them uniquely. There's also a function prototype
9590  * definition for the callback functions: #Evas_Smart_Cb.
9591  *
9592  * When defining an #Evas_Smart_Class, smart object implementors are
9593  * strongly encorauged to properly set the Evas_Smart_Class::callbacks
9594  * callbacks description array, so that the users of the smart object
9595  * can have introspection on its events API <b>at run time</b>.
9596  *
9597  * See some @ref Example_Evas_Smart_Objects "examples" of this group
9598  * of functions.
9599  *
9600  * @see @ref Evas_Smart_Group for class definitions.
9601  */
9602
9603 /**
9604  * @addtogroup Evas_Smart_Object_Group
9605  * @{
9606  */
9607
9608 /**
9609  * Instantiates a new smart object described by @p s.
9610  *
9611  * @param e the canvas on which to add the object
9612  * @param s the #Evas_Smart describing the smart object
9613  * @return a new #Evas_Object handle
9614  *
9615  * This is the function one should use when defining the public
9616  * function @b adding an instance of the new smart object to a given
9617  * canvas. It will take care of setting all of its internals to work
9618  * as they should, if the user set things properly, as seem on the
9619  * #EVAS_SMART_SUBCLASS_NEW, for example.
9620  *
9621  * @ingroup Evas_Smart_Object_Group
9622  */
9623 EAPI Evas_Object      *evas_object_smart_add             (Evas *e, Evas_Smart *s) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2) EINA_MALLOC;
9624
9625 /**
9626  * Set an Evas object as a member of a given smart object.
9627  *
9628  * @param obj The member object
9629  * @param smart_obj The smart object
9630  *
9631  * Members will automatically be stacked and layered together with the
9632  * smart object. The various stacking functions will operate on
9633  * members relative to the other members instead of the entire canvas,
9634  * since they now live on an exclusive layer (see
9635  * evas_object_stack_above(), for more details).
9636  *
9637  * Any @p smart_obj object's specific implementation of the @c
9638  * member_add() smart function will take place too, naturally.
9639  *
9640  * @see evas_object_smart_member_del()
9641  * @see evas_object_smart_members_get()
9642  *
9643  * @ingroup Evas_Smart_Object_Group
9644  */
9645 EAPI void              evas_object_smart_member_add      (Evas_Object *obj, Evas_Object *smart_obj) EINA_ARG_NONNULL(1, 2);
9646
9647 /**
9648  * Removes a member object from a given smart object.
9649  *
9650  * @param obj the member object
9651  * @ingroup Evas_Smart_Object_Group
9652  *
9653  * This removes a member object from a smart object, if it was added
9654  * to any. The object will still be on the canvas, but no longer
9655  * associated with whichever smart object it was associated with.
9656  *
9657  * @see evas_object_smart_member_add() for more details
9658  * @see evas_object_smart_members_get()
9659  */
9660 EAPI void              evas_object_smart_member_del      (Evas_Object *obj) EINA_ARG_NONNULL(1);
9661
9662 /**
9663  * Retrieves the list of the member objects of a given Evas smart
9664  * object
9665  *
9666  * @param obj the smart object to get members from
9667  * @return Returns the list of the member objects of @p obj.
9668  *
9669  * The returned list should be freed with @c eina_list_free() when you
9670  * no longer need it.
9671  *
9672  * @see evas_object_smart_member_add()
9673  * @see evas_object_smart_member_del()
9674 */
9675 EAPI Eina_List        *evas_object_smart_members_get     (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
9676
9677 /**
9678  * Gets the parent smart object of a given Evas object, if it has one.
9679  *
9680  * @param obj the Evas object you want to get the parent smart object
9681  * from
9682  * @return Returns the parent smart object of @a obj or @c NULL, if @a
9683  * obj is not a smart member of any
9684  *
9685  * @ingroup Evas_Smart_Object_Group
9686  */
9687 EAPI Evas_Object      *evas_object_smart_parent_get      (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
9688
9689 /**
9690  * Checks whether a given smart object or any of its smart object
9691  * parents is of a given smart class.
9692  *
9693  * @param obj An Evas smart object to check the type of
9694  * @param type The @b name (type) of the smart class to check for
9695  * @return @c EINA_TRUE, if @a obj or any of its parents is of type @a
9696  * type, @c EINA_FALSE otherwise
9697  *
9698  * If @p obj is not a smart object, this call will fail
9699  * immediately. Otherwise, make sure evas_smart_class_inherit() or its
9700  * sibling functions were used correctly when creating the smart
9701  * object's class, so it has a valid @b parent smart class pointer
9702  * set.
9703  *
9704  * The checks use smart classes names and <b>string
9705  * comparison</b>. There is a version of this same check using
9706  * <b>pointer comparison</b>, since a smart class' name is a single
9707  * string in Evas.
9708  *
9709  * @see evas_object_smart_type_check_ptr()
9710  * @see #EVAS_SMART_SUBCLASS_NEW
9711  *
9712  * @ingroup Evas_Smart_Object_Group
9713  */
9714 EAPI Eina_Bool         evas_object_smart_type_check      (const Evas_Object *obj, const char *type) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2);
9715
9716 /**
9717  * Checks whether a given smart object or any of its smart object
9718  * parents is of a given smart class, <b>using pointer comparison</b>.
9719  *
9720  * @param obj An Evas smart object to check the type of
9721  * @param type The type (name string) to check for. Must be the name
9722  * @return @c EINA_TRUE, if @a obj or any of its parents is of type @a
9723  * type, @c EINA_FALSE otherwise
9724  *
9725  * @see evas_object_smart_type_check() for more details
9726  *
9727  * @ingroup Evas_Smart_Object_Group
9728  */
9729 EAPI Eina_Bool         evas_object_smart_type_check_ptr  (const Evas_Object *obj, const char *type) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2);
9730
9731 /**
9732  * Get the #Evas_Smart from which @p obj smart object was created.
9733  *
9734  * @param obj a smart object
9735  * @return the #Evas_Smart handle or @c NULL, on errors
9736  *
9737  * @ingroup Evas_Smart_Object_Group
9738  */
9739 EAPI Evas_Smart       *evas_object_smart_smart_get       (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
9740
9741 /**
9742  * Retrieve user data stored on a given smart object.
9743  *
9744  * @param obj The smart object's handle
9745  * @return A pointer to data stored using
9746  *         evas_object_smart_data_set(), or @c NULL, if none has been
9747  *         set.
9748  *
9749  * @see evas_object_smart_data_set()
9750  *
9751  * @ingroup Evas_Smart_Object_Group
9752  */
9753 EAPI void             *evas_object_smart_data_get        (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
9754
9755 /**
9756  * Store a pointer to user data for a given smart object.
9757  *
9758  * @param obj The smart object's handle
9759  * @param data A pointer to user data
9760  *
9761  * This data is stored @b independently of the one set by
9762  * evas_object_data_set(), naturally.
9763  *
9764  * @see evas_object_smart_data_get()
9765  *
9766  * @ingroup Evas_Smart_Object_Group
9767  */
9768 EAPI void              evas_object_smart_data_set        (Evas_Object *obj, void *data) EINA_ARG_NONNULL(1);
9769
9770 /**
9771  * Add (register) a callback function to the smart event specified by
9772  * @p event on the smart object @p obj.
9773  *
9774  * @param obj a smart object
9775  * @param event the event's name string
9776  * @param func the callback function
9777  * @param data user data to be passed to the callback function
9778  *
9779  * Smart callbacks look very similar to Evas callbacks, but are
9780  * implemented as smart object's custom ones.
9781  *
9782  * This function adds a function callback to an smart object when the
9783  * event named @p event occurs in it. The function is @p func.
9784  *
9785  * In the event of a memory allocation error during addition of the
9786  * callback to the object, evas_alloc_error() should be used to
9787  * determine the nature of the error, if any, and the program should
9788  * sensibly try and recover.
9789  *
9790  * A smart callback function must have the ::Evas_Smart_Cb prototype
9791  * definition. The first parameter (@p data) in this definition will
9792  * have the same value passed to evas_object_smart_callback_add() as
9793  * the @p data parameter, at runtime. The second parameter @p obj is a
9794  * handle to the object on which the event occurred. The third
9795  * parameter, @p event_info, is a pointer to data which is totally
9796  * dependent on the smart object's implementation and semantic for the
9797  * given event.
9798  *
9799  * There is an infrastructure for introspection on smart objects'
9800  * events (see evas_smart_callbacks_descriptions_get()), but no
9801  * internal smart objects on Evas implement them yet.
9802  *
9803  * @see @ref Evas_Smart_Object_Group_Callbacks for more details.
9804  *
9805  * @see evas_object_smart_callback_del()
9806  * @ingroup Evas_Smart_Object_Group
9807  */
9808 EAPI void              evas_object_smart_callback_add    (Evas_Object *obj, const char *event, Evas_Smart_Cb func, const void *data) EINA_ARG_NONNULL(1, 2, 3);
9809
9810 /**
9811  * Add (register) a callback function to the smart event specified by
9812  * @p event on the smart object @p obj. Except for the priority field,
9813  * it's exactly the same as @ref evas_object_smart_callback_add
9814  *
9815  * @param obj a smart object
9816  * @param event the event's name string
9817  * @param priority The priority of the callback, lower values called first.
9818  * @param func the callback function
9819  * @param data user data to be passed to the callback function
9820  *
9821  * @see evas_object_smart_callback_add
9822  * @since 1.1.0
9823  * @ingroup Evas_Smart_Object_Group
9824  */
9825 EAPI void              evas_object_smart_callback_priority_add(Evas_Object *obj, const char *event, Evas_Callback_Priority priority, Evas_Smart_Cb func, const void *data);
9826
9827 /**
9828  * Delete (unregister) a callback function from the smart event
9829  * specified by @p event on the smart object @p obj.
9830  *
9831  * @param obj a smart object
9832  * @param event the event's name string
9833  * @param func the callback function
9834  * @return the data pointer
9835  *
9836  * This function removes <b>the first</b> added smart callback on the
9837  * object @p obj matching the event name @p event and the registered
9838  * function pointer @p func. If the removal is successful it will also
9839  * return the data pointer that was passed to
9840  * evas_object_smart_callback_add() (that will be the same as the
9841  * parameter) when the callback(s) was(were) added to the canvas. If
9842  * not successful @c NULL will be returned.
9843  *
9844  * @see evas_object_smart_callback_add() for more details.
9845  *
9846  * @ingroup Evas_Smart_Object_Group
9847  */
9848 EAPI void             *evas_object_smart_callback_del    (Evas_Object *obj, const char *event, Evas_Smart_Cb func) EINA_ARG_NONNULL(1, 2, 3);
9849
9850 /**
9851  * Delete (unregister) a callback function from the smart event
9852  * specified by @p event on the smart object @p obj.
9853  *
9854  * @param obj a smart object
9855  * @param event the event's name string
9856  * @param func the callback function
9857  * @param data the data pointer that was passed to the callback
9858  * @return the data pointer
9859  *
9860  * This function removes <b>the first</b> added smart callback on the
9861  * object @p obj matching the event name @p event, the registered
9862  * function pointer @p func and the callback data pointer @p data. If
9863  * the removal is successful it will also return the data pointer that
9864  * was passed to evas_object_smart_callback_add() (that will be the same
9865  * as the parameter) when the callback(s) was(were) added to the canvas.
9866  * If not successful @c NULL will be returned. A common use would be to
9867  * remove an exact match of a callback
9868  *
9869  * @see evas_object_smart_callback_add() for more details.
9870  * @since 1.2.0
9871  * @ingroup Evas_Smart_Object_Group
9872  *
9873  * @note To delete all smart event callbacks which match @p type and @p func,
9874  * use evas_object_smart_callback_del().
9875  */
9876 EAPI void             *evas_object_smart_callback_del_full(Evas_Object *obj, const char *event, Evas_Smart_Cb func, const void *data) EINA_ARG_NONNULL(1, 2, 3);
9877
9878 /**
9879  * Call a given smart callback on the smart object @p obj.
9880  *
9881  * @param obj the smart object
9882  * @param event the event's name string
9883  * @param event_info pointer to an event specific struct or information to
9884  * pass to the callback functions registered on this smart event
9885  *
9886  * This should be called @b internally, from the smart object's own
9887  * code, when some specific event has occurred and the implementor
9888  * wants is to pertain to the object's events API (see @ref
9889  * Evas_Smart_Object_Group_Callbacks). The documentation for the smart
9890  * object should include a list of possible events and what type of @p
9891  * event_info to expect for each of them. Also, when defining an
9892  * #Evas_Smart_Class, smart object implementors are strongly
9893  * encorauged to properly set the Evas_Smart_Class::callbacks
9894  * callbacks description array, so that the users of the smart object
9895  * can have introspection on its events API <b>at run time</b>.
9896  *
9897  * @ingroup Evas_Smart_Object_Group
9898  */
9899 EAPI void              evas_object_smart_callback_call   (Evas_Object *obj, const char *event, void *event_info) EINA_ARG_NONNULL(1, 2);
9900
9901
9902 /**
9903  * Set an smart object @b instance's smart callbacks descriptions.
9904  *
9905  * @param obj A smart object
9906  * @param descriptions @c NULL terminated array with
9907  * #Evas_Smart_Cb_Description descriptions. Array elements won't be
9908  * modified at run time, but references to them and their contents
9909  * will be made, so this array should be kept alive during the whole
9910  * object's lifetime.
9911  * @return @c EINA_TRUE on success, @c EINA_FALSE on failure.
9912  *
9913  * These descriptions are hints to be used by introspection and are
9914  * not enforced in any way.
9915  *
9916  * It will not be checked if instance callbacks descriptions have the
9917  * same name as respective possibly registered in the smart object
9918  * @b class. Both are kept in different arrays and users of
9919  * evas_object_smart_callbacks_descriptions_get() should handle this
9920  * case as they wish.
9921  *
9922  * @note Becase @p descriptions must be @c NULL terminated, and
9923  *        because a @c NULL name makes little sense, too,
9924  *        Evas_Smart_Cb_Description::name must @b not be @c NULL.
9925  *
9926  * @note While instance callbacks descriptions are possible, they are
9927  *       @b not recommended. Use @b class callbacks descriptions
9928  *       instead as they make you smart object user's life simpler and
9929  *       will use less memory, as descriptions and arrays will be
9930  *       shared among all instances.
9931  *
9932  * @ingroup Evas_Smart_Object_Group
9933  */
9934 EAPI Eina_Bool         evas_object_smart_callbacks_descriptions_set(Evas_Object *obj, const Evas_Smart_Cb_Description *descriptions) EINA_ARG_NONNULL(1);
9935
9936 /**
9937  * Retrieve an smart object's know smart callback descriptions (both
9938  * instance and class ones).
9939  *
9940  * @param obj The smart object to get callback descriptions from.
9941  * @param class_descriptions Where to store class callbacks
9942  *        descriptions array, if any is known. If no descriptions are
9943  *        known, @c NULL is returned
9944  * @param class_count Returns how many class callbacks descriptions
9945  *        are known.
9946  * @param instance_descriptions Where to store instance callbacks
9947  *        descriptions array, if any is known. If no descriptions are
9948  *        known, @c NULL is returned.
9949  * @param instance_count Returns how many instance callbacks
9950  *        descriptions are known.
9951  *
9952  * This call searchs for registered callback descriptions for both
9953  * instance and class of the given smart object. These arrays will be
9954  * sorted by Evas_Smart_Cb_Description::name and also @c NULL
9955  * terminated, so both @a class_count and @a instance_count can be
9956  * ignored, if the caller wishes so. The terminator @c NULL is not
9957  * counted in these values.
9958  *
9959  * @note If just class descriptions are of interest, try
9960  *       evas_smart_callbacks_descriptions_get() instead.
9961  *
9962  * @note Use @c NULL pointers on the descriptions/counters you're not
9963  * interested in: they'll be ignored by the function.
9964  *
9965  * @see evas_smart_callbacks_descriptions_get()
9966  *
9967  * @ingroup Evas_Smart_Object_Group
9968  */
9969 EAPI void              evas_object_smart_callbacks_descriptions_get(const Evas_Object *obj, const Evas_Smart_Cb_Description ***class_descriptions, unsigned int *class_count, const Evas_Smart_Cb_Description ***instance_descriptions, unsigned int *instance_count) EINA_ARG_NONNULL(1);
9970
9971 /**
9972  * Find callback description for callback called @a name.
9973  *
9974  * @param obj the smart object.
9975  * @param name name of desired callback, must @b not be @c NULL.  The
9976  *        search have a special case for @a name being the same
9977  *        pointer as registered with Evas_Smart_Cb_Description, one
9978  *        can use it to avoid excessive use of strcmp().
9979  * @param class_description pointer to return class description or @c
9980  *        NULL if not found. If parameter is @c NULL, no search will
9981  *        be done on class descriptions.
9982  * @param instance_description pointer to return instance description
9983  *        or @c NULL if not found. If parameter is @c NULL, no search
9984  *        will be done on instance descriptions.
9985  * @return reference to description if found, @c NULL if not found.
9986  */
9987 EAPI void              evas_object_smart_callback_description_find(const Evas_Object *obj, const char *name, const Evas_Smart_Cb_Description **class_description, const Evas_Smart_Cb_Description **instance_description) EINA_ARG_NONNULL(1, 2);
9988
9989
9990 /**
9991  * Mark smart object as changed, dirty.
9992  *
9993  * @param obj The given Evas smart object
9994  *
9995  * This will flag the given object as needing recalculation,
9996  * forcefully. As an effect, on the next rendering cycle it's @b
9997  * calculate() (see #Evas_Smart_Class) smart function will be called.
9998  *
9999  * @see evas_object_smart_need_recalculate_set().
10000  * @see evas_object_smart_calculate().
10001  *
10002  * @ingroup Evas_Smart_Object_Group
10003  */
10004 EAPI void              evas_object_smart_changed         (Evas_Object *obj) EINA_ARG_NONNULL(1);
10005
10006 /**
10007  * Set or unset the flag signalling that a given smart object needs to
10008  * get recalculated.
10009  *
10010  * @param obj the smart object
10011  * @param value whether one wants to set (@c EINA_TRUE) or to unset
10012  * (@c EINA_FALSE) the flag.
10013  *
10014  * If this flag is set, then the @c calculate() smart function of @p
10015  * obj will be called, if one is provided, during rendering phase of
10016  * Evas (see evas_render()), after which this flag will be
10017  * automatically unset.
10018  *
10019  * If that smart function is not provided for the given object, this
10020  * flag will be left unchanged.
10021  *
10022  * @note just setting this flag will not make the canvas' whole scene
10023  *       dirty, by itself, and evas_render() will have no effect. To
10024  *       force that, use evas_object_smart_changed(), that will also
10025  *       automatically call this function automatically, with @c
10026  *       EINA_TRUE as parameter.
10027  *
10028  * @see evas_object_smart_need_recalculate_get()
10029  * @see evas_object_smart_calculate()
10030  * @see evas_smart_objects_calculate()
10031  *
10032  * @ingroup Evas_Smart_Object_Group
10033  */
10034 EAPI void              evas_object_smart_need_recalculate_set(Evas_Object *obj, Eina_Bool value) EINA_ARG_NONNULL(1);
10035
10036 /**
10037  * Get the value of the flag signalling that a given smart object needs to
10038  * get recalculated.
10039  *
10040  * @param obj the smart object
10041  * @return if flag is set or not.
10042  *
10043  * @note this flag will be unset during the rendering phase, when the
10044  *       @c calculate() smart function is called, if one is provided.
10045  *       If it's not provided, then the flag will be left unchanged
10046  *       after the rendering phase.
10047  *
10048  * @see evas_object_smart_need_recalculate_set(), for more details
10049  *
10050  * @ingroup Evas_Smart_Object_Group
10051  */
10052 EAPI Eina_Bool         evas_object_smart_need_recalculate_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
10053
10054 /**
10055  * Call the @b calculate() smart function immediataly on a given smart
10056  * object.
10057  *
10058  * @param obj the smart object's handle
10059  *
10060  * This will force immediate calculations (see #Evas_Smart_Class)
10061  * needed for renderization of this object and, besides, unset the
10062  * flag on it telling it needs recalculation for the next rendering
10063  * phase.
10064  *
10065  * @see evas_object_smart_need_recalculate_set()
10066  *
10067  * @ingroup Evas_Smart_Object_Group
10068  */
10069 EAPI void              evas_object_smart_calculate       (Evas_Object *obj) EINA_ARG_NONNULL(1);
10070
10071 /**
10072  * Call user-provided @c calculate() smart functions and unset the
10073  * flag signalling that the object needs to get recalculated to @b all
10074  * smart objects in the canvas.
10075  *
10076  * @param e The canvas to calculate all smart objects in
10077  *
10078  * @see evas_object_smart_need_recalculate_set()
10079  *
10080  * @ingroup Evas_Smart_Object_Group
10081  */
10082 EAPI void              evas_smart_objects_calculate      (Evas *e);
10083
10084 /**
10085  * This gets the internal counter that counts the number of smart calculations
10086  * 
10087  * @param e The canvas to get the calculate counter from
10088  * 
10089  * Whenever evas performs smart object calculations on the whole canvas
10090  * it increments a counter by 1. This is the smart object calculate counter
10091  * that this function returns the value of. It starts at the value of 0 and
10092  * will increase (and eventually wrap around to negative values and so on) by
10093  * 1 every time objects are calculated. You can use this counter to ensure
10094  * you dont re-do calculations withint the same calculation generation/run
10095  * if the calculations maybe cause self-feeding effects.
10096  * 
10097  * @ingroup Evas_Smart_Object_Group
10098  * @since 1.1
10099  */
10100 EAPI int               evas_smart_objects_calculate_count_get (const Evas *e);
10101    
10102 /**
10103  * Moves all children objects of a given smart object relative to a
10104  * given offset.
10105  *
10106  * @param obj the smart object.
10107  * @param dx horizontal offset (delta).
10108  * @param dy vertical offset (delta).
10109  *
10110  * This will make each of @p obj object's children to move, from where
10111  * they before, with those delta values (offsets) on both directions.
10112  *
10113  * @note This is most useful on custom smart @c move() functions.
10114  *
10115  * @note Clipped smart objects already make use of this function on
10116  * their @c move() smart function definition.
10117  */
10118 EAPI void                    evas_object_smart_move_children_relative(Evas_Object *obj, Evas_Coord dx, Evas_Coord dy) EINA_ARG_NONNULL(1);
10119
10120 /**
10121  * @}
10122  */
10123
10124 /**
10125  * @defgroup Evas_Smart_Object_Clipped Clipped Smart Object
10126  *
10127  * Clipped smart object is a base to construct other smart objects
10128  * based on the concept of having an internal clipper that is applied
10129  * to all children objects. This clipper will control the visibility,
10130  * clipping and color of sibling objects (remember that the clipping
10131  * is recursive, and clipper color modulates the color of its
10132  * clippees). By default, this base will also move children relatively
10133  * to the parent, and delete them when parent is deleted. In other
10134  * words, it is the base for simple object grouping.
10135  *
10136  * See some @ref Example_Evas_Smart_Objects "examples" of this group
10137  * of functions.
10138  *
10139  * @see evas_object_smart_clipped_smart_set()
10140  *
10141  * @ingroup Evas_Smart_Object_Group
10142  */
10143
10144 /**
10145  * @addtogroup Evas_Smart_Object_Clipped
10146  * @{
10147  */
10148
10149 /**
10150  * Every subclass should provide this at the beginning of their own
10151  * data set with evas_object_smart_data_set().
10152  */
10153   typedef struct _Evas_Object_Smart_Clipped_Data Evas_Object_Smart_Clipped_Data;
10154   struct _Evas_Object_Smart_Clipped_Data
10155   {
10156      Evas_Object *clipper;
10157      Evas        *evas;
10158   };
10159
10160
10161 /**
10162  * Get the clipper object for the given clipped smart object.
10163  *
10164  * @param obj the clipped smart object to retrieve associated clipper
10165  * from.
10166  * @return the clipper object.
10167  *
10168  * Use this function if you want to change any of this clipper's
10169  * properties, like colors.
10170  *
10171  * @see evas_object_smart_clipped_smart_add()
10172  */
10173 EAPI Evas_Object            *evas_object_smart_clipped_clipper_get   (Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
10174
10175 /**
10176  * Set a given smart class' callbacks so it implements the <b>clipped smart
10177  * object"</b>'s interface.
10178  *
10179  * @param sc The smart class handle to operate on
10180  *
10181  * This call will assign all the required methods of the @p sc
10182  * #Evas_Smart_Class instance to the implementations set for clipped
10183  * smart objects. If one wants to "subclass" it, call this function
10184  * and then override desired values. If one wants to call any original
10185  * method, save it somewhere. Example:
10186  *
10187  * @code
10188  * static Evas_Smart_Class parent_sc = EVAS_SMART_CLASS_INIT_NULL;
10189  *
10190  * static void my_class_smart_add(Evas_Object *o)
10191  * {
10192  *    parent_sc.add(o);
10193  *    evas_object_color_set(evas_object_smart_clipped_clipper_get(o),
10194  *                          255, 0, 0, 255);
10195  * }
10196  *
10197  * Evas_Smart_Class *my_class_new(void)
10198  * {
10199  *    static Evas_Smart_Class sc = EVAS_SMART_CLASS_INIT_NAME_VERSION("MyClass");
10200  *    if (!parent_sc.name)
10201  *      {
10202  *         evas_object_smart_clipped_smart_set(&sc);
10203  *         parent_sc = sc;
10204  *         sc.add = my_class_smart_add;
10205  *      }
10206  *    return &sc;
10207  * }
10208  * @endcode
10209  *
10210  * Default behavior for each of #Evas_Smart_Class functions on a
10211  * clipped smart object are:
10212  * - @c add: creates a hidden clipper with "infinite" size, to clip
10213  *    any incoming members;
10214  *  - @c del: delete all children objects;
10215  *  - @c move: move all objects relative relatively;
10216  *  - @c resize: <b>not defined</b>;
10217  *  - @c show: if there are children objects, show clipper;
10218  *  - @c hide: hides clipper;
10219  *  - @c color_set: set the color of clipper;
10220  *  - @c clip_set: set clipper of clipper;
10221  *  - @c clip_unset: unset the clipper of clipper;
10222  *
10223  * @note There are other means of assigning parent smart classes to
10224  * child ones, like the #EVAS_SMART_SUBCLASS_NEW macro or the
10225  * evas_smart_class_inherit_full() function.
10226  */
10227 EAPI void                    evas_object_smart_clipped_smart_set     (Evas_Smart_Class *sc) EINA_ARG_NONNULL(1);
10228
10229 /**
10230  * Get a pointer to the <b>clipped smart object's</b> class, to use
10231  * for proper inheritance
10232  *
10233  * @see #Evas_Smart_Object_Clipped for more information on this smart
10234  * class
10235  */
10236 EAPI const Evas_Smart_Class *evas_object_smart_clipped_class_get     (void) EINA_CONST;
10237
10238 /**
10239  * @}
10240  */
10241
10242 /**
10243  * @defgroup Evas_Object_Box Box Smart Object
10244  *
10245  * A box is a convenience smart object that packs children inside it
10246  * in @b sequence, using a layouting function specified by the
10247  * user. There are a couple of pre-made layouting functions <b>built-in
10248  * in Evas</b>, all of them using children size hints to define their
10249  * size and alignment inside their cell space.
10250  *
10251  * Examples on this smart object's usage:
10252  * - @ref Example_Evas_Box
10253  * - @ref Example_Evas_Size_Hints
10254  *
10255  * @see @ref Evas_Object_Group_Size_Hints
10256  *
10257  * @ingroup Evas_Smart_Object_Group
10258  */
10259
10260 /**
10261  * @addtogroup Evas_Object_Box
10262  * @{
10263  */
10264
10265 /**
10266  * @typedef Evas_Object_Box_Api
10267  *
10268  * Smart class extension, providing extra box object requirements.
10269  *
10270  * @ingroup Evas_Object_Box
10271  */
10272    typedef struct _Evas_Object_Box_Api        Evas_Object_Box_Api;
10273
10274 /**
10275  * @typedef Evas_Object_Box_Data
10276  *
10277  * Smart object instance data, providing box object requirements.
10278  *
10279  * @ingroup Evas_Object_Box
10280  */
10281    typedef struct _Evas_Object_Box_Data       Evas_Object_Box_Data;
10282
10283 /**
10284  * @typedef Evas_Object_Box_Option
10285  *
10286  * The base structure for a box option. Box options are a way of
10287  * extending box items properties, which will be taken into account
10288  * for layouting decisions. The box layouting functions provided by
10289  * Evas will only rely on objects' canonical size hints to layout
10290  * them, so the basic box option has @b no (custom) property set.
10291  *
10292  * Users creating their own layouts, but not depending on extra child
10293  * items' properties, would be fine just using
10294  * evas_object_box_layout_set(). But if one desires a layout depending
10295  * on extra child properties, he/she has to @b subclass the box smart
10296  * object. Thus, by using evas_object_box_smart_class_get() and
10297  * evas_object_box_smart_set(), the @c option_new() and @c
10298  * option_free() smart class functions should be properly
10299  * redefined/extended.
10300  *
10301  * Object properties are bound to an integer identifier and must have
10302  * a name string. Their values are open to any data. See the API on
10303  * option properties for more details.
10304  *
10305  * @ingroup Evas_Object_Box
10306  */
10307    typedef struct _Evas_Object_Box_Option     Evas_Object_Box_Option;
10308
10309 /**
10310  * @typedef Evas_Object_Box_Layout
10311  *
10312  * Function signature for an Evas box object layouting routine. By
10313  * @a o it will be passed the box object in question, by @a priv it will
10314  * be passed the box's internal data and, by @a user_data, it will be
10315  * passed any custom data one could have set to a given box layouting
10316  * function, with evas_object_box_layout_set().
10317  *
10318  * @ingroup Evas_Object_Box
10319  */
10320    typedef void (*Evas_Object_Box_Layout) (Evas_Object *o, Evas_Object_Box_Data *priv, void *user_data);
10321
10322 /**
10323  * @def EVAS_OBJECT_BOX_API_VERSION
10324  *
10325  * Current version for Evas box object smart class, a value which goes
10326  * to _Evas_Object_Box_Api::version.
10327  *
10328  * @ingroup Evas_Object_Box
10329  */
10330 #define EVAS_OBJECT_BOX_API_VERSION 1
10331
10332 /**
10333  * @struct _Evas_Object_Box_Api
10334  *
10335  * This structure should be used by any smart class inheriting from
10336  * the box's one, to provide custom box behavior which could not be
10337  * achieved only by providing a layout function, with
10338  * evas_object_box_layout_set().
10339  *
10340  * @extends Evas_Smart_Class
10341  * @ingroup Evas_Object_Box
10342  */
10343    struct _Evas_Object_Box_Api
10344    {
10345       Evas_Smart_Class          base; /**< Base smart class struct, need for all smart objects */
10346       int                       version; /**< Version of this smart class definition */
10347       Evas_Object_Box_Option *(*append)           (Evas_Object *o, Evas_Object_Box_Data *priv, Evas_Object *child); /**< Smart function to append child elements in boxes */
10348       Evas_Object_Box_Option *(*prepend)          (Evas_Object *o, Evas_Object_Box_Data *priv, Evas_Object *child); /**< Smart function to prepend child elements in boxes */
10349       Evas_Object_Box_Option *(*insert_before)    (Evas_Object *o, Evas_Object_Box_Data *priv, Evas_Object *child, const Evas_Object *reference); /**< Smart function to insert a child element before another in boxes */
10350       Evas_Object_Box_Option *(*insert_after)     (Evas_Object *o, Evas_Object_Box_Data *priv, Evas_Object *child, const Evas_Object *reference); /**< Smart function to insert a child element after another in boxes */
10351       Evas_Object_Box_Option *(*insert_at)        (Evas_Object *o, Evas_Object_Box_Data *priv, Evas_Object *child, unsigned int pos); /**< Smart function to insert a child element at a given positon on boxes */
10352       Evas_Object            *(*remove)           (Evas_Object *o, Evas_Object_Box_Data *priv, Evas_Object *child); /**< Smart function to remove a child element from boxes */
10353       Evas_Object            *(*remove_at)        (Evas_Object *o, Evas_Object_Box_Data *priv, unsigned int pos); /**< Smart function to remove a child element from boxes, by its position */
10354       Eina_Bool               (*property_set)     (Evas_Object *o, Evas_Object_Box_Option *opt, int property, va_list args); /**< Smart function to set a custom property on a box child */
10355       Eina_Bool               (*property_get)     (Evas_Object *o, Evas_Object_Box_Option *opt, int property, va_list args); /**< Smart function to retrieve a custom property from a box child */
10356       const char             *(*property_name_get)(Evas_Object *o, int property); /**< Smart function to get the name of a custom property of box children */
10357       int                     (*property_id_get)  (Evas_Object *o, const char *name); /**< Smart function to get the numerical ID of a custom property of box children */
10358       Evas_Object_Box_Option *(*option_new)       (Evas_Object *o, Evas_Object_Box_Data *priv, Evas_Object *child); /**< Smart function to create a new box option struct */
10359       void                    (*option_free)      (Evas_Object *o, Evas_Object_Box_Data *priv, Evas_Object_Box_Option *opt); /**< Smart function to delete a box option struct */
10360    };
10361
10362 /**
10363  * @def EVAS_OBJECT_BOX_API_INIT
10364  *
10365  * Initializer for a whole #Evas_Object_Box_Api structure, with
10366  * @c NULL values on its specific fields.
10367  *
10368  * @param smart_class_init initializer to use for the "base" field
10369  * (#Evas_Smart_Class).
10370  *
10371  * @see EVAS_SMART_CLASS_INIT_NULL
10372  * @see EVAS_SMART_CLASS_INIT_VERSION
10373  * @see EVAS_SMART_CLASS_INIT_NAME_VERSION
10374  * @see EVAS_OBJECT_BOX_API_INIT_NULL
10375  * @see EVAS_OBJECT_BOX_API_INIT_VERSION
10376  * @see EVAS_OBJECT_BOX_API_INIT_NAME_VERSION
10377  * @ingroup Evas_Object_Box
10378  */
10379 #define EVAS_OBJECT_BOX_API_INIT(smart_class_init) {smart_class_init, EVAS_OBJECT_BOX_API_VERSION, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL}
10380
10381 /**
10382  * @def EVAS_OBJECT_BOX_API_INIT_NULL
10383  *
10384  * Initializer to zero out a whole #Evas_Object_Box_Api structure.
10385  *
10386  * @see EVAS_OBJECT_BOX_API_INIT_VERSION
10387  * @see EVAS_OBJECT_BOX_API_INIT_NAME_VERSION
10388  * @see EVAS_OBJECT_BOX_API_INIT
10389  * @ingroup Evas_Object_Box
10390  */
10391 #define EVAS_OBJECT_BOX_API_INIT_NULL EVAS_OBJECT_BOX_API_INIT(EVAS_SMART_CLASS_INIT_NULL)
10392
10393 /**
10394  * @def EVAS_OBJECT_BOX_API_INIT_VERSION
10395  *
10396  * Initializer to zero out a whole #Evas_Object_Box_Api structure and
10397  * set a specific version on it.
10398  *
10399  * This is similar to #EVAS_OBJECT_BOX_API_INIT_NULL, but it will set
10400  * the version field of #Evas_Smart_Class (base field) to the latest
10401  * #EVAS_SMART_CLASS_VERSION.
10402  *
10403  * @see EVAS_OBJECT_BOX_API_INIT_NULL
10404  * @see EVAS_OBJECT_BOX_API_INIT_NAME_VERSION
10405  * @see EVAS_OBJECT_BOX_API_INIT
10406  * @ingroup Evas_Object_Box
10407  */
10408 #define EVAS_OBJECT_BOX_API_INIT_VERSION EVAS_OBJECT_BOX_API_INIT(EVAS_SMART_CLASS_INIT_VERSION)
10409
10410 /**
10411  * @def EVAS_OBJECT_BOX_API_INIT_NAME_VERSION
10412  *
10413  * Initializer to zero out a whole #Evas_Object_Box_Api structure and
10414  * set its name and version.
10415  *
10416  * This is similar to #EVAS_OBJECT_BOX_API_INIT_NULL, but it will also
10417  * set the version field of #Evas_Smart_Class (base field) to the
10418  * latest #EVAS_SMART_CLASS_VERSION and name it to the specific value.
10419  *
10420  * It will keep a reference to the name field as a <c>"const char *"</c>,
10421  * i.e., the name must be available while the structure is
10422  * used (hint: static or global variable!) and must not be modified.
10423  *
10424  * @see EVAS_OBJECT_BOX_API_INIT_NULL
10425  * @see EVAS_OBJECT_BOX_API_INIT_VERSION
10426  * @see EVAS_OBJECT_BOX_API_INIT
10427  * @ingroup Evas_Object_Box
10428  */
10429 #define EVAS_OBJECT_BOX_API_INIT_NAME_VERSION(name) EVAS_OBJECT_BOX_API_INIT(EVAS_SMART_CLASS_INIT_NAME_VERSION(name))
10430
10431 /**
10432  * @struct _Evas_Object_Box_Data
10433  *
10434  * This structure augments clipped smart object's instance data,
10435  * providing extra members required by generic box implementation. If
10436  * a subclass inherits from #Evas_Object_Box_Api, then it may augment
10437  * #Evas_Object_Box_Data to fit its own needs.
10438  *
10439  * @extends Evas_Object_Smart_Clipped_Data
10440  * @ingroup Evas_Object_Box
10441  */
10442    struct _Evas_Object_Box_Data
10443    {
10444       Evas_Object_Smart_Clipped_Data   base;
10445       const Evas_Object_Box_Api       *api;
10446       struct {
10447          double                        h, v;
10448       } align;
10449       struct {
10450          Evas_Coord                    h, v;
10451       } pad;
10452       Eina_List                       *children;
10453       struct {
10454          Evas_Object_Box_Layout        cb;
10455          void                         *data;
10456          void                        (*free_data)(void *data);
10457       } layout;
10458       Eina_Bool                        layouting : 1;
10459       Eina_Bool                        children_changed : 1;
10460    };
10461
10462    struct _Evas_Object_Box_Option
10463    {
10464       Evas_Object *obj; /**< Pointer to the box child object, itself */
10465       Eina_Bool    max_reached:1;
10466       Eina_Bool    min_reached:1;
10467       Evas_Coord   alloc_size;
10468    }; /**< #Evas_Object_Box_Option struct fields */
10469
10470 /**
10471  * Set the default box @a api struct (Evas_Object_Box_Api)
10472  * with the default values. May be used to extend that API.
10473  *
10474  * @param api The box API struct to set back, most probably with
10475  * overriden fields (on class extensions scenarios)
10476  */
10477 EAPI void                       evas_object_box_smart_set                             (Evas_Object_Box_Api *api) EINA_ARG_NONNULL(1);
10478
10479 /**
10480  * Get the Evas box smart class, for inheritance purposes.
10481  *
10482  * @return the (canonical) Evas box smart class.
10483  *
10484  * The returned value is @b not to be modified, just use it as your
10485  * parent class.
10486  */
10487 EAPI const Evas_Object_Box_Api *evas_object_box_smart_class_get                       (void) EINA_CONST;
10488
10489 /**
10490  * Set a new layouting function to a given box object
10491  *
10492  * @param o The box object to operate on.
10493  * @param cb The new layout function to set on @p o.
10494  * @param data Data pointer to be passed to @p cb.
10495  * @param free_data Function to free @p data, if need be.
10496  *
10497  * A box layout function affects how a box object displays child
10498  * elements within its area. The list of pre-defined box layouts
10499  * available in Evas is:
10500  * - evas_object_box_layout_horizontal()
10501  * - evas_object_box_layout_vertical()
10502  * - evas_object_box_layout_homogeneous_horizontal()
10503  * - evas_object_box_layout_homogeneous_vertical()
10504  * - evas_object_box_layout_homogeneous_max_size_horizontal()
10505  * - evas_object_box_layout_homogeneous_max_size_vertical()
10506  * - evas_object_box_layout_flow_horizontal()
10507  * - evas_object_box_layout_flow_vertical()
10508  * - evas_object_box_layout_stack()
10509  *
10510  * Refer to each of their documentation texts for details on them.
10511  *
10512  * @note A box layouting function will be triggered by the @c
10513  * 'calculate' smart callback of the box's smart class.
10514  */
10515 EAPI void                       evas_object_box_layout_set                            (Evas_Object *o, Evas_Object_Box_Layout cb, const void *data, void (*free_data)(void *data)) EINA_ARG_NONNULL(1, 2);
10516
10517 /**
10518  * Add a new box object on the provided canvas.
10519  *
10520  * @param evas The canvas to create the box object on.
10521  * @return @c NULL on error, a pointer to a new box object on
10522  * success.
10523  *
10524  * After instantiation, if a box object hasn't its layout function
10525  * set, via evas_object_box_layout_set(), it will have it by default
10526  * set to evas_object_box_layout_horizontal(). The remaining
10527  * properties of the box must be set/retrieved via
10528  * <c>evas_object_box_{h,v}_{align,padding}_{get,set)()</c>.
10529  */
10530 EAPI Evas_Object               *evas_object_box_add                                   (Evas *evas) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
10531
10532 /**
10533  * Add a new box as a @b child of a given smart object.
10534  *
10535  * @param parent The parent smart object to put the new box in.
10536  * @return @c NULL on error, a pointer to a new box object on
10537  * success.
10538  *
10539  * This is a helper function that has the same effect of putting a new
10540  * box object into @p parent by use of evas_object_smart_member_add().
10541  *
10542  * @see evas_object_box_add()
10543  */
10544 EAPI Evas_Object               *evas_object_box_add_to                                (Evas_Object *parent) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
10545
10546 /**
10547  * Layout function which sets the box @a o to a (basic) horizontal box
10548  *
10549  * @param o The box object in question
10550  * @param priv The smart data of the @p o
10551  * @param data The data pointer passed on
10552  * evas_object_box_layout_set(), if any
10553  *
10554  * In this layout, the box object's overall behavior is controlled by
10555  * its padding/alignment properties, which are set by the
10556  * <c>evas_object_box_{h,v}_{align,padding}_set()</c> family of
10557  * functions. The size hints of the elements in the box -- set by the
10558  * <c>evas_object_size_hint_{align,padding,weight}_set()</c> functions
10559  * -- also control the way this function works.
10560  *
10561  * \par Box's properties:
10562  * @c align_h controls the horizontal alignment of the child objects
10563  * relative to the containing box. When set to @c 0.0, children are
10564  * aligned to the left. A value of @c 1.0 makes them aligned to the
10565  * right border. Values in between align them proportionally. Note
10566  * that if the size required by the children, which is given by their
10567  * widths and the @c padding_h property of the box, is bigger than the
10568  * their container's width, the children will be displayed out of the
10569  * box's bounds. A negative value of @c align_h makes the box to
10570  * @b justify its children. The padding between them, in this case, is
10571  * corrected so that the leftmost one touches the left border and the
10572  * rightmost one touches the right border (even if they must
10573  * overlap). The @c align_v and @c padding_v properties of the box
10574  * @b don't contribute to its behaviour when this layout is chosen.
10575  *
10576  * \par Child element's properties:
10577  * @c align_x does @b not influence the box's behavior. @c padding_l
10578  * and @c padding_r sum up to the container's horizontal padding
10579  * between elements. The child's @c padding_t, @c padding_b and
10580  * @c align_y properties apply for padding/alignment relative to the
10581  * overall height of the box. Finally, there is the @c weight_x
10582  * property, which, if set to a non-zero value, tells the container
10583  * that the child width is @b not pre-defined. If the container can't
10584  * accommodate all its children, it sets the widths of the ones
10585  * <b>with weights</b> to sizes as small as they can all fit into
10586  * it. If the size required by the children is less than the
10587  * available, the box increases its childrens' (which have weights)
10588  * widths as to fit the remaining space. The @c weight_x property,
10589  * besides telling the element is resizable, gives a @b weight for the
10590  * resizing process.  The parent box will try to distribute (or take
10591  * off) widths accordingly to the @b normalized list of weigths: most
10592  * weighted children remain/get larger in this process than the least
10593  * ones. @c weight_y does not influence the layout.
10594  *
10595  * If one desires that, besides having weights, child elements must be
10596  * resized bounded to a minimum or maximum size, those size hints must
10597  * be set, by the <c>evas_object_size_hint_{min,max}_set()</c>
10598  * functions.
10599  */
10600 EAPI void                       evas_object_box_layout_horizontal                     (Evas_Object *o, Evas_Object_Box_Data *priv, void *data) EINA_ARG_NONNULL(1, 2);
10601
10602 /**
10603  * Layout function which sets the box @a o to a (basic) vertical box
10604  *
10605  * This function behaves analogously to
10606  * evas_object_box_layout_horizontal(). The description of its
10607  * behaviour can be derived from that function's documentation.
10608  */
10609 EAPI void                       evas_object_box_layout_vertical                       (Evas_Object *o, Evas_Object_Box_Data *priv, void *data) EINA_ARG_NONNULL(1, 2);
10610
10611 /**
10612  * Layout function which sets the box @a o to a @b homogeneous
10613  * vertical box
10614  *
10615  * This function behaves analogously to
10616  * evas_object_box_layout_homogeneous_horizontal().  The description
10617  * of its behaviour can be derived from that function's documentation.
10618  */
10619 EAPI void                       evas_object_box_layout_homogeneous_vertical           (Evas_Object *o, Evas_Object_Box_Data *priv, void *data) EINA_ARG_NONNULL(1, 2);
10620
10621 /**
10622  * Layout function which sets the box @a o to a @b homogeneous
10623  * horizontal box
10624  *
10625  * @param o The box object in question
10626  * @param priv The smart data of the @p o
10627  * @param data The data pointer passed on
10628  * evas_object_box_layout_set(), if any
10629  *
10630  * In a homogeneous horizontal box, its width is divided @b equally
10631  * between the contained objects. The box's overall behavior is
10632  * controlled by its padding/alignment properties, which are set by
10633  * the <c>evas_object_box_{h,v}_{align,padding}_set()</c> family of
10634  * functions.  The size hints the elements in the box -- set by the
10635  * <c>evas_object_size_hint_{align,padding,weight}_set()</c> functions
10636  * -- also control the way this function works.
10637  *
10638  * \par Box's properties:
10639  * @c align_h has no influence on the box for this layout.
10640  * @c padding_h tells the box to draw empty spaces of that size, in
10641  * pixels, between the (equal) child objects's cells. The @c align_v
10642  * and @c padding_v properties of the box don't contribute to its
10643  * behaviour when this layout is chosen.
10644  *
10645  * \par Child element's properties:
10646  * @c padding_l and @c padding_r sum up to the required width of the
10647  * child element. The @c align_x property tells the relative position
10648  * of this overall child width in its allocated cell (@r 0.0 to
10649  * extreme left, @c 1.0 to extreme right). A value of @c -1.0 to
10650  * @c align_x makes the box try to resize this child element to the exact
10651  * width of its cell (respecting the minimum and maximum size hints on
10652  * the child's width and accounting for its horizontal padding
10653  * hints). The child's @c padding_t, @c padding_b and @c align_y
10654  * properties apply for padding/alignment relative to the overall
10655  * height of the box. A value of @c -1.0 to @c align_y makes the box
10656  * try to resize this child element to the exact height of its parent
10657  * (respecting the maximum size hint on the child's height).
10658  */
10659 EAPI void                       evas_object_box_layout_homogeneous_horizontal         (Evas_Object *o, Evas_Object_Box_Data *priv, void *data) EINA_ARG_NONNULL(1, 2);
10660
10661 /**
10662  * Layout function which sets the box @a o to a <b>maximum size,
10663  * homogeneous</b> horizontal box
10664  *
10665  * @param o The box object in question
10666  * @param priv The smart data of the @p o
10667  * @param data The data pointer passed on
10668  * evas_object_box_layout_set(), if any
10669  *
10670  * In a maximum size, homogeneous horizontal box, besides having cells
10671  * of <b>equal size</b> reserved for the child objects, this size will
10672  * be defined by the size of the @b largest child in the box (in
10673  * width). The box's overall behavior is controlled by its properties,
10674  * which are set by the
10675  * <c>evas_object_box_{h,v}_{align,padding}_set()</c> family of
10676  * functions.  The size hints of the elements in the box -- set by the
10677  * <c>evas_object_size_hint_{align,padding,weight}_set()</c> functions
10678  * -- also control the way this function works.
10679  *
10680  * \par Box's properties:
10681  * @c padding_h tells the box to draw empty spaces of that size, in
10682  * pixels, between the child objects's cells. @c align_h controls the
10683  * horizontal alignment of the child objects, relative to the
10684  * containing box. When set to @c 0.0, children are aligned to the
10685  * left. A value of @c 1.0 lets them aligned to the right
10686  * border. Values in between align them proportionally. A negative
10687  * value of @c align_h makes the box to @b justify its children
10688  * cells. The padding between them, in this case, is corrected so that
10689  * the leftmost one touches the left border and the rightmost one
10690  * touches the right border (even if they must overlap). The
10691  * @c align_v and @c padding_v properties of the box don't contribute to
10692  * its behaviour when this layout is chosen.
10693  *
10694  * \par Child element's properties:
10695  * @c padding_l and @c padding_r sum up to the required width of the
10696  * child element. The @c align_x property tells the relative position
10697  * of this overall child width in its allocated cell (@c 0.0 to
10698  * extreme left, @c 1.0 to extreme right). A value of @c -1.0 to
10699  * @c align_x makes the box try to resize this child element to the exact
10700  * width of its cell (respecting the minimun and maximum size hints on
10701  * the child's width and accounting for its horizontal padding
10702  * hints). The child's @c padding_t, @c padding_b and @c align_y
10703  * properties apply for padding/alignment relative to the overall
10704  * height of the box. A value of @c -1.0 to @c align_y makes the box
10705  * try to resize this child element to the exact height of its parent
10706  * (respecting the max hint on the child's height).
10707  */
10708 EAPI void                       evas_object_box_layout_homogeneous_max_size_horizontal(Evas_Object *o, Evas_Object_Box_Data *priv, void *data) EINA_ARG_NONNULL(1, 2);
10709
10710 /**
10711  * Layout function which sets the box @a o to a <b>maximum size,
10712  * homogeneous</b> vertical box
10713  *
10714  * This function behaves analogously to
10715  * evas_object_box_layout_homogeneous_max_size_horizontal(). The
10716  * description of its behaviour can be derived from that function's
10717  * documentation.
10718  */
10719 EAPI void                       evas_object_box_layout_homogeneous_max_size_vertical  (Evas_Object *o, Evas_Object_Box_Data *priv, void *data) EINA_ARG_NONNULL(1, 2);
10720
10721 /**
10722  * Layout function which sets the box @a o to a @b flow horizontal
10723  * box.
10724  *
10725  * @param o The box object in question
10726  * @param priv The smart data of the @p o
10727  * @param data The data pointer passed on
10728  * evas_object_box_layout_set(), if any
10729  *
10730  * In a flow horizontal box, the box's child elements are placed in
10731  * @b rows (think of text as an analogy). A row has as much elements as
10732  * can fit into the box's width. The box's overall behavior is
10733  * controlled by its properties, which are set by the
10734  * <c>evas_object_box_{h,v}_{align,padding}_set()</c> family of
10735  * functions.  The size hints of the elements in the box -- set by the
10736  * <c>evas_object_size_hint_{align,padding,weight}_set()</c> functions
10737  * -- also control the way this function works.
10738  *
10739  * \par Box's properties:
10740  * @c padding_h tells the box to draw empty spaces of that size, in
10741  * pixels, between the child objects's cells. @c align_h dictates the
10742  * horizontal alignment of the rows (@c 0.0 to left align them, @c 1.0
10743  * to right align). A value of @c -1.0 to @c align_h lets the rows
10744  * @b justified horizontally. @c align_v controls the vertical alignment
10745  * of the entire set of rows (@c 0.0 to top, @c 1.0 to bottom). A
10746  * value of @c -1.0 to @c align_v makes the box to @b justify the rows
10747  * vertically. The padding between them, in this case, is corrected so
10748  * that the first row touches the top border and the last one touches
10749  * the bottom border (even if they must overlap). @c padding_v has no
10750  * influence on the layout.
10751  *
10752  * \par Child element's properties:
10753  * @c padding_l and @c padding_r sum up to the required width of the
10754  * child element. The @c align_x property has no influence on the
10755  * layout. The child's @c padding_t and @c padding_b sum up to the
10756  * required height of the child element and is the only means (besides
10757  * row justifying) of setting space between rows. Note, however, that
10758  * @c align_y dictates positioning relative to the <b>largest
10759  * height</b> required by a child object in the actual row.
10760  */
10761 EAPI void                       evas_object_box_layout_flow_horizontal                (Evas_Object *o, Evas_Object_Box_Data *priv, void *data) EINA_ARG_NONNULL(1, 2);
10762
10763 /**
10764  * Layout function which sets the box @a o to a @b flow vertical box.
10765  *
10766  * This function behaves analogously to
10767  * evas_object_box_layout_flow_horizontal(). The description of its
10768  * behaviour can be derived from that function's documentation.
10769  */
10770 EAPI void                       evas_object_box_layout_flow_vertical                  (Evas_Object *o, Evas_Object_Box_Data *priv, void *data) EINA_ARG_NONNULL(1, 2);
10771
10772 /**
10773  * Layout function which sets the box @a o to a @b stacking box
10774  *
10775  * @param o The box object in question
10776  * @param priv The smart data of the @p o
10777  * @param data The data pointer passed on
10778  * evas_object_box_layout_set(), if any
10779  *
10780  * In a stacking box, all children will be given the same size -- the
10781  * box's own size -- and they will be stacked one above the other, so
10782  * that the first object in @p o's internal list of child elements
10783  * will be the bottommost in the stack.
10784  *
10785  * \par Box's properties:
10786  * No box properties are used.
10787  *
10788  * \par Child element's properties:
10789  * @c padding_l and @c padding_r sum up to the required width of the
10790  * child element. The @c align_x property tells the relative position
10791  * of this overall child width in its allocated cell (@c 0.0 to
10792  * extreme left, @c 1.0 to extreme right). A value of @c -1.0 to @c
10793  * align_x makes the box try to resize this child element to the exact
10794  * width of its cell (respecting the min and max hints on the child's
10795  * width and accounting for its horizontal padding properties). The
10796  * same applies to the vertical axis.
10797  */
10798 EAPI void                       evas_object_box_layout_stack                          (Evas_Object *o, Evas_Object_Box_Data *priv, void *data) EINA_ARG_NONNULL(1, 2);
10799
10800 /**
10801  * Set the alignment of the whole bounding box of contents, for a
10802  * given box object.
10803  *
10804  * @param o The given box object to set alignment from
10805  * @param horizontal The horizontal alignment, in pixels
10806  * @param vertical the vertical alignment, in pixels
10807  *
10808  * This will influence how a box object is to align its bounding box
10809  * of contents within its own area. The values @b must be in the range
10810  * @c 0.0 - @c 1.0, or undefined behavior is expected. For horizontal
10811  * alignment, @c 0.0 means to the left, with @c 1.0 meaning to the
10812  * right. For vertical alignment, @c 0.0 means to the top, with @c 1.0
10813  * meaning to the bottom.
10814  *
10815  * @note The default values for both alignments is @c 0.5.
10816  *
10817  * @see evas_object_box_align_get()
10818  */
10819 EAPI void                       evas_object_box_align_set                             (Evas_Object *o, double horizontal, double vertical) EINA_ARG_NONNULL(1);
10820
10821 /**
10822  * Get the alignment of the whole bounding box of contents, for a
10823  * given box object.
10824  *
10825  * @param o The given box object to get alignment from
10826  * @param horizontal Pointer to a variable where to store the
10827  * horizontal alignment
10828  * @param vertical Pointer to a variable where to store the vertical
10829  * alignment
10830  *
10831  * @see evas_object_box_align_set() for more information
10832  */
10833 EAPI void                       evas_object_box_align_get                             (const Evas_Object *o, double *horizontal, double *vertical) EINA_ARG_NONNULL(1);
10834
10835 /**
10836  * Set the (space) padding between cells set for a given box object.
10837  *
10838  * @param o The given box object to set padding from
10839  * @param horizontal The horizontal padding, in pixels
10840  * @param vertical the vertical padding, in pixels
10841  *
10842  * @note The default values for both padding components is @c 0.
10843  *
10844  * @see evas_object_box_padding_get()
10845  */
10846 EAPI void                       evas_object_box_padding_set                           (Evas_Object *o, Evas_Coord horizontal, Evas_Coord vertical) EINA_ARG_NONNULL(1);
10847
10848 /**
10849  * Get the (space) padding between cells set for a given box object.
10850  *
10851  * @param o The given box object to get padding from
10852  * @param horizontal Pointer to a variable where to store the
10853  * horizontal padding
10854  * @param vertical Pointer to a variable where to store the vertical
10855  * padding
10856  *
10857  * @see evas_object_box_padding_set()
10858  */
10859 EAPI void                       evas_object_box_padding_get                           (const Evas_Object *o, Evas_Coord *horizontal, Evas_Coord *vertical) EINA_ARG_NONNULL(1);
10860
10861 /**
10862  * Append a new @a child object to the given box object @a o.
10863  *
10864  * @param o The given box object
10865  * @param child A child Evas object to be made a member of @p o
10866  * @return A box option bound to the recently added box item or @c
10867  * NULL, on errors
10868  *
10869  * On success, the @c "child,added" smart event will take place.
10870  *
10871  * @note The actual placing of the item relative to @p o's area will
10872  * depend on the layout set to it. For example, on horizontal layouts
10873  * an item in the end of the box's list of children will appear on its
10874  * right.
10875  *
10876  * @note This call will trigger the box's _Evas_Object_Box_Api::append
10877  * smart function.
10878  */
10879 EAPI Evas_Object_Box_Option    *evas_object_box_append                                (Evas_Object *o, Evas_Object *child) EINA_ARG_NONNULL(1, 2);
10880
10881 /**
10882  * Prepend a new @a child object to the given box object @a o.
10883  *
10884  * @param o The given box object
10885  * @param child A child Evas object to be made a member of @p o
10886  * @return A box option bound to the recently added box item or @c
10887  * NULL, on errors
10888  *
10889  * On success, the @c "child,added" smart event will take place.
10890  *
10891  * @note The actual placing of the item relative to @p o's area will
10892  * depend on the layout set to it. For example, on horizontal layouts
10893  * an item in the beginning of the box's list of children will appear
10894  * on its left.
10895  *
10896  * @note This call will trigger the box's
10897  * _Evas_Object_Box_Api::prepend smart function.
10898  */
10899 EAPI Evas_Object_Box_Option    *evas_object_box_prepend                               (Evas_Object *o, Evas_Object *child) EINA_ARG_NONNULL(1, 2);
10900
10901 /**
10902  * Insert a new @a child object <b>before another existing one</b>, in
10903  * a given box object @a o.
10904  *
10905  * @param o The given box object
10906  * @param child A child Evas object to be made a member of @p o
10907  * @param reference The child object to place this new one before
10908  * @return A box option bound to the recently added box item or @c
10909  * NULL, on errors
10910  *
10911  * On success, the @c "child,added" smart event will take place.
10912  *
10913  * @note This function will fail if @p reference is not a member of @p
10914  * o.
10915  *
10916  * @note The actual placing of the item relative to @p o's area will
10917  * depend on the layout set to it.
10918  *
10919  * @note This call will trigger the box's
10920  * _Evas_Object_Box_Api::insert_before smart function.
10921  */
10922 EAPI Evas_Object_Box_Option    *evas_object_box_insert_before                         (Evas_Object *o, Evas_Object *child, const Evas_Object *reference) EINA_ARG_NONNULL(1, 2, 3);
10923
10924 /**
10925  * Insert a new @a child object <b>after another existing one</b>, in
10926  * a given box object @a o.
10927  *
10928  * @param o The given box object
10929  * @param child A child Evas object to be made a member of @p o
10930  * @param reference The child object to place this new one after
10931  * @return A box option bound to the recently added box item or @c
10932  * NULL, on errors
10933  *
10934  * On success, the @c "child,added" smart event will take place.
10935  *
10936  * @note This function will fail if @p reference is not a member of @p
10937  * o.
10938  *
10939  * @note The actual placing of the item relative to @p o's area will
10940  * depend on the layout set to it.
10941  *
10942  * @note This call will trigger the box's
10943  * _Evas_Object_Box_Api::insert_after smart function.
10944  */
10945 EAPI Evas_Object_Box_Option    *evas_object_box_insert_after                          (Evas_Object *o, Evas_Object *child, const Evas_Object *referente) EINA_ARG_NONNULL(1, 2, 3);
10946
10947 /**
10948  * Insert a new @a child object <b>at a given position</b>, in a given
10949  * box object @a o.
10950  *
10951  * @param o The given box object
10952  * @param child A child Evas object to be made a member of @p o
10953  * @param pos The numeric position (starting from @c 0) to place the
10954  * new child object at
10955  * @return A box option bound to the recently added box item or @c
10956  * NULL, on errors
10957  *
10958  * On success, the @c "child,added" smart event will take place.
10959  *
10960  * @note This function will fail if the given position is invalid,
10961  * given @p o's internal list of elements.
10962  *
10963  * @note The actual placing of the item relative to @p o's area will
10964  * depend on the layout set to it.
10965  *
10966  * @note This call will trigger the box's
10967  * _Evas_Object_Box_Api::insert_at smart function.
10968  */
10969 EAPI Evas_Object_Box_Option    *evas_object_box_insert_at                             (Evas_Object *o, Evas_Object *child, unsigned int pos) EINA_ARG_NONNULL(1, 2);
10970
10971 /**
10972  * Remove a given object from a box object, unparenting it again.
10973  *
10974  * @param o The box object to remove a child object from
10975  * @param child The handle to the child object to be removed
10976  * @return @c EINA_TRUE, on success, @c EINA_FALSE otherwise
10977  *
10978  * On removal, you'll get an unparented object again, just as it was
10979  * before you inserted it in the box. The
10980  * _Evas_Object_Box_Api::option_free box smart callback will be called
10981  * automatilly for you and, also, the @c "child,removed" smart event
10982  * will take place.
10983  *
10984  * @note This call will trigger the box's _Evas_Object_Box_Api::remove
10985  * smart function.
10986  */
10987 EAPI Eina_Bool                  evas_object_box_remove                                (Evas_Object *o, Evas_Object *child) EINA_ARG_NONNULL(1, 2);
10988
10989 /**
10990  * Remove an object, <b>bound to a given position</b> in a box object,
10991  * unparenting it again.
10992  *
10993  * @param o The box object to remove a child object from
10994  * @param in The numeric position (starting from @c 0) of the child
10995  * object to be removed
10996  * @return @c EINA_TRUE, on success, @c EINA_FALSE otherwise
10997  *
10998  * On removal, you'll get an unparented object again, just as it was
10999  * before you inserted it in the box. The @c option_free() box smart
11000  * callback will be called automatilly for you and, also, the
11001  * @c "child,removed" smart event will take place.
11002  *
11003  * @note This function will fail if the given position is invalid,
11004  * given @p o's internal list of elements.
11005  *
11006  * @note This call will trigger the box's
11007  * _Evas_Object_Box_Api::remove_at smart function.
11008  */
11009 EAPI Eina_Bool                  evas_object_box_remove_at                             (Evas_Object *o, unsigned int pos) EINA_ARG_NONNULL(1);
11010
11011 /**
11012  * Remove @b all child objects from a box object, unparenting them
11013  * again.
11014  *
11015  * @param o The box object to remove a child object from
11016  * @param child The handle to the child object to be removed
11017  * @return @c EINA_TRUE, on success, @c EINA_FALSE otherwise
11018  *
11019  * This has the same effect of calling evas_object_box_remove() on
11020  * each of @p o's child objects, in sequence. If, and only if, all
11021  * those calls succeed, so does this one.
11022  */
11023 EAPI Eina_Bool                  evas_object_box_remove_all                            (Evas_Object *o, Eina_Bool clear) EINA_ARG_NONNULL(1);
11024
11025 /**
11026  * Get an iterator to walk the list of children of a given box object.
11027  *
11028  * @param o The box to retrieve an items iterator from
11029  * @return An iterator on @p o's child objects, on success, or @c NULL,
11030  * on errors
11031  *
11032  * @note Do @b not remove or delete objects while walking the list.
11033  */
11034 EAPI Eina_Iterator             *evas_object_box_iterator_new                          (const Evas_Object *o) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
11035
11036 /**
11037  * Get an accessor (a structure providing random items access) to the
11038  * list of children of a given box object.
11039  *
11040  * @param o The box to retrieve an items iterator from
11041  * @return An accessor on @p o's child objects, on success, or @c NULL,
11042  * on errors
11043  *
11044  * @note Do not remove or delete objects while walking the list.
11045  */
11046 EAPI Eina_Accessor             *evas_object_box_accessor_new                          (const Evas_Object *o) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
11047
11048 /**
11049  * Get the list of children objects in a given box object.
11050  *
11051  * @param o The box to retrieve an items list from
11052  * @return A list of @p o's child objects, on success, or @c NULL,
11053  * on errors (or if it has no child objects)
11054  *
11055  * The returned list should be freed with @c eina_list_free() when you
11056  * no longer need it.
11057  *
11058  * @note This is a duplicate of the list kept by the box internally.
11059  *       It's up to the user to destroy it when it no longer needs it.
11060  *       It's possible to remove objects from the box when walking
11061  *       this list, but these removals won't be reflected on it.
11062  */
11063 EAPI Eina_List                 *evas_object_box_children_get                          (const Evas_Object *o) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
11064
11065 /**
11066  * Get the name of the property of the child elements of the box @a o
11067  * which have @a id as identifier
11068  *
11069  * @param o The box to search child options from
11070  * @param id The numerical identifier of the option being searched, for
11071  * its name
11072  * @return The name of the given property or @c NULL, on errors.
11073  *
11074  * @note This call won't do anything for a canonical Evas box. Only
11075  * users which have @b subclassed it, setting custom box items options
11076  * (see #Evas_Object_Box_Option) on it, would benefit from this
11077  * function. They'd have to implement it and set it to be the
11078  * _Evas_Object_Box_Api::property_name_get smart class function of the
11079  * box, which is originally set to @c NULL.
11080  */
11081 EAPI const char                *evas_object_box_option_property_name_get              (Evas_Object *o, int property) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
11082
11083 /**
11084  * Get the numerical identifier of the property of the child elements
11085  * of the box @a o which have @a name as name string
11086  *
11087  * @param o The box to search child options from
11088  * @param name The name string of the option being searched, for
11089  * its ID
11090  * @return The numerical ID of the given property or @c -1, on
11091  * errors.
11092  *
11093  * @note This call won't do anything for a canonical Evas box. Only
11094  * users which have @b subclassed it, setting custom box items options
11095  * (see #Evas_Object_Box_Option) on it, would benefit from this
11096  * function. They'd have to implement it and set it to be the
11097  * _Evas_Object_Box_Api::property_id_get smart class function of the
11098  * box, which is originally set to @c NULL.
11099  */
11100 EAPI int                        evas_object_box_option_property_id_get                (Evas_Object *o, const char *name) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2);
11101
11102 /**
11103  * Set a property value (by its given numerical identifier), on a
11104  * given box child element
11105  *
11106  * @param o The box parenting the child element
11107  * @param opt The box option structure bound to the child box element
11108  * to set a property on
11109  * @param id The numerical ID of the given property
11110  * @param ... (List of) actual value(s) to be set for this
11111  * property. It (they) @b must be of the same type the user has
11112  * defined for it (them).
11113  * @return @c EINA_TRUE on success, @c EINA_FALSE on failure.
11114  *
11115  * @note This call won't do anything for a canonical Evas box. Only
11116  * users which have @b subclassed it, setting custom box items options
11117  * (see #Evas_Object_Box_Option) on it, would benefit from this
11118  * function. They'd have to implement it and set it to be the
11119  * _Evas_Object_Box_Api::property_set smart class function of the box,
11120  * which is originally set to @c NULL.
11121  *
11122  * @note This function will internally create a variable argument
11123  * list, with the values passed after @p property, and call
11124  * evas_object_box_option_property_vset() with this list and the same
11125  * previous arguments.
11126  */
11127 EAPI Eina_Bool                  evas_object_box_option_property_set                   (Evas_Object *o, Evas_Object_Box_Option *opt, int property, ...) EINA_ARG_NONNULL(1, 2);
11128
11129 /**
11130  * Set a property value (by its given numerical identifier), on a
11131  * given box child element -- by a variable argument list
11132  *
11133  * @param o The box parenting the child element
11134  * @param opt The box option structure bound to the child box element
11135  * to set a property on
11136  * @param id The numerical ID of the given property
11137  * @param va_list The variable argument list implementing the value to
11138  * be set for this property. It @b must be of the same type the user has
11139  * defined for it.
11140  * @return @c EINA_TRUE on success, @c EINA_FALSE on failure.
11141  *
11142  * This is a variable argument list variant of the
11143  * evas_object_box_option_property_set(). See its documentation for
11144  * more details.
11145  */
11146 EAPI Eina_Bool                  evas_object_box_option_property_vset                  (Evas_Object *o, Evas_Object_Box_Option *opt, int property, va_list args) EINA_ARG_NONNULL(1, 2);
11147
11148 /**
11149  * Get a property's value (by its given numerical identifier), on a
11150  * given box child element
11151  *
11152  * @param o The box parenting the child element
11153  * @param opt The box option structure bound to the child box element
11154  * to get a property from
11155  * @param id The numerical ID of the given property
11156  * @param ... (List of) pointer(s) where to store the value(s) set for
11157  * this property. It (they) @b must point to variable(s) of the same
11158  * type the user has defined for it (them).
11159  * @return @c EINA_TRUE on success, @c EINA_FALSE on failure.
11160  *
11161  * @note This call won't do anything for a canonical Evas box. Only
11162  * users which have @b subclassed it, getting custom box items options
11163  * (see #Evas_Object_Box_Option) on it, would benefit from this
11164  * function. They'd have to implement it and get it to be the
11165  * _Evas_Object_Box_Api::property_get smart class function of the
11166  * box, which is originally get to @c NULL.
11167  *
11168  * @note This function will internally create a variable argument
11169  * list, with the values passed after @p property, and call
11170  * evas_object_box_option_property_vget() with this list and the same
11171  * previous arguments.
11172  */
11173 EAPI Eina_Bool                  evas_object_box_option_property_get                   (Evas_Object *o, Evas_Object_Box_Option *opt, int property, ...) EINA_ARG_NONNULL(1, 2);
11174
11175 /**
11176  * Get a property's value (by its given numerical identifier), on a
11177  * given box child element -- by a variable argument list
11178  *
11179  * @param o The box parenting the child element
11180  * @param opt The box option structure bound to the child box element
11181  * to get a property from
11182  * @param id The numerical ID of the given property
11183  * @param va_list The variable argument list with pointers to where to
11184  * store the values of this property. They @b must point to variables
11185  * of the same type the user has defined for them.
11186  * @return @c EINA_TRUE on success, @c EINA_FALSE on failure.
11187  *
11188  * This is a variable argument list variant of the
11189  * evas_object_box_option_property_get(). See its documentation for
11190  * more details.
11191  */
11192 EAPI Eina_Bool                  evas_object_box_option_property_vget                  (Evas_Object *o, Evas_Object_Box_Option *opt, int property, va_list args) EINA_ARG_NONNULL(1, 2);
11193
11194 /**
11195  * @}
11196  */
11197
11198 /**
11199  * @defgroup Evas_Object_Table Table Smart Object.
11200  *
11201  * Convenience smart object that packs children using a tabular
11202  * layout using children size hints to define their size and
11203  * alignment inside their cell space.
11204  *
11205  * @ref tutorial_table shows how to use this Evas_Object.
11206  *
11207  * @see @ref Evas_Object_Group_Size_Hints
11208  *
11209  * @ingroup Evas_Smart_Object_Group
11210  *
11211  * @{
11212  */
11213
11214 /**
11215  * @brief Create a new table.
11216  *
11217  * @param evas Canvas in which table will be added.
11218  */
11219 EAPI Evas_Object                        *evas_object_table_add             (Evas *evas) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
11220
11221 /**
11222  * @brief Create a table that is child of a given element @a parent.
11223  *
11224  * @see evas_object_table_add()
11225  */
11226 EAPI Evas_Object                        *evas_object_table_add_to          (Evas_Object *parent) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
11227
11228 /**
11229  * @brief Set how this table should layout children.
11230  *
11231  * @todo consider aspect hint and respect it.
11232  *
11233  * @par EVAS_OBJECT_TABLE_HOMOGENEOUS_NONE
11234  * If table does not use homogeneous mode then columns and rows will
11235  * be calculated based on hints of individual cells. This operation
11236  * mode is more flexible, but more complex and heavy to calculate as
11237  * well. @b Weight properties are handled as a boolean expand. Negative
11238  * alignment will be considered as 0.5. This is the default.
11239  *
11240  * @todo @c EVAS_OBJECT_TABLE_HOMOGENEOUS_NONE should balance weight.
11241  *
11242  * @par EVAS_OBJECT_TABLE_HOMOGENEOUS_TABLE
11243  * When homogeneous is relative to table the own table size is divided
11244  * equally among children, filling the whole table area. That is, if
11245  * table has @c WIDTH and @c COLUMNS, each cell will get <tt>WIDTH /
11246  * COLUMNS</tt> pixels. If children have minimum size that is larger
11247  * than this amount (including padding), then it will overflow and be
11248  * aligned respecting the alignment hint, possible overlapping sibling
11249  * cells. @b Weight hint is used as a boolean, if greater than zero it
11250  * will make the child expand in that axis, taking as much space as
11251  * possible (bounded to maximum size hint). Negative alignment will be
11252  * considered as 0.5.
11253  *
11254  * @par EVAS_OBJECT_TABLE_HOMOGENEOUS_ITEM
11255  * When homogeneous is relative to item it means the greatest minimum
11256  * cell size will be used. That is, if no element is set to expand,
11257  * the table will have its contents to a minimum size, the bounding
11258  * box of all these children will be aligned relatively to the table
11259  * object using evas_object_table_align_get(). If the table area is
11260  * too small to hold this minimum bounding box, then the objects will
11261  * keep their size and the bounding box will overflow the box area,
11262  * still respecting the alignment. @b Weight hint is used as a
11263  * boolean, if greater than zero it will make that cell expand in that
11264  * axis, toggling the <b>expand mode</b>, which makes the table behave
11265  * much like @b EVAS_OBJECT_TABLE_HOMOGENEOUS_TABLE, except that the
11266  * bounding box will overflow and items will not overlap siblings. If
11267  * no minimum size is provided at all then the table will fallback to
11268  * expand mode as well.
11269  */
11270 EAPI void                                evas_object_table_homogeneous_set (Evas_Object *o, Evas_Object_Table_Homogeneous_Mode homogeneous) EINA_ARG_NONNULL(1);
11271
11272 /**
11273  * Get the current layout homogeneous mode.
11274  *
11275  * @see evas_object_table_homogeneous_set()
11276  */
11277 EAPI Evas_Object_Table_Homogeneous_Mode  evas_object_table_homogeneous_get (const Evas_Object *o) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
11278
11279 /**
11280  * Set padding between cells.
11281  */
11282 EAPI void                                evas_object_table_padding_set     (Evas_Object *o, Evas_Coord horizontal, Evas_Coord vertical) EINA_ARG_NONNULL(1);
11283
11284 /**
11285  * Get padding between cells.
11286  */
11287 EAPI void                                evas_object_table_padding_get     (const Evas_Object *o, Evas_Coord *horizontal, Evas_Coord *vertical) EINA_ARG_NONNULL(1);
11288
11289 /**
11290  * Set the alignment of the whole bounding box of contents.
11291  */
11292 EAPI void                                evas_object_table_align_set       (Evas_Object *o, double horizontal, double vertical) EINA_ARG_NONNULL(1);
11293
11294 /**
11295  * Get alignment of the whole bounding box of contents.
11296  */
11297 EAPI void                                evas_object_table_align_get       (const Evas_Object *o, double *horizontal, double *vertical) EINA_ARG_NONNULL(1);
11298
11299 /**
11300  * Sets the mirrored mode of the table. In mirrored mode the table items go
11301  * from right to left instead of left to right. That is, 1,1 is top right, not
11302  * top left.
11303  *
11304  * @param obj The table object.
11305  * @param mirrored the mirrored mode to set
11306  * @since 1.1.0
11307  */
11308 EAPI void                                evas_object_table_mirrored_set    (Evas_Object *o, Eina_Bool mirrored) EINA_ARG_NONNULL(1);
11309
11310 /**
11311  * Gets the mirrored mode of the table.
11312  *
11313  * @param obj The table object.
11314  * @return EINA_TRUE if it's a mirrored table, EINA_FALSE otherwise.
11315  * @since 1.1.0
11316  * @see evas_object_table_mirrored_set()
11317  */
11318 EAPI Eina_Bool                           evas_object_table_mirrored_get    (const Evas_Object *o) EINA_ARG_NONNULL(1);
11319
11320 /**
11321  * Get packing location of a child of table
11322  *
11323  * @param o The given table object.
11324  * @param child The child object to add.
11325  * @param col pointer to store relative-horizontal position to place child.
11326  * @param row pointer to store relative-vertical position to place child.
11327  * @param colspan pointer to store how many relative-horizontal position to use for this child.
11328  * @param rowspan pointer to store how many relative-vertical position to use for this child.
11329  *
11330  * @return 1 on success, 0 on failure.
11331  * @since 1.1.0
11332  */
11333 EAPI Eina_Bool                           evas_object_table_pack_get(Evas_Object *o, Evas_Object *child, unsigned short *col, unsigned short *row, unsigned short *colspan, unsigned short *rowspan);
11334
11335 /**
11336  * Add a new child to a table object or set its current packing.
11337  *
11338  * @param o The given table object.
11339  * @param child The child object to add.
11340  * @param col relative-horizontal position to place child.
11341  * @param row relative-vertical position to place child.
11342  * @param colspan how many relative-horizontal position to use for this child.
11343  * @param rowspan how many relative-vertical position to use for this child.
11344  *
11345  * @return 1 on success, 0 on failure.
11346  */
11347 EAPI Eina_Bool                           evas_object_table_pack            (Evas_Object *o, Evas_Object *child, unsigned short col, unsigned short row, unsigned short colspan, unsigned short rowspan) EINA_ARG_NONNULL(1, 2);
11348
11349 /**
11350  * Remove child from table.
11351  *
11352  * @note removing a child will immediately call a walk over children in order
11353  *       to recalculate numbers of columns and rows. If you plan to remove
11354  *       all children, use evas_object_table_clear() instead.
11355  *
11356  * @return 1 on success, 0 on failure.
11357  */
11358 EAPI Eina_Bool                           evas_object_table_unpack          (Evas_Object *o, Evas_Object *child) EINA_ARG_NONNULL(1, 2);
11359
11360 /**
11361  * Faster way to remove all child objects from a table object.
11362  *
11363  * @param o The given table object.
11364  * @param clear if true, it will delete just removed children.
11365  */
11366 EAPI void                                evas_object_table_clear           (Evas_Object *o, Eina_Bool clear) EINA_ARG_NONNULL(1);
11367
11368 /**
11369  * Get the number of columns and rows this table takes.
11370  *
11371  * @note columns and rows are virtual entities, one can specify a table
11372  *       with a single object that takes 4 columns and 5 rows. The only
11373  *       difference for a single cell table is that paddings will be
11374  *       accounted proportionally.
11375  */
11376 EAPI void                                evas_object_table_col_row_size_get(const Evas_Object *o, int *cols, int *rows) EINA_ARG_NONNULL(1);
11377
11378 /**
11379  * Get an iterator to walk the list of children for the table.
11380  *
11381  * @note Do not remove or delete objects while walking the list.
11382  */
11383 EAPI Eina_Iterator                      *evas_object_table_iterator_new    (const Evas_Object *o) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
11384
11385 /**
11386  * Get an accessor to get random access to the list of children for the table.
11387  *
11388  * @note Do not remove or delete objects while walking the list.
11389  */
11390 EAPI Eina_Accessor                      *evas_object_table_accessor_new    (const Evas_Object *o) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
11391
11392 /**
11393  * Get the list of children for the table.
11394  *
11395  * @note This is a duplicate of the list kept by the table internally.
11396  *       It's up to the user to destroy it when it no longer needs it.
11397  *       It's possible to remove objects from the table when walking this
11398  *       list, but these removals won't be reflected on it.
11399  */
11400 EAPI Eina_List                          *evas_object_table_children_get    (const Evas_Object *o) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
11401
11402 /**
11403  * Get the child of the table at the given coordinates
11404  *
11405  * @note This does not take into account col/row spanning
11406  */
11407 EAPI Evas_Object                        *evas_object_table_child_get       (const Evas_Object *o, unsigned short col, unsigned short row) EINA_ARG_NONNULL(1);
11408 /**
11409  * @}
11410  */
11411
11412 /**
11413  * @defgroup Evas_Object_Grid Grid Smart Object.
11414  *
11415  * Convenience smart object that packs children under a regular grid
11416  * layout, using their virtual grid location and size to determine
11417  * children's positions inside the grid object's area.
11418  *
11419  * @ingroup Evas_Smart_Object_Group
11420  * @since 1.1.0
11421  */
11422
11423 /**
11424  * @addtogroup Evas_Object_Grid
11425  * @{
11426  */
11427
11428 /**
11429  * Create a new grid.
11430  *
11431  * It's set to a virtual size of 1x1 by default and add children with
11432  * evas_object_grid_pack().
11433  * @since 1.1.0
11434  */
11435 EAPI Evas_Object                        *evas_object_grid_add             (Evas *evas) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
11436
11437 /**
11438  * Create a grid that is child of a given element @a parent.
11439  *
11440  * @see evas_object_grid_add()
11441  * @since 1.1.0
11442  */
11443 EAPI Evas_Object                        *evas_object_grid_add_to          (Evas_Object *parent) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
11444
11445 /**
11446  * Set the virtual resolution for the grid
11447  *
11448  * @param o The grid object to modify
11449  * @param w The virtual horizontal size (resolution) in integer units
11450  * @param h The virtual vertical size (resolution) in integer units
11451  * @since 1.1.0
11452  */
11453 EAPI void                                evas_object_grid_size_set        (Evas_Object *o, int w, int h) EINA_ARG_NONNULL(1);
11454
11455 /**
11456  * Get the current virtual resolution
11457  *
11458  * @param o The grid object to query
11459  * @param w A pointer to an integer to store the virtual width
11460  * @param h A pointer to an integer to store the virtual height
11461  * @see evas_object_grid_size_set()
11462  * @since 1.1.0
11463  */
11464 EAPI void                                evas_object_grid_size_get        (const Evas_Object *o, int *w, int *h) EINA_ARG_NONNULL(1);
11465
11466 /**
11467  * Sets the mirrored mode of the grid. In mirrored mode the grid items go
11468  * from right to left instead of left to right. That is, 0,0 is top right, not
11469  * to left.
11470  *
11471  * @param obj The grid object.
11472  * @param mirrored the mirrored mode to set
11473  * @since 1.1.0
11474  */
11475 EAPI void                                evas_object_grid_mirrored_set    (Evas_Object *o, Eina_Bool mirrored) EINA_ARG_NONNULL(1);
11476
11477 /**
11478  * Gets the mirrored mode of the grid.
11479  *
11480  * @param obj The grid object.
11481  * @return EINA_TRUE if it's a mirrored grid, EINA_FALSE otherwise.
11482  * @see evas_object_grid_mirrored_set()
11483  * @since 1.1.0
11484  */
11485 EAPI Eina_Bool                           evas_object_grid_mirrored_get    (const Evas_Object *o) EINA_ARG_NONNULL(1);
11486
11487 /**
11488  * Add a new child to a grid object.
11489  *
11490  * @param o The given grid object.
11491  * @param child The child object to add.
11492  * @param x The virtual x coordinate of the child
11493  * @param y The virtual y coordinate of the child
11494  * @param w The virtual width of the child
11495  * @param h The virtual height of the child
11496  * @return 1 on success, 0 on failure.
11497  * @since 1.1.0
11498  */
11499 EAPI Eina_Bool                           evas_object_grid_pack            (Evas_Object *o, Evas_Object *child, int x, int y, int w, int h) EINA_ARG_NONNULL(1, 2);
11500
11501 /**
11502  * Remove child from grid.
11503  *
11504  * @note removing a child will immediately call a walk over children in order
11505  *       to recalculate numbers of columns and rows. If you plan to remove
11506  *       all children, use evas_object_grid_clear() instead.
11507  *
11508  * @return 1 on success, 0 on failure.
11509  * @since 1.1.0
11510  */
11511 EAPI Eina_Bool                           evas_object_grid_unpack          (Evas_Object *o, Evas_Object *child) EINA_ARG_NONNULL(1, 2);
11512
11513 /**
11514  * Faster way to remove all child objects from a grid object.
11515  *
11516  * @param o The given grid object.
11517  * @param clear if true, it will delete just removed children.
11518  * @since 1.1.0
11519  */
11520 EAPI void                                evas_object_grid_clear           (Evas_Object *o, Eina_Bool clear) EINA_ARG_NONNULL(1);
11521
11522 /**
11523  * Get the pack options for a grid child
11524  *
11525  * Get the pack x, y, width and height in virtual coordinates set by
11526  * evas_object_grid_pack()
11527  * @param o The grid object
11528  * @param child The grid child to query for coordinates
11529  * @param x The pointer to where the x coordinate will be returned
11530  * @param y The pointer to where the y coordinate will be returned
11531  * @param w The pointer to where the width will be returned
11532  * @param h The pointer to where the height will be returned
11533  * @return 1 on success, 0 on failure.
11534  * @since 1.1.0
11535  */
11536 EAPI Eina_Bool                           evas_object_grid_pack_get        (Evas_Object *o, Evas_Object *child, int *x, int *y, int *w, int *h);
11537
11538 /**
11539  * Get an iterator to walk the list of children for the grid.
11540  *
11541  * @note Do not remove or delete objects while walking the list.
11542  * @since 1.1.0
11543  */
11544 EAPI Eina_Iterator                      *evas_object_grid_iterator_new    (const Evas_Object *o) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
11545
11546 /**
11547  * Get an accessor to get random access to the list of children for the grid.
11548  *
11549  * @note Do not remove or delete objects while walking the list.
11550  * @since 1.1.0
11551  */
11552 EAPI Eina_Accessor                      *evas_object_grid_accessor_new    (const Evas_Object *o) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
11553
11554 /**
11555  * Get the list of children for the grid.
11556  *
11557  * @note This is a duplicate of the list kept by the grid internally.
11558  *       It's up to the user to destroy it when it no longer needs it.
11559  *       It's possible to remove objects from the grid when walking this
11560  *       list, but these removals won't be reflected on it.
11561  * @since 1.1.0
11562  */
11563 EAPI Eina_List                          *evas_object_grid_children_get    (const Evas_Object *o) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
11564
11565 /**
11566  * @}
11567  */
11568
11569 /**
11570  * @defgroup Evas_Cserve Shared Image Cache Server
11571  *
11572  * Evas has an (optional) module which provides client-server
11573  * infrastructure to <b>share bitmaps across multiple processes</b>,
11574  * saving data and processing power.
11575  *
11576  * Be warned that it @b doesn't work when <b>threaded image
11577  * preloading</b> is enabled for Evas, though.
11578  */
11579    typedef struct _Evas_Cserve_Stats       Evas_Cserve_Stats;
11580    typedef struct _Evas_Cserve_Image_Cache Evas_Cserve_Image_Cache;
11581    typedef struct _Evas_Cserve_Image       Evas_Cserve_Image;
11582    typedef struct _Evas_Cserve_Config      Evas_Cserve_Config;
11583
11584 /**
11585  * Statistics about the server that shares cached bitmaps.
11586  * @ingroup Evas_Cserve
11587  */
11588    struct _Evas_Cserve_Stats
11589      {
11590         int    saved_memory; /**< current amount of saved memory, in bytes */
11591         int    wasted_memory; /**< current amount of wasted memory, in bytes */
11592         int    saved_memory_peak; /**< peak ammount of saved memory, in bytes */
11593         int    wasted_memory_peak; /**< peak ammount of wasted memory, in bytes */
11594         double saved_time_image_header_load; /**< time, in seconds, saved in header loads by sharing cached loads instead */
11595         double saved_time_image_data_load; /**< time, in seconds, saved in data loads by sharing cached loads instead */
11596      };
11597
11598 /**
11599  * A handle of a cache of images shared by a server.
11600  * @ingroup Evas_Cserve
11601  */
11602    struct _Evas_Cserve_Image_Cache
11603      {
11604         struct {
11605            int     mem_total;
11606            int     count;
11607         } active, cached;
11608         Eina_List *images;
11609      };
11610
11611 /**
11612  * A handle to an image shared by a server.
11613  * @ingroup Evas_Cserve
11614  */
11615    struct _Evas_Cserve_Image
11616      {
11617         const char *file, *key;
11618         int         w, h;
11619         time_t      file_mod_time;
11620         time_t      file_checked_time;
11621         time_t      cached_time;
11622         int         refcount;
11623         int         data_refcount;
11624         int         memory_footprint;
11625         double      head_load_time;
11626         double      data_load_time;
11627         Eina_Bool   alpha : 1;
11628         Eina_Bool   data_loaded : 1;
11629         Eina_Bool   active : 1;
11630         Eina_Bool   dead : 1;
11631         Eina_Bool   useless : 1;
11632      };
11633
11634 /**
11635  * Configuration that controls the server that shares cached bitmaps.
11636  * @ingroup Evas_Cserve
11637  */
11638     struct _Evas_Cserve_Config
11639      {
11640         int cache_max_usage;
11641         int cache_item_timeout;
11642         int cache_item_timeout_check;
11643      };
11644
11645
11646 /**
11647  * Retrieves if the system wants to share bitmaps using the server.
11648  * @return @c EINA_TRUE if it wants, @c EINA_FALSE otherwise.
11649  * @ingroup Evas_Cserve
11650  */
11651 EAPI Eina_Bool         evas_cserve_want_get                   (void) EINA_WARN_UNUSED_RESULT;
11652
11653 /**
11654  * Retrieves if the system is connected to the server used to share
11655  * bitmaps.
11656  *
11657  * @return @c EINA_TRUE if it's connected, @c EINA_FALSE otherwise.
11658  * @ingroup Evas_Cserve
11659  */
11660 EAPI Eina_Bool         evas_cserve_connected_get              (void) EINA_WARN_UNUSED_RESULT;
11661
11662 /**
11663  * Retrieves statistics from a running bitmap sharing server.
11664  * @param stats pointer to structure to fill with statistics about the
11665  *        bitmap cache server.
11666  *
11667  * @return @c EINA_TRUE if @p stats were filled with data,
11668  *         @c EINA_FALSE otherwise (when @p stats is untouched)
11669  * @ingroup Evas_Cserve
11670  */
11671 EAPI Eina_Bool         evas_cserve_stats_get                  (Evas_Cserve_Stats *stats) EINA_WARN_UNUSED_RESULT;
11672
11673 /**
11674  * Completely discard/clean a given images cache, thus re-setting it.
11675  *
11676  * @param cache A handle to the given images cache.
11677  */
11678 EAPI void              evas_cserve_image_cache_contents_clean (Evas_Cserve_Image_Cache *cache);
11679
11680 /**
11681  * Retrieves the current configuration of the Evas image caching
11682  * server.
11683  *
11684  * @param config where to store current image caching server's
11685  * configuration.
11686  *
11687  * @return @c EINA_TRUE if @p config was filled with data,
11688  *         @c EINA_FALSE otherwise (when @p config is untouched)
11689  *
11690  * The fields of @p config will be altered to reflect the current
11691  * configuration's values.
11692  *
11693  * @see evas_cserve_config_set()
11694  *
11695  * @ingroup Evas_Cserve
11696  */
11697 EAPI Eina_Bool         evas_cserve_config_get                 (Evas_Cserve_Config *config) EINA_WARN_UNUSED_RESULT;
11698
11699 /**
11700  * Changes the configurations of the Evas image caching server.
11701  *
11702  * @param config A bitmap cache configuration handle with fields set
11703  * to desired configuration values.
11704  * @return @c EINA_TRUE if @p config was successfully applied,
11705  *         @c EINA_FALSE otherwise.
11706  *
11707  * @see evas_cserve_config_get()
11708  *
11709  * @ingroup Evas_Cserve
11710  */
11711 EAPI Eina_Bool         evas_cserve_config_set                 (const Evas_Cserve_Config *config) EINA_WARN_UNUSED_RESULT;
11712
11713 /**
11714  * Force the system to disconnect from the bitmap caching server.
11715  *
11716  * @ingroup Evas_Cserve
11717  */
11718 EAPI void              evas_cserve_disconnect                 (void);
11719
11720 /**
11721  * @defgroup Evas_Utils General Utilities
11722  *
11723  * Some functions that are handy but are not specific of canvas or
11724  * objects.
11725  */
11726
11727 /**
11728  * Converts the given Evas image load error code into a string
11729  * describing it in english.
11730  *
11731  * @param error the error code, a value in ::Evas_Load_Error.
11732  * @return Always returns a valid string. If the given @p error is not
11733  *         supported, <code>"Unknown error"</code> is returned.
11734  *
11735  * Mostly evas_object_image_file_set() would be the function setting
11736  * that error value afterwards, but also evas_object_image_load(),
11737  * evas_object_image_save(), evas_object_image_data_get(),
11738  * evas_object_image_data_convert(), evas_object_image_pixels_import()
11739  * and evas_object_image_is_inside(). This function is meant to be
11740  * used in conjunction with evas_object_image_load_error_get(), as in:
11741  *
11742  * Example code:
11743  * @dontinclude evas-load-error-str.c
11744  * @skip img1 =
11745  * @until ecore_main_loop_begin(
11746  *
11747  * Here, being @c valid_path the path to a valid image and @c
11748  * bogus_path a path to a file which does not exist, the two outputs
11749  * of evas_load_error_str() would be (if no other errors occur):
11750  * <code>"No error on load"</code> and <code>"File (or file path) does
11751  * not exist"</code>, respectively. See the full @ref
11752  * Example_Evas_Images "example".
11753  *
11754  * @ingroup Evas_Utils
11755  */
11756 EAPI const char       *evas_load_error_str               (Evas_Load_Error error);
11757
11758 /* Evas utility routines for color space conversions */
11759 /* hsv color space has h in the range 0.0 to 360.0, and s,v in the range 0.0 to 1.0 */
11760 /* rgb color space has r,g,b in the range 0 to 255 */
11761
11762 /**
11763  * Convert a given color from HSV to RGB format.
11764  *
11765  * @param h The Hue component of the color.
11766  * @param s The Saturation component of the color.
11767  * @param v The Value component of the color.
11768  * @param r The Red component of the color.
11769  * @param g The Green component of the color.
11770  * @param b The Blue component of the color.
11771  *
11772  * This function converts a given color in HSV color format to RGB
11773  * color format.
11774  *
11775  * @ingroup Evas_Utils
11776  **/
11777 EAPI void              evas_color_hsv_to_rgb             (float h, float s, float v, int *r, int *g, int *b);
11778
11779 /**
11780  * Convert a given color from RGB to HSV format.
11781  *
11782  * @param r The Red component of the color.
11783  * @param g The Green component of the color.
11784  * @param b The Blue component of the color.
11785  * @param h The Hue component of the color.
11786  * @param s The Saturation component of the color.
11787  * @param v The Value component of the color.
11788  *
11789  * This function converts a given color in RGB color format to HSV
11790  * color format.
11791  *
11792  * @ingroup Evas_Utils
11793  **/
11794 EAPI void              evas_color_rgb_to_hsv             (int r, int g, int b, float *h, float *s, float *v);
11795
11796 /* argb color space has a,r,g,b in the range 0 to 255 */
11797
11798 /**
11799  * Pre-multiplies a rgb triplet by an alpha factor.
11800  *
11801  * @param a The alpha factor.
11802  * @param r The Red component of the color.
11803  * @param g The Green component of the color.
11804  * @param b The Blue component of the color.
11805  *
11806  * This function pre-multiplies a given rbg triplet by an alpha
11807  * factor. Alpha factor is used to define transparency.
11808  *
11809  * @ingroup Evas_Utils
11810  **/
11811 EAPI void              evas_color_argb_premul            (int a, int *r, int *g, int *b);
11812
11813 /**
11814  * Undo pre-multiplication of a rgb triplet by an alpha factor.
11815  *
11816  * @param a The alpha factor.
11817  * @param r The Red component of the color.
11818  * @param g The Green component of the color.
11819  * @param b The Blue component of the color.
11820  *
11821  * This function undoes pre-multiplication a given rbg triplet by an
11822  * alpha factor. Alpha factor is used to define transparency.
11823  *
11824  * @see evas_color_argb_premul().
11825  *
11826  * @ingroup Evas_Utils
11827  **/
11828 EAPI void              evas_color_argb_unpremul          (int a, int *r, int *g, int *b);
11829
11830
11831 /**
11832  * Pre-multiplies data by an alpha factor.
11833  *
11834  * @param data The data value.
11835  * @param len  The length value.
11836  *
11837  * This function pre-multiplies a given data by an alpha
11838  * factor. Alpha factor is used to define transparency.
11839  *
11840  * @ingroup Evas_Utils
11841  **/
11842 EAPI void              evas_data_argb_premul             (unsigned int *data, unsigned int len);
11843
11844 /**
11845  * Undo pre-multiplication data by an alpha factor.
11846  *
11847  * @param data The data value.
11848  * @param len  The length value.
11849  *
11850  * This function undoes pre-multiplication of a given data by an alpha
11851  * factor. Alpha factor is used to define transparency.
11852  *
11853  * @ingroup Evas_Utils
11854  **/
11855 EAPI void              evas_data_argb_unpremul           (unsigned int *data, unsigned int len);
11856
11857 /* string and font handling */
11858
11859 /**
11860  * Gets the next character in the string
11861  *
11862  * Given the UTF-8 string in @p str, and starting byte position in @p pos,
11863  * this function will place in @p decoded the decoded code point at @p pos
11864  * and return the byte index for the next character in the string.
11865  *
11866  * The only boundary check done is that @p pos must be >= 0. Other than that,
11867  * no checks are performed, so passing an index value that's not within the
11868  * length of the string will result in undefined behavior.
11869  *
11870  * @param str The UTF-8 string
11871  * @param pos The byte index where to start
11872  * @param decoded Address where to store the decoded code point. Optional.
11873  *
11874  * @return The byte index of the next character
11875  *
11876  * @ingroup Evas_Utils
11877  */
11878 EAPI int               evas_string_char_next_get         (const char *str, int pos, int *decoded) EINA_ARG_NONNULL(1);
11879
11880 /**
11881  * Gets the previous character in the string
11882  *
11883  * Given the UTF-8 string in @p str, and starting byte position in @p pos,
11884  * this function will place in @p decoded the decoded code point at @p pos
11885  * and return the byte index for the previous character in the string.
11886  *
11887  * The only boundary check done is that @p pos must be >= 1. Other than that,
11888  * no checks are performed, so passing an index value that's not within the
11889  * length of the string will result in undefined behavior.
11890  *
11891  * @param str The UTF-8 string
11892  * @param pos The byte index where to start
11893  * @param decoded Address where to store the decoded code point. Optional.
11894  *
11895  * @return The byte index of the previous character
11896  *
11897  * @ingroup Evas_Utils
11898  */
11899 EAPI int               evas_string_char_prev_get         (const char *str, int pos, int *decoded) EINA_ARG_NONNULL(1);
11900
11901 /**
11902  * Get the length in characters of the string.
11903  * @param  str The string to get the length of.
11904  * @return The length in characters (not bytes)
11905  * @ingroup Evas_Utils
11906  */
11907 EAPI int               evas_string_char_len_get          (const char *str) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
11908
11909 /**
11910  * @defgroup Evas_Keys Key Input Functions
11911  *
11912  * Functions which feed key events to the canvas.
11913  *
11914  * As explained in @ref intro_not_evas, Evas is @b not aware of input
11915  * systems at all. Then, the user, if using it crudely (evas_new()),
11916  * will have to feed it with input events, so that it can react
11917  * somehow. If, however, the user creates a canvas by means of the
11918  * Ecore_Evas wrapper, it will automatically bind the chosen display
11919  * engine's input events to the canvas, for you.
11920  *
11921  * This group presents the functions dealing with the feeding of key
11922  * events to the canvas. On most of them, one has to reference a given
11923  * key by a name (<code>keyname</code> argument). Those are
11924  * <b>platform dependent</b> symbolic names for the keys. Sometimes
11925  * you'll get the right <code>keyname</code> by simply using an ASCII
11926  * value of the key name, but it won't be like that always.
11927  *
11928  * Typical platforms are Linux frame buffer (Ecore_FB) and X server
11929  * (Ecore_X) when using Evas with Ecore and Ecore_Evas. Please refer
11930  * to your display engine's documentation when using evas through an
11931  * Ecore helper wrapper when you need the <code>keyname</code>s.
11932  *
11933  * Example:
11934  * @dontinclude evas-events.c
11935  * @skip mods = evas_key_modifier_get(evas);
11936  * @until {
11937  *
11938  * All the other @c evas_key functions behave on the same manner. See
11939  * the full @ref Example_Evas_Events "example".
11940  *
11941  * @ingroup Evas_Canvas
11942  */
11943
11944 /**
11945  * @addtogroup Evas_Keys
11946  * @{
11947  */
11948
11949 /**
11950  * Returns a handle to the list of modifier keys registered in the
11951  * canvas @p e. This is required to check for which modifiers are set
11952  * at a given time with the evas_key_modifier_is_set() function.
11953  *
11954  * @param e The pointer to the Evas canvas
11955  *
11956  * @see evas_key_modifier_add
11957  * @see evas_key_modifier_del
11958  * @see evas_key_modifier_on
11959  * @see evas_key_modifier_off
11960  * @see evas_key_modifier_is_set
11961  *
11962  * @return An ::Evas_Modifier handle to query Evas' keys subsystem
11963  *      with evas_key_modifier_is_set(), or @c NULL on error.
11964  */
11965 EAPI const Evas_Modifier *evas_key_modifier_get          (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
11966
11967 /**
11968  * Returns a handle to the list of lock keys registered in the canvas
11969  * @p e. This is required to check for which locks are set at a given
11970  * time with the evas_key_lock_is_set() function.
11971  *
11972  * @param e The pointer to the Evas canvas
11973  *
11974  * @see evas_key_lock_add
11975  * @see evas_key_lock_del
11976  * @see evas_key_lock_on
11977  * @see evas_key_lock_off
11978  * @see evas_key_lock_is_set
11979  *
11980  * @return An ::Evas_Lock handle to query Evas' keys subsystem with
11981  *      evas_key_lock_is_set(), or @c NULL on error.
11982  */
11983 EAPI const Evas_Lock     *evas_key_lock_get              (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
11984
11985
11986 /**
11987  * Checks the state of a given modifier key, at the time of the
11988  * call. If the modifier is set, such as shift being pressed, this
11989  * function returns @c Eina_True.
11990  *
11991  * @param m The current modifiers set, as returned by
11992  *        evas_key_modifier_get().
11993  * @param keyname The name of the modifier key to check status for.
11994  *
11995  * @return @c Eina_True if the modifier key named @p keyname is on, @c
11996  *         Eina_False otherwise.
11997  *
11998  * @see evas_key_modifier_add
11999  * @see evas_key_modifier_del
12000  * @see evas_key_modifier_get
12001  * @see evas_key_modifier_on
12002  * @see evas_key_modifier_off
12003  */
12004 EAPI Eina_Bool            evas_key_modifier_is_set       (const Evas_Modifier *m, const char *keyname) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2);
12005
12006
12007 /**
12008  * Checks the state of a given lock key, at the time of the call. If
12009  * the lock is set, such as caps lock, this function returns @c
12010  * Eina_True.
12011  *
12012  * @param l The current locks set, as returned by evas_key_lock_get().
12013  * @param keyname The name of the lock key to check status for.
12014  *
12015  * @return @c Eina_True if the @p keyname lock key is set, @c
12016  *        Eina_False otherwise.
12017  *
12018  * @see evas_key_lock_get
12019  * @see evas_key_lock_add
12020  * @see evas_key_lock_del
12021  * @see evas_key_lock_on
12022  * @see evas_key_lock_off
12023  */
12024 EAPI Eina_Bool            evas_key_lock_is_set           (const Evas_Lock *l, const char *keyname) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2);
12025
12026
12027 /**
12028  * Adds the @p keyname key to the current list of modifier keys.
12029  *
12030  * @param e The pointer to the Evas canvas
12031  * @param keyname The name of the modifier key to add to the list of
12032  *        Evas modifiers.
12033  *
12034  * Modifiers are keys like shift, alt and ctrl, i.e., keys which are
12035  * meant to be pressed together with others, altering the behavior of
12036  * the secondly pressed keys somehow. Evas is so that these keys can
12037  * be user defined.
12038  *
12039  * This call allows custom modifiers to be added to the Evas system at
12040  * run time. It is then possible to set and unset modifier keys
12041  * programmatically for other parts of the program to check and act
12042  * on. Programmers using Evas would check for modifier keys on key
12043  * event callbacks using evas_key_modifier_is_set().
12044  *
12045  * @see evas_key_modifier_del
12046  * @see evas_key_modifier_get
12047  * @see evas_key_modifier_on
12048  * @see evas_key_modifier_off
12049  * @see evas_key_modifier_is_set
12050  *
12051  * @note If the programmer instantiates the canvas by means of the
12052  *       ecore_evas_new() family of helper functions, Ecore will take
12053  *       care of registering on it all standard modifiers: "Shift",
12054  *       "Control", "Alt", "Meta", "Hyper", "Super".
12055  */
12056 EAPI void                 evas_key_modifier_add          (Evas *e, const char *keyname) EINA_ARG_NONNULL(1, 2);
12057
12058 /**
12059  * Removes the @p keyname key from the current list of modifier keys
12060  * on canvas @e.
12061  *
12062  * @param e The pointer to the Evas canvas
12063  * @param keyname The name of the key to remove from the modifiers list.
12064  *
12065  * @see evas_key_modifier_add
12066  * @see evas_key_modifier_get
12067  * @see evas_key_modifier_on
12068  * @see evas_key_modifier_off
12069  * @see evas_key_modifier_is_set
12070  */
12071 EAPI void                 evas_key_modifier_del          (Evas *e, const char *keyname) EINA_ARG_NONNULL(1, 2);
12072
12073 /**
12074  * Adds the @p keyname key to the current list of lock keys.
12075  *
12076  * @param e The pointer to the Evas canvas
12077  * @param keyname The name of the key to add to the locks list.
12078  *
12079  * Locks are keys like caps lock, num lock or scroll lock, i.e., keys
12080  * which are meant to be pressed once -- toggling a binary state which
12081  * is bound to it -- and thus altering the behavior of all
12082  * subsequently pressed keys somehow, depending on its state. Evas is
12083  * so that these keys can be defined by the user.
12084  *
12085  * This allows custom locks to be added to the evas system at run
12086  * time. It is then possible to set and unset lock keys
12087  * programmatically for other parts of the program to check and act
12088  * on. Programmers using Evas would check for lock keys on key event
12089  * callbacks using evas_key_lock_is_set().
12090  *
12091  * @see evas_key_lock_get
12092  * @see evas_key_lock_del
12093  * @see evas_key_lock_on
12094  * @see evas_key_lock_off
12095  * @see evas_key_lock_is_set
12096  *
12097  * @note If the programmer instantiates the canvas by means of the
12098  *       ecore_evas_new() family of helper functions, Ecore will take
12099  *       care of registering on it all standard lock keys: "Caps_Lock",
12100  *       "Num_Lock", "Scroll_Lock".
12101  */
12102 EAPI void                 evas_key_lock_add              (Evas *e, const char *keyname) EINA_ARG_NONNULL(1, 2);
12103
12104 /**
12105  * Removes the @p keyname key from the current list of lock keys on
12106  * canvas @e.
12107  *
12108  * @param e The pointer to the Evas canvas
12109  * @param keyname The name of the key to remove from the locks list.
12110  *
12111  * @see evas_key_lock_get
12112  * @see evas_key_lock_add
12113  * @see evas_key_lock_on
12114  * @see evas_key_lock_off
12115  */
12116 EAPI void                 evas_key_lock_del              (Evas *e, const char *keyname) EINA_ARG_NONNULL(1, 2);
12117
12118
12119 /**
12120  * Enables or turns on programmatically the modifier key with name @p
12121  * keyname.
12122  *
12123  * @param e The pointer to the Evas canvas
12124  * @param keyname The name of the modifier to enable.
12125  *
12126  * The effect will be as if the key was pressed for the whole time
12127  * between this call and a matching evas_key_modifier_off().
12128  *
12129  * @see evas_key_modifier_add
12130  * @see evas_key_modifier_get
12131  * @see evas_key_modifier_off
12132  * @see evas_key_modifier_is_set
12133  */
12134 EAPI void                 evas_key_modifier_on           (Evas *e, const char *keyname) EINA_ARG_NONNULL(1, 2);
12135
12136 /**
12137  * Disables or turns off programmatically the modifier key with name
12138  * @p keyname.
12139  *
12140  * @param e The pointer to the Evas canvas
12141  * @param keyname The name of the modifier to disable.
12142  *
12143  * @see evas_key_modifier_add
12144  * @see evas_key_modifier_get
12145  * @see evas_key_modifier_on
12146  * @see evas_key_modifier_is_set
12147  */
12148 EAPI void                 evas_key_modifier_off          (Evas *e, const char *keyname) EINA_ARG_NONNULL(1, 2);
12149
12150 /**
12151  * Enables or turns on programmatically the lock key with name @p
12152  * keyname.
12153  *
12154  * @param e The pointer to the Evas canvas
12155  * @param keyname The name of the lock to enable.
12156  *
12157  * The effect will be as if the key was put on its active state after
12158  * this call.
12159  *
12160  * @see evas_key_lock_get
12161  * @see evas_key_lock_add
12162  * @see evas_key_lock_del
12163  * @see evas_key_lock_off
12164  */
12165 EAPI void                 evas_key_lock_on               (Evas *e, const char *keyname) EINA_ARG_NONNULL(1, 2);
12166
12167 /**
12168  * Disables or turns off programmatically the lock key with name @p
12169  * keyname.
12170  *
12171  * @param e The pointer to the Evas canvas
12172  * @param keyname The name of the lock to disable.
12173  *
12174  * The effect will be as if the key was put on its inactive state
12175  * after this call.
12176  *
12177  * @see evas_key_lock_get
12178  * @see evas_key_lock_add
12179  * @see evas_key_lock_del
12180  * @see evas_key_lock_on
12181  */
12182 EAPI void                 evas_key_lock_off              (Evas *e, const char *keyname) EINA_ARG_NONNULL(1, 2);
12183
12184
12185 /**
12186  * Creates a bit mask from the @p keyname @b modifier key. Values
12187  * returned from different calls to it may be ORed together,
12188  * naturally.
12189  *
12190  * @param e The canvas whom to query the bit mask from.
12191  * @param keyname The name of the modifier key to create the mask for.
12192  *
12193  * @returns the bit mask or 0 if the @p keyname key wasn't registered as a
12194  *          modifier for canvas @p e.
12195  *
12196  * This function is meant to be using in conjunction with
12197  * evas_object_key_grab()/evas_object_key_ungrab(). Go check their
12198  * documentation for more information.
12199  *
12200  * @see evas_key_modifier_add
12201  * @see evas_key_modifier_get
12202  * @see evas_key_modifier_on
12203  * @see evas_key_modifier_off
12204  * @see evas_key_modifier_is_set
12205  * @see evas_object_key_grab
12206  * @see evas_object_key_ungrab
12207  */
12208 EAPI Evas_Modifier_Mask   evas_key_modifier_mask_get     (const Evas *e, const char *keyname) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2);
12209
12210
12211 /**
12212  * Requests @p keyname key events be directed to @p obj.
12213  *
12214  * @param obj the object to direct @p keyname events to.
12215  * @param keyname the key to request events for.
12216  * @param modifiers a mask of modifiers that must be present to
12217  * trigger the event.
12218  * @param not_modifiers a mask of modifiers that must @b not be present
12219  * to trigger the event.
12220  * @param exclusive request that the @p obj is the only object
12221  * receiving the @p keyname events.
12222  * @return @c EINA_TRUE, if the call succeeded, @c EINA_FALSE otherwise.
12223  *
12224  * Key grabs allow one or more objects to receive key events for
12225  * specific key strokes even if other objects have focus. Whenever a
12226  * key is grabbed, only the objects grabbing it will get the events
12227  * for the given keys.
12228  *
12229  * @p keyname is a platform dependent symbolic name for the key
12230  * pressed (see @ref Evas_Keys for more information).
12231  *
12232  * @p modifiers and @p not_modifiers are bit masks of all the
12233  * modifiers that must and mustn't, respectively, be pressed along
12234  * with @p keyname key in order to trigger this new key
12235  * grab. Modifiers can be things such as Shift and Ctrl as well as
12236  * user defigned types via evas_key_modifier_add(). Retrieve them with
12237  * evas_key_modifier_mask_get() or use @c 0 for empty masks.
12238  *
12239  * @p exclusive will make the given object the only one permitted to
12240  * grab the given key. If given @c EINA_TRUE, subsequent calls on this
12241  * function with different @p obj arguments will fail, unless the key
12242  * is ungrabbed again.
12243  *
12244  * Example code follows.
12245  * @dontinclude evas-events.c
12246  * @skip if (d.focus)
12247  * @until else
12248  *
12249  * See the full example @ref Example_Evas_Events "here".
12250  *
12251  * @see evas_object_key_ungrab
12252  * @see evas_object_focus_set
12253  * @see evas_object_focus_get
12254  * @see evas_focus_get
12255  * @see evas_key_modifier_add
12256  */
12257 EAPI Eina_Bool            evas_object_key_grab           (Evas_Object *obj, const char *keyname, Evas_Modifier_Mask modifiers, Evas_Modifier_Mask not_modifiers, Eina_Bool exclusive) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2);
12258
12259 /**
12260  * Removes the grab on @p keyname key events by @p obj.
12261  *
12262  * @param obj the object that has an existing key grab.
12263  * @param keyname the key the grab is set for.
12264  * @param modifiers a mask of modifiers that must be present to
12265  * trigger the event.
12266  * @param not_modifiers a mask of modifiers that must not not be
12267  * present to trigger the event.
12268  *
12269  * Removes a key grab on @p obj if @p keyname, @p modifiers, and @p
12270  * not_modifiers match.
12271  *
12272  * Example code follows.
12273  * @dontinclude evas-events.c
12274  * @skip got here by key grabs
12275  * @until }
12276  *
12277  * See the full example @ref Example_Evas_Events "here".
12278  *
12279  * @see evas_object_key_grab
12280  * @see evas_object_focus_set
12281  * @see evas_object_focus_get
12282  * @see evas_focus_get
12283  */
12284 EAPI void                 evas_object_key_ungrab         (Evas_Object *obj, const char *keyname, Evas_Modifier_Mask modifiers, Evas_Modifier_Mask not_modifiers) EINA_ARG_NONNULL(1, 2);
12285
12286 /**
12287  * @}
12288  */
12289
12290 /**
12291  * @defgroup Evas_Touch_Point_List Touch Point List Functions
12292  *
12293  * Functions to get information of touched points in the Evas.
12294  *
12295  * Evas maintains list of touched points on the canvas. Each point has
12296  * its co-ordinates, id and state. You can get the number of touched
12297  * points and information of each point using evas_touch_point_list
12298  * functions.
12299  *
12300  * @ingroup Evas_Canvas
12301  */
12302
12303 /**
12304  * @addtogroup Evas_Touch_Point_List
12305  * @{
12306  */
12307
12308 /**
12309  * Get the number of touched point in the evas.
12310  *
12311  * @param e The pointer to the Evas canvas.
12312  * @return The number of touched point on the evas.
12313  *
12314  * New touched point is added to the list whenever touching the evas
12315  * and point is removed whenever removing touched point from the evas.
12316  *
12317  * Example:
12318  * @code
12319  * extern Evas *evas;
12320  * int count;
12321  *
12322  * count = evas_touch_point_list_count(evas);
12323  * printf("The count of touch points: %i\n", count);
12324  * @endcode
12325  *
12326  * @see evas_touch_point_list_nth_xy_get()
12327  * @see evas_touch_point_list_nth_id_get()
12328  * @see evas_touch_point_list_nth_state_get()
12329  */
12330 EAPI unsigned int           evas_touch_point_list_count(Evas *e) EINA_ARG_NONNULL(1);
12331
12332 /**
12333  * This function returns the nth touch point's co-ordinates.
12334  *
12335  * @param e The pointer to the Evas canvas.
12336  * @param n The number of the touched point (0 being the first).
12337  * @param x The pointer to a Evas_Coord to be filled in.
12338  * @param y The pointer to a Evas_Coord to be filled in.
12339  *
12340  * Touch point's co-ordinates is updated whenever moving that point
12341  * on the canvas.
12342  *
12343  * Example:
12344  * @code
12345  * extern Evas *evas;
12346  * Evas_Coord x, y;
12347  *
12348  * if (evas_touch_point_list_count(evas))
12349  *   {
12350  *      evas_touch_point_nth_xy_get(evas, 0, &x, &y);
12351  *      printf("The first touch point's co-ordinate: (%i, %i)\n", x, y);
12352  *   }
12353  * @endcode
12354  *
12355  * @see evas_touch_point_list_count()
12356  * @see evas_touch_point_list_nth_id_get()
12357  * @see evas_touch_point_list_nth_state_get()
12358  */
12359 EAPI void                   evas_touch_point_list_nth_xy_get(Evas *e, unsigned int n, Evas_Coord *x, Evas_Coord *y) EINA_ARG_NONNULL(1);
12360
12361 /**
12362  * This function returns the @p id of nth touch point.
12363  *
12364  * @param e The pointer to the Evas canvas.
12365  * @param n The number of the touched point (0 being the first).
12366  * @return id of nth touch point, if the call succeeded, -1 otherwise.
12367  *
12368  * The point which comes from Mouse Event has @p id 0 and The point
12369  * which comes from Multi Event has @p id that is same as Multi
12370  * Event's device id.
12371  *
12372  * Example:
12373  * @code
12374  * extern Evas *evas;
12375  * int id;
12376  *
12377  * if (evas_touch_point_list_count(evas))
12378  *   {
12379  *      id = evas_touch_point_nth_id_get(evas, 0);
12380  *      printf("The first touch point's id: %i\n", id);
12381  *   }
12382  * @endcode
12383  *
12384  * @see evas_touch_point_list_count()
12385  * @see evas_touch_point_list_nth_xy_get()
12386  * @see evas_touch_point_list_nth_state_get()
12387  */
12388 EAPI int                    evas_touch_point_list_nth_id_get(Evas *e, unsigned int n) EINA_ARG_NONNULL(1);
12389
12390 /**
12391  * This function returns the @p state of nth touch point.
12392  *
12393  * @param e The pointer to the Evas canvas.
12394  * @param n The number of the touched point (0 being the first).
12395  * @return @p state of nth touch point, if the call succeeded,
12396  *         EVAS_TOUCH_POINT_CANCEL otherwise.
12397  *
12398  * The point's @p state is EVAS_TOUCH_POINT_DOWN when pressed,
12399  * EVAS_TOUCH_POINT_STILL when the point is not moved after pressed,
12400  * EVAS_TOUCH_POINT_MOVE when moved at least once after pressed and
12401  * EVAS_TOUCH_POINT_UP when released.
12402  *
12403  * Example:
12404  * @code
12405  * extern Evas *evas;
12406  * Evas_Touch_Point_State state;
12407  *
12408  * if (evas_touch_point_list_count(evas))
12409  *   {
12410  *      state = evas_touch_point_nth_state_get(evas, 0);
12411  *      printf("The first touch point's state: %i\n", state);
12412  *   }
12413  * @endcode
12414  *
12415  * @see evas_touch_point_list_count()
12416  * @see evas_touch_point_list_nth_xy_get()
12417  * @see evas_touch_point_list_nth_id_get()
12418  */
12419 EAPI Evas_Touch_Point_State evas_touch_point_list_nth_state_get(Evas *e, unsigned int n) EINA_ARG_NONNULL(1);
12420
12421 /**
12422  * @}
12423  */
12424
12425 #ifdef __cplusplus
12426 }
12427 #endif
12428
12429 #endif