[evas] Examples on box object.
[framework/uifw/evas.git] / src / lib / Evas.h
1 /**
2 @mainpage Evas
3
4 @image html  e_big.png
5
6 @version 1.1
7 @date 2000-2011
8
9 Please see the @ref authors page for contact details.
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_Image, to learn about image objects, over which
250     Evas can do a plethora of operations.
251 @li @ref Evas_Object_Text, to learn how to create textual elements on
252     the canvas.
253 @li @ref Evas_Smart_Object_Group and @ref Evas_Smart_Group, to define
254     new objects that provide @b custom functions to handle clipping,
255     hiding, moving, resizing, color setting and more. These could
256     be as simple as a group of objects that move together (see @ref
257     Evas_Smart_Object_Clipped) up to implementations of what
258     ends to be a widget, providing some intelligence (thus the name)
259     to Evas objects -- like a button or check box, for example.
260
261 @section intro_example Introductory Example
262
263 @include evas-buffer-simple.c
264 */
265
266 /**
267 @page authors Authors
268 @author Carsten Haitzler <raster@@rasterman.com>
269 @author Till Adam <till@@adam-lilienthal.de>
270 @author Steve Ireland <sireland@@pobox.com>
271 @author Brett Nash <nash@@nash.id.au>
272 @author Tilman Sauerbeck <tilman@@code-monkey.de>
273 @author Corey Donohoe <atmos@@atmos.org>
274 @author Yuri Hudobin <glassy_ape@@users.sourceforge.net>
275 @author Nathan Ingersoll <ningerso@@d.umn.edu>
276 @author Willem Monsuwe <willem@@stack.nl>
277 @author Jose O Gonzalez <jose_ogp@@juno.com>
278 @author Bernhard Nemec <Bernhard.Nemec@@viasyshc.com>
279 @author Jorge Luis Zapata Muga <jorgeluis.zapata@@gmail.com>
280 @author Cedric Bail <cedric.bail@@free.fr>
281 @author Gustavo Sverzut Barbieri <barbieri@@profusion.mobi>
282 @author Vincent Torri <vtorri@@univ-evry.fr>
283 @author Tim Horton <hortont424@@gmail.com>
284 @author Tom Hacohen <tom@@stosb.com>
285 @author Mathieu Taillefumier <mathieu.taillefumier@@free.fr>
286 @author Iván Briano <ivan@@profusion.mobi>
287 @author Gustavo Lima Chaves <glima@@profusion.mobi>
288 @author Samsung Electronics <tbd>
289 @author Samsung SAIT <tbd>
290 @author Sung W. Park <sungwoo@@gmail.com>
291 @author Jiyoun Park <jy0703.park@@samsung.com>
292 @author Myoungwoon Roy Kim(roy_kim) <myoungwoon.kim@@samsung.com> <myoungwoon@@gmail.com>
293 @author Thierry el Borgi <thierry@@substantiel.fr>
294 @author ChunEon Park <hermet@@hermet.pe.kr>
295
296 Please contact <enlightenment-devel@lists.sourceforge.net> to get in
297 contact with the developers and maintainers.
298 */
299
300 #ifndef _EVAS_H
301 #define _EVAS_H
302
303 #include <time.h>
304
305 #include <Eina.h>
306
307 #ifdef EAPI
308 # undef EAPI
309 #endif
310
311 #ifdef _WIN32
312 # ifdef EFL_EVAS_BUILD
313 #  ifdef DLL_EXPORT
314 #   define EAPI __declspec(dllexport)
315 #  else
316 #   define EAPI
317 #  endif /* ! DLL_EXPORT */
318 # else
319 #  define EAPI __declspec(dllimport)
320 # endif /* ! EFL_EVAS_BUILD */
321 #else
322 # ifdef __GNUC__
323 #  if __GNUC__ >= 4
324 #   define EAPI __attribute__ ((visibility("default")))
325 #  else
326 #   define EAPI
327 #  endif
328 # else
329 #  define EAPI
330 # endif
331 #endif /* ! _WIN32 */
332
333 #ifdef __cplusplus
334 extern "C" {
335 #endif
336
337 #define EVAS_VERSION_MAJOR 1
338 #define EVAS_VERSION_MINOR 0
339
340 typedef struct _Evas_Version
341 {
342    int major;
343    int minor;
344    int micro;
345    int revision;
346 } Evas_Version;
347
348 EAPI extern Evas_Version *evas_version;
349
350 /**
351  * @file
352  * @brief These routines are used for Evas library interaction.
353  *
354  * @todo check boolean return values and convert to Eina_Bool
355  * @todo change all api to use EINA_SAFETY_*
356  * @todo finish api documentation
357  */
358
359 /* BiDi exposed stuff */
360    /*FIXME: document */
361 typedef enum _Evas_BiDi_Direction
362 {
363    EVAS_BIDI_DIRECTION_NATURAL,
364    EVAS_BIDI_DIRECTION_NEUTRAL = EVAS_BIDI_DIRECTION_NATURAL,
365    EVAS_BIDI_DIRECTION_LTR,
366    EVAS_BIDI_DIRECTION_RTL
367 } Evas_BiDi_Direction;
368
369 /**
370  * Identifier of callbacks to be set for Evas canvases or Evas
371  * objects.
372  *
373  * The following figure illustrates some Evas callbacks:
374  * @image html evas-callbacks.png
375  * @image rtf evas-callbacks.png
376  * @image latex evas-callbacks.eps
377  *
378  * @see evas_object_event_callback_add()
379  * @see evas_event_callback_add()
380  */
381 typedef enum _Evas_Callback_Type
382 {
383    /*
384     * The following events are only for use with Evas objects, with
385     * evas_object_event_callback_add():
386     */
387    EVAS_CALLBACK_MOUSE_IN, /**< Mouse In Event */
388    EVAS_CALLBACK_MOUSE_OUT, /**< Mouse Out Event */
389    EVAS_CALLBACK_MOUSE_DOWN, /**< Mouse Button Down Event */
390    EVAS_CALLBACK_MOUSE_UP, /**< Mouse Button Up Event */
391    EVAS_CALLBACK_MOUSE_MOVE, /**< Mouse Move Event */
392    EVAS_CALLBACK_MOUSE_WHEEL, /**< Mouse Wheel Event */
393    EVAS_CALLBACK_MULTI_DOWN, /**< Multi-touch Down Event */
394    EVAS_CALLBACK_MULTI_UP, /**< Multi-touch Up Event */
395    EVAS_CALLBACK_MULTI_MOVE, /**< Multi-touch Move Event */
396    EVAS_CALLBACK_FREE, /**< Object Being Freed (Called after Del) */
397    EVAS_CALLBACK_KEY_DOWN, /**< Key Press Event */
398    EVAS_CALLBACK_KEY_UP, /**< Key Release Event */
399    EVAS_CALLBACK_FOCUS_IN, /**< Focus In Event */
400    EVAS_CALLBACK_FOCUS_OUT, /**< Focus Out Event */
401    EVAS_CALLBACK_SHOW, /**< Show Event */
402    EVAS_CALLBACK_HIDE, /**< Hide Event */
403    EVAS_CALLBACK_MOVE, /**< Move Event */
404    EVAS_CALLBACK_RESIZE, /**< Resize Event */
405    EVAS_CALLBACK_RESTACK, /**< Restack Event */
406    EVAS_CALLBACK_DEL, /**< Object Being Deleted (called before Free) */
407    EVAS_CALLBACK_HOLD, /**< Events go on/off hold */
408    EVAS_CALLBACK_CHANGED_SIZE_HINTS, /**< Size hints changed event */
409    EVAS_CALLBACK_IMAGE_PRELOADED, /**< Image has been preloaded */
410
411    /*
412     * The following events are only for use with Evas canvases, with
413     * evas_event_callback_add():
414     */
415    EVAS_CALLBACK_CANVAS_FOCUS_IN, /**< Canvas got focus as a whole */
416    EVAS_CALLBACK_CANVAS_FOCUS_OUT, /**< Canvas lost focus as a whole */
417    EVAS_CALLBACK_RENDER_FLUSH_PRE, /**< Called just before rendering is updated on the canvas target */
418    EVAS_CALLBACK_RENDER_FLUSH_POST, /**< Called just after rendering is updated on the canvas target */
419    EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_IN, /**< Canvas object got focus */
420    EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_OUT, /**< Canvas object lost focus */
421
422    /*
423     * More Evas object event types - see evas_object_event_callback_add():
424     */
425    EVAS_CALLBACK_IMAGE_UNLOADED, /**< Image data has been unloaded (by some mechanims in Evas that throw out original image data) */
426
427    EVAS_CALLBACK_LAST /**< kept as last element/sentinel -- not really an event */
428 } Evas_Callback_Type; /**< The types of events triggering a callback */
429
430 /**
431  * Flags for Mouse Button events
432  */
433 typedef enum _Evas_Button_Flags
434 {
435    EVAS_BUTTON_NONE = 0, /**< No extra mouse button data */
436    EVAS_BUTTON_DOUBLE_CLICK = (1 << 0), /**< This mouse button press was the 2nd press of a double click */
437    EVAS_BUTTON_TRIPLE_CLICK = (1 << 1) /**< This mouse button press was the 3rd press of a triple click */
438 } Evas_Button_Flags; /**< Flags for Mouse Button events */
439
440 /**
441  * Flags for Events
442  */
443 typedef enum _Evas_Event_Flags
444 {
445    EVAS_EVENT_FLAG_NONE = 0, /**< No fancy flags set */
446    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 */
447    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 */
448 } Evas_Event_Flags; /**< Flags for Events */
449
450 /**
451  * Flags for Font Hinting
452  * @ingroup Evas_Font_Group
453  */
454 typedef enum _Evas_Font_Hinting_Flags
455 {
456    EVAS_FONT_HINTING_NONE, /**< No font hinting */
457    EVAS_FONT_HINTING_AUTO, /**< Automatic font hinting */
458    EVAS_FONT_HINTING_BYTECODE /**< Bytecode font hinting */
459 } Evas_Font_Hinting_Flags; /**< Flags for Font Hinting */
460
461 /**
462  * Colorspaces for pixel data supported by Evas
463  * @ingroup Evas_Object_Image
464  */
465 typedef enum _Evas_Colorspace
466 {
467    EVAS_COLORSPACE_ARGB8888, /**< ARGB 32 bits per pixel, high-byte is Alpha, accessed 1 32bit word at a time */
468      /* these are not currently supported - but planned for the future */
469    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 */
470    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 */
471    EVAS_COLORSPACE_RGB565_A5P, /**< 16bit rgb565 + Alpha plane at end - 5 bits of the 8 being used per alpha byte */
472    EVAS_COLORSPACE_GRY8, /**< 8bit grayscale */
473    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 */
474 } Evas_Colorspace; /**< Colorspaces for pixel data supported by Evas */
475
476 /**
477  * How to pack items into cells in a table.
478  * @ingroup Evas_Object_Table
479  *
480  * @see evas_object_table_homogeneous_set() for an explanation of the funcion of
481  * each one.
482  */
483 typedef enum _Evas_Object_Table_Homogeneous_Mode
484 {
485   EVAS_OBJECT_TABLE_HOMOGENEOUS_NONE = 0,
486   EVAS_OBJECT_TABLE_HOMOGENEOUS_TABLE = 1,
487   EVAS_OBJECT_TABLE_HOMOGENEOUS_ITEM = 2
488 } Evas_Object_Table_Homogeneous_Mode; /**< Table cell pack mode. */
489
490 typedef struct _Evas_Coord_Rectangle  Evas_Coord_Rectangle; /**< A generic rectangle handle */
491 typedef struct _Evas_Point                   Evas_Point; /**< integer point */
492
493 typedef struct _Evas_Coord_Point             Evas_Coord_Point;  /**< Evas_Coord point */
494 typedef struct _Evas_Coord_Precision_Point   Evas_Coord_Precision_Point; /**< Evas_Coord point with sub-pixel precision */
495
496 typedef struct _Evas_Position                Evas_Position; /**< associates given point in Canvas and Output */
497 typedef struct _Evas_Precision_Position      Evas_Precision_Position; /**< associates given point in Canvas and Output, with sub-pixel precision */
498
499 /**
500  * @typedef Evas_Smart_Class
501  *
502  * A smart object's @b base class definition
503  *
504  * @ingroup Evas_Smart_Group
505  */
506 typedef struct _Evas_Smart_Class             Evas_Smart_Class;
507
508 /**
509  * @typedef Evas_Smart_Cb_Description
510  *
511  * A smart object callback description, used to provide introspection
512  *
513  * @ingroup Evas_Smart_Group
514  */
515 typedef struct _Evas_Smart_Cb_Description    Evas_Smart_Cb_Description;
516
517 /**
518  * @typedef Evas_Map
519  *
520  * An opaque handle to map points
521  *
522  * @see evas_map_new()
523  * @see evas_map_free()
524  * @see evas_map_dup()
525  *
526  * @ingroup Evas_Object_Group_Map
527  */
528 typedef struct _Evas_Map            Evas_Map;
529
530 /**
531  * @typedef Evas
532  *
533  * An opaque handle to an Evas canvas.
534  *
535  * @see evas_new()
536  * @see evas_free()
537  *
538  * @ingroup Evas_Canvas
539  */
540 typedef struct _Evas                Evas;
541
542 /**
543  * @typedef Evas_Object
544  * An Evas Object handle.
545  * @ingroup Evas_Object_Group
546  */
547 typedef struct _Evas_Object         Evas_Object;
548
549 typedef void                        Evas_Performance; /**< An Evas Performance handle */
550 typedef struct _Evas_Modifier       Evas_Modifier; /**< An opaque type containing information on which modifier keys are registered in an Evas canvas */
551 typedef struct _Evas_Lock           Evas_Lock; /**< An opaque type containing information on which lock keys are registered in an Evas canvas */
552 typedef struct _Evas_Smart          Evas_Smart; /**< An Evas Smart Object handle */
553 typedef struct _Evas_Native_Surface Evas_Native_Surface; /**< A generic datatype for engine specific native surface information */
554 typedef unsigned long long          Evas_Modifier_Mask; /**< An Evas modifier mask type */
555
556 typedef int                         Evas_Coord;
557 typedef int                         Evas_Font_Size;
558 typedef int                         Evas_Angle;
559
560 struct _Evas_Coord_Rectangle /**< A rectangle in Evas_Coord */
561 {
562    Evas_Coord x; /**< top-left x co-ordinate of rectangle */
563    Evas_Coord y; /**< top-left y co-ordinate of rectangle */
564    Evas_Coord w; /**< width of rectangle */
565    Evas_Coord h; /**< height of rectangle */
566 };
567
568 struct _Evas_Point
569 {
570    int x, y;
571 };
572
573 struct _Evas_Coord_Point
574 {
575    Evas_Coord x, y;
576 };
577
578 struct _Evas_Coord_Precision_Point
579 {
580    Evas_Coord x, y;
581    double xsub, ysub;
582 };
583
584 struct _Evas_Position
585 {
586     Evas_Point output;
587     Evas_Coord_Point canvas;
588 };
589
590 struct _Evas_Precision_Position
591 {
592     Evas_Point output;
593     Evas_Coord_Precision_Point canvas;
594 };
595
596 typedef enum _Evas_Aspect_Control
597 {
598    EVAS_ASPECT_CONTROL_NONE = 0, /**< Preference on scaling unset */
599    EVAS_ASPECT_CONTROL_NEITHER = 1, /**< Same effect as unset preference on scaling */
600    EVAS_ASPECT_CONTROL_HORIZONTAL = 2, /**< Use all horizontal container space to place an object, using the given aspect */
601    EVAS_ASPECT_CONTROL_VERTICAL = 3, /**< Use all vertical container space to place an object, using the given aspect */
602    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 */
603 } Evas_Aspect_Control; /**< Aspect types/policies for scaling size hints, used for evas_object_size_hint_aspect_set() */
604
605 typedef struct _Evas_Pixel_Import_Source Evas_Pixel_Import_Source; /**< A source description of pixels for importing pixels */
606 typedef struct _Evas_Engine_Info      Evas_Engine_Info; /**< A generic Evas Engine information structure */
607 typedef struct _Evas_Device           Evas_Device; /**< A source device handle - where the event came from */
608 typedef struct _Evas_Event_Mouse_Down Evas_Event_Mouse_Down; /**< Event structure for #EVAS_CALLBACK_MOUSE_DOWN event callbacks */
609 typedef struct _Evas_Event_Mouse_Up   Evas_Event_Mouse_Up; /**< Event structure for #EVAS_CALLBACK_MOUSE_UP event callbacks */
610 typedef struct _Evas_Event_Mouse_In   Evas_Event_Mouse_In; /**< Event structure for #EVAS_CALLBACK_MOUSE_IN event callbacks */
611 typedef struct _Evas_Event_Mouse_Out  Evas_Event_Mouse_Out; /**< Event structure for #EVAS_CALLBACK_MOUSE_OUT event callbacks */
612 typedef struct _Evas_Event_Mouse_Move Evas_Event_Mouse_Move; /**< Event structure for #EVAS_CALLBACK_MOUSE_MOVE event callbacks */
613 typedef struct _Evas_Event_Mouse_Wheel Evas_Event_Mouse_Wheel; /**< Event structure for #EVAS_CALLBACK_MOUSE_WHEEL event callbacks */
614 typedef struct _Evas_Event_Multi_Down Evas_Event_Multi_Down; /**< Event structure for #EVAS_CALLBACK_MULTI_DOWN event callbacks */
615 typedef struct _Evas_Event_Multi_Up   Evas_Event_Multi_Up; /**< Event structure for #EVAS_CALLBACK_MULTI_UP event callbacks */
616 typedef struct _Evas_Event_Multi_Move Evas_Event_Multi_Move; /**< Event structure for #EVAS_CALLBACK_MULTI_MOVE event callbacks */
617 typedef struct _Evas_Event_Key_Down   Evas_Event_Key_Down; /**< Event structure for #EVAS_CALLBACK_KEY_DOWN event callbacks */
618 typedef struct _Evas_Event_Key_Up     Evas_Event_Key_Up; /**< Event structure for #EVAS_CALLBACK_KEY_UP event callbacks */
619 typedef struct _Evas_Event_Hold       Evas_Event_Hold; /**< Event structure for #EVAS_CALLBACK_HOLD event callbacks */
620
621 typedef enum _Evas_Load_Error
622 {
623    EVAS_LOAD_ERROR_NONE = 0, /**< No error on load */
624    EVAS_LOAD_ERROR_GENERIC = 1, /**< A non-specific error occurred */
625    EVAS_LOAD_ERROR_DOES_NOT_EXIST = 2, /**< File (or file path) does not exist */
626    EVAS_LOAD_ERROR_PERMISSION_DENIED = 3, /**< Permission deinied to an existing file (or path) */
627    EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED = 4, /**< Allocation of resources failure prevented load */
628    EVAS_LOAD_ERROR_CORRUPT_FILE = 5, /**< File corrupt (but was detected as a known format) */
629    EVAS_LOAD_ERROR_UNKNOWN_FORMAT = 6 /**< File is not a known format */
630 } Evas_Load_Error; /**< Evas image load error codes one can get - see evas_load_error_str() too. */
631
632
633 typedef enum _Evas_Alloc_Error
634 {
635    EVAS_ALLOC_ERROR_NONE = 0, /**< No allocation error */
636    EVAS_ALLOC_ERROR_FATAL = 1, /**< Allocation failed despite attempts to free up memory */
637    EVAS_ALLOC_ERROR_RECOVERED = 2 /**< Allocation succeeded, but extra memory had to be found by freeing up speculative resources */
638 } Evas_Alloc_Error; /**< Possible allocation errors returned by evas_alloc_error() */
639
640 typedef enum _Evas_Fill_Spread
641 {
642    EVAS_TEXTURE_REFLECT = 0, /**< image fill tiling mode - tiling reflects */
643    EVAS_TEXTURE_REPEAT = 1, /**< tiling repeats */
644    EVAS_TEXTURE_RESTRICT = 2, /**< tiling clamps - range offset ignored */
645    EVAS_TEXTURE_RESTRICT_REFLECT = 3, /**< tiling clamps and any range offset reflects */
646    EVAS_TEXTURE_RESTRICT_REPEAT = 4, /**< tiling clamps and any range offset repeats */
647    EVAS_TEXTURE_PAD = 5 /**< tiling extends with end values */
648 } Evas_Fill_Spread; /**< Fill types used for evas_object_image_fill_spread_set() */
649
650 typedef enum _Evas_Pixel_Import_Pixel_Format
651 {
652    EVAS_PIXEL_FORMAT_NONE = 0, /**< No pixel format */
653    EVAS_PIXEL_FORMAT_ARGB32 = 1, /**< ARGB 32bit pixel format with A in the high byte per 32bit pixel word */
654    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 */
655 } Evas_Pixel_Import_Pixel_Format; /**< Pixel format for import call. See evas_object_image_pixels_import() */
656
657 struct _Evas_Pixel_Import_Source
658 {
659    Evas_Pixel_Import_Pixel_Format format; /**< pixel format type ie ARGB32, YUV420P_601 etc. */
660    int w, h; /**< width and height of source in pixels */
661    void **rows; /**< an array of pointers (size depends on format) pointing to left edge of each scanline */
662 };
663
664 /* magic version number to know what the native surf struct looks like */
665 #define EVAS_NATIVE_SURFACE_VERSION 2
666
667 typedef enum _Evas_Native_Surface_Type
668 {
669    EVAS_NATIVE_SURFACE_NONE,
670    EVAS_NATIVE_SURFACE_X11,
671    EVAS_NATIVE_SURFACE_OPENGL
672 } Evas_Native_Surface_Type;
673
674 struct _Evas_Native_Surface
675 {
676    int                         version;
677    Evas_Native_Surface_Type    type;
678    union {
679      struct {
680        void          *visual; /**< visual of the pixmap to use (Visual) */
681        unsigned long  pixmap; /**< pixmap id to use (Pixmap) */
682      } x11;
683      struct {
684        unsigned int   texture_id; /**< opengl texture id to use from glGenTextures() */
685        unsigned int   framebuffer_id; /**< 0 if not a FBO, FBO id otherwise from glGenFramebuffers() */
686        unsigned int   internal_format; /**< same as 'internalFormat' for glTexImage2D() */
687        unsigned int   format; /**< same as 'format' for glTexImage2D() */
688        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) */
689      } opengl;
690    } data;
691 };
692
693 #define EVAS_LAYER_MIN -32768 /**< bottom-most layer number */
694 #define EVAS_LAYER_MAX 32767  /**< top-most layer number */
695
696 #define EVAS_COLOR_SPACE_ARGB 0 /**< Not used for anything */
697 #define EVAS_COLOR_SPACE_AHSV 1 /**< Not used for anything */
698 #define EVAS_TEXT_INVALID -1 /**< Not used for anything */
699 #define EVAS_TEXT_SPECIAL -2 /**< Not used for anything */
700
701 #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() */
702 #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() */
703 #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) */
704 #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) */
705 #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 */
706 #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 */
707
708 /**
709  * How the object should be rendered to output.
710  * @ingroup Evas_Object_Group_Extras
711  */
712 typedef enum _Evas_Render_Op
713 {
714    EVAS_RENDER_BLEND = 0, /**< default op: d = d*(1-sa) + s */
715    EVAS_RENDER_BLEND_REL = 1, /**< d = d*(1 - sa) + s*da */
716    EVAS_RENDER_COPY = 2, /**< d = s */
717    EVAS_RENDER_COPY_REL = 3, /**< d = s*da */
718    EVAS_RENDER_ADD = 4, /**< d = d + s */
719    EVAS_RENDER_ADD_REL = 5, /**< d = d + s*da */
720    EVAS_RENDER_SUB = 6, /**< d = d - s */
721    EVAS_RENDER_SUB_REL = 7, /**< d = d - s*da */
722    EVAS_RENDER_TINT = 8, /**< d = d*s + d*(1 - sa) + s*(1 - da) */
723    EVAS_RENDER_TINT_REL = 9, /**< d = d*(1 - sa + s) */
724    EVAS_RENDER_MASK = 10, /**< d = d*sa */
725    EVAS_RENDER_MUL = 11 /**< d = d*s */
726 } Evas_Render_Op; /**< How the object should be rendered to output. */
727
728 typedef enum _Evas_Border_Fill_Mode
729 {
730    EVAS_BORDER_FILL_NONE = 0, /**< Image's center region is @b not to be rendered */
731    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 */
732    EVAS_BORDER_FILL_SOLID = 2 /**< Image's center region is to be made solid, even if it has transparency on it */
733 } Evas_Border_Fill_Mode; /**< How an image's center region (the complement to the border region) should be rendered by Evas */
734
735 typedef enum _Evas_Image_Scale_Hint
736 {
737    EVAS_IMAGE_SCALE_HINT_NONE = 0, /**< No scale hint at all */
738    EVAS_IMAGE_SCALE_HINT_DYNAMIC = 1, /**< Image is being re-scaled over time, thus turning scaling cache @b off for its data */
739    EVAS_IMAGE_SCALE_HINT_STATIC = 2 /**< Image is not being re-scaled over time, thus turning scaling cache @b on for its data */
740 } Evas_Image_Scale_Hint; /**< How an image's data is to be treated by Evas, with regard to scaling cache */
741
742 typedef enum _Evas_Engine_Render_Mode
743 {
744    EVAS_RENDER_MODE_BLOCKING = 0,
745    EVAS_RENDER_MODE_NONBLOCKING = 1,
746 } Evas_Engine_Render_Mode;
747
748 typedef enum _Evas_Image_Content_Hint
749 {
750    EVAS_IMAGE_CONTENT_HINT_NONE = 0, /**< No hint at all */
751    EVAS_IMAGE_CONTENT_HINT_DYNAMIC = 1, /**< The contents will change over time */
752    EVAS_IMAGE_CONTENT_HINT_STATIC = 2 /**< The contents won't change over time */
753 } Evas_Image_Content_Hint; /**< How an image's data is to be treated by Evas, for optimization */
754
755 struct _Evas_Engine_Info /** Generic engine information. Generic info is useless */
756 {
757    int magic; /**< Magic number */
758 };
759
760 struct _Evas_Event_Mouse_Down /** Mouse button press event */
761 {
762    int button; /**< Mouse button number that went down (1 - 32) */
763
764    Evas_Point output;
765    Evas_Coord_Point canvas;
766
767    void          *data;
768    Evas_Modifier *modifiers;
769    Evas_Lock     *locks;
770
771    Evas_Button_Flags flags;
772    unsigned int      timestamp;
773    Evas_Event_Flags  event_flags;
774    Evas_Device      *dev;
775 };
776
777 struct _Evas_Event_Mouse_Up /** Mouse button release event */
778 {
779    int button; /**< Mouse button number that was raised (1 - 32) */
780
781    Evas_Point output;
782    Evas_Coord_Point canvas;
783
784    void          *data;
785    Evas_Modifier *modifiers;
786    Evas_Lock     *locks;
787
788    Evas_Button_Flags flags;
789    unsigned int      timestamp;
790    Evas_Event_Flags  event_flags;
791    Evas_Device      *dev;
792 };
793
794 struct _Evas_Event_Mouse_In /** Mouse enter event */
795 {
796    int buttons; /**< Button pressed mask, Bits set to 1 are buttons currently pressed (bit 0 = mouse button 1, bit 1 = mouse button 2 etc.) */
797
798    Evas_Point output;
799    Evas_Coord_Point canvas;
800
801    void          *data;
802    Evas_Modifier *modifiers;
803    Evas_Lock     *locks;
804    unsigned int   timestamp;
805    Evas_Event_Flags  event_flags;
806    Evas_Device      *dev;
807 };
808
809 struct _Evas_Event_Mouse_Out /** Mouse leave event */
810 {
811    int buttons; /**< Button pressed mask, Bits set to 1 are buttons currently pressed (bit 0 = mouse button 1, bit 1 = mouse button 2 etc.) */
812
813
814    Evas_Point output;
815    Evas_Coord_Point canvas;
816
817    void          *data;
818    Evas_Modifier *modifiers;
819    Evas_Lock     *locks;
820    unsigned int   timestamp;
821    Evas_Event_Flags  event_flags;
822    Evas_Device      *dev;
823 };
824
825 struct _Evas_Event_Mouse_Move /** Mouse button down event */
826 {
827    int buttons; /**< Button pressed mask, Bits set to 1 are buttons currently pressed (bit 0 = mouse button 1, bit 1 = mouse button 2 etc.) */
828
829    Evas_Position cur, prev;
830
831    void          *data;
832    Evas_Modifier *modifiers;
833    Evas_Lock     *locks;
834    unsigned int   timestamp;
835    Evas_Event_Flags  event_flags;
836    Evas_Device      *dev;
837 };
838
839 struct _Evas_Event_Mouse_Wheel /** Wheel event */
840 {
841    int direction; /* 0 = default up/down wheel FIXME: more wheel types */
842    int z; /* ...,-2,-1 = down, 1,2,... = up */
843
844    Evas_Point output;
845    Evas_Coord_Point canvas;
846
847    void          *data;
848    Evas_Modifier *modifiers;
849    Evas_Lock     *locks;
850    unsigned int   timestamp;
851    Evas_Event_Flags  event_flags;
852    Evas_Device      *dev;
853 };
854
855 struct _Evas_Event_Multi_Down /** Multi button press event */
856 {
857    int device; /**< Multi device number that went down (1 or more for extra touches) */
858    double radius, radius_x, radius_y;
859    double pressure, angle;
860
861    Evas_Point output;
862    Evas_Coord_Precision_Point canvas;
863
864    void          *data;
865    Evas_Modifier *modifiers;
866    Evas_Lock     *locks;
867
868    Evas_Button_Flags flags;
869    unsigned int      timestamp;
870    Evas_Event_Flags  event_flags;
871    Evas_Device      *dev;
872 };
873
874 struct _Evas_Event_Multi_Up /** Multi button release event */
875 {
876    int device; /**< Multi device number that went up (1 or more for extra touches) */
877    double radius, radius_x, radius_y;
878    double pressure, angle;
879
880    Evas_Point output;
881    Evas_Coord_Precision_Point canvas;
882
883    void          *data;
884    Evas_Modifier *modifiers;
885    Evas_Lock     *locks;
886
887    Evas_Button_Flags flags;
888    unsigned int      timestamp;
889    Evas_Event_Flags  event_flags;
890    Evas_Device      *dev;
891 };
892
893 struct _Evas_Event_Multi_Move /** Multi button down event */
894 {
895    int device; /**< Multi device number that moved (1 or more for extra touches) */
896    double radius, radius_x, radius_y;
897    double pressure, angle;
898
899    Evas_Precision_Position cur;
900
901    void          *data;
902    Evas_Modifier *modifiers;
903    Evas_Lock     *locks;
904    unsigned int   timestamp;
905    Evas_Event_Flags  event_flags;
906    Evas_Device      *dev;
907 };
908
909 struct _Evas_Event_Key_Down /** Key press event */
910 {
911    char          *keyname; /**< the name string of the key pressed */
912    void          *data;
913    Evas_Modifier *modifiers;
914    Evas_Lock     *locks;
915
916    const char    *key; /**< The logical key : (eg shift+1 == exclamation) */
917    const char    *string; /**< A UTF8 string if this keystroke has produced a visible string to be ADDED */
918    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 */
919    unsigned int   timestamp;
920    Evas_Event_Flags  event_flags;
921    Evas_Device      *dev;
922 };
923
924 struct _Evas_Event_Key_Up /** Key release event */
925 {
926    char          *keyname; /**< the name string of the key released */
927    void          *data;
928    Evas_Modifier *modifiers;
929    Evas_Lock     *locks;
930
931    const char    *key; /**< The logical key : (eg shift+1 == exclamation) */
932    const char    *string; /**< A UTF8 string if this keystroke has produced a visible string to be ADDED */
933    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 */
934    unsigned int   timestamp;
935    Evas_Event_Flags  event_flags;
936    Evas_Device      *dev;
937 };
938
939 struct _Evas_Event_Hold /** Hold change event */
940 {
941    int            hold; /**< The hold flag */
942    void          *data;
943
944    unsigned int   timestamp;
945    Evas_Event_Flags  event_flags;
946    Evas_Device      *dev;
947 };
948
949 /**
950  * How the mouse pointer should be handled by Evas.
951  *
952  * In the mode #EVAS_OBJECT_POINTER_MODE_AUTOGRAB, when a mouse button
953  * is pressed down over an object and held, with the mouse pointer
954  * being moved outside of it, the pointer still behaves as being bound
955  * to that object, albeit out of its drawing region. When the button
956  * is released, the event will be fed to the object, that may check if
957  * the final position is over it or not and do something about it.
958  *
959  * In the mode #EVAS_OBJECT_POINTER_MODE_NOGRAB, the pointer will
960  * always be bound to the object right below it.
961  *
962  * @ingroup Evas_Object_Group_Extras
963  */
964 typedef enum _Evas_Object_Pointer_Mode
965 {
966    EVAS_OBJECT_POINTER_MODE_AUTOGRAB, /**< default, X11-like */
967    EVAS_OBJECT_POINTER_MODE_NOGRAB /**< pointer always bound to the object right below it */
968 } Evas_Object_Pointer_Mode; /**< How the mouse pointer should be handled by Evas. */
969
970 typedef void      (*Evas_Smart_Cb) (void *data, Evas_Object *obj, void *event_info); /**< Evas smart objects' "smart callback" function signature */
971 typedef void      (*Evas_Event_Cb) (void *data, Evas *e, void *event_info); /**< Evas event callback function signature */
972 typedef Eina_Bool (*Evas_Object_Event_Post_Cb) (void *data, Evas *e);
973 typedef void      (*Evas_Object_Event_Cb) (void *data, Evas *e, Evas_Object *obj, void *event_info); /**< Evas object event callback function signature */
974 typedef void      (*Evas_Async_Events_Put_Cb)(void *target, Evas_Callback_Type type, void *event_info);
975
976 /**
977  * @defgroup Evas_Group Top Level Functions
978  *
979  * Functions that affect Evas as a whole.
980  */
981
982 /**
983  * Initialize Evas
984  *
985  * @return The init counter value.
986  *
987  * This function initializes Evas and increments a counter of the
988  * number of calls to it. It returs the new counter's value.
989  *
990  * @see evas_shutdown().
991  *
992  * Most EFL users wouldn't be using this function directly, because
993  * they wouldn't access Evas directly by themselves. Instead, they
994  * would be using higher level helpers, like @c ecore_evas_init().
995  * See http://docs.enlightenment.org/auto/ecore/.
996  *
997  * You should be using this if your use is something like the
998  * following. The buffer engine is just one of the many ones Evas
999  * provides.
1000  *
1001  * @dontinclude evas-buffer-simple.c
1002  * @skip int main
1003  * @until return -1;
1004  * And being the canvas creation something like:
1005  * @skip static Evas *create_canvas
1006  * @until    evas_output_viewport_set(canvas,
1007  *
1008  * Note that this is code creating an Evas canvas with no usage of
1009  * Ecore helpers at all -- no linkage with Ecore on this scenario,
1010  * thus. Again, this wouldn't be on Evas common usage for most
1011  * developers. See the full @ref Example_Evas_Buffer_Simple "example".
1012  *
1013  * @ingroup Evas_Group
1014  */
1015 EAPI int               evas_init                         (void);
1016
1017 /**
1018  * Shutdown Evas
1019  *
1020  * @return Evas' init counter value.
1021  *
1022  * This function finalizes Evas, decrementing the counter of the
1023  * number of calls to the function evas_init(). This new value for the
1024  * counter is returned.
1025  *
1026  * @see evas_init().
1027  *
1028  * If you were the sole user of Evas, by means of evas_init(), you can
1029  * check if it's being properly shut down by expecting a return value
1030  * of 0.
1031  *
1032  * Example code follows.
1033  * @dontinclude evas-buffer-simple.c
1034  * @skip // NOTE: use ecore_evas_buffer_new
1035  * @until evas_shutdown
1036  * Where that function would contain:
1037  * @skip   evas_free(canvas)
1038  * @until   evas_free(canvas)
1039  *
1040  * Most users would be using ecore_evas_shutdown() instead, like told
1041  * in evas_init(). See the full @ref Example_Evas_Buffer_Simple
1042  * "example".
1043  *
1044  * @ingroup Evas_Group
1045  */
1046 EAPI int               evas_shutdown                     (void);
1047
1048
1049 /**
1050  * Return if any allocation errors have occurred during the prior function
1051  * @return The allocation error flag
1052  *
1053  * This function will return if any memory allocation errors occurred during,
1054  * and what kind they were. The return value will be one of
1055  * EVAS_ALLOC_ERROR_NONE, EVAS_ALLOC_ERROR_FATAL or EVAS_ALLOC_ERROR_RECOVERED
1056  * with each meaning something different.
1057  *
1058  * EVAS_ALLOC_ERROR_NONE means that no errors occurred at all and the function
1059  * worked as expected.
1060  *
1061  * EVAS_ALLOC_ERROR_FATAL means the function was completely unable to perform
1062  * its job and will  have  exited as cleanly as possible. The programmer
1063  * should consider this as a sign of very low memory and should try and safely
1064  * recover from the prior functions failure (or try free up memory elsewhere
1065  * and try again after more memory is freed).
1066  *
1067  * EVAS_ALLOC_ERROR_RECOVERED means that an allocation error occurred, but was
1068  * recovered from by evas finding memory of its own it has allocated and
1069  * freeing what it sees as not really usefully allocated memory. What is freed
1070  * may vary. Evas may reduce the resolution of images, free cached images or
1071  * fonts, trhow out pre-rendered data, reduce the complexity of change lists
1072  * etc. Evas and the program will function as per normal after this, but this
1073  * is a sign of low memory, and it is suggested that the program try and
1074  * identify memory it doesn't need, and free it.
1075  *
1076  * Example:
1077  * @code
1078  * extern Evas_Object *object;
1079  * void callback (void *data, Evas *e, Evas_Object *obj, void *event_info);
1080  *
1081  * evas_object_event_callback_add(object, EVAS_CALLBACK_MOUSE_DOWN, callback, NULL);
1082  * if (evas_alloc_error() == EVAS_ALLOC_ERROR_FATAL)
1083  *   {
1084  *     fprintf(stderr, "ERROR: Completely unable to attach callback. Must\n");
1085  *     fprintf(stderr, "       destroy object now as it cannot be used.\n");
1086  *     evas_object_del(object);
1087  *     object = NULL;
1088  *     fprintf(stderr, "WARNING: Memory is really low. Cleaning out RAM.\n");
1089  *     my_memory_cleanup();
1090  *   }
1091  * if (evas_alloc_error() == EVAS_ALLOC_ERROR_RECOVERED)
1092  *   {
1093  *     fprintf(stderr, "WARNING: Memory is really low. Cleaning out RAM.\n");
1094  *     my_memory_cleanup();
1095  *   }
1096  * @endcode
1097  *
1098  * @ingroup Evas_Group
1099  */
1100 EAPI Evas_Alloc_Error  evas_alloc_error                  (void);
1101
1102
1103 /**
1104  * @brief Get evas' internal asynchronous events read file descriptor.
1105  *
1106  * @return The canvas' asynchronous events read file descriptor.
1107  *
1108  * Evas' asynchronous events are meant to be dealt with internally,
1109  * i. e., when building stuff to be glued together into the EFL
1110  * infrastructure -- a module, for example. The context which demands
1111  * its use is when calculations need to be done out of the main
1112  * thread, asynchronously, and some action must be performed after
1113  * that.
1114  *
1115  * An example of actual use of this API is for image asynchronous
1116  * preload inside evas. If the canvas was instantiated through
1117  * ecore-evas usage, ecore itself will take care of calling those
1118  * events' processing.
1119  *
1120  * This function returns the read file descriptor where to get the
1121  * asynchronous events of the canvas. Naturally, other mainloops,
1122  * apart from ecore, may make use of it.
1123  *
1124  * @ingroup Evas_Group
1125  */
1126 EAPI int               evas_async_events_fd_get          (void) EINA_WARN_UNUSED_RESULT EINA_PURE;
1127
1128 /**
1129  * @brief Trigger the processing of all events waiting on the file
1130  * descriptor returned by evas_async_events_fd_get().
1131  *
1132  * @return The number of events processed.
1133  *
1134  * All asynchronous events queued up by evas_async_events_put() are
1135  * processed here. More precisely, the callback functions, informed
1136  * together with other event parameters, when queued, get called (with
1137  * those parameters), in that order.
1138  *
1139  * @ingroup Evas_Group
1140  */
1141 EAPI int               evas_async_events_process         (void);
1142
1143 /**
1144 * Insert asynchronous events on the canvas.
1145  *
1146  * @param target The target to be affected by the events.
1147  * @param type The type of callback function.
1148  * @param event_info Information about the event.
1149  * @param func The callback function pointer.
1150  *
1151  * This is the way, for a routine running outside evas' main thread,
1152  * to report an asynchronous event. A callback function is informed,
1153  * whose call is to happen after evas_async_events_process() is
1154  * called.
1155  *
1156  * @ingroup Evas_Group
1157  */
1158 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);
1159
1160 /**
1161  * @defgroup Evas_Canvas Canvas Functions
1162  *
1163  * Low level Evas canvas functions. Sub groups will present more high
1164  * level ones, though.
1165  *
1166  * Most of these functions deal with low level Evas actions, like:
1167  * @li create/destroy raw canvases, not bound to any displaying engine
1168  * @li tell a canvas i got focused (in a windowing context, for example)
1169  * @li tell a canvas a region should not be calculated anymore in rendering
1170  * @li tell a canvas to render its contents, immediately
1171  *
1172  * Most users will be using Evas by means of the @c Ecore_Evas
1173  * wrapper, which deals with all the above mentioned issues
1174  * automatically for them. Thus, you'll be looking at this section
1175  * only if you're building low level stuff.
1176  *
1177  * The groups within present you functions that deal with the canvas
1178  * directly, too, and not yet with its @b objects. They are the
1179  * functions you need to use at a minimum to get a working canvas.
1180  *
1181  * Some of the funcions in this group are exemplified @ref
1182  * Example_Evas_Events "here".
1183  */
1184
1185 /**
1186  * Creates a new empty evas.
1187  *
1188  * Note that before you can use the evas, you will to at a minimum:
1189  * @li Set its render method with @ref evas_output_method_set .
1190  * @li Set its viewport size with @ref evas_output_viewport_set .
1191  * @li Set its size of the canvas with @ref evas_output_size_set .
1192  * @li Ensure that the render engine is given the correct settings
1193  *     with @ref evas_engine_info_set .
1194  *
1195  * This function should only fail if the memory allocation fails
1196  *
1197  * @note this function is very low level. Instead of using it
1198  *       directly, consider using the high level functions in
1199  *       Ecore_Evas such as @c ecore_evas_new(). See
1200  *       http://docs.enlightenment.org/auto/ecore/.
1201  *
1202  * @attention it is recommended that one calls evas_init() before
1203  *       creating new canvas.
1204  *
1205  * @return A new uninitialised Evas canvas on success.  Otherwise, @c
1206  * NULL.
1207  * @ingroup Evas_Canvas
1208  */
1209 EAPI Evas             *evas_new                          (void) EINA_WARN_UNUSED_RESULT EINA_MALLOC;
1210
1211 /**
1212  * Frees the given evas and any objects created on it.
1213  *
1214  * Any objects with 'free' callbacks will have those callbacks called
1215  * in this function.
1216  *
1217  * @param   e The given evas.
1218  *
1219  * @ingroup Evas_Canvas
1220  */
1221 EAPI void              evas_free                         (Evas *e)  EINA_ARG_NONNULL(1);
1222
1223 /**
1224  * Inform to the evas that it got the focus.
1225  *
1226  * @param e The evas to change information.
1227  * @ingroup Evas_Canvas
1228  */
1229 EAPI void              evas_focus_in                     (Evas *e);
1230
1231 /**
1232  * Inform to the evas that it lost the focus.
1233  *
1234  * @param e The evas to change information.
1235  * @ingroup Evas_Canvas
1236  */
1237 EAPI void              evas_focus_out                    (Evas *e);
1238
1239 /**
1240  * Get the focus state known by the given evas
1241  *
1242  * @param e The evas to query information.
1243  * @ingroup Evas_Canvas
1244  */
1245 EAPI Eina_Bool         evas_focus_state_get              (const Evas *e) EINA_PURE;
1246
1247 /**
1248  * Push the nochange flag up 1
1249  *
1250  * This tells evas, that while the nochange flag is greater than 0, do not
1251  * mark objects as "changed" when making changes.
1252  *
1253  * @param e The evas to change information.
1254  * @ingroup Evas_Canvas
1255  */
1256 EAPI void              evas_nochange_push                (Evas *e);
1257
1258 /**
1259  * Pop the nochange flag down 1
1260  *
1261  * This tells evas, that while the nochange flag is greater than 0, do not
1262  * mark objects as "changed" when making changes.
1263  *
1264  * @param e The evas to change information.
1265  * @ingroup Evas_Canvas
1266  */
1267 EAPI void              evas_nochange_pop                 (Evas *e);
1268
1269
1270 /**
1271  * Attaches a specific pointer to the evas for fetching later
1272  *
1273  * @param e The canvas to attach the pointer to
1274  * @param data The pointer to attach
1275  * @ingroup Evas_Canvas
1276  */
1277 EAPI void              evas_data_attach_set              (Evas *e, void *data) EINA_ARG_NONNULL(1);
1278
1279 /**
1280  * Returns the pointer attached by evas_data_attach_set()
1281  *
1282  * @param e The canvas to attach the pointer to
1283  * @return The pointer attached
1284  * @ingroup Evas_Canvas
1285  */
1286 EAPI void             *evas_data_attach_get              (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
1287
1288
1289 /**
1290  * Add a damage rectangle.
1291  *
1292  * @param e The given canvas pointer.
1293  * @param x The rectangle's left position.
1294  * @param y The rectangle's top position.
1295  * @param w The rectangle's width.
1296  * @param h The rectangle's height.
1297  *
1298  * This is the function by which one tells evas that a part of the
1299  * canvas has to be repainted.
1300  *
1301  * @ingroup Evas_Canvas
1302  */
1303 EAPI void              evas_damage_rectangle_add         (Evas *e, int x, int y, int w, int h) EINA_ARG_NONNULL(1);
1304
1305 /**
1306  * Add an "obscured region" to an Evas canvas.
1307  *
1308  * @param e The given canvas pointer.
1309  * @param x The rectangle's top left corner's horizontal coordinate.
1310  * @param y The rectangle's top left corner's vertical coordinate
1311  * @param w The rectangle's width.
1312  * @param h The rectangle's height.
1313  *
1314  * This is the function by which one tells an Evas canvas that a part
1315  * of it <b>must not</b> be repainted. The region must be
1316  * rectangular and its coordinates inside the canvas viewport are
1317  * passed in the call. After this call, the region specified won't
1318  * participate in any form in Evas' calculations and actions during
1319  * its rendering updates, having its displaying content frozen as it
1320  * was just after this function took place.
1321  *
1322  * We call it "obscured region" because the most common use case for
1323  * this rendering (partial) freeze is something else (most problaby
1324  * other canvas) being on top of the specified rectangular region,
1325  * thus shading it completely from the user's final scene in a
1326  * display. To avoid unnecessary processing, one should indicate to the
1327  * obscured canvas not to bother about the non-important area.
1328  *
1329  * The majority of users won't have to worry about this funcion, as
1330  * they'll be using just one canvas in their applications, with
1331  * nothing inset or on top of it in any form.
1332  *
1333  * To make this region one that @b has to be repainted again, call the
1334  * function evas_obscured_clear().
1335  *
1336  * @note This is a <b>very low level function</b>, which most of
1337  * Evas' users wouldn't care about.
1338  *
1339  * @note This function does @b not flag the canvas as having its state
1340  * changed. If you want to re-render it afterwards expecting new
1341  * contents, you have to add "damage" regions yourself (see
1342  * evas_damage_rectangle_add()).
1343  *
1344  * @see evas_obscured_clear()
1345  * @see evas_render_updates()
1346  *
1347  * Example code follows.
1348  * @dontinclude evas-events.c
1349  * @skip add an obscured
1350  * @until evas_obscured_clear(evas);
1351  *
1352  * In that example, pressing the "Ctrl" and "o" keys will impose or
1353  * remove an obscured region in the middle of the canvas. You'll get
1354  * the same contents at the time the key was pressed, if toggling it
1355  * on, until you toggle it off again (make sure the animation is
1356  * running on to get the idea better). See the full @ref
1357  * Example_Evas_Events "example".
1358  *
1359  * @ingroup Evas_Canvas
1360  */
1361 EAPI void              evas_obscured_rectangle_add       (Evas *e, int x, int y, int w, int h) EINA_ARG_NONNULL(1);
1362
1363 /**
1364  * Remove all "obscured regions" from an Evas canvas.
1365  *
1366  * @param e The given canvas pointer.
1367  *
1368  * This function removes all the rectangles from the obscured regions
1369  * list of the canvas @p e. It takes obscured areas added with
1370  * evas_obscured_rectangle_add() and make them again a regions that @b
1371  * have to be repainted on rendering updates.
1372  *
1373  * @note This is a <b>very low level function</b>, which most of
1374  * Evas' users wouldn't care about.
1375  *
1376  * @note This function does @b not flag the canvas as having its state
1377  * changed. If you want to re-render it afterwards expecting new
1378  * contents, you have to add "damage" regions yourself (see
1379  * evas_damage_rectangle_add()).
1380  *
1381  * @see evas_obscured_rectangle_add() for an example
1382  * @see evas_render_updates()
1383  *
1384  * @ingroup Evas_Canvas
1385  */
1386 EAPI void              evas_obscured_clear               (Evas *e) EINA_ARG_NONNULL(1);
1387
1388 /**
1389  * Force immediate renderization of the given Evas canvas.
1390  *
1391  * @param e The given canvas pointer.
1392  * @return A newly allocated list of updated rectangles of the canvas
1393  *        (@c Eina_Rectangle structs). Free this list with
1394  *        evas_render_updates_free().
1395  *
1396  * This function forces an immediate renderization update of the given
1397  * canvas @e.
1398  *
1399  * @note This is a <b>very low level function</b>, which most of
1400  * Evas' users wouldn't care about. One would use it, for example, to
1401  * grab an Evas' canvas update regions and paint them back, using the
1402  * canvas' pixmap, on a displaying system working below Evas.
1403  *
1404  * @note Evas is a stateful canvas. If no operations changing its
1405  * state took place since the last rendering action, you won't see no
1406  * changes and this call will be a no-op.
1407  *
1408  * Example code follows.
1409  * @dontinclude evas-events.c
1410  * @skip add an obscured
1411  * @until d.obscured = !d.obscured;
1412  *
1413  * See the full @ref Example_Evas_Events "example".
1414  *
1415  * @ingroup Evas_Canvas
1416  */
1417 EAPI Eina_List        *evas_render_updates               (Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
1418
1419 /**
1420  * Free the rectangles returned by evas_render_updates().
1421  *
1422  * @param updates The list of updated rectangles of the canvas.
1423  *
1424  * This function removes the region from the render updates list. It
1425  * makes the region doesn't be render updated anymore.
1426  *
1427  * @see evas_render_updates() for an example
1428  *
1429  * @ingroup Evas_Canvas
1430  */
1431 EAPI void              evas_render_updates_free          (Eina_List *updates);
1432
1433 /**
1434  * Force renderization of the given canvas.
1435  *
1436  * @param e The given canvas pointer.
1437  *
1438  * @ingroup Evas_Canvas
1439  */
1440 EAPI void              evas_render                       (Evas *e) EINA_ARG_NONNULL(1);
1441
1442 /**
1443  * Update the canvas internal objects but not triggering immediate
1444  * renderization.
1445  *
1446  * @param e The given canvas pointer.
1447  *
1448  * This function updates the canvas internal objects not triggering
1449  * renderization. To force renderization function evas_render() should
1450  * be used.
1451  *
1452  * @see evas_render.
1453  *
1454  * @ingroup Evas_Canvas
1455  */
1456 EAPI void              evas_norender                     (Evas *e) EINA_ARG_NONNULL(1);
1457
1458 /**
1459  * Make the canvas discard internally cached data used for rendering.
1460  *
1461  * @param e The given canvas pointer.
1462  *
1463  * This function flushes the arrays of delete, active and render objects.
1464  * Other things it may also discard are: shared memory segments,
1465  * temporary scratch buffers, cached data to avoid re-compute of that data etc.
1466  *
1467  * @ingroup Evas_Canvas
1468  */
1469 EAPI void              evas_render_idle_flush            (Evas *e) EINA_ARG_NONNULL(1);
1470
1471 /**
1472  * Make the canvas discard as much data as possible used by the engine at
1473  * runtime.
1474  *
1475  * @param e The given canvas pointer.
1476  *
1477  * This function will unload images, delete textures and much more, where
1478  * possible. You may also want to call evas_render_idle_flush() immediately
1479  * prior to this to perhaps discard a little more, though evas_render_dump()
1480  * should implicitly delete most of what evas_render_idle_flush() might
1481  * discard too.
1482  *
1483  * @ingroup Evas_Canvas
1484  */
1485 EAPI void              evas_render_dump                  (Evas *e) EINA_ARG_NONNULL(1);
1486
1487 /**
1488  * @defgroup Evas_Output_Method Render Engine Functions
1489  *
1490  * Functions that are used to set the render engine for a given
1491  * function, and then get that engine working.
1492  *
1493  * The following code snippet shows how they can be used to
1494  * initialise an evas that uses the X11 software engine:
1495  * @code
1496  * Evas *evas;
1497  * Evas_Engine_Info_Software_X11 *einfo;
1498  * extern Display *display;
1499  * extern Window win;
1500  *
1501  * evas_init();
1502  *
1503  * evas = evas_new();
1504  * evas_output_method_set(evas, evas_render_method_lookup("software_x11"));
1505  * evas_output_size_set(evas, 640, 480);
1506  * evas_output_viewport_set(evas, 0, 0, 640, 480);
1507  * einfo = (Evas_Engine_Info_Software_X11 *)evas_engine_info_get(evas);
1508  * einfo->info.display = display;
1509  * einfo->info.visual = DefaultVisual(display, DefaultScreen(display));
1510  * einfo->info.colormap = DefaultColormap(display, DefaultScreen(display));
1511  * einfo->info.drawable = win;
1512  * einfo->info.depth = DefaultDepth(display, DefaultScreen(display));
1513  * evas_engine_info_set(evas, (Evas_Engine_Info *)einfo);
1514  * @endcode
1515  *
1516  * @ingroup Evas_Canvas
1517  */
1518
1519 /**
1520  * Look up a numeric ID from a string name of a rendering engine.
1521  *
1522  * @param name the name string of an engine
1523  * @return A numeric (opaque) ID for the rendering engine
1524  * @ingroup Evas_Output_Method
1525  *
1526  * This function looks up a numeric return value for the named engine
1527  * in the string @p name. This is a normal C string, NUL byte
1528  * terminated. The name is case sensitive. If the rendering engine is
1529  * available, a numeric ID for that engine is returned that is not
1530  * 0. If the engine is not available, 0 is returned, indicating an
1531  * invalid engine.
1532  *
1533  * The programmer should NEVER rely on the numeric ID of an engine
1534  * unless it is returned by this function. Programs should NOT be
1535  * written accessing render method ID's directly, without first
1536  * obtaining it from this function.
1537  *
1538  * @attention it is mandatory that one calls evas_init() before
1539  *       looking up the render method.
1540  *
1541  * Example:
1542  * @code
1543  * int engine_id;
1544  * Evas *evas;
1545  *
1546  * evas_init();
1547  *
1548  * evas = evas_new();
1549  * if (!evas)
1550  *   {
1551  *     fprintf(stderr, "ERROR: Canvas creation failed. Fatal error.\n");
1552  *     exit(-1);
1553  *   }
1554  * engine_id = evas_render_method_lookup("software_x11");
1555  * if (!engine_id)
1556  *   {
1557  *     fprintf(stderr, "ERROR: Requested rendering engine is absent.\n");
1558  *     exit(-1);
1559  *   }
1560  * evas_output_method_set(evas, engine_id);
1561  * @endcode
1562  */
1563 EAPI int               evas_render_method_lookup         (const char *name) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
1564
1565 /**
1566  * List all the rendering engines compiled into the copy of the Evas library
1567  *
1568  * @return A linked list whose data members are C strings of engine names
1569  * @ingroup Evas_Output_Method
1570  *
1571  * Calling this will return a handle (pointer) to an Evas linked
1572  * list. Each node in the linked list will have the data pointer be a
1573  * (char *) pointer to the name string of the rendering engine
1574  * available. The strings should never be modified, neither should the
1575  * list be modified. This list should be cleaned up as soon as the
1576  * program no longer needs it using evas_render_method_list_free(). If
1577  * no engines are available from Evas, NULL will be returned.
1578  *
1579  * Example:
1580  * @code
1581  * Eina_List *engine_list, *l;
1582  * char *engine_name;
1583  *
1584  * engine_list = evas_render_method_list();
1585  * if (!engine_list)
1586  *   {
1587  *     fprintf(stderr, "ERROR: Evas supports no engines! Exit.\n");
1588  *     exit(-1);
1589  *   }
1590  * printf("Available Evas Engines:\n");
1591  * EINA_LIST_FOREACH(engine_list, l, engine_name)
1592  *     printf("%s\n", engine_name);
1593  * evas_render_method_list_free(engine_list);
1594  * @endcode
1595  */
1596 EAPI Eina_List        *evas_render_method_list           (void) EINA_WARN_UNUSED_RESULT;
1597
1598 /**
1599  * This function should be called to free a list of engine names
1600  *
1601  * @param list The Eina_List base pointer for the engine list to be freed
1602  * @ingroup Evas_Output_Method
1603  *
1604  * When this function is called it will free the engine list passed in
1605  * as @p list. The list should only be a list of engines generated by
1606  * calling evas_render_method_list(). If @p list is NULL, nothing will
1607  * happen.
1608  *
1609  * Example:
1610  * @code
1611  * Eina_List *engine_list, *l;
1612  * char *engine_name;
1613  *
1614  * engine_list = evas_render_method_list();
1615  * if (!engine_list)
1616  *   {
1617  *     fprintf(stderr, "ERROR: Evas supports no engines! Exit.\n");
1618  *     exit(-1);
1619  *   }
1620  * printf("Available Evas Engines:\n");
1621  * EINA_LIST_FOREACH(engine_list, l, engine_name)
1622  *     printf("%s\n", engine_name);
1623  * evas_render_method_list_free(engine_list);
1624  * @endcode
1625  */
1626 EAPI void              evas_render_method_list_free      (Eina_List *list);
1627
1628
1629 /**
1630  * Sets the output engine for the given evas.
1631  *
1632  * Once the output engine for an evas is set, any attempt to change it
1633  * will be ignored.  The value for @p render_method can be found using
1634  * @ref evas_render_method_lookup .
1635  *
1636  * @param   e             The given evas.
1637  * @param   render_method The numeric engine value to use.
1638  *
1639  * @attention it is mandatory that one calls evas_init() before
1640  *       setting the output method.
1641  *
1642  * @ingroup Evas_Output_Method
1643  */
1644 EAPI void              evas_output_method_set            (Evas *e, int render_method) EINA_ARG_NONNULL(1);
1645
1646 /**
1647  * Retrieves the number of the output engine used for the given evas.
1648  * @param   e The given evas.
1649  * @return  The ID number of the output engine being used.  @c 0 is
1650  *          returned if there is an error.
1651  * @ingroup Evas_Output_Method
1652  */
1653 EAPI int               evas_output_method_get            (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
1654
1655
1656 /**
1657  * Retrieves the current render engine info struct from the given evas.
1658  *
1659  * The returned structure is publicly modifiable.  The contents are
1660  * valid until either @ref evas_engine_info_set or @ref evas_render
1661  * are called.
1662  *
1663  * This structure does not need to be freed by the caller.
1664  *
1665  * @param   e The given evas.
1666  * @return  A pointer to the Engine Info structure.  @c NULL is returned if
1667  *          an engine has not yet been assigned.
1668  * @ingroup Evas_Output_Method
1669  */
1670 EAPI Evas_Engine_Info *evas_engine_info_get              (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
1671
1672 /**
1673  * Applies the engine settings for the given evas from the given @c
1674  * Evas_Engine_Info structure.
1675  *
1676  * To get the Evas_Engine_Info structure to use, call @ref
1677  * evas_engine_info_get .  Do not try to obtain a pointer to an
1678  * @c Evas_Engine_Info structure in any other way.
1679  *
1680  * You will need to call this function at least once before you can
1681  * create objects on an evas or render that evas.  Some engines allow
1682  * their settings to be changed more than once.
1683  *
1684  * Once called, the @p info pointer should be considered invalid.
1685  *
1686  * @param   e    The pointer to the Evas Canvas
1687  * @param   info The pointer to the Engine Info to use
1688  * @return  1 if no error occurred, 0 otherwise
1689  * @ingroup Evas_Output_Method
1690  */
1691 EAPI Eina_Bool         evas_engine_info_set              (Evas *e, Evas_Engine_Info *info) EINA_ARG_NONNULL(1);
1692
1693 /**
1694  * @defgroup Evas_Output_Size Output and Viewport Resizing Functions
1695  *
1696  * Functions that set and retrieve the output and viewport size of an
1697  * evas.
1698  *
1699  * @ingroup Evas_Canvas
1700  */
1701
1702 /**
1703  * Sets the output size of the render engine of the given evas.
1704  *
1705  * The evas will render to a rectangle of the given size once this
1706  * function is called.  The output size is independent of the viewport
1707  * size.  The viewport will be stretched to fill the given rectangle.
1708  *
1709  * The units used for @p w and @p h depend on the engine used by the
1710  * evas.
1711  *
1712  * @param   e The given evas.
1713  * @param   w The width in output units, usually pixels.
1714  * @param   h The height in output units, usually pixels.
1715  * @ingroup Evas_Output_Size
1716  */
1717 EAPI void              evas_output_size_set              (Evas *e, int w, int h) EINA_ARG_NONNULL(1);
1718
1719 /**
1720  * Retrieve the output size of the render engine of the given evas.
1721  *
1722  * The output size is given in whatever the output units are for the
1723  * engine.
1724  *
1725  * If either @p w or @p h is @c NULL, then it is ignored.  If @p e is
1726  * invalid, the returned results are undefined.
1727  *
1728  * @param   e The given evas.
1729  * @param   w The pointer to an integer to store the width in.
1730  * @param   h The pointer to an integer to store the height in.
1731  * @ingroup Evas_Output_Size
1732  */
1733 EAPI void              evas_output_size_get              (const Evas *e, int *w, int *h) EINA_ARG_NONNULL(1);
1734
1735 /**
1736  * Sets the output viewport of the given evas in evas units.
1737  *
1738  * The output viewport is the area of the evas that will be visible to
1739  * the viewer.  The viewport will be stretched to fit the output
1740  * target of the evas when rendering is performed.
1741  *
1742  * @note The coordinate values do not have to map 1-to-1 with the output
1743  *       target.  However, it is generally advised that it is done for ease
1744  *       of use.
1745  *
1746  * @param   e The given evas.
1747  * @param   x The top-left corner x value of the viewport.
1748  * @param   y The top-left corner y value of the viewport.
1749  * @param   w The width of the viewport.  Must be greater than 0.
1750  * @param   h The height of the viewport.  Must be greater than 0.
1751  * @ingroup Evas_Output_Size
1752  */
1753 EAPI void              evas_output_viewport_set          (Evas *e, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h) EINA_ARG_NONNULL(1);
1754
1755 /**
1756  * Get the render engine's output viewport co-ordinates in canvas units.
1757  * @param e The pointer to the Evas Canvas
1758  * @param x The pointer to a x variable to be filled in
1759  * @param y The pointer to a y variable to be filled in
1760  * @param w The pointer to a width variable to be filled in
1761  * @param h The pointer to a height variable to be filled in
1762  * @ingroup Evas_Output_Size
1763  *
1764  * Calling this function writes the current canvas output viewport
1765  * size and location values into the variables pointed to by @p x, @p
1766  * y, @p w and @p h.  On success the variables have the output
1767  * location and size values written to them in canvas units. Any of @p
1768  * x, @p y, @p w or @p h that are NULL will not be written to. If @p e
1769  * is invalid, the results are undefined.
1770  *
1771  * Example:
1772  * @code
1773  * extern Evas *evas;
1774  * Evas_Coord x, y, width, height;
1775  *
1776  * evas_output_viewport_get(evas, &x, &y, &w, &h);
1777  * @endcode
1778  */
1779 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);
1780
1781 /**
1782  * @defgroup Evas_Coord_Mapping_Group Coordinate Mapping Functions
1783  *
1784  * Functions that are used to map coordinates from the canvas to the
1785  * screen or the screen to the canvas.
1786  *
1787  * @ingroup Evas_Canvas
1788  */
1789
1790 /**
1791  * Convert/scale an ouput screen co-ordinate into canvas co-ordinates
1792  *
1793  * @param e The pointer to the Evas Canvas
1794  * @param x The screen/output x co-ordinate
1795  * @return The screen co-ordinate translated to canvas unit co-ordinates
1796  * @ingroup Evas_Coord_Mapping_Group
1797  *
1798  * This function takes in a horizontal co-ordinate as the @p x
1799  * parameter and converts it into canvas units, accounting for output
1800  * size, viewport size and location, returning it as the function
1801  * return value. If @p e is invalid, the results are undefined.
1802  *
1803  * Example:
1804  * @code
1805  * extern Evas *evas;
1806  * extern int screen_x;
1807  * Evas_Coord canvas_x;
1808  *
1809  * canvas_x = evas_coord_screen_x_to_world(evas, screen_x);
1810  * @endcode
1811  */
1812 EAPI Evas_Coord        evas_coord_screen_x_to_world      (const Evas *e, int x) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
1813
1814 /**
1815  * Convert/scale an ouput screen co-ordinate into canvas co-ordinates
1816  *
1817  * @param e The pointer to the Evas Canvas
1818  * @param y The screen/output y co-ordinate
1819  * @return The screen co-ordinate translated to canvas unit co-ordinates
1820  * @ingroup Evas_Coord_Mapping_Group
1821  *
1822  * This function takes in a vertical co-ordinate as the @p y parameter
1823  * and converts it into canvas units, accounting for output size,
1824  * viewport size and location, returning it as the function return
1825  * value. If @p e is invalid, the results are undefined.
1826  *
1827  * Example:
1828  * @code
1829  * extern Evas *evas;
1830  * extern int screen_y;
1831  * Evas_Coord canvas_y;
1832  *
1833  * canvas_y = evas_coord_screen_y_to_world(evas, screen_y);
1834  * @endcode
1835  */
1836 EAPI Evas_Coord        evas_coord_screen_y_to_world      (const Evas *e, int y) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
1837
1838 /**
1839  * Convert/scale a canvas co-ordinate into output screen co-ordinates
1840  *
1841  * @param e The pointer to the Evas Canvas
1842  * @param x The canvas x co-ordinate
1843  * @return The output/screen co-ordinate translated to output co-ordinates
1844  * @ingroup Evas_Coord_Mapping_Group
1845  *
1846  * This function takes in a horizontal co-ordinate as the @p x
1847  * parameter and converts it into output units, accounting for output
1848  * size, viewport size and location, returning it as the function
1849  * return value. If @p e is invalid, the results are undefined.
1850  *
1851  * Example:
1852  * @code
1853  * extern Evas *evas;
1854  * int screen_x;
1855  * extern Evas_Coord canvas_x;
1856  *
1857  * screen_x = evas_coord_world_x_to_screen(evas, canvas_x);
1858  * @endcode
1859  */
1860 EAPI int               evas_coord_world_x_to_screen      (const Evas *e, Evas_Coord x) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
1861
1862 /**
1863  * Convert/scale a canvas co-ordinate into output screen co-ordinates
1864  *
1865  * @param e The pointer to the Evas Canvas
1866  * @param y The canvas y co-ordinate
1867  * @return The output/screen co-ordinate translated to output co-ordinates
1868  * @ingroup Evas_Coord_Mapping_Group
1869  *
1870  * This function takes in a vertical co-ordinate as the @p x parameter
1871  * and converts it into output units, accounting for output size,
1872  * viewport size and location, returning it as the function return
1873  * value. If @p e is invalid, the results are undefined.
1874  *
1875  * Example:
1876  * @code
1877  * extern Evas *evas;
1878  * int screen_y;
1879  * extern Evas_Coord canvas_y;
1880  *
1881  * screen_y = evas_coord_world_y_to_screen(evas, canvas_y);
1882  * @endcode
1883  */
1884 EAPI int               evas_coord_world_y_to_screen      (const Evas *e, Evas_Coord y) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
1885
1886 /**
1887  * @defgroup Evas_Pointer_Group Pointer (Mouse) Functions
1888  *
1889  * Functions that deal with the status of the pointer (mouse cursor).
1890  *
1891  * @ingroup Evas_Canvas
1892  */
1893
1894 /**
1895  * This function returns the current known pointer co-ordinates
1896  *
1897  * @param e The pointer to the Evas Canvas
1898  * @param x The pointer to an integer to be filled in
1899  * @param y The pointer to an integer to be filled in
1900  * @ingroup Evas_Pointer_Group
1901  *
1902  * This function returns the current known screen/output co-ordinates
1903  * of the mouse pointer and sets the contents of the integers pointed
1904  * to by @p x and @p y to contain these co-ordinates. If @p e is not a
1905  * valid canvas the results of this function are undefined.
1906  *
1907  * Example:
1908  * @code
1909  * extern Evas *evas;
1910  * int mouse_x, mouse_y;
1911  *
1912  * evas_pointer_output_xy_get(evas, &mouse_x, &mouse_y);
1913  * printf("Mouse is at screen position %i, %i\n", mouse_x, mouse_y);
1914  * @endcode
1915  */
1916 EAPI void              evas_pointer_output_xy_get        (const Evas *e, int *x, int *y) EINA_ARG_NONNULL(1);
1917
1918 /**
1919  * This function returns the current known pointer co-ordinates
1920  *
1921  * @param e The pointer to the Evas Canvas
1922  * @param x The pointer to a Evas_Coord to be filled in
1923  * @param y The pointer to a Evas_Coord to be filled in
1924  * @ingroup Evas_Pointer_Group
1925  *
1926  * This function returns the current known canvas unit co-ordinates of
1927  * the mouse pointer and sets the contents of the Evas_Coords pointed
1928  * to by @p x and @p y to contain these co-ordinates. If @p e is not a
1929  * valid canvas the results of this function are undefined.
1930  *
1931  * Example:
1932  * @code
1933  * extern Evas *evas;
1934  * Evas_Coord mouse_x, mouse_y;
1935  *
1936  * evas_pointer_output_xy_get(evas, &mouse_x, &mouse_y);
1937  * printf("Mouse is at canvas position %f, %f\n", mouse_x, mouse_y);
1938  * @endcode
1939  */
1940 EAPI void              evas_pointer_canvas_xy_get        (const Evas *e, Evas_Coord *x, Evas_Coord *y) EINA_ARG_NONNULL(1);
1941
1942 /**
1943  * Returns a bitmask with the mouse buttons currently pressed, set to 1
1944  *
1945  * @param e The pointer to the Evas Canvas
1946  * @return A bitmask of the currently depressed buttons on the cavas
1947  * @ingroup Evas_Pointer_Group
1948  *
1949  * Calling this function will return a 32-bit integer with the
1950  * appropriate bits set to 1 that correspond to a mouse button being
1951  * depressed. This limits Evas to a mouse devices with a maximum of 32
1952  * buttons, but that is generally in excess of any host system's
1953  * pointing device abilities.
1954  *
1955  * A canvas by default begins with no mouse buttons being pressed and
1956  * only calls to evas_event_feed_mouse_down(),
1957  * evas_event_feed_mouse_down_data(), evas_event_feed_mouse_up() and
1958  * evas_event_feed_mouse_up_data() will alter that.
1959  *
1960  * The least significant bit corresponds to the first mouse button
1961  * (button 1) and the most significant bit corresponds to the last
1962  * mouse button (button 32).
1963  *
1964  * If @p e is not a valid canvas, the return value is undefined.
1965  *
1966  * Example:
1967  * @code
1968  * extern Evas *evas;
1969  * int button_mask, i;
1970  *
1971  * button_mask = evas_pointer_button_down_mask_get(evas);
1972  * printf("Buttons currently pressed:\n");
1973  * for (i = 0; i < 32; i++)
1974  *   {
1975  *     if ((button_mask & (1 << i)) != 0) printf("Button %i\n", i + 1);
1976  *   }
1977  * @endcode
1978  */
1979 EAPI int               evas_pointer_button_down_mask_get (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
1980
1981 /**
1982  * Returns whether the mouse pointer is logically inside the canvas
1983  *
1984  * @param e The pointer to the Evas Canvas
1985  * @return An integer that is 1 if the mouse is inside the canvas, 0 otherwise
1986  * @ingroup Evas_Pointer_Group
1987  *
1988  * When this function is called it will return a value of either 0 or
1989  * 1, depending on if evas_event_feed_mouse_in(),
1990  * evas_event_feed_mouse_in_data(), or evas_event_feed_mouse_out(),
1991  * evas_event_feed_mouse_out_data() have been called to feed in a
1992  * mouse enter event into the canvas.
1993  *
1994  * A return value of 1 indicates the mouse is logically inside the
1995  * canvas, and 0 implies it is logically outside the canvas.
1996  *
1997  * A canvas begins with the mouse being assumed outside (0).
1998  *
1999  * If @p e is not a valid canvas, the return value is undefined.
2000  *
2001  * Example:
2002  * @code
2003  * extern Evas *evas;
2004  *
2005  * if (evas_pointer_inside_get(evas)) printf("Mouse is in!\n");
2006  * else printf("Mouse is out!\n");
2007  * @endcode
2008  */
2009 EAPI Eina_Bool         evas_pointer_inside_get           (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
2010    EAPI void              evas_sync(Evas *e) EINA_ARG_NONNULL(1);
2011
2012 /**
2013  * @defgroup Evas_Canvas_Events Canvas Events
2014  *
2015  * Functions relating to canvas events, which are mainly reports on
2016  * its internal states changing (an object got focused, the rendering
2017  * is updated, etc).
2018  *
2019  * Some of the funcions in this group are exemplified @ref
2020  * Example_Evas_Events "here".
2021  *
2022  * @ingroup Evas_Canvas
2023  */
2024
2025 /**
2026  * @addtogroup Evas_Canvas_Events
2027  * @{
2028  */
2029
2030 /**
2031  * Add (register) a callback function to a given canvas event.
2032  *
2033  * @param e Canvas to attach a callback to
2034  * @param type The type of event that will trigger the callback
2035  * @param func The (callback) function to be called when the event is
2036  *        triggered
2037  * @param data The data pointer to be passed to @p func
2038  *
2039  * This function adds a function callback to the canvas @p e when the
2040  * event of type @p type occurs on it. The function pointer is @p
2041  * func.
2042  *
2043  * In the event of a memory allocation error during the addition of
2044  * the callback to the canvas, evas_alloc_error() should be used to
2045  * determine the nature of the error, if any, and the program should
2046  * sensibly try and recover.
2047  *
2048  * A callback function must have the ::Evas_Event_Cb prototype
2049  * definition. The first parameter (@p data) in this definition will
2050  * have the same value passed to evas_event_callback_add() as the @p
2051  * data parameter, at runtime. The second parameter @p e is the canvas
2052  * pointer on which the event occurred. The third parameter @p
2053  * event_info is a pointer to a data structure that may or may not be
2054  * passed to the callback, depending on the event type that triggered
2055  * the callback. This is so because some events don't carry extra
2056  * context with them, but others do.
2057  *
2058  * The event type @p type to trigger the function may be one of
2059  * #EVAS_CALLBACK_RENDER_FLUSH_PRE, #EVAS_CALLBACK_RENDER_FLUSH_POST,
2060  * #EVAS_CALLBACK_CANVAS_FOCUS_IN, #EVAS_CALLBACK_CANVAS_FOCUS_OUT,
2061  * #EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_IN and
2062  * #EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_OUT. This determines the kind of
2063  * event that will trigger the callback to be called. Only the last
2064  * two of the event types listed here provide useful event information
2065  * data -- a pointer to the recently focused Evas object. For the
2066  * others the @p event_info pointer is going to be @c NULL.
2067  *
2068  * Example:
2069  * @dontinclude evas-events.c
2070  * @skip evas_event_callback_add(d.canvas, EVAS_CALLBACK_RENDER_FLUSH_PRE
2071  * @until two canvas event callbacks
2072  *
2073  * Looking to the callbacks registered above,
2074  * @dontinclude evas-events.c
2075  * @skip called when our rectangle gets focus
2076  * @until let's have our events back
2077  *
2078  * we see that the canvas flushes its rendering pipeline
2079  * (#EVAS_CALLBACK_RENDER_FLUSH_PRE) whenever the @c _resize_cb
2080  * routine takes place: it has to redraw that image at a different
2081  * size. Also, the callback on an object being focused comes just
2082  * after we focus it explicitly, on code.
2083  *
2084  * See the full @ref Example_Evas_Events "example".
2085  *
2086  * @note Be careful not to add the same callback multiple times, if
2087  * that's not what you want, because Evas won't check if a callback
2088  * existed before exactly as the one being registered (and thus, call
2089  * it more than once on the event, in this case). This would make
2090  * sense if you passed different functions and/or callback data, only.
2091  */
2092 EAPI void              evas_event_callback_add              (Evas *e, Evas_Callback_Type type, Evas_Event_Cb func, const void *data) EINA_ARG_NONNULL(1, 3);
2093
2094 /**
2095  * Delete a callback function from the canvas.
2096  *
2097  * @param e Canvas to remove a callback from
2098  * @param type The type of event that was triggering the callback
2099  * @param func The function that was to be called when the event was triggered
2100  * @return The data pointer that was to be passed to the callback
2101  *
2102  * This function removes the most recently added callback from the
2103  * canvas @p e which was triggered by the event type @p type and was
2104  * calling the function @p func when triggered. If the removal is
2105  * successful it will also return the data pointer that was passed to
2106  * evas_event_callback_add() when the callback was added to the
2107  * canvas. If not successful NULL will be returned.
2108  *
2109  * Example:
2110  * @code
2111  * extern Evas *e;
2112  * void *my_data;
2113  * void focus_in_callback(void *data, Evas *e, void *event_info);
2114  *
2115  * my_data = evas_event_callback_del(ebject, EVAS_CALLBACK_CANVAS_FOCUS_IN, focus_in_callback);
2116  * @endcode
2117  */
2118 EAPI void             *evas_event_callback_del              (Evas *e, Evas_Callback_Type type, Evas_Event_Cb func) EINA_ARG_NONNULL(1, 3);
2119
2120 /**
2121  * Delete (unregister) a callback function registered to a given
2122  * canvas event.
2123  *
2124  * @param e Canvas to remove an event callback from
2125  * @param type The type of event that was triggering the callback
2126  * @param func The function that was to be called when the event was
2127  *        triggered
2128  * @param data The data pointer that was to be passed to the callback
2129  * @return The data pointer that was to be passed to the callback
2130  *
2131  * This function removes <b>the first</b> added callback from the
2132  * canvas @p e matching the event type @p type, the registered
2133  * function pointer @p func and the callback data pointer @p data. If
2134  * the removal is successful it will also return the data pointer that
2135  * was passed to evas_event_callback_add() (that will be the same as
2136  * the parameter) when the callback(s) was(were) added to the
2137  * canvas. If not successful @c NULL will be returned. A common use
2138  * would be to remove an exact match of a callback.
2139  *
2140  * Example:
2141  * @dontinclude evas-events.c
2142  * @skip evas_event_callback_del_full(evas, EVAS_CALLBACK_RENDER_FLUSH_PRE,
2143  * @until _object_focus_in_cb, NULL);
2144  *
2145  * See the full @ref Example_Evas_Events "example".
2146  *
2147  * @note For deletion of canvas events callbacks filtering by just
2148  * type and function pointer, user evas_event_callback_del().
2149  */
2150 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);
2151
2152 /**
2153  * Push a callback on the post-event callback stack
2154  *
2155  * @param e Canvas to push the callback on
2156  * @param func The function that to be called when the stack is unwound
2157  * @param data The data pointer to be passed to the callback
2158  *
2159  * Evas has a stack of callbacks that get called after all the callbacks for
2160  * an event have triggered (all the objects it triggers on and al the callbacks
2161  * in each object triggered). When all these have been called, the stack is
2162  * unwond from most recently to least recently pushed item and removed from the
2163  * stack calling the callback set for it.
2164  *
2165  * This is intended for doing reverse logic-like processing, example - when a
2166  * child object that happens to get the event later is meant to be able to
2167  * "steal" functions from a parent and thus on unwind of this stack hav its
2168  * function called first, thus being able to set flags, or return 0 from the
2169  * post-callback that stops all other post-callbacks in the current stack from
2170  * being called (thus basically allowing a child to take control, if the event
2171  * callback prepares information ready for taking action, but the post callback
2172  * actually does the action).
2173  *
2174  */
2175 EAPI void              evas_post_event_callback_push        (Evas *e, Evas_Object_Event_Post_Cb func, const void *data);
2176
2177 /**
2178  * Remove a callback from the post-event callback stack
2179  *
2180  * @param e Canvas to push the callback on
2181  * @param func The function that to be called when the stack is unwound
2182  *
2183  * This removes a callback from the stack added with
2184  * evas_post_event_callback_push(). The first instance of the function in
2185  * the callback stack is removed from being executed when the stack is
2186  * unwound. Further instances may still be run on unwind.
2187  */
2188 EAPI void              evas_post_event_callback_remove      (Evas *e, Evas_Object_Event_Post_Cb func);
2189
2190 /**
2191  * Remove a callback from the post-event callback stack
2192  *
2193  * @param e Canvas to push the callback on
2194  * @param func The function that to be called when the stack is unwound
2195  * @param data The data pointer to be passed to the callback
2196  *
2197  * This removes a callback from the stack added with
2198  * evas_post_event_callback_push(). The first instance of the function and data
2199  * in the callback stack is removed from being executed when the stack is
2200  * unwound. Further instances may still be run on unwind.
2201  */
2202 EAPI void              evas_post_event_callback_remove_full (Evas *e, Evas_Object_Event_Post_Cb func, const void *data);
2203
2204 /**
2205  * @defgroup Evas_Event_Freezing_Group Input Events Freezing Functions
2206  *
2207  * Functions that deal with the freezing of input event processing of
2208  * an Evas canvas.
2209  *
2210  * There might be scenarios during a graphical user interface
2211  * program's use when the developer whishes the users wouldn't be able
2212  * to deliver input events to this application. It may, for example,
2213  * be the time for it to populate a view or to change some
2214  * layout. Assuming proper behavior with user interaction during this
2215  * exact time would be hard, as things are in a changing state. The
2216  * programmer can then tell the canvas to ignore input events,
2217  * bringing it back to normal behavior when he/she wants.
2218  *
2219  * Some of the funcions in this group are exemplified @ref
2220  * Example_Evas_Events "here".
2221  *
2222  * @ingroup Evas_Canvas_Events
2223  */
2224
2225 /**
2226  * @addtogroup Evas_Event_Freezing_Group
2227  * @{
2228  */
2229
2230 /**
2231  * Freeze all input events processing.
2232  *
2233  * @param e The canvas to freeze input events processing on.
2234  *
2235  * This function will indicate to Evas that the canvas @p e is to have
2236  * all input event processing frozen until a matching
2237  * evas_event_thaw() function is called on the same canvas. All events
2238  * of this kind during the freeze will get @b discarded. Every freeze
2239  * call must be matched by a thaw call in order to completely thaw out
2240  * a canvas (i.e. these calls may be nested). The most common use is
2241  * when you don't want the user to interect with your user interface
2242  * when you're populating a view or changing the layout.
2243  *
2244  * Example:
2245  * @dontinclude evas-events.c
2246  * @skip freeze input for 3 seconds
2247  * @until }
2248  * @dontinclude evas-events.c
2249  * @skip let's have our events back
2250  * @until }
2251  *
2252  * See the full @ref Example_Evas_Events "example".
2253  *
2254  * If you run that example, you'll see the canvas ignoring all input
2255  * events for 3 seconds, when the "f" key is pressed. In a more
2256  * realistic code we would be freezing while a toolkit or Edje was
2257  * doing some UI changes, thawing it back afterwards.
2258  */
2259 EAPI void              evas_event_freeze                 (Evas *e) EINA_ARG_NONNULL(1);
2260
2261 /**
2262  * Thaw a canvas out after freezing (for input events).
2263  *
2264  * @param e The canvas to thaw out.
2265  *
2266  * This will thaw out a canvas after a matching evas_event_freeze()
2267  * call. If this call completely thaws out a canvas, i.e., there's no
2268  * other unbalanced call to evas_event_freeze(), events will start to
2269  * be processed again, but any "missed" events will @b not be
2270  * evaluated.
2271  *
2272  * See evas_event_freeze() for an example.
2273  */
2274 EAPI void              evas_event_thaw                   (Evas *e) EINA_ARG_NONNULL(1);
2275
2276 /**
2277  * Return the freeze count on input events of a given canvas.
2278  *
2279  * @param e The canvas to fetch the freeze count from.
2280  *
2281  * This returns the number of times the canvas has been told to freeze
2282  * input events. It is possible to call evas_event_freeze() multiple
2283  * times, and these must be matched by evas_event_thaw() calls. This
2284  * call allows the program to discover just how many times things have
2285  * been frozen in case it may want to break out of a deep freeze state
2286  * where the count is high.
2287  *
2288  * Example:
2289  * @code
2290  * extern Evas *evas;
2291  *
2292  * while (evas_event_freeze_get(evas) > 0) evas_event_thaw(evas);
2293  * @endcode
2294  *
2295  */
2296 EAPI int               evas_event_freeze_get             (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
2297
2298 /**
2299  * After thaw of a canvas, re-evaluate the state of objects and call callbacks
2300  *
2301  * @param e The canvas to evaluate after a thaw
2302  *
2303  * This is normally called after evas_event_thaw() to re-evaluate mouse
2304  * containment and other states and thus also call callbacks for mouse in and
2305  * out on new objects if the state change demands it.
2306  */
2307 EAPI void              evas_event_thaw_eval              (Evas *e) EINA_ARG_NONNULL(1);
2308
2309 /**
2310  * @}
2311  */
2312
2313 /**
2314  * @defgroup Evas_Event_Feeding_Group Input Events Feeding Functions
2315  *
2316  * Functions to tell Evas that input events happened and should be
2317  * processed.
2318  *
2319  * As explained in @ref intro_not_evas, Evas does not know how to poll
2320  * for input events, so the developer should do it and then feed such
2321  * events to the canvas to be processed. This is only required if
2322  * operating Evas directly. Modules such as Ecore_Evas do that for
2323  * you.
2324  *
2325  * Some of the funcions in this group are exemplified @ref
2326  * Example_Evas_Events "here".
2327  *
2328  * @ingroup Evas_Canvas_Events
2329  */
2330
2331 /**
2332  * @addtogroup Evas_Event_Feeding_Group
2333  * @{
2334  */
2335
2336 /**
2337  * Mouse down event feed.
2338  *
2339  * @param e The given canvas pointer.
2340  * @param b The button number.
2341  * @param flags The evas button flags.
2342  * @param timestamp The timestamp of the mouse down event.
2343  * @param data The data for canvas.
2344  *
2345  * This function will set some evas properties that is necessary when
2346  * the mouse button is pressed. It prepares information to be treated
2347  * by the callback function.
2348  *
2349  */
2350 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);
2351
2352 /**
2353  * Mouse up event feed.
2354  *
2355  * @param e The given canvas pointer.
2356  * @param b The button number.
2357  * @param flags evas button flags.
2358  * @param timestamp The timestamp of the mouse up event.
2359  * @param data The data for canvas.
2360  *
2361  * This function will set some evas properties that is necessary when
2362  * the mouse button is released. It prepares information to be treated
2363  * by the callback function.
2364  *
2365  */
2366 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);
2367
2368 /**
2369  * Mouse move event feed.
2370  *
2371  * @param e The given canvas pointer.
2372  * @param x The horizontal position of the mouse pointer.
2373  * @param y The vertical position of the mouse pointer.
2374  * @param timestamp The timestamp of the mouse up event.
2375  * @param data The data for canvas.
2376  *
2377  * This function will set some evas properties that is necessary when
2378  * the mouse is moved from its last position. It prepares information
2379  * to be treated by the callback function.
2380  *
2381  */
2382 EAPI void              evas_event_feed_mouse_move        (Evas *e, int x, int y, unsigned int timestamp, const void *data) EINA_ARG_NONNULL(1);
2383
2384 /**
2385  * Mouse in event feed.
2386  *
2387  * @param e The given canvas pointer.
2388  * @param timestamp The timestamp of the mouse up event.
2389  * @param data The data for canvas.
2390  *
2391  * This function will set some evas properties that is necessary when
2392  * the mouse in event happens. It prepares information to be treated
2393  * by the callback function.
2394  *
2395  */
2396 EAPI void              evas_event_feed_mouse_in          (Evas *e, unsigned int timestamp, const void *data) EINA_ARG_NONNULL(1);
2397
2398 /**
2399  * Mouse out event feed.
2400  *
2401  * @param e The given canvas pointer.
2402  * @param timestamp Timestamp of the mouse up event.
2403  * @param data The data for canvas.
2404  *
2405  * This function will set some evas properties that is necessary when
2406  * the mouse out event happens. It prepares information to be treated
2407  * by the callback function.
2408  *
2409  */
2410 EAPI void              evas_event_feed_mouse_out         (Evas *e, unsigned int timestamp, const void *data) EINA_ARG_NONNULL(1);
2411    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);
2412    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);
2413    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);
2414
2415 /**
2416  * Mouse cancel event feed.
2417  *
2418  * @param e The given canvas pointer.
2419  * @param timestamp The timestamp of the mouse up event.
2420  * @param data The data for canvas.
2421  *
2422  * This function will call evas_event_feed_mouse_up() when a
2423  * mouse cancel event happens.
2424  *
2425  */
2426 EAPI void              evas_event_feed_mouse_cancel      (Evas *e, unsigned int timestamp, const void *data) EINA_ARG_NONNULL(1);
2427
2428 /**
2429  * Mouse wheel event feed.
2430  *
2431  * @param e The given canvas pointer.
2432  * @param direction The wheel mouse direction.
2433  * @param z How much mouse wheel was scrolled up or down.
2434  * @param timestamp The timestamp of the mouse up event.
2435  * @param data The data for canvas.
2436  *
2437  * This function will set some evas properties that is necessary when
2438  * the mouse wheel is scrolled up or down. It prepares information to
2439  * be treated by the callback function.
2440  *
2441  */
2442 EAPI void              evas_event_feed_mouse_wheel       (Evas *e, int direction, int z, unsigned int timestamp, const void *data) EINA_ARG_NONNULL(1);
2443
2444 /**
2445  * Key down event feed
2446  *
2447  * @param e The canvas to thaw out
2448  * @param keyname  Name of the key
2449  * @param key The key pressed.
2450  * @param string A String
2451  * @param compose The compose string
2452  * @param timestamp Timestamp of the mouse up event
2453  * @param data Data for canvas.
2454  *
2455  * This function will set some evas properties that is necessary when
2456  * a key is pressed. It prepares information to be treated by the
2457  * callback function.
2458  *
2459  */
2460 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);
2461
2462 /**
2463  * Key up event feed
2464  *
2465  * @param e The canvas to thaw out
2466  * @param keyname  Name of the key
2467  * @param key The key released.
2468  * @param string string
2469  * @param compose compose
2470  * @param timestamp Timestamp of the mouse up event
2471  * @param data Data for canvas.
2472  *
2473  * This function will set some evas properties that is necessary when
2474  * a key is released. It prepares information to be treated by the
2475  * callback function.
2476  *
2477  */
2478 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);
2479
2480 /**
2481  * Hold event feed
2482  *
2483  * @param e The given canvas pointer.
2484  * @param hold The hold.
2485  * @param timestamp The timestamp of the mouse up event.
2486  * @param data The data for canvas.
2487  *
2488  * This function makes the object to stop sending events.
2489  *
2490  */
2491 EAPI void              evas_event_feed_hold              (Evas *e, int hold, unsigned int timestamp, const void *data) EINA_ARG_NONNULL(1);
2492
2493 /**
2494  * Re feed event.
2495  *
2496  * @param e The given canvas pointer.
2497  * @param event_copy the event to refeed
2498  * @param event_type Event type
2499  *
2500  * This function re-feeds the event pointed by event_copy
2501  *
2502  * This function call evas_event_feed_* functions, so it can
2503  * cause havoc if not used wisely. Please use it responsibly.
2504  */
2505 EAPI void              evas_event_refeed_event           (Evas *e, void *event_copy, Evas_Callback_Type event_type);  EINA_ARG_NONNULL(1);
2506
2507
2508 /**
2509  * @}
2510  */
2511
2512 /**
2513  * @}
2514  */
2515
2516 /**
2517  * @defgroup Evas_Image_Group Image Functions
2518  *
2519  * Functions that deals with images at canvas level.
2520  *
2521  * @ingroup Evas_Canvas
2522  */
2523
2524 /**
2525  * Flush the image cache of the canvas.
2526  *
2527  * @param e The given evas pointer.
2528  *
2529  * This function flushes image cache of canvas.
2530  *
2531  */
2532 EAPI void              evas_image_cache_flush            (Evas *e) EINA_ARG_NONNULL(1);
2533
2534 /**
2535  * Reload the image cache
2536  *
2537  * @param e The given evas pointer.
2538  *
2539  * This function reloads the image cache of canvas.
2540  *
2541  */
2542 EAPI void              evas_image_cache_reload           (Evas *e) EINA_ARG_NONNULL(1);
2543
2544 /**
2545  * Set the image cache.
2546  *
2547  * @param e The given evas pointer.
2548  * @param size The cache size.
2549  *
2550  * This function sets the image cache of canvas.
2551  *
2552  */
2553 EAPI void              evas_image_cache_set              (Evas *e, int size) EINA_ARG_NONNULL(1);
2554
2555 /**
2556  * Set the image cache
2557  *
2558  * @param e The given evas pointer.
2559  *
2560  * This function returns the image cache of canvas.
2561  *
2562  */
2563 EAPI int               evas_image_cache_get              (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
2564
2565 /**
2566  * @defgroup Evas_Font_Group Font Functions
2567  *
2568  * Functions that deals with fonts.
2569  *
2570  * @ingroup Evas_Canvas
2571  */
2572
2573 /**
2574  * Changes the font hinting for the given evas.
2575  *
2576  * @param e The given evas.
2577  * @param hinting The hinting to use, one of #EVAS_FONT_HINTING_NONE,
2578  *        #EVAS_FONT_HINTING_AUTO, #EVAS_FONT_HINTING_BYTECODE.
2579  * @ingroup Evas_Font_Group
2580  */
2581 EAPI void                     evas_font_hinting_set        (Evas *e, Evas_Font_Hinting_Flags hinting) EINA_ARG_NONNULL(1);
2582
2583 /**
2584  * Retrieves the font hinting used by the given evas.
2585  *
2586  * @param e The given evas to query.
2587  * @return The hinting in use, one of #EVAS_FONT_HINTING_NONE,
2588  *         #EVAS_FONT_HINTING_AUTO, #EVAS_FONT_HINTING_BYTECODE.
2589  * @ingroup Evas_Font_Group
2590  */
2591 EAPI Evas_Font_Hinting_Flags  evas_font_hinting_get        (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
2592
2593 /**
2594  * Checks if the font hinting is supported by the given evas.
2595  *
2596  * @param e The given evas to query.
2597  * @param hinting The hinting to use, one of #EVAS_FONT_HINTING_NONE,
2598  *        #EVAS_FONT_HINTING_AUTO, #EVAS_FONT_HINTING_BYTECODE.
2599  * @return @c EINA_TRUE if it is supported, @c EINA_FALSE otherwise.
2600  * @ingroup Evas_Font_Group
2601  */
2602 EAPI Eina_Bool                evas_font_hinting_can_hint   (const Evas *e, Evas_Font_Hinting_Flags hinting) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
2603
2604
2605 /**
2606  * Force the given evas and associated engine to flush its font cache.
2607  *
2608  * @param e The given evas to flush font cache.
2609  * @ingroup Evas_Font_Group
2610  */
2611 EAPI void                     evas_font_cache_flush        (Evas *e) EINA_ARG_NONNULL(1);
2612
2613 /**
2614  * Changes the size of font cache of the given evas.
2615  *
2616  * @param e The given evas to flush font cache.
2617  * @param size The size, in bytes.
2618  *
2619  * @ingroup Evas_Font_Group
2620  */
2621 EAPI void                     evas_font_cache_set          (Evas *e, int size) EINA_ARG_NONNULL(1);
2622
2623 /**
2624  * Changes the size of font cache of the given evas.
2625  *
2626  * @param e The given evas to flush font cache.
2627  * @return The size, in bytes.
2628  *
2629  * @ingroup Evas_Font_Group
2630  */
2631 EAPI int                      evas_font_cache_get          (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
2632
2633
2634 /**
2635  * List of available font descriptions known or found by this evas.
2636  *
2637  * The list depends on Evas compile time configuration, such as
2638  * fontconfig support, and the paths provided at runtime as explained
2639  * in @ref Evas_Font_Path_Group.
2640  *
2641  * @param e The evas instance to query.
2642  * @return a newly allocated list of strings. Do not change the
2643  *         strings.  Be sure to call evas_font_available_list_free()
2644  *         after you're done.
2645  *
2646  * @ingroup Evas_Font_Group
2647  */
2648 EAPI Eina_List               *evas_font_available_list     (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
2649
2650 /**
2651  * Free list of font descriptions returned by evas_font_dir_available_list().
2652  *
2653  * @param e The evas instance that returned such list.
2654  * @param available the list returned by evas_font_dir_available_list().
2655  *
2656  * @ingroup Evas_Font_Group
2657  */
2658 EAPI void                     evas_font_available_list_free(Evas *e, Eina_List *available) EINA_ARG_NONNULL(1);
2659
2660 /**
2661  * @defgroup Evas_Font_Path_Group Font Path Functions
2662  *
2663  * Functions that edit the paths being used to load fonts.
2664  *
2665  * @ingroup Evas_Font_Group
2666  */
2667
2668 /**
2669  * Removes all font paths loaded into memory for the given evas.
2670  * @param   e The given evas.
2671  * @ingroup Evas_Font_Path_Group
2672  */
2673 EAPI void              evas_font_path_clear              (Evas *e) EINA_ARG_NONNULL(1);
2674
2675 /**
2676  * Appends a font path to the list of font paths used by the given evas.
2677  * @param   e    The given evas.
2678  * @param   path The new font path.
2679  * @ingroup Evas_Font_Path_Group
2680  */
2681 EAPI void              evas_font_path_append             (Evas *e, const char *path) EINA_ARG_NONNULL(1, 2);
2682
2683 /**
2684  * Prepends a font path to the list of font paths used by the given evas.
2685  * @param   e The given evas.
2686  * @param   path The new font path.
2687  * @ingroup Evas_Font_Path_Group
2688  */
2689 EAPI void              evas_font_path_prepend            (Evas *e, const char *path) EINA_ARG_NONNULL(1, 2);
2690
2691 /**
2692  * Retrieves the list of font paths used by the given evas.
2693  * @param   e The given evas.
2694  * @return  The list of font paths used.
2695  * @ingroup Evas_Font_Path_Group
2696  */
2697 EAPI const Eina_List  *evas_font_path_list               (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
2698
2699 /**
2700  * @defgroup Evas_Object_Group Generic Object Functions
2701  *
2702  * Functions that manipulate generic Evas objects.
2703  *
2704  * All Evas displaying units are Evas objects. One handles them all by
2705  * means of the handle ::Evas_Object. Besides Evas treats their
2706  * objects equally, they have @b types, which define their specific
2707  * behavior (and individual API).
2708  *
2709  * Evas comes with a set of built-in object types:
2710  *   - rectangle,
2711  *   - line,
2712  *   - polygon,
2713  *   - text,
2714  *   - textblock and
2715  *   - image.
2716  *
2717  * These functions apply to @b any Evas object, whichever type thay
2718  * may have.
2719  *
2720  * @note The built-in types which are most used are rectangles, text
2721  * and images. In fact, with these ones one can create 2D interfaces
2722  * of arbitrary complexity and EFL makes it easy.
2723  */
2724
2725 /**
2726  * @defgroup Evas_Object_Group_Basic Basic Object Manipulation
2727  *
2728  * Methods that are broadly used, like those that change the color,
2729  * clippers and geometry of an Evas object.
2730  *
2731  * An example on the most used functions in this group can be seen @ref
2732  * Example_Evas_Object_Manipulation "here".
2733  *
2734  * For function dealing with stacking, the examples are gathered  @ref
2735  * Example_Evas_Stacking "here".
2736  *
2737  * @ingroup Evas_Object_Group
2738  */
2739
2740 /**
2741  * @addtogroup Evas_Object_Group_Basic
2742  * @{
2743  */
2744
2745 /**
2746  * Clip one object to another.
2747  *
2748  * @param obj The object to be clipped
2749  * @param clip The object to clip @p obj by
2750  *
2751  * This function will clip the object @p obj to the area occupied by
2752  * the object @p clip. This means the object @p obj will only be
2753  * visible within the area occupied by the clipping object (@p clip).
2754  *
2755  * The color of the object being clipped will be multiplied by the
2756  * color of the clipping one, so the resulting color for the former
2757  * will be <code>RESULT = (OBJ * CLIP) / (255 * 255)</code>, per color
2758  * element (red, green, blue and alpha).
2759  *
2760  * Clipping is recursive, so clipping objects may be clipped by
2761  * others, and their color will in term be multiplied. You may @b not
2762  * set up circular clipping lists (i.e. object 1 clips object 2, which
2763  * clips object 1): the behavior of Evas is undefined in this case.
2764  *
2765  * Objects which do not clip others are visible in the canvas as
2766  * normal; <b>those that clip one or more objects become invisible
2767  * themselves</b>, only affecting what they clip. If an object ceases
2768  * to have other objects being clipped by it, it will become visible
2769  * again.
2770  *
2771  * The visibility of an object affects the objects that are clipped by
2772  * it, so if the object clipping others is not shown (as in
2773  * evas_object_show()), the objects clipped by it will not be shown
2774  * either.
2775  *
2776  * If @p obj was being clipped by another object when this function is
2777  * called, it gets implicitly removed from the old clipper's domain
2778  * and is made now to be clipped by its new clipper.
2779  *
2780  * The following figure illustrates some clipping in Evas:
2781  * @image html clipping.png
2782  * @image rtf clipping.png
2783  * @image latex clipping.eps
2784  *
2785  * @note At the moment the <b>only objects that can validly be used to
2786  * clip other objects are rectangle objects</b>. All other object
2787  * types are invalid and the result of using them is undefined. The
2788  * clip object @p clip must be a valid object, but can also be @c
2789  * NULL, in which case the effect of this function is the same as
2790  * calling evas_object_clip_unset() on the @p obj object.
2791  *
2792  * Example:
2793  * @dontinclude evas-object-manipulation.c
2794  * @skip solid white clipper (note that it's the default color for a
2795  * @until evas_object_show(d.clipper);
2796  *
2797  * See the full @ref Example_Evas_Object_Manipulation "example".
2798  */
2799 EAPI void              evas_object_clip_set              (Evas_Object *obj, Evas_Object *clip) EINA_ARG_NONNULL(1, 2);
2800
2801 /**
2802  * Get the object clipping @p obj (if any).
2803  *
2804  * @param obj The object to get the clipper from
2805  *
2806  * This function returns the object clipping @p obj. If @p obj is
2807  * not being clipped at all, @c NULL is returned. The object @p obj
2808  * must be a valid ::Evas_Object.
2809  *
2810  * See also evas_object_clip_set(), evas_object_clip_unset() and
2811  * evas_object_clipees_get().
2812  *
2813  * Example:
2814  * @dontinclude evas-object-manipulation.c
2815  * @skip if (evas_object_clip_get(d.img) == d.clipper)
2816  * @until return
2817  *
2818  * See the full @ref Example_Evas_Object_Manipulation "example".
2819  */
2820 EAPI Evas_Object      *evas_object_clip_get              (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
2821
2822 /**
2823  * Disable/cease clipping on a clipped @p obj object.
2824  *
2825  * @param obj The object to cease clipping on
2826  *
2827  * This function disables clipping for the object @p obj, if it was
2828  * already clipped, i.e., its visibility and color get detached from
2829  * the previous clipper. If it wasn't, this has no effect. The object
2830  * @p obj must be a valid ::Evas_Object.
2831  *
2832  * See also evas_object_clip_set() (for an example),
2833  * evas_object_clipees_get() and evas_object_clip_get().
2834  *
2835  */
2836 EAPI void              evas_object_clip_unset            (Evas_Object *obj);
2837
2838 /**
2839  * Return a list of objects currently clipped by @p obj.
2840  *
2841  * @param obj The object to get a list of clippees from
2842  * @return a list of objects being clipped by @p obj
2843  *
2844  * This returns the internal list handle that contains all objects
2845  * clipped by the object @p obj. If none are clipped by it, the call
2846  * returns @c NULL. This list is only valid until the clip list is
2847  * changed and should be fetched again with another call to
2848  * evas_object_clipees_get() if any objects being clipped by this
2849  * object are unclipped, clipped by a new object, deleted or get the
2850  * clipper deleted. These operations will invalidate the list
2851  * returned, so it should not be used anymore after that point. Any
2852  * use of the list after this may have undefined results, possibly
2853  * leading to crashes. The object @p obj must be a valid
2854  * ::Evas_Object.
2855  *
2856  * See also evas_object_clip_set(), evas_object_clip_unset() and
2857  * evas_object_clip_get().
2858  *
2859  * Example:
2860  * @code
2861  * extern Evas_Object *obj;
2862  * Evas_Object *clipper;
2863  *
2864  * clipper = evas_object_clip_get(obj);
2865  * if (clipper)
2866  *   {
2867  *     Eina_List *clippees, *l;
2868  *     Evas_Object *obj_tmp;
2869  *
2870  *     clippees = evas_object_clipees_get(clipper);
2871  *     printf("Clipper clips %i objects\n", eina_list_count(clippees));
2872  *     EINA_LIST_FOREACH(clippees, l, obj_tmp)
2873  *         evas_object_show(obj_tmp);
2874  *   }
2875  * @endcode
2876  */
2877 EAPI const Eina_List  *evas_object_clipees_get           (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
2878
2879
2880 /**
2881  * Sets or unsets a given object as the currently focused one on its
2882  * canvas.
2883  *
2884  * @param obj The object to be focused or unfocused.
2885  * @param focus @c EINA_TRUE, to set it as focused or @c EINA_FALSE,
2886  * to take away the focus from it.
2887  *
2888  * Changing focus only affects where (key) input events go. There can
2889  * be only one object focused at any time. If @p focus is @c
2890  * EINA_TRUE, @p obj will be set as the currently focused object and
2891  * it will receive all keyboard events that are not exclusive key
2892  * grabs on other objects.
2893  *
2894  * Example:
2895  * @dontinclude evas-events.c
2896  * @skip evas_object_focus_set
2897  * @until evas_object_focus_set
2898  *
2899  * See the full example @ref Example_Evas_Events "here".
2900  *
2901  * @see evas_object_focus_get
2902  * @see evas_focus_get
2903  * @see evas_object_key_grab
2904  * @see evas_object_key_ungrab
2905  */
2906 EAPI void              evas_object_focus_set             (Evas_Object *obj, Eina_Bool focus) EINA_ARG_NONNULL(1);
2907
2908 /**
2909  * Retrieve whether an object has the focus.
2910  *
2911  * @param obj The object to retrieve focus information from.
2912  * @return @c EINA_TRUE if the object has the focus, @c EINA_FALSE
2913  * otherwise.
2914  *
2915  * If the passed object is the currently focused one, @c EINA_TRUE is
2916  * returned. @c EINA_FALSE is returned, otherwise.
2917  *
2918  * Example:
2919  * @dontinclude evas-events.c
2920  * @skip And again
2921  * @until something is bad
2922  *
2923  * See the full example @ref Example_Evas_Events "here".
2924  *
2925  * @see evas_object_focus_set
2926  * @see evas_focus_get
2927  * @see evas_object_key_grab
2928  * @see evas_object_key_ungrab
2929  */
2930 EAPI Eina_Bool         evas_object_focus_get             (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
2931
2932
2933 /**
2934  * Sets the layer of the its canvas that the given object will be part
2935  * of.
2936  *
2937  * @param   obj The given Evas object.
2938  * @param   l   The number of the layer to place the object on.
2939  *          Must be between #EVAS_LAYER_MIN and #EVAS_LAYER_MAX.
2940  *
2941  * If you don't use this function, you'll be dealing with an @b unique
2942  * layer of objects, the default one. Additional layers are handy when
2943  * you don't want a set of objects to interfere with another set with
2944  * regard to @b stacking. Two layers are completely disjoint in that
2945  * matter.
2946  *
2947  * This is a low-level function, which you'd be using when something
2948  * should be always on top, for example.
2949  *
2950  * @warning Be careful, it doesn't make sense to change the layer of
2951  * smart objects' children. Smart objects have a layer of their own,
2952  * which should contain all their children objects.
2953  *
2954  * @see evas_object_layer_get()
2955  */
2956 EAPI void              evas_object_layer_set             (Evas_Object *obj, short l) EINA_ARG_NONNULL(1);
2957
2958 /**
2959  * Retrieves the layer of its canvas that the given object is part of.
2960  *
2961  * @param   obj The given Evas object to query layer from
2962  * @return  Number of the its layer
2963  *
2964  * @see evas_object_layer_set()
2965  */
2966 EAPI short             evas_object_layer_get             (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
2967
2968
2969 /**
2970  * Sets the name of the given Evas object to the given name.
2971  *
2972  * @param   obj  The given object.
2973  * @param   name The given name.
2974  *
2975  * There might be occasions where one would like to name his/her
2976  * objects.
2977  *
2978  * Example:
2979  * @dontinclude evas-events.c
2980  * @skip d.bg = evas_object_rectangle_add(d.canvas);
2981  * @until evas_object_name_set(d.bg, "our dear rectangle");
2982  *
2983  * See the full @ref Example_Evas_Events "example".
2984  */
2985 EAPI void              evas_object_name_set              (Evas_Object *obj, const char *name) EINA_ARG_NONNULL(1);
2986
2987 /**
2988  * Retrieves the name of the given Evas object.
2989  *
2990  * @param   obj The given object.
2991  * @return  The name of the object or @c NULL, if no name has been given
2992  *          to it.
2993  *
2994  * Example:
2995  * @dontinclude evas-events.c
2996  * @skip fprintf(stdout, "An object got focused: %s\n",
2997  * @until evas_focus_get
2998  *
2999  * See the full @ref Example_Evas_Events "example".
3000  */
3001 EAPI const char       *evas_object_name_get              (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
3002
3003
3004 /**
3005  * Increments object reference count to defer its deletion.
3006  *
3007  * @param obj The given Evas object to reference
3008  *
3009  * This increments the reference count of an object, which if greater
3010  * than 0 will defer deletion by evas_object_del() until all
3011  * references are released back (counter back to 0). References cannot
3012  * go below 0 and unreferencing past that will result in the reference
3013  * count being limited to 0. References are limited to <c>2^32 - 1</c>
3014  * for an object. Referencing it more than this will result in it
3015  * being limited to this value.
3016  *
3017  * @see evas_object_unref()
3018  * @see evas_object_del()
3019  *
3020  * @note This is a <b>very simple<b> reference counting mechanism! For
3021  * instance, Evas is not ready to check for pending references on a
3022  * canvas deletion, or things like that. This is useful on scenarios
3023  * where, inside a code block, callbacks exist which would possibly
3024  * delete an object we are operating on afterwards. Then, one would
3025  * evas_object_ref() it on the beginning of the block and
3026  * evas_object_unref() it on the end. It would then be deleted at this
3027  * point, if it should be.
3028  *
3029  * Example:
3030  * @code
3031  *  evas_object_ref(obj);
3032  *
3033  *  // action here...
3034  *  evas_object_smart_callback_call(obj, SIG_SELECTED, NULL);
3035  *  // more action here...
3036  *  evas_object_unref(obj);
3037  * @endcode
3038  *
3039  * @ingroup Evas_Object_Group_Basic
3040  * @since 1.1.0
3041  */
3042 EAPI void              evas_object_ref                   (Evas_Object *obj);
3043
3044 /**
3045  * Decrements object reference count.
3046  *
3047  * @param obj The given Evas object to unreference
3048  *
3049  * This decrements the reference count of an object. If the object has
3050  * had evas_object_del() called on it while references were more than
3051  * 0, it will be deleted at the time this function is called and puts
3052  * the counter back to 0. See evas_object_ref() for more information.
3053  *
3054  * @see evas_object_ref() (for an example)
3055  * @see evas_object_del()
3056  *
3057  * @ingroup Evas_Object_Group_Basic
3058  * @since 1.1.0
3059  */
3060 EAPI void              evas_object_unref                 (Evas_Object *obj);
3061
3062
3063 /**
3064  * Marks the given Evas object for deletion (when Evas will free its
3065  * memory).
3066  *
3067  * @param obj The given Evas object.
3068  *
3069  * This call will mark @p obj for deletion, which will take place
3070  * whenever it has no more references to it (see evas_object_ref() and
3071  * evas_object_unref()).
3072  *
3073  * At actual deletion time, which may or may not be just after this
3074  * call, ::EVAS_CALLBACK_DEL and ::EVAS_CALLBACK_FREE callbacks will
3075  * be called. If the object currently had the focus, its
3076  * ::EVAS_CALLBACK_FOCUS_OUT callback will also be called.
3077  *
3078  * @see evas_object_ref()
3079  * @see evas_object_unref()
3080  *
3081  * @ingroup Evas_Object_Group_Basic
3082  */
3083 EAPI void              evas_object_del                   (Evas_Object *obj) EINA_ARG_NONNULL(1);
3084
3085 /**
3086  * Move the given Evas object to the given location inside its
3087  * canvas' viewport.
3088  *
3089  * @param obj The given Evas object.
3090  * @param x   X position to move the object to, in canvas units.
3091  * @param y   Y position to move the object to, in canvas units.
3092  *
3093  * Besides being moved, the object's ::EVAS_CALLBACK_MOVE callback
3094  * will be called.
3095  *
3096  * @note Naturally, newly created objects are placed at the canvas'
3097  * origin: <code>0, 0</code>.
3098  *
3099  * Example:
3100  * @dontinclude evas-object-manipulation.c
3101  * @skip evas_object_image_border_set(d.clipper_border, 3, 3, 3, 3);
3102  * @until evas_object_show
3103  *
3104  * See the full @ref Example_Evas_Object_Manipulation "example".
3105  *
3106  * @ingroup Evas_Object_Group_Basic
3107  */
3108 EAPI void              evas_object_move                  (Evas_Object *obj, Evas_Coord x, Evas_Coord y) EINA_ARG_NONNULL(1);
3109
3110 /**
3111  * Changes the size of the given Evas object.
3112  *
3113  * @param obj The given Evas object.
3114  * @param w   The new width of the Evas object.
3115  * @param h   The new height of the Evas object.
3116  *
3117  * Besides being resized, the object's ::EVAS_CALLBACK_RESIZE callback
3118  * will be called.
3119  *
3120  * @note Newly created objects have zeroed dimensions. Then, you most
3121  * probably want to use evas_object_resize() on them after they are
3122  * created.
3123  *
3124  * @note Be aware that resizing an object changes its drawing area,
3125  * but that does imply the object is rescaled! For instance, images
3126  * are filled inside their drawing area using the specifications of
3127  * evas_object_image_fill_set(). Thus to scale the image to match
3128  * exactly your drawing area, you need to change the
3129  * evas_object_image_fill_set() as well.
3130  *
3131  * @note This is more evident in images, but text, textblock, lines
3132  * and polygons will behave similarly. Check their specific APIs to
3133  * know how to achieve your desired behavior. Consider the following
3134  * example:
3135  *
3136  * @code
3137  * // rescale image to fill exactly its area without tiling:
3138  * evas_object_resize(img, w, h);
3139  * evas_object_image_fill_set(img, 0, 0, w, h);
3140  * @endcode
3141  *
3142  * @ingroup Evas_Object_Group_Basic
3143  */
3144 EAPI void              evas_object_resize                (Evas_Object *obj, Evas_Coord w, Evas_Coord h) EINA_ARG_NONNULL(1);
3145
3146 /**
3147  * Retrieves the position and (rectangular) size of the given Evas
3148  * object.
3149  *
3150  * @param obj The given Evas object.
3151  * @param x Pointer to an integer in which to store the X coordinate
3152  *          of the object.
3153  * @param y Pointer to an integer in which to store the Y coordinate
3154  *          of the object.
3155  * @param w Pointer to an integer in which to store the width of the
3156  *          object.
3157  * @param h Pointer to an integer in which to store the height of the
3158  *          object.
3159  *
3160  * The position, naturally, will be relative to the top left corner of
3161  * the canvas' viewport.
3162  *
3163  * @note Use @c NULL pointers on the geometry components you're not
3164  * interested in: they'll be ignored by the function.
3165  *
3166  * Example:
3167  * @dontinclude evas-events.c
3168  * @skip int w, h, cw, ch;
3169  * @until return
3170  *
3171  * See the full @ref Example_Evas_Events "example".
3172  *
3173  * @ingroup Evas_Object_Group_Basic
3174  */
3175 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);
3176
3177
3178 /**
3179  * Makes the given Evas object visible.
3180  *
3181  * @param obj The given Evas object.
3182  *
3183  * Besides becoming visible, the object's ::EVAS_CALLBACK_SHOW
3184  * callback will be called.
3185  *
3186  * @see evas_object_hide() for more on object visibility.
3187  * @see evas_object_visible_get()
3188  *
3189  * @ingroup Evas_Object_Group_Basic
3190  */
3191 EAPI void              evas_object_show                  (Evas_Object *obj) EINA_ARG_NONNULL(1);
3192
3193 /**
3194  * Makes the given Evas object invisible.
3195  *
3196  * @param obj The given Evas object.
3197  *
3198  * Hidden objects, besides not being shown at all in your canvas,
3199  * won't be checked for changes on the canvas rendering
3200  * process. Furthermore, they will not catch input events. Thus, they
3201  * are much ligher (in processing needs) than an object that is
3202  * invisible due to indirect causes, such as being clipped or out of
3203  * the canvas' viewport.
3204  *
3205  * Besides becoming hidden, @p obj object's ::EVAS_CALLBACK_SHOW
3206  * callback will be called.
3207  *
3208  * @note All objects are created in the hidden state! If you want them
3209  * shown, use evas_object_show() after their creation.
3210  *
3211  * @see evas_object_show()
3212  * @see evas_object_visible_get()
3213  *
3214  * Example:
3215  * @dontinclude evas-object-manipulation.c
3216  * @skip if (evas_object_visible_get(d.clipper))
3217  * @until return
3218  *
3219  * See the full @ref Example_Evas_Object_Manipulation "example".
3220  *
3221  * @ingroup Evas_Object_Group_Basic
3222  */
3223 EAPI void              evas_object_hide                  (Evas_Object *obj) EINA_ARG_NONNULL(1);
3224
3225 /**
3226  * Retrieves whether or not the given Evas object is visible.
3227  *
3228  * @param   obj The given Evas object.
3229  * @return @c EINA_TRUE if the object is visible, @c EINA_FALSE
3230  * otherwise.
3231  *
3232  * This retrieves an object's visibily as the one enforced by
3233  * evas_object_show() and evas_object_hide().
3234  *
3235  * @note The value returned isn't, by any means, influenced by
3236  * clippers covering @obj, it being out of its canvas' viewport or
3237  * stacked below other object.
3238  *
3239  * @see evas_object_show()
3240  * @see evas_object_hide() (for an example)
3241  *
3242  * @ingroup Evas_Object_Group_Basic
3243  */
3244 EAPI Eina_Bool         evas_object_visible_get           (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
3245
3246
3247 /**
3248  * Sets the general/main color of the given Evas object to the given
3249  * one.
3250  *
3251  * @param obj The given Evas object.
3252  * @param r   The red component of the given color.
3253  * @param g   The green component of the given color.
3254  * @param b   The blue component of the given color.
3255  * @param a   The alpha component of the given color.
3256  *
3257  * @see evas_object_color_get() (for an example)
3258  *
3259  * @ingroup Evas_Object_Group_Basic
3260  */
3261 EAPI void              evas_object_color_set             (Evas_Object *obj, int r, int g, int b, int a) EINA_ARG_NONNULL(1);
3262
3263 /**
3264  * Retrieves the general/main color of the given Evas object.
3265  *
3266  * @param obj The given Evas object to retrieve color from.
3267  * @param r Pointer to an integer in which to store the red component
3268  *          of the color.
3269  * @param g Pointer to an integer in which to store the green
3270  *          component of the color.
3271  * @param b Pointer to an integer in which to store the blue component
3272  *          of the color.
3273  * @param a Pointer to an integer in which to store the alpha
3274  *          component of the color.
3275  *
3276  * Retrieves the “main” color's RGB component (and alpha channel)
3277  * values, <b>which range from 0 to 255</b>. For the alpha channel,
3278  * which defines the object's transparency level, the former value
3279  * means totally trasparent, while the latter means opaque.
3280  *
3281  * Usually you’ll use this attribute for text and rectangle objects,
3282  * where the “main” color is their unique one. If set for objects
3283  * which themselves have colors, like the images one, those colors get
3284  * modulated by this one.
3285  *
3286  * @note All newly created Evas rectangles get the default color
3287  * values of <code>255 255 255 255</code> (opaque white).
3288  *
3289  * @note Use @c NULL pointers on the components you're not interested
3290  * in: they'll be ignored by the function.
3291  *
3292  * Example:
3293  * @dontinclude evas-object-manipulation.c
3294  * @skip int alpha, r, g, b;
3295  * @until return
3296  *
3297  * See the full @ref Example_Evas_Object_Manipulation "example".
3298  *
3299  * @ingroup Evas_Object_Group_Basic
3300  */
3301 EAPI void              evas_object_color_get             (const Evas_Object *obj, int *r, int *g, int *b, int *a) EINA_ARG_NONNULL(1);
3302
3303
3304 /**
3305  * Retrieves the Evas canvas that the given object lives on.
3306  *
3307  * @param   obj The given Evas object.
3308  * @return  A pointer to the canvas where the object is on.
3309  *
3310  * This function is most useful at code contexts where you need to
3311  * operate on the canvas but have only the object pointer.
3312  *
3313  * @ingroup Evas_Object_Group_Basic
3314  */
3315 EAPI Evas             *evas_object_evas_get              (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
3316
3317 /**
3318  * Retrieves the type of the given Evas object.
3319  *
3320  * @param obj The given object.
3321  * @return The type of the object.
3322  *
3323  * For Evas' builtin types, the return strings will be one of:
3324  *   - <c>"rectangle"</c>,
3325  *   - <c>"line"</c>,
3326  *   - <c>"polygon"</c>,
3327  *   - <c>"text"</c>,
3328  *   - <c>"textblock"</c> and
3329  *   - <c>"image"</c>.
3330  *
3331  * For Evas smart objects (see @ref Evas_Smart_Group), the name of the
3332  * smart class itself is returned on this call. For the built-in smart
3333  * objects, these names are:
3334  *   - <c>"EvasObjectSmartClipped"</c>, for the clipped smart object
3335  *   - <c>"Evas_Object_Box"</c>, for the box object and
3336  *   - <c>"Evas_Object_Table"</c>, for the table object.
3337  *
3338  * Example:
3339  * @dontinclude evas-object-manipulation.c
3340  * @skip d.img = evas_object_image_filled_add(d.canvas);
3341  * @until border on the
3342  *
3343  * See the full @ref Example_Evas_Object_Manipulation "example".
3344  */
3345 EAPI const char       *evas_object_type_get              (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
3346
3347 /**
3348  * Raise @p obj to the bottom of its layer.
3349  *
3350  * @param obj the object to raise
3351  *
3352  * @p obj will, then, be the highest one in the layer it belongs
3353  * to. Object on other layers won't get touched.
3354  *
3355  * @see evas_object_stack_above()
3356  * @see evas_object_stack_below()
3357  * @see evas_object_lower()
3358  */
3359 EAPI void              evas_object_raise                 (Evas_Object *obj) EINA_ARG_NONNULL(1);
3360
3361 /**
3362  * Lower @p obj to the bottom of its layer.
3363  *
3364  * @param obj the object to lower
3365  *
3366  * @p obj will, then, be the lowest one in the layer it belongs
3367  * to. Objects on other layers won't get touched.
3368  *
3369  * @see evas_object_stack_above()
3370  * @see evas_object_stack_below()
3371  * @see evas_object_raise()
3372  */
3373 EAPI void              evas_object_lower                 (Evas_Object *obj) EINA_ARG_NONNULL(1);
3374
3375 /**
3376  * Stack @p obj immediately above @p above
3377  *
3378  * @param obj the object to stack
3379  * @param above the object above which to stack
3380  *
3381  * Objects, in a given canvas, are stacked in the order they get added
3382  * to it.  This means that, if they overlap, the highest ones will
3383  * cover the lowest ones, in that order. This function is a way to
3384  * change the stacking order for the objects.
3385  *
3386  * This function is intended to be used with <b>objects belonging to
3387  * the same layer</b> in a given canvas, otherwise it will fail (and
3388  * accomplish nothing).
3389  *
3390  * If you have smart objects on your canvas and @p obj is a member of
3391  * one of them, then @p above must also be a member of the same
3392  * smart object.
3393  *
3394  * Similarly, if @p obj is not a member of a smart object, @p above
3395  * must not be either.
3396  *
3397  * @see evas_object_layer_get()
3398  * @see evas_object_layer_set()
3399  * @see evas_object_stack_below()
3400  */
3401 EAPI void              evas_object_stack_above           (Evas_Object *obj, Evas_Object *above) EINA_ARG_NONNULL(1, 2);
3402
3403 /**
3404  * Stack @p obj immediately below @p below
3405  *
3406  * @param obj the object to stack
3407  * @param below the object below which to stack
3408  *
3409  * Objects, in a given canvas, are stacked in the order they get added
3410  * to it.  This means that, if they overlap, the highest ones will
3411  * cover the lowest ones, in that order. This function is a way to
3412  * change the stacking order for the objects.
3413  *
3414  * This function is intended to be used with <b>objects belonging to
3415  * the same layer</b> in a given canvas, otherwise it will fail (and
3416  * accomplish nothing).
3417  *
3418  * If you have smart objects on your canvas and @p obj is a member of
3419  * one of them, then @p below must also be a member of the same
3420  * smart object.
3421  *
3422  * Similarly, if @p obj is not a member of a smart object, @p below
3423  * must not be either.
3424  *
3425  * @see evas_object_layer_get()
3426  * @see evas_object_layer_set()
3427  * @see evas_object_stack_below()
3428  */
3429 EAPI void              evas_object_stack_below           (Evas_Object *obj, Evas_Object *below) EINA_ARG_NONNULL(1, 2);
3430
3431 /**
3432  * Get the Evas object stacked right above @p obj
3433  *
3434  * @param obj an #Evas_Object
3435  * @return the #Evas_Object directly above @p obj, if any, or @c NULL,
3436  * if none
3437  *
3438  * This function will traverse layers in its search, if there are
3439  * objects on layers above the one @p obj is placed at.
3440  *
3441  * @see evas_object_layer_get()
3442  * @see evas_object_layer_set()
3443  * @see evas_object_below_get()
3444  *
3445  */
3446 EAPI Evas_Object      *evas_object_above_get             (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
3447
3448 /**
3449  * Get the Evas object stacked right below @p obj
3450  *
3451  * @param obj an #Evas_Object
3452  * @return the #Evas_Object directly below @p obj, if any, or @c NULL,
3453  * if none
3454  *
3455  * This function will traverse layers in its search, if there are
3456  * objects on layers below the one @p obj is placed at.
3457  *
3458  * @see evas_object_layer_get()
3459  * @see evas_object_layer_set()
3460  * @see evas_object_below_set()
3461  */
3462 EAPI Evas_Object      *evas_object_below_get             (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
3463
3464 /**
3465  * @}
3466  */
3467
3468 /**
3469  * @defgroup Evas_Object_Group_Events Object Events
3470  *
3471  * Objects generate events when they are moved, resized, when their
3472  * visibility change, when they are deleted and so on. These methods
3473  * allow one to be notified about and to handle such events.
3474  *
3475  * Objects also generate events on input (keyboard and mouse), if they
3476  * accept them (are visible, focused, etc).
3477  *
3478  * For each of those events, Evas provides a way for one to register
3479  * callback functions to be issued just after they happen.
3480  *
3481  * The following figure illustrates some Evas (event) callbacks:
3482  * @image html evas-callbacks.png
3483  * @image rtf evas-callbacks.png
3484  * @image latex evas-callbacks.eps
3485  *
3486  * Thees events have their values in the #Evas_Callback_Type
3487  * enumeration, which has also ones happening on the canvas level (se
3488  * #Evas_Canvas_Events).
3489  *
3490  * Examples on this group of functions can be found @ref
3491  * Example_Evas_Stacking "here" and @ref Example_Evas_Events "here".
3492  *
3493  * @ingroup Evas_Object_Group
3494  */
3495
3496 /**
3497  * @addtogroup Evas_Object_Group_Events
3498  * @{
3499  */
3500
3501 /**
3502  * Add (register) a callback function to a given Evas object event.
3503  *
3504  * @param obj Object to attach a callback to
3505  * @param type The type of event that will trigger the callback
3506  * @param func The function to be called when the event is triggered
3507  * @param data The data pointer to be passed to @p func
3508  *
3509  * This function adds a function callback to an object when the event
3510  * of type @p type occurs on object @p obj. The function is @p func.
3511  *
3512  * In the event of a memory allocation error during addition of the
3513  * callback to the object, evas_alloc_error() should be used to
3514  * determine the nature of the error, if any, and the program should
3515  * sensibly try and recover.
3516  *
3517  * A callback function must have the ::Evas_Object_Event_Cb prototype
3518  * definition. The first parameter (@p data) in this definition will
3519  * have the same value passed to evas_object_event_callback_add() as
3520  * the @p data parameter, at runtime. The second parameter @p e is the
3521  * canvas pointer on which the event occurred. The third parameter is
3522  * a pointer to the object on which event occurred. Finally, the
3523  * fourth parameter @p event_info is a pointer to a data structure
3524  * that may or may not be passed to the callback, depending on the
3525  * event type that triggered the callback. This is so because some
3526  * events don't carry extra context with them, but others do.
3527  *
3528  * The event type @p type to trigger the function may be one of
3529  * #EVAS_CALLBACK_MOUSE_IN, #EVAS_CALLBACK_MOUSE_OUT,
3530  * #EVAS_CALLBACK_MOUSE_DOWN, #EVAS_CALLBACK_MOUSE_UP,
3531  * #EVAS_CALLBACK_MOUSE_MOVE, #EVAS_CALLBACK_MOUSE_WHEEL,
3532  * #EVAS_CALLBACK_MULTI_DOWN, #EVAS_CALLBACK_MULTI_UP,
3533  * #EVAS_CALLBACK_MULTI_MOVE, #EVAS_CALLBACK_FREE,
3534  * #EVAS_CALLBACK_KEY_DOWN, #EVAS_CALLBACK_KEY_UP,
3535  * #EVAS_CALLBACK_FOCUS_IN, #EVAS_CALLBACK_FOCUS_OUT,
3536  * #EVAS_CALLBACK_SHOW, #EVAS_CALLBACK_HIDE, #EVAS_CALLBACK_MOVE,
3537  * #EVAS_CALLBACK_RESIZE, #EVAS_CALLBACK_RESTACK, #EVAS_CALLBACK_DEL,
3538  * #EVAS_CALLBACK_HOLD, #EVAS_CALLBACK_CHANGED_SIZE_HINTS,
3539  * #EVAS_CALLBACK_IMAGE_PRELOADED or #EVAS_CALLBACK_IMAGE_UNLOADED.
3540  *
3541  * This determines the kind of event that will trigger the callback.
3542  * What follows is a list explaining better the nature of each type of
3543  * event, along with their associated @p event_info pointers:
3544  *
3545  * - #EVAS_CALLBACK_MOUSE_IN: @p event_info is a pointer to an
3546  *   #Evas_Event_Mouse_In struct\n\n
3547  *   This event is triggered when the mouse pointer enters the area
3548  *   (not shaded by other objects) of the object @p obj. This may
3549  *   occur by the mouse pointer being moved by
3550  *   evas_event_feed_mouse_move() calls, or by the object being shown,
3551  *   raised, moved, resized, or other objects being moved out of the
3552  *   way, hidden or lowered, whatever may cause the mouse pointer to
3553  *   get on top of @p obj, having been on top of another object
3554  *   previously.
3555  *
3556  * - #EVAS_CALLBACK_MOUSE_OUT: @p event_info is a pointer to an
3557  *   #Evas_Event_Mouse_Out struct\n\n
3558  *   This event is triggered exactly like #EVAS_CALLBACK_MOUSE_IN is,
3559  *   but it occurs when the mouse pointer exits an object's area. Note
3560  *   that no mouse out events will be reported if the mouse pointer is
3561  *   implicitly grabbed to an object (mouse buttons are down, having
3562  *   been pressed while the pointer was over that object). In these
3563  *   cases, mouse out events will be reported once all buttons are
3564  *   released, if the mouse pointer has left the object's area. The
3565  *   indirect ways of taking off the mouse pointer from an object,
3566  *   like cited above, for #EVAS_CALLBACK_MOUSE_IN, also apply here,
3567  *   naturally.
3568  *
3569  * - #EVAS_CALLBACK_MOUSE_DOWN: @p event_info is a pointer to an
3570  *   #Evas_Event_Mouse_Down struct\n\n
3571  *   This event is triggered by a mouse button being pressed while the
3572  *   mouse pointer is over an object. If the pointer mode for Evas is
3573  *   #EVAS_OBJECT_POINTER_MODE_AUTOGRAB (default), this causes this
3574  *   object to <b>passively grab the mouse</b> until all mouse buttons
3575  *   have been released: all future mouse events will be reported to
3576  *   only this object until no buttons are down. That includes mouse
3577  *   move events, mouse in and mouse out events, and further button
3578  *   presses. When all buttons are released, event propagation will
3579  *   occur as normal (see #Evas_Object_Pointer_Mode).
3580  *
3581  * - #EVAS_CALLBACK_MOUSE_UP: @p event_info is a pointer to an
3582  *   #Evas_Event_Mouse_Up struct\n\n
3583  *   This event is triggered by a mouse button being released while
3584  *   the mouse pointer is over an object's area (or when passively
3585  *   grabbed to an object).
3586  *
3587  * - #EVAS_CALLBACK_MOUSE_MOVE: @p event_info is a pointer to an
3588  *   #Evas_Event_Mouse_Move struct\n\n
3589  *   This event is triggered by the mouse pointer being moved while
3590  *   over an object's area (or while passively grabbed to an object).
3591  *
3592  * - #EVAS_CALLBACK_MOUSE_WHEEL: @p event_info is a pointer to an
3593  *   #Evas_Event_Mouse_Wheel struct\n\n
3594  *   This event is triggered by the mouse wheel being rolled while the
3595  *   mouse pointer is over an object (or passively grabbed to an
3596  *   object).
3597  *
3598  * - #EVAS_CALLBACK_MULTI_DOWN: @p event_info is a pointer to an
3599  *   #Evas_Event_Multi_Down struct
3600  *
3601  * - #EVAS_CALLBACK_MULTI_UP: @p event_info is a pointer to an
3602  *   #Evas_Event_Multi_Up struct
3603  *
3604  * - #EVAS_CALLBACK_MULTI_MOVE: @p event_info is a pointer to an
3605  *   #Evas_Event_Multi_Move struct
3606  *
3607  * - #EVAS_CALLBACK_FREE: @p event_info is @c NULL \n\n
3608  *   This event is triggered just before Evas is about to free all
3609  *   memory used by an object and remove all references to it. This is
3610  *   useful for programs to use if they attached data to an object and
3611  *   want to free it when the object is deleted. The object is still
3612  *   valid when this callback is called, but after it returns, there
3613  *   is no guarantee on the object's validity.
3614  *
3615  * - #EVAS_CALLBACK_KEY_DOWN: @p event_info is a pointer to an
3616  *   #Evas_Event_Key_Down struct\n\n
3617  *   This callback is called when a key is pressed and the focus is on
3618  *   the object, or a key has been grabbed to a particular object
3619  *   which wants to intercept the key press regardless of what object
3620  *   has the focus.
3621  *
3622  * - #EVAS_CALLBACK_KEY_UP: @p event_info is a pointer to an
3623  *   #Evas_Event_Key_Up struct \n\n
3624  *   This callback is called when a key is released and the focus is
3625  *   on the object, or a key has been grabbed to a particular object
3626  *   which wants to intercept the key release regardless of what
3627  *   object has the focus.
3628  *
3629  * - #EVAS_CALLBACK_FOCUS_IN: @p event_info is @c NULL \n\n
3630  *   This event is called when an object gains the focus. When it is
3631  *   called the object has already gained the focus.
3632  *
3633  * - #EVAS_CALLBACK_FOCUS_OUT: @p event_info is @c NULL \n\n
3634  *   This event is triggered when an object loses the focus. When it
3635  *   is called the object has already lost the focus.
3636  *
3637  * - #EVAS_CALLBACK_SHOW: @p event_info is @c NULL \n\n
3638  *   This event is triggered by the object being shown by
3639  *   evas_object_show().
3640  *
3641  * - #EVAS_CALLBACK_HIDE: @p event_info is @c NULL \n\n
3642  *   This event is triggered by an object being hidden by
3643  *   evas_object_hide().
3644  *
3645  * - #EVAS_CALLBACK_MOVE: @p event_info is @c NULL \n\n
3646  *   This event is triggered by an object being
3647  *   moved. evas_object_move() can trigger this, as can any
3648  *   object-specific manipulations that would mean the object's origin
3649  *   could move.
3650  *
3651  * - #EVAS_CALLBACK_RESIZE: @p event_info is @c NULL \n\n
3652  *   This event is triggered by an object being resized. Resizes can
3653  *   be triggered by evas_object_resize() or by any object-specific
3654  *   calls that may cause the object to resize.
3655  *
3656  * - #EVAS_CALLBACK_RESTACK: @p event_info is @c NULL \n\n
3657  *   This event is triggered by an object being re-stacked. Stacking
3658  *   changes can be triggered by
3659  *   evas_object_stack_below()/evas_object_stack_above() and others.
3660  *
3661  * - #EVAS_CALLBACK_DEL: @p event_info is @c NULL.
3662  *
3663  * - #EVAS_CALLBACK_HOLD: @p event_info is a pointer to an
3664  *   #Evas_Event_Hold struct
3665  *
3666  * - #EVAS_CALLBACK_CHANGED_SIZE_HINTS: @p event_info is @c NULL.
3667  *
3668  * - #EVAS_CALLBACK_IMAGE_PRELOADED: @p event_info is @c NULL.
3669  *
3670  * - #EVAS_CALLBACK_IMAGE_UNLOADED: @p event_info is @c NULL.
3671  *
3672  * @note Be careful not to add the same callback multiple times, if
3673  * that's not what you want, because Evas won't check if a callback
3674  * existed before exactly as the one being registered (and thus, call
3675  * it more than once on the event, in this case). This would make
3676  * sense if you passed different functions and/or callback data, only.
3677  *
3678  * Example:
3679  * @dontinclude evas-events.c
3680  * @skip evas_object_event_callback_add(
3681  * @until }
3682  *
3683  * See the full example @ref Example_Evas_Events "here".
3684  *
3685  */
3686    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);
3687
3688 /**
3689  * Delete a callback function from an object
3690  *
3691  * @param obj Object to remove a callback from
3692  * @param type The type of event that was triggering the callback
3693  * @param func The function that was to be called when the event was triggered
3694  * @return The data pointer that was to be passed to the callback
3695  *
3696  * This function removes the most recently added callback from the
3697  * object @p obj which was triggered by the event type @p type and was
3698  * calling the function @p func when triggered. If the removal is
3699  * successful it will also return the data pointer that was passed to
3700  * evas_object_event_callback_add() when the callback was added to the
3701  * object. If not successful NULL will be returned.
3702  *
3703  * Example:
3704  * @code
3705  * extern Evas_Object *object;
3706  * void *my_data;
3707  * void up_callback(void *data, Evas *e, Evas_Object *obj, void *event_info);
3708  *
3709  * my_data = evas_object_event_callback_del(object, EVAS_CALLBACK_MOUSE_UP, up_callback);
3710  * @endcode
3711  */
3712 EAPI void             *evas_object_event_callback_del     (Evas_Object *obj, Evas_Callback_Type type, Evas_Object_Event_Cb func) EINA_ARG_NONNULL(1, 3);
3713
3714 /**
3715  * Delete (unregister) a callback function registered to a given
3716  * Evas object event.
3717  *
3718  * @param obj Object to remove a callback from
3719  * @param type The type of event that was triggering the callback
3720  * @param func The function that was to be called when the event was
3721  * triggered
3722  * @param data The data pointer that was to be passed to the callback
3723  * @return The data pointer that was to be passed to the callback
3724  *
3725  * This function removes the most recently added callback from the
3726  * object @p obj, which was triggered by the event type @p type and was
3727  * calling the function @p func with data @p data, when triggered. If
3728  * the removal is successful it will also return the data pointer that
3729  * was passed to evas_object_event_callback_add() (that will be the
3730  * same as the parameter) when the callback was added to the
3731  * object. In errors, @c NULL will be returned.
3732  *
3733  * @note For deletion of Evas object events callbacks filtering by
3734  * just type and function pointer, user
3735  * evas_object_event_callback_del().
3736  *
3737  * Example:
3738  * @code
3739  * extern Evas_Object *object;
3740  * void *my_data;
3741  * void up_callback(void *data, Evas *e, Evas_Object *obj, void *event_info);
3742  *
3743  * my_data = evas_object_event_callback_del_full(object, EVAS_CALLBACK_MOUSE_UP, up_callback, data);
3744  * @endcode
3745  */
3746 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);
3747
3748
3749 /**
3750  * Set whether an Evas object is to pass (ignore) events.
3751  *
3752  * @param obj the Evas object to operate on
3753  * @param pass whether @p obj is to pass events (@c EINA_TRUE) or not
3754  * (@c EINA_FALSE)
3755  *
3756  * If @p pass is @c EINA_TRUE, it will make events on @p obj to be @b
3757  * ignored. They will be triggered on the @b next lower object (that
3758  * is not set to pass events), instead (see evas_object_below_get()).
3759  *
3760  * If @p pass is @c EINA_FALSE, events will be processed on that
3761  * object as normal.
3762  *
3763  * @see evas_object_pass_events_get() for an example
3764  * @see evas_object_repeat_events_set()
3765  * @see evas_object_propagate_events_set()
3766  */
3767 EAPI void              evas_object_pass_events_set        (Evas_Object *obj, Eina_Bool pass) EINA_ARG_NONNULL(1);
3768
3769 /**
3770  * Determine whether an object is set to pass (ignore) events.
3771  *
3772  * @param obj the Evas object to get information from.
3773  * @return pass whether @p obj is set to pass events (@c EINA_TRUE) or not
3774  * (@c EINA_FALSE)
3775  *
3776  * Example:
3777  * @dontinclude evas-stacking.c
3778  * @skip if (strcmp(ev->keyname, "p") == 0)
3779  * @until }
3780  *
3781  * See the full @ref Example_Evas_Stacking "example".
3782  *
3783  * @see evas_object_pass_events_set()
3784  * @see evas_object_repeat_events_get()
3785  * @see evas_object_propagate_events_get()
3786  */
3787 EAPI Eina_Bool         evas_object_pass_events_get        (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
3788
3789 /**
3790  * Set whether an Evas object is to repeat events.
3791  *
3792  * @param obj the Evas object to operate on
3793  * @param repeat whether @p obj is to repeat events (@c EINA_TRUE) or not
3794  * (@c EINA_FALSE)
3795  *
3796  * If @p repeat is @c EINA_TRUE, it will make events on @p obj to also
3797  * be repeated for the @b next lower object in the objects' stack (see
3798  * see evas_object_below_get()).
3799  *
3800  * If @p repeat is @c EINA_FALSE, events occurring on @p obj will be
3801  * processed only on it.
3802  *
3803  * Example:
3804  * @dontinclude evas-stacking.c
3805  * @skip if (strcmp(ev->keyname, "r") == 0)
3806  * @until }
3807  *
3808  * See the full @ref Example_Evas_Stacking "example".
3809  *
3810  * @see evas_object_repeat_events_get()
3811  * @see evas_object_pass_events_get()
3812  * @see evas_object_propagate_events_get()
3813  */
3814 EAPI void              evas_object_repeat_events_set      (Evas_Object *obj, Eina_Bool repeat) EINA_ARG_NONNULL(1);
3815
3816 /**
3817  * Determine whether an object is set to repeat events.
3818  *
3819  * @param obj the given Evas object pointer
3820  * @retrieve whether @p obj is set to repeat events (@c EINA_TRUE)
3821  * or not (@c EINA_FALSE)
3822  *
3823  * @see evas_object_repeat_events_set() for an example
3824  * @see evas_object_pass_events_set()
3825  * @see evas_object_propagate_events_set()
3826  */
3827 EAPI Eina_Bool         evas_object_repeat_events_get      (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
3828
3829 /**
3830  * Set whether events on a smart object's member should get propagated
3831  * up to its parent.
3832  *
3833  * @param obj the smart object's child to operate on
3834  * @param prop whether to propagate events (@c EINA_TRUE) or not (@c
3835  * EINA_FALSE)
3836  *
3837  * This function has @b no effect if @p obj is not a member of a smart
3838  * object.
3839  *
3840  * If @p prop is @c EINA_TRUE, events occurring on this object will be
3841  * propagated on to the smart object of which @p obj is a member.  If
3842  * @p prop is @c EINA_FALSE, events occurring on this object will @b
3843  * not be propagated on to the smart object of which @p obj is a
3844  * member.  The default value is @c EINA_TRUE.
3845  *
3846  * @see evas_object_event_callback_add()
3847  * @see evas_object_propagate_events_get()
3848  * @see evas_object_repeat_events_get()
3849  * @see evas_object_pass_events_get()
3850  */
3851 EAPI void              evas_object_propagate_events_set   (Evas_Object *obj, Eina_Bool prop) EINA_ARG_NONNULL(1);
3852
3853 /**
3854  * Retrieve whether an Evas object is set to propagate events.
3855  *
3856  * @param obj the given Evas object pointer
3857  * @return whether @p obj is set to propagate events (@c EINA_TRUE)
3858  * or not (@c EINA_FALSE)
3859  *
3860  * @see evas_object_event_callback_add()
3861  * @see evas_object_propagate_events_set()
3862  * @see evas_object_repeat_events_set()
3863  * @see evas_object_pass_events_set()
3864  */
3865 EAPI Eina_Bool         evas_object_propagate_events_get   (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
3866
3867 /**
3868  * @}
3869  */
3870
3871 /**
3872  * @defgroup Evas_Object_Group_Map UV Mapping (Rotation, Perspective, 3D...)
3873  *
3874  * Evas allows different transformations to be applied to all kinds of
3875  * objects. These are applied by means of UV mapping.
3876  *
3877  * With UV mapping, one maps points in the source object to a 3D space
3878  * positioning at target. This allows rotation, perspective, scale and
3879  * lots of other effects, depending on the map that is used.
3880  *
3881  * Each map point may carry a multiplier color. If properly
3882  * calculated, these can do shading effects on the object, producing
3883  * 3D effects.
3884  *
3885  * As usual, Evas provides both the raw and easy to use methods. The
3886  * raw methods allow developer to create its maps somewhere else,
3887  * maybe load them from some file format. The easy to use methods,
3888  * calculate the points given some high-level parameters, such as
3889  * rotation angle, ambient light and so on.
3890  *
3891  * @note applying mapping will reduce performance, so use with
3892  *       care. The impact on performance depends on engine in
3893  *       use. Software is quite optimized, but not as fast as OpenGL.
3894  *
3895  * @section sec-map-points Map points
3896  * @subsection subsec-rotation Rotation
3897  *
3898  * A map consists of a set of points, currently only four are supported. Each
3899  * of these points contains a set of canvas coordinates @c x and @c y that
3900  * can be used to alter the geometry of the mapped object, and a @c z
3901  * coordinate that indicates the depth of that point. This last coordinate
3902  * does not normally affect the map, but it's used by several of the utility
3903  * functions to calculate the right position of the point given other
3904  * parameters.
3905  *
3906  * The coordinates for each point are set with evas_map_point_coord_set().
3907  * The following image shows a map set to match the geometry of an existing
3908  * object.
3909  *
3910  * @image html map-set-map-points-1.png
3911  * @image rtf map-set-map-points-1.png
3912  * @image latex map-set-map-points-1.eps
3913  *
3914  * This is a common practice, so there are a few functions that help make it
3915  * easier.
3916  *
3917  * evas_map_util_points_populate_from_geometry() sets the coordinates of each
3918  * point in the given map to match the rectangle defined by the function
3919  * parameters.
3920  *
3921  * evas_map_util_points_populate_from_object() and
3922  * evas_map_util_points_populate_from_object_full() both take an object and
3923  * set the map points to match its geometry. The difference between the two
3924  * is that the first function sets the @c z value of all points to 0, while
3925  * the latter receives the value to set in said coordinate as a parameter.
3926  *
3927  * The following lines of code all produce the same result as in the image
3928  * above.
3929  * @code
3930  * evas_map_util_points_populate_from_geometry(m, 100, 100, 200, 200, 0);
3931  * // Assuming o is our original object
3932  * evas_object_move(o, 100, 100);
3933  * evas_object_resize(o, 200, 200);
3934  * evas_map_util_points_populate_from_object(m, o);
3935  * evas_map_util_points_populate_from_object_full(m, o, 0);
3936  * @endcode
3937  *
3938  * Several effects can be applied to an object by simply setting each point
3939  * of the map to the right coordinates. For example, a simulated perspective
3940  * could be achieve as follows.
3941  *
3942  * @image html map-set-map-points-2.png
3943  * @image rtf map-set-map-points-2.png
3944  * @image latex map-set-map-points-2.eps
3945  *
3946  * As said before, the @c z coordinate is unused here so when setting points
3947  * by hand, its value is of no importance.
3948  *
3949  * @image html map-set-map-points-3.png
3950  * @image rtf map-set-map-points-3.png
3951  * @image latex map-set-map-points-3.eps
3952  *
3953  * In all three cases above, setting the map to be used by the object is the
3954  * same.
3955  * @code
3956  * evas_object_map_set(o, m);
3957  * evas_object_map_enable_set(o, EINA_TRUE);
3958  * @endcode
3959  *
3960  * Doing things this way, however, is a lot of work that can be avoided by
3961  * using the provided utility functions, as described in the next section.
3962  *
3963  * @section map-utils Utility functions
3964  *
3965  * Utility functions take an already set up map and alter it to produce a
3966  * specific effect. For example, to rotate an object around its own center
3967  * you would need to take the rotation angle, the coordinates of each corner
3968  * of the object and do all the math to get the new set of coordinates that
3969  * need to tbe set in the map.
3970  *
3971  * Or you can use this code:
3972  * @code
3973  * evas_object_geometry_get(o, &x, &y, &w, &h);
3974  * m = evas_map_new(4);
3975  * evas_map_util_points_populate_from_object(m, o);
3976  * evas_map_util_rotate(m, 45, x + (w / 2), y + (h / 2));
3977  * evas_object_map_set(o, m);
3978  * evas_object_map_enable_set(o, EINA_TRUE);
3979  * evas_map_free(m);
3980  * @endcode
3981  *
3982  * Which will rotate the object around its center point in a 45 degree angle
3983  * in the clockwise direction, taking it from this
3984  *
3985  * @image html map-rotation-2d-1.png
3986  * @image rtf map-rotation-2d-1.png
3987  * @image latex map-rotation-2d-1.eps
3988  *
3989  * to this
3990  *
3991  * @image html map-rotation-2d-2.png
3992  * @image rtf map-rotation-2d-2.png
3993  * @image latex map-rotation-2d-2.eps
3994  *
3995  * Objects may be rotated around any other point just by setting the last two
3996  * paramaters of the evas_map_util_rotate() function to the right values. A
3997  * circle of roughly the diameter of the object overlaid on each image shows
3998  * where the center of rotation is set for each example.
3999  *
4000  * For example, this code
4001  * @code
4002  * evas_object_geometry_get(o, &x, &y, &w, &h);
4003  * m = evas_map_new(4);
4004  * evas_map_util_points_populate_from_object(m, o);
4005  * evas_map_util_rotate(m, 45, x + w - 20, y + h - 20);
4006  * evas_object_map_set(o, m);
4007  * evas_object_map_enable_set(o, EINA_TRUE);
4008  * evas_map_free(m);
4009  * @endcode
4010  *
4011  * produces something like
4012  * @image html map-rotation-2d-3.png
4013  * @image rtf map-rotation-2d-3.png
4014  * @image latex map-rotation-2d-3.eps
4015  *
4016  * And the following
4017  * @code
4018  * evas_output_size_get(evas, &w, &h);
4019  * m = evas_map_new(4);
4020  * evas_map_util_points_populate_from_object(m, o);
4021  * evas_map_util_rotate(m, 45, w, h);
4022  * evas_object_map_set(o, m);
4023  * evas_object_map_enable_set(o, EINA_TRUE);
4024  * evas_map_free(m);
4025  * @endcode
4026  *
4027  * rotates the object around the center of the window
4028  * @image html map-rotation-2d-4.png
4029  * @image rtf map-rotation-2d-4.png
4030  * @image latex map-rotation-2d-4.eps
4031  *
4032  * @subsection subsec-3d 3D Maps
4033  *
4034  * Maps can also be used to achieve the effect of 3-dimensionality. When doing
4035  * this, the @c z coordinate of each point counts, with higher values meaning
4036  * the point is further into the screen, and smaller values (negative, usually)
4037  * meaning the point is closwer towards the user.
4038  *
4039  * Thinking in 3D also introduces the concept of back-face of an object. An
4040  * object is said to be facing the user when all its points are placed in a
4041  * clockwise fashion. The next image shows this, with each point showing the
4042  * with which is identified within the map.
4043  *
4044  * @image html map-point-order-face.png
4045  * @image rtf map-point-order-face.png
4046  * @image latex map-point-order-face.eps
4047  *
4048  * Rotating this map around the @c Y axis would leave the order of the points
4049  * in a counter-clockwise fashion, as seen in the following image.
4050  *
4051  * @image html map-point-order-back.png
4052  * @image rtf map-point-order-back.png
4053  * @image latex map-point-order-back.eps
4054  *
4055  * This way we can say that we are looking at the back face of the object.
4056  * This will have stronger implications later when we talk about lighting.
4057  *
4058  * To know if a map is facing towards the user or not it's enough to use
4059  * the evas_map_util_clockwise_get() function, but this is normally done
4060  * after all the other operations are applied on the map.
4061  *
4062  * @subsection subsec-3d-rot 3D rotation and perspective
4063  *
4064  * Much like evas_map_util_rotate(), there's the function
4065  * evas_map_util_3d_rotate() that transforms the map to apply a 3D rotation
4066  * to an object. As in its 2D counterpart, the rotation can be applied around
4067  * any point in the canvas, this time with a @c z coordinate too. The rotation
4068  * can also be around any of the 3 axis.
4069  *
4070  * Starting from this simple setup
4071  *
4072  * @image html map-3d-basic-1.png
4073  * @image rtf map-3d-basic-1.png
4074  * @image latex map-3d-basic-1.eps
4075  *
4076  * and setting maps so that the blue square to rotate on all axis around a
4077  * sphere that uses the object as its center, and the red square to rotate
4078  * around the @c Y axis, we get the following. A simple overlay over the image
4079  * shows the original geometry of each object and the axis around which they
4080  * are being rotated, with the @c Z one not appearing due to being orthogonal
4081  * to the screen.
4082  *
4083  * @image html map-3d-basic-2.png
4084  * @image rtf map-3d-basic-2.png
4085  * @image latex map-3d-basic-2.eps
4086  *
4087  * which doesn't look very real. This can be helped by adding perspective
4088  * to the transformation, which can be simply done by calling
4089  * evas_map_util_3d_perspective() on the map after its position has been set.
4090  * The result in this case, making the vanishing point the center of each
4091  * object:
4092  *
4093  * @image html map-3d-basic-3.png
4094  * @image rtf map-3d-basic-3.png
4095  * @image latex map-3d-basic-3.eps
4096  *
4097  * @section sec-color Color and lighting
4098  *
4099  * Each point in a map can be set to a color, which will be multiplied with
4100  * the objects own color and linearly interpolated in between adjacent points.
4101  * This is done with evas_map_point_color_set() for each point of the map,
4102  * or evas_map_util_points_color_set() to set every point to the same color.
4103  *
4104  * When using 3D effects, colors can be used to improve the looks of them by
4105  * simulating a light source. The evas_map_util_3d_lighting() function makes
4106  * this task easier by taking the coordinates of the light source and its
4107  * color, along with the color of the ambient light. Evas then sets the color
4108  * of each point based on the distance to the light source, the angle with
4109  * which the object is facing the light and the ambient light. Here, the
4110  * orientation of each point as explained before, becomes more important.
4111  * If the map is defined counter-clockwise, the object will be facing away
4112  * from the user and thus become obscured, since no light would be reflecting
4113  * from it.
4114  *
4115  * @image html map-light.png
4116  * @image rtf map-light.png
4117  * @image latex map-light.eps
4118  * @note Object facing the light source
4119  *
4120  * @image html map-light2.png
4121  * @image rtf map-light2.png
4122  * @image latex map-light2.eps
4123  * @note Same object facing away from the user
4124  *
4125  * @section Image mapping
4126  *
4127  * @image html map-uv-mapping-1.png
4128  * @image rtf map-uv-mapping-1.png
4129  * @image latex map-uv-mapping-1.eps
4130  *
4131  * Images need some special handlign when mapped. Evas can easily take care
4132  * of objects and do almost anything with them, but it's completely oblivious
4133  * to the content of images, so each point in the map needs to be told to what
4134  * pixel in the source image it belongs. Failing to do may sometimes result
4135  * in the expected behavior, or it may look like a partial work.
4136  *
4137  * The next image illustrates one possibility of a map being set to an image
4138  * object, without setting the right UV mapping for each point. The objects
4139  * themselves are mapped properly to their new geometry, but the image content
4140  * may not be displayed correctly within the mapped object.
4141  *
4142  * @image html map-uv-mapping-2.png
4143  * @image rtf map-uv-mapping-2.png
4144  * @image latex map-uv-mapping-2.eps
4145  *
4146  * Once Evas knows how to handle the source image within the map, it will
4147  * transform it as needed. This is done with evas_map_point_image_uv_set(),
4148  * which tells the map to which pixel in image it maps.
4149  *
4150  * To match our example images to the maps above all we need is the size of
4151  * each image, which can always be found with evas_object_image_size_get().
4152  *
4153  * @code
4154  * evas_map_point_image_uv_set(m, 0, 0, 0);
4155  * evas_map_point_image_uv_set(m, 1, 150, 0);
4156  * evas_map_point_image_uv_set(m, 2, 150, 200);
4157  * evas_map_point_image_uv_set(m, 3, 0, 200);
4158  * evas_object_map_set(o, m);
4159  * evas_object_map_enable_set(o, EINA_TRUE);
4160  *
4161  * evas_map_point_image_uv_set(m, 0, 0, 0);
4162  * evas_map_point_image_uv_set(m, 1, 120, 0);
4163  * evas_map_point_image_uv_set(m, 2, 120, 160);
4164  * evas_map_point_image_uv_set(m, 3, 0, 160);
4165  * evas_object_map_set(o2, m);
4166  * evas_object_map_enable_set(o2, EINA_TRUE);
4167  * @endcode
4168  *
4169  * To get
4170  *
4171  * @image html map-uv-mapping-3.png
4172  * @image rtf map-uv-mapping-3.png
4173  * @image latex map-uv-mapping-3.eps
4174  *
4175  * Maps can also be set to use part of an image only, or even map them inverted,
4176  * and combined with evas_object_image_source_set() it can be used to achieve
4177  * more interesting results.
4178  *
4179  * @code
4180  * evas_object_image_size_get(evas_object_image_source_get(o), &w, &h);
4181  * evas_map_point_image_uv_set(m, 0, 0, h);
4182  * evas_map_point_image_uv_set(m, 1, w, h);
4183  * evas_map_point_image_uv_set(m, 2, w, h / 3);
4184  * evas_map_point_image_uv_set(m, 3, 0, h / 3);
4185  * evas_object_map_set(o, m);
4186  * evas_object_map_enable_set(o, EINA_TRUE);
4187  * @endcode
4188  *
4189  * @image html map-uv-mapping-4.png
4190  * @image rtf map-uv-mapping-4.png
4191  * @image latex map-uv-mapping-4.eps
4192  *
4193  * Examples:
4194  * @li @ref Example_Evas_Map_Overview
4195  *
4196  * @ingroup Evas_Object_Group
4197  *
4198  * @{
4199  */
4200
4201 /**
4202  * Enable or disable the map that is set.
4203  *
4204  * Enable or disable the use of map for the object @p obj.
4205  * On enable, the object geometry will be saved, and the new geometry will
4206  * change (position and size) to reflect the map geometry set.
4207  *
4208  * If the object doesn't have a map set (with evas_object_map_set()), the
4209  * initial geometry will be undefined. It is advised to always set a map
4210  * to the object first, and then call this function to enable its use.
4211  *
4212  * @param obj object to enable the map on
4213  * @param enabled enabled state
4214  */
4215 EAPI void              evas_object_map_enable_set        (Evas_Object *obj, Eina_Bool enabled);
4216
4217 /**
4218  * Get the map enabled state
4219  *
4220  * This returns the currently enabled state of the map on the object indicated.
4221  * The default map enable state is off. You can enable and disable it with
4222  * evas_object_map_enable_set().
4223  *
4224  * @param obj object to get the map enabled state from
4225  * @return the map enabled state
4226  */
4227 EAPI Eina_Bool         evas_object_map_enable_get        (const Evas_Object *obj);
4228
4229 /**
4230  * Set the map source object
4231  *
4232  * This sets the object from which the map is taken - can be any object that
4233  * has map enabled on it.
4234  *
4235  * Currently not implemented. for future use.
4236  *
4237  * @param obj object to set the map source of
4238  * @param src the source object from which the map is taken
4239  */
4240 EAPI void              evas_object_map_source_set        (Evas_Object *obj, Evas_Object *src);
4241
4242 /**
4243  * Get the map source object
4244  *
4245  * @param obj object to set the map source of
4246  * @return the object set as the source
4247  *
4248  * @see evas_object_map_source_set()
4249  */
4250 EAPI Evas_Object      *evas_object_map_source_get        (const Evas_Object *obj);
4251
4252 /**
4253  * Set current object transformation map.
4254  *
4255  * This sets the map on a given object. It is copied from the @p map pointer,
4256  * so there is no need to keep the @p map object if you don't need it anymore.
4257  *
4258  * A map is a set of 4 points which have canvas x, y coordinates per point,
4259  * with an optional z point value as a hint for perspective correction, if it
4260  * is available. As well each point has u and v coordinates. These are like
4261  * "texture coordinates" in OpenGL in that they define a point in the source
4262  * image that is mapped to that map vertex/point. The u corresponds to the x
4263  * coordinate of this mapped point and v, the y coordinate. Note that these
4264  * coordinates describe a bounding region to sample. If you have a 200x100
4265  * source image and want to display it at 200x100 with proper pixel
4266  * precision, then do:
4267  *
4268  * @code
4269  * Evas_Map *m = evas_map_new(4);
4270  * evas_map_point_coord_set(m, 0,   0,   0, 0);
4271  * evas_map_point_coord_set(m, 1, 200,   0, 0);
4272  * evas_map_point_coord_set(m, 2, 200, 100, 0);
4273  * evas_map_point_coord_set(m, 3,   0, 100, 0);
4274  * evas_map_point_image_uv_set(m, 0,   0,   0);
4275  * evas_map_point_image_uv_set(m, 1, 200,   0);
4276  * evas_map_point_image_uv_set(m, 2, 200, 100);
4277  * evas_map_point_image_uv_set(m, 3,   0, 100);
4278  * evas_object_map_set(obj, m);
4279  * evas_map_free(m);
4280  * @endcode
4281  *
4282  * Note that the map points a uv coordinates match the image geometry. If
4283  * the @p map parameter is NULL, the stored map will be freed and geometry
4284  * prior to enabling/setting a map will be restored.
4285  *
4286  * @param obj object to change transformation map
4287  * @param map new map to use
4288  *
4289  * @see evas_map_new()
4290  */
4291 EAPI void              evas_object_map_set               (Evas_Object *obj, const Evas_Map *map);
4292
4293 /**
4294  * Get current object transformation map.
4295  *
4296  * This returns the current internal map set on the indicated object. It is
4297  * intended for read-only acces and is only valid as long as the object is
4298  * not deleted or the map on the object is not changed. If you wish to modify
4299  * the map and set it back do the following:
4300  *
4301  * @code
4302  * const Evas_Map *m = evas_object_map_get(obj);
4303  * Evas_Map *m2 = evas_map_dup(m);
4304  * evas_map_util_rotate(m2, 30.0, 0, 0);
4305  * evas_object_map_set(obj);
4306  * evas_map_free(m2);
4307  * @endcode
4308  *
4309  * @param obj object to query transformation map.
4310  * @return map reference to map in use. This is an internal data structure, so
4311  * do not modify it.
4312  *
4313  * @see evas_object_map_set()
4314  */
4315 EAPI const Evas_Map   *evas_object_map_get               (const Evas_Object *obj);
4316
4317
4318 /**
4319  * Populate source and destination map points to match exactly object.
4320  *
4321  * Usually one initialize map of an object to match it's original
4322  * position and size, then transform these with evas_map_util_*
4323  * functions, such as evas_map_util_rotate() or
4324  * evas_map_util_3d_rotate(). The original set is done by this
4325  * function, avoiding code duplication all around.
4326  *
4327  * @param m map to change all 4 points (must be of size 4).
4328  * @param obj object to use unmapped geometry to populate map coordinates.
4329  * @param z Point Z Coordinate hint (pre-perspective transform). This value
4330  *        will be used for all four points.
4331  *
4332  * @see evas_map_util_points_populate_from_object()
4333  * @see evas_map_point_coord_set()
4334  * @see evas_map_point_image_uv_set()
4335  */
4336 EAPI void              evas_map_util_points_populate_from_object_full(Evas_Map *m, const Evas_Object *obj, Evas_Coord z);
4337
4338 /**
4339  * Populate source and destination map points to match exactly object.
4340  *
4341  * Usually one initialize map of an object to match it's original
4342  * position and size, then transform these with evas_map_util_*
4343  * functions, such as evas_map_util_rotate() or
4344  * evas_map_util_3d_rotate(). The original set is done by this
4345  * function, avoiding code duplication all around.
4346  *
4347  * Z Point coordinate is assumed as 0 (zero).
4348  *
4349  * @param m map to change all 4 points (must be of size 4).
4350  * @param obj object to use unmapped geometry to populate map coordinates.
4351  *
4352  * @see evas_map_util_points_populate_from_object_full()
4353  * @see evas_map_util_points_populate_from_geometry()
4354  * @see evas_map_point_coord_set()
4355  * @see evas_map_point_image_uv_set()
4356  */
4357 EAPI void              evas_map_util_points_populate_from_object     (Evas_Map *m, const Evas_Object *obj);
4358
4359 /**
4360  * Populate source and destination map points to match given geometry.
4361  *
4362  * Similar to evas_map_util_points_populate_from_object_full(), this
4363  * call takes raw values instead of querying object's unmapped
4364  * geometry. The given width will be used to calculate destination
4365  * points (evas_map_point_coord_set()) and set the image uv
4366  * (evas_map_point_image_uv_set()).
4367  *
4368  * @param m map to change all 4 points (must be of size 4).
4369  * @param x Point X Coordinate
4370  * @param y Point Y Coordinate
4371  * @param w width to use to calculate second and third points.
4372  * @param h height to use to calculate third and fourth points.
4373  * @param z Point Z Coordinate hint (pre-perspective transform). This value
4374  *        will be used for all four points.
4375  *
4376  * @see evas_map_util_points_populate_from_object()
4377  * @see evas_map_point_coord_set()
4378  * @see evas_map_point_image_uv_set()
4379  */
4380 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);
4381
4382 /**
4383  * Set color of all points to given color.
4384  *
4385  * This call is useful to reuse maps after they had 3d lightning or
4386  * any other colorization applied before.
4387  *
4388  * @param m map to change the color of.
4389  * @param r red (0 - 255)
4390  * @param g green (0 - 255)
4391  * @param b blue (0 - 255)
4392  * @param a alpha (0 - 255)
4393  *
4394  * @see evas_map_point_color_set()
4395  */
4396 EAPI void              evas_map_util_points_color_set                (Evas_Map *m, int r, int g, int b, int a);
4397
4398 /**
4399  * Change the map to apply the given rotation.
4400  *
4401  * This rotates the indicated map's coordinates around the center coordinate
4402  * given by @p cx and @p cy as the rotation center. The points will have their
4403  * X and Y coordinates rotated clockwise by @p degrees degress (360.0 is a
4404  * full rotation). Negative values for degrees will rotate counter-clockwise
4405  * by that amount. All coordinates are canvas global coordinates.
4406  *
4407  * @param m map to change.
4408  * @param degrees amount of degrees from 0.0 to 360.0 to rotate.
4409  * @param cx rotation's center horizontal position.
4410  * @param cy rotation's center vertical position.
4411  *
4412  * @see evas_map_point_coord_set()
4413  * @see evas_map_util_zoom()
4414  */
4415 EAPI void              evas_map_util_rotate                          (Evas_Map *m, double degrees, Evas_Coord cx, Evas_Coord cy);
4416
4417 /**
4418  * Change the map to apply the given zooming.
4419  *
4420  * Like evas_map_util_rotate(), this zooms the points of the map from a center
4421  * point. That center is defined by @p cx and @p cy. The @p zoomx and @p zoomy
4422  * parameters specify how much to zoom in the X and Y direction respectively.
4423  * A value of 1.0 means "don't zoom". 2.0 means "dobule the size". 0.5 is
4424  * "half the size" etc. All coordinates are canvas global coordinates.
4425  *
4426  * @param m map to change.
4427  * @param zoomx horizontal zoom to use.
4428  * @param zoomy vertical zoom to use.
4429  * @param cx zooming center horizontal position.
4430  * @param cy zooming center vertical position.
4431  *
4432  * @see evas_map_point_coord_set()
4433  * @see evas_map_util_rotate()
4434  */
4435 EAPI void              evas_map_util_zoom                            (Evas_Map *m, double zoomx, double zoomy, Evas_Coord cx, Evas_Coord cy);
4436
4437 /**
4438  * Rotate the map around 3 axes in 3D
4439  *
4440  * This will rotate not just around the "Z" axis as in evas_map_util_rotate()
4441  * (which is a convenience call for those only wanting 2D). This will rotate
4442  * around the X, Y and Z axes. The Z axis points "into" the screen with low
4443  * values at the screen and higher values further away. The X axis runs from
4444  * left to right on the screen and the Y axis from top to bottom. Like with
4445  * evas_map_util_rotate() you provide a center point to rotate around (in 3D).
4446  *
4447  * @param m map to change.
4448  * @param dx amount of degrees from 0.0 to 360.0 to rotate arount X axis.
4449  * @param dy amount of degrees from 0.0 to 360.0 to rotate arount Y axis.
4450  * @param dz amount of degrees from 0.0 to 360.0 to rotate arount Z axis.
4451  * @param cx rotation's center horizontal position.
4452  * @param cy rotation's center vertical position.
4453  * @param cz rotation's center vertical position.
4454  */
4455 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);
4456
4457 /**
4458  * Perform lighting calculations on the given Map
4459  *
4460  * This is used to apply lighting calculations (from a single light source)
4461  * to a given map. The R, G and B values of each vertex will be modified to
4462  * reflect the lighting based on the lixth point coordinates, the light
4463  * color and the ambient color, and at what angle the map is facing the
4464  * light source. A surface should have its points be declared in a
4465  * clockwise fashion if the face is "facing" towards you (as opposed to
4466  * away from you) as faces have a "logical" side for lighting.
4467  *
4468  * @image html map-light3.png
4469  * @image rtf map-light3.png
4470  * @image latex map-light3.eps
4471  * @note Grey object, no lighting used
4472  *
4473  * @image html map-light4.png
4474  * @image rtf map-light4.png
4475  * @image latex map-light4.eps
4476  * @note Lights out! Every color set to 0
4477  *
4478  * @image html map-light5.png
4479  * @image rtf map-light5.png
4480  * @image latex map-light5.eps
4481  * @note Ambient light to full black, red light coming from close at the
4482  * bottom-left vertex
4483  *
4484  * @image html map-light6.png
4485  * @image rtf map-light6.png
4486  * @image latex map-light6.eps
4487  * @note Same light as before, but not the light is set to 0 and ambient light
4488  * is cyan
4489  *
4490  * @image html map-light7.png
4491  * @image rtf map-light7.png
4492  * @image latex map-light7.eps
4493  * @note Both lights are on
4494  *
4495  * @image html map-light8.png
4496  * @image rtf map-light8.png
4497  * @image latex map-light8.eps
4498  * @note Both lights again, but this time both are the same color.
4499  *
4500  * @param m map to change.
4501  * @param lx X coordinate in space of light point
4502  * @param ly Y coordinate in space of light point
4503  * @param lz Z coordinate in space of light point
4504  * @param lr light red value (0 - 255)
4505  * @param lg light green value (0 - 255)
4506  * @param lb light blue value (0 - 255)
4507  * @param ar ambient color red value (0 - 255)
4508  * @param ag ambient color green value (0 - 255)
4509  * @param ab ambient color blue value (0 - 255)
4510  */
4511 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);
4512
4513 /**
4514  * Apply a perspective transform to the map
4515  *
4516  * This applies a given perspective (3D) to the map coordinates. X, Y and Z
4517  * values are used. The px and py points specify the "infinite distance" point
4518  * in the 3D conversion (where all lines converge to like when artists draw
4519  * 3D by hand). The @p z0 value specifis the z value at which there is a 1:1
4520  * mapping between spatial coorinates and screen coordinates. Any points
4521  * on this z value will not have their X and Y values modified in the transform.
4522  * Those further away (Z value higher) will shrink into the distance, and
4523  * those less than this value will expand and become bigger. The @p foc value
4524  * determines the "focal length" of the camera. This is in reality the distance
4525  * between the camera lens plane itself (at or closer than this rendering
4526  * results are undefined) and the "z0" z value. This allows for some "depth"
4527  * control and @p foc must be greater than 0.
4528  *
4529  * @param m map to change.
4530  * @param px The pespective distance X coordinate
4531  * @param py The pespective distance Y coordinate
4532  * @param z0 The "0" z plane value
4533  * @param foc The focal distance
4534  */
4535 EAPI void              evas_map_util_3d_perspective                  (Evas_Map *m, Evas_Coord px, Evas_Coord py, Evas_Coord z0, Evas_Coord foc);
4536
4537 /**
4538  * Get the clockwise state of a map
4539  *
4540  * This determines if the output points (X and Y. Z is not used) are
4541  * clockwise or anti-clockwise. This can be used for "back-face culling". This
4542  * is where you hide objects that "face away" from you. In this case objects
4543  * that are not clockwise.
4544  *
4545  * @param m map to query.
4546  * @return 1 if clockwise, 0 otherwise
4547  */
4548 EAPI Eina_Bool         evas_map_util_clockwise_get                   (Evas_Map *m);
4549
4550
4551 /**
4552  * Create map of transformation points to be later used with an Evas object.
4553  *
4554  * This creates a set of points (currently only 4 is supported. no other
4555  * number for @p count will work). That is empty and ready to be modified
4556  * with evas_map calls.
4557  *
4558  * @param count number of points in the map.
4559  * @return a newly allocated map or @c NULL on errors.
4560  *
4561  * @see evas_map_free()
4562  * @see evas_map_dup()
4563  * @see evas_map_point_coord_set()
4564  * @see evas_map_point_image_uv_set()
4565  * @see evas_map_util_points_populate_from_object_full()
4566  * @see evas_map_util_points_populate_from_object()
4567  *
4568  * @see evas_object_map_set()
4569  */
4570 EAPI Evas_Map         *evas_map_new                      (int count);
4571
4572 /**
4573  * Set the smoothing for map rendering
4574  *
4575  * This sets smoothing for map rendering. If the object is a type that has
4576  * its own smoothing settings, then both the smooth settings for this object
4577  * and the map must be turned off. By default smooth maps are enabled.
4578  *
4579  * @param m map to modify. Must not be NULL.
4580  * @param enabled enable or disable smooth map rendering
4581  */
4582 EAPI void              evas_map_smooth_set               (Evas_Map *m, Eina_Bool enabled);
4583
4584 /**
4585  * get the smoothing for map rendering
4586  *
4587  * This gets smoothing for map rendering.
4588  *
4589  * @param m map to get the smooth from. Must not be NULL.
4590  */
4591 EAPI Eina_Bool         evas_map_smooth_get               (const Evas_Map *m);
4592
4593 /**
4594  * Set the alpha flag for map rendering
4595  *
4596  * This sets alpha flag for map rendering. If the object is a type that has
4597  * its own alpha settings, then this will take precedence. Only image objects
4598  * have this currently.
4599  * Setting this off stops alpha blending of the map area, and is
4600  * useful if you know the object and/or all sub-objects is 100% solid.
4601  *
4602  * @param m map to modify. Must not be NULL.
4603  * @param enabled enable or disable alpha map rendering
4604  */
4605 EAPI void              evas_map_alpha_set                (Evas_Map *m, Eina_Bool enabled);
4606
4607 /**
4608  * get the alpha flag for map rendering
4609  *
4610  * This gets the alph flag for map rendering.
4611  *
4612  * @param m map to get the alpha from. Must not be NULL.
4613  */
4614 EAPI Eina_Bool         evas_map_alpha_get                (const Evas_Map *m);
4615
4616 /**
4617  * Copy a previously allocated map.
4618  *
4619  * This makes a duplicate of the @p m object and returns it.
4620  *
4621  * @param m map to copy. Must not be NULL.
4622  * @return newly allocated map with the same count and contents as @p m.
4623  */
4624 EAPI Evas_Map         *evas_map_dup                      (const Evas_Map *m);
4625
4626 /**
4627  * Free a previously allocated map.
4628  *
4629  * This frees a givem map @p m and all memory associated with it. You must NOT
4630  * free a map returned by evas_object_map_get() as this is internal.
4631  *
4632  * @param m map to free.
4633  */
4634 EAPI void              evas_map_free                     (Evas_Map *m);
4635
4636 /**
4637  * Get a maps size.
4638  *
4639  * Returns the number of points in a map.  Should be at least 4.
4640  *
4641  * @param m map to get size.
4642  * @return -1 on error, points otherwise.
4643  */
4644 EAPI int               evas_map_count_get               (const Evas_Map *m) EINA_CONST;
4645
4646 /**
4647  * Change the map point's coordinate.
4648  *
4649  * This sets the fixed point's coordinate in the map. Note that points
4650  * describe the outline of a quadrangle and are ordered either clockwise
4651  * or anit-clock-wise. It is suggested to keep your quadrangles concave and
4652  * non-complex, though these polygon modes may work, they may not render
4653  * a desired set of output. The quadrangle will use points 0 and 1 , 1 and 2,
4654  * 2 and 3, and 3 and 0 to describe the edges of the quandrangle.
4655  *
4656  * The X and Y and Z coordinates are in canvas units. Z is optional and may
4657  * or may not be honored in drawing. Z is a hint and does not affect the
4658  * X and Y rendered coordinates. It may be used for calculating fills with
4659  * perspective correct rendering.
4660  *
4661  * Remember all coordinates are canvas global ones like with move and reize
4662  * in evas.
4663  *
4664  * @param m map to change point. Must not be @c NULL.
4665  * @param idx index of point to change. Must be smaller than map size.
4666  * @param x Point X Coordinate
4667  * @param y Point Y Coordinate
4668  * @param z Point Z Coordinate hint (pre-perspective transform)
4669  *
4670  * @see evas_map_util_rotate()
4671  * @see evas_map_util_zoom()
4672  * @see evas_map_util_points_populate_from_object_full()
4673  * @see evas_map_util_points_populate_from_object()
4674  */
4675 EAPI void              evas_map_point_coord_set          (Evas_Map *m, int idx, Evas_Coord x, Evas_Coord y, Evas_Coord z);
4676
4677 /**
4678  * Get the map point's coordinate.
4679  *
4680  * This returns the coordinates of the given point in the map.
4681  *
4682  * @param m map to query point.
4683  * @param idx index of point to query. Must be smaller than map size.
4684  * @param x where to return the X coordinate.
4685  * @param y where to return the Y coordinate.
4686  * @param z where to return the Z coordinate.
4687  */
4688 EAPI void              evas_map_point_coord_get          (const Evas_Map *m, int idx, Evas_Coord *x, Evas_Coord *y, Evas_Coord *z);
4689
4690 /**
4691  * Change the map point's U and V texture source point
4692  *
4693  * This sets the U and V coordinates for the point. This determines which
4694  * coordinate in the source image is mapped to the given point, much like
4695  * OpenGL and textures. Notes that these points do select the pixel, but
4696  * are double floating point values to allow for accuracy and sub-pixel
4697  * selection.
4698  *
4699  * @param m map to change the point of.
4700  * @param idx index of point to change. Must be smaller than map size.
4701  * @param u the X coordinate within the image/texture source
4702  * @param v the Y coordinate within the image/texture source
4703  *
4704  * @see evas_map_point_coord_set()
4705  * @see evas_object_map_set()
4706  * @see evas_map_util_points_populate_from_object_full()
4707  * @see evas_map_util_points_populate_from_object()
4708  */
4709 EAPI void              evas_map_point_image_uv_set       (Evas_Map *m, int idx, double u, double v);
4710
4711 /**
4712  * Get the map point's U and V texture source points
4713  *
4714  * This returns the texture points set by evas_map_point_image_uv_set().
4715  *
4716  * @param m map to query point.
4717  * @param idx index of point to query. Must be smaller than map size.
4718  * @param u where to write the X coordinate within the image/texture source
4719  * @param v where to write the Y coordinate within the image/texture source
4720  */
4721 EAPI void              evas_map_point_image_uv_get       (const Evas_Map *m, int idx, double *u, double *v);
4722
4723 /**
4724  * Set the color of a vertex in the map
4725  *
4726  * This sets the color of the vertex in the map. Colors will be linearly
4727  * interpolated between vertex points through the map. Color will multiply
4728  * the "texture" pixels (like GL_MODULATE in OpenGL). The default color of
4729  * a vertex in a map is white solid (255, 255, 255, 255) which means it will
4730  * have no affect on modifying the texture pixels.
4731  *
4732  * @param m map to change the color of.
4733  * @param idx index of point to change. Must be smaller than map size.
4734  * @param r red (0 - 255)
4735  * @param g green (0 - 255)
4736  * @param b blue (0 - 255)
4737  * @param a alpha (0 - 255)
4738  *
4739  * @see evas_map_util_points_color_set()
4740  * @see evas_map_point_coord_set()
4741  * @see evas_object_map_set()
4742  */
4743 EAPI void              evas_map_point_color_set          (Evas_Map *m, int idx, int r, int g, int b, int a);
4744
4745 /**
4746  * Get the color set on a vertex in the map
4747  *
4748  * This gets the color set by evas_map_point_color_set() on the given vertex
4749  * of the map.
4750  *
4751  * @param m map to get the color of the vertex from.
4752  * @param idx index of point get. Must be smaller than map size.
4753  * @param r pointer to red return
4754  * @param g pointer to green return
4755  * @param b pointer to blue return
4756  * @param a pointer to alpha return (0 - 255)
4757  *
4758  * @see evas_map_point_coord_set()
4759  * @see evas_object_map_set()
4760  */
4761 EAPI void              evas_map_point_color_get          (const Evas_Map *m, int idx, int *r, int *g, int *b, int *a);
4762 /**
4763  * @}
4764  */
4765
4766 /**
4767  * @defgroup Evas_Object_Group_Size_Hints Size Hints
4768  *
4769  * Objects may carry hints, so that another object that acts as a
4770  * manager (see @ref Evas_Smart_Object_Group) may know how to properly
4771  * position and resize its subordinate objects. The Size Hints provide
4772  * a common interface that is recommended as the protocol for such
4773  * information.
4774  *
4775  * For example, box objects use alignment hints to align its
4776  * lines/columns inside its container, padding hints to set the
4777  * padding between each individual child, etc.
4778  *
4779  * Examples on their usage:
4780  * - @ref Example_Evas_Size_Hints "evas-hints.c"
4781  * - @ref Example_Evas_Aspect_Hints "evas-aspect-hints.c"
4782  *
4783  * @ingroup Evas_Object_Group
4784  */
4785
4786 /**
4787  * @addtogroup Evas_Object_Group_Size_Hints
4788  * @{
4789  */
4790
4791 /**
4792  * Retrieves the hints for an object's minimum size.
4793  *
4794  * @param obj The given Evas object to query hints from.
4795  * @param w Pointer to an integer in which to store the minimum width.
4796  * @param h Pointer to an integer in which to store the minimum height.
4797  *
4798  * These are hints on the minimim sizes @p obj should have. This is
4799  * not a size enforcement in any way, it's just a hint that should be
4800  * used whenever appropriate.
4801  *
4802  * @note Use @c NULL pointers on the hint components you're not
4803  * interested in: they'll be ignored by the function.
4804  *
4805  * @see evas_object_size_hint_min_set() for an example
4806  */
4807 EAPI void              evas_object_size_hint_min_get     (const Evas_Object *obj, Evas_Coord *w, Evas_Coord *h) EINA_ARG_NONNULL(1);
4808
4809 /**
4810  * Sets the hints for an object's minimum size.
4811  *
4812  * @param obj The given Evas object to query hints from.
4813  * @param w Integer to use as the minimum width hint.
4814  * @param h Integer to use as the minimum height hint.
4815  *
4816  * This is not a size enforcement in any way, it's just a hint that
4817  * should be used whenever appropriate.
4818  *
4819  * Values @c 0 will be treated as unset hint components, when queried
4820  * by managers.
4821  *
4822  * Example:
4823  * @dontinclude evas-hints.c
4824  * @skip evas_object_size_hint_min_set
4825  * @until return
4826  *
4827  * In this example the minimum size hints change de behavior of an
4828  * Evas box when layouting its children. See the full @ref
4829  * Example_Evas_Size_Hints "example".
4830  *
4831  * @see evas_object_size_hint_min_get()
4832  */
4833 EAPI void              evas_object_size_hint_min_set     (Evas_Object *obj, Evas_Coord w, Evas_Coord h) EINA_ARG_NONNULL(1);
4834
4835 /**
4836  * Retrieves the hints for an object's maximum size.
4837  *
4838  * @param obj The given Evas object to query hints from.
4839  * @param w Pointer to an integer in which to store the maximum width.
4840  * @param h Pointer to an integer in which to store the maximum height.
4841  *
4842  * These are hints on the maximum sizes @p obj should have. This is
4843  * not a size enforcement in any way, it's just a hint that should be
4844  * used whenever appropriate.
4845  *
4846  * @note Use @c NULL pointers on the hint components you're not
4847  * interested in: they'll be ignored by the function.
4848  *
4849  * @see evas_object_size_hint_max_set()
4850  */
4851 EAPI void              evas_object_size_hint_max_get     (const Evas_Object *obj, Evas_Coord *w, Evas_Coord *h) EINA_ARG_NONNULL(1);
4852
4853 /**
4854  * Sets the hints for an object's maximum size.
4855  *
4856  * @param obj The given Evas object to query hints from.
4857  * @param w Integer to use as the maximum width hint.
4858  * @param h Integer to use as the maximum height hint.
4859  *
4860  * This is not a size enforcement in any way, it's just a hint that
4861  * should be used whenever appropriate.
4862  *
4863  * Values @c -1 will be treated as unset hint components, when queried
4864  * by managers.
4865  *
4866  * Example:
4867  * @dontinclude evas-hints.c
4868  * @skip evas_object_size_hint_max_set
4869  * @until return
4870  *
4871  * In this example the maximum size hints change de behavior of an
4872  * Evas box when layouting its children. See the full @ref
4873  * Example_Evas_Size_Hints "example".
4874  *
4875  * @see evas_object_size_hint_max_get()
4876  */
4877 EAPI void              evas_object_size_hint_max_set     (Evas_Object *obj, Evas_Coord w, Evas_Coord h) EINA_ARG_NONNULL(1);
4878
4879 /**
4880  * Retrieves the hints for an object's optimum size.
4881  *
4882  * @param obj The given Evas object to query hints from.
4883  * @param w Pointer to an integer in which to store the requested width.
4884  * @param h Pointer to an integer in which to store the requested height.
4885  *
4886  * These are hints on the optimum sizes @p obj should have. This is
4887  * not a size enforcement in any way, it's just a hint that should be
4888  * used whenever appropriate.
4889  *
4890  * @note Use @c NULL pointers on the hint components you're not
4891  * interested in: they'll be ignored by the function.
4892  *
4893  * @see evas_object_size_hint_request_set()
4894  */
4895 EAPI void              evas_object_size_hint_request_get (const Evas_Object *obj, Evas_Coord *w, Evas_Coord *h) EINA_ARG_NONNULL(1);
4896
4897 /**
4898  * Sets the hints for an object's optimum size.
4899  *
4900  * @param obj The given Evas object to query hints from.
4901  * @param w Integer to use as the preferred width hint.
4902  * @param h Integer to use as the preferred height hint.
4903  *
4904  * This is not a size enforcement in any way, it's just a hint that
4905  * should be used whenever appropriate.
4906  *
4907  * Values @c 0 will be treated as unset hint components, when queried
4908  * by managers.
4909  *
4910  * @see evas_object_size_hint_request_get()
4911  */
4912 EAPI void              evas_object_size_hint_request_set (Evas_Object *obj, Evas_Coord w, Evas_Coord h) EINA_ARG_NONNULL(1);
4913
4914 /**
4915  * Retrieves the hints for an object's aspect ratio.
4916  *
4917  * @param obj The given Evas object to query hints from.
4918  * @param aspect Returns the policy/type of aspect ratio applied to @p obj.
4919  * @param w Pointer to an integer in which to store the aspect's width
4920  * ratio term.
4921  * @param h Pointer to an integer in which to store the aspect's
4922  * height ratio term.
4923  *
4924  * The different aspect ratio policies are documented in the
4925  * #Evas_Aspect_Control type. A container respecting these size hints
4926  * would @b resize its children accordingly to those policies.
4927  *
4928  * For any policy, if any of the given aspect ratio terms are @c 0,
4929  * the object's container should ignore the aspect and scale @p obj to
4930  * occupy the whole available area. If they are both positive
4931  * integers, that proportion will be respected, under each scaling
4932  * policy.
4933  *
4934  * These images illustrate some of the #Evas_Aspect_Control policies:
4935  *
4936  * @image html any-policy.png
4937  * @image rtf any-policy.png
4938  * @image latex any-policy.eps
4939  *
4940  * @image html aspect-control-none-neither.png
4941  * @image rtf aspect-control-none-neither.png
4942  * @image latex aspect-control-none-neither.eps
4943  *
4944  * @image html aspect-control-both.png
4945  * @image rtf aspect-control-both.png
4946  * @image latex aspect-control-both.eps
4947  *
4948  * @image html aspect-control-horizontal.png
4949  * @image rtf aspect-control-horizontal.png
4950  * @image latex aspect-control-horizontal.eps
4951  *
4952  * This is not a size enforcement in any way, it's just a hint that
4953  * should be used whenever appropriate.
4954  *
4955  * @note Use @c NULL pointers on the hint components you're not
4956  * interested in: they'll be ignored by the function.
4957  *
4958  * Example:
4959  * @dontinclude evas-aspect-hints.c
4960  * @skip if (strcmp(ev->keyname, "c") == 0)
4961  * @until }
4962  *
4963  * See the full @ref Example_Evas_Aspect_Hints "example".
4964  *
4965  * @see evas_object_size_hint_aspect_set()
4966  */
4967 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);
4968
4969 /**
4970  * Sets the hints for an object's aspect ratio.
4971  *
4972  * @param obj The given Evas object to query hints from.
4973  * @param aspect The policy/type of aspect ratio to apply to @p obj.
4974  * @param w Integer to use as aspect width ratio term.
4975  * @param h Integer to use as aspect height ratio term.
4976  *
4977  * This is not a size enforcement in any way, it's just a hint that should
4978  * be used whenever appropriate.
4979  *
4980  * If any of the given aspect ratio terms are @c 0,
4981  * the object's container will ignore the aspect and scale @p obj to
4982  * occupy the whole available area, for any given policy.
4983  *
4984  * @see evas_object_size_hint_aspect_get() for more information.
4985  */
4986 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);
4987
4988 /**
4989  * Retrieves the hints for on object's alignment.
4990  *
4991  * @param obj The given Evas object to query hints from.
4992  * @param x Pointer to a double in which to store the horizontal
4993  * alignment hint.
4994  * @param y Pointer to a double in which to store the vertical
4995  * alignment hint.
4996  *
4997  * This is not a size enforcement in any way, it's just a hint that
4998  * should be used whenever appropriate.
4999  *
5000  * @note Use @c NULL pointers on the hint components you're not
5001  * interested in: they'll be ignored by the function.
5002  *
5003  * @see evas_object_size_hint_align_set() for more information
5004  */
5005 EAPI void              evas_object_size_hint_align_get   (const Evas_Object *obj, double *x, double *y) EINA_ARG_NONNULL(1);
5006
5007 /**
5008  * Sets the hints for an object's alignment.
5009  *
5010  * @param obj The given Evas object to query hints from.
5011  * @param x Double, ranging from @c 0.0 to @c 1.0 or with the
5012  * special value #EVAS_HINT_FILL, to use as horizontal alignment hint.
5013  * @param y Double, ranging from @c 0.0 to @c 1.0 or with the
5014  * special value #EVAS_HINT_FILL, to use as vertical alignment hint.
5015  *
5016  * These are hints on how to align an object <b>inside the boundaries
5017  * of a container/manager</b>. Accepted values are in the @c 0.0 to @c
5018  * 1.0 range, with the special value #EVAS_HINT_FILL used to specify
5019  * "justify" or "fill" by some users. In this case, maximum size hints
5020  * should be enforced with higher priority, if they are set. Also, any
5021  * padding hint set on objects should add up to the alignment space on
5022  * the final scene composition.
5023  *
5024  * See documentation of possible users: in Evas, they are the @ref
5025  * Evas_Object_Box "box" and @ref Evas_Object_Table "table" smart
5026  * objects.
5027  *
5028  * For the horizontal component, @c 0.0 means to the left, @c 1.0
5029  * means to the right. Analogously, for the vertical component, @c 0.0
5030  * to the top, @c 1.0 means to the bottom.
5031  *
5032  * See the following figure:
5033  * @image html alignment-hints.png
5034  * @image rtf alignment-hints.png
5035  * @image latex alignment-hints.eps
5036  *
5037  * This is not a size enforcement in any way, it's just a hint that
5038  * should be used whenever appropriate.
5039  *
5040  * Example:
5041  * @dontinclude evas-hints.c
5042  * @skip evas_object_size_hint_align_set
5043  * @until return
5044  *
5045  * In this example the alignment hints change de behavior of an Evas
5046  * box when layouting its children. See the full @ref
5047  * Example_Evas_Size_Hints "example".
5048  *
5049  * @see evas_object_size_hint_align_get()
5050  * @see evas_object_size_hint_max_set()
5051  * @see evas_object_size_hint_padding_set()
5052  */
5053 EAPI void              evas_object_size_hint_align_set   (Evas_Object *obj, double x, double y) EINA_ARG_NONNULL(1);
5054
5055 /**
5056  * Retrieves the hints for an object's weight.
5057  *
5058  * @param obj The given Evas object to query hints from.
5059  * @param x Pointer to a double in which to store the horizontal weight.
5060  * @param y Pointer to a double in which to store the vertical weight.
5061  *
5062  * Accepted values are zero or positive values. Some users might use
5063  * this hint as a boolean, but some might consider it as a @b
5064  * proportion, see documentation of possible users, which in Evas are
5065  * the @ref Evas_Object_Box "box" and @ref Evas_Object_Table "table"
5066  * smart objects.
5067  *
5068  * This is not a size enforcement in any way, it's just a hint that
5069  * should be used whenever appropriate.
5070  *
5071  * @note Use @c NULL pointers on the hint components you're not
5072  * interested in: they'll be ignored by the function.
5073  *
5074  * @see evas_object_size_hint_weight_set() for an example
5075  */
5076 EAPI void              evas_object_size_hint_weight_get  (const Evas_Object *obj, double *x, double *y) EINA_ARG_NONNULL(1);
5077
5078 /**
5079  * Sets the hints for an object's weight.
5080  *
5081  * @param obj The given Evas object to query hints from.
5082  * @param x Nonnegative double value to use as horizontal weight hint.
5083  * @param y Nonnegative double value to use as vertical weight hint.
5084  *
5085  * This is not a size enforcement in any way, it's just a hint that
5086  * should be used whenever appropriate.
5087  *
5088  * This is a hint on how a container object should @b resize a given
5089  * child within its area. Containers may adhere to the simpler logic
5090  * of just expanding the child object's dimensions to fit its own (see
5091  * the #EVAS_HINT_EXPAND helper weight macro) or the complete one of
5092  * taking each child's weight hint as real @b weights to how much of
5093  * its size to allocate for them in each axis. A container is supposed
5094  * to, after @b normalizing the weights of its children (with weight
5095  * hints), distribute the space it has to layout them by those factors
5096  * -- most weighted children get larger in this process than the least
5097  * ones.
5098  *
5099  * Example:
5100  * @dontinclude evas-hints.c
5101  * @skip evas_object_size_hint_weight_set
5102  * @until return
5103  *
5104  * In this example the weight hints change de behavior of an Evas box
5105  * when layouting its children. See the full @ref
5106  * Example_Evas_Size_Hints "example".
5107  *
5108  * @see evas_object_size_hint_weight_get() for more information
5109  */
5110 EAPI void              evas_object_size_hint_weight_set  (Evas_Object *obj, double x, double y) EINA_ARG_NONNULL(1);
5111
5112 /**
5113  * Retrieves the hints for an object's padding space.
5114  *
5115  * @param obj The given Evas object to query hints from.
5116  * @param l Pointer to an integer in which to store left padding.
5117  * @param r Pointer to an integer in which to store right padding.
5118  * @param t Pointer to an integer in which to store top padding.
5119  * @param b Pointer to an integer in which to store bottom padding.
5120  *
5121  * Padding is extra space an object takes on each of its delimiting
5122  * rectangle sides, in canvas units. This space will be rendered
5123  * transparent, naturally, as in the following figure:
5124  * @image html padding-hints.png
5125  * @image rtf padding-hints.png
5126  * @image latex padding-hints.eps
5127  *
5128  * This is not a size enforcement in any way, it's just a hint that
5129  * should be used whenever appropriate.
5130  *
5131  * @note Use @c NULL pointers on the hint components you're not
5132  * interested in: they'll be ignored by the function.
5133  *
5134  * Example:
5135  * @dontinclude evas-hints.c
5136  * @skip evas_object_size_hint_padding_set
5137  * @until return
5138  *
5139  * In this example the padding hints change de behavior of an Evas box
5140  * when layouting its children. See the full @ref
5141  * Example_Evas_Size_Hints "example".
5142  *
5143  * @see evas_object_size_hint_padding_set()
5144  */
5145 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);
5146
5147 /**
5148  * Sets the hints for an object's padding space.
5149  *
5150  * @param obj The given Evas object to query hints from.
5151  * @param l Integer to specify left padding.
5152  * @param r Integer to specify right padding.
5153  * @param t Integer to specify top padding.
5154  * @param b Integer to specify bottom padding.
5155  *
5156  * This is not a size enforcement in any way, it's just a hint that
5157  * should be used whenever appropriate.
5158  *
5159  * @see evas_object_size_hint_padding_get() for more information
5160  */
5161 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);
5162
5163 /**
5164  * @}
5165  */
5166
5167 /**
5168  * @defgroup Evas_Object_Group_Extras Extra Object Manipulation
5169  *
5170  * Miscellaneous functions that also apply to any object, but are less
5171  * used or not implemented by all objects.
5172  *
5173  * Examples on this group of functions can be found @ref
5174  * Example_Evas_Stacking "here" and @ref Example_Evas_Events "here".
5175  *
5176  * @ingroup Evas_Object_Group
5177  */
5178
5179 /**
5180  * @addtogroup Evas_Object_Group_Extras
5181  * @{
5182  */
5183
5184 /**
5185  * Set an attached data pointer to an object with a given string key.
5186  *
5187  * @param obj The object to attach the data pointer to
5188  * @param key The string key for the data to access it
5189  * @param data The ponter to the data to be attached
5190  *
5191  * This attaches the pointer @p data to the object @p obj, given the
5192  * access string @p key. This pointer will stay "hooked" to the object
5193  * until a new pointer with the same string key is attached with
5194  * evas_object_data_set() or it is deleted with
5195  * evas_object_data_del(). On deletion of the object @p obj, the
5196  * pointers will not be accessible from the object anymore.
5197  *
5198  * You can find the pointer attached under a string key using
5199  * evas_object_data_get(). It is the job of the calling application to
5200  * free any data pointed to by @p data when it is no longer required.
5201  *
5202  * If @p data is @c NULL, the old value stored at @p key will be
5203  * removed but no new value will be stored. This is synonymous with
5204  * calling evas_object_data_del() with @p obj and @p key.
5205  *
5206  * @note This function is very handy when you have data associated
5207  * specifically to an Evas object, being of use only when dealing with
5208  * it. Than you don't have the burden to a pointer to it elsewhere,
5209  * using this family of functions.
5210  *
5211  * Example:
5212  *
5213  * @code
5214  * int *my_data;
5215  * extern Evas_Object *obj;
5216  *
5217  * my_data = malloc(500);
5218  * evas_object_data_set(obj, "name_of_data", my_data);
5219  * printf("The data that was attached was %p\n", evas_object_data_get(obj, "name_of_data"));
5220  * @endcode
5221  */
5222 EAPI void                      evas_object_data_set             (Evas_Object *obj, const char *key, const void *data) EINA_ARG_NONNULL(1, 2);
5223
5224 /**
5225  * Return an attached data pointer on an Evas object by its given
5226  * string key.
5227  *
5228  * @param obj The object to which the data was attached
5229  * @param key The string key the data was stored under
5230  * @return The data pointer stored, or @c NULL if none was stored
5231  *
5232  * This function will return the data pointer attached to the object
5233  * @p obj, stored using the string key @p key. If the object is valid
5234  * and a data pointer was stored under the given key, that pointer
5235  * will be returned. If this is not the case, @c NULL will be
5236  * returned, signifying an invalid object or a non-existent key. It is
5237  * possible that a @c NULL pointer was stored given that key, but this
5238  * situation is non-sensical and thus can be considered an error as
5239  * well. @c NULL pointers are never stored as this is the return value
5240  * if an error occurs.
5241  *
5242  * Example:
5243  *
5244  * @code
5245  * int *my_data;
5246  * extern Evas_Object *obj;
5247  *
5248  * my_data = evas_object_data_get(obj, "name_of_my_data");
5249  * if (my_data) printf("Data stored was %p\n", my_data);
5250  * else printf("No data was stored on the object\n");
5251  * @endcode
5252  */
5253 EAPI void                     *evas_object_data_get             (const Evas_Object *obj, const char *key) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2) EINA_PURE;
5254
5255 /**
5256  * Delete an attached data pointer from an object.
5257  *
5258  * @param obj The object to delete the data pointer from
5259  * @param key The string key the data was stored under
5260  * @return The original data pointer stored at @p key on @p obj
5261  *
5262  * This will remove the stored data pointer from @p obj stored under
5263  * @p key and return this same pointer, if actually there was data
5264  * there, or @c NULL, if nothing was stored under that key.
5265  *
5266  * Example:
5267  *
5268  * @code
5269  * int *my_data;
5270  * extern Evas_Object *obj;
5271  *
5272  * my_data = evas_object_data_del(obj, "name_of_my_data");
5273  * @endcode
5274  */
5275 EAPI void                     *evas_object_data_del             (Evas_Object *obj, const char *key) EINA_ARG_NONNULL(1, 2);
5276
5277
5278 /**
5279  * Set pointer behavior.
5280  *
5281  * @param obj
5282  * @param setting desired behavior.
5283  *
5284  * This function has direct effect on event callbacks related to
5285  * mouse.
5286  *
5287  * If @p setting is EVAS_OBJECT_POINTER_MODE_AUTOGRAB, then when mouse
5288  * is down at this object, events will be restricted to it as source,
5289  * mouse moves, for example, will be emitted even if outside this
5290  * object area.
5291  *
5292  * If @p setting is EVAS_OBJECT_POINTER_MODE_NOGRAB, then events will
5293  * be emitted just when inside this object area.
5294  *
5295  * The default value is EVAS_OBJECT_POINTER_MODE_AUTOGRAB.
5296  *
5297  * @ingroup Evas_Object_Group_Extras
5298  */
5299 EAPI void                      evas_object_pointer_mode_set     (Evas_Object *obj, Evas_Object_Pointer_Mode setting) EINA_ARG_NONNULL(1);
5300
5301 /**
5302  * Determine how pointer will behave.
5303  * @param obj
5304  * @return pointer behavior.
5305  * @ingroup Evas_Object_Group_Extras
5306  */
5307 EAPI Evas_Object_Pointer_Mode  evas_object_pointer_mode_get     (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
5308
5309
5310 /**
5311  * Sets whether or not the given Evas object is to be drawn anti-aliased.
5312  *
5313  * @param   obj The given Evas object.
5314  * @param   anti_alias 1 if the object is to be anti_aliased, 0 otherwise.
5315  * @ingroup Evas_Object_Group_Extras
5316  */
5317 EAPI void                      evas_object_anti_alias_set       (Evas_Object *obj, Eina_Bool antialias) EINA_ARG_NONNULL(1);
5318
5319 /**
5320  * Retrieves whether or not the given Evas object is to be drawn anti_aliased.
5321  * @param   obj The given Evas object.
5322  * @return  @c 1 if the object is to be anti_aliased.  @c 0 otherwise.
5323  * @ingroup Evas_Object_Group_Extras
5324  */
5325 EAPI Eina_Bool                 evas_object_anti_alias_get       (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
5326
5327
5328 /**
5329  * Sets the scaling factor for an Evas object. Does not affect all
5330  * objects.
5331  *
5332  * @param obj The given Evas object.
5333  * @param scale The scaling factor. <c>1.0</c> means no scaling,
5334  *        default size.
5335  *
5336  * This will multiply the object's dimension by the given factor, thus
5337  * altering its geometry (width and height). Useful when you want
5338  * scalable UI elements, possibly at run time.
5339  *
5340  * @note Only text and textblock objects have scaling change
5341  * handlers. Other objects won't change visually on this call.
5342  *
5343  * @see evas_object_scale_get()
5344  *
5345  * @ingroup Evas_Object_Group_Extras
5346  */
5347 EAPI void                      evas_object_scale_set            (Evas_Object *obj, double scale) EINA_ARG_NONNULL(1);
5348
5349 /**
5350  * Retrieves the scaling factor for the given Evas object.
5351  *
5352  * @param   obj The given Evas object.
5353  * @return  The scaling factor.
5354  *
5355  * @ingroup Evas_Object_Group_Extras
5356  *
5357  * @see evas_object_scale_set()
5358  */
5359 EAPI double                    evas_object_scale_get            (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
5360
5361
5362 /**
5363  * Sets the render_op to be used for rendering the Evas object.
5364  * @param   obj The given Evas object.
5365  * @param   render_op one of the Evas_Render_Op values.
5366  * @ingroup Evas_Object_Group_Extras
5367  */
5368 EAPI void                      evas_object_render_op_set        (Evas_Object *obj, Evas_Render_Op op) EINA_ARG_NONNULL(1);
5369
5370 /**
5371  * Retrieves the current value of the operation used for rendering the Evas object.
5372  * @param   obj The given Evas object.
5373  * @return  one of the enumerated values in Evas_Render_Op.
5374  * @ingroup Evas_Object_Group_Extras
5375  */
5376 EAPI Evas_Render_Op            evas_object_render_op_get        (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
5377
5378 /**
5379  * Set whether to use precise (usually expensive) point collision
5380  * detection for a given Evas object.
5381  *
5382  * @param obj The given object.
5383  * @param precise whether to use precise point collision detection or
5384  * not The default value is false.
5385  *
5386  * Use this function to make Evas treat objects' transparent areas as
5387  * @b not belonging to it with regard to mouse pointer events. By
5388  * default, all of the object's boundary rectangle will be taken in
5389  * account for them.
5390  *
5391  * @warning By using precise point collision detection you'll be
5392  * making Evas more resource intensive.
5393  *
5394  * Example code follows.
5395  * @dontinclude evas-events.c
5396  * @skip if (strcmp(ev->keyname, "p") == 0)
5397  * @until }
5398  *
5399  * See the full example @ref Example_Evas_Events "here".
5400  *
5401  * @see evas_object_precise_is_inside_get()
5402  * @ingroup Evas_Object_Group_Extras
5403  */
5404    EAPI void                      evas_object_precise_is_inside_set(Evas_Object *obj, Eina_Bool precise) EINA_ARG_NONNULL(1);
5405
5406 /**
5407  * Determine whether an object is set to use precise point collision
5408  * detection.
5409  *
5410  * @param obj The given object.
5411  * @return whether @p obj is set to use precise point collision
5412  * detection or not The default value is false.
5413  *
5414  * @see evas_object_precise_is_inside_set() for an example
5415  *
5416  * @ingroup Evas_Object_Group_Extras
5417  */
5418    EAPI Eina_Bool                 evas_object_precise_is_inside_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
5419
5420 /**
5421  * Set a hint flag on the given Evas object that it's used as a "static
5422  * clipper".
5423  *
5424  * @param obj The given object.
5425  * @param is_static_clip @c EINA_TRUE if it's to be used as a static
5426  * clipper, @c EINA_FALSE otherwise
5427  *
5428  * This is a hint to Evas that this object is used as a big static
5429  * clipper and shouldn't be moved with children and otherwise
5430  * considered specially. The default value for new objects is @c
5431  * EINA_FALSE.
5432  *
5433  * @see evas_object_static_clip_get()
5434  *
5435  * @ingroup Evas_Object_Group_Extras
5436  */
5437    EAPI void                      evas_object_static_clip_set      (Evas_Object *obj, Eina_Bool is_static_clip) EINA_ARG_NONNULL(1);
5438
5439 /**
5440  * Get the "static clipper" hint flag for a given Evas object.
5441  *
5442  * @param obj The given object.
5443  * @returrn @c EINA_TRUE if it's set as a static clipper, @c
5444  * EINA_FALSE otherwise
5445  *
5446  * @see evas_object_static_clip_set() for more details
5447  *
5448  * @ingroup Evas_Object_Group_Extras
5449  */
5450    EAPI Eina_Bool                 evas_object_static_clip_get      (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
5451
5452 /**
5453  * @}
5454  */
5455
5456 /**
5457  * @defgroup Evas_Object_Group_Find Finding Objects
5458  *
5459  * Functions that allows finding objects by their position, name or
5460  * other properties.
5461  *
5462  * @ingroup Evas_Object_Group
5463  */
5464
5465 /**
5466  * @addtogroup Evas_Object_Group_Find
5467  * @{
5468  */
5469
5470 /**
5471  * Retrieve the object that currently has focus.
5472  *
5473  * @param e The Evas canvas to query for focused object on.
5474  * @return The object that has focus or @c NULL if there is not one.
5475  *
5476  * Evas can have (at most) one of its objects focused at a time.
5477  * Focused objects will be the ones having <b>key events</b> delivered
5478  * to, which the programmer can act upon by means of
5479  * evas_object_event_callback_add() usage.
5480  *
5481  * @note Most users wouldn't be dealing directly with Evas' focused
5482  * objects. Instead, they would be using a higher level library for
5483  * that (like a toolkit, as Elementary) to handle focus and who's
5484  * receiving input for them.
5485  *
5486  * This call returns the object that currently has focus on the canvas
5487  * @p e or @c NULL, if none.
5488  *
5489  * @see evas_object_focus_set
5490  * @see evas_object_focus_get
5491  * @see evas_object_key_grab
5492  * @see evas_object_key_ungrab
5493  *
5494  * Example:
5495  * @dontinclude evas-events.c
5496  * @skip evas_event_callback_add(d.canvas, EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_IN,
5497  * @until evas_object_focus_set(d.bg, EINA_TRUE);
5498  * @dontinclude evas-events.c
5499  * @skip called when our rectangle gets focus
5500  * @until }
5501  *
5502  * In this example the @c event_info is exactly a pointer to that
5503  * focused rectangle. See the full @ref Example_Evas_Events "example".
5504  *
5505  * @ingroup Evas_Object_Group_Find
5506  */
5507 EAPI Evas_Object      *evas_focus_get                    (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
5508
5509
5510 /**
5511  * Retrieves the object on the given evas with the given name.
5512  * @param   e    The given evas.
5513  * @param   name The given name.
5514  * @return  If successful, the Evas object with the given name.  Otherwise,
5515  *          @c NULL.
5516  * @ingroup Evas_Object_Group_Find
5517  */
5518 EAPI Evas_Object      *evas_object_name_find             (const Evas *e, const char *name) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
5519
5520
5521 /**
5522  * Retrieves the top object at the given position (x,y)
5523  * @param   e The given Evas object.
5524  * @param   x The horizontal coordinate
5525  * @param   y The vertical coordinate
5526  * @param   include_pass_events_objects Boolean Flag to include or not
5527  * pass events objects
5528  * @param   include_hidden_objects Boolean Flag to include or not hidden objects
5529  * @return  The Evas object that is over all others objects at the given position.
5530  */
5531 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) EINA_PURE;
5532
5533 /**
5534  * Retrieves the top object at mouse pointer position
5535  * @param   e The given Evas object.
5536  * @return The Evas object that is over all others objects at the
5537  * pointer position.
5538  */
5539 EAPI Evas_Object      *evas_object_top_at_pointer_get    (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
5540
5541 /**
5542  * Retrieves the top object in the given rectangle region
5543  * @param   e The given Evas object.
5544  * @param   x The horizontal coordinate.
5545  * @param   y The vertical coordinate.
5546  * @param   w The width size.
5547  * @param   h The height size.
5548  * @param   include_pass_events_objects Boolean Flag to include or not pass events objects
5549  * @param   include_hidden_objects Boolean Flag to include or not hidden objects
5550  * @return  The Evas object that is over all others objects at the pointer position.
5551  *
5552  */
5553 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) EINA_PURE;
5554
5555
5556 /**
5557  * Retrieves the objects at the given position
5558  * @param   e The given Evas object.
5559  * @param   x The horizontal coordinate.
5560  * @param   y The vertical coordinate.
5561  * @param include_pass_events_objects Boolean Flag to include or not
5562  * pass events objects
5563  * @param   include_hidden_objects Boolean Flag to include or not hidden objects
5564  * @return  The list of Evas objects at the pointer position.
5565  *
5566  */
5567 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) EINA_PURE;
5568    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) EINA_PURE;
5569
5570 /**
5571  * Get the lowest (stacked) Evas object on the canvas @p
5572  *
5573  * @param e a valid canvas pointer
5574  * @return a pointer to the lowest object on it, if any, or @c NULL,
5575  * otherwise
5576  *
5577  * This function will take all populated layers in the canvas into
5578  * account, getting the lowest object for the lowest layer, naturally.
5579  *
5580  * @see evas_object_layer_get()
5581  * @see evas_object_layer_set()
5582  * @see evas_object_below_set()
5583  * @see evas_object_above_set()
5584  */
5585 EAPI Evas_Object      *evas_object_bottom_get            (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
5586
5587 /**
5588  * Get the highest (stacked) Evas object on the canvas @p
5589  *
5590  * @param e a valid canvas pointer
5591  * @return a pointer to the highest object on it, if any, or @c NULL,
5592  * otherwise
5593  *
5594  * This function will take all populated layers in the canvas into
5595  * account, getting the highest object for the highest layer,
5596  * naturally.
5597  *
5598  * @see evas_object_layer_get()
5599  * @see evas_object_layer_set()
5600  * @see evas_object_below_set()
5601  * @see evas_object_above_set()
5602  */
5603 EAPI Evas_Object      *evas_object_top_get               (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
5604
5605 /**
5606  * @}
5607  */
5608
5609 /**
5610  * @defgroup Evas_Object_Group_Interceptors Object Method Interceptors
5611  *
5612  * Evas provides a way to intercept method calls. The interceptor
5613  * callback may opt to completely deny the call, or may check and
5614  * change the parameters before continuing. The continuation of an
5615  * intercepted call is done by calling the intercepted call again,
5616  * from inside the interceptor callback.
5617  *
5618  * @ingroup Evas_Object_Group
5619  */
5620 typedef void (*Evas_Object_Intercept_Show_Cb) (void *data, Evas_Object *obj);
5621 typedef void (*Evas_Object_Intercept_Hide_Cb) (void *data, Evas_Object *obj);
5622 typedef void (*Evas_Object_Intercept_Move_Cb) (void *data, Evas_Object *obj, Evas_Coord x, Evas_Coord y);
5623 typedef void (*Evas_Object_Intercept_Resize_Cb) (void *data, Evas_Object *obj, Evas_Coord w, Evas_Coord h);
5624 typedef void (*Evas_Object_Intercept_Raise_Cb) (void *data, Evas_Object *obj);
5625 typedef void (*Evas_Object_Intercept_Lower_Cb) (void *data, Evas_Object *obj);
5626 typedef void (*Evas_Object_Intercept_Stack_Above_Cb) (void *data, Evas_Object *obj, Evas_Object *above);
5627 typedef void (*Evas_Object_Intercept_Stack_Below_Cb) (void *data, Evas_Object *obj, Evas_Object *above);
5628 typedef void (*Evas_Object_Intercept_Layer_Set_Cb) (void *data, Evas_Object *obj, int l);
5629 typedef void (*Evas_Object_Intercept_Color_Set_Cb) (void *data, Evas_Object *obj, int r, int g, int b, int a);
5630 typedef void (*Evas_Object_Intercept_Clip_Set_Cb) (void *data, Evas_Object *obj, Evas_Object *clip);
5631 typedef void (*Evas_Object_Intercept_Clip_Unset_Cb) (void *data, Evas_Object *obj);
5632
5633
5634 /**
5635  * Set the callback function that intercepts a show event of a object.
5636  *
5637  * @param obj The given canvas object pointer.
5638  * @param func The given function to be the callback function.
5639  * @param data The data passed to the callback function.
5640  *
5641  * This function sets a callback function to intercepts a show event
5642  * of a canvas object.
5643  *
5644  * @see evas_object_intercept_show_callback_del().
5645  *
5646  */
5647 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);
5648
5649 /**
5650  * Unset the callback function that intercepts a show event of a
5651  * object.
5652  *
5653  * @param obj The given canvas object pointer.
5654  * @param func The given callback function.
5655  *
5656  * This function sets a callback function to intercepts a show event
5657  * of a canvas object.
5658  *
5659  * @see evas_object_intercept_show_callback_add().
5660  *
5661  */
5662 EAPI void             *evas_object_intercept_show_callback_del        (Evas_Object *obj, Evas_Object_Intercept_Show_Cb func) EINA_ARG_NONNULL(1, 2);
5663
5664 /**
5665  * Set the callback function that intercepts a hide event of a object.
5666  *
5667  * @param obj The given canvas object pointer.
5668  * @param func The given function to be the callback function.
5669  * @param data The data passed to the callback function.
5670  *
5671  * This function sets a callback function to intercepts a hide event
5672  * of a canvas object.
5673  *
5674  * @see evas_object_intercept_hide_callback_del().
5675  *
5676  */
5677 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);
5678
5679 /**
5680  * Unset the callback function that intercepts a hide event of a
5681  * object.
5682  *
5683  * @param obj The given canvas object pointer.
5684  * @param func The given callback function.
5685  *
5686  * This function sets a callback function to intercepts a hide event
5687  * of a canvas object.
5688  *
5689  * @see evas_object_intercept_hide_callback_add().
5690  *
5691  */
5692 EAPI void             *evas_object_intercept_hide_callback_del        (Evas_Object *obj, Evas_Object_Intercept_Hide_Cb func) EINA_ARG_NONNULL(1, 2);
5693
5694 /**
5695  * Set the callback function that intercepts a move event of a object.
5696  *
5697  * @param obj The given canvas object pointer.
5698  * @param func The given function to be the callback function.
5699  * @param data The data passed to the callback function.
5700  *
5701  * This function sets a callback function to intercepts a move event
5702  * of a canvas object.
5703  *
5704  * @see evas_object_intercept_move_callback_del().
5705  *
5706  */
5707 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);
5708
5709 /**
5710  * Unset the callback function that intercepts a move event of a
5711  * object.
5712  *
5713  * @param obj The given canvas object pointer.
5714  * @param func The given callback function.
5715  *
5716  * This function sets a callback function to intercepts a move event
5717  * of a canvas object.
5718  *
5719  * @see evas_object_intercept_move_callback_add().
5720  *
5721  */
5722 EAPI void             *evas_object_intercept_move_callback_del        (Evas_Object *obj, Evas_Object_Intercept_Move_Cb func) EINA_ARG_NONNULL(1, 2);
5723
5724    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);
5725    EAPI void             *evas_object_intercept_resize_callback_del      (Evas_Object *obj, Evas_Object_Intercept_Resize_Cb func) EINA_ARG_NONNULL(1, 2);
5726    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);
5727    EAPI void             *evas_object_intercept_raise_callback_del       (Evas_Object *obj, Evas_Object_Intercept_Raise_Cb func) EINA_ARG_NONNULL(1, 2);
5728    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);
5729    EAPI void             *evas_object_intercept_lower_callback_del       (Evas_Object *obj, Evas_Object_Intercept_Lower_Cb func) EINA_ARG_NONNULL(1, 2);
5730    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);
5731    EAPI void             *evas_object_intercept_stack_above_callback_del (Evas_Object *obj, Evas_Object_Intercept_Stack_Above_Cb func) EINA_ARG_NONNULL(1, 2);
5732    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);
5733    EAPI void             *evas_object_intercept_stack_below_callback_del (Evas_Object *obj, Evas_Object_Intercept_Stack_Below_Cb func) EINA_ARG_NONNULL(1, 2);
5734    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);
5735    EAPI void             *evas_object_intercept_layer_set_callback_del   (Evas_Object *obj, Evas_Object_Intercept_Layer_Set_Cb func) EINA_ARG_NONNULL(1, 2);
5736    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);
5737    EAPI void             *evas_object_intercept_color_set_callback_del   (Evas_Object *obj, Evas_Object_Intercept_Color_Set_Cb func) EINA_ARG_NONNULL(1, 2);
5738    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);
5739    EAPI void             *evas_object_intercept_clip_set_callback_del    (Evas_Object *obj, Evas_Object_Intercept_Clip_Set_Cb func) EINA_ARG_NONNULL(1, 2);
5740    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);
5741    EAPI void             *evas_object_intercept_clip_unset_callback_del  (Evas_Object *obj, Evas_Object_Intercept_Clip_Unset_Cb func) EINA_ARG_NONNULL(1, 2);
5742
5743 /**
5744  * @defgroup Evas_Object_Specific Specific Object Functions
5745  *
5746  * Functions that work on specific objects.
5747  *
5748  */
5749
5750 /**
5751  * @defgroup Evas_Object_Rectangle Rectangle Object Functions
5752  *
5753  * @brief Function to create evas rectangle objects.
5754  *
5755  * This function may seem useless given there are no functions to manipulate
5756  * the created rectangle, however the rectangle is actually very useful and can
5757  * be manipulate using the generic @ref Evas_Object_Group
5758  * "evas object functions".
5759  *
5760  * For an example of use of an evas_object_rectangle see @ref
5761  * Example_Evas_Object_Manipulation "here".
5762  *
5763  * @ingroup Evas_Object_Specific
5764  */
5765
5766 /**
5767  * Adds a rectangle to the given evas.
5768  * @param   e The given evas.
5769  * @return  The new rectangle object.
5770  *
5771  * @ingroup Evas_Object_Rectangle
5772  */
5773 EAPI Evas_Object      *evas_object_rectangle_add         (Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
5774
5775 /**
5776  * @defgroup Evas_Object_Image Image Object Functions
5777  *
5778  * Here are grouped together functions used to create and manipulate
5779  * image objects. They are available to whichever occasion one needs
5780  * complex imagery on a GUI that could not be achieved by the other
5781  * Evas' primitive object types, or to make image manipulations.
5782  *
5783  * Evas will support whichever image file types it was compiled with
5784  * support to (its image loaders) -- check your software packager for
5785  * that information and see
5786  * evas_object_image_extension_can_load_get().
5787  *
5788  * @section Evas_Object_Image_Basics Image object basics
5789  *
5790  * The most common use of image objects -- to display an image on the
5791  * canvas -- is achieved by a common function triplet:
5792  * @code
5793  * img = evas_object_image_add(canvas);
5794  * evas_object_image_file_set(img, "path/to/img", NULL);
5795  * evas_object_image_fill_set(img, 0, 0, w, h);
5796  * @endcode
5797  * The first function, naturally, is creating the image object. Then,
5798  * one must set an source file on it, so that it knows where to fetch
5799  * image data from. Next, one must set <b>how to fill the image
5800  * object's area</b> with that given pixel data. One could use just a
5801  * sub-region of the original image or even have it tiled repeatedly
5802  * on the image object. For the common case of having the whole source
5803  * image to be displayed on the image object, streched to the
5804  * destination's size, there's also a function helper, to be used
5805  * instead of evas_object_image_fill_set():
5806  * @code
5807  * evas_object_image_filled_set(img, EINA_TRUE);
5808  * @endcode
5809  * See those functions' documentation for more details.
5810  *
5811  * @section Evas_Object_Image_Scale Scale and resizing
5812  *
5813  * Resizing of image objects will scale their respective source images
5814  * to their areas, if they are set to "fill" the object's area
5815  * (evas_object_image_filled_set()). If the user wants any control on
5816  * the aspect ratio of an image for different sizes, he/she has to
5817  * take care of that themselves. There are functions to make images to
5818  * get loaded scaled (up or down) in memory, already, if the user is
5819  * going to use them at pre-determined sizes and wants to save
5820  * computations.
5821  *
5822  * Evas has even a scale cache, which will take care of caching scaled
5823  * versions of images with more often usage/hits. Finally, one can
5824  * have images being rescaled @b smoothly by Evas (more
5825  * computationally expensive) or not.
5826  *
5827  * @section Evas_Object_Image_Performance Performance hints
5828  *
5829  * When dealing with image objects, there are some tricks to boost the
5830  * performance of your application, if it does intense image loading
5831  * and/or manipulations, as in animations on a UI.
5832  *
5833  * @subsection Evas_Object_Image_Load Load hints
5834  *
5835  * In image viewer applications, for example, the user will be looking
5836  * at a given image, at full size, and will desire that the navigation
5837  * to the adjacent images on his/her album be fluid and fast. Thus,
5838  * while displaying a given image, the program can be on the
5839  * background loading the next and previous imagens already, so that
5840  * displaying them on the sequence is just a matter of repainting the
5841  * screen (and not decoding image data).
5842  *
5843  * Evas addresses this issue with <b>image pre-loading</b>. The code
5844  * for the situation above would be something like the following:
5845  * @code
5846  * prev = evas_object_image_filled_add(canvas);
5847  * evas_object_image_file_set(prev, "/path/to/prev", NULL);
5848  * evas_object_image_preload(prev, EINA_TRUE);
5849  *
5850  * next = evas_object_image_filled_add(canvas);
5851  * evas_object_image_file_set(next, "/path/to/next", NULL);
5852  * evas_object_image_preload(next, EINA_TRUE);
5853  * @endcode
5854  *
5855  * If you're loading images which are too big, consider setting
5856  * previously it's loading size to something smaller, in case you
5857  * won't expose them in real size. It may speed up the loading
5858  * considerably:
5859  * @code
5860  * //to load a scaled down version of the image in memory, if that's
5861  * //the size you'll be displaying it anyway
5862  * evas_object_image_load_scale_down_set(img, zoom);
5863  *
5864  * //optional: if you know you'll be showing a sub-set of the image's
5865  * //pixels, you can avoid loading the complementary data
5866  * evas_object_image_load_region_set(img, x, y, w, h);
5867  * @endcode
5868  * Refer to Elementary's Photocam widget for a high level (smart)
5869  * object which does lots of loading speed-ups for you.
5870  *
5871  * @subsection Evas_Object_Image_Animation Animation hints
5872  *
5873  * If you want to animate image objects on a UI (what you'd get by
5874  * concomitant usage of other libraries, like Ecore and Edje), there
5875  * are also some tips on how to boost the performance of your
5876  * application. If the animation involves resizing of an image (thus,
5877  * re-scaling), you'd better turn off smooth scaling on it @b during
5878  * the animation, turning it back on afterwrads, for less
5879  * computations. Also, in this case you'd better flag the image object
5880  * in question not to cache scaled versions of it:
5881  * @code
5882  * evas_object_image_scale_hint_set(wd->img, EVAS_IMAGE_SCALE_HINT_DYNAMIC);
5883  *
5884  * // resizing takes place in between
5885  *
5886  * evas_object_image_scale_hint_set(wd->img, EVAS_IMAGE_SCALE_HINT_STATIC);
5887  * @endcode
5888  *
5889  * Finally, movement of opaque images through the canvas is less
5890  * expensive than of translucid ones, because of blending
5891  * computations.
5892  *
5893  * @section Evas_Object_Image_Borders Borders
5894  *
5895  * Evas provides facilities for one to specify an image's region to be
5896  * treated specially -- as "borders". This will make those regions be
5897  * treated specially on resizing scales, by keeping their aspect. This
5898  * makes setting frames around other objects on UIs easy.
5899  * See the following figures for a visual explanation:\n
5900  * @htmlonly
5901  * <img src="image-borders.png" style="max-width: 100%;" />
5902  * <a href="image-borders.png">Full-size</a>
5903  * @endhtmlonly
5904  * @image rtf image-borders.png
5905  * @image latex image-borders.eps width=\textwidth
5906  * @htmlonly
5907  * <img src="border-effect.png" style="max-width: 100%;" />
5908  * <a href="border-effect.png">Full-size</a>
5909  * @endhtmlonly
5910  * @image rtf border-effect.png
5911  * @image latex border-effect.eps width=\textwidth
5912  *
5913  * @section Evas_Object_Image_Manipulation Manipulating pixels
5914  *
5915  * Evas image objects can be used to manipulate raw pixels in many
5916  * ways.  The meaning of the data in the pixel arrays will depend on
5917  * the image's color space, be warned (see next section). You can set
5918  * your own data as an image's pixel data, fetch an image's pixel data
5919  * for saving/altering, convert images between different color spaces
5920  * and even advanced operations like setting a native surface as image
5921  * objecs' data.
5922  *
5923  * @section Evas_Object_Image_Color_Spaces Color spaces
5924  *
5925  * Image objects may return or accept "image data" in multiple
5926  * formats. This is based on the color space of an object. Here is a
5927  * rundown on formats:
5928  *
5929  * - #EVAS_COLORSPACE_ARGB8888:
5930  *   .
5931  *   This pixel format is a linear block of pixels, starting at the
5932  *   top-left row by row until the bottom right of the image or pixel
5933  *   region. All pixels are 32-bit unsigned int's with the high-byte
5934  *   being alpha and the low byte being blue in the format ARGB. Alpha
5935  *   may or may not be used by evas depending on the alpha flag of the
5936  *   image, but if not used, should be set to 0xff anyway.
5937  *   \n\n
5938  *   This colorspace uses premultiplied alpha. That means that R, G
5939  *   and B cannot exceed A in value. The conversion from
5940  *   non-premultiplied colorspace is:
5941  *   \n\n
5942  *   R = (r * a) / 255; G = (g * a) / 255; B = (b * a) / 255;
5943  *   \n\n
5944  *   So 50% transparent blue will be: 0x80000080. This will not be
5945  *   "dark" - just 50% transparent. Values are 0 == black, 255 ==
5946  *   solid or full red, green or blue.
5947  *
5948  * - #EVAS_COLORSPACE_YCBCR422P601_PL:
5949  *   .
5950  *   This is a pointer-list indirected set of YUV (YCbCr) pixel
5951  *   data. This means that the data returned or set is not actual
5952  *   pixel data, but pointers TO lines of pixel data. The list of
5953  *   pointers will first be N rows of pointers to the Y plane -
5954  *   pointing to the first pixel at the start of each row in the Y
5955  *   plane. N is the height of the image data in pixels. Each pixel in
5956  *   the Y, U and V planes is 1 byte exactly, packed. The next N / 2
5957  *   pointers will point to rows in the U plane, and the next N / 2
5958  *   pointers will point to the V plane rows. U and V planes are half
5959  *   the horizontal and vertical resolution of the Y plane.
5960  *   \n\n
5961  *   Row order is top to bottom and row pixels are stored left to
5962  *   right.
5963  *   \n\n
5964  *   There is a limitation that these images MUST be a multiple of 2
5965  *   pixels in size horizontally or vertically. This is due to the U
5966  *   and V planes being half resolution. Also note that this assumes
5967  *   the itu601 YUV colorspace specification. This is defined for
5968  *   standard television and mpeg streams. HDTV may use the itu709
5969  *   specification.
5970  *   \n\n
5971  *   Values are 0 to 255, indicating full or no signal in that plane
5972  *   respectively.
5973  *
5974  * - #EVAS_COLORSPACE_YCBCR422P709_PL:
5975  *   .
5976  *   Not implemented yet.
5977  *
5978  * - #EVAS_COLORSPACE_RGB565_A5P:
5979  *   .
5980  *   In the process of being implemented in 1 engine only. This may
5981  *   change.
5982  *   \n\n
5983  *   This is a pointer to image data for 16-bit half-word pixel data
5984  *   in 16bpp RGB 565 format (5 bits red, 6 bits green, 5 bits blue),
5985  *   with the high-byte containing red and the low byte containing
5986  *   blue, per pixel. This data is packed row by row from the top-left
5987  *   to the bottom right.
5988  *   \n\n
5989  *   If the image has an alpha channel enabled there will be an extra
5990  *   alpha plane after the color pixel plane. If not, then this data
5991  *   will not exist and should not be accessed in any way. This plane
5992  *   is a set of pixels with 1 byte per pixel defining the alpha
5993  *   values of all pixels in the image from the top-left to the bottom
5994  *   right of the image, row by row. Even though the values of the
5995  *   alpha pixels can be 0 to 255, only values 0 through to 32 are
5996  *   used, 32 being solid and 0 being transparent.
5997  *   \n\n
5998  *   RGB values can be 0 to 31 for red and blue and 0 to 63 for green,
5999  *   with 0 being black and 31 or 63 being full red, green or blue
6000  *   respectively. This colorspace is also pre-multiplied like
6001  *   EVAS_COLORSPACE_ARGB8888 so:
6002  *   \n\n
6003  *   R = (r * a) / 32; G = (g * a) / 32; B = (b * a) / 32;
6004  *
6005  * - #EVAS_COLORSPACE_GRY8:
6006  *   .
6007  *   The image is just a alpha mask (8 bit's per pixel). This is used
6008  *   for alpha masking.
6009  *
6010  * Some examples on this group of functions can be found @ref
6011  * Example_Evas_Images "here".
6012  *
6013  * @ingroup Evas_Object_Specific
6014  */
6015
6016 /**
6017  * @addtogroup Evas_Object_Image
6018  * @{
6019  */
6020
6021 typedef void (*Evas_Object_Image_Pixels_Get_Cb) (void *data, Evas_Object *o);
6022
6023
6024 /**
6025  * Creates a new image object on the given Evas @p e canvas.
6026  *
6027  * @param e The given canvas.
6028  * @return The created image object handle.
6029  *
6030  * @note If you intend to @b display an image somehow in a GUI,
6031  * besides binding it to a real image file/source (with
6032  * evas_object_image_file_set(), for example), you'll have to tell
6033  * this image object how to fill its space with the pixels it can get
6034  * from the source. See evas_object_image_filled_add(), for a helper
6035  * on the common case of scaling up an image source to the whole area
6036  * of the image object.
6037  *
6038  * @see evas_object_image_fill_set()
6039  *
6040  * Example:
6041  * @code
6042  * img = evas_object_image_add(canvas);
6043  * evas_object_image_file_set(img, "/path/to/img", NULL);
6044  * @endcode
6045  */
6046 EAPI Evas_Object             *evas_object_image_add                    (Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
6047
6048 /**
6049  * Creates a new image object that @b automatically scales its bound
6050  * image to the object's area, on both axis.
6051  *
6052  * @param e The given canvas.
6053  * @return The created image object handle.
6054  *
6055  * This is a helper function around evas_object_image_add() and
6056  * evas_object_image_filled_set(). It has the same effect of applying
6057  * those functions in sequence, which is a very common use case.
6058  *
6059  * @note Whenever this object gets resized, the bound image will be
6060  * rescaled, too.
6061  *
6062  * @see evas_object_image_add()
6063  * @see evas_object_image_filled_set()
6064  * @see evas_object_image_fill_set()
6065  */
6066 EAPI Evas_Object             *evas_object_image_filled_add             (Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
6067
6068
6069 /**
6070  * Sets the data for an image from memory to be loaded
6071  *
6072  * This is the same as evas_object_image_file_set() but the file to be loaded
6073  * may exist at an address in memory (the data for the file, not the filename
6074  * itself). The @p data at the address is copied and stored for future use, so
6075  * no @p data needs to be kept after this call is made. It will be managed and
6076  * freed for you when no longer needed. The @p size is limited to 2 gigabytes
6077  * in size, and must be greater than 0. A NULL @p data pointer is also invalid.
6078  * Set the filename to NULL to reset to empty state and have the image file
6079  * data freed from memory using evas_object_image_file_set().
6080  *
6081  * The @p format is optional (pass NULL if you don't need/use it). It is used
6082  * to help Evas guess better which loader to use for the data. It may simply
6083  * be the "extension" of the file as it would normally be on disk such as
6084  * "jpg" or "png" or "gif" etc.
6085  *
6086  * @param obj The given image object.
6087  * @param data The image file data address
6088  * @param size The size of the image file data in bytes
6089  * @param format The format of the file (optional), or @c NULL if not needed
6090  * @param key The image key in file, or @c NULL.
6091  */
6092 EAPI void                     evas_object_image_memfile_set            (Evas_Object *obj, void *data, int size, char *format, char *key) EINA_ARG_NONNULL(1, 2);
6093
6094 /**
6095  * Set the source file from where an image object must fetch the real
6096  * image data (it may be an Eet file, besides pure image ones).
6097  *
6098  * @param obj The given image object.
6099  * @param file The image file path.
6100  * @param key The image key in @p file (if its an Eet one), or @c
6101  * NULL, otherwise.
6102  *
6103  * If the file supports multiple data stored in it (as Eet files do),
6104  * you can specify the key to be used as the index of the image in
6105  * this file.
6106  *
6107  * Example:
6108  * @code
6109  * img = evas_object_image_add(canvas);
6110  * evas_object_image_file_set(img, "/path/to/img", NULL);
6111  * err = evas_object_image_load_error_get(img);
6112  * if (err != EVAS_LOAD_ERROR_NONE)
6113  *   {
6114  *      fprintf(stderr, "could not load image '%s'. error string is \"%s\"\n",
6115  *              valid_path, evas_load_error_str(err));
6116  *   }
6117  * else
6118  *   {
6119  *      evas_object_image_fill_set(img, 0, 0, w, h);
6120  *      evas_object_resize(img, w, h);
6121  *      evas_object_show(img);
6122  *   }
6123  * @endcode
6124  */
6125 EAPI void                     evas_object_image_file_set               (Evas_Object *obj, const char *file, const char *key) EINA_ARG_NONNULL(1);
6126
6127 /**
6128  * Retrieve the source file from where an image object is to fetch the
6129  * real image data (it may be an Eet file, besides pure image ones).
6130  *
6131  * @param obj The given image object.
6132  * @param file Location to store the image file path.
6133  * @param key Location to store the image key (if @p file is an Eet
6134  * one).
6135  *
6136  * You must @b not modify the strings on the returned pointers.
6137  *
6138  * @note Use @c NULL pointers on the file components you're not
6139  * interested in: they'll be ignored by the function.
6140  */
6141 EAPI void                     evas_object_image_file_get               (const Evas_Object *obj, const char **file, const char **key) EINA_ARG_NONNULL(1, 2);
6142
6143 /**
6144  * Set the dimensions for an image object's border, a region which @b
6145  * won't ever be scaled together with its center.
6146  *
6147  * @param obj The given image object.
6148  * @param l The border's left width.
6149  * @param r The border's right width.
6150  * @param t The border's top width.
6151  * @param b The border's bottom width.
6152  *
6153  * When Evas is rendering, an image source may be scaled to fit the
6154  * size of its image object. This function sets an area from the
6155  * borders of the image inwards which is @b not to be scaled. This
6156  * function is useful for making frames and for widget theming, where,
6157  * for example, buttons may be of varying sizes, but their border size
6158  * must remain constant.
6159  *
6160  * The units used for @p l, @p r, @p t and @p b are canvas units.
6161  *
6162  * @note The border region itself @b may be scaled by the
6163  * evas_object_image_border_scale_set() function.
6164  *
6165  * @note By default, image objects have no borders set, i. e. @c l, @c
6166  * r, @c t and @c b start as @c 0.
6167  *
6168  * See the following figures for visual explanation:\n
6169  * @htmlonly
6170  * <img src="image-borders.png" style="max-width: 100%;" />
6171  * <a href="image-borders.png">Full-size</a>
6172  * @endhtmlonly
6173  * @image rtf image-borders.png
6174  * @image latex image-borders.eps width=\textwidth
6175  * @htmlonly
6176  * <img src="border-effect.png" style="max-width: 100%;" />
6177  * <a href="border-effect.png">Full-size</a>
6178  * @endhtmlonly
6179  * @image rtf border-effect.png
6180  * @image latex border-effect.eps width=\textwidth
6181  *
6182  * @see evas_object_image_border_get()
6183  * @see evas_object_image_border_center_fill_set()
6184  */
6185 EAPI void                     evas_object_image_border_set             (Evas_Object *obj, int l, int r, int t, int b) EINA_ARG_NONNULL(1);
6186
6187 /**
6188  * Retrieve the dimensions for an image object's border, a region
6189  * which @b won't ever be scaled together with its center.
6190  *
6191  * @param obj The given image object.
6192  * @param l Location to store the border's left width in.
6193  * @param r Location to store the border's right width in.
6194  * @param t Location to store the border's top width in.
6195  * @param b Location to store the border's bottom width in.
6196  *
6197  * @note Use @c NULL pointers on the border components you're not
6198  * interested in: they'll be ignored by the function.
6199  *
6200  * See @ref evas_object_image_border_set() for more details.
6201  */
6202 EAPI void                     evas_object_image_border_get             (const Evas_Object *obj, int *l, int *r, int *t, int *b) EINA_ARG_NONNULL(1);
6203
6204 /**
6205  * Sets @b how the center part of the given image object (not the
6206  * borders) should be drawn when Evas is rendering it.
6207  *
6208  * @param obj The given image object.
6209  * @param fill Fill mode of the center region of @p obj (a value in
6210  * #Evas_Border_Fill_Mode).
6211  *
6212  * This function sets how the center part of the image object's source
6213  * image is to be drawn, which must be one of the values in
6214  * #Evas_Border_Fill_Mode. By center we mean the complementary part of
6215  * that defined by evas_object_image_border_set(). This one is very
6216  * useful for making frames and decorations. You would most probably
6217  * also be using a filled image (as in evas_object_image_filled_set())
6218  * to use as a frame.
6219  *
6220  * @see evas_object_image_border_center_fill_get()
6221  */
6222 EAPI void                     evas_object_image_border_center_fill_set (Evas_Object *obj, Evas_Border_Fill_Mode fill) EINA_ARG_NONNULL(1);
6223
6224 /**
6225  * Retrieves @b how the center part of the given image object (not the
6226  * borders) is to be drawn when Evas is rendering it.
6227  *
6228  * @param obj The given image object.
6229  * @return fill Fill mode of the center region of @p obj (a value in
6230  * #Evas_Border_Fill_Mode).
6231  *
6232  * See @ref evas_object_image_fill_set() for more details.
6233  */
6234 EAPI Evas_Border_Fill_Mode    evas_object_image_border_center_fill_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
6235
6236 /**
6237  * Set whether the image object's fill property should track the
6238  * object's size.
6239  *
6240  * @param obj The given image object.
6241  * @param setting @c EINA_TRUE, to make the fill property follow
6242  *        object size or @c EINA_FALSE, otherwise
6243  *
6244  * If @p setting is @c EINA_TRUE, then every evas_object_resize() will
6245  * @b automatically trigger a call to evas_object_image_fill_set()
6246  * with the that new size (and @c 0, @c 0 as source image's origin),
6247  * so the bound image will fill the whole object's area.
6248  *
6249  * @see evas_object_image_filled_add()
6250  * @see evas_object_image_fill_get()
6251  */
6252 EAPI void                     evas_object_image_filled_set             (Evas_Object *obj, Eina_Bool setting) EINA_ARG_NONNULL(1);
6253
6254 /**
6255  * Retrieve whether the image object's fill property should track the
6256  * object's size.
6257  *
6258  * @param obj The given image object.
6259  * @return @c EINA_TRUE if it is tracking, @c EINA_FALSE, if not (and
6260  *         evas_object_fill_set() must be called manually).
6261  *
6262  * @see evas_object_image_filled_set() for more information
6263  */
6264 EAPI Eina_Bool                evas_object_image_filled_get             (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
6265
6266 /**
6267  * Sets the scaling factor (multiplier) for the borders of an image
6268  * object.
6269  *
6270  * @param obj The given image object.
6271  * @param scale The scale factor (default is @c 1.0 - i.e. no scaling)
6272  *
6273  * @see evas_object_image_border_set()
6274  * @see evas_object_image_border_scale_get()
6275  */
6276 EAPI void                     evas_object_image_border_scale_set       (Evas_Object *obj, double scale);
6277
6278 /**
6279  * Retrieves the scaling factor (multiplier) for the borders of an
6280  * image object.
6281  *
6282  * @param obj The given image object.
6283  * @return The scale factor set for its borders
6284  *
6285  * @see evas_object_image_border_set()
6286  * @see evas_object_image_border_scale_set()
6287  */
6288 EAPI double                   evas_object_image_border_scale_get       (const Evas_Object *obj);
6289
6290 /**
6291  * Set how to fill an image object's drawing rectangle given the
6292  * (real) image bound to it.
6293  *
6294  * @param obj The given image object to operate on.
6295  * @param x The x coordinate (from the top left corner of the bound
6296  *          image) to start drawing from.
6297  * @param y The y coordinate (from the top left corner of the bound
6298  *          image) to start drawing from.
6299  * @param w The width the bound image will be displayed at.
6300  * @param h The height the bound image will be displayed at.
6301  *
6302  * Note that if @p w or @h are smaller the same dimensions @p obj, the
6303  * displayed image will be @b tiled around the object's area. To have
6304  * only one copy of the bound image drawn, @p x and @p y must be 0 and
6305  * @p w and @p h need to be the exact width and height of the image
6306  * object itself, respectively.
6307  *
6308  * @warning The default values for the fill parameters are @p x = 0,
6309  * @p y = 0, @p w = 0 and @p h = 0. Thus, if you're not using the
6310  * evas_object_image_filled_add() helper and want your image
6311  * displayed, you'll have to set valid values with this fuction on
6312  * your object.
6313  *
6314  * @note evas_object_image_filled_set() is helper function which will
6315  * @b override the values set here automatically, for you, in a given
6316  * way.
6317  */
6318 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);
6319
6320 /**
6321  * Retrieve how an image object is to fill its drawing rectangle,
6322  * given the (real) image bound to it.
6323  *
6324  * @param obj The given image object.
6325  * @param x Location to store the x coordinate (from the top left
6326  *          corner of the bound image) to start drawing from.
6327  * @param y Location to store the y coordinate (from the top left
6328  *          corner of the bound image) to start drawing from.
6329  * @param w Location to store the width the bound image is to be
6330  *          displayed at.
6331  * @param h Location to store the height the bound image is to be
6332  *          displayed at.
6333  *
6334  * @note Use @c NULL pointers on the fill components you're not
6335  * interested in: they'll be ignored by the function.
6336  *
6337  * See @ref evas_object_image_fill_set() for more details.
6338  */
6339 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);
6340
6341 /**
6342  * Sets the tiling mode for the given evas image object's fill.
6343  * @param   obj   The given evas image object.
6344  * @param   spread One of EVAS_TEXTURE_REFLECT, EVAS_TEXTURE_REPEAT,
6345  * EVAS_TEXTURE_RESTRICT, or EVAS_TEXTURE_PAD.
6346  */
6347 EAPI void                     evas_object_image_fill_spread_set        (Evas_Object *obj, Evas_Fill_Spread spread) EINA_ARG_NONNULL(1);
6348
6349 /**
6350  * Retrieves the spread (tiling mode) for the given image object's
6351  * fill.
6352  *
6353  * @param   obj The given evas image object.
6354  * @return  The current spread mode of the image object.
6355  */
6356 EAPI Evas_Fill_Spread         evas_object_image_fill_spread_get        (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
6357
6358 /**
6359  * Sets the size of the given image object.
6360  *
6361  * @param obj The given image object.
6362  * @param w The new width of the image.
6363  * @param h The new height of the image.
6364  *
6365  * This function will scale down or crop the image so that it is
6366  * treated as if it were at the given size. If the size given is
6367  * smaller than the image, it will be cropped. If the size given is
6368  * larger, then the image will be treated as if it were in the upper
6369  * left hand corner of a larger image that is otherwise transparent.
6370  */
6371 EAPI void                     evas_object_image_size_set               (Evas_Object *obj, int w, int h) EINA_ARG_NONNULL(1);
6372
6373 /**
6374  * Retrieves the size of the given image object.
6375  *
6376  * @param obj The given image object.
6377  * @param w Location to store the width of the image in, or @c NULL.
6378  * @param h Location to store the height of the image in, or @c NULL.
6379  *
6380  * See @ref evas_object_image_size_set() for more details.
6381  */
6382 EAPI void                     evas_object_image_size_get               (const Evas_Object *obj, int *w, int *h) EINA_ARG_NONNULL(1);
6383
6384 /**
6385  * Retrieves the row stride of the given image object.
6386  *
6387  * @param obj The given image object.
6388  * @return The stride of the image (<b>in bytes</b>).
6389  *
6390  * The row stride is the number of bytes between the start of a row
6391  * and the start of the next row for image data.
6392  */
6393 EAPI int                      evas_object_image_stride_get             (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
6394
6395 /**
6396  * Retrieves a number representing any error that occurred during the
6397  * last loading of the given image object's source image.
6398  *
6399  * @param obj The given image object.
6400  * @return A value giving the last error that occurred. It should be
6401  *         one of the #Evas_Load_Error values. #EVAS_LOAD_ERROR_NONE
6402  *         is returned if there was no error.
6403  */
6404 EAPI Evas_Load_Error          evas_object_image_load_error_get         (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
6405
6406 /**
6407  * Sets the raw image data of the given image object.
6408  *
6409  * @param obj The given image object.
6410  * @param data The raw data, or @c NULL.
6411  *
6412  * Note that the raw data must be of the same size (see
6413  * evas_object_image_size_set(), which has to be called @b before this
6414  * one) and colorspace (see evas_object_image_colorspace_set()) of the
6415  * image. If data is @c NULL, the current image data will be
6416  * freed. Naturally, if one does not set an image object's data
6417  * manually, it will still have one, allocated by Evas.
6418  *
6419  * @see evas_object_image_data_get()
6420  */
6421 EAPI void                     evas_object_image_data_set               (Evas_Object *obj, void *data) EINA_ARG_NONNULL(1);
6422
6423 /**
6424  * Get a pointer to the raw image data of the given image object.
6425  *
6426  * @param obj The given image object.
6427  * @param for_writing Whether the data being retrieved will be
6428  *        modified (@c EINA_TRUE) or not (@c EINA_FALSE).
6429  * @return The raw image data.
6430  *
6431  * This function returns a pointer to an image object's internal pixel
6432  * buffer, for reading only or read/write. If you request it for
6433  * writing, the image will be marked dirty so that it gets redrawn at
6434  * the next update.
6435  *
6436  * Each time you call this function on an image object, its data
6437  * buffer will have an internal reference counter
6438  * incremented. Decrement it back by using
6439  * evas_object_image_data_set(). This is specially important for the
6440  * directfb Evas engine.
6441  *
6442  * This is best suited for when you want to modify an existing image,
6443  * without changing its dimensions.
6444  *
6445  * @note The contents' formart returned by it depend on the color
6446  * space of the given image object.
6447  *
6448  * @note You may want to use evas_object_image_data_update_add() to
6449  * inform data changes, if you did any.
6450  *
6451  * @see evas_object_image_data_set()
6452  */
6453 EAPI void                    *evas_object_image_data_get               (const Evas_Object *obj, Eina_Bool for_writing) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
6454
6455 /**
6456  * Converts the raw image data of the given image object to the
6457  * specified colorspace.
6458  *
6459  * Note that this function does not modify the raw image data.  If the
6460  * requested colorspace is the same as the image colorspace nothing is
6461  * done and NULL is returned. You should use
6462  * evas_object_image_colorspace_get() to check the current image
6463  * colorspace.
6464  *
6465  * See @ref evas_object_image_colorspace_get.
6466  *
6467  * @param obj The given image object.
6468  * @param to_cspace The colorspace to which the image raw data will be converted.
6469  * @return data A newly allocated data in the format specified by to_cspace.
6470  */
6471 EAPI void                    *evas_object_image_data_convert           (Evas_Object *obj, Evas_Colorspace to_cspace) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
6472
6473 /**
6474  * Replaces the raw image data of the given image object.
6475  *
6476  * @param obj The given image object.
6477  * @param data The raw data to replace.
6478  *
6479  * This function lets the application replace an image object's
6480  * internal pixel buffer with an user-allocated one. For best results,
6481  * you should generally first call evas_object_image_size_set() with
6482  * the width and height for the new buffer.
6483  *
6484  * This call is best suited for when you will be using image data with
6485  * different dimensions than the existing image data, if any. If you
6486  * only need to modify the existing image in some fashion, then using
6487  * evas_object_image_data_get() is probably what you are after.
6488  *
6489  * Note that the caller is responsible for freeing the buffer when
6490  * finished with it, as user-set image data will not be automatically
6491  * freed when the image object is deleted.
6492  *
6493  * See @ref evas_object_image_data_get() for more details.
6494  *
6495  */
6496 EAPI void                     evas_object_image_data_copy_set          (Evas_Object *obj, void *data) EINA_ARG_NONNULL(1);
6497
6498 /**
6499  * Mark a sub-region of the given image object to be redrawn.
6500  *
6501  * @param obj The given image object.
6502  * @param x X-offset of the region to be updated.
6503  * @param y Y-offset of the region to be updated.
6504  * @param w Width of the region to be updated.
6505  * @param h Height of the region to be updated.
6506  *
6507  * This function schedules a particular rectangular region of an image
6508  * object to be updated (redrawn) at the next rendering cycle.
6509  */
6510 EAPI void                     evas_object_image_data_update_add        (Evas_Object *obj, int x, int y, int w, int h) EINA_ARG_NONNULL(1);
6511
6512 /**
6513  * Enable or disable alpha channel usage on the given image object.
6514  *
6515  * @param obj The given image object.
6516  * @param has_alpha Whether to use alpha channel (@c EINA_TRUE) data
6517  * or not (@c EINA_FALSE).
6518  *
6519  * This function sets a flag on an image object indicating whether or
6520  * not to use alpha channel data. A value of @c EINA_TRUE makes it use
6521  * alpha channel data, and @c EINA_FALSE makes it ignore that
6522  * data. Note that this has nothing to do with an object's color as
6523  * manipulated by evas_object_color_set().
6524  *
6525  * @see evas_object_image_alpha_get()
6526  */
6527 EAPI void                     evas_object_image_alpha_set              (Evas_Object *obj, Eina_Bool has_alpha) EINA_ARG_NONNULL(1);
6528
6529 /**
6530  * Retrieve whether alpha channel data is being used on the given
6531  * image object.
6532  *
6533  * @param obj The given image object.
6534  * @return Whether the alpha channel data is being used (@c EINA_TRUE)
6535  * or not (@c EINA_FALSE).
6536  *
6537  * This function returns @c EINA_TRUE if the image object's alpha
6538  * channel is being used, or @c EINA_FALSE otherwise.
6539  *
6540  * See @ref evas_object_image_alpha_set() for more details.
6541  */
6542 EAPI Eina_Bool                evas_object_image_alpha_get              (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
6543
6544 /**
6545  * Sets whether to use high-quality image scaling algorithm on the
6546  * given image object.
6547  *
6548  * @param obj The given image object.
6549  * @param smooth_scale Whether to use smooth scale or not.
6550  *
6551  * When enabled, a higher quality image scaling algorithm is used when
6552  * scaling images to sizes other than the source image's original
6553  * one. This gives better results but is more computationally
6554  * expensive.
6555  *
6556  * @note Image objects get created originally with smooth scaling @b
6557  * on.
6558  *
6559  * @see evas_object_image_smooth_scale_get()
6560  */
6561 EAPI void                     evas_object_image_smooth_scale_set       (Evas_Object *obj, Eina_Bool smooth_scale) EINA_ARG_NONNULL(1);
6562
6563 /**
6564  * Retrieves whether the given image object is using high-quality
6565  * image scaling algorithm.
6566  *
6567  * @param obj The given image object.
6568  * @return Whether smooth scale is being used.
6569  *
6570  * See @ref evas_object_image_smooth_scale_set() for more details.
6571  */
6572 EAPI Eina_Bool                evas_object_image_smooth_scale_get       (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
6573
6574 /**
6575  * Preload an image object's image data in the background
6576  *
6577  * @param obj The given image object.
6578  * @param cancel @c EINA_FALSE will add it the preloading work queue,
6579  *               @c EINA_TRUE will remove it (if it was issued before).
6580  *
6581  * This function requests the preload of the data image in the
6582  * background. The work is queued before being processed (because
6583  * there might be other pending requests of this type).
6584  *
6585  * Whenever the image data gets loaded, Evas will call
6586  * #EVAS_CALLBACK_IMAGE_PRELOADED registered callbacks on @p obj (what
6587  * may be immediately, if the data was already preloaded before).
6588  *
6589  * Use @c EINA_TRUE for @p cancel on scenarios where you don't need
6590  * the image data preloaded anymore.
6591  *
6592  * @note Any evas_object_show() call after evas_object_image_preload()
6593  * will make the latter to be @b cancelled, with the loading process
6594  * now taking place @b synchronously (and, thus, blocking the return
6595  * of the former until the image is loaded). It is highly advisable,
6596  * then, that the user preload an image with it being @b hidden, just
6597  * to be shown on the #EVAS_CALLBACK_IMAGE_PRELOADED event's callback.
6598  */
6599 EAPI void                     evas_object_image_preload                (Evas_Object *obj, Eina_Bool cancel) EINA_ARG_NONNULL(1);
6600
6601 /**
6602  * Reload an image object's image data.
6603  *
6604  * @param obj The given image object pointer.
6605  *
6606  * This function reloads the image data bound to image object @p obj.
6607  */
6608 EAPI void                     evas_object_image_reload                 (Evas_Object *obj) EINA_ARG_NONNULL(1);
6609
6610 /**
6611  * Save the given image object's contents to an (image) file.
6612  *
6613  * @param obj The given image object.
6614  * @param file The filename to be used to save the image (extension
6615  *        obligatory).
6616  * @param key The image key in the file (if an Eet one), or @c NULL,
6617  *        otherwise.
6618  * @param flags String containing the flags to be used (@c NULL for
6619  *        none).
6620  *
6621  * The extension suffix on @p file will determine which <b>saver
6622  * module</b> Evas is to use when saving, thus the final file's
6623  * format. If the file supports multiple data stored in it (Eet ones),
6624  * you can specify the key to be used as the index of the image in it.
6625  *
6626  * You can specify some flags when saving the image.  Currently
6627  * acceptable flags are @c quality and @c compress. Eg.: @c
6628  * "quality=100 compress=9"
6629  */
6630 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);
6631
6632 /**
6633  * Import pixels from given source to a given canvas image object.
6634  *
6635  * @param obj The given canvas object.
6636  * @param pixels The pixel's source to be imported.
6637  *
6638  * This function imports pixels from a given source to a given canvas image.
6639  *
6640  */
6641 EAPI Eina_Bool                evas_object_image_pixels_import          (Evas_Object *obj, Evas_Pixel_Import_Source *pixels) EINA_ARG_NONNULL(1, 2);
6642
6643 /**
6644  * Set the callback function to get pixels from a canva's image.
6645  *
6646  * @param obj The given canvas pointer.
6647  * @param func The callback function.
6648  * @param data The data pointer to be passed to @a func.
6649  *
6650  * This functions sets a function to be the callback function that get
6651  * pixes from a image of the canvas.
6652  *
6653  */
6654 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);
6655
6656 /**
6657  * Mark whether the given image object is dirty (needs to be redrawn).
6658  *
6659  * @param obj The given image object.
6660  * @param dirty Whether the image is dirty.
6661  */
6662 EAPI void                     evas_object_image_pixels_dirty_set       (Evas_Object *obj, Eina_Bool dirty) EINA_ARG_NONNULL(1);
6663
6664 /**
6665  * Retrieves whether the given image object is dirty (needs to be redrawn).
6666  *
6667  * @param obj The given image object.
6668  * @return Whether the image is dirty.
6669  */
6670 EAPI Eina_Bool                evas_object_image_pixels_dirty_get       (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
6671
6672 /**
6673  * Set the DPI resolution of an image object's source image.
6674  *
6675  * @param obj The given canvas pointer.
6676  * @param dpi The new DPI resolution.
6677  *
6678  * This function sets the DPI resolution of a given loaded canvas
6679  * image. Most useful for the SVG image loader.
6680  *
6681  * @see evas_object_image_load_dpi_get()
6682  */
6683 EAPI void                     evas_object_image_load_dpi_set           (Evas_Object *obj, double dpi) EINA_ARG_NONNULL(1);
6684
6685 /**
6686  * Get the DPI resolution of a loaded image object in the canvas.
6687  *
6688  * @param obj The given canvas pointer.
6689  * @return The DPI resolution of the given canvas image.
6690  *
6691  * This function returns the DPI resolution of the given canvas image.
6692  *
6693  * @see evas_object_image_load_dpi_set() for more details
6694  */
6695 EAPI double                   evas_object_image_load_dpi_get           (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
6696
6697 /**
6698  * Set the size of a given image object's source image, when loading
6699  * it.
6700  *
6701  * @param obj The given canvas object.
6702  * @param w The new width of the image's load size.
6703  * @param h The new height of the image's load size.
6704  *
6705  * This function sets a new (loading) size for the given canvas
6706  * image.
6707  *
6708  * @see evas_object_image_load_size_get()
6709  */
6710 EAPI void                     evas_object_image_load_size_set          (Evas_Object *obj, int w, int h) EINA_ARG_NONNULL(1);
6711
6712 /**
6713  * Get the size of a given image object's source image, when loading
6714  * it.
6715  *
6716  * @param obj The given image object.
6717  * @param w Where to store the new width of the image's load size.
6718  * @param h Where to store the new height of the image's load size.
6719  *
6720  * @note Use @c NULL pointers on the size components you're not
6721  * interested in: they'll be ignored by the function.
6722  *
6723  * @see evas_object_image_load_size_set() for more details
6724  */
6725 EAPI void                     evas_object_image_load_size_get          (const Evas_Object *obj, int *w, int *h) EINA_ARG_NONNULL(1);
6726
6727 /**
6728  * Set the scale down factor of a given image object's source image,
6729  * when loading it.
6730  *
6731  * @param obj The given image object pointer.
6732  * @param scale_down The scale down factor.
6733  *
6734  * This function sets the scale down factor of a given canvas
6735  * image. Most useful for the SVG image loader.
6736  *
6737  * @see evas_object_image_load_scale_down_get()
6738  */
6739 EAPI void                     evas_object_image_load_scale_down_set    (Evas_Object *obj, int scale_down) EINA_ARG_NONNULL(1);
6740
6741 /**
6742  * get the scale down factor of a given image object's source image,
6743  * when loading it.
6744  *
6745  * @param obj The given image object pointer.
6746  *
6747  * @see evas_object_image_load_scale_down_set() for more details
6748  */
6749 EAPI int                      evas_object_image_load_scale_down_get    (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
6750
6751 /**
6752  * Inform a given image object to load a selective region of its
6753  * source image.
6754  *
6755  * @param obj The given image object pointer.
6756  * @param x X-offset of the region to be loaded.
6757  * @param y Y-offset of the region to be loaded.
6758  * @param w Width of the region to be loaded.
6759  * @param h Height of the region to be loaded.
6760  *
6761  * This function is useful when one is not showing all of an image's
6762  * area on its image object.
6763  *
6764  * @note The image loader for the image format in question has to
6765  * support selective region loading in order to this function to take
6766  * effect.
6767  *
6768  * @see evas_object_image_load_region_get()
6769  */
6770 EAPI void                     evas_object_image_load_region_set        (Evas_Object *obj, int x, int y, int w, int h) EINA_ARG_NONNULL(1);
6771
6772 /**
6773  * Retrieve the coordinates of a given image object's selective
6774  * (source image) load region.
6775  *
6776  * @param obj The given image object pointer.
6777  * @param x Where to store the X-offset of the region to be loaded.
6778  * @param y Where to store the Y-offset of the region to be loaded.
6779  * @param w Where to store the width of the region to be loaded.
6780  * @param h Where to store the height of the region to be loaded.
6781  *
6782  * @note Use @c NULL pointers on the coordinates you're not interested
6783  * in: they'll be ignored by the function.
6784  *
6785  * @see evas_object_image_load_region_get()
6786  */
6787 EAPI void                     evas_object_image_load_region_get        (const Evas_Object *obj, int *x, int *y, int *w, int *h) EINA_ARG_NONNULL(1);
6788
6789 /**
6790  * Define if the orientation information in the image file should be honored.
6791  *
6792  * @param obj The given image object pointer.
6793  * @param enable @p EINA_TRUE means that it should honor the orientation information
6794  * @since 1.1
6795  */
6796 EAPI void                     evas_object_image_load_orientation_set        (Evas_Object *obj, Eina_Bool enable) EINA_ARG_NONNULL(1);
6797
6798 /**
6799  * Get if the orientation information in the image file should be honored.
6800  *
6801  * @param obj The given image object pointer.
6802  * @since 1.1
6803  */
6804 EAPI Eina_Bool                evas_object_image_load_orientation_get        (const Evas_Object *obj) EINA_ARG_NONNULL(1);
6805
6806 /**
6807  * Set the colorspace of a given image of the canvas.
6808  *
6809  * @param obj The given image object pointer.
6810  * @param cspace The new color space.
6811  *
6812  * This function sets the colorspace of given canvas image.
6813  *
6814  */
6815 EAPI void                     evas_object_image_colorspace_set         (Evas_Object *obj, Evas_Colorspace cspace) EINA_ARG_NONNULL(1);
6816
6817 /**
6818  * Get the colorspace of a given image of the canvas.
6819  *
6820  * @param obj The given image object pointer.
6821  * @return The colorspace of the image.
6822  *
6823  * This function returns the colorspace of given canvas image.
6824  *
6825  */
6826 EAPI Evas_Colorspace          evas_object_image_colorspace_get         (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
6827
6828 /**
6829  * Set the native surface of a given image of the canvas
6830  *
6831  * @param obj The given canvas pointer.
6832  * @param surf The new native surface.
6833  *
6834  * This function sets a native surface of a given canvas image.
6835  *
6836  */
6837 EAPI void                     evas_object_image_native_surface_set     (Evas_Object *obj, Evas_Native_Surface *surf) EINA_ARG_NONNULL(1, 2);
6838
6839 /**
6840  * Get the native surface of a given image of the canvas
6841  *
6842  * @param obj The given canvas pointer.
6843  * @return The native surface of the given canvas image.
6844  *
6845  * This function returns the native surface of a given canvas image.
6846  *
6847  */
6848 EAPI Evas_Native_Surface     *evas_object_image_native_surface_get     (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
6849
6850 /**
6851  * Set the scale hint of a given image of the canvas.
6852  *
6853  * @param obj The given image object pointer.
6854  * @param hint The scale hint, a value in
6855  * #Evas_Image_Scale_Hint.
6856  *
6857  * This function sets the scale hint value of the given image object
6858  * in the canvas, which will affect how Evas is to cache scaled
6859  * versions of its original source image.
6860  *
6861  * @see evas_object_image_scale_hint_get()
6862  */
6863 EAPI void                     evas_object_image_scale_hint_set         (Evas_Object *obj, Evas_Image_Scale_Hint hint) EINA_ARG_NONNULL(1);
6864
6865 /**
6866  * Get the scale hint of a given image of the canvas.
6867  *
6868  * @param obj The given image object pointer.
6869  * @return The scale hint value set on @p obj, a value in
6870  * #Evas_Image_Scale_Hint.
6871  *
6872  * This function returns the scale hint value of the given image
6873  * object of the canvas.
6874  *
6875  * @see evas_object_image_scale_hint_set() for more details.
6876  */
6877 EAPI Evas_Image_Scale_Hint    evas_object_image_scale_hint_get         (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
6878
6879 /**
6880  * Set the content hint setting of a given image object of the canvas.
6881  *
6882  * @param obj The given canvas pointer.
6883  * @param hint The content hint value, one of the
6884  * #Evas_Image_Content_Hint ones.
6885  *
6886  * This function sets the content hint value of the given image of the
6887  * canvas. For example, if you're on the GL engine and your driver
6888  * implementation supports it, setting this hint to
6889  * #EVAS_IMAGE_CONTENT_HINT_DYNAMIC will make it need @b zero copies
6890  * at texture upload time, which is an "expensive" operation.
6891  *
6892  * @see evas_object_image_content_hint_get()
6893  */
6894 EAPI void                     evas_object_image_content_hint_set       (Evas_Object *obj, Evas_Image_Content_Hint hint) EINA_ARG_NONNULL(1);
6895
6896 /**
6897  * Get the content hint setting of a given image object of the canvas.
6898  *
6899  * @param obj The given canvas pointer.
6900  * @return hint The content hint value set on it, one of the
6901  * #Evas_Image_Content_Hint ones (#EVAS_IMAGE_CONTENT_HINT_NONE means
6902  * an error).
6903  *
6904  * This function returns the content hint value of the given image of
6905  * the canvas.
6906  *
6907  * @see evas_object_image_content_hint_set()
6908  */
6909 EAPI Evas_Image_Content_Hint  evas_object_image_content_hint_get       (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
6910
6911
6912 /**
6913  * Enable an image to be used as an alpha mask.
6914  *
6915  * This will set any flags, and discard any excess image data not used as an
6916  * alpha mask.
6917  *
6918  * Note there is little point in using a image as alpha mask unless it has an
6919  * alpha channel.
6920  *
6921  * @param obj Object to use as an alpha mask.
6922  * @param ismask Use image as alphamask, must be true.
6923  */
6924 EAPI void                     evas_object_image_alpha_mask_set         (Evas_Object *obj, Eina_Bool ismask) EINA_ARG_NONNULL(1);
6925
6926 /**
6927  * Set the source object on an image object to used as a @b proxy.
6928  *
6929  * @param obj Proxy (image) object.
6930  * @param src Source object to use for the proxy.
6931  * @return @c EINA_TRUE on success, @c EINA_FALSE on error.
6932  *
6933  * If an image object is set to behave as a @b proxy, it will mirror
6934  * the rendering contents of a given @b source object in its drawing
6935  * region, without affecting that source in any way. The source must
6936  * be another valid Evas object. Other effects may be applied to the
6937  * proxy, such as a map (see evas_object_map_set()) to create a
6938  * reflection of the original object (for example).
6939  *
6940  * Any existing source object on @p obj will be removed after this
6941  * call. Setting @p src to @c NULL clears the proxy object (not in
6942  * "proxy state" anymore).
6943  *
6944  * @warning You cannot set a proxy as another proxy's source.
6945  *
6946  * @see evas_object_image_source_get()
6947  * @see evas_object_image_source_unset()
6948  */
6949 EAPI Eina_Bool                evas_object_image_source_set             (Evas_Object *obj, Evas_Object *src) EINA_ARG_NONNULL(1);
6950
6951 /**
6952  * Get the current source object of an image object.
6953  *
6954  * @param obj Image object
6955  * @return Source object (if any), or @c NULL, if not in "proxy mode"
6956  * (or on errors).
6957  *
6958  * @see evas_object_image_source_set() for more details
6959  */
6960 EAPI Evas_Object             *evas_object_image_source_get             (Evas_Object *obj) EINA_ARG_NONNULL(1);
6961
6962 /**
6963  * Clear the source object on a proxy image object.
6964  *
6965  * @param obj Image object to clear source of.
6966  * @return @c EINA_TRUE on success, @c EINA_FALSE on error.
6967  *
6968  * This is equivalent to calling evas_object_image_source_set() with a
6969  * @c NULL source.
6970  */
6971 EAPI Eina_Bool                evas_object_image_source_unset           (Evas_Object *obj) EINA_ARG_NONNULL(1);
6972
6973 /**
6974  * Check if a file extension may be supported by @ref Evas_Object_Image.
6975  *
6976  * @param file The file to check
6977  * @return EINA_TRUE if we may be able to opeen it, EINA_FALSE if it's unlikely.
6978  * @since 1.1.0
6979  *
6980  * If file is a Eina_Stringshare, use directly @ref evas_object_image_extension_can_load_fast_get.
6981  *
6982  * This functions is threadsafe.
6983  */
6984 EAPI Eina_Bool evas_object_image_extension_can_load_get(const char *file);
6985
6986 /**
6987  * Check if a file extension may be supported by @ref Evas_Object_Image.
6988  *
6989  * @param file The file to check, it should be an Eina_Stringshare.
6990  * @return EINA_TRUE if we may be able to opeen it, EINA_FALSE if it's unlikely.
6991  * @since 1.1.0
6992  *
6993  * This functions is threadsafe.
6994  */
6995 EAPI Eina_Bool evas_object_image_extension_can_load_fast_get(const char *file);
6996
6997 /**
6998  * @}
6999  */
7000
7001 /**
7002  * @defgroup Evas_Object_Text Text Object Functions
7003  *
7004  * Functions that operate on single line, single style text objects.
7005  *
7006  * For multiline and multiple style text, see @ref Evas_Object_Textblock.
7007  *
7008  * See some @ref Example_Evas_Text "examples" on this group of functions.
7009  *
7010  * @ingroup Evas_Object_Specific
7011  */
7012
7013 /**
7014  * @addtogroup Evas_Object_Text
7015  * @{
7016  */
7017
7018 /* basic styles (4 bits allocated use 0->10 now, 5 left) */
7019 #define EVAS_TEXT_STYLE_MASK_BASIC 0xf
7020
7021 /**
7022  * Text style type creation macro. Use style types on the 's'
7023  * arguments, being 'x' your style variable.
7024  */
7025 #define EVAS_TEXT_STYLE_BASIC_SET(x, s) \
7026    do { x = ((x) & ~EVAS_TEXT_STYLE_MASK_BASIC) | (s); } while (0)
7027
7028 #define EVAS_TEXT_STYLE_MASK_SHADOW_DIRECTION (0x7 << 4)
7029
7030 /**
7031  * Text style type creation macro. This one will impose shadow
7032  * directions on the style type variable -- use the @c
7033  * EVAS_TEXT_STYLE_SHADOW_DIRECTION_* values on 's', incremmentally.
7034  */
7035 #define EVAS_TEXT_STYLE_SHADOW_DIRECTION_SET(x, s) \
7036    do { x = ((x) & ~EVAS_TEXT_STYLE_MASK_SHADOW_DIRECTION) | (s); } while (0)
7037
7038    typedef enum _Evas_Text_Style_Type
7039      {
7040         EVAS_TEXT_STYLE_PLAIN, /**< plain, standard text */
7041         EVAS_TEXT_STYLE_SHADOW, /**< text with shadow underneath */
7042         EVAS_TEXT_STYLE_OUTLINE, /**< text with an outline */
7043         EVAS_TEXT_STYLE_SOFT_OUTLINE, /**< text with a soft outline */
7044         EVAS_TEXT_STYLE_GLOW, /**< text with a glow effect */
7045         EVAS_TEXT_STYLE_OUTLINE_SHADOW, /**< text with both outline and shadow effects */
7046         EVAS_TEXT_STYLE_FAR_SHADOW, /**< text with (far) shadow underneath */
7047         EVAS_TEXT_STYLE_OUTLINE_SOFT_SHADOW, /**< text with outline and soft shadow effects combined */
7048         EVAS_TEXT_STYLE_SOFT_SHADOW, /**< text with (soft) shadow underneath */
7049         EVAS_TEXT_STYLE_FAR_SOFT_SHADOW, /**< text with (far soft) shadow underneath */
7050
7051         /* OR these to modify shadow direction (3 bits needed) */
7052         EVAS_TEXT_STYLE_SHADOW_DIRECTION_BOTTOM_RIGHT = (0x0 << 4), /**< shadow growing to bottom right */
7053         EVAS_TEXT_STYLE_SHADOW_DIRECTION_BOTTOM       = (0x1 << 4), /**< shadow growing to the bottom */
7054         EVAS_TEXT_STYLE_SHADOW_DIRECTION_BOTTOM_LEFT  = (0x2 << 4), /**< shadow growing to bottom left */
7055         EVAS_TEXT_STYLE_SHADOW_DIRECTION_LEFT         = (0x3 << 4), /**< shadow growing to the left */
7056         EVAS_TEXT_STYLE_SHADOW_DIRECTION_TOP_LEFT     = (0x4 << 4), /**< shadow growing to top left */
7057         EVAS_TEXT_STYLE_SHADOW_DIRECTION_TOP          = (0x5 << 4), /**< shadow growing to the top */
7058         EVAS_TEXT_STYLE_SHADOW_DIRECTION_TOP_RIGHT    = (0x6 << 4), /**< shadow growing to top right */
7059         EVAS_TEXT_STYLE_SHADOW_DIRECTION_RIGHT        = (0x7 << 4) /**< shadow growing to the right */
7060      } 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 */
7061
7062 /**
7063  * Creates a new text object on the provided canvas.
7064  *
7065  * @param e The canvas to create the text object on.
7066  * @return @c NULL on error, a pointer to a new text object on
7067  * success.
7068  *
7069  * Text objects are for simple, single line text elements. If you want
7070  * more elaborated text blocks, see @ref Evas_Object_Textblock.
7071  *
7072  * @see evas_object_text_font_source_set()
7073  * @see evas_object_text_font_set()
7074  * @see evas_object_text_text_set()
7075  */
7076 EAPI Evas_Object      *evas_object_text_add              (Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
7077
7078 /**
7079  * Set the font (source) file to be used on a given text object.
7080  *
7081  * @param obj The text object to set font for.
7082  * @param font The font file's path.
7083  *
7084  * This function allows the font file to be explicitly set for a given
7085  * text object, overriding system lookup, which will first occur in
7086  * the given file's contents.
7087  *
7088  * @see evas_object_text_font_get()
7089  */
7090 EAPI void              evas_object_text_font_source_set  (Evas_Object *obj, const char *font) EINA_ARG_NONNULL(1);
7091
7092 /**
7093  * Get the font file's path which is being used on a given text
7094  * object.
7095  *
7096  * @param obj The text object to set font for.
7097  * @param font The font file's path.
7098  *
7099  * @see evas_object_text_font_get() for more details
7100  */
7101 EAPI const char       *evas_object_text_font_source_get  (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
7102
7103 /**
7104  * Set the font family and size on a given text object.
7105  *
7106  * @param obj The text object to set font for.
7107  * @param font The font (family) name.
7108  * @param size The font size, in points.
7109  *
7110  * This function allows the font name and size of a text object to be
7111  * set. The @p font string has to follow fontconfig's convention on
7112  * naming fonts, as it's the underlying lybrary used to query system
7113  * fonts by Evas (see the @c fc-list command's output, on your system,
7114  * to get an idea).
7115  *
7116  * @see evas_object_text_font_get()
7117  * @see evas_object_text_font_source_set()
7118  */
7119    EAPI void              evas_object_text_font_set         (Evas_Object *obj, const char *font, Evas_Font_Size size) EINA_ARG_NONNULL(1);
7120
7121 /**
7122  * Retrieve the font family and size in use on a given text object.
7123  *
7124  * @param obj The evas text object to query for font information.
7125  * @param font A pointer to the location to store the font name in.
7126  * @param size A pointer to the location to store the font size in.
7127  *
7128  * This function allows the font name and size of a text object to be
7129  * queried. Be aware that the font name string is still owned by Evas
7130  * and should @b not have free() called on it by the caller of the
7131  * function.
7132  *
7133  * @see evas_object_text_font_set()
7134  */
7135 EAPI void              evas_object_text_font_get         (const Evas_Object *obj, const char **font, Evas_Font_Size *size) EINA_ARG_NONNULL(1, 2);
7136
7137 /**
7138  * Sets the text string to be displayed by the given text object.
7139  *
7140  * @param obj The text object to set text string on.
7141  * @param text Text string to display on it.
7142  *
7143  * @see evas_object_text_text_get()
7144  */
7145 EAPI void              evas_object_text_text_set         (Evas_Object *obj, const char *text) EINA_ARG_NONNULL(1);
7146
7147 /**
7148  * Retrieves the text string currently being displayed by the given
7149  * text object.
7150  *
7151  * @param  obj The given text object.
7152  * @return The text string currently being displayed on it.
7153  *
7154  * @note Do not free() the return value.
7155  *
7156  * @see evas_object_text_text_set()
7157  */
7158 EAPI const char       *evas_object_text_text_get         (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
7159
7160 /**
7161  * @brief Sets the BiDi delimiters used in the textblock.
7162  *
7163  * BiDi delimiters are use for in-paragraph separation of bidi segments. This
7164  * is useful for example in recipients fields of e-mail clients where bidi
7165  * oddities can occur when mixing rtl and ltr.
7166  *
7167  * @param obj The given text object.
7168  * @param delim A null terminated string of delimiters, e.g ",|".
7169  * @since 1.1.0
7170  */
7171 EAPI void              evas_object_text_bidi_delimiters_set(Evas_Object *obj, const char *delim);
7172
7173 /**
7174  * @brief Gets the BiDi delimiters used in the textblock.
7175  *
7176  * BiDi delimiters are use for in-paragraph separation of bidi segments. This
7177  * is useful for example in recipients fields of e-mail clients where bidi
7178  * oddities can occur when mixing rtl and ltr.
7179  *
7180  * @param obj The given text object.
7181  * @return A null terminated string of delimiters, e.g ",|". If empty, returns NULL.
7182  * @since 1.1.0
7183  */
7184 EAPI const char       *evas_object_text_bidi_delimiters_get(const Evas_Object *obj);
7185
7186    EAPI Evas_Coord        evas_object_text_ascent_get       (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
7187    EAPI Evas_Coord        evas_object_text_descent_get      (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
7188    EAPI Evas_Coord        evas_object_text_max_ascent_get   (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
7189    EAPI Evas_Coord        evas_object_text_max_descent_get  (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
7190    EAPI Evas_Coord        evas_object_text_horiz_advance_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
7191    EAPI Evas_Coord        evas_object_text_vert_advance_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
7192    EAPI Evas_Coord        evas_object_text_inset_get        (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
7193
7194 /**
7195  * Retrieve position and dimension information of a character within a text @c Evas_Object.
7196  *
7197  * This function is used to obtain the X, Y, width and height of a the character
7198  * located at @p pos within the @c Evas_Object @p obj. @p obj must be a text object
7199  * as created with evas_object_text_add(). Any of the @c Evas_Coord parameters (@p cx,
7200  * @p cy, @p cw, @p ch) may be NULL in which case no value will be assigned to that
7201  * parameter.
7202  *
7203  * @param obj   The text object to retrieve position information for.
7204  * @param pos   The character position to request co-ordinates for.
7205  * @param cx    A pointer to an @c Evas_Coord to store the X value in (can be NULL).
7206  * @param cy    A pointer to an @c Evas_Coord to store the Y value in (can be NULL).
7207  * @param cw    A pointer to an @c Evas_Coord to store the Width value in (can be NULL).
7208  * @param ch    A pointer to an @c Evas_Coord to store the Height value in (can be NULL).
7209  *
7210  * @returns EINA_FALSE on success, EINA_TRUE on error.
7211  */
7212 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);
7213    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);
7214
7215 /**
7216  * Returns the logical position of the last char in the text
7217  * up to the pos given. this is NOT the position of the last char
7218  * because of the possibility of RTL in the text.
7219  */
7220 EAPI int               evas_object_text_last_up_to_pos   (const Evas_Object *obj, Evas_Coord x, Evas_Coord y) EINA_ARG_NONNULL(1);
7221
7222 /**
7223  * Retrieves the style on use on the given text object.
7224  *
7225  * @param obj the given text object to set style on.
7226  * @return the style type in use.
7227  *
7228  * @see evas_object_text_style_set() for more details.
7229  */
7230 EAPI Evas_Text_Style_Type evas_object_text_style_get     (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
7231
7232 /**
7233  * Sets the style to apply on the given text object.
7234  *
7235  * @param obj the given text object to set style on.
7236  * @param type a style type.
7237  *
7238  * Text object styles are one of the values in
7239  * #Evas_Text_Style_Type. Some of those values are combinations of
7240  * more than one style, and some account for the direction of the
7241  * rendering of shadow effects.
7242  *
7243  * @note One may use the helper macros #EVAS_TEXT_STYLE_BASIC_SET and
7244  * #EVAS_TEXT_STYLE_SHADOW_DIRECTION_SET to assemble a style value.
7245  *
7246  * The following figure illustrates the text styles:
7247  * @image html text-styles.png
7248  * @image rtf text-styles.png
7249  * @image latex text-styles.eps
7250  *
7251  * @see evas_object_text_style_get()
7252  * @see evas_object_text_shadow_color_set()
7253  * @see evas_object_text_outline_color_set()
7254  * @see evas_object_text_glow_color_set()
7255  * @see evas_object_text_glow2_color_set()
7256  */
7257 EAPI void              evas_object_text_style_set        (Evas_Object *obj, Evas_Text_Style_Type type) EINA_ARG_NONNULL(1);
7258
7259 /**
7260  * Sets the shadow color for the given text object.
7261  *
7262  * @param obj The given Evas text object.
7263  * @param r The red component of the given color.
7264  * @param g The green component of the given color.
7265  * @param b The blue component of the given color.
7266  * @param a The alpha component of the given color.
7267  *
7268  * Shadow effects, which are fading colors decorating the text
7269  * underneath it, will just be shown if the object is set to one of
7270  * the following styles:
7271  *
7272  * - #EVAS_TEXT_STYLE_SHADOW
7273  * - #EVAS_TEXT_STYLE_OUTLINE_SHADOW
7274  * - #EVAS_TEXT_STYLE_FAR_SHADOW
7275  * - #EVAS_TEXT_STYLE_OUTLINE_SOFT_SHADOW
7276  * - #EVAS_TEXT_STYLE_SOFT_SHADOW
7277  * - #EVAS_TEXT_STYLE_FAR_SOFT_SHADOW
7278  *
7279  * One can also change de direction the shadow grows to, with
7280  * evas_object_text_style_set().
7281  *
7282  * @see evas_object_text_shadow_color_get()
7283  */
7284 EAPI void              evas_object_text_shadow_color_set (Evas_Object *obj, int r, int g, int b, int a) EINA_ARG_NONNULL(1);
7285
7286 /**
7287  * Retrieves the shadow color for the given text object.
7288  *
7289  * @param obj The given Evas text object.
7290  * @param r Pointer to variable to hold the red component of the given
7291  * color.
7292  * @param g Pointer to variable to hold the green component of the
7293  * given color.
7294  * @param b Pointer to variable to hold the blue component of the
7295  * given color.
7296  * @param a Pointer to variable to hold the alpha component of the
7297  * given color.
7298  *
7299  * @note Use @c NULL pointers on the color components you're not
7300  * interested in: they'll be ignored by the function.
7301  *
7302  * @see evas_object_text_shadow_color_set() for more details.
7303  */
7304 EAPI void              evas_object_text_shadow_color_get (const Evas_Object *obj, int *r, int *g, int *b, int *a) EINA_ARG_NONNULL(1);
7305
7306 /**
7307  * Sets the glow color for the given text object.
7308  *
7309  * @param obj The given Evas text object.
7310  * @param r The red component of the given color.
7311  * @param g The green component of the given color.
7312  * @param b The blue component of the given color.
7313  * @param a The alpha component of the given color.
7314  *
7315  * Glow effects, which are glowing colors decorating the text's
7316  * surroundings, will just be shown if the object is set to the
7317  * #EVAS_TEXT_STYLE_GLOW style.
7318  *
7319  * @note Glow effects are placed from a short distance of the text
7320  * itself, but no touching it. For glowing effects right on the
7321  * borders of the glyphs, see 'glow 2' effects
7322  * (evas_object_text_glow2_color_set()).
7323  *
7324  * @see evas_object_text_glow_color_get()
7325  */
7326 EAPI void              evas_object_text_glow_color_set   (Evas_Object *obj, int r, int g, int b, int a) EINA_ARG_NONNULL(1);
7327
7328 /**
7329  * Retrieves the glow color for the given text object.
7330  *
7331  * @param obj The given Evas text object.
7332  * @param r Pointer to variable to hold the red component of the given
7333  * color.
7334  * @param g Pointer to variable to hold the green component of the
7335  * given color.
7336  * @param b Pointer to variable to hold the blue component of the
7337  * given color.
7338  * @param a Pointer to variable to hold the alpha component of the
7339  * given color.
7340  *
7341  * @note Use @c NULL pointers on the color components you're not
7342  * interested in: they'll be ignored by the function.
7343  *
7344  * @see evas_object_text_glow_color_set() for more details.
7345  */
7346 EAPI void              evas_object_text_glow_color_get   (const Evas_Object *obj, int *r, int *g, int *b, int *a) EINA_ARG_NONNULL(1);
7347
7348 /**
7349  * Sets the 'glow 2' color for the given text object.
7350  *
7351  * @param obj The given Evas text object.
7352  * @param r The red component of the given color.
7353  * @param g The green component of the given color.
7354  * @param b The blue component of the given color.
7355  * @param a The alpha component of the given color.
7356  *
7357  * 'Glow 2' effects, which are glowing colors decorating the text's
7358  * (immediate) surroundings, will just be shown if the object is set
7359  * to the #EVAS_TEXT_STYLE_GLOW style. See also
7360  * evas_object_text_glow_color_set().
7361  *
7362  * @see evas_object_text_glow2_color_get()
7363  */
7364 EAPI void              evas_object_text_glow2_color_set  (Evas_Object *obj, int r, int g, int b, int a) EINA_ARG_NONNULL(1);
7365
7366 /**
7367  * Retrieves the 'glow 2' color for the given text object.
7368  *
7369  * @param obj The given Evas text object.
7370  * @param r Pointer to variable to hold the red component of the given
7371  * color.
7372  * @param g Pointer to variable to hold the green component of the
7373  * given color.
7374  * @param b Pointer to variable to hold the blue component of the
7375  * given color.
7376  * @param a Pointer to variable to hold the alpha component of the
7377  * given color.
7378  *
7379  * @note Use @c NULL pointers on the color components you're not
7380  * interested in: they'll be ignored by the function.
7381  *
7382  * @see evas_object_text_glow2_color_set() for more details.
7383  */
7384 EAPI void              evas_object_text_glow2_color_get  (const Evas_Object *obj, int *r, int *g, int *b, int *a) EINA_ARG_NONNULL(1);
7385
7386 /**
7387  * Sets the outline color for the given text object.
7388  *
7389  * @param obj The given Evas text object.
7390  * @param r The red component of the given color.
7391  * @param g The green component of the given color.
7392  * @param b The blue component of the given color.
7393  * @param a The alpha component of the given color.
7394  *
7395  * Outline effects (colored lines around text glyphs) will just be
7396  * shown if the object is set to one of the following styles:
7397  * - #EVAS_TEXT_STYLE_OUTLINE
7398  * - #EVAS_TEXT_STYLE_SOFT_OUTLINE
7399  * - #EVAS_TEXT_STYLE_OUTLINE_SHADOW
7400  * - #EVAS_TEXT_STYLE_OUTLINE_SOFT_SHADOW
7401  *
7402  * @see evas_object_text_outline_color_get()
7403  */
7404 EAPI void              evas_object_text_outline_color_set(Evas_Object *obj, int r, int g, int b, int a) EINA_ARG_NONNULL(1);
7405
7406 /**
7407  * Retrieves the outline color for the given text object.
7408  *
7409  * @param obj The given Evas text object.
7410  * @param r Pointer to variable to hold the red component of the given
7411  * color.
7412  * @param g Pointer to variable to hold the green component of the
7413  * given color.
7414  * @param b Pointer to variable to hold the blue component of the
7415  * given color.
7416  * @param a Pointer to variable to hold the alpha component of the
7417  * given color.
7418  *
7419  * @note Use @c NULL pointers on the color components you're not
7420  * interested in: they'll be ignored by the function.
7421  *
7422  * @see evas_object_text_outline_color_set() for more details.
7423  */
7424 EAPI void              evas_object_text_outline_color_get(const Evas_Object *obj, int *r, int *g, int *b, int *a) EINA_ARG_NONNULL(1);
7425
7426 /**
7427  * Gets the text style pad of a text object.
7428  *
7429  * @param obj The given text object.
7430  * @param l The left pad (or @c NULL).
7431  * @param r The right pad (or @c NULL).
7432  * @param t The top pad (or @c NULL).
7433  * @param b The bottom pad (or @c NULL).
7434  *
7435  */
7436 EAPI void              evas_object_text_style_pad_get    (const Evas_Object *obj, int *l, int *r, int *t, int *b) EINA_ARG_NONNULL(1);
7437
7438 /**
7439  * Retrieves the direction of the text currently being displayed in the
7440  * text object.
7441  * @param  obj The given evas text object.
7442  * @return the direction of the text
7443  */
7444 EAPI Evas_BiDi_Direction evas_object_text_direction_get  (const Evas_Object *obj) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
7445
7446 /**
7447  * @}
7448  */
7449
7450 /**
7451  * @defgroup Evas_Object_Textblock Textblock Object Functions
7452  *
7453  * Functions used to create and manipulate textblock objects. Unlike
7454  * @ref Evas_Object_Text, these handle complex text, doing multiple
7455  * styles and multiline text based on HTML-like tags. Of these extra
7456  * features will be heavier on memory and processing cost.
7457  *
7458  * @section Evas_Object_Textblock_Tutorial Textblock Object Tutorial
7459  *
7460  * This part explains about the textblock object's API and proper usage.
7461  * If you want to develop textblock, you should also refer to @ref Evas_Object_Textblock_Internal.
7462  * The main user of the textblock object is the edje entry object in Edje, so
7463  * that's a good place to learn from, but I think this document is more than
7464  * enough, if it's not, please contact me and I'll update it.
7465  *
7466  * @subsection textblock_intro Introduction
7467  * The textblock objects is, as implied, an object that can show big chunks of
7468  * text. Textblock supports many features including: Text formatting, automatic
7469  * and manual text alignment, embedding items (for example icons) and more.
7470  * Textblock has three important parts, the text paragraphs, the format nodes
7471  * and the cursors.
7472  *
7473  * You can use markup to format text, for example: "<font_size=50>Big!</font_size>".
7474  * You can also put more than one style directive in one tag:
7475  * "<font_size=50 color=#F00>Big and Red!</font_size>".
7476  * Please notice that we used "</font_size>" although the format also included
7477  * color, this is because the first format determines the matching closing tag's
7478  * name. You can also use anonymous tags, like: "<font_size=30>Big</>" which
7479  * just pop any type of format, but it's advised to use the named alternatives
7480  * instead.
7481  *
7482  * @subsection textblock_cursors Textblock Object Cursors
7483  * A textblock Cursor @ref Evas_Textblock_Cursor is data type that represents
7484  * a position in a textblock. Each cursor contains information about the
7485  * paragraph it points to, the position in that paragraph and the object itself.
7486  * Cursors register to textblock objects upon creation, this means that once
7487  * you created a cursor, it belongs to a specific obj and you can't for example
7488  * copy a cursor "into" a cursor of a different object. Registered cursors
7489  * also have the added benefit of updating automatically upon textblock changes,
7490  * this means that if you have a cursor pointing to a specific character, it'll
7491  * still point to it even after you change the whole object completely (as long
7492  * as the char was not deleted), this is not possible without updating, because
7493  * as mentioned, each cursor holds a character position. There are many
7494  * functions that handle cursors, just check out the evas_textblock_cursor*
7495  * functions. For creation and deletion of cursors check out:
7496  * @see evas_object_textblock_cursor_new()
7497  * @see evas_textblock_cursor_free()
7498  * @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).
7499  *
7500  * @subsection textblock_paragraphs Textblock Object Paragraphs
7501  * The textblock object is made out of text splitted to paragraphs (delimited
7502  * by the paragraph separation character). Each paragraph has many (or none)
7503  * format nodes associated with it which are responsible for the formatting
7504  * of that paragraph.
7505  *
7506  * @subsection textblock_format_nodes Textblock Object Format Nodes
7507  * As explained in @ref textblock_paragraphs each one of the format nodes
7508  * is associated with a paragraph.
7509  * There are two types of format nodes, visible and invisible:
7510  * Visible: formats that a cursor can point to, i.e formats that
7511  * occupy space, for example: newlines, tabs, items and etc. Some visible items
7512  * are made of two parts, in this case, only the opening tag is visible.
7513  * A closing tag (i.e a </tag> tag) should NEVER be visible.
7514  * Invisible: formats that don't occupy space, for example: bold and underline.
7515  * Being able to access format nodes is very important for some uses. For
7516  * example, edje uses the "<a>" format to create links in the text (and pop
7517  * popups above them when clicked). For the textblock object a is just a
7518  * formatting instruction (how to color the text), but edje utilizes the access
7519  * to the format nodes to make it do more.
7520  * For more information, take a look at all the evas_textblock_node_format_*
7521  * functions.
7522  * The translation of "<tag>" tags to actual format is done according to the
7523  * tags defined in the style, see @ref evas_textblock_style_set
7524  *
7525  * @subsection textblock_special_formats Special Formats
7526  * Textblock supports various format directives that can be used either in
7527  * markup, or by calling @ref evas_object_textblock_format_append or
7528  * @ref evas_object_textblock_format_prepend. In addition to the mentioned
7529  * format directives, textblock allows creating additional format directives
7530  * using "tags" that can be set in the style see @ref evas_textblock_style_set .
7531  *
7532  * Textblock supports the following formats:
7533  * @li font - Font description in fontconfig like format, e.g: "Sans:style=Italic:lang=hi". or "Serif:style=Bold".
7534  * @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".
7535  * @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".
7536  * @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".
7537  * @li lang - Overrides the language defined in "font". E.g: "lang=he" is the same as "font=:lang=he".
7538  * @li font_fallbacks - A comma delimited list of fonts to try if finding the main font fails.
7539  * @li font_size - The font size in points.
7540  * @li font_source - The source of the font, e.g an eet file.
7541  * @li color - Text color in one of the following formats: "#RRGGBB", "#RRGGBBAA", "#RGB", and "#RGBA".
7542  * @li underline_color - color in one of the following formats: "#RRGGBB", "#RRGGBBAA", "#RGB", and "#RGBA".
7543  * @li underline2_color - color in one of the following formats: "#RRGGBB", "#RRGGBBAA", "#RGB", and "#RGBA".
7544  * @li outline_color - color in one of the following formats: "#RRGGBB", "#RRGGBBAA", "#RGB", and "#RGBA".
7545  * @li shadow_color - color in one of the following formats: "#RRGGBB", "#RRGGBBAA", "#RGB", and "#RGBA".
7546  * @li glow_color - color in one of the following formats: "#RRGGBB", "#RRGGBBAA", "#RGB", and "#RGBA".
7547  * @li glow2_color - color in one of the following formats: "#RRGGBB", "#RRGGBBAA", "#RGB", and "#RGBA".
7548  * @li backing_color - color in one of the following formats: "#RRGGBB", "#RRGGBBAA", "#RGB", and "#RGBA".
7549  * @li strikethrough_color - color in one of the following formats: "#RRGGBB", "#RRGGBBAA", "#RGB", and "#RGBA".
7550  * @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%.
7551  * @li valign - Either "top", "bottom", "middle", "center", "baseline", "base", a value between 0.0 and 1.0, or a value between 0% to 100%.
7552  * @li wrap - "word", "char", "mixed", or "none".
7553  * @li left_margin - Either "reset", or a pixel value indicating the margin.
7554  * @li right_margin - Either "reset", or a pixel value indicating the margin.
7555  * @li underline - "on", "off", "single", or "double".
7556  * @li strikethrough - "on" or "off"
7557  * @li backing - "on" or "off"
7558  * @li style - Either "off", "none", "plain", "shadow", "outline", "soft_outline", "outline_shadow", "outline_soft_shadow", "glow", "far_shadow", "soft_shadow", or "far_soft_shadow".
7559  * @li tabstops - Pixel value for tab width.
7560  * @li linesize - Force a line size in pixels.
7561  * @li linerelsize - Either a floating point value or a percentage indicating the wanted size of the line relative to the calculated size.
7562  * @li linegap - Force a line gap in pixels.
7563  * @li linerelgap - Either a floating point value or a percentage indicating the wanted size of the line relative to the calculated size.
7564  * @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.
7565  * @li linefill - Either a float value or percentage indicating how much to fill the line.
7566  * @li ellipsis - Value between 0.0-1.0 to indicate the type of ellipsis, or -1.0 to indicate ellipsis isn't wanted.
7567  * @li password - "on" or "off". This is used to specifically turn replacing chars with the replacement char (i.e password mode) on and off.
7568  *
7569  *
7570  * @todo put here some usage examples
7571  *
7572  * @ingroup Evas_Object_Specific
7573  *
7574  * @{
7575  */
7576
7577    typedef struct _Evas_Textblock_Style                 Evas_Textblock_Style;
7578    typedef struct _Evas_Textblock_Cursor                Evas_Textblock_Cursor;
7579    /**
7580     * @typedef Evas_Object_Textblock_Node_Format
7581     * A format node.
7582     */
7583    typedef struct _Evas_Object_Textblock_Node_Format    Evas_Object_Textblock_Node_Format;
7584    typedef struct _Evas_Textblock_Rectangle             Evas_Textblock_Rectangle;
7585
7586    struct _Evas_Textblock_Rectangle
7587      {
7588         Evas_Coord x, y, w, h;
7589      };
7590
7591    typedef enum _Evas_Textblock_Text_Type
7592      {
7593         EVAS_TEXTBLOCK_TEXT_RAW,
7594         EVAS_TEXTBLOCK_TEXT_PLAIN,
7595         EVAS_TEXTBLOCK_TEXT_MARKUP
7596      } Evas_Textblock_Text_Type;
7597
7598    typedef enum _Evas_Textblock_Cursor_Type
7599      {
7600         EVAS_TEXTBLOCK_CURSOR_UNDER,
7601         EVAS_TEXTBLOCK_CURSOR_BEFORE
7602      } Evas_Textblock_Cursor_Type;
7603
7604
7605 /**
7606  * Adds a textblock to the given evas.
7607  * @param   e The given evas.
7608  * @return  The new textblock object.
7609  */
7610 EAPI Evas_Object                 *evas_object_textblock_add(Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
7611
7612
7613 /**
7614  * Returns the unescaped version of escape.
7615  * @param escape the string to be escaped
7616  * @return the unescaped version of escape
7617  */
7618 EAPI const char                  *evas_textblock_escape_string_get(const char *escape) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
7619
7620 /**
7621  * Returns the escaped version of the string.
7622  * @param string to escape
7623  * @param len_ret the len of the part of the string that was used.
7624  * @return the escaped string.
7625  */
7626 EAPI const char                  *evas_textblock_string_escape_get(const char *string, int *len_ret) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
7627
7628 /**
7629  * Return the unescaped version of the string between start and end.
7630  *
7631  * @param escape_start the start of the string.
7632  * @param escape_end the end of the string.
7633  * @return the unescaped version of the range
7634  */
7635 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) EINA_PURE;
7636
7637
7638 /**
7639  * Creates a new textblock style.
7640  * @return  The new textblock style.
7641  */
7642 EAPI Evas_Textblock_Style        *evas_textblock_style_new(void) EINA_WARN_UNUSED_RESULT EINA_MALLOC;
7643
7644 /**
7645  * Destroys a textblock style.
7646  * @param ts The textblock style to free.
7647  */
7648 EAPI void                         evas_textblock_style_free(Evas_Textblock_Style *ts) EINA_ARG_NONNULL(1);
7649
7650 /**
7651  * Sets the style ts to the style passed as text by text.
7652  * Expected a string consisting of many (or none) tag='format' pairs.
7653  *
7654  * @param ts  the style to set.
7655  * @param text the text to parse - NOT NULL.
7656  * @return Returns no value.
7657  */
7658 EAPI void                         evas_textblock_style_set(Evas_Textblock_Style *ts, const char *text) EINA_ARG_NONNULL(1);
7659
7660 /**
7661  * Return the text of the style ts.
7662  * @param ts  the style to get it's text.
7663  * @return the text of the style or null on error.
7664  */
7665 EAPI const char                  *evas_textblock_style_get(const Evas_Textblock_Style *ts) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
7666
7667
7668 /**
7669  * Set the objects style to ts.
7670  * @param obj the Evas object to set the style to.
7671  * @param ts  the style to set.
7672  * @return Returns no value.
7673  */
7674 EAPI void                         evas_object_textblock_style_set(Evas_Object *obj, Evas_Textblock_Style *ts) EINA_ARG_NONNULL(1);
7675
7676 /**
7677  * Return the style of an object.
7678  * @param obj  the object to get the style from.
7679  * @return the style of the object.
7680  */
7681 EAPI const Evas_Textblock_Style  *evas_object_textblock_style_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
7682
7683 /**
7684  * @brief Set the "replacement character" to use for the given textblock object.
7685  *
7686  * @param obj The given textblock object.
7687  * @param ch The charset name.
7688  */
7689 EAPI void                         evas_object_textblock_replace_char_set(Evas_Object *obj, const char *ch) EINA_ARG_NONNULL(1);
7690
7691 /**
7692  * @brief Get the "replacement character" for given textblock object. Returns
7693  * NULL if no replacement character is in use.
7694  *
7695  * @param obj The given textblock object
7696  * @return replacement character or @c NULL
7697  */
7698 EAPI const char                  *evas_object_textblock_replace_char_get(Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
7699
7700 /**
7701  * @brief Sets the vertical alignment of text within the textblock object
7702  * as a whole.
7703  *
7704  * Normally alignment is 0.0 (top of object). Values given should be
7705  * between 0.0 and 1.0 (1.0 bottom of object, 0.5 being vertically centered
7706  * etc.).
7707  *
7708  * @param obj The given textblock object.
7709  * @param align A value between 0.0 and 1.0
7710  * @since 1.1.0
7711  */
7712 EAPI void                         evas_object_textblock_valign_set(Evas_Object *obj, double align);
7713
7714 /**
7715  * @brief Gets the vertical alignment of a textblock
7716  *
7717  * @param obj The given textblock object.
7718  * @return The elignment set for the object
7719  * @since 1.1.0
7720  */
7721 EAPI double                       evas_object_textblock_valign_get(const Evas_Object *obj);
7722
7723 /**
7724  * @brief Sets the BiDi delimiters used in the textblock.
7725  *
7726  * BiDi delimiters are use for in-paragraph separation of bidi segments. This
7727  * is useful for example in recipients fields of e-mail clients where bidi
7728  * oddities can occur when mixing rtl and ltr.
7729  *
7730  * @param obj The given textblock object.
7731  * @param delim A null terminated string of delimiters, e.g ",|".
7732  * @since 1.1.0
7733  */
7734 EAPI void                         evas_object_textblock_bidi_delimiters_set(Evas_Object *obj, const char *delim);
7735
7736 /**
7737  * @brief Gets the BiDi delimiters used in the textblock.
7738  *
7739  * BiDi delimiters are use for in-paragraph separation of bidi segments. This
7740  * is useful for example in recipients fields of e-mail clients where bidi
7741  * oddities can occur when mixing rtl and ltr.
7742  *
7743  * @param obj The given textblock object.
7744  * @return A null terminated string of delimiters, e.g ",|". If empty, returns NULL.
7745  * @since 1.1.0
7746  */
7747 EAPI const char                  *evas_object_textblock_bidi_delimiters_get(const Evas_Object *obj);
7748
7749 /**
7750  * @brief Sets newline mode. When true, newline character will behave
7751  * as a paragraph separator.
7752  *
7753  * @param obj The given textblock object.
7754  * @param mode EINA_TRUE for legacy mode, EINA_FALSE otherwise.
7755  * @since 1.1.0
7756  */
7757 EAPI void                         evas_object_textblock_legacy_newline_set(Evas_Object *obj, Eina_Bool mode) EINA_ARG_NONNULL(1);
7758
7759 /**
7760  * @brief Gets newline mode. When true, newline character behaves
7761  * as a paragraph separator.
7762  *
7763  * @param obj The given textblock object.
7764  * @return EINA_TRUE if in legacy mode, EINA_FALSE otherwise.
7765  * @since 1.1.0
7766  */
7767 EAPI Eina_Bool                    evas_object_textblock_legacy_newline_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
7768
7769
7770 /**
7771  * Sets the tetxblock's text to the markup text.
7772  *
7773  * @note assumes text does not include the unicode object replacement char (0xFFFC)
7774  *
7775  * @param obj  the textblock object.
7776  * @param text the markup text to use.
7777  * @return Return no value.
7778  */
7779 EAPI void                         evas_object_textblock_text_markup_set(Evas_Object *obj, const char *text) EINA_ARG_NONNULL(1);
7780
7781 /**
7782  * Prepends markup to the cursor cur.
7783  *
7784  * @note assumes text does not include the unicode object replacement char (0xFFFC)
7785  *
7786  * @param cur  the cursor to prepend to.
7787  * @param text the markup text to prepend.
7788  * @return Return no value.
7789  */
7790 EAPI void                         evas_object_textblock_text_markup_prepend(Evas_Textblock_Cursor *cur, const char *text) EINA_ARG_NONNULL(1, 2);
7791
7792 /**
7793  * Return the markup of the object.
7794  *
7795  * @param obj the Evas object.
7796  * @return the markup text of the object.
7797  */
7798 EAPI const char                  *evas_object_textblock_text_markup_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
7799
7800
7801 /**
7802  * Return the object's main cursor.
7803  *
7804  * @param obj the object.
7805  * @return the obj's main cursor.
7806  */
7807 EAPI Evas_Textblock_Cursor *evas_object_textblock_cursor_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
7808
7809 /**
7810  * Create a new cursor, associate it to the obj and init it to point
7811  * to the start of the textblock. Association to the object means the cursor
7812  * will be updated when the object will change.
7813  *
7814  * @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).
7815  *
7816  * @param obj the object to associate to.
7817  * @return the new cursor.
7818  */
7819 EAPI Evas_Textblock_Cursor       *evas_object_textblock_cursor_new(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
7820
7821
7822 /**
7823  * Free the cursor and unassociate it from the object.
7824  * @note do not use it to free unassociated cursors.
7825  *
7826  * @param cur the cursor to free.
7827  * @return Returns no value.
7828  */
7829 EAPI void                         evas_textblock_cursor_free(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
7830
7831
7832 /**
7833  * Sets the cursor to the start of the first text node.
7834  *
7835  * @param cur the cursor to update.
7836  * @return Returns no value.
7837  */
7838 EAPI void                         evas_textblock_cursor_paragraph_first(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
7839
7840 /**
7841  * sets the cursor to the end of the last text node.
7842  *
7843  * @param cur the cursor to set.
7844  * @return Returns no value.
7845  */
7846 EAPI void                         evas_textblock_cursor_paragraph_last(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
7847
7848 /**
7849  * Advances to the start of the next text node
7850  *
7851  * @param cur the cursor to update
7852  * @return #EINA_TRUE if it managed to advance a paragraph, #EINA_FALSE otherwise.
7853  */
7854 EAPI Eina_Bool                    evas_textblock_cursor_paragraph_next(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
7855
7856 /**
7857  * Advances to the end of the previous text node
7858  *
7859  * @param cur the cursor to update
7860  * @return #EINA_TRUE if it managed to advance a paragraph, #EINA_FALSE otherwise.
7861  */
7862 EAPI Eina_Bool                    evas_textblock_cursor_paragraph_prev(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
7863
7864 /**
7865  * Returns the
7866  *
7867  * @param obj The evas, must not be NULL.
7868  * @param anchor the anchor name to get
7869  * @return Returns the list format node corresponding to the anchor, may be null if there are none.
7870  */
7871 EAPI const Eina_List             *evas_textblock_node_format_list_get(const Evas_Object *obj, const char *anchor) EINA_ARG_NONNULL(1, 2);
7872
7873 /**
7874  * Returns the first format node.
7875  *
7876  * @param obj The evas, must not be NULL.
7877  * @return Returns the first format node, may be null if there are none.
7878  */
7879 EAPI const Evas_Object_Textblock_Node_Format *evas_textblock_node_format_first_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
7880
7881 /**
7882  * Returns the last format node.
7883  *
7884  * @param obj The evas textblock, must not be NULL.
7885  * @return Returns the first format node, may be null if there are none.
7886  */
7887 EAPI const Evas_Object_Textblock_Node_Format *evas_textblock_node_format_last_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
7888
7889 /**
7890  * Returns the next format node (after n)
7891  *
7892  * @param n the current format node - not null.
7893  * @return Returns the next format node, may be null.
7894  */
7895 EAPI const Evas_Object_Textblock_Node_Format *evas_textblock_node_format_next_get(const Evas_Object_Textblock_Node_Format *n) EINA_ARG_NONNULL(1);
7896
7897 /**
7898  * Returns the prev format node (after n)
7899  *
7900  * @param n the current format node - not null.
7901  * @return Returns the prev format node, may be null.
7902  */
7903 EAPI const Evas_Object_Textblock_Node_Format *evas_textblock_node_format_prev_get(const Evas_Object_Textblock_Node_Format *n) EINA_ARG_NONNULL(1);
7904
7905 /**
7906  * Remove a format node and it's match. i.e, removes a <tag> </tag> pair.
7907  * Assumes the node is the first part of <tag> i.e, this won't work if
7908  * n is a closing tag.
7909  *
7910  * @param obj the Evas object of the textblock - not null.
7911  * @param n the current format node - not null.
7912  */
7913 EAPI void                         evas_textblock_node_format_remove_pair(Evas_Object *obj, Evas_Object_Textblock_Node_Format *n) EINA_ARG_NONNULL(1, 2);
7914
7915 /**
7916  * Sets the cursor to point to the place where format points to.
7917  *
7918  * @param cur the cursor to update.
7919  * @param n the format node to update according.
7920  * @deprecated duplicate of evas_textblock_cursor_at_format_set
7921  */
7922 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);
7923
7924 /**
7925  * Return the format node at the position pointed by cur.
7926  *
7927  * @param cur the position to look at.
7928  * @return the format node if found, NULL otherwise.
7929  * @see evas_textblock_cursor_format_is_visible_get()
7930  */
7931 EAPI const Evas_Object_Textblock_Node_Format *evas_textblock_cursor_format_get(const Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
7932
7933 /**
7934  * Get the text format representation of the format node.
7935  *
7936  * @param fmt the format node.
7937  * @return the textual format of the format node.
7938  */
7939 EAPI const char                  *evas_textblock_node_format_text_get(const Evas_Object_Textblock_Node_Format *fnode) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
7940
7941 /**
7942  * Set the cursor to point to the position of fmt.
7943  *
7944  * @param cur the cursor to update
7945  * @param fmt the format to update according to.
7946  */
7947 EAPI void                         evas_textblock_cursor_at_format_set(Evas_Textblock_Cursor *cur, const Evas_Object_Textblock_Node_Format *fmt) EINA_ARG_NONNULL(1, 2);
7948
7949 /**
7950  * Check if the current cursor position is a visible format. This way is more
7951  * efficient than evas_textblock_cursor_format_get() to check for the existence
7952  * of a visible format.
7953  *
7954  * @param cur the cursor to look at.
7955  * @return #EINA_TRUE if the cursor points to a visible format, #EINA_FALSE otherwise.
7956  * @see evas_textblock_cursor_format_get()
7957  */
7958 EAPI Eina_Bool                    evas_textblock_cursor_format_is_visible_get(const Evas_Textblock_Cursor *cur) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
7959
7960 /**
7961  * Advances to the next format node
7962  *
7963  * @param cur the cursor to be updated.
7964  * @return #EINA_TRUE on success #EINA_FALSE otherwise.
7965  */
7966 EAPI Eina_Bool                    evas_textblock_cursor_format_next(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
7967
7968 /**
7969  * Advances to the previous format node.
7970  *
7971  * @param cur the cursor to update.
7972  * @return #EINA_TRUE on success #EINA_FALSE otherwise.
7973  */
7974 EAPI Eina_Bool                    evas_textblock_cursor_format_prev(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
7975
7976 /**
7977  * Returns true if the cursor points to a format.
7978  *
7979  * @param cur the cursor to check.
7980  * @return Returns #EINA_TRUE if a cursor points to a format #EINA_FALSE otherwise.
7981  */
7982 EAPI Eina_Bool                    evas_textblock_cursor_is_format(const Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
7983
7984 /**
7985  * Advances 1 char forward.
7986  *
7987  * @param cur the cursor to advance.
7988  * @return #EINA_TRUE on success #EINA_FALSE otherwise.
7989  */
7990 EAPI Eina_Bool                    evas_textblock_cursor_char_next(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
7991
7992 /**
7993  * Advances 1 char backward.
7994  *
7995  * @param cur the cursor to advance.
7996  * @return #EINA_TRUE on success #EINA_FALSE otherwise.
7997  */
7998 EAPI Eina_Bool                    evas_textblock_cursor_char_prev(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
7999
8000 /**
8001  * Go to the first char in the node the cursor is pointing on.
8002  *
8003  * @param cur the cursor to update.
8004  * @return Returns no value.
8005  */
8006 EAPI void                         evas_textblock_cursor_paragraph_char_first(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8007
8008 /**
8009  * Go to the last char in a text node.
8010  *
8011  * @param cur the cursor to update.
8012  * @return Returns no value.
8013  */
8014 EAPI void                         evas_textblock_cursor_paragraph_char_last(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8015
8016 /**
8017  * Go to the start of the current line
8018  *
8019  * @param cur the cursor to update.
8020  * @return Returns no value.
8021  */
8022 EAPI void                         evas_textblock_cursor_line_char_first(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8023
8024 /**
8025  * Go to the end of the current line.
8026  *
8027  * @param cur the cursor to update.
8028  * @return Returns no value.
8029  */
8030 EAPI void                         evas_textblock_cursor_line_char_last(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8031
8032 /**
8033  * Return the current cursor pos.
8034  *
8035  * @param cur the cursor to take the position from.
8036  * @return the position or -1 on error
8037  */
8038 EAPI int                          evas_textblock_cursor_pos_get(const Evas_Textblock_Cursor *cur) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
8039
8040 /**
8041  * Set the cursor pos.
8042  *
8043  * @param cur the cursor to be set.
8044  * @param pos the pos to set.
8045  */
8046 EAPI void                         evas_textblock_cursor_pos_set(Evas_Textblock_Cursor *cur, int pos) EINA_ARG_NONNULL(1);
8047
8048 /**
8049  * Go to the start of the line passed
8050  *
8051  * @param cur cursor to update.
8052  * @param line numer to set.
8053  * @return #EINA_TRUE on success, #EINA_FALSE on error.
8054  */
8055 EAPI Eina_Bool                    evas_textblock_cursor_line_set(Evas_Textblock_Cursor *cur, int line) EINA_ARG_NONNULL(1);
8056
8057 /**
8058  * Compare two cursors.
8059  *
8060  * @param cur1 the first cursor.
8061  * @param cur2 the second cursor.
8062  * @return -1 if cur1 < cur2, 0 if cur1 == cur2 and 1 otherwise.
8063  */
8064 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) EINA_PURE;
8065
8066 /**
8067  * Make cur_dest point to the same place as cur. Does not work if they don't
8068  * point to the same object.
8069  *
8070  * @param cur the source cursor.
8071  * @param cur_dest destination cursor.
8072  * @return Returns no value.
8073  */
8074 EAPI void                         evas_textblock_cursor_copy(const Evas_Textblock_Cursor *cur, Evas_Textblock_Cursor *cur_dest) EINA_ARG_NONNULL(1, 2);
8075
8076
8077 /**
8078  * Adds text to the current cursor position and set the cursor to *before*
8079  * the start of the text just added.
8080  *
8081  * @param cur the cursor to where to add text at.
8082  * @param _text the text to add.
8083  * @return Returns the len of the text added.
8084  * @see evas_textblock_cursor_text_prepend()
8085  */
8086 EAPI int                          evas_textblock_cursor_text_append(Evas_Textblock_Cursor *cur, const char *text) EINA_ARG_NONNULL(1, 2);
8087
8088 /**
8089  * Adds text to the current cursor position and set the cursor to *after*
8090  * the start of the text just added.
8091  *
8092  * @param cur the cursor to where to add text at.
8093  * @param _text the text to add.
8094  * @return Returns the len of the text added.
8095  * @see evas_textblock_cursor_text_append()
8096  */
8097 EAPI int                          evas_textblock_cursor_text_prepend(Evas_Textblock_Cursor *cur, const char *text) EINA_ARG_NONNULL(1, 2);
8098
8099
8100 /**
8101  * Adds format to the current cursor position. If the format being added is a
8102  * visible format, add it *before* the cursor position, otherwise, add it after.
8103  * This behavior is because visible formats are like characters and invisible
8104  * should be stacked in a way that the last one is added last.
8105  *
8106  * This function works with native formats, that means that style defined
8107  * tags like <br> won't work here. For those kind of things use markup prepend.
8108  *
8109  * @param cur the cursor to where to add format at.
8110  * @param format the format to add.
8111  * @return Returns true if a visible format was added, false otherwise.
8112  * @see evas_textblock_cursor_format_prepend()
8113  */
8114
8115 /**
8116  * Check if the current cursor position points to the terminating null of the
8117  * last paragraph. (shouldn't be allowed to point to the terminating null of
8118  * any previous paragraph anyway.
8119  *
8120  * @param cur the cursor to look at.
8121  * @return #EINA_TRUE if the cursor points to the terminating null, #EINA_FALSE otherwise.
8122  */
8123 EAPI Eina_Bool                    evas_textblock_cursor_format_append(Evas_Textblock_Cursor *cur, const char *format) EINA_ARG_NONNULL(1, 2);
8124
8125 /**
8126  * Adds format to the current cursor position. If the format being added is a
8127  * visible format, add it *before* the cursor position, otherwise, add it after.
8128  * This behavior is because visible formats are like characters and invisible
8129  * should be stacked in a way that the last one is added last.
8130  * If the format is visible the cursor is advanced after it.
8131  *
8132  * This function works with native formats, that means that style defined
8133  * tags like <br> won't work here. For those kind of things use markup prepend.
8134  *
8135  * @param cur the cursor to where to add format at.
8136  * @param format the format to add.
8137  * @return Returns true if a visible format was added, false otherwise.
8138  * @see evas_textblock_cursor_format_prepend()
8139  */
8140 EAPI Eina_Bool                    evas_textblock_cursor_format_prepend(Evas_Textblock_Cursor *cur, const char *format) EINA_ARG_NONNULL(1, 2);
8141
8142 /**
8143  * Delete the character at the location of the cursor. If there's a format
8144  * pointing to this position, delete it as well.
8145  *
8146  * @param cur the cursor pointing to the current location.
8147  * @return Returns no value.
8148  */
8149 EAPI void                         evas_textblock_cursor_char_delete(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8150
8151 /**
8152  * Delete the range between cur1 and cur2.
8153  *
8154  * @param cur1 one side of the range.
8155  * @param cur2 the second side of the range
8156  * @return Returns no value.
8157  */
8158 EAPI void                         evas_textblock_cursor_range_delete(Evas_Textblock_Cursor *cur1, Evas_Textblock_Cursor *cur2) EINA_ARG_NONNULL(1, 2);
8159
8160
8161 /**
8162  * Return the text of the paragraph cur points to - returns the text in markup..
8163  *
8164  * @param cur the cursor pointing to the paragraph.
8165  * @return the text on success, NULL otherwise.
8166  */
8167 EAPI const char                  *evas_textblock_cursor_paragraph_text_get(const Evas_Textblock_Cursor *cur) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
8168
8169 /**
8170  * Return the length of the paragraph, cheaper the eina_unicode_strlen()
8171  *
8172  * @param cur the position of the paragraph.
8173  * @return the length of the paragraph on success, -1 otehrwise.
8174  */
8175 EAPI int                          evas_textblock_cursor_paragraph_text_length_get(const Evas_Textblock_Cursor *cur) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
8176
8177 /**
8178  * Return the text in the range between cur1 and cur2
8179  *
8180  * FIXME: format is currently unused, you always get markup back.
8181  *
8182  * @param cur1 one side of the range.
8183  * @param cur2 the other side of the range
8184  * @param format to be documented
8185  * @return the text in the range
8186  * @see elm_entry_markup_to_utf8()
8187  */
8188 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) EINA_PURE;
8189
8190 /**
8191  * Return the content of the cursor.
8192  *
8193  * @param cur the cursor
8194  * @return the text in the range
8195  */
8196 EAPI char                        *evas_textblock_cursor_content_get(const Evas_Textblock_Cursor *cur) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
8197
8198
8199 /**
8200  * Returns the geometry of the cursor. Depends on the type of cursor requested.
8201  * This should be used instead of char_geometry_get because there are weird
8202  * special cases with BiDi text.
8203  * in '_' cursor mode (i.e a line below the char) it's the same as char_geometry
8204  * get, except for the case of the last char of a line which depends on the
8205  * paragraph direction.
8206  *
8207  * in '|' cursor mode (i.e a line between two chars) it is very varyable.
8208  * For example consider the following visual string:
8209  * "abcCBA" (ABC are rtl chars), a cursor pointing on A should actually draw
8210  * a '|' between the c and the C.
8211  *
8212  * @param cur the cursor.
8213  * @param cx the x of the cursor
8214  * @param cy the y of the cursor
8215  * @param cw the width of the cursor
8216  * @param ch the height of the cursor
8217  * @param dir the direction of the cursor, can be NULL.
8218  * @param ctype the type of the cursor.
8219  * @return line number of the char on success, -1 on error.
8220  */
8221 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);
8222
8223 /**
8224  * Returns the geometry of the char at cur.
8225  *
8226  * @param cur the position of the char.
8227  * @param cx the x of the char.
8228  * @param cy the y of the char.
8229  * @param cw the w of the char.
8230  * @param ch the h of the char.
8231  * @return line number of the char on success, -1 on error.
8232  */
8233 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);
8234
8235 /**
8236  * Returns the geometry of the pen at cur.
8237  *
8238  * @param cur the position of the char.
8239  * @param cpen_x the pen_x of the char.
8240  * @param cy the y of the char.
8241  * @param cadv the adv of the char.
8242  * @param ch the h of the char.
8243  * @return line number of the char on success, -1 on error.
8244  */
8245 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);
8246
8247 /**
8248  * Returns the geometry of the line at cur.
8249  *
8250  * @param cur the position of the line.
8251  * @param cx the x of the line.
8252  * @param cy the y of the line.
8253  * @param cw the width of the line.
8254  * @param ch the height of the line.
8255  * @return line number of the line on success, -1 on error.
8256  */
8257 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);
8258
8259 /**
8260  * Set the position of the cursor according to the X and Y coordinates.
8261  *
8262  * @param cur the cursor to set.
8263  * @param x coord to set by.
8264  * @param y coord to set by.
8265  * @return #EINA_TRUE on success, #EINA_FALSE otherwise.
8266  */
8267 EAPI Eina_Bool                    evas_textblock_cursor_char_coord_set(Evas_Textblock_Cursor *cur, Evas_Coord x, Evas_Coord y) EINA_ARG_NONNULL(1);
8268
8269 /**
8270  * Set the cursor position according to the y coord.
8271  *
8272  * @param cur the cur to be set.
8273  * @param y the coord to set by.
8274  * @return the line number found, -1 on error.
8275  */
8276 EAPI int                          evas_textblock_cursor_line_coord_set(Evas_Textblock_Cursor *cur, Evas_Coord y) EINA_ARG_NONNULL(1);
8277
8278 /**
8279  * Get the geometry of a range.
8280  *
8281  * @param cur1 one side of the range.
8282  * @param cur2 other side of the range.
8283  * @return a list of Rectangles representing the geometry of the range.
8284  */
8285 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) EINA_PURE;
8286    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);
8287
8288
8289 /**
8290  * Checks if the cursor points to the end of the line.
8291  *
8292  * @param cur the cursor to check.
8293  * @return #EINA_TRUE if true, #EINA_FALSE otherwise.
8294  */
8295 EAPI Eina_Bool                    evas_textblock_cursor_eol_get(const Evas_Textblock_Cursor *cur) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
8296
8297
8298 /**
8299  * Get the geometry of a line number.
8300  *
8301  * @param obj the object.
8302  * @param line the line number.
8303  * @param cx x coord of the line.
8304  * @param cy y coord of the line.
8305  * @param cw w coord of the line.
8306  * @param ch h coord of the line.
8307  * @return #EINA_TRUE on success, #EINA_FALSE otherwise.
8308  */
8309 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);
8310
8311 /**
8312  * Clear the textblock object.
8313  * @note Does *NOT* free the Evas object itself.
8314  *
8315  * @param obj the object to clear.
8316  * @return nothing.
8317  */
8318 EAPI void                         evas_object_textblock_clear(Evas_Object *obj) EINA_ARG_NONNULL(1);
8319
8320 /**
8321  * Get the formatted width and height. This calculates the actual size after restricting
8322  * the textblock to the current size of the object.
8323  * The main difference between this and @ref evas_object_textblock_size_native_get
8324  * is that the "native" function does not wrapping into account
8325  * it just calculates the real width of the object if it was placed on an
8326  * infinite canvas, while this function gives the size after wrapping
8327  * according to the size restrictions of the object.
8328  *
8329  * For example for a textblock containing the text: "You shall not pass!"
8330  * with no margins or padding and assuming a monospace font and a size of
8331  * 7x10 char widths (for simplicity) has a native size of 19x1
8332  * and a formatted size of 5x4.
8333  *
8334  *
8335  * @param obj the Evas object.
8336  * @param w[out] the width of the object.
8337  * @param h[out] the height of the object
8338  * @return Returns no value.
8339  * @see evas_object_textblock_size_native_get
8340  */
8341 EAPI void                         evas_object_textblock_size_formatted_get(const Evas_Object *obj, Evas_Coord *w, Evas_Coord *h) EINA_ARG_NONNULL(1);
8342
8343 /**
8344  * Get the native width and height. This calculates the actual size without taking account
8345  * the current size of the object.
8346  * The main difference between this and @ref evas_object_textblock_size_formatted_get
8347  * is that the "native" function does not take wrapping into account
8348  * it just calculates the real width of the object if it was placed on an
8349  * infinite canvas, while the "formatted" function gives the size after
8350  * wrapping text according to the size restrictions of the object.
8351  *
8352  * For example for a textblock containing the text: "You shall not pass!"
8353  * with no margins or padding and assuming a monospace font and a size of
8354  * 7x10 char widths (for simplicity) has a native size of 19x1
8355  * and a formatted size of 5x4.
8356  *
8357  * @param obj the Evas object of the textblock
8358  * @param w[out] the width returned
8359  * @param h[out] the height returned
8360  * @return Returns no value.
8361  */
8362 EAPI void                         evas_object_textblock_size_native_get(const Evas_Object *obj, Evas_Coord *w, Evas_Coord *h) EINA_ARG_NONNULL(1);
8363    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);
8364 /**
8365  * @}
8366  */
8367
8368 /**
8369  * @defgroup Evas_Line_Group Line Object Functions
8370  *
8371  * Functions used to deal with evas line objects.
8372  *
8373  * @ingroup Evas_Object_Specific
8374  *
8375  * @{
8376  */
8377
8378 /**
8379  * Adds a new evas line object to the given evas.
8380  * @param   e The given evas.
8381  * @return  The new evas line object.
8382  */
8383 EAPI Evas_Object      *evas_object_line_add              (Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
8384
8385 /**
8386  * Sets the coordinates of the end points of the given evas line object.
8387  * @param   obj The given evas line object.
8388  * @param   x1  The X coordinate of the first point.
8389  * @param   y1  The Y coordinate of the first point.
8390  * @param   x2  The X coordinate of the second point.
8391  * @param   y2  The Y coordinate of the second point.
8392  */
8393 EAPI void              evas_object_line_xy_set           (Evas_Object *obj, Evas_Coord x1, Evas_Coord y1, Evas_Coord x2, Evas_Coord y2);
8394
8395 /**
8396  * Retrieves the coordinates of the end points of the given evas line object.
8397  * @param obj The given line object.
8398  * @param x1  Pointer to an integer in which to store the X coordinate of the
8399  *            first end point.
8400  * @param y1  Pointer to an integer in which to store the Y coordinate of the
8401  *            first end point.
8402  * @param x2  Pointer to an integer in which to store the X coordinate of the
8403  *            second end point.
8404  * @param y2  Pointer to an integer in which to store the Y coordinate of the
8405  *            second end point.
8406  */
8407 EAPI void              evas_object_line_xy_get           (const Evas_Object *obj, Evas_Coord *x1, Evas_Coord *y1, Evas_Coord *x2, Evas_Coord *y2);
8408 /**
8409  * @}
8410  */
8411
8412 /**
8413  * @defgroup Evas_Object_Polygon Polygon Object Functions
8414  *
8415  * Functions that operate on evas polygon objects.
8416  *
8417  * Hint: as evas does not provide ellipse, smooth paths or circle, one
8418  * can calculate points and convert these to a polygon.
8419  *
8420  * @ingroup Evas_Object_Specific
8421  *
8422  * @{
8423  */
8424
8425 /**
8426  * Adds a new evas polygon object to the given evas.
8427  * @param   e The given evas.
8428  * @return  A new evas polygon object.
8429  */
8430 EAPI Evas_Object      *evas_object_polygon_add           (Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
8431
8432 /**
8433  * Adds the given point to the given evas polygon object.
8434  * @param obj The given evas polygon object.
8435  * @param x   The X coordinate of the given point.
8436  * @param y   The Y coordinate of the given point.
8437  * @ingroup Evas_Polygon_Group
8438  */
8439 EAPI void              evas_object_polygon_point_add     (Evas_Object *obj, Evas_Coord x, Evas_Coord y) EINA_ARG_NONNULL(1);
8440
8441 /**
8442  * Removes all of the points from the given evas polygon object.
8443  * @param   obj The given polygon object.
8444  */
8445 EAPI void              evas_object_polygon_points_clear  (Evas_Object *obj) EINA_ARG_NONNULL(1);
8446 /**
8447  * @}
8448  */
8449
8450 /**
8451  * @defgroup Evas_Smart_Group Smart Functions
8452  *
8453  * Functions that deal with #Evas_Smart structs, creating definition
8454  * (classes) of objects that will have customized behavior for methods
8455  * like evas_object_move(), evas_object_resize(),
8456  * evas_object_clip_set() and others.
8457  *
8458  * These objects will accept the generic methods defined in @ref
8459  * Evas_Object_Group and the extensions defined in @ref
8460  * Evas_Smart_Object_Group. There are a couple of existent smart
8461  * objects in Evas itself (see @ref Evas_Object_Box, @ref
8462  * Evas_Object_Table and @ref Evas_Smart_Object_Clipped).
8463  *
8464  * See also some @ref Example_Evas_Smart_Objects "examples" of this
8465  * group of functions.
8466  */
8467
8468 /**
8469  * @addtogroup Evas_Smart_Group
8470  * @{
8471  */
8472
8473 /**
8474  * @def EVAS_SMART_CLASS_VERSION
8475  *
8476  * The version you have to put into the version field in the
8477  * #Evas_Smart_Class struct. Used to safeguard from binaries with old
8478  * smart object intefaces running with newer ones.
8479  *
8480  * @ingroup Evas_Smart_Group
8481  */
8482 #define EVAS_SMART_CLASS_VERSION 4
8483 /**
8484  * @struct _Evas_Smart_Class
8485  *
8486  * A smart object's @b base class definition
8487  *
8488  * @ingroup Evas_Smart_Group
8489  */
8490 struct _Evas_Smart_Class
8491 {
8492    const char *name; /**< the name string of the class */
8493    int         version;
8494    void  (*add)         (Evas_Object *o); /**< code to be run when adding object to a canvas */
8495    void  (*del)         (Evas_Object *o); /**< code to be run when removing object to a canvas */
8496    void  (*move)        (Evas_Object *o, Evas_Coord x, Evas_Coord y); /**< code to be run when moving object on a canvas */
8497    void  (*resize)      (Evas_Object *o, Evas_Coord w, Evas_Coord h); /**< code to be run when resizing object on a canvas */
8498    void  (*show)        (Evas_Object *o); /**< code to be run when showing object on a canvas */
8499    void  (*hide)        (Evas_Object *o); /**< code to be run when hiding object on a canvas */
8500    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 */
8501    void  (*clip_set)    (Evas_Object *o, Evas_Object *clip); /**< code to be run when setting clipper of object on a canvas */
8502    void  (*clip_unset)  (Evas_Object *o); /**< code to be run when unsetting clipper of object on a canvas */
8503    void  (*calculate)   (Evas_Object *o); /**< code to be run when object has rendering updates on a canvas */
8504    void  (*member_add)  (Evas_Object *o, Evas_Object *child); /**< code to be run when child member is added to object */
8505    void  (*member_del)  (Evas_Object *o, Evas_Object *child); /**< code to be run when child member is removed from object */
8506
8507    const Evas_Smart_Class          *parent; /**< this class inherits from this parent */
8508    const Evas_Smart_Cb_Description *callbacks; /**< callbacks at this level, @c NULL terminated */
8509    void                            *interfaces; /**< to be used in a future near you */
8510    const void                      *data;
8511 };
8512
8513 /**
8514  * @struct _Evas_Smart_Cb_Description
8515  *
8516  * Describes a callback issued by a smart object
8517  * (evas_object_smart_callback_call()), as defined in its smart object
8518  * class. This is particularly useful to explain to end users and
8519  * their code (i.e., introspection) what the parameter @c event_info
8520  * will point to.
8521  *
8522  * @ingroup Evas_Smart_Group
8523  */
8524 struct _Evas_Smart_Cb_Description
8525 {
8526    const char *name; /**< callback name ("changed", for example) */
8527
8528    /**
8529     * @brief Hint on the type of @c event_info parameter's contents on
8530     * a #Evas_Smart_Cb callback.
8531     *
8532     * The type string uses the pattern similar to
8533     * http://dbus.freedesktop.org/doc/dbus-specification.html#message-protocol-signatures,
8534     * but extended to optionally include variable names within
8535     * brackets preceding types. Example:
8536     *
8537     * @li Structure with two integers:
8538     *     @c "(ii)"
8539     *
8540     * @li Structure called 'x' with two integers named 'a' and 'b':
8541     *     @c "[x]([a]i[b]i)"
8542     *
8543     * @li Array of integers:
8544     *     @c "ai"
8545     *
8546     * @li Array called 'x' of struct with two integers:
8547     *     @c "[x]a(ii)"
8548     *
8549     * @note This type string is used as a hint and is @b not validated
8550     *       or enforced in any way. Implementors should make the best
8551     *       use of it to help bindings, documentation and other users
8552     *       of introspection features.
8553     */
8554    const char *type;
8555 };
8556
8557 /**
8558  * @def EVAS_SMART_CLASS_INIT_NULL
8559  * Initializer to zero a whole Evas_Smart_Class structure.
8560  *
8561  * @see EVAS_SMART_CLASS_INIT_VERSION
8562  * @see EVAS_SMART_CLASS_INIT_NAME_VERSION
8563  * @see EVAS_SMART_CLASS_INIT_NAME_VERSION_PARENT
8564  * @see EVAS_SMART_CLASS_INIT_NAME_VERSION_PARENT_CALLBACKS
8565  * @ingroup Evas_Smart_Group
8566  */
8567 #define EVAS_SMART_CLASS_INIT_NULL {NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL}
8568
8569 /**
8570  * @def EVAS_SMART_CLASS_INIT_VERSION
8571  * Initializer to zero a whole Evas_Smart_Class structure and set version.
8572  *
8573  * Similar to EVAS_SMART_CLASS_INIT_NULL, but will set version field to
8574  * latest EVAS_SMART_CLASS_VERSION.
8575  *
8576  * @see EVAS_SMART_CLASS_INIT_NULL
8577  * @see EVAS_SMART_CLASS_INIT_NAME_VERSION
8578  * @see EVAS_SMART_CLASS_INIT_NAME_VERSION_PARENT
8579  * @see EVAS_SMART_CLASS_INIT_NAME_VERSION_PARENT_CALLBACKS
8580  * @ingroup Evas_Smart_Group
8581  */
8582 #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}
8583
8584 /**
8585  * @def EVAS_SMART_CLASS_INIT_NAME_VERSION
8586  * Initializer to zero a whole Evas_Smart_Class structure and set name
8587  * and version.
8588  *
8589  * Similar to EVAS_SMART_CLASS_INIT_NULL, but will set version field to
8590  * latest EVAS_SMART_CLASS_VERSION and name to the specified value.
8591  *
8592  * It will keep a reference to name field as a "const char *", that is,
8593  * name must be available while the structure is used (hint: static or global!)
8594  * and will not be modified.
8595  *
8596  * @see EVAS_SMART_CLASS_INIT_NULL
8597  * @see EVAS_SMART_CLASS_INIT_VERSION
8598  * @see EVAS_SMART_CLASS_INIT_NAME_VERSION_PARENT
8599  * @see EVAS_SMART_CLASS_INIT_NAME_VERSION_PARENT_CALLBACKS
8600  * @ingroup Evas_Smart_Group
8601  */
8602 #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}
8603
8604 /**
8605  * @def EVAS_SMART_CLASS_INIT_NAME_VERSION_PARENT
8606  * Initializer to zero a whole Evas_Smart_Class structure and set name,
8607  * version and parent class.
8608  *
8609  * Similar to EVAS_SMART_CLASS_INIT_NULL, but will set version field to
8610  * latest EVAS_SMART_CLASS_VERSION, name to the specified value and
8611  * parent class.
8612  *
8613  * It will keep a reference to name field as a "const char *", that is,
8614  * name must be available while the structure is used (hint: static or global!)
8615  * and will not be modified. Similarly, parent reference will be kept.
8616  *
8617  * @see EVAS_SMART_CLASS_INIT_NULL
8618  * @see EVAS_SMART_CLASS_INIT_VERSION
8619  * @see EVAS_SMART_CLASS_INIT_NAME_VERSION
8620  * @see EVAS_SMART_CLASS_INIT_NAME_VERSION_PARENT_CALLBACKS
8621  * @ingroup Evas_Smart_Group
8622  */
8623 #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}
8624
8625 /**
8626  * @def EVAS_SMART_CLASS_INIT_NAME_VERSION_PARENT_CALLBACKS
8627  * Initializer to zero a whole Evas_Smart_Class structure and set name,
8628  * version, parent class and callbacks definition.
8629  *
8630  * Similar to EVAS_SMART_CLASS_INIT_NULL, but will set version field to
8631  * latest EVAS_SMART_CLASS_VERSION, name to the specified value, parent
8632  * class and callbacks at this level.
8633  *
8634  * It will keep a reference to name field as a "const char *", that is,
8635  * name must be available while the structure is used (hint: static or global!)
8636  * and will not be modified. Similarly, parent and callbacks reference
8637  * will be kept.
8638  *
8639  * @see EVAS_SMART_CLASS_INIT_NULL
8640  * @see EVAS_SMART_CLASS_INIT_VERSION
8641  * @see EVAS_SMART_CLASS_INIT_NAME_VERSION
8642  * @see EVAS_SMART_CLASS_INIT_NAME_VERSION_PARENT
8643  * @ingroup Evas_Smart_Group
8644  */
8645 #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}
8646
8647 /**
8648  * @def EVAS_SMART_SUBCLASS_NEW
8649  *
8650  * Convenience macro to subclass a given Evas smart class.
8651  *
8652  * @param smart_name The name used for the smart class. e.g:
8653  * @c "Evas_Object_Box".
8654  * @param prefix Prefix used for all variables and functions defined
8655  * and referenced by this macro.
8656  * @param api_type Type of the structure used as API for the smart
8657  * class. Either #Evas_Smart_Class or something derived from it.
8658  * @param parent_type Type of the parent class API.
8659  * @param parent_func Function that gets the parent class. e.g:
8660  * evas_object_box_smart_class_get().
8661  * @param cb_desc Array of callback descriptions for this smart class.
8662  *
8663  * This macro saves some typing when writing a smart class derived
8664  * from another one. In order to work, the user @b must provide some
8665  * functions adhering to the following guidelines:
8666  *  - @<prefix@>_smart_set_user(): the @b internal @c _smart_set
8667  *    function (defined by this macro) will call this one, provided by
8668  *    the user, after inheriting everything from the parent, which
8669  *    should <b>take care of setting the right member functions for
8670  *    the class</b>, both overrides and extensions, if any.
8671  *  - If this new class should be subclassable as well, a @b public @c
8672  *    _smart_set() function is desirable to fill in the class used as
8673  *    parent by the children. It's up to the user to provide this
8674  *    interface, which will most likely call @<prefix@>_smart_set() to
8675  *    get the job done.
8676  *
8677  * After the macro's usage, the following will be defined for use:
8678  *  - @<prefix@>_parent_sc: A pointer to the @b parent smart
8679  *    class. When calling parent functions from overloaded ones, use
8680  *    this global variable.
8681  *  - @<prefix@>_smart_class_new(): this function returns the
8682  *    #Evas_Smart needed to create smart objects with this class,
8683  *    which should be passed to evas_object_smart_add().
8684  *
8685  * @warning @p smart_name has to be a pointer to a globally available
8686  * string! The smart class created here will just have a pointer set
8687  * to that, and all object instances will depend on it for smart class
8688  * name lookup.
8689  *
8690  * @ingroup Evas_Smart_Group
8691  */
8692 #define EVAS_SMART_SUBCLASS_NEW(smart_name, prefix, api_type, parent_type, parent_func, cb_desc) \
8693   static const parent_type * prefix##_parent_sc = NULL;                 \
8694   static void prefix##_smart_set_user(api_type *api);                   \
8695   static void prefix##_smart_set(api_type *api)                         \
8696   {                                                                     \
8697      Evas_Smart_Class *sc;                                              \
8698      if (!(sc = (Evas_Smart_Class *)api))                               \
8699        return;                                                          \
8700      if (!prefix##_parent_sc)                                           \
8701        prefix##_parent_sc = parent_func();                              \
8702      evas_smart_class_inherit(sc, (const Evas_Smart_Class *)prefix##_parent_sc); \
8703      prefix##_smart_set_user(api);                                      \
8704   }                                                                     \
8705   static Evas_Smart * prefix##_smart_class_new(void)                    \
8706   {                                                                     \
8707      static Evas_Smart *smart = NULL;                                   \
8708      static api_type api;                                               \
8709      if (!smart)                                                        \
8710        {                                                                \
8711           Evas_Smart_Class *sc = (Evas_Smart_Class *)&api;              \
8712           memset(&api, 0, sizeof(api_type));                            \
8713           sc->version = EVAS_SMART_CLASS_VERSION;                       \
8714           sc->name = smart_name;                                        \
8715           sc->callbacks = cb_desc;                                      \
8716           prefix##_smart_set(&api);                                     \
8717           smart = evas_smart_class_new(sc);                             \
8718        }                                                                \
8719      return smart;                                                      \
8720   }
8721
8722 /**
8723  * @def EVAS_SMART_DATA_ALLOC
8724  *
8725  * Convenience macro to allocate smart data only if needed.
8726  *
8727  * When writing a subclassable smart object, the @c .add() function
8728  * will need to check if the smart private data was already allocated
8729  * by some child object or not. This macro makes it easier to do it.
8730  *
8731  * @note This is an idiom used when one calls the parent's @c. add()
8732  * after the specialized code. Naturally, the parent's base smart data
8733  * has to be contemplated as the specialized one's first member, for
8734  * things to work.
8735  *
8736  * @param o Evas object passed to the @c .add() function
8737  * @param priv_type The type of the data to allocate
8738  *
8739  * @ingroup Evas_Smart_Group
8740  */
8741 #define EVAS_SMART_DATA_ALLOC(o, priv_type) \
8742    priv_type *priv; \
8743    priv = evas_object_smart_data_get(o); \
8744    if (!priv) { \
8745       priv = (priv_type *)calloc(1, sizeof(priv_type)); \
8746       if (!priv) return; \
8747       evas_object_smart_data_set(o, priv); \
8748    }
8749
8750
8751 /**
8752  * Free an #Evas_Smart struct
8753  *
8754  * @param s the #Evas_Smart struct to free
8755  *
8756  * @warning If this smart handle was created using
8757  * evas_smart_class_new(), the associated #Evas_Smart_Class will not
8758  * be freed.
8759  *
8760  * @note If you're using the #EVAS_SMART_SUBCLASS_NEW schema to create your
8761  * smart object, note that an #Evas_Smart handle will be shared amongst all
8762  * instances of the given smart class, through a static variable.
8763  * Evas will internally count references on #Evas_Smart handles and free them
8764  * when they are not referenced anymore. Thus, this function is of no use
8765  * for Evas users, most probably.
8766  */
8767 EAPI void                             evas_smart_free                     (Evas_Smart *s) EINA_ARG_NONNULL(1);
8768
8769 /**
8770  * Creates a new #Evas_Smart from a given #Evas_Smart_Class struct
8771  *
8772  * @param sc the smart class definition
8773  * @return a new #Evas_Smart pointer
8774  *
8775  * #Evas_Smart handles are necessary to create new @b instances of
8776  * smart objects belonging to the class described by @p sc. That
8777  * handle will contain, besides the smart class interface definition,
8778  * all its smart callbacks infrastructure set, too.
8779  *
8780  * @note If you are willing to subclass a given smart class to
8781  * construct yours, consider using the #EVAS_SMART_SUBCLASS_NEW macro,
8782  * which will make use of this function automatically for you.
8783  */
8784 EAPI Evas_Smart                      *evas_smart_class_new                (const Evas_Smart_Class *sc) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
8785
8786 /**
8787  * Get the #Evas_Smart_Class handle of an #Evas_Smart struct
8788  *
8789  * @param s a valid #Evas_Smart pointer
8790  * @return the #Evas_Smart_Class in it
8791  */
8792 EAPI const Evas_Smart_Class          *evas_smart_class_get                (const Evas_Smart *s) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
8793
8794
8795 /**
8796  * @brief Get the data pointer set on an #Evas_Smart struct
8797  *
8798  * @param s a valid #Evas_Smart handle
8799  *
8800  * This data pointer is set as the data field in the #Evas_Smart_Class
8801  * passed in to evas_smart_class_new().
8802  */
8803 EAPI void                            *evas_smart_data_get                 (const Evas_Smart *s) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
8804
8805 /**
8806  * Get the smart callbacks known by this #Evas_Smart handle's smart
8807  * class hierarchy.
8808  *
8809  * @param s A valid #Evas_Smart handle.
8810  * @param[out] count Returns the number of elements in the returned
8811  * array.
8812  * @return The array with callback descriptions known by this smart
8813  *         class, with its size returned in @a count parameter. It
8814  *         should not be modified in any way. If no callbacks are
8815  *         known, @c NULL is returned. The array is sorted by event
8816  *         names and elements refer to the original values given to
8817  *         evas_smart_class_new()'s #Evas_Smart_Class::callbacks
8818  *         (pointer to them).
8819  *
8820  * This is likely different from
8821  * evas_object_smart_callbacks_descriptions_get() as it will contain
8822  * the callbacks of @b all this class hierarchy sorted, while the
8823  * direct smart class member refers only to that specific class and
8824  * should not include parent's.
8825  *
8826  * If no callbacks are known, this function returns @c NULL.
8827  *
8828  * The array elements and thus their contents will be @b references to
8829  * original values given to evas_smart_class_new() as
8830  * Evas_Smart_Class::callbacks.
8831  *
8832  * The array is sorted by Evas_Smart_Cb_Description::name. The last
8833  * array element is a @c NULL pointer and is not accounted for in @a
8834  * count. Loop iterations can check any of these size indicators.
8835  *
8836  * @note objects may provide per-instance callbacks, use
8837  *       evas_object_smart_callbacks_descriptions_get() to get those
8838  *       as well.
8839  * @see evas_object_smart_callbacks_descriptions_get()
8840  */
8841 EAPI const Evas_Smart_Cb_Description **evas_smart_callbacks_descriptions_get(const Evas_Smart *s, unsigned int *count) EINA_ARG_NONNULL(1, 1);
8842
8843
8844 /**
8845  * Find a callback description for the callback named @a name.
8846  *
8847  * @param s The #Evas_Smart where to search for class registered smart
8848  * event callbacks.
8849  * @param name Name of the desired callback, which must @b not be @c
8850  *        NULL. The search has a special case for @a name being the
8851  *        same pointer as registered with #Evas_Smart_Cb_Description.
8852  *        One can use it to avoid excessive use of strcmp().
8853  * @return A reference to the description if found, or @c NULL, otherwise
8854  *
8855  * @see evas_smart_callbacks_descriptions_get()
8856  */
8857 EAPI const Evas_Smart_Cb_Description *evas_smart_callback_description_find(const Evas_Smart *s, const char *name) EINA_ARG_NONNULL(1, 2) EINA_PURE;
8858
8859
8860 /**
8861  * Sets one class to inherit from the other.
8862  *
8863  * Copy all function pointers, set @c parent to @a parent_sc and copy
8864  * everything after sizeof(Evas_Smart_Class) present in @a parent_sc,
8865  * using @a parent_sc_size as reference.
8866  *
8867  * This is recommended instead of a single memcpy() since it will take
8868  * care to not modify @a sc name, version, callbacks and possible
8869  * other members.
8870  *
8871  * @param sc child class.
8872  * @param parent_sc parent class, will provide attributes.
8873  * @param parent_sc_size size of parent_sc structure, child should be at least
8874  *        this size. Everything after @c Evas_Smart_Class size is copied
8875  *        using regular memcpy().
8876  */
8877 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);
8878
8879 /**
8880  * Get the number of users of the smart instance
8881  *
8882  * @param s The Evas_Smart to get the usage count of
8883  * @return The number of uses of the smart instance
8884  *
8885  * This function tells you how many more uses of the smart instance are in
8886  * existence. This should be used before freeing/clearing any of the
8887  * Evas_Smart_Class that was used to create the smart instance. The smart
8888  * instance will refer to data in the Evas_Smart_Class used to create it and
8889  * thus you cannot remove the original data until all users of it are gone.
8890  * When the usage count goes to 0, you can evas_smart_free() the smart
8891  * instance @p s and remove from memory any of the Evas_Smart_Class that
8892  * was used to create the smart instance, if you desire. Removing it from
8893  * memory without doing this will cause problems (crashes, undefined
8894  * behavior etc. etc.), so either never remove the original
8895  * Evas_Smart_Class data from memory (have it be a constant structure and
8896  * data), or use this API call and be very careful.
8897  */
8898 EAPI int                              evas_smart_usage_get(const Evas_Smart *s);
8899
8900   /**
8901    * @def evas_smart_class_inherit
8902    * Easy to use version of evas_smart_class_inherit_full().
8903    *
8904    * This version will use sizeof(parent_sc), copying everything.
8905    *
8906    * @param sc child class, will have methods copied from @a parent_sc
8907    * @param parent_sc parent class, will provide contents to be copied.
8908    * @return 1 on success, 0 on failure.
8909    * @ingroup Evas_Smart_Group
8910    */
8911 #define evas_smart_class_inherit(sc, parent_sc) evas_smart_class_inherit_full(sc, parent_sc, sizeof(*parent_sc))
8912
8913 /**
8914  * @}
8915  */
8916
8917 /**
8918  * @defgroup Evas_Smart_Object_Group Smart Object Functions
8919  *
8920  * Functions dealing with Evas smart objects (instances).
8921  *
8922  * Smart objects are groupings of primitive Evas objects that behave
8923  * as a cohesive group. For instance, a file manager icon may be a
8924  * smart object composed of an image object, a text label and two
8925  * rectangles that appear behind the image and text when the icon is
8926  * selected. As a smart object, the normal Evas object API could be
8927  * used on the icon object.
8928  *
8929  * Besides that, generally smart objects implement a <b>specific
8930  * API</b>, so that users interect with its own custom features. The
8931  * API takes form of explicit exported functions one may call and
8932  * <b>smart callbacks</b>.
8933  *
8934  * @section Evas_Smart_Object_Group_Callbacks Smart events and callbacks
8935  *
8936  * Smart objects can elect events (smart events, from now on) ocurring
8937  * inside of them to be reported back to their users via callback
8938  * functions (smart callbacks). This way, you can extend Evas' own
8939  * object events. They are defined by an <b>event string</b>, which
8940  * identifies them uniquely. There's also a function prototype
8941  * definition for the callback functions: #Evas_Smart_Cb.
8942  *
8943  * When defining an #Evas_Smart_Class, smart object implementors are
8944  * strongly encorauged to properly set the Evas_Smart_Class::callbacks
8945  * callbacks description array, so that the users of the smart object
8946  * can have introspection on its events API <b>at run time</b>.
8947  *
8948  * See some @ref Example_Evas_Smart_Objects "examples" of this group
8949  * of functions.
8950  *
8951  * @see @ref Evas_Smart_Group for class definitions.
8952  */
8953
8954 /**
8955  * @addtogroup Evas_Smart_Object_Group
8956  * @{
8957  */
8958
8959 /**
8960  * Instantiates a new smart object described by @p s.
8961  *
8962  * @param e the canvas on which to add the object
8963  * @param s the #Evas_Smart describing the smart object
8964  * @return a new #Evas_Object handle
8965  *
8966  * This is the function one should use when defining the public
8967  * function @b adding an instance of the new smart object to a given
8968  * canvas. It will take care of setting all of its internals to work
8969  * as they should, if the user set things properly, as seem on the
8970  * #EVAS_SMART_SUBCLASS_NEW, for example.
8971  *
8972  * @ingroup Evas_Smart_Object_Group
8973  */
8974 EAPI Evas_Object      *evas_object_smart_add             (Evas *e, Evas_Smart *s) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2) EINA_MALLOC;
8975
8976 /**
8977  * Set an Evas object as a member of a given smart object.
8978  *
8979  * @param obj The member object
8980  * @param smart_obj The smart object
8981  *
8982  * Members will automatically be stacked and layered together with the
8983  * smart object. The various stacking functions will operate on
8984  * members relative to the other members instead of the entire canvas,
8985  * since they now live on an exclusive layer (see
8986  * evas_object_stack_above(), for more details).
8987  *
8988  * Any @p smart_obj object's specific implementation of the @c
8989  * member_add() smart function will take place too, naturally.
8990  *
8991  * @see evas_object_smart_member_del()
8992  * @see evas_object_smart_members_get()
8993  *
8994  * @ingroup Evas_Smart_Object_Group
8995  */
8996 EAPI void              evas_object_smart_member_add      (Evas_Object *obj, Evas_Object *smart_obj) EINA_ARG_NONNULL(1, 2);
8997
8998 /**
8999  * Removes a member object from a given smart object.
9000  *
9001  * @param obj the member object
9002  * @ingroup Evas_Smart_Object_Group
9003  *
9004  * This removes a member object from a smart object, if it was added
9005  * to any. The object will still be on the canvas, but no longer
9006  * associated with whichever smart object it was associated with.
9007  *
9008  * @see evas_object_smart_member_add() for more details
9009  * @see evas_object_smart_members_get()
9010  */
9011 EAPI void              evas_object_smart_member_del      (Evas_Object *obj) EINA_ARG_NONNULL(1);
9012
9013 /**
9014  * Retrieves the list of the member objects of a given Evas smart
9015  * object
9016  *
9017  * @param obj the smart object to get members from
9018  * @return Returns the list of the member objects of @p obj.
9019  *
9020  * The returned list should be freed with @c eina_list_free() when you
9021  * no longer need it.
9022  *
9023  * @see evas_object_smart_member_add()
9024  * @see evas_object_smart_member_del()
9025 */
9026 EAPI Eina_List        *evas_object_smart_members_get     (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
9027
9028 /**
9029  * Gets the parent smart object of a given Evas object, if it has one.
9030  *
9031  * @param obj the Evas object you want to get the parent smart object
9032  * from
9033  * @return Returns the parent smart object of @a obj or @c NULL, if @a
9034  * obj is not a smart member of any
9035  *
9036  * @ingroup Evas_Smart_Object_Group
9037  */
9038 EAPI Evas_Object      *evas_object_smart_parent_get      (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
9039
9040 /**
9041  * Checks whether a given smart object or any of its smart object
9042  * parents is of a given smart class.
9043  *
9044  * @param obj An Evas smart object to check the type of
9045  * @param type The @b name (type) of the smart class to check for
9046  * @return @c EINA_TRUE, if @a obj or any of its parents is of type @a
9047  * type, @c EINA_FALSE otherwise
9048  *
9049  * If @p obj is not a smart object, this call will fail
9050  * immediately. Otherwise, make sure evas_smart_class_inherit() or its
9051  * sibling functions were used correctly when creating the smart
9052  * object's class, so it has a valid @b parent smart class pointer
9053  * set.
9054  *
9055  * The checks use smart classes names and <b>string
9056  * comparison</b>. There is a version of this same check using
9057  * <b>pointer comparison</b>, since a smart class' name is a single
9058  * string in Evas.
9059  *
9060  * @see evas_object_smart_type_check_ptr()
9061  * @see #EVAS_SMART_SUBCLASS_NEW
9062  *
9063  * @ingroup Evas_Smart_Object_Group
9064  */
9065 EAPI Eina_Bool         evas_object_smart_type_check      (const Evas_Object *obj, const char *type) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2) EINA_PURE;
9066
9067 /**
9068  * Checks whether a given smart object or any of its smart object
9069  * parents is of a given smart class, <b>using pointer comparison</b>.
9070  *
9071  * @param obj An Evas smart object to check the type of
9072  * @param type The type (name string) to check for. Must be the name
9073  * @return @c EINA_TRUE, if @a obj or any of its parents is of type @a
9074  * type, @c EINA_FALSE otherwise
9075  *
9076  * @see evas_object_smart_type_check() for more details
9077  *
9078  * @ingroup Evas_Smart_Object_Group
9079  */
9080 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) EINA_PURE;
9081
9082 /**
9083  * Get the #Evas_Smart from which @p obj smart object was created.
9084  *
9085  * @param obj a smart object
9086  * @return the #Evas_Smart handle or @c NULL, on errors
9087  *
9088  * @ingroup Evas_Smart_Object_Group
9089  */
9090 EAPI Evas_Smart       *evas_object_smart_smart_get       (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
9091
9092 /**
9093  * Retrieve user data stored on a given smart object.
9094  *
9095  * @param obj The smart object's handle
9096  * @return A pointer to data stored using
9097  *         evas_object_smart_data_set(), or @c NULL, if none has been
9098  *         set.
9099  *
9100  * @see evas_object_smart_data_set()
9101  *
9102  * @ingroup Evas_Smart_Object_Group
9103  */
9104 EAPI void             *evas_object_smart_data_get        (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
9105
9106 /**
9107  * Store a pointer to user data for a given smart object.
9108  *
9109  * @param obj The smart object's handle
9110  * @param data A pointer to user data
9111  *
9112  * This data is stored @b independently of the one set by
9113  * evas_object_data_set(), naturally.
9114  *
9115  * @see evas_object_smart_data_get()
9116  *
9117  * @ingroup Evas_Smart_Object_Group
9118  */
9119 EAPI void              evas_object_smart_data_set        (Evas_Object *obj, void *data) EINA_ARG_NONNULL(1);
9120
9121 /**
9122  * Add (register) a callback function to the smart event specified by
9123  * @p event on the smart object @p obj.
9124  *
9125  * @param obj a smart object
9126  * @param event the event's name string
9127  * @param func the callback function
9128  * @param data user data to be passed to the callback function
9129  *
9130  * Smart callbacks look very similar to Evas callbacks, but are
9131  * implemented as smart object's custom ones.
9132  *
9133  * This function adds a function callback to an smart object when the
9134  * event named @p event occurs in it. The function is @p func.
9135  *
9136  * In the event of a memory allocation error during addition of the
9137  * callback to the object, evas_alloc_error() should be used to
9138  * determine the nature of the error, if any, and the program should
9139  * sensibly try and recover.
9140  *
9141  * A smart callback function must have the ::Evas_Smart_Cb prototype
9142  * definition. The first parameter (@p data) in this definition will
9143  * have the same value passed to evas_object_smart_callback_add() as
9144  * the @p data parameter, at runtime. The second parameter @p obj is a
9145  * handle to the object on which the event occurred. The third
9146  * parameter, @p event_info, is a pointer to data which is totally
9147  * dependent on the smart object's implementation and semantic for the
9148  * given event.
9149  *
9150  * There is an infrastructure for introspection on smart objects'
9151  * events (see evas_smart_callbacks_descriptions_get()), but no
9152  * internal smart objects on Evas implement them yet.
9153  *
9154  * @see @ref Evas_Smart_Object_Group_Callbacks for more details.
9155  *
9156  * @see evas_object_smart_callback_del()
9157  * @ingroup Evas_Smart_Object_Group
9158  */
9159 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);
9160
9161 /**
9162  * Delete (unregister) a callback function from the smart event
9163  * specified by @p event on the smart object @p obj.
9164  *
9165  * @param obj a smart object
9166  * @param event the event's name string
9167  * @param func the callback function
9168  * @return the data pointer
9169  *
9170  * This function removes <b>the first</b> added smart callback on the
9171  * object @p obj matching the event name @p event and the registered
9172  * function pointer @p func. If the removal is successful it will also
9173  * return the data pointer that was passed to
9174  * evas_object_smart_callback_add() (that will be the same as the
9175  * parameter) when the callback(s) was(were) added to the canvas. If
9176  * not successful @c NULL will be returned.
9177  *
9178  * @see evas_object_smart_callback_add() for more details.
9179  *
9180  * @ingroup Evas_Smart_Object_Group
9181  */
9182 EAPI void             *evas_object_smart_callback_del    (Evas_Object *obj, const char *event, Evas_Smart_Cb func) EINA_ARG_NONNULL(1, 2, 3);
9183
9184 /**
9185  * Call a given smart callback on the smart object @p obj.
9186  *
9187  * @param obj the smart object
9188  * @param event the event's name string
9189  * @param event_info pointer to an event specific struct or information to
9190  * pass to the callback functions registered on this smart event
9191  *
9192  * This should be called @b internally, from the smart object's own
9193  * code, when some specific event has occurred and the implementor
9194  * wants is to pertain to the object's events API (see @ref
9195  * Evas_Smart_Object_Group_Callbacks). The documentation for the smart
9196  * object should include a list of possible events and what type of @p
9197  * event_info to expect for each of them. Also, when defining an
9198  * #Evas_Smart_Class, smart object implementors are strongly
9199  * encorauged to properly set the Evas_Smart_Class::callbacks
9200  * callbacks description array, so that the users of the smart object
9201  * can have introspection on its events API <b>at run time</b>.
9202  *
9203  * @ingroup Evas_Smart_Object_Group
9204  */
9205 EAPI void              evas_object_smart_callback_call   (Evas_Object *obj, const char *event, void *event_info) EINA_ARG_NONNULL(1, 2);
9206
9207
9208 /**
9209  * Set an smart object @b instance's smart callbacks descriptions.
9210  *
9211  * @param obj A smart object
9212  * @param descriptions @c NULL terminated array with
9213  * #Evas_Smart_Cb_Description descriptions. Array elements won't be
9214  * modified at run time, but references to them and their contents
9215  * will be made, so this array should be kept alive during the whole
9216  * object's lifetime.
9217  * @return @c EINA_TRUE on success, @c EINA_FALSE on failure.
9218  *
9219  * These descriptions are hints to be used by introspection and are
9220  * not enforced in any way.
9221  *
9222  * It will not be checked if instance callbacks descriptions have the
9223  * same name as respective possibly registered in the smart object
9224  * @b class. Both are kept in different arrays and users of
9225  * evas_object_smart_callbacks_descriptions_get() should handle this
9226  * case as they wish.
9227  *
9228  * @note Becase @p descriptions must be @c NULL terminated, and
9229  *        because a @c NULL name makes little sense, too,
9230  *        Evas_Smart_Cb_Description::name must @b not be @c NULL.
9231  *
9232  * @note While instance callbacks descriptions are possible, they are
9233  *       @b not recommended. Use @b class callbacks descriptions
9234  *       instead as they make you smart object user's life simpler and
9235  *       will use less memory, as descriptions and arrays will be
9236  *       shared among all instances.
9237  *
9238  * @ingroup Evas_Smart_Object_Group
9239  */
9240 EAPI Eina_Bool         evas_object_smart_callbacks_descriptions_set(Evas_Object *obj, const Evas_Smart_Cb_Description *descriptions) EINA_ARG_NONNULL(1);
9241
9242 /**
9243  * Retrieve an smart object's know smart callback descriptions (both
9244  * instance and class ones).
9245  *
9246  * @param obj The smart object to get callback descriptions from.
9247  * @param class_descriptions Where to store class callbacks
9248  *        descriptions array, if any is known. If no descriptions are
9249  *        known, @c NULL is returned
9250  * @param class_count Returns how many class callbacks descriptions
9251  *        are known.
9252  * @param instance_descriptions Where to store instance callbacks
9253  *        descriptions array, if any is known. If no descriptions are
9254  *        known, @c NULL is returned.
9255  * @param instance_count Returns how many instance callbacks
9256  *        descriptions are known.
9257  *
9258  * This call searchs for registered callback descriptions for both
9259  * instance and class of the given smart object. These arrays will be
9260  * sorted by Evas_Smart_Cb_Description::name and also @c NULL
9261  * terminated, so both @a class_count and @a instance_count can be
9262  * ignored, if the caller wishes so. The terminator @c NULL is not
9263  * counted in these values.
9264  *
9265  * @note If just class descriptions are of interest, try
9266  *       evas_smart_callbacks_descriptions_get() instead.
9267  *
9268  * @note Use @c NULL pointers on the descriptions/counters you're not
9269  * interested in: they'll be ignored by the function.
9270  *
9271  * @see evas_smart_callbacks_descriptions_get()
9272  *
9273  * @ingroup Evas_Smart_Object_Group
9274  */
9275 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);
9276
9277 /**
9278  * Find callback description for callback called @a name.
9279  *
9280  * @param obj the smart object.
9281  * @param name name of desired callback, must @b not be @c NULL.  The
9282  *        search have a special case for @a name being the same
9283  *        pointer as registered with Evas_Smart_Cb_Description, one
9284  *        can use it to avoid excessive use of strcmp().
9285  * @param class_description pointer to return class description or @c
9286  *        NULL if not found. If parameter is @c NULL, no search will
9287  *        be done on class descriptions.
9288  * @param instance_description pointer to return instance description
9289  *        or @c NULL if not found. If parameter is @c NULL, no search
9290  *        will be done on instance descriptions.
9291  * @return reference to description if found, @c NULL if not found.
9292  */
9293 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);
9294
9295
9296 /**
9297  * Mark smart object as changed, dirty.
9298  *
9299  * @param obj The given Evas smart object
9300  *
9301  * This will flag the given object as needing recalculation,
9302  * forcefully. As an effect, on the next rendering cycle it's @b
9303  * calculate() (see #Evas_Smart_Class) smart function will be called.
9304  *
9305  * @see evas_object_smart_need_recalculate_set().
9306  * @see evas_object_smart_calculate().
9307  *
9308  * @ingroup Evas_Smart_Object_Group
9309  */
9310 EAPI void              evas_object_smart_changed         (Evas_Object *obj) EINA_ARG_NONNULL(1);
9311
9312 /**
9313  * Set or unset the flag signalling that a given smart object needs to
9314  * get recalculated.
9315  *
9316  * @param obj the smart object
9317  * @param value whether one wants to set (@c EINA_TRUE) or to unset
9318  * (@c EINA_FALSE) the flag.
9319  *
9320  * If this flag is set, then the @c calculate() smart function of @p
9321  * obj will be called, if one is provided, during rendering phase of
9322  * Evas (see evas_render()), after which this flag will be
9323  * automatically unset.
9324  *
9325  * If that smart function is not provided for the given object, this
9326  * flag will be left unchanged.
9327  *
9328  * @note just setting this flag will not make the canvas' whole scene
9329  *       dirty, by itself, and evas_render() will have no effect. To
9330  *       force that, use evas_object_smart_changed(), that will also
9331  *       automatically call this function automatically, with @c
9332  *       EINA_TRUE as parameter.
9333  *
9334  * @see evas_object_smart_need_recalculate_get()
9335  * @see evas_object_smart_calculate()
9336  * @see evas_smart_objects_calculate()
9337  *
9338  * @ingroup Evas_Smart_Object_Group
9339  */
9340 EAPI void              evas_object_smart_need_recalculate_set(Evas_Object *obj, Eina_Bool value) EINA_ARG_NONNULL(1);
9341
9342 /**
9343  * Get the value of the flag signalling that a given smart object needs to
9344  * get recalculated.
9345  *
9346  * @param obj the smart object
9347  * @return if flag is set or not.
9348  *
9349  * @note this flag will be unset during the rendering phase, when the
9350  *       @c calculate() smart function is called, if one is provided.
9351  *       If it's not provided, then the flag will be left unchanged
9352  *       after the rendering phase.
9353  *
9354  * @see evas_object_smart_need_recalculate_set(), for more details
9355  *
9356  * @ingroup Evas_Smart_Object_Group
9357  */
9358 EAPI Eina_Bool         evas_object_smart_need_recalculate_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
9359
9360 /**
9361  * Call the @b calculate() smart function immediataly on a given smart
9362  * object.
9363  *
9364  * @param obj the smart object's handle
9365  *
9366  * This will force immediate calculations (see #Evas_Smart_Class)
9367  * needed for renderization of this object and, besides, unset the
9368  * flag on it telling it needs recalculation for the next rendering
9369  * phase.
9370  *
9371  * @see evas_object_smart_need_recalculate_set()
9372  *
9373  * @ingroup Evas_Smart_Object_Group
9374  */
9375 EAPI void              evas_object_smart_calculate       (Evas_Object *obj) EINA_ARG_NONNULL(1);
9376
9377 /**
9378  * Call user-provided @c calculate() smart functions and unset the
9379  * flag signalling that the object needs to get recalculated to @b all
9380  * smart objects in the canvas.
9381  *
9382  * @param e The canvas to calculate all smart objects in
9383  *
9384  * @see evas_object_smart_need_recalculate_set()
9385  *
9386  * @ingroup Evas_Smart_Object_Group
9387  */
9388 EAPI void              evas_smart_objects_calculate      (Evas *e);
9389
9390 /**
9391  * Moves all children objects of a given smart object relative to a
9392  * given offset.
9393  *
9394  * @param obj the smart object.
9395  * @param dx horizontal offset (delta).
9396  * @param dy vertical offset (delta).
9397  *
9398  * This will make each of @p obj object's children to move, from where
9399  * they before, with those delta values (offsets) on both directions.
9400  *
9401  * @note This is most useful on custom smart @c move() functions.
9402  *
9403  * @note Clipped smart objects already make use of this function on
9404  * their @c move() smart function definition.
9405  */
9406 EAPI void                    evas_object_smart_move_children_relative(Evas_Object *obj, Evas_Coord dx, Evas_Coord dy) EINA_ARG_NONNULL(1);
9407
9408 /**
9409  * @}
9410  */
9411
9412 /**
9413  * @defgroup Evas_Smart_Object_Clipped Clipped Smart Object
9414  *
9415  * Clipped smart object is a base to construct other smart objects
9416  * based on the concept of having an internal clipper that is applied
9417  * to all children objects. This clipper will control the visibility,
9418  * clipping and color of sibling objects (remember that the clipping
9419  * is recursive, and clipper color modulates the color of its
9420  * clippees). By default, this base will also move children relatively
9421  * to the parent, and delete them when parent is deleted. In other
9422  * words, it is the base for simple object grouping.
9423  *
9424  * See some @ref Example_Evas_Smart_Objects "examples" of this group
9425  * of functions.
9426  *
9427  * @see evas_object_smart_clipped_smart_set()
9428  *
9429  * @ingroup Evas_Smart_Object_Group
9430  */
9431
9432 /**
9433  * @addtogroup Evas_Smart_Object_Clipped
9434  * @{
9435  */
9436
9437 /**
9438  * Every subclass should provide this at the beginning of their own
9439  * data set with evas_object_smart_data_set().
9440  */
9441   typedef struct _Evas_Object_Smart_Clipped_Data Evas_Object_Smart_Clipped_Data;
9442   struct _Evas_Object_Smart_Clipped_Data
9443   {
9444      Evas_Object *clipper;
9445      Evas        *evas;
9446   };
9447
9448
9449 /**
9450  * Get the clipper object for the given clipped smart object.
9451  *
9452  * @param obj the clipped smart object to retrieve associated clipper
9453  * from.
9454  * @return the clipper object.
9455  *
9456  * Use this function if you want to change any of this clipper's
9457  * properties, like colors.
9458  *
9459  * @see evas_object_smart_clipped_smart_add()
9460  */
9461 EAPI Evas_Object            *evas_object_smart_clipped_clipper_get   (Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
9462
9463 /**
9464  * Set a given smart class' callbacks so it implements the <b>clipped smart
9465  * object"</b>'s interface.
9466  *
9467  * @param sc The smart class handle to operate on
9468  *
9469  * This call will assign all the required methods of the @p sc
9470  * #Evas_Smart_Class instance to the implementations set for clipped
9471  * smart objects. If one wants to "subclass" it, call this function
9472  * and then override desired values. If one wants to call any original
9473  * method, save it somewhere. Example:
9474  *
9475  * @code
9476  * static Evas_Smart_Class parent_sc = EVAS_SMART_CLASS_INIT_NULL;
9477  *
9478  * static void my_class_smart_add(Evas_Object *o)
9479  * {
9480  *    parent_sc.add(o);
9481  *    evas_object_color_set(evas_object_smart_clipped_clipper_get(o),
9482  *                          255, 0, 0, 255);
9483  * }
9484  *
9485  * Evas_Smart_Class *my_class_new(void)
9486  * {
9487  *    static Evas_Smart_Class sc = EVAS_SMART_CLASS_INIT_NAME_VERSION("MyClass");
9488  *    if (!parent_sc.name)
9489  *      {
9490  *         evas_object_smart_clipped_smart_set(&sc);
9491  *         parent_sc = sc;
9492  *         sc.add = my_class_smart_add;
9493  *      }
9494  *    return &sc;
9495  * }
9496  * @endcode
9497  *
9498  * Default behavior for each of #Evas_Smart_Class functions on a
9499  * clipped smart object are:
9500  * - @c add: creates a hidden clipper with "infinite" size, to clip
9501  *    any incoming members;
9502  *  - @c del: delete all children objects;
9503  *  - @c move: move all objects relative relatively;
9504  *  - @c resize: <b>not defined</b>;
9505  *  - @c show: if there are children objects, show clipper;
9506  *  - @c hide: hides clipper;
9507  *  - @c color_set: set the color of clipper;
9508  *  - @c clip_set: set clipper of clipper;
9509  *  - @c clip_unset: unset the clipper of clipper;
9510  *
9511  * @note There are other means of assigning parent smart classes to
9512  * child ones, like the #EVAS_SMART_SUBCLASS_NEW macro or the
9513  * evas_smart_class_inherit_full() function.
9514  */
9515 EAPI void                    evas_object_smart_clipped_smart_set     (Evas_Smart_Class *sc) EINA_ARG_NONNULL(1);
9516
9517 /**
9518  * Get a pointer to the <b>clipped smart object's</b> class, to use
9519  * for proper inheritance
9520  *
9521  * @see #Evas_Smart_Object_Clipped for more information on this smart
9522  * class
9523  */
9524 EAPI const Evas_Smart_Class *evas_object_smart_clipped_class_get     (void) EINA_CONST;
9525
9526 /**
9527  * @}
9528  */
9529
9530 /**
9531  * @defgroup Evas_Object_Box Box Smart Object
9532  *
9533  * A box is a convenience smart object that packs children inside it
9534  * in @b sequence, using a layouting function specified by the
9535  * user. There are a couple of pre-made layouting functions <b>built-in
9536  * in Evas</b>, all of them using children size hints to define their
9537  * size and alignment inside their cell space.
9538  *
9539  * Examples on this smart object's usage:
9540  * - @ref Example_Evas_Box
9541  * - @ref Example_Evas_Size_Hints
9542  *
9543  * @see @ref Evas_Object_Group_Size_Hints
9544  *
9545  * @ingroup Evas_Smart_Object_Group
9546  */
9547
9548 /**
9549  * @addtogroup Evas_Object_Box
9550  * @{
9551  */
9552
9553 /**
9554  * @typedef Evas_Object_Box_Api
9555  *
9556  * Smart class extension, providing extra box object requirements.
9557  *
9558  * @ingroup Evas_Object_Box
9559  */
9560    typedef struct _Evas_Object_Box_Api        Evas_Object_Box_Api;
9561
9562 /**
9563  * @typedef Evas_Object_Box_Data
9564  *
9565  * Smart object instance data, providing box object requirements.
9566  *
9567  * @ingroup Evas_Object_Box
9568  */
9569    typedef struct _Evas_Object_Box_Data       Evas_Object_Box_Data;
9570
9571 /**
9572  * @typedef Evas_Object_Box_Option
9573  *
9574  * The base structure for a box option. Box options are a way of
9575  * extending box items properties, which will be taken into account
9576  * for layouting decisions. The box layouting functions provided by
9577  * Evas will only rely on objects' canonical size hints to layout
9578  * them, so the basic box option has @b no (custom) property set.
9579  *
9580  * Users creating their own layouts, but not depending on extra child
9581  * items' properties, would be fine just using
9582  * evas_object_box_layout_set(). But if one desires a layout depending
9583  * on extra child properties, he/she has to @b subclass the box smart
9584  * object. Thus, by using evas_object_box_smart_class_get() and
9585  * evas_object_box_smart_set(), the @c option_new() and @c
9586  * option_free() smart class functions should be properly
9587  * redefined/extended.
9588  *
9589  * Object properties are bound to an integer identifier and must have
9590  * a name string. Their values are open to any data. See the API on
9591  * option properties for more details.
9592  *
9593  * @ingroup Evas_Object_Box
9594  */
9595    typedef struct _Evas_Object_Box_Option     Evas_Object_Box_Option;
9596
9597 /**
9598  * @typedef Evas_Object_Box_Layout
9599  *
9600  * Function signature for an Evas box object layouting routine. By
9601  * @a o it will be passed the box object in question, by @a priv it will
9602  * be passed the box's internal data and, by @a user_data, it will be
9603  * passed any custom data one could have set to a given box layouting
9604  * function, with evas_object_box_layout_set().
9605  *
9606  * @ingroup Evas_Object_Box
9607  */
9608    typedef void (*Evas_Object_Box_Layout) (Evas_Object *o, Evas_Object_Box_Data *priv, void *user_data);
9609
9610 /**
9611  * @def EVAS_OBJECT_BOX_API_VERSION
9612  *
9613  * Current version for Evas box object smart class, a value which goes
9614  * to _Evas_Object_Box_Api::version.
9615  *
9616  * @ingroup Evas_Object_Box
9617  */
9618 #define EVAS_OBJECT_BOX_API_VERSION 1
9619
9620 /**
9621  * @struct _Evas_Object_Box_Api
9622  *
9623  * This structure should be used by any smart class inheriting from
9624  * the box's one, to provide custom box behavior which could not be
9625  * achieved only by providing a layout function, with
9626  * evas_object_box_layout_set().
9627  *
9628  * @extends Evas_Smart_Class
9629  * @ingroup Evas_Object_Box
9630  */
9631    struct _Evas_Object_Box_Api
9632    {
9633       Evas_Smart_Class          base; /**< Base smart class struct, need for all smart objects */
9634       int                       version; /**< Version of this smart class definition */
9635       Evas_Object_Box_Option *(*append)           (Evas_Object *o, Evas_Object_Box_Data *priv, Evas_Object *child); /**< Smart function to append child elements in boxes */
9636       Evas_Object_Box_Option *(*prepend)          (Evas_Object *o, Evas_Object_Box_Data *priv, Evas_Object *child); /**< Smart function to prepend child elements in boxes */
9637       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 */
9638       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 */
9639       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 */
9640       Evas_Object            *(*remove)           (Evas_Object *o, Evas_Object_Box_Data *priv, Evas_Object *child); /**< Smart function to remove a child element from boxes */
9641       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 */
9642       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 */
9643       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 */
9644       const char             *(*property_name_get)(Evas_Object *o, int property); /**< Smart function to get the name of a custom property of box children */
9645       int                     (*property_id_get)  (Evas_Object *o, const char *name); /**< Smart function to get the numerical ID of a custom property of box children */
9646       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 */
9647       void                    (*option_free)      (Evas_Object *o, Evas_Object_Box_Data *priv, Evas_Object_Box_Option *opt); /**< Smart function to delete a box option struct */
9648    };
9649
9650 /**
9651  * @def EVAS_OBJECT_BOX_API_INIT
9652  *
9653  * Initializer for a whole #Evas_Object_Box_Api structure, with
9654  * @c NULL values on its specific fields.
9655  *
9656  * @param smart_class_init initializer to use for the "base" field
9657  * (#Evas_Smart_Class).
9658  *
9659  * @see EVAS_SMART_CLASS_INIT_NULL
9660  * @see EVAS_SMART_CLASS_INIT_VERSION
9661  * @see EVAS_SMART_CLASS_INIT_NAME_VERSION
9662  * @see EVAS_OBJECT_BOX_API_INIT_NULL
9663  * @see EVAS_OBJECT_BOX_API_INIT_VERSION
9664  * @see EVAS_OBJECT_BOX_API_INIT_NAME_VERSION
9665  * @ingroup Evas_Object_Box
9666  */
9667 #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}
9668
9669 /**
9670  * @def EVAS_OBJECT_BOX_API_INIT_NULL
9671  *
9672  * Initializer to zero out a whole #Evas_Object_Box_Api structure.
9673  *
9674  * @see EVAS_OBJECT_BOX_API_INIT_VERSION
9675  * @see EVAS_OBJECT_BOX_API_INIT_NAME_VERSION
9676  * @see EVAS_OBJECT_BOX_API_INIT
9677  * @ingroup Evas_Object_Box
9678  */
9679 #define EVAS_OBJECT_BOX_API_INIT_NULL EVAS_OBJECT_BOX_API_INIT(EVAS_SMART_CLASS_INIT_NULL)
9680
9681 /**
9682  * @def EVAS_OBJECT_BOX_API_INIT_VERSION
9683  *
9684  * Initializer to zero out a whole #Evas_Object_Box_Api structure and
9685  * set a specific version on it.
9686  *
9687  * This is similar to #EVAS_OBJECT_BOX_API_INIT_NULL, but it will set
9688  * the version field of #Evas_Smart_Class (base field) to the latest
9689  * #EVAS_SMART_CLASS_VERSION.
9690  *
9691  * @see EVAS_OBJECT_BOX_API_INIT_NULL
9692  * @see EVAS_OBJECT_BOX_API_INIT_NAME_VERSION
9693  * @see EVAS_OBJECT_BOX_API_INIT
9694  * @ingroup Evas_Object_Box
9695  */
9696 #define EVAS_OBJECT_BOX_API_INIT_VERSION EVAS_OBJECT_BOX_API_INIT(EVAS_SMART_CLASS_INIT_VERSION)
9697
9698 /**
9699  * @def EVAS_OBJECT_BOX_API_INIT_NAME_VERSION
9700  *
9701  * Initializer to zero out a whole #Evas_Object_Box_Api structure and
9702  * set its name and version.
9703  *
9704  * This is similar to #EVAS_OBJECT_BOX_API_INIT_NULL, but it will also
9705  * set the version field of #Evas_Smart_Class (base field) to the
9706  * latest #EVAS_SMART_CLASS_VERSION and name it to the specific value.
9707  *
9708  * It will keep a reference to the name field as a <c>"const char *"</c>,
9709  * i.e., the name must be available while the structure is
9710  * used (hint: static or global variable!) and must not be modified.
9711  *
9712  * @see EVAS_OBJECT_BOX_API_INIT_NULL
9713  * @see EVAS_OBJECT_BOX_API_INIT_VERSION
9714  * @see EVAS_OBJECT_BOX_API_INIT
9715  * @ingroup Evas_Object_Box
9716  */
9717 #define EVAS_OBJECT_BOX_API_INIT_NAME_VERSION(name) EVAS_OBJECT_BOX_API_INIT(EVAS_SMART_CLASS_INIT_NAME_VERSION(name))
9718
9719 /**
9720  * @struct _Evas_Object_Box_Data
9721  *
9722  * This structure augments clipped smart object's instance data,
9723  * providing extra members required by generic box implementation. If
9724  * a subclass inherits from #Evas_Object_Box_Api, then it may augment
9725  * #Evas_Object_Box_Data to fit its own needs.
9726  *
9727  * @extends Evas_Object_Smart_Clipped_Data
9728  * @ingroup Evas_Object_Box
9729  */
9730    struct _Evas_Object_Box_Data
9731    {
9732       Evas_Object_Smart_Clipped_Data   base;
9733       const Evas_Object_Box_Api       *api;
9734       struct {
9735          double                        h, v;
9736       } align;
9737       struct {
9738          Evas_Coord                    h, v;
9739       } pad;
9740       Eina_List                       *children;
9741       struct {
9742          Evas_Object_Box_Layout        cb;
9743          void                         *data;
9744          void                        (*free_data)(void *data);
9745       } layout;
9746       Eina_Bool                        layouting : 1;
9747       Eina_Bool                        children_changed : 1;
9748    };
9749
9750    struct _Evas_Object_Box_Option
9751    {
9752       Evas_Object *obj; /**< Pointer to the box child object, itself */
9753       Eina_Bool    max_reached:1;
9754       Eina_Bool    min_reached:1;
9755       Evas_Coord   alloc_size;
9756    }; /**< #Evas_Object_Box_Option struct fields */
9757
9758 /**
9759  * Set the default box @a api struct (Evas_Object_Box_Api)
9760  * with the default values. May be used to extend that API.
9761  *
9762  * @param api The box API struct to set back, most probably with
9763  * overriden fields (on class extensions scenarios)
9764  */
9765 EAPI void                       evas_object_box_smart_set                             (Evas_Object_Box_Api *api) EINA_ARG_NONNULL(1);
9766
9767 /**
9768  * Get the Evas box smart class, for inheritance purposes.
9769  *
9770  * @return the (canonical) Evas box smart class.
9771  *
9772  * The returned value is @b not to be modified, just use it as your
9773  * parent class.
9774  */
9775 EAPI const Evas_Object_Box_Api *evas_object_box_smart_class_get                       (void) EINA_CONST;
9776
9777 /**
9778  * Set a new layouting function to a given box object
9779  *
9780  * @param o The box object to operate on.
9781  * @param cb The new layout function to set on @p o.
9782  * @param data Data pointer to be passed to @p cb.
9783  * @param free_data Function to free @p data, if need be.
9784  *
9785  * A box layout function affects how a box object displays child
9786  * elements within its area. The list of pre-defined box layouts
9787  * available in Evas is:
9788  * - evas_object_box_layout_horizontal()
9789  * - evas_object_box_layout_vertical()
9790  * - evas_object_box_layout_homogeneous_horizontal()
9791  * - evas_object_box_layout_homogeneous_vertical()
9792  * - evas_object_box_layout_homogeneous_max_size_horizontal()
9793  * - evas_object_box_layout_homogeneous_max_size_vertical()
9794  * - evas_object_box_layout_flow_horizontal()
9795  * - evas_object_box_layout_flow_vertical()
9796  * - evas_object_box_layout_stack()
9797  *
9798  * Refer to each of their documentation texts for details on them.
9799  *
9800  * @note A box layouting function will be triggered by the @c
9801  * 'calculate' smart callback of the box's smart class.
9802  */
9803 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);
9804
9805 /**
9806  * Add a new box object on the provided canvas.
9807  *
9808  * @param evas The canvas to create the box object on.
9809  * @return @c NULL on error, a pointer to a new box object on
9810  * success.
9811  *
9812  * After instantiation, if a box object hasn't its layout function
9813  * set, via evas_object_box_layout_set(), it will have it by default
9814  * set to evas_object_box_layout_horizontal(). The remaining
9815  * properties of the box must be set/retrieved via
9816  * <c>evas_object_box_{h,v}_{align,padding}_{get,set)()</c>.
9817  */
9818 EAPI Evas_Object               *evas_object_box_add                                   (Evas *evas) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
9819
9820 /**
9821  * Add a new box as a @b child of a given smart object.
9822  *
9823  * @param parent The parent smart object to put the new box in.
9824  * @return @c NULL on error, a pointer to a new box object on
9825  * success.
9826  *
9827  * This is a helper function that has the same effect of putting a new
9828  * box object into @p parent by use of evas_object_smart_member_add().
9829  *
9830  * @see evas_object_box_add()
9831  */
9832 EAPI Evas_Object               *evas_object_box_add_to                                (Evas_Object *parent) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
9833
9834 /**
9835  * Layout function which sets the box @a o to a (basic) horizontal box
9836  *
9837  * @param o The box object in question
9838  * @param priv The smart data of the @p o
9839  * @param data The data pointer passed on
9840  * evas_object_box_layout_set(), if any
9841  *
9842  * In this layout, the box object's overall behavior is controlled by
9843  * its padding/alignment properties, which are set by the
9844  * <c>evas_object_box_{h,v}_{align,padding}_set()</c> family of
9845  * functions. The size hints of the elements in the box -- set by the
9846  * <c>evas_object_size_hint_{align,padding,weight}_set()</c> functions
9847  * -- also control the way this function works.
9848  *
9849  * \par Box's properties:
9850  * @c align_h controls the horizontal alignment of the child objects
9851  * relative to the containing box. When set to @c 0.0, children are
9852  * aligned to the left. A value of @c 1.0 makes them aligned to the
9853  * right border. Values in between align them proportionally. Note
9854  * that if the size required by the children, which is given by their
9855  * widths and the @c padding_h property of the box, is bigger than the
9856  * their container's width, the children will be displayed out of the
9857  * box's bounds. A negative value of @c align_h makes the box to
9858  * @b justify its children. The padding between them, in this case, is
9859  * corrected so that the leftmost one touches the left border and the
9860  * rightmost one touches the right border (even if they must
9861  * overlap). The @c align_v and @c padding_v properties of the box
9862  * @b don't contribute to its behaviour when this layout is chosen.
9863  *
9864  * \par Child element's properties:
9865  * @c align_x does @b not influence the box's behavior. @c padding_l
9866  * and @c padding_r sum up to the container's horizontal padding
9867  * between elements. The child's @c padding_t, @c padding_b and
9868  * @c align_y properties apply for padding/alignment relative to the
9869  * overall height of the box. Finally, there is the @c weight_x
9870  * property, which, if set to a non-zero value, tells the container
9871  * that the child width is @b not pre-defined. If the container can't
9872  * accommodate all its children, it sets the widths of the ones
9873  * <b>with weights</b> to sizes as small as they can all fit into
9874  * it. If the size required by the children is less than the
9875  * available, the box increases its childrens' (which have weights)
9876  * widths as to fit the remaining space. The @c weight_x property,
9877  * besides telling the element is resizable, gives a @b weight for the
9878  * resizing process.  The parent box will try to distribute (or take
9879  * off) widths accordingly to the @b normalized list of weigths: most
9880  * weighted children remain/get larger in this process than the least
9881  * ones. @c weight_y does not influence the layout.
9882  *
9883  * If one desires that, besides having weights, child elements must be
9884  * resized bounded to a minimum or maximum size, those size hints must
9885  * be set, by the <c>evas_object_size_hint_{min,max}_set()</c>
9886  * functions.
9887  */
9888 EAPI void                       evas_object_box_layout_horizontal                     (Evas_Object *o, Evas_Object_Box_Data *priv, void *data) EINA_ARG_NONNULL(1, 2);
9889
9890 /**
9891  * Layout function which sets the box @a o to a (basic) vertical box
9892  *
9893  * This function behaves analogously to
9894  * evas_object_box_layout_horizontal(). The description of its
9895  * behaviour can be derived from that function's documentation.
9896  */
9897 EAPI void                       evas_object_box_layout_vertical                       (Evas_Object *o, Evas_Object_Box_Data *priv, void *data) EINA_ARG_NONNULL(1, 2);
9898
9899 /**
9900  * Layout function which sets the box @a o to a @b homogeneous
9901  * vertical box
9902  *
9903  * This function behaves analogously to
9904  * evas_object_box_layout_homogeneous_horizontal().  The description
9905  * of its behaviour can be derived from that function's documentation.
9906  */
9907 EAPI void                       evas_object_box_layout_homogeneous_vertical           (Evas_Object *o, Evas_Object_Box_Data *priv, void *data) EINA_ARG_NONNULL(1, 2);
9908
9909 /**
9910  * Layout function which sets the box @a o to a @b homogeneous
9911  * horizontal box
9912  *
9913  * @param o The box object in question
9914  * @param priv The smart data of the @p o
9915  * @param data The data pointer passed on
9916  * evas_object_box_layout_set(), if any
9917  *
9918  * In a homogeneous horizontal box, its width is divided @b equally
9919  * between the contained objects. The box's overall behavior is
9920  * controlled by its padding/alignment properties, which are set by
9921  * the <c>evas_object_box_{h,v}_{align,padding}_set()</c> family of
9922  * functions.  The size hints the elements in the box -- set by the
9923  * <c>evas_object_size_hint_{align,padding,weight}_set()</c> functions
9924  * -- also control the way this function works.
9925  *
9926  * \par Box's properties:
9927  * @c align_h has no influence on the box for this layout.
9928  * @c padding_h tells the box to draw empty spaces of that size, in
9929  * pixels, between the (equal) child objects's cells. The @c align_v
9930  * and @c padding_v properties of the box don't contribute to its
9931  * behaviour when this layout is chosen.
9932  *
9933  * \par Child element's properties:
9934  * @c padding_l and @c padding_r sum up to the required width of the
9935  * child element. The @c align_x property tells the relative position
9936  * of this overall child width in its allocated cell (@r 0.0 to
9937  * extreme left, @c 1.0 to extreme right). A value of @c -1.0 to
9938  * @c align_x makes the box try to resize this child element to the exact
9939  * width of its cell (respecting the minimum and maximum size hints on
9940  * the child's width and accounting for its horizontal padding
9941  * hints). The child's @c padding_t, @c padding_b and @c align_y
9942  * properties apply for padding/alignment relative to the overall
9943  * height of the box. A value of @c -1.0 to @c align_y makes the box
9944  * try to resize this child element to the exact height of its parent
9945  * (respecting the maximum size hint on the child's height).
9946  */
9947 EAPI void                       evas_object_box_layout_homogeneous_horizontal         (Evas_Object *o, Evas_Object_Box_Data *priv, void *data) EINA_ARG_NONNULL(1, 2);
9948
9949 /**
9950  * Layout function which sets the box @a o to a <b>maximum size,
9951  * homogeneous</b> horizontal box
9952  *
9953  * @param o The box object in question
9954  * @param priv The smart data of the @p o
9955  * @param data The data pointer passed on
9956  * evas_object_box_layout_set(), if any
9957  *
9958  * In a maximum size, homogeneous horizontal box, besides having cells
9959  * of <b>equal size</b> reserved for the child objects, this size will
9960  * be defined by the size of the @b largest child in the box (in
9961  * width). The box's overall behavior is controlled by its properties,
9962  * which are set by the
9963  * <c>evas_object_box_{h,v}_{align,padding}_set()</c> family of
9964  * functions.  The size hints of the elements in the box -- set by the
9965  * <c>evas_object_size_hint_{align,padding,weight}_set()</c> functions
9966  * -- also control the way this function works.
9967  *
9968  * \par Box's properties:
9969  * @c padding_h tells the box to draw empty spaces of that size, in
9970  * pixels, between the child objects's cells. @c align_h controls the
9971  * horizontal alignment of the child objects, relative to the
9972  * containing box. When set to @c 0.0, children are aligned to the
9973  * left. A value of @c 1.0 lets them aligned to the right
9974  * border. Values in between align them proportionally. A negative
9975  * value of @c align_h makes the box to @b justify its children
9976  * cells. The padding between them, in this case, is corrected so that
9977  * the leftmost one touches the left border and the rightmost one
9978  * touches the right border (even if they must overlap). The
9979  * @c align_v and @c padding_v properties of the box don't contribute to
9980  * its behaviour when this layout is chosen.
9981  *
9982  * \par Child element's properties:
9983  * @c padding_l and @c padding_r sum up to the required width of the
9984  * child element. The @c align_x property tells the relative position
9985  * of this overall child width in its allocated cell (@c 0.0 to
9986  * extreme left, @c 1.0 to extreme right). A value of @c -1.0 to
9987  * @c align_x makes the box try to resize this child element to the exact
9988  * width of its cell (respecting the minimun and maximum size hints on
9989  * the child's width and accounting for its horizontal padding
9990  * hints). The child's @c padding_t, @c padding_b and @c align_y
9991  * properties apply for padding/alignment relative to the overall
9992  * height of the box. A value of @c -1.0 to @c align_y makes the box
9993  * try to resize this child element to the exact height of its parent
9994  * (respecting the max hint on the child's height).
9995  */
9996 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);
9997
9998 /**
9999  * Layout function which sets the box @a o to a <b>maximum size,
10000  * homogeneous</b> vertical box
10001  *
10002  * This function behaves analogously to
10003  * evas_object_box_layout_homogeneous_max_size_horizontal(). The
10004  * description of its behaviour can be derived from that function's
10005  * documentation.
10006  */
10007 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);
10008
10009 /**
10010  * Layout function which sets the box @a o to a @b flow horizontal
10011  * box.
10012  *
10013  * @param o The box object in question
10014  * @param priv The smart data of the @p o
10015  * @param data The data pointer passed on
10016  * evas_object_box_layout_set(), if any
10017  *
10018  * In a flow horizontal box, the box's child elements are placed in
10019  * @b rows (think of text as an analogy). A row has as much elements as
10020  * can fit into the box's width. The box's overall behavior is
10021  * controlled by its properties, which are set by the
10022  * <c>evas_object_box_{h,v}_{align,padding}_set()</c> family of
10023  * functions.  The size hints of the elements in the box -- set by the
10024  * <c>evas_object_size_hint_{align,padding,weight}_set()</c> functions
10025  * -- also control the way this function works.
10026  *
10027  * \par Box's properties:
10028  * @c padding_h tells the box to draw empty spaces of that size, in
10029  * pixels, between the child objects's cells. @c align_h dictates the
10030  * horizontal alignment of the rows (@c 0.0 to left align them, @c 1.0
10031  * to right align). A value of @c -1.0 to @c align_h lets the rows
10032  * @b justified horizontally. @c align_v controls the vertical alignment
10033  * of the entire set of rows (@c 0.0 to top, @c 1.0 to bottom). A
10034  * value of @c -1.0 to @c align_v makes the box to @b justify the rows
10035  * vertically. The padding between them, in this case, is corrected so
10036  * that the first row touches the top border and the last one touches
10037  * the bottom border (even if they must overlap). @c padding_v has no
10038  * influence on the layout.
10039  *
10040  * \par Child element's properties:
10041  * @c padding_l and @c padding_r sum up to the required width of the
10042  * child element. The @c align_x property has no influence on the
10043  * layout. The child's @c padding_t and @c padding_b sum up to the
10044  * required height of the child element and is the only means (besides
10045  * row justifying) of setting space between rows. Note, however, that
10046  * @c align_y dictates positioning relative to the <b>largest
10047  * height</b> required by a child object in the actual row.
10048  */
10049 EAPI void                       evas_object_box_layout_flow_horizontal                (Evas_Object *o, Evas_Object_Box_Data *priv, void *data) EINA_ARG_NONNULL(1, 2);
10050
10051 /**
10052  * Layout function which sets the box @a o to a @b flow vertical box.
10053  *
10054  * This function behaves analogously to
10055  * evas_object_box_layout_flow_horizontal(). The description of its
10056  * behaviour can be derived from that function's documentation.
10057  */
10058 EAPI void                       evas_object_box_layout_flow_vertical                  (Evas_Object *o, Evas_Object_Box_Data *priv, void *data) EINA_ARG_NONNULL(1, 2);
10059
10060 /**
10061  * Layout function which sets the box @a o to a @b stacking box
10062  *
10063  * @param o The box object in question
10064  * @param priv The smart data of the @p o
10065  * @param data The data pointer passed on
10066  * evas_object_box_layout_set(), if any
10067  *
10068  * In a stacking box, all children will be given the same size -- the
10069  * box's own size -- and they will be stacked one above the other, so
10070  * that the first object in @p o's internal list of child elements
10071  * will be the bottommost in the stack.
10072  *
10073  * \par Box's properties:
10074  * No box properties are used.
10075  *
10076  * \par Child element's properties:
10077  * @c padding_l and @c padding_r sum up to the required width of the
10078  * child element. The @c align_x property tells the relative position
10079  * of this overall child width in its allocated cell (@c 0.0 to
10080  * extreme left, @c 1.0 to extreme right). A value of @c -1.0 to @c
10081  * align_x makes the box try to resize this child element to the exact
10082  * width of its cell (respecting the min and max hints on the child's
10083  * width and accounting for its horizontal padding properties). The
10084  * same applies to the vertical axis.
10085  */
10086 EAPI void                       evas_object_box_layout_stack                          (Evas_Object *o, Evas_Object_Box_Data *priv, void *data) EINA_ARG_NONNULL(1, 2);
10087
10088 /**
10089  * Set the alignment of the whole bounding box of contents, for a
10090  * given box object.
10091  *
10092  * @param o The given box object to set alignment from
10093  * @param horizontal The horizontal alignment, in pixels
10094  * @param vertical the vertical alignment, in pixels
10095  *
10096  * This will influence how a box object is to align its bounding box
10097  * of contents within its own area. The values @b must be in the range
10098  * @c 0.0 - @c 1.0, or undefined behavior is expected. For horizontal
10099  * alignment, @c 0.0 means to the left, with @c 1.0 meaning to the
10100  * right. For vertical alignment, @c 0.0 means to the top, with @c 1.0
10101  * meaning to the bottom.
10102  *
10103  * @note The default values for both alignments is @c 0.5.
10104  *
10105  * @see evas_object_box_align_get()
10106  */
10107 EAPI void                       evas_object_box_align_set                             (Evas_Object *o, double horizontal, double vertical) EINA_ARG_NONNULL(1);
10108
10109 /**
10110  * Get the alignment of the whole bounding box of contents, for a
10111  * given box object.
10112  *
10113  * @param o The given box object to get alignment from
10114  * @param horizontal Pointer to a variable where to store the
10115  * horizontal alignment
10116  * @param vertical Pointer to a variable where to store the vertical
10117  * alignment
10118  *
10119  * @see evas_object_box_align_set() for more information
10120  */
10121 EAPI void                       evas_object_box_align_get                             (const Evas_Object *o, double *horizontal, double *vertical) EINA_ARG_NONNULL(1);
10122
10123 /**
10124  * Set the (space) padding between cells set for a given box object.
10125  *
10126  * @param o The given box object to set padding from
10127  * @param horizontal The horizontal padding, in pixels
10128  * @param vertical the vertical padding, in pixels
10129  *
10130  * @note The default values for both padding components is @c 0.
10131  *
10132  * @see evas_object_box_padding_get()
10133  */
10134 EAPI void                       evas_object_box_padding_set                           (Evas_Object *o, Evas_Coord horizontal, Evas_Coord vertical) EINA_ARG_NONNULL(1);
10135
10136 /**
10137  * Get the (space) padding between cells set for a given box object.
10138  *
10139  * @param o The given box object to get padding from
10140  * @param horizontal Pointer to a variable where to store the
10141  * horizontal padding
10142  * @param vertical Pointer to a variable where to store the vertical
10143  * padding
10144  *
10145  * @see evas_object_box_padding_set()
10146  */
10147 EAPI void                       evas_object_box_padding_get                           (const Evas_Object *o, Evas_Coord *horizontal, Evas_Coord *vertical) EINA_ARG_NONNULL(1);
10148
10149 /**
10150  * Append a new @a child object to the given box object @a o.
10151  *
10152  * @param o The given box object
10153  * @param child A child Evas object to be made a member of @p o
10154  * @return A box option bound to the recently added box item or @c
10155  * NULL, on errors
10156  *
10157  * On success, the @c "child,added" smart event will take place.
10158  *
10159  * @note The actual placing of the item relative to @p o's area will
10160  * depend on the layout set to it. For example, on horizontal layouts
10161  * an item in the end of the box's list of children will appear on its
10162  * right.
10163  *
10164  * @note This call will trigger the box's _Evas_Object_Box_Api::append
10165  * smart function.
10166  */
10167 EAPI Evas_Object_Box_Option    *evas_object_box_append                                (Evas_Object *o, Evas_Object *child) EINA_ARG_NONNULL(1, 2);
10168
10169 /**
10170  * Prepend a new @a child object to the given box object @a o.
10171  *
10172  * @param o The given box object
10173  * @param child A child Evas object to be made a member of @p o
10174  * @return A box option bound to the recently added box item or @c
10175  * NULL, on errors
10176  *
10177  * On success, the @c "child,added" smart event will take place.
10178  *
10179  * @note The actual placing of the item relative to @p o's area will
10180  * depend on the layout set to it. For example, on horizontal layouts
10181  * an item in the beginning of the box's list of children will appear
10182  * on its left.
10183  *
10184  * @note This call will trigger the box's
10185  * _Evas_Object_Box_Api::prepend smart function.
10186  */
10187 EAPI Evas_Object_Box_Option    *evas_object_box_prepend                               (Evas_Object *o, Evas_Object *child) EINA_ARG_NONNULL(1, 2);
10188
10189 /**
10190  * Insert a new @a child object <b>before another existing one</b>, in
10191  * a given box object @a o.
10192  *
10193  * @param o The given box object
10194  * @param child A child Evas object to be made a member of @p o
10195  * @param reference The child object to place this new one before
10196  * @return A box option bound to the recently added box item or @c
10197  * NULL, on errors
10198  *
10199  * On success, the @c "child,added" smart event will take place.
10200  *
10201  * @note This function will fail if @p reference is not a member of @p
10202  * o.
10203  *
10204  * @note The actual placing of the item relative to @p o's area will
10205  * depend on the layout set to it.
10206  *
10207  * @note This call will trigger the box's
10208  * _Evas_Object_Box_Api::insert_before smart function.
10209  */
10210 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);
10211
10212 /**
10213  * Insert a new @a child object <b>after another existing one</b>, in
10214  * a given box object @a o.
10215  *
10216  * @param o The given box object
10217  * @param child A child Evas object to be made a member of @p o
10218  * @param reference The child object to place this new one after
10219  * @return A box option bound to the recently added box item or @c
10220  * NULL, on errors
10221  *
10222  * On success, the @c "child,added" smart event will take place.
10223  *
10224  * @note This function will fail if @p reference is not a member of @p
10225  * o.
10226  *
10227  * @note The actual placing of the item relative to @p o's area will
10228  * depend on the layout set to it.
10229  *
10230  * @note This call will trigger the box's
10231  * _Evas_Object_Box_Api::insert_after smart function.
10232  */
10233 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);
10234
10235 /**
10236  * Insert a new @a child object <b>at a given position</b>, in a given
10237  * box object @a o.
10238  *
10239  * @param o The given box object
10240  * @param child A child Evas object to be made a member of @p o
10241  * @param pos The numeric position (starting from @c 0) to place the
10242  * new child object at
10243  * @return A box option bound to the recently added box item or @c
10244  * NULL, on errors
10245  *
10246  * On success, the @c "child,added" smart event will take place.
10247  *
10248  * @note This function will fail if the given position is invalid,
10249  * given @p o's internal list of elements.
10250  *
10251  * @note The actual placing of the item relative to @p o's area will
10252  * depend on the layout set to it.
10253  *
10254  * @note This call will trigger the box's
10255  * _Evas_Object_Box_Api::insert_at smart function.
10256  */
10257 EAPI Evas_Object_Box_Option    *evas_object_box_insert_at                             (Evas_Object *o, Evas_Object *child, unsigned int pos) EINA_ARG_NONNULL(1, 2);
10258
10259 /**
10260  * Remove a given object from a box object, unparenting it again.
10261  *
10262  * @param o The box object to remove a child object from
10263  * @param child The handle to the child object to be removed
10264  * @return @c EINA_TRUE, on success, @c EINA_FALSE otherwise
10265  *
10266  * On removal, you'll get an unparented object again, just as it was
10267  * before you inserted it in the box. The
10268  * _Evas_Object_Box_Api::option_free box smart callback will be called
10269  * automatilly for you and, also, the @c "child,removed" smart event
10270  * will take place.
10271  *
10272  * @note This call will trigger the box's _Evas_Object_Box_Api::remove
10273  * smart function.
10274  */
10275 EAPI Eina_Bool                  evas_object_box_remove                                (Evas_Object *o, Evas_Object *child) EINA_ARG_NONNULL(1, 2);
10276
10277 /**
10278  * Remove an object, <b>bound to a given position</b> in a box object,
10279  * unparenting it again.
10280  *
10281  * @param o The box object to remove a child object from
10282  * @param in The numeric position (starting from @c 0) of the child
10283  * object to be removed
10284  * @return @c EINA_TRUE, on success, @c EINA_FALSE otherwise
10285  *
10286  * On removal, you'll get an unparented object again, just as it was
10287  * before you inserted it in the box. The @c option_free() box smart
10288  * callback will be called automatilly for you and, also, the
10289  * @c "child,removed" smart event will take place.
10290  *
10291  * @note This function will fail if the given position is invalid,
10292  * given @p o's internal list of elements.
10293  *
10294  * @note This call will trigger the box's
10295  * _Evas_Object_Box_Api::remove_at smart function.
10296  */
10297 EAPI Eina_Bool                  evas_object_box_remove_at                             (Evas_Object *o, unsigned int pos) EINA_ARG_NONNULL(1);
10298
10299 /**
10300  * Remove @b all child objects from a box object, unparenting them
10301  * again.
10302  *
10303  * @param o The box object to remove a child object from
10304  * @param child The handle to the child object to be removed
10305  * @return @c EINA_TRUE, on success, @c EINA_FALSE otherwise
10306  *
10307  * This has the same effect of calling evas_object_box_remove() on
10308  * each of @p o's child objects, in sequence. If, and only if, all
10309  * those calls succeed, so does this one.
10310  */
10311 EAPI Eina_Bool                  evas_object_box_remove_all                            (Evas_Object *o, Eina_Bool clear) EINA_ARG_NONNULL(1);
10312
10313 /**
10314  * Get an iterator to walk the list of children of a given box object.
10315  *
10316  * @param o The box to retrieve an items iterator from
10317  * @return An iterator on @p o's child objects, on success, or @c NULL,
10318  * on errors
10319  *
10320  * @note Do @b not remove or delete objects while walking the list.
10321  */
10322 EAPI Eina_Iterator             *evas_object_box_iterator_new                          (const Evas_Object *o) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
10323
10324 /**
10325  * Get an accessor (a structure providing random items access) to the
10326  * list of children of a given box object.
10327  *
10328  * @param o The box to retrieve an items iterator from
10329  * @return An accessor on @p o's child objects, on success, or @c NULL,
10330  * on errors
10331  *
10332  * @note Do not remove or delete objects while walking the list.
10333  */
10334 EAPI Eina_Accessor             *evas_object_box_accessor_new                          (const Evas_Object *o) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
10335
10336 /**
10337  * Get the list of children objects in a given box object.
10338  *
10339  * @param o The box to retrieve an items list from
10340  * @return A list of @p o's child objects, on success, or @c NULL,
10341  * on errors (or if it has no child objects)
10342  *
10343  * The returned list should be freed with @c eina_list_free() when you
10344  * no longer need it.
10345  *
10346  * @note This is a duplicate of the list kept by the box internally.
10347  *       It's up to the user to destroy it when it no longer needs it.
10348  *       It's possible to remove objects from the box when walking
10349  *       this list, but these removals won't be reflected on it.
10350  */
10351 EAPI Eina_List                 *evas_object_box_children_get                          (const Evas_Object *o) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
10352
10353 /**
10354  * Get the name of the property of the child elements of the box @a o
10355  * which have @a id as identifier
10356  *
10357  * @param o The box to search child options from
10358  * @param id The numerical identifier of the option being searched, for
10359  * its name
10360  * @return The name of the given property or @c NULL, on errors.
10361  *
10362  * @note This call won't do anything for a canonical Evas box. Only
10363  * users which have @b subclassed it, setting custom box items options
10364  * (see #Evas_Object_Box_Option) on it, would benefit from this
10365  * function. They'd have to implement it and set it to be the
10366  * _Evas_Object_Box_Api::property_name_get smart class function of the
10367  * box, which is originally set to @c NULL.
10368  */
10369 EAPI const char                *evas_object_box_option_property_name_get              (Evas_Object *o, int property) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
10370
10371 /**
10372  * Get the numerical identifier of the property of the child elements
10373  * of the box @a o which have @a name as name string
10374  *
10375  * @param o The box to search child options from
10376  * @param name The name string of the option being searched, for
10377  * its ID
10378  * @return The numerical ID of the given property or @c -1, on
10379  * errors.
10380  *
10381  * @note This call won't do anything for a canonical Evas box. Only
10382  * users which have @b subclassed it, setting custom box items options
10383  * (see #Evas_Object_Box_Option) on it, would benefit from this
10384  * function. They'd have to implement it and set it to be the
10385  * _Evas_Object_Box_Api::property_id_get smart class function of the
10386  * box, which is originally set to @c NULL.
10387  */
10388 EAPI int                        evas_object_box_option_property_id_get                (Evas_Object *o, const char *name) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2) EINA_PURE;
10389
10390 /**
10391  * Set a property value (by its given numerical identifier), on a
10392  * given box child element
10393  *
10394  * @param o The box parenting the child element
10395  * @param opt The box option structure bound to the child box element
10396  * to set a property on
10397  * @param id The numerical ID of the given property
10398  * @param ... (List of) actual value(s) to be set for this
10399  * property. It (they) @b must be of the same type the user has
10400  * defined for it (them).
10401  * @return @c EINA_TRUE on success, @c EINA_FALSE on failure.
10402  *
10403  * @note This call won't do anything for a canonical Evas box. Only
10404  * users which have @b subclassed it, setting custom box items options
10405  * (see #Evas_Object_Box_Option) on it, would benefit from this
10406  * function. They'd have to implement it and set it to be the
10407  * _Evas_Object_Box_Api::property_set smart class function of the box,
10408  * which is originally set to @c NULL.
10409  *
10410  * @note This function will internally create a variable argument
10411  * list, with the values passed after @p property, and call
10412  * evas_object_box_option_property_vset() with this list and the same
10413  * previous arguments.
10414  */
10415 EAPI Eina_Bool                  evas_object_box_option_property_set                   (Evas_Object *o, Evas_Object_Box_Option *opt, int property, ...) EINA_ARG_NONNULL(1, 2);
10416
10417 /**
10418  * Set a property value (by its given numerical identifier), on a
10419  * given box child element -- by a variable argument list
10420  *
10421  * @param o The box parenting the child element
10422  * @param opt The box option structure bound to the child box element
10423  * to set a property on
10424  * @param id The numerical ID of the given property
10425  * @param va_list The variable argument list implementing the value to
10426  * be set for this property. It @b must be of the same type the user has
10427  * defined for it.
10428  * @return @c EINA_TRUE on success, @c EINA_FALSE on failure.
10429  *
10430  * This is a variable argument list variant of the
10431  * evas_object_box_option_property_set(). See its documentation for
10432  * more details.
10433  */
10434 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);
10435
10436 /**
10437  * Get a property's value (by its given numerical identifier), on a
10438  * given box child element
10439  *
10440  * @param o The box parenting the child element
10441  * @param opt The box option structure bound to the child box element
10442  * to get a property from
10443  * @param id The numerical ID of the given property
10444  * @param ... (List of) pointer(s) where to store the value(s) set for
10445  * this property. It (they) @b must point to variable(s) of the same
10446  * type the user has defined for it (them).
10447  * @return @c EINA_TRUE on success, @c EINA_FALSE on failure.
10448  *
10449  * @note This call won't do anything for a canonical Evas box. Only
10450  * users which have @b subclassed it, getting custom box items options
10451  * (see #Evas_Object_Box_Option) on it, would benefit from this
10452  * function. They'd have to implement it and get it to be the
10453  * _Evas_Object_Box_Api::property_get smart class function of the
10454  * box, which is originally get to @c NULL.
10455  *
10456  * @note This function will internally create a variable argument
10457  * list, with the values passed after @p property, and call
10458  * evas_object_box_option_property_vget() with this list and the same
10459  * previous arguments.
10460  */
10461 EAPI Eina_Bool                  evas_object_box_option_property_get                   (Evas_Object *o, Evas_Object_Box_Option *opt, int property, ...) EINA_ARG_NONNULL(1, 2);
10462
10463 /**
10464  * Get a property's value (by its given numerical identifier), on a
10465  * given box child element -- by a variable argument list
10466  *
10467  * @param o The box parenting the child element
10468  * @param opt The box option structure bound to the child box element
10469  * to get a property from
10470  * @param id The numerical ID of the given property
10471  * @param va_list The variable argument list with pointers to where to
10472  * store the values of this property. They @b must point to variables
10473  * of the same type the user has defined for them.
10474  * @return @c EINA_TRUE on success, @c EINA_FALSE on failure.
10475  *
10476  * This is a variable argument list variant of the
10477  * evas_object_box_option_property_get(). See its documentation for
10478  * more details.
10479  */
10480 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);
10481
10482 /**
10483  * @}
10484  */
10485
10486 /**
10487  * @defgroup Evas_Object_Table Table Smart Object.
10488  *
10489  * Convenience smart object that packs children using a tabular
10490  * layout using children size hints to define their size and
10491  * alignment inside their cell space.
10492  *
10493  * @ref tutorial_table shows how to use this Evas_Object.
10494  *
10495  * @see @ref Evas_Object_Group_Size_Hints
10496  *
10497  * @ingroup Evas_Smart_Object_Group
10498  *
10499  * @{
10500  */
10501
10502 /**
10503  * @brief Create a new table.
10504  *
10505  * @param evas Canvas in which table will be added.
10506  */
10507 EAPI Evas_Object                        *evas_object_table_add             (Evas *evas) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
10508
10509 /**
10510  * @brief Create a table that is child of a given element @a parent.
10511  *
10512  * @see evas_object_table_add()
10513  */
10514 EAPI Evas_Object                        *evas_object_table_add_to          (Evas_Object *parent) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
10515
10516 /**
10517  * @brief Set how this table should layout children.
10518  *
10519  * @todo consider aspect hint and respect it.
10520  *
10521  * @par EVAS_OBJECT_TABLE_HOMOGENEOUS_NONE
10522  * If table does not use homogeneous mode then columns and rows will
10523  * be calculated based on hints of individual cells. This operation
10524  * mode is more flexible, but more complex and heavy to calculate as
10525  * well. @b Weight properties are handled as a boolean expand. Negative
10526  * alignment will be considered as 0.5. This is the default.
10527  *
10528  * @todo @c EVAS_OBJECT_TABLE_HOMOGENEOUS_NONE should balance weight.
10529  *
10530  * @par EVAS_OBJECT_TABLE_HOMOGENEOUS_TABLE
10531  * When homogeneous is relative to table the own table size is divided
10532  * equally among children, filling the whole table area. That is, if
10533  * table has @c WIDTH and @c COLUMNS, each cell will get <tt>WIDTH /
10534  * COLUMNS</tt> pixels. If children have minimum size that is larger
10535  * than this amount (including padding), then it will overflow and be
10536  * aligned respecting the alignment hint, possible overlapping sibling
10537  * cells. @b Weight hint is used as a boolean, if greater than zero it
10538  * will make the child expand in that axis, taking as much space as
10539  * possible (bounded to maximum size hint). Negative alignment will be
10540  * considered as 0.5.
10541  *
10542  * @par EVAS_OBJECT_TABLE_HOMOGENEOUS_ITEM
10543  * When homogeneous is relative to item it means the greatest minimum
10544  * cell size will be used. That is, if no element is set to expand,
10545  * the table will have its contents to a minimum size, the bounding
10546  * box of all these children will be aligned relatively to the table
10547  * object using evas_object_table_align_get(). If the table area is
10548  * too small to hold this minimum bounding box, then the objects will
10549  * keep their size and the bounding box will overflow the box area,
10550  * still respecting the alignment. @b Weight hint is used as a
10551  * boolean, if greater than zero it will make that cell expand in that
10552  * axis, toggling the <b>expand mode</b>, which makes the table behave
10553  * much like @b EVAS_OBJECT_TABLE_HOMOGENEOUS_TABLE, except that the
10554  * bounding box will overflow and items will not overlap siblings. If
10555  * no minimum size is provided at all then the table will fallback to
10556  * expand mode as well.
10557  */
10558 EAPI void                                evas_object_table_homogeneous_set (Evas_Object *o, Evas_Object_Table_Homogeneous_Mode homogeneous) EINA_ARG_NONNULL(1);
10559
10560 /**
10561  * Get the current layout homogeneous mode.
10562  *
10563  * @see evas_object_table_homogeneous_set()
10564  */
10565 EAPI Evas_Object_Table_Homogeneous_Mode  evas_object_table_homogeneous_get (const Evas_Object *o) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
10566
10567 /**
10568  * Set padding between cells.
10569  */
10570 EAPI void                                evas_object_table_padding_set     (Evas_Object *o, Evas_Coord horizontal, Evas_Coord vertical) EINA_ARG_NONNULL(1);
10571
10572 /**
10573  * Get padding between cells.
10574  */
10575 EAPI void                                evas_object_table_padding_get     (const Evas_Object *o, Evas_Coord *horizontal, Evas_Coord *vertical) EINA_ARG_NONNULL(1);
10576
10577 /**
10578  * Set the alignment of the whole bounding box of contents.
10579  */
10580 EAPI void                                evas_object_table_align_set       (Evas_Object *o, double horizontal, double vertical) EINA_ARG_NONNULL(1);
10581
10582 /**
10583  * Get alignment of the whole bounding box of contents.
10584  */
10585 EAPI void                                evas_object_table_align_get       (const Evas_Object *o, double *horizontal, double *vertical) EINA_ARG_NONNULL(1);
10586
10587 /**
10588  * Sets the mirrored mode of the table. In mirrored mode the table items go
10589  * from right to left instead of left to right. That is, 1,1 is top right, not
10590  * top left.
10591  *
10592  * @param obj The table object.
10593  * @param mirrored the mirrored mode to set
10594  * @since 1.1.0
10595  */
10596 EAPI void                                evas_object_table_mirrored_set    (Evas_Object *o, Eina_Bool mirrored) EINA_ARG_NONNULL(1);
10597
10598 /**
10599  * Gets the mirrored mode of the table.
10600  *
10601  * @param obj The table object.
10602  * @return EINA_TRUE if it's a mirrored table, EINA_FALSE otherwise.
10603  * @since 1.1.0
10604  * @see evas_object_table_mirrored_set()
10605  */
10606 EAPI Eina_Bool                           evas_object_table_mirrored_get    (const Evas_Object *o) EINA_ARG_NONNULL(1);
10607
10608 /**
10609  * Get packing location of a child of table
10610  *
10611  * @param o The given table object.
10612  * @param child The child object to add.
10613  * @param col pointer to store relative-horizontal position to place child.
10614  * @param row pointer to store relative-vertical position to place child.
10615  * @param colspan pointer to store how many relative-horizontal position to use for this child.
10616  * @param rowspan pointer to store how many relative-vertical position to use for this child.
10617  *
10618  * @return 1 on success, 0 on failure.
10619  * @since 1.1.0
10620  */
10621 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);
10622
10623 /**
10624  * Add a new child to a table object or set its current packing.
10625  *
10626  * @param o The given table object.
10627  * @param child The child object to add.
10628  * @param col relative-horizontal position to place child.
10629  * @param row relative-vertical position to place child.
10630  * @param colspan how many relative-horizontal position to use for this child.
10631  * @param rowspan how many relative-vertical position to use for this child.
10632  *
10633  * @return 1 on success, 0 on failure.
10634  */
10635 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);
10636
10637 /**
10638  * Remove child from table.
10639  *
10640  * @note removing a child will immediately call a walk over children in order
10641  *       to recalculate numbers of columns and rows. If you plan to remove
10642  *       all children, use evas_object_table_clear() instead.
10643  *
10644  * @return 1 on success, 0 on failure.
10645  */
10646 EAPI Eina_Bool                           evas_object_table_unpack          (Evas_Object *o, Evas_Object *child) EINA_ARG_NONNULL(1, 2);
10647
10648 /**
10649  * Faster way to remove all child objects from a table object.
10650  *
10651  * @param o The given table object.
10652  * @param clear if true, it will delete just removed children.
10653  */
10654 EAPI void                                evas_object_table_clear           (Evas_Object *o, Eina_Bool clear) EINA_ARG_NONNULL(1);
10655
10656 /**
10657  * Get the number of columns and rows this table takes.
10658  *
10659  * @note columns and rows are virtual entities, one can specify a table
10660  *       with a single object that takes 4 columns and 5 rows. The only
10661  *       difference for a single cell table is that paddings will be
10662  *       accounted proportionally.
10663  */
10664 EAPI void                                evas_object_table_col_row_size_get(const Evas_Object *o, int *cols, int *rows) EINA_ARG_NONNULL(1);
10665
10666 /**
10667  * Get an iterator to walk the list of children for the table.
10668  *
10669  * @note Do not remove or delete objects while walking the list.
10670  */
10671 EAPI Eina_Iterator                      *evas_object_table_iterator_new    (const Evas_Object *o) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
10672
10673 /**
10674  * Get an accessor to get random access to the list of children for the table.
10675  *
10676  * @note Do not remove or delete objects while walking the list.
10677  */
10678 EAPI Eina_Accessor                      *evas_object_table_accessor_new    (const Evas_Object *o) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
10679
10680 /**
10681  * Get the list of children for the table.
10682  *
10683  * @note This is a duplicate of the list kept by the table internally.
10684  *       It's up to the user to destroy it when it no longer needs it.
10685  *       It's possible to remove objects from the table when walking this
10686  *       list, but these removals won't be reflected on it.
10687  */
10688 EAPI Eina_List                          *evas_object_table_children_get    (const Evas_Object *o) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
10689
10690 /**
10691  * Get the child of the table at the given coordinates
10692  *
10693  * @note This does not take into account col/row spanning
10694  */
10695 EAPI Evas_Object                        *evas_object_table_child_get       (const Evas_Object *o, unsigned short col, unsigned short row) EINA_ARG_NONNULL(1);
10696 /**
10697  * @}
10698  */
10699
10700 /**
10701  * @defgroup Evas_Object_Grid Grid Smart Object.
10702  *
10703  * Convenience smart object that packs children using a regular grid
10704  * layout using Their virtual grid location and size to determine
10705  * position inside the grid object
10706  *
10707  * @ingroup Evas_Smart_Object_Group
10708  * @since 1.1.0
10709  */
10710
10711 /**
10712  * Create a new grid.
10713  *
10714  * It's set to a virtual size of 1x1 by default and add children with
10715  * evas_object_grid_pack().
10716  * @since 1.1.0
10717  */
10718 EAPI Evas_Object                        *evas_object_grid_add             (Evas *evas) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
10719
10720 /**
10721  * Create a grid that is child of a given element @a parent.
10722  *
10723  * @see evas_object_grid_add()
10724  * @since 1.1.0
10725  */
10726 EAPI Evas_Object                        *evas_object_grid_add_to          (Evas_Object *parent) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
10727
10728 /**
10729  * Set the virtual resolution for the grid
10730  *
10731  * @param o The grid object to modify
10732  * @param w The virtual horizontal size (resolution) in integer units
10733  * @param h The virtual vertical size (resolution) in integer units
10734  * @since 1.1.0
10735  */
10736 EAPI void                                evas_object_grid_size_set        (Evas_Object *o, int w, int h) EINA_ARG_NONNULL(1);
10737
10738 /**
10739  * Get the current virtual resolution
10740  *
10741  * @param o The grid object to query
10742  * @param w A pointer to an integer to store the virtual width
10743  * @param h A pointer to an integer to store the virtual height
10744  * @see evas_object_grid_size_set()
10745  * @since 1.1.0
10746  */
10747 EAPI void                                evas_object_grid_size_get        (const Evas_Object *o, int *w, int *h) EINA_ARG_NONNULL(1) EINA_PURE;
10748
10749 /**
10750  * Sets the mirrored mode of the grid. In mirrored mode the grid items go
10751  * from right to left instead of left to right. That is, 0,0 is top right, not
10752  * to left.
10753  *
10754  * @param obj The grid object.
10755  * @param mirrored the mirrored mode to set
10756  * @since 1.1.0
10757  */
10758 EAPI void                                evas_object_grid_mirrored_set    (Evas_Object *o, Eina_Bool mirrored) EINA_ARG_NONNULL(1);
10759
10760 /**
10761  * Gets the mirrored mode of the grid.
10762  *
10763  * @param obj The grid object.
10764  * @return EINA_TRUE if it's a mirrored grid, EINA_FALSE otherwise.
10765  * @see evas_object_grid_mirrored_set()
10766  * @since 1.1.0
10767  */
10768 EAPI Eina_Bool                           evas_object_grid_mirrored_get    (const Evas_Object *o) EINA_ARG_NONNULL(1);
10769
10770 /**
10771  * Add a new child to a grid object.
10772  *
10773  * @param o The given grid object.
10774  * @param child The child object to add.
10775  * @param x The virtual x coordinate of the child
10776  * @param y The virtual y coordinate of the child
10777  * @param w The virtual width of the child
10778  * @param h The virtual height of the child
10779  * @return 1 on success, 0 on failure.
10780  * @since 1.1.0
10781  */
10782 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);
10783
10784 /**
10785  * Remove child from grid.
10786  *
10787  * @note removing a child will immediately call a walk over children in order
10788  *       to recalculate numbers of columns and rows. If you plan to remove
10789  *       all children, use evas_object_grid_clear() instead.
10790  *
10791  * @return 1 on success, 0 on failure.
10792  * @since 1.1.0
10793  */
10794 EAPI Eina_Bool                           evas_object_grid_unpack          (Evas_Object *o, Evas_Object *child) EINA_ARG_NONNULL(1, 2);
10795
10796 /**
10797  * Faster way to remove all child objects from a grid object.
10798  *
10799  * @param o The given grid object.
10800  * @param clear if true, it will delete just removed children.
10801  * @since 1.1.0
10802  */
10803 EAPI void                                evas_object_grid_clear           (Evas_Object *o, Eina_Bool clear) EINA_ARG_NONNULL(1);
10804
10805 /**
10806  * Get the pack options for a grid child
10807  *
10808  * Get the pack x, y, width and height in virtual coordinates set by
10809  * evas_object_grid_pack()
10810  * @param o The grid object
10811  * @param child The grid child to query for coordinates
10812  * @param x The pointer to where the x coordinate will be returned
10813  * @param y The pointer to where the y coordinate will be returned
10814  * @param w The pointer to where the width will be returned
10815  * @param h The pointer to where the height will be returned
10816  * @return 1 on success, 0 on failure.
10817  * @since 1.1.0
10818  */
10819 EAPI Eina_Bool                           evas_object_grid_pack_get        (Evas_Object *o, Evas_Object *child, int *x, int *y, int *w, int *h);
10820
10821 /**
10822  * Get an iterator to walk the list of children for the grid.
10823  *
10824  * @note Do not remove or delete objects while walking the list.
10825  * @since 1.1.0
10826  */
10827 EAPI Eina_Iterator                      *evas_object_grid_iterator_new    (const Evas_Object *o) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
10828
10829 /**
10830  * Get an accessor to get random access to the list of children for the grid.
10831  *
10832  * @note Do not remove or delete objects while walking the list.
10833  * @since 1.1.0
10834  */
10835 EAPI Eina_Accessor                      *evas_object_grid_accessor_new    (const Evas_Object *o) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
10836
10837 /**
10838  * Get the list of children for the grid.
10839  *
10840  * @note This is a duplicate of the list kept by the grid internally.
10841  *       It's up to the user to destroy it when it no longer needs it.
10842  *       It's possible to remove objects from the grid when walking this
10843  *       list, but these removals won't be reflected on it.
10844  * @since 1.1.0
10845  */
10846 EAPI Eina_List                          *evas_object_grid_children_get    (const Evas_Object *o) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
10847
10848 /**
10849  * @defgroup Evas_Cserve Shared Image Cache Server
10850  *
10851  * Provides client-server infrastructure to share bitmaps across
10852  * multiple processes, saving data and processing power.
10853  */
10854    typedef struct _Evas_Cserve_Stats       Evas_Cserve_Stats;
10855    typedef struct _Evas_Cserve_Image_Cache Evas_Cserve_Image_Cache;
10856    typedef struct _Evas_Cserve_Image       Evas_Cserve_Image;
10857    typedef struct _Evas_Cserve_Config      Evas_Cserve_Config;
10858
10859 /**
10860  * Statistics about server that shares cached bitmaps.
10861  * @ingroup Evas_Cserve
10862  */
10863    struct _Evas_Cserve_Stats
10864      {
10865         int    saved_memory; /**< current saved memory, in bytes */
10866         int    wasted_memory; /**< current wasted memory, in bytes */
10867         int    saved_memory_peak; /**< peak of saved memory, in bytes */
10868         int    wasted_memory_peak; /**< peak of wasted memory, in bytes */
10869         double saved_time_image_header_load; /**< time, in seconds, saved in header loads by sharing cached loads instead */
10870         double saved_time_image_data_load; /**< time, in seconds, saved in data loads by sharing cached loads instead */
10871      };
10872
10873 /**
10874  * Cache of images shared by server.
10875  * @ingroup Evas_Cserve
10876  */
10877    struct _Evas_Cserve_Image_Cache
10878      {
10879         struct {
10880            int     mem_total;
10881            int     count;
10882         } active, cached;
10883         Eina_List *images;
10884      };
10885
10886 /**
10887  * An image shared by the server.
10888  * @ingroup Evas_Cserve
10889  */
10890    struct _Evas_Cserve_Image
10891      {
10892         const char *file, *key;
10893         int         w, h;
10894         time_t      file_mod_time;
10895         time_t      file_checked_time;
10896         time_t      cached_time;
10897         int         refcount;
10898         int         data_refcount;
10899         int         memory_footprint;
10900         double      head_load_time;
10901         double      data_load_time;
10902         Eina_Bool   alpha : 1;
10903         Eina_Bool   data_loaded : 1;
10904         Eina_Bool   active : 1;
10905         Eina_Bool   dead : 1;
10906         Eina_Bool   useless : 1;
10907      };
10908
10909 /**
10910  * Configuration that controls the server that shares cached bitmaps.
10911  * @ingroup Evas_Cserve
10912  */
10913     struct _Evas_Cserve_Config
10914      {
10915         int cache_max_usage;
10916         int cache_item_timeout;
10917         int cache_item_timeout_check;
10918      };
10919
10920
10921 /**
10922  * Retrieves if the system wants to share bitmaps using the server.
10923  * @return @c EINA_TRUE if wants, @c EINA_FALSE otherwise.
10924  * @ingroup Evas_Cserve
10925  */
10926 EAPI Eina_Bool         evas_cserve_want_get                   (void) EINA_WARN_UNUSED_RESULT EINA_PURE;
10927
10928 /**
10929  * Retrieves if the system is connected to the server used to shae bitmaps.
10930  * @return @c EINA_TRUE if connected, @c EINA_FALSE otherwise.
10931  * @ingroup Evas_Cserve
10932  */
10933 EAPI Eina_Bool         evas_cserve_connected_get              (void) EINA_WARN_UNUSED_RESULT;
10934
10935 /**
10936  * Retrieves if the system wants to share bitmaps using the server.
10937  * @param stats pointer to structure to fill with statistics about
10938  *        cache server.
10939  * @return @c EINA_TRUE if @p stats were filled with data,
10940  *         @c EINA_FALSE otherwise and @p stats is untouched.
10941  * @ingroup Evas_Cserve
10942  */
10943 EAPI Eina_Bool         evas_cserve_stats_get                  (Evas_Cserve_Stats *stats) EINA_WARN_UNUSED_RESULT;
10944    EAPI void              evas_cserve_image_cache_contents_clean (Evas_Cserve_Image_Cache *cache) EINA_PURE;
10945
10946 /**
10947  * Retrieves the current configuration of the server.
10948  * @param config where to store current server configuration.
10949  * @return @c EINA_TRUE if @p config were filled with data,
10950  *         @c EINA_FALSE otherwise and @p config is untouched.
10951  * @ingroup Evas_Cserve
10952  */
10953 EAPI Eina_Bool         evas_cserve_config_get                 (Evas_Cserve_Config *config) EINA_WARN_UNUSED_RESULT EINA_PURE;
10954
10955 /**
10956  * Changes the configuration of the server.
10957  * @param config where to store current server configuration.
10958  * @return @c EINA_TRUE if @p config were successfully applied,
10959  *         @c EINA_FALSE otherwise.
10960  * @ingroup Evas_Cserve
10961  */
10962 EAPI Eina_Bool         evas_cserve_config_set                 (const Evas_Cserve_Config *config) EINA_WARN_UNUSED_RESULT EINA_PURE;
10963
10964 /**
10965  * Force system to disconnect from cache server.
10966  * @ingroup Evas_Cserve
10967  */
10968 EAPI void              evas_cserve_disconnect                 (void);
10969
10970 /**
10971  * @defgroup Evas_Utils General Utilities
10972  *
10973  * Some functions that are handy but are not specific of canvas or
10974  * objects.
10975  */
10976
10977 /**
10978  * Converts the given Evas image load error code into a string
10979  * describing it in english.
10980  *
10981  * @param error the error code, a value in ::Evas_Load_Error.
10982  * @return Always returns a valid string. If the given @p error is not
10983  *         supported, <code>"Unknown error"</code> is returned.
10984  *
10985  * Mostly evas_object_image_file_set() would be the function setting
10986  * that error value afterwards, but also evas_object_image_load(),
10987  * evas_object_image_save(), evas_object_image_data_get(),
10988  * evas_object_image_data_convert(), evas_object_image_pixels_import()
10989  * and evas_object_image_is_inside(). This function is meant to be
10990  * used in conjunction with evas_object_image_load_error_get(), as in:
10991  *
10992  * Example code:
10993  * @dontinclude evas-load-error-str.c
10994  * @skip img1 =
10995  * @until ecore_main_loop_begin(
10996  *
10997  * Here, being @c valid_path the path to a valid image and @c
10998  * bogus_path a path to a file which does not exist, the two outputs
10999  * of evas_load_error_str() would be (if no other errors occur):
11000  * <code>"No error on load"</code> and <code>"File (or file path) does
11001  * not exist"</code>, respectively. See the full @ref
11002  * Example_Evas_Images "example".
11003  *
11004  * @ingroup Evas_Utils
11005  */
11006 EAPI const char       *evas_load_error_str               (Evas_Load_Error error);
11007
11008 /* Evas utility routines for color space conversions */
11009 /* hsv color space has h in the range 0.0 to 360.0, and s,v in the range 0.0 to 1.0 */
11010 /* rgb color space has r,g,b in the range 0 to 255 */
11011
11012 /**
11013  * Convert a given color from HSV to RGB format.
11014  *
11015  * @param h The Hue component of the color.
11016  * @param s The Saturation component of the color.
11017  * @param v The Value component of the color.
11018  * @param r The Red component of the color.
11019  * @param g The Green component of the color.
11020  * @param b The Blue component of the color.
11021  *
11022  * This function converts a given color in HSV color format to RGB
11023  * color format.
11024  *
11025  * @ingroup Evas_Utils
11026  **/
11027 EAPI void              evas_color_hsv_to_rgb             (float h, float s, float v, int *r, int *g, int *b);
11028
11029 /**
11030  * Convert a given color from RGB to HSV format.
11031  *
11032  * @param r The Red component of the color.
11033  * @param g The Green component of the color.
11034  * @param b The Blue component of the color.
11035  * @param h The Hue component of the color.
11036  * @param s The Saturation component of the color.
11037  * @param v The Value component of the color.
11038  *
11039  * This function converts a given color in RGB color format to HSV
11040  * color format.
11041  *
11042  * @ingroup Evas_Utils
11043  **/
11044 EAPI void              evas_color_rgb_to_hsv             (int r, int g, int b, float *h, float *s, float *v);
11045
11046 /* argb color space has a,r,g,b in the range 0 to 255 */
11047
11048 /**
11049  * Pre-multiplies a rgb triplet by an alpha factor.
11050  *
11051  * @param a The alpha factor.
11052  * @param r The Red component of the color.
11053  * @param g The Green component of the color.
11054  * @param b The Blue component of the color.
11055  *
11056  * This function pre-multiplies a given rbg triplet by an alpha
11057  * factor. Alpha factor is used to define transparency.
11058  *
11059  * @ingroup Evas_Utils
11060  **/
11061 EAPI void              evas_color_argb_premul            (int a, int *r, int *g, int *b);
11062
11063 /**
11064  * Undo pre-multiplication of a rgb triplet by an alpha factor.
11065  *
11066  * @param a The alpha factor.
11067  * @param r The Red component of the color.
11068  * @param g The Green component of the color.
11069  * @param b The Blue component of the color.
11070  *
11071  * This function undoes pre-multiplication a given rbg triplet by an
11072  * alpha factor. Alpha factor is used to define transparency.
11073  *
11074  * @see evas_color_argb_premul().
11075  *
11076  * @ingroup Evas_Utils
11077  **/
11078 EAPI void              evas_color_argb_unpremul          (int a, int *r, int *g, int *b);
11079
11080
11081 /**
11082  * Pre-multiplies data by an alpha factor.
11083  *
11084  * @param data The data value.
11085  * @param len  The length value.
11086  *
11087  * This function pre-multiplies a given data by an alpha
11088  * factor. Alpha factor is used to define transparency.
11089  *
11090  * @ingroup Evas_Utils
11091  **/
11092 EAPI void              evas_data_argb_premul             (unsigned int *data, unsigned int len);
11093
11094 /**
11095  * Undo pre-multiplication data by an alpha factor.
11096  *
11097  * @param data The data value.
11098  * @param len  The length value.
11099  *
11100  * This function undoes pre-multiplication of a given data by an alpha
11101  * factor. Alpha factor is used to define transparency.
11102  *
11103  * @ingroup Evas_Utils
11104  **/
11105 EAPI void              evas_data_argb_unpremul           (unsigned int *data, unsigned int len);
11106
11107 /* string and font handling */
11108
11109 /**
11110  * Gets the next character in the string
11111  *
11112  * Given the UTF-8 string in @p str, and starting byte position in @p pos,
11113  * this function will place in @p decoded the decoded code point at @p pos
11114  * and return the byte index for the next character in the string.
11115  *
11116  * The only boundary check done is that @p pos must be >= 0. Other than that,
11117  * no checks are performed, so passing an index value that's not within the
11118  * length of the string will result in undefined behavior.
11119  *
11120  * @param str The UTF-8 string
11121  * @param pos The byte index where to start
11122  * @param decoded Address where to store the decoded code point. Optional.
11123  *
11124  * @return The byte index of the next character
11125  *
11126  * @ingroup Evas_Utils
11127  */
11128 EAPI int               evas_string_char_next_get         (const char *str, int pos, int *decoded) EINA_ARG_NONNULL(1);
11129
11130 /**
11131  * Gets the previous character in the string
11132  *
11133  * Given the UTF-8 string in @p str, and starting byte position in @p pos,
11134  * this function will place in @p decoded the decoded code point at @p pos
11135  * and return the byte index for the previous character in the string.
11136  *
11137  * The only boundary check done is that @p pos must be >= 1. Other than that,
11138  * no checks are performed, so passing an index value that's not within the
11139  * length of the string will result in undefined behavior.
11140  *
11141  * @param str The UTF-8 string
11142  * @param pos The byte index where to start
11143  * @param decoded Address where to store the decoded code point. Optional.
11144  *
11145  * @return The byte index of the previous character
11146  *
11147  * @ingroup Evas_Utils
11148  */
11149 EAPI int               evas_string_char_prev_get         (const char *str, int pos, int *decoded) EINA_ARG_NONNULL(1);
11150
11151 /**
11152  * Get the length in characters of the string.
11153  * @param  str The string to get the length of.
11154  * @return The length in characters (not bytes)
11155  * @ingroup Evas_Utils
11156  */
11157 EAPI int               evas_string_char_len_get          (const char *str) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
11158
11159 /**
11160  * @defgroup Evas_Keys Key Input Functions
11161  *
11162  * Functions which feed key events to the canvas.
11163  *
11164  * As explained in @ref intro_not_evas, Evas is @b not aware of input
11165  * systems at all. Then, the user, if using it crudely (evas_new()),
11166  * will have to feed it with input events, so that it can react
11167  * somehow. If, however, the user creates a canvas by means of the
11168  * Ecore_Evas wrapper, it will automatically bind the chosen display
11169  * engine's input events to the canvas, for you.
11170  *
11171  * This group presents the functions dealing with the feeding of key
11172  * events to the canvas. On most of them, one has to reference a given
11173  * key by a name (<code>keyname</code> argument). Those are
11174  * <b>platform dependent</b> symbolic names for the keys. Sometimes
11175  * you'll get the right <code>keyname</code> by simply using an ASCII
11176  * value of the key name, but it won't be like that always.
11177  *
11178  * Typical platforms are Linux frame buffer (Ecore_FB) and X server
11179  * (Ecore_X) when using Evas with Ecore and Ecore_Evas. Please refer
11180  * to your display engine's documentation when using evas through an
11181  * Ecore helper wrapper when you need the <code>keyname</code>s.
11182  *
11183  * Example:
11184  * @dontinclude evas-events.c
11185  * @skip mods = evas_key_modifier_get(evas);
11186  * @until {
11187  *
11188  * All the other @c evas_key functions behave on the same manner. See
11189  * the full @ref Example_Evas_Events "example".
11190  *
11191  * @ingroup Evas_Canvas
11192  */
11193
11194 /**
11195  * @addtogroup Evas_Keys
11196  * @{
11197  */
11198
11199 /**
11200  * Returns a handle to the list of modifier keys registered in the
11201  * canvas @p e. This is required to check for which modifiers are set
11202  * at a given time with the evas_key_modifier_is_set() function.
11203  *
11204  * @param e The pointer to the Evas canvas
11205  *
11206  * @see evas_key_modifier_add
11207  * @see evas_key_modifier_del
11208  * @see evas_key_modifier_on
11209  * @see evas_key_modifier_off
11210  * @see evas_key_modifier_is_set
11211  *
11212  * @return An ::Evas_Modifier handle to query Evas' keys subsystem
11213  *      with evas_key_modifier_is_set(), or @c NULL on error.
11214  */
11215 EAPI const Evas_Modifier *evas_key_modifier_get          (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
11216
11217 /**
11218  * Returns a handle to the list of lock keys registered in the canvas
11219  * @p e. This is required to check for which locks are set at a given
11220  * time with the evas_key_lock_is_set() function.
11221  *
11222  * @param e The pointer to the Evas canvas
11223  *
11224  * @see evas_key_lock_add
11225  * @see evas_key_lock_del
11226  * @see evas_key_lock_on
11227  * @see evas_key_lock_off
11228  * @see evas_key_lock_is_set
11229  *
11230  * @return An ::Evas_Lock handle to query Evas' keys subsystem with
11231  *      evas_key_lock_is_set(), or @c NULL on error.
11232  */
11233 EAPI const Evas_Lock     *evas_key_lock_get              (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
11234
11235
11236 /**
11237  * Checks the state of a given modifier key, at the time of the
11238  * call. If the modifier is set, such as shift being pressed, this
11239  * function returns @c Eina_True.
11240  *
11241  * @param m The current modifiers set, as returned by
11242  *        evas_key_modifier_get().
11243  * @param keyname The name of the modifier key to check status for.
11244  *
11245  * @return @c Eina_True if the modifier key named @p keyname is on, @c
11246  *         Eina_False otherwise.
11247  *
11248  * @see evas_key_modifier_add
11249  * @see evas_key_modifier_del
11250  * @see evas_key_modifier_get
11251  * @see evas_key_modifier_on
11252  * @see evas_key_modifier_off
11253  */
11254 EAPI Eina_Bool            evas_key_modifier_is_set       (const Evas_Modifier *m, const char *keyname) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2) EINA_PURE;
11255
11256
11257 /**
11258  * Checks the state of a given lock key, at the time of the call. If
11259  * the lock is set, such as caps lock, this function returns @c
11260  * Eina_True.
11261  *
11262  * @param l The current locks set, as returned by evas_key_lock_get().
11263  * @param keyname The name of the lock key to check status for.
11264  *
11265  * @return @c Eina_True if the @p keyname lock key is set, @c
11266  *        Eina_False otherwise.
11267  *
11268  * @see evas_key_lock_get
11269  * @see evas_key_lock_add
11270  * @see evas_key_lock_del
11271  * @see evas_key_lock_on
11272  * @see evas_key_lock_off
11273  */
11274 EAPI Eina_Bool            evas_key_lock_is_set           (const Evas_Lock *l, const char *keyname) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2) EINA_PURE;
11275
11276
11277 /**
11278  * Adds the @p keyname key to the current list of modifier keys.
11279  *
11280  * @param e The pointer to the Evas canvas
11281  * @param keyname The name of the modifier key to add to the list of
11282  *        Evas modifiers.
11283  *
11284  * Modifiers are keys like shift, alt and ctrl, i.e., keys which are
11285  * meant to be pressed together with others, altering the behavior of
11286  * the secondly pressed keys somehow. Evas is so that these keys can
11287  * be user defined.
11288  *
11289  * This call allows custom modifiers to be added to the Evas system at
11290  * run time. It is then possible to set and unset modifier keys
11291  * programmatically for other parts of the program to check and act
11292  * on. Programmers using Evas would check for modifier keys on key
11293  * event callbacks using evas_key_modifier_is_set().
11294  *
11295  * @see evas_key_modifier_del
11296  * @see evas_key_modifier_get
11297  * @see evas_key_modifier_on
11298  * @see evas_key_modifier_off
11299  * @see evas_key_modifier_is_set
11300  *
11301  * @note If the programmer instantiates the canvas by means of the
11302  *       ecore_evas_new() family of helper functions, Ecore will take
11303  *       care of registering on it all standard modifiers: "Shift",
11304  *       "Control", "Alt", "Meta", "Hyper", "Super".
11305  */
11306 EAPI void                 evas_key_modifier_add          (Evas *e, const char *keyname) EINA_ARG_NONNULL(1, 2);
11307
11308 /**
11309  * Removes the @p keyname key from the current list of modifier keys
11310  * on canvas @e.
11311  *
11312  * @param e The pointer to the Evas canvas
11313  * @param keyname The name of the key to remove from the modifiers list.
11314  *
11315  * @see evas_key_modifier_add
11316  * @see evas_key_modifier_get
11317  * @see evas_key_modifier_on
11318  * @see evas_key_modifier_off
11319  * @see evas_key_modifier_is_set
11320  */
11321 EAPI void                 evas_key_modifier_del          (Evas *e, const char *keyname) EINA_ARG_NONNULL(1, 2);
11322
11323 /**
11324  * Adds the @p keyname key to the current list of lock keys.
11325  *
11326  * @param e The pointer to the Evas canvas
11327  * @param keyname The name of the key to add to the locks list.
11328  *
11329  * Locks are keys like caps lock, num lock or scroll lock, i.e., keys
11330  * which are meant to be pressed once -- toggling a binary state which
11331  * is bound to it -- and thus altering the behavior of all
11332  * subsequently pressed keys somehow, depending on its state. Evas is
11333  * so that these keys can be defined by the user.
11334  *
11335  * This allows custom locks to be added to the evas system at run
11336  * time. It is then possible to set and unset lock keys
11337  * programmatically for other parts of the program to check and act
11338  * on. Programmers using Evas would check for lock keys on key event
11339  * callbacks using evas_key_lock_is_set().
11340  *
11341  * @see evas_key_lock_get
11342  * @see evas_key_lock_del
11343  * @see evas_key_lock_on
11344  * @see evas_key_lock_off
11345  * @see evas_key_lock_is_set
11346  *
11347  * @note If the programmer instantiates the canvas by means of the
11348  *       ecore_evas_new() family of helper functions, Ecore will take
11349  *       care of registering on it all standard lock keys: "Caps_Lock",
11350  *       "Num_Lock", "Scroll_Lock".
11351  */
11352 EAPI void                 evas_key_lock_add              (Evas *e, const char *keyname) EINA_ARG_NONNULL(1, 2);
11353
11354 /**
11355  * Removes the @p keyname key from the current list of lock keys on
11356  * canvas @e.
11357  *
11358  * @param e The pointer to the Evas canvas
11359  * @param keyname The name of the key to remove from the locks list.
11360  *
11361  * @see evas_key_lock_get
11362  * @see evas_key_lock_add
11363  * @see evas_key_lock_on
11364  * @see evas_key_lock_off
11365  */
11366 EAPI void                 evas_key_lock_del              (Evas *e, const char *keyname) EINA_ARG_NONNULL(1, 2);
11367
11368
11369 /**
11370  * Enables or turns on programmatically the modifier key with name @p
11371  * keyname.
11372  *
11373  * @param e The pointer to the Evas canvas
11374  * @param keyname The name of the modifier to enable.
11375  *
11376  * The effect will be as if the key was pressed for the whole time
11377  * between this call and a matching evas_key_modifier_off().
11378  *
11379  * @see evas_key_modifier_add
11380  * @see evas_key_modifier_get
11381  * @see evas_key_modifier_off
11382  * @see evas_key_modifier_is_set
11383  */
11384 EAPI void                 evas_key_modifier_on           (Evas *e, const char *keyname) EINA_ARG_NONNULL(1, 2);
11385
11386 /**
11387  * Disables or turns off programmatically the modifier key with name
11388  * @p keyname.
11389  *
11390  * @param e The pointer to the Evas canvas
11391  * @param keyname The name of the modifier to disable.
11392  *
11393  * @see evas_key_modifier_add
11394  * @see evas_key_modifier_get
11395  * @see evas_key_modifier_on
11396  * @see evas_key_modifier_is_set
11397  */
11398 EAPI void                 evas_key_modifier_off          (Evas *e, const char *keyname) EINA_ARG_NONNULL(1, 2);
11399
11400 /**
11401  * Enables or turns on programmatically the lock key with name @p
11402  * keyname.
11403  *
11404  * @param e The pointer to the Evas canvas
11405  * @param keyname The name of the lock to enable.
11406  *
11407  * The effect will be as if the key was put on its active state after
11408  * this call.
11409  *
11410  * @see evas_key_lock_get
11411  * @see evas_key_lock_add
11412  * @see evas_key_lock_del
11413  * @see evas_key_lock_off
11414  */
11415 EAPI void                 evas_key_lock_on               (Evas *e, const char *keyname) EINA_ARG_NONNULL(1, 2);
11416
11417 /**
11418  * Disables or turns off programmatically the lock key with name @p
11419  * keyname.
11420  *
11421  * @param e The pointer to the Evas canvas
11422  * @param keyname The name of the lock to disable.
11423  *
11424  * The effect will be as if the key was put on its inactive state
11425  * after this call.
11426  *
11427  * @see evas_key_lock_get
11428  * @see evas_key_lock_add
11429  * @see evas_key_lock_del
11430  * @see evas_key_lock_on
11431  */
11432 EAPI void                 evas_key_lock_off              (Evas *e, const char *keyname) EINA_ARG_NONNULL(1, 2);
11433
11434
11435 /**
11436  * Creates a bit mask from the @p keyname @b modifier key. Values
11437  * returned from different calls to it may be ORed together,
11438  * naturally.
11439  *
11440  * @param e The canvas whom to query the bit mask from.
11441  * @param keyname The name of the modifier key to create the mask for.
11442  *
11443  * @returns the bit mask or 0 if the @p keyname key wasn't registered as a
11444  *          modifier for canvas @p e.
11445  *
11446  * This function is meant to be using in conjunction with
11447  * evas_object_key_grab()/evas_object_key_ungrab(). Go check their
11448  * documentation for more information.
11449  *
11450  * @see evas_key_modifier_add
11451  * @see evas_key_modifier_get
11452  * @see evas_key_modifier_on
11453  * @see evas_key_modifier_off
11454  * @see evas_key_modifier_is_set
11455  * @see evas_object_key_grab
11456  * @see evas_object_key_ungrab
11457  */
11458 EAPI Evas_Modifier_Mask   evas_key_modifier_mask_get     (const Evas *e, const char *keyname) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2) EINA_PURE;
11459
11460
11461 /**
11462  * Requests @p keyname key events be directed to @p obj.
11463  *
11464  * @param obj the object to direct @p keyname events to.
11465  * @param keyname the key to request events for.
11466  * @param modifiers a mask of modifiers that must be present to
11467  * trigger the event.
11468  * @param not_modifiers a mask of modifiers that must @b not be present
11469  * to trigger the event.
11470  * @param exclusive request that the @p obj is the only object
11471  * receiving the @p keyname events.
11472  * @return @c EINA_TRUE, if the call succeeded, @c EINA_FALSE otherwise.
11473  *
11474  * Key grabs allow one or more objects to receive key events for
11475  * specific key strokes even if other objects have focus. Whenever a
11476  * key is grabbed, only the objects grabbing it will get the events
11477  * for the given keys.
11478  *
11479  * @p keyname is a platform dependent symbolic name for the key
11480  * pressed (see @ref Evas_Keys for more information).
11481  *
11482  * @p modifiers and @p not_modifiers are bit masks of all the
11483  * modifiers that must and mustn't, respectively, be pressed along
11484  * with @p keyname key in order to trigger this new key
11485  * grab. Modifiers can be things such as Shift and Ctrl as well as
11486  * user defigned types via evas_key_modifier_add(). Retrieve them with
11487  * evas_key_modifier_mask_get() or use @c 0 for empty masks.
11488  *
11489  * @p exclusive will make the given object the only one permitted to
11490  * grab the given key. If given @c EINA_TRUE, subsequent calls on this
11491  * function with different @p obj arguments will fail, unless the key
11492  * is ungrabbed again.
11493  *
11494  * Example code follows.
11495  * @dontinclude evas-events.c
11496  * @skip if (d.focus)
11497  * @until else
11498  *
11499  * See the full example @ref Example_Evas_Events "here".
11500  *
11501  * @see evas_object_key_ungrab
11502  * @see evas_object_focus_set
11503  * @see evas_object_focus_get
11504  * @see evas_focus_get
11505  * @see evas_key_modifier_add
11506  */
11507 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);
11508
11509 /**
11510  * Removes the grab on @p keyname key events by @p obj.
11511  *
11512  * @param obj the object that has an existing key grab.
11513  * @param keyname the key the grab is set for.
11514  * @param modifiers a mask of modifiers that must be present to
11515  * trigger the event.
11516  * @param not_modifiers a mask of modifiers that must not not be
11517  * present to trigger the event.
11518  *
11519  * Removes a key grab on @p obj if @p keyname, @p modifiers, and @p
11520  * not_modifiers match.
11521  *
11522  * Example code follows.
11523  * @dontinclude evas-events.c
11524  * @skip got here by key grabs
11525  * @until }
11526  *
11527  * See the full example @ref Example_Evas_Events "here".
11528  *
11529  * @see evas_object_key_grab
11530  * @see evas_object_focus_set
11531  * @see evas_object_focus_get
11532  * @see evas_focus_get
11533  */
11534 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);
11535
11536 /**
11537  * @}
11538  */
11539
11540 #ifdef __cplusplus
11541 }
11542 #endif
11543
11544 #endif