Revert "Rollback to previous package. evas_1.0.0.001+svn.62695slp2+build31"
[framework/uifw/evas.git] / src / lib / Evas.h
1 /**
2 @mainpage Evas
3
4 @version 1.1
5 @date 2000-2011
6
7 Please see the @ref authors page for contact details.
8
9 @section toc Table of Contents
10
11 @li @ref intro
12 @li @ref work
13 @li @ref compiling
14 @li @ref install
15 @li @ref next_steps
16 @li @ref intro_example
17
18
19 @section intro What is Evas?
20
21 Evas is a clean display canvas API for several target display systems
22 that can draw anti-aliased text, smooth super and sub-sampled scaled
23 images, alpha-blend objects and much more.
24
25 It abstracts any need to know much about what the characteristics of
26 your display system are or what graphics calls are used to draw them
27 and how. It deals on an object level where all you do is create and
28 manipulate objects in a canvas, set their properties, and the rest is
29 done for you.
30
31 Evas optimises the rendering pipeline to minimise effort in redrawing
32 changes made to the canvas and so takes this work out of the
33 programmers hand, saving a lot of time and energy.
34
35 It's small and lean, designed to work on embedded systems all the way
36 to large and powerful multi-cpu workstations. It can be compiled to
37 only have the features you need for your target platform if you so
38 wish, thus keeping it small and lean. It has several display
39 back-ends, letting it display on several display systems, making it
40 portable for cross-device and cross-platform development.
41
42 @subsection intro_not_evas What Evas is not?
43
44 Evas is not a widget set or widget toolkit, however it is their
45 base. See Elementary (http://docs.enlightenment.org/auto/elementary/)
46 for a toolkit based on Evas, Edje, Ecore and other Enlightenment
47 technologies.
48
49 It is not dependent or aware of main loops, input or output
50 systems. Input should be polled from various sources and fed to
51 Evas. Similarly, it will not create windows or report windows updates
52 to your system, rather just drawing the pixels and reporting to the
53 user the areas that were changed. Of course these operations are quite
54 common and thus they are ready to use in Ecore, particularly in
55 Ecore_Evas (http://docs.enlightenment.org/auto/ecore/).
56
57
58 @section work How does Evas work?
59
60 Evas is a canvas display library. This is markedly different from most
61 display and windowing systems as a canvas is structural and is also a
62 state engine, whereas most display and windowing systems are immediate
63 mode display targets. Evas handles the logic between a structural
64 display via its state engine, and controls the target windowing system
65 in order to produce rendered results of the current canvas' state on
66 the display.
67
68 Immediate mode display systems retain very little, or no state. A
69 program will execute a series of commands, as in the pseudo code:
70
71 @verbatim
72 draw line from position (0, 0) to position (100, 200);
73
74 draw rectangle from position (10, 30) to position (50, 500);
75
76 bitmap_handle = create_bitmap();
77 scale bitmap_handle to size 100 x 100;
78 draw image bitmap_handle at position (10, 30);
79 @endverbatim
80
81 The series of commands is executed by the windowing system and the
82 results are displayed on the screen (normally). Once the commands are
83 executed the display system has little or no idea of how to reproduce
84 this image again, and so has to be instructed by the application how
85 to redraw sections of the screen whenever needed. Each successive
86 command will be executed as instructed by the application and either
87 emulated by software or sent to the graphics hardware on the device to
88 be performed.
89
90 The advantage of such a system is that it is simple, and gives a
91 program tight control over how something looks and is drawn. Given the
92 increasing complexity of displays and demands by users to have better
93 looking interfaces, more and more work is needing to be done at this
94 level by the internals of widget sets, custom display widgets and
95 other programs. This means more and more logic and display rendering
96 code needs to be written time and time again, each time the
97 application needs to figure out how to minimise redraws so that
98 display is fast and interactive, and keep track of redraw logic. The
99 power comes at a high-price, lots of extra code and work.  Programmers
100 not very familiar with graphics programming will often make mistakes
101 at this level and produce code that is sub optimal. Those familiar
102 with this kind of programming will simply get bored by writing the
103 same code again and again.
104
105 For example, if in the above scene, the windowing system requires the
106 application to redraw the area from 0, 0 to 50, 50 (also referred as
107 "expose event"), then the programmer must calculate manually the
108 updates and repaint it again:
109
110 @verbatim
111 Redraw from position (0, 0) to position (50, 50):
112
113 // what was in area (0, 0, 50, 50)?
114
115 // 1. intersection part of line (0, 0) to (100, 200)?
116       draw line from position (0, 0) to position (25, 50);
117
118 // 2. intersection part of rectangle (10, 30) to (50, 500)?
119       draw rectangle from position (10, 30) to position (50, 50)
120
121 // 3. intersection part of image at (10, 30), size 100 x 100?
122       bitmap_subimage = subregion from position (0, 0) to position (40, 20)
123       draw image bitmap_subimage at position (10, 30);
124 @endverbatim
125
126 The clever reader might have noticed that, if all elements in the
127 above scene are opaque, then the system is doing useless paints: part
128 of the line is behind the rectangle, and part of the rectangle is
129 behind the image. These useless paints tend to be very costly, as
130 pixels tend to be 4 bytes in size, thus an overlapping region of 100 x
131 100 pixels is around 40000 useless writes! The developer could write
132 code to calculate the overlapping areas and avoid painting then, but
133 then it should be mixed with the "expose event" handling mentioned
134 above and quickly one realizes the initially simpler method became
135 really complex.
136
137 Evas is a structural system in which the programmer creates and
138 manages display objects and their properties, and as a result of this
139 higher level state management, the canvas is able to redraw the set of
140 objects when needed to represent the current state of the canvas.
141
142 For example, the pseudo code:
143
144 @verbatim
145 line_handle = create_line();
146 set line_handle from position (0, 0) to position (100, 200);
147 show line_handle;
148
149 rectangle_handle = create_rectangle();
150 move rectangle_handle to position (10, 30);
151 resize rectangle_handle to size 40 x 470;
152 show rectangle_handle;
153
154 bitmap_handle = create_bitmap();
155 scale bitmap_handle to size 100 x 100;
156 move bitmap_handle to position (10, 30);
157 show bitmap_handle;
158
159 render scene;
160 @endverbatim
161
162 This may look longer, but when the display needs to be refreshed or
163 updated, the programmer only moves, resizes, shows, hides etc. the
164 objects that need to change. The programmer simply thinks at the
165 object logic level, and the canvas software does the rest of the work
166 for them, figuring out what actually changed in the canvas since it
167 was last drawn, how to most efficiently redraw the canvas and its
168 contents to reflect the current state, and then it can go off and do
169 the actual drawing of the canvas.
170
171 This lets the programmer think in a more natural way when dealing with
172 a display, and saves time and effort of working out how to load and
173 display images, render given the current display system etc. Since
174 Evas also is portable across different display systems, this also
175 gives the programmer the ability to have their code ported and
176 displayed on different display systems with very little work.
177
178 Evas can be seen as a display system that stands somewhere between a
179 widget set and an immediate mode display system. It retains basic
180 display logic, but does very little high-level logic such as
181 scrollbars, sliders, push buttons etc.
182
183
184 @section compiling How to compile using Evas ?
185
186 Evas is a library your application links to. The procedure for this is
187 very simple. You simply have to compile your application with the
188 appropriate compiler flags that the @c pkg-config script outputs. For
189 example:
190
191 Compiling C or C++ files into object files:
192
193 @verbatim
194 gcc -c -o main.o main.c `pkg-config --cflags evas`
195 @endverbatim
196
197 Linking object files into a binary executable:
198
199 @verbatim
200 gcc -o my_application main.o `pkg-config --libs evas`
201 @endverbatim
202
203 You simply have to make sure that @c pkg-config is in your shell's @c
204 PATH (see the manual page for your appropriate shell) and @c evas.pc
205 in @c /usr/lib/pkgconfig or its path in the @c PKG_CONFIG_PATH
206 environment variable. It's that simple to link and use Evas once you
207 have written your code to use it.
208
209 Since the program is linked to Evas, it is now able to use any
210 advertised API calls to display graphics in a canvas managed by it, as
211 well as use the API calls provided to manage data.
212
213 You should make sure you add any extra compile and link flags to your
214 compile commands that your application may need as well. The above
215 example is only guaranteed to make Evas add it's own requirements.
216
217
218 @section install How is it installed?
219
220 Simple:
221
222 @verbatim
223 ./configure
224 make
225 su -
226 ...
227 make install
228 @endverbatim
229
230 @section next_steps Next Steps
231
232 After you understood what Evas is and installed it in your system you
233 should proceed understanding the programming interface for all
234 objects, then see the specific for the most used elements. We'd
235 recommend you to take a while to learn Ecore
236 (http://docs.enlightenment.org/auto/ecore/) and Edje
237 (http://docs.enlightenment.org/auto/edje/) as they will likely save
238 you tons of work compared to using just Evas directly.
239
240 Recommended reading:
241
242 @li @ref Evas_Object_Group, where you'll get how to basically
243     manipulate generic objects lying on an Evas canvas, handle canvas
244     and object events, etc.
245 @li @ref Evas_Object_Rectangle, to learn about the most basic object
246     type on Evas -- the rectangle.
247 @li @ref Evas_Object_Polygon, to learn how to create polygon elements
248     on the canvas.
249 @li @ref Evas_Line_Group, to learn how to create line elements on the
250     canvas.
251 @li @ref Evas_Object_Image, to learn about image objects, over which
252     Evas can do a plethora of operations.
253 @li @ref Evas_Object_Text, to learn how to create textual elements on
254     the canvas.
255 @li @ref Evas_Object_Textblock, to learn how to create multiline
256     textual elements on the canvas.
257 @li @ref Evas_Smart_Object_Group and @ref Evas_Smart_Group, to define
258     new objects that provide @b custom functions to handle clipping,
259     hiding, moving, resizing, color setting and more. These could
260     be as simple as a group of objects that move together (see @ref
261     Evas_Smart_Object_Clipped) up to implementations of what
262     ends to be a widget, providing some intelligence (thus the name)
263     to Evas objects -- like a button or check box, for example.
264
265 @section intro_example Introductory Example
266
267 @include evas-buffer-simple.c
268 */
269
270 /**
271 @page authors Authors
272 @author Carsten Haitzler <raster@@rasterman.com>
273 @author Till Adam <till@@adam-lilienthal.de>
274 @author Steve Ireland <sireland@@pobox.com>
275 @author Brett Nash <nash@@nash.id.au>
276 @author Tilman Sauerbeck <tilman@@code-monkey.de>
277 @author Corey Donohoe <atmos@@atmos.org>
278 @author Yuri Hudobin <glassy_ape@@users.sourceforge.net>
279 @author Nathan Ingersoll <ningerso@@d.umn.edu>
280 @author Willem Monsuwe <willem@@stack.nl>
281 @author Jose O Gonzalez <jose_ogp@@juno.com>
282 @author Bernhard Nemec <Bernhard.Nemec@@viasyshc.com>
283 @author Jorge Luis Zapata Muga <jorgeluis.zapata@@gmail.com>
284 @author Cedric Bail <cedric.bail@@free.fr>
285 @author Gustavo Sverzut Barbieri <barbieri@@profusion.mobi>
286 @author Vincent Torri <vtorri@@univ-evry.fr>
287 @author Tim Horton <hortont424@@gmail.com>
288 @author Tom Hacohen <tom@@stosb.com>
289 @author Mathieu Taillefumier <mathieu.taillefumier@@free.fr>
290 @author Iván Briano <ivan@@profusion.mobi>
291 @author Gustavo Lima Chaves <glima@@profusion.mobi>
292 @author Samsung Electronics <tbd>
293 @author Samsung SAIT <tbd>
294 @author Sung W. Park <sungwoo@@gmail.com>
295 @author Jiyoun Park <jy0703.park@@samsung.com>
296 @author Myoungwoon Roy Kim(roy_kim) <myoungwoon.kim@@samsung.com> <myoungwoon@@gmail.com>
297 @author Thierry el Borgi <thierry@@substantiel.fr>
298 @author ChunEon Park <hermet@@hermet.pe.kr>
299 @author Christopher 'devilhorns' Michael <cpmichael1@comcast.net>
300 @author Seungsoo Woo <om101.woo@samsung.com>
301
302 Please contact <enlightenment-devel@lists.sourceforge.net> to get in
303 contact with the developers and maintainers.
304 */
305
306 #ifndef _EVAS_H
307 #define _EVAS_H
308
309 #include <time.h>
310
311 #include <Eina.h>
312
313 #ifdef EAPI
314 # undef EAPI
315 #endif
316
317 #ifdef _WIN32
318 # ifdef EFL_EVAS_BUILD
319 #  ifdef DLL_EXPORT
320 #   define EAPI __declspec(dllexport)
321 #  else
322 #   define EAPI
323 #  endif /* ! DLL_EXPORT */
324 # else
325 #  define EAPI __declspec(dllimport)
326 # endif /* ! EFL_EVAS_BUILD */
327 #else
328 # ifdef __GNUC__
329 #  if __GNUC__ >= 4
330 #   define EAPI __attribute__ ((visibility("default")))
331 #  else
332 #   define EAPI
333 #  endif
334 # else
335 #  define EAPI
336 # endif
337 #endif /* ! _WIN32 */
338
339 #ifdef __cplusplus
340 extern "C" {
341 #endif
342
343 #define EVAS_VERSION_MAJOR 1
344 #define EVAS_VERSION_MINOR 0
345
346 typedef struct _Evas_Version
347 {
348    int major;
349    int minor;
350    int micro;
351    int revision;
352 } Evas_Version;
353
354 EAPI extern Evas_Version *evas_version;
355
356 /**
357  * @file
358  * @brief These routines are used for Evas library interaction.
359  *
360  * @todo check boolean return values and convert to Eina_Bool
361  * @todo change all api to use EINA_SAFETY_*
362  * @todo finish api documentation
363  */
364
365 /* BiDi exposed stuff */
366    /*FIXME: document */
367 typedef enum _Evas_BiDi_Direction
368 {
369    EVAS_BIDI_DIRECTION_NATURAL,
370    EVAS_BIDI_DIRECTION_NEUTRAL = EVAS_BIDI_DIRECTION_NATURAL,
371    EVAS_BIDI_DIRECTION_LTR,
372    EVAS_BIDI_DIRECTION_RTL
373 } Evas_BiDi_Direction;
374
375 /**
376  * Identifier of callbacks to be set for Evas canvases or Evas
377  * objects.
378  *
379  * The following figure illustrates some Evas callbacks:
380  *
381  * @image html evas-callbacks.png
382  * @image rtf evas-callbacks.png
383  * @image latex evas-callbacks.eps
384  *
385  * @see evas_object_event_callback_add()
386  * @see evas_event_callback_add()
387  */
388 typedef enum _Evas_Callback_Type
389 {
390    /*
391     * The following events are only for use with Evas objects, with
392     * evas_object_event_callback_add():
393     */
394    EVAS_CALLBACK_MOUSE_IN, /**< Mouse In Event */
395    EVAS_CALLBACK_MOUSE_OUT, /**< Mouse Out Event */
396    EVAS_CALLBACK_MOUSE_DOWN, /**< Mouse Button Down Event */
397    EVAS_CALLBACK_MOUSE_UP, /**< Mouse Button Up Event */
398    EVAS_CALLBACK_MOUSE_MOVE, /**< Mouse Move Event */
399    EVAS_CALLBACK_MOUSE_WHEEL, /**< Mouse Wheel Event */
400    EVAS_CALLBACK_MULTI_DOWN, /**< Multi-touch Down Event */
401    EVAS_CALLBACK_MULTI_UP, /**< Multi-touch Up Event */
402    EVAS_CALLBACK_MULTI_MOVE, /**< Multi-touch Move Event */
403    EVAS_CALLBACK_FREE, /**< Object Being Freed (Called after Del) */
404    EVAS_CALLBACK_KEY_DOWN, /**< Key Press Event */
405    EVAS_CALLBACK_KEY_UP, /**< Key Release Event */
406    EVAS_CALLBACK_FOCUS_IN, /**< Focus In Event */
407    EVAS_CALLBACK_FOCUS_OUT, /**< Focus Out Event */
408    EVAS_CALLBACK_SHOW, /**< Show Event */
409    EVAS_CALLBACK_HIDE, /**< Hide Event */
410    EVAS_CALLBACK_MOVE, /**< Move Event */
411    EVAS_CALLBACK_RESIZE, /**< Resize Event */
412    EVAS_CALLBACK_RESTACK, /**< Restack Event */
413    EVAS_CALLBACK_DEL, /**< Object Being Deleted (called before Free) */
414    EVAS_CALLBACK_HOLD, /**< Events go on/off hold */
415    EVAS_CALLBACK_CHANGED_SIZE_HINTS, /**< Size hints changed event */
416    EVAS_CALLBACK_IMAGE_PRELOADED, /**< Image has been preloaded */
417
418    /*
419     * The following events are only for use with Evas canvases, with
420     * evas_event_callback_add():
421     */
422    EVAS_CALLBACK_CANVAS_FOCUS_IN, /**< Canvas got focus as a whole */
423    EVAS_CALLBACK_CANVAS_FOCUS_OUT, /**< Canvas lost focus as a whole */
424    EVAS_CALLBACK_RENDER_FLUSH_PRE, /**< Called just before rendering is updated on the canvas target */
425    EVAS_CALLBACK_RENDER_FLUSH_POST, /**< Called just after rendering is updated on the canvas target */
426    EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_IN, /**< Canvas object got focus */
427    EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_OUT, /**< Canvas object lost focus */
428
429    /*
430     * More Evas object event types - see evas_object_event_callback_add():
431     */
432    EVAS_CALLBACK_IMAGE_UNLOADED, /**< Image data has been unloaded (by some mechanims in Evas that throw out original image data) */
433    EVAS_CALLBACK_TOUCH, /**< Touch Event */
434
435    EVAS_CALLBACK_LAST /**< kept as last element/sentinel -- not really an event */
436 } Evas_Callback_Type; /**< The types of events triggering a callback */
437
438 /**
439  * @def EVAS_CALLBACK_PRIORITY_BEFORE
440  * Slightly more prioritized than default.
441  * @since 1.1.0
442  */
443 #define EVAS_CALLBACK_PRIORITY_BEFORE -100
444 /**
445  * @def EVAS_CALLBACK_PRIORITY_DEFAULT
446  * Default callback priority level
447  * @since 1.1.0
448  */
449 #define EVAS_CALLBACK_PRIORITY_DEFAULT 0
450 /**
451  * @def EVAS_CALLBACK_PRIORITY_AFTER
452  * Slightly less prioritized than default.
453  * @since 1.1.0
454  */
455 #define EVAS_CALLBACK_PRIORITY_AFTER 100
456
457 /**
458  * @typedef Evas_Callback_Priority
459  *
460  * Callback priority value. Range is -32k - 32k. The lower the number, the
461  * bigger the priority.
462  *
463  * @see EVAS_CALLBACK_PRIORITY_AFTER
464  * @see EVAS_CALLBACK_PRIORITY_BEFORE
465  * @see EVAS_CALLBACK_PRIORITY_DEFAULT
466  *
467  * @since 1.1.0
468  */
469 typedef short Evas_Callback_Priority;
470
471 /**
472  * Flags for Mouse Button events
473  */
474 typedef enum _Evas_Button_Flags
475 {
476    EVAS_BUTTON_NONE = 0, /**< No extra mouse button data */
477    EVAS_BUTTON_DOUBLE_CLICK = (1 << 0), /**< This mouse button press was the 2nd press of a double click */
478    EVAS_BUTTON_TRIPLE_CLICK = (1 << 1) /**< This mouse button press was the 3rd press of a triple click */
479 } Evas_Button_Flags; /**< Flags for Mouse Button events */
480
481 /**
482  * Flags for Events
483  */
484 typedef enum _Evas_Event_Flags
485 {
486    EVAS_EVENT_FLAG_NONE = 0, /**< No fancy flags set */
487    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 */
488    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 */
489 } Evas_Event_Flags; /**< Flags for Events */
490
491 /**
492  * State of Evas_Coord_Touch_Point
493  */
494 typedef enum _Evas_Touch_Point_State
495 {
496    EVAS_TOUCH_POINT_DOWN, /**< Touch point is pressed down */
497    EVAS_TOUCH_POINT_UP, /**< Touch point is released */
498    EVAS_TOUCH_POINT_MOVE, /**< Touch point is moved */
499    EVAS_TOUCH_POINT_STILL, /**< Touch point is not moved after pressed */
500    EVAS_TOUCH_POINT_CANCEL /**< Touch point is calcelled */
501 } Evas_Touch_Point_State;
502
503 /**
504  * Types for Evas_Touch_Event
505  */
506 typedef enum _Evas_Event_Touch_Type
507 {
508    EVAS_EVENT_TOUCH_BEGIN, /**< Begin touch event with pressed new touch point */
509    EVAS_EVENT_TOUCH_END, /**< End touch event with released touch point */
510    EVAS_EVENT_TOUCH_MOVE, /**< Any touch point in the touch_points list is moved */
511    EVAS_EVENT_TOUCH_CANCEL /**< Touch event is cancelled */
512 } Evas_Event_Touch_Type;
513
514 /**
515  * Flags for Font Hinting
516  * @ingroup Evas_Font_Group
517  */
518 typedef enum _Evas_Font_Hinting_Flags
519 {
520    EVAS_FONT_HINTING_NONE, /**< No font hinting */
521    EVAS_FONT_HINTING_AUTO, /**< Automatic font hinting */
522    EVAS_FONT_HINTING_BYTECODE /**< Bytecode font hinting */
523 } Evas_Font_Hinting_Flags; /**< Flags for Font Hinting */
524
525 /**
526  * Colorspaces for pixel data supported by Evas
527  * @ingroup Evas_Object_Image
528  */
529 typedef enum _Evas_Colorspace
530 {
531    EVAS_COLORSPACE_ARGB8888, /**< ARGB 32 bits per pixel, high-byte is Alpha, accessed 1 32bit word at a time */
532      /* these are not currently supported - but planned for the future */
533    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 */
534    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 */
535    EVAS_COLORSPACE_RGB565_A5P, /**< 16bit rgb565 + Alpha plane at end - 5 bits of the 8 being used per alpha byte */
536    EVAS_COLORSPACE_GRY8, /**< 8bit grayscale */
537    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 */
538    EVAS_COLORSPACE_YCBCR420NV12601_PL, /**< YCbCr 4:2:0, ITU.BT-601 specification. The data pointed to is just an array of row pointer, pointing to the Y rows, then the Cb,Cr rows. */
539    EVAS_COLORSPACE_YCBCR420TM12601_PL, /**< YCbCr 4:2:0, ITU.BT-601 specification. The data pointed to is just an array of tiled row pointer, pointing to the Y rows, then the Cb,Cr rows. */
540 } Evas_Colorspace; /**< Colorspaces for pixel data supported by Evas */
541
542 /**
543  * How to pack items into cells in a table.
544  * @ingroup Evas_Object_Table
545  *
546  * @see evas_object_table_homogeneous_set() for an explanation of the funcion of
547  * each one.
548  */
549 typedef enum _Evas_Object_Table_Homogeneous_Mode
550 {
551   EVAS_OBJECT_TABLE_HOMOGENEOUS_NONE = 0,
552   EVAS_OBJECT_TABLE_HOMOGENEOUS_TABLE = 1,
553   EVAS_OBJECT_TABLE_HOMOGENEOUS_ITEM = 2
554 } Evas_Object_Table_Homogeneous_Mode; /**< Table cell pack mode. */
555
556 typedef struct _Evas_Coord_Rectangle  Evas_Coord_Rectangle; /**< A generic rectangle handle */
557 typedef struct _Evas_Point                   Evas_Point; /**< integer point */
558
559 typedef struct _Evas_Coord_Point             Evas_Coord_Point;  /**< Evas_Coord point */
560 typedef struct _Evas_Coord_Precision_Point   Evas_Coord_Precision_Point; /**< Evas_Coord point with sub-pixel precision */
561 typedef struct _Evas_Coord_Touch_Point       Evas_Coord_Touch_Point; /**< Evas_Coord point with touch type and id */
562
563 typedef struct _Evas_Position                Evas_Position; /**< associates given point in Canvas and Output */
564 typedef struct _Evas_Precision_Position      Evas_Precision_Position; /**< associates given point in Canvas and Output, with sub-pixel precision */
565
566 /**
567  * @typedef Evas_Smart_Class
568  *
569  * A smart object's @b base class definition
570  *
571  * @ingroup Evas_Smart_Group
572  */
573 typedef struct _Evas_Smart_Class             Evas_Smart_Class;
574
575 /**
576  * @typedef Evas_Smart_Cb_Description
577  *
578  * A smart object callback description, used to provide introspection
579  *
580  * @ingroup Evas_Smart_Group
581  */
582 typedef struct _Evas_Smart_Cb_Description    Evas_Smart_Cb_Description;
583
584 /**
585  * @typedef Evas_Map
586  *
587  * An opaque handle to map points
588  *
589  * @see evas_map_new()
590  * @see evas_map_free()
591  * @see evas_map_dup()
592  *
593  * @ingroup Evas_Object_Group_Map
594  */
595 typedef struct _Evas_Map            Evas_Map;
596
597 /**
598  * @typedef Evas
599  *
600  * An opaque handle to an Evas canvas.
601  *
602  * @see evas_new()
603  * @see evas_free()
604  *
605  * @ingroup Evas_Canvas
606  */
607 typedef struct _Evas                Evas;
608
609 /**
610  * @typedef Evas_Object
611  * An Evas Object handle.
612  * @ingroup Evas_Object_Group
613  */
614 typedef struct _Evas_Object         Evas_Object;
615
616 typedef void                        Evas_Performance; /**< An Evas Performance handle */
617 typedef struct _Evas_Modifier       Evas_Modifier; /**< An opaque type containing information on which modifier keys are registered in an Evas canvas */
618 typedef struct _Evas_Lock           Evas_Lock; /**< An opaque type containing information on which lock keys are registered in an Evas canvas */
619 typedef struct _Evas_Smart          Evas_Smart; /**< An Evas Smart Object handle */
620 typedef struct _Evas_Native_Surface Evas_Native_Surface; /**< A generic datatype for engine specific native surface information */
621
622  /**
623   * @typedef Evas_Video_Surface
624   *
625   * A generic datatype for video specific surface information
626   * @see evas_object_image_video_surface_set
627   * @see evas_object_image_video_surface_get
628   * @since 1.1.0
629   */
630 typedef struct _Evas_Video_Surface  Evas_Video_Surface;
631
632 typedef unsigned long long          Evas_Modifier_Mask; /**< An Evas modifier mask type */
633
634 typedef int                         Evas_Coord;
635 typedef int                         Evas_Font_Size;
636 typedef int                         Evas_Angle;
637
638 struct _Evas_Coord_Rectangle /**< A rectangle in Evas_Coord */
639 {
640    Evas_Coord x; /**< top-left x co-ordinate of rectangle */
641    Evas_Coord y; /**< top-left y co-ordinate of rectangle */
642    Evas_Coord w; /**< width of rectangle */
643    Evas_Coord h; /**< height of rectangle */
644 };
645
646 struct _Evas_Point
647 {
648    int x, y;
649 };
650
651 struct _Evas_Coord_Point
652 {
653    Evas_Coord x, y;
654 };
655
656 struct _Evas_Coord_Precision_Point
657 {
658    Evas_Coord x, y;
659    double xsub, ysub;
660 };
661
662 struct _Evas_Coord_Touch_Point
663 {
664    Evas_Coord x, y;
665    int id; /**< id in order to distinguish each point */
666    Evas_Touch_Point_State state;
667 };
668
669 struct _Evas_Position
670 {
671     Evas_Point output;
672     Evas_Coord_Point canvas;
673 };
674
675 struct _Evas_Precision_Position
676 {
677     Evas_Point output;
678     Evas_Coord_Precision_Point canvas;
679 };
680
681 typedef enum _Evas_Aspect_Control
682 {
683    EVAS_ASPECT_CONTROL_NONE = 0, /**< Preference on scaling unset */
684    EVAS_ASPECT_CONTROL_NEITHER = 1, /**< Same effect as unset preference on scaling */
685    EVAS_ASPECT_CONTROL_HORIZONTAL = 2, /**< Use all horizontal container space to place an object, using the given aspect */
686    EVAS_ASPECT_CONTROL_VERTICAL = 3, /**< Use all vertical container space to place an object, using the given aspect */
687    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 */
688 } Evas_Aspect_Control; /**< Aspect types/policies for scaling size hints, used for evas_object_size_hint_aspect_set() */
689
690 typedef struct _Evas_Pixel_Import_Source Evas_Pixel_Import_Source; /**< A source description of pixels for importing pixels */
691 typedef struct _Evas_Engine_Info      Evas_Engine_Info; /**< A generic Evas Engine information structure */
692 typedef struct _Evas_Device           Evas_Device; /**< A source device handle - where the event came from */
693 typedef struct _Evas_Event_Mouse_Down Evas_Event_Mouse_Down; /**< Event structure for #EVAS_CALLBACK_MOUSE_DOWN event callbacks */
694 typedef struct _Evas_Event_Mouse_Up   Evas_Event_Mouse_Up; /**< Event structure for #EVAS_CALLBACK_MOUSE_UP event callbacks */
695 typedef struct _Evas_Event_Mouse_In   Evas_Event_Mouse_In; /**< Event structure for #EVAS_CALLBACK_MOUSE_IN event callbacks */
696 typedef struct _Evas_Event_Mouse_Out  Evas_Event_Mouse_Out; /**< Event structure for #EVAS_CALLBACK_MOUSE_OUT event callbacks */
697 typedef struct _Evas_Event_Mouse_Move Evas_Event_Mouse_Move; /**< Event structure for #EVAS_CALLBACK_MOUSE_MOVE event callbacks */
698 typedef struct _Evas_Event_Mouse_Wheel Evas_Event_Mouse_Wheel; /**< Event structure for #EVAS_CALLBACK_MOUSE_WHEEL event callbacks */
699 typedef struct _Evas_Event_Multi_Down Evas_Event_Multi_Down; /**< Event structure for #EVAS_CALLBACK_MULTI_DOWN event callbacks */
700 typedef struct _Evas_Event_Multi_Up   Evas_Event_Multi_Up; /**< Event structure for #EVAS_CALLBACK_MULTI_UP event callbacks */
701 typedef struct _Evas_Event_Multi_Move Evas_Event_Multi_Move; /**< Event structure for #EVAS_CALLBACK_MULTI_MOVE event callbacks */
702 typedef struct _Evas_Event_Key_Down   Evas_Event_Key_Down; /**< Event structure for #EVAS_CALLBACK_KEY_DOWN event callbacks */
703 typedef struct _Evas_Event_Key_Up     Evas_Event_Key_Up; /**< Event structure for #EVAS_CALLBACK_KEY_UP event callbacks */
704 typedef struct _Evas_Event_Hold       Evas_Event_Hold; /**< Event structure for #EVAS_CALLBACK_HOLD event callbacks */
705 typedef struct _Evas_Event_Touch      Evas_Event_Touch; /**< Event structure for #EVAS_CALLBACK_TOUCH event callbacks */
706
707 typedef enum _Evas_Load_Error
708 {
709    EVAS_LOAD_ERROR_NONE = 0, /**< No error on load */
710    EVAS_LOAD_ERROR_GENERIC = 1, /**< A non-specific error occurred */
711    EVAS_LOAD_ERROR_DOES_NOT_EXIST = 2, /**< File (or file path) does not exist */
712    EVAS_LOAD_ERROR_PERMISSION_DENIED = 3, /**< Permission deinied to an existing file (or path) */
713    EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED = 4, /**< Allocation of resources failure prevented load */
714    EVAS_LOAD_ERROR_CORRUPT_FILE = 5, /**< File corrupt (but was detected as a known format) */
715    EVAS_LOAD_ERROR_UNKNOWN_FORMAT = 6 /**< File is not a known format */
716 } Evas_Load_Error; /**< Evas image load error codes one can get - see evas_load_error_str() too. */
717
718
719 typedef enum _Evas_Alloc_Error
720 {
721    EVAS_ALLOC_ERROR_NONE = 0, /**< No allocation error */
722    EVAS_ALLOC_ERROR_FATAL = 1, /**< Allocation failed despite attempts to free up memory */
723    EVAS_ALLOC_ERROR_RECOVERED = 2 /**< Allocation succeeded, but extra memory had to be found by freeing up speculative resources */
724 } Evas_Alloc_Error; /**< Possible allocation errors returned by evas_alloc_error() */
725
726 typedef enum _Evas_Fill_Spread
727 {
728    EVAS_TEXTURE_REFLECT = 0, /**< image fill tiling mode - tiling reflects */
729    EVAS_TEXTURE_REPEAT = 1, /**< tiling repeats */
730    EVAS_TEXTURE_RESTRICT = 2, /**< tiling clamps - range offset ignored */
731    EVAS_TEXTURE_RESTRICT_REFLECT = 3, /**< tiling clamps and any range offset reflects */
732    EVAS_TEXTURE_RESTRICT_REPEAT = 4, /**< tiling clamps and any range offset repeats */
733    EVAS_TEXTURE_PAD = 5 /**< tiling extends with end values */
734 } Evas_Fill_Spread; /**< Fill types used for evas_object_image_fill_spread_set() */
735
736 typedef enum _Evas_Pixel_Import_Pixel_Format
737 {
738    EVAS_PIXEL_FORMAT_NONE = 0, /**< No pixel format */
739    EVAS_PIXEL_FORMAT_ARGB32 = 1, /**< ARGB 32bit pixel format with A in the high byte per 32bit pixel word */
740    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 */
741 } Evas_Pixel_Import_Pixel_Format; /**< Pixel format for import call. See evas_object_image_pixels_import() */
742
743 struct _Evas_Pixel_Import_Source
744 {
745    Evas_Pixel_Import_Pixel_Format format; /**< pixel format type ie ARGB32, YUV420P_601 etc. */
746    int w, h; /**< width and height of source in pixels */
747    void **rows; /**< an array of pointers (size depends on format) pointing to left edge of each scanline */
748 };
749
750 /* magic version number to know what the native surf struct looks like */
751 #define EVAS_NATIVE_SURFACE_VERSION 2
752
753 typedef enum _Evas_Native_Surface_Type
754 {
755    EVAS_NATIVE_SURFACE_NONE,
756    EVAS_NATIVE_SURFACE_X11,
757    EVAS_NATIVE_SURFACE_OPENGL
758 } Evas_Native_Surface_Type;
759
760 struct _Evas_Native_Surface
761 {
762    int                         version;
763    Evas_Native_Surface_Type    type;
764    union {
765      struct {
766        void          *visual; /**< visual of the pixmap to use (Visual) */
767        unsigned long  pixmap; /**< pixmap id to use (Pixmap) */
768      } x11;
769      struct {
770        unsigned int   texture_id; /**< opengl texture id to use from glGenTextures() */
771        unsigned int   framebuffer_id; /**< 0 if not a FBO, FBO id otherwise from glGenFramebuffers() */
772        unsigned int   internal_format; /**< same as 'internalFormat' for glTexImage2D() */
773        unsigned int   format; /**< same as 'format' for glTexImage2D() */
774        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) */
775      } opengl;
776    } data;
777 };
778
779 /**
780  * @def EVAS_VIDEO_SURFACE_VERSION
781  * Magic version number to know what the video surf struct looks like
782  * @since 1.1.0
783  */
784 #define EVAS_VIDEO_SURFACE_VERSION 1
785
786 typedef void (*Evas_Video_Cb)(void *data, Evas_Object *obj, const Evas_Video_Surface *surface);
787 typedef void (*Evas_Video_Coord_Cb)(void *data, Evas_Object *obj, const Evas_Video_Surface *surface, Evas_Coord a, Evas_Coord b);
788
789 struct _Evas_Video_Surface
790 {
791    int version;
792
793    Evas_Video_Coord_Cb move; /**< Move the video surface to this position */
794    Evas_Video_Coord_Cb resize; /**< Resize the video surface to that size */
795    Evas_Video_Cb show; /**< Show the video overlay surface */
796    Evas_Video_Cb hide; /**< Hide the video overlay surface */
797    Evas_Video_Cb update_pixels; /**< Please update the Evas_Object_Image pixels when called */
798
799    Evas_Object   *parent;
800    void          *data;
801 };
802
803 #define EVAS_LAYER_MIN -32768 /**< bottom-most layer number */
804 #define EVAS_LAYER_MAX 32767  /**< top-most layer number */
805
806 #define EVAS_COLOR_SPACE_ARGB 0 /**< Not used for anything */
807 #define EVAS_COLOR_SPACE_AHSV 1 /**< Not used for anything */
808 #define EVAS_TEXT_INVALID -1 /**< Not used for anything */
809 #define EVAS_TEXT_SPECIAL -2 /**< Not used for anything */
810
811 #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() */
812 #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() */
813 #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) */
814 #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) */
815 #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 */
816 #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 */
817
818 /**
819  * How the object should be rendered to output.
820  * @ingroup Evas_Object_Group_Extras
821  */
822 typedef enum _Evas_Render_Op
823 {
824    EVAS_RENDER_BLEND = 0, /**< default op: d = d*(1-sa) + s */
825    EVAS_RENDER_BLEND_REL = 1, /**< d = d*(1 - sa) + s*da */
826    EVAS_RENDER_COPY = 2, /**< d = s */
827    EVAS_RENDER_COPY_REL = 3, /**< d = s*da */
828    EVAS_RENDER_ADD = 4, /**< d = d + s */
829    EVAS_RENDER_ADD_REL = 5, /**< d = d + s*da */
830    EVAS_RENDER_SUB = 6, /**< d = d - s */
831    EVAS_RENDER_SUB_REL = 7, /**< d = d - s*da */
832    EVAS_RENDER_TINT = 8, /**< d = d*s + d*(1 - sa) + s*(1 - da) */
833    EVAS_RENDER_TINT_REL = 9, /**< d = d*(1 - sa + s) */
834    EVAS_RENDER_MASK = 10, /**< d = d*sa */
835    EVAS_RENDER_MUL = 11 /**< d = d*s */
836 } Evas_Render_Op; /**< How the object should be rendered to output. */
837
838 typedef enum _Evas_Border_Fill_Mode
839 {
840    EVAS_BORDER_FILL_NONE = 0, /**< Image's center region is @b not to be rendered */
841    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 */
842    EVAS_BORDER_FILL_SOLID = 2 /**< Image's center region is to be made solid, even if it has transparency on it */
843 } Evas_Border_Fill_Mode; /**< How an image's center region (the complement to the border region) should be rendered by Evas */
844
845 typedef enum _Evas_Image_Scale_Hint
846 {
847    EVAS_IMAGE_SCALE_HINT_NONE = 0, /**< No scale hint at all */
848    EVAS_IMAGE_SCALE_HINT_DYNAMIC = 1, /**< Image is being re-scaled over time, thus turning scaling cache @b off for its data */
849    EVAS_IMAGE_SCALE_HINT_STATIC = 2 /**< Image is not being re-scaled over time, thus turning scaling cache @b on for its data */
850 } Evas_Image_Scale_Hint; /**< How an image's data is to be treated by Evas, with regard to scaling cache */
851
852 typedef enum _Evas_Image_Animated_Loop_Hint
853 {
854    EVAS_IMAGE_ANIMATED_HINT_NONE = 0,
855    EVAS_IMAGE_ANIMATED_HINT_LOOP = 1, /**< Image's animation mode is loop like 1->2->3->1->2->3 */
856    EVAS_IMAGE_ANIMATED_HINT_PINGPONG = 2 /**< Image's animation mode is pingpong like 1->2->3->2->1-> ... */
857 } Evas_Image_Animated_Loop_Hint;
858
859 typedef enum _Evas_Engine_Render_Mode
860 {
861    EVAS_RENDER_MODE_BLOCKING = 0,
862    EVAS_RENDER_MODE_NONBLOCKING = 1,
863 } Evas_Engine_Render_Mode;
864
865 typedef enum _Evas_Image_Content_Hint
866 {
867    EVAS_IMAGE_CONTENT_HINT_NONE = 0, /**< No hint at all */
868    EVAS_IMAGE_CONTENT_HINT_DYNAMIC = 1, /**< The contents will change over time */
869    EVAS_IMAGE_CONTENT_HINT_STATIC = 2 /**< The contents won't change over time */
870 } Evas_Image_Content_Hint; /**< How an image's data is to be treated by Evas, for optimization */
871
872 struct _Evas_Engine_Info /** Generic engine information. Generic info is useless */
873 {
874    int magic; /**< Magic number */
875 };
876
877 struct _Evas_Event_Mouse_Down /** Mouse button press event */
878 {
879    int button; /**< Mouse button number that went down (1 - 32) */
880
881    Evas_Point output; /**< The X/Y location of the cursor */
882    Evas_Coord_Point canvas; /**< The X/Y location of the cursor */
883
884    void          *data;
885    Evas_Modifier *modifiers; /**< modifier keys pressed during the event */
886    Evas_Lock     *locks;
887
888    Evas_Button_Flags flags; /**< button flags set during the event */
889    unsigned int      timestamp;
890    Evas_Event_Flags  event_flags;
891    Evas_Device      *dev;
892 };
893
894 struct _Evas_Event_Mouse_Up /** Mouse button release event */
895 {
896    int button; /**< Mouse button number that was raised (1 - 32) */
897
898    Evas_Point output;
899    Evas_Coord_Point canvas;
900
901    void          *data;
902    Evas_Modifier *modifiers;
903    Evas_Lock     *locks;
904
905    Evas_Button_Flags flags;
906    unsigned int      timestamp;
907    Evas_Event_Flags  event_flags;
908    Evas_Device      *dev;
909 };
910
911 struct _Evas_Event_Mouse_In /** Mouse enter event */
912 {
913    int buttons; /**< Button pressed mask, Bits set to 1 are buttons currently pressed (bit 0 = mouse button 1, bit 1 = mouse button 2 etc.) */
914
915    Evas_Point output;
916    Evas_Coord_Point canvas;
917
918    void          *data;
919    Evas_Modifier *modifiers;
920    Evas_Lock     *locks;
921    unsigned int   timestamp;
922    Evas_Event_Flags  event_flags;
923    Evas_Device      *dev;
924 };
925
926 struct _Evas_Event_Mouse_Out /** Mouse leave event */
927 {
928    int buttons; /**< Button pressed mask, Bits set to 1 are buttons currently pressed (bit 0 = mouse button 1, bit 1 = mouse button 2 etc.) */
929
930
931    Evas_Point output;
932    Evas_Coord_Point canvas;
933
934    void          *data;
935    Evas_Modifier *modifiers;
936    Evas_Lock     *locks;
937    unsigned int   timestamp;
938    Evas_Event_Flags  event_flags;
939    Evas_Device      *dev;
940 };
941
942 struct _Evas_Event_Mouse_Move /** Mouse button down event */
943 {
944    int buttons; /**< Button pressed mask, Bits set to 1 are buttons currently pressed (bit 0 = mouse button 1, bit 1 = mouse button 2 etc.) */
945
946    Evas_Position cur, prev;
947
948    void          *data;
949    Evas_Modifier *modifiers;
950    Evas_Lock     *locks;
951    unsigned int   timestamp;
952    Evas_Event_Flags  event_flags;
953    Evas_Device      *dev;
954 };
955
956 struct _Evas_Event_Mouse_Wheel /** Wheel event */
957 {
958    int direction; /* 0 = default up/down wheel FIXME: more wheel types */
959    int z; /* ...,-2,-1 = down, 1,2,... = up */
960
961    Evas_Point output;
962    Evas_Coord_Point canvas;
963
964    void          *data;
965    Evas_Modifier *modifiers;
966    Evas_Lock     *locks;
967    unsigned int   timestamp;
968    Evas_Event_Flags  event_flags;
969    Evas_Device      *dev;
970 };
971
972 struct _Evas_Event_Multi_Down /** Multi button press event */
973 {
974    int device; /**< Multi device number that went down (1 or more for extra touches) */
975    double radius, radius_x, radius_y;
976    double pressure, angle;
977
978    Evas_Point output;
979    Evas_Coord_Precision_Point canvas;
980
981    void          *data;
982    Evas_Modifier *modifiers;
983    Evas_Lock     *locks;
984
985    Evas_Button_Flags flags;
986    unsigned int      timestamp;
987    Evas_Event_Flags  event_flags;
988    Evas_Device      *dev;
989 };
990
991 struct _Evas_Event_Multi_Up /** Multi button release event */
992 {
993    int device; /**< Multi device number that went up (1 or more for extra touches) */
994    double radius, radius_x, radius_y;
995    double pressure, angle;
996
997    Evas_Point output;
998    Evas_Coord_Precision_Point canvas;
999
1000    void          *data;
1001    Evas_Modifier *modifiers;
1002    Evas_Lock     *locks;
1003
1004    Evas_Button_Flags flags;
1005    unsigned int      timestamp;
1006    Evas_Event_Flags  event_flags;
1007    Evas_Device      *dev;
1008 };
1009
1010 struct _Evas_Event_Multi_Move /** Multi button down event */
1011 {
1012    int device; /**< Multi device number that moved (1 or more for extra touches) */
1013    double radius, radius_x, radius_y;
1014    double pressure, angle;
1015
1016    Evas_Precision_Position cur;
1017
1018    void          *data;
1019    Evas_Modifier *modifiers;
1020    Evas_Lock     *locks;
1021    unsigned int   timestamp;
1022    Evas_Event_Flags  event_flags;
1023    Evas_Device      *dev;
1024 };
1025
1026 struct _Evas_Event_Key_Down /** Key press event */
1027 {
1028    char          *keyname; /**< the name string of the key pressed */
1029    void          *data;
1030    Evas_Modifier *modifiers;
1031    Evas_Lock     *locks;
1032
1033    const char    *key; /**< The logical key : (eg shift+1 == exclamation) */
1034    const char    *string; /**< A UTF8 string if this keystroke has produced a visible string to be ADDED */
1035    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 */
1036    unsigned int   timestamp;
1037    Evas_Event_Flags  event_flags;
1038    Evas_Device      *dev;
1039 };
1040
1041 struct _Evas_Event_Key_Up /** Key release event */
1042 {
1043    char          *keyname; /**< the name string of the key released */
1044    void          *data;
1045    Evas_Modifier *modifiers;
1046    Evas_Lock     *locks;
1047
1048    const char    *key; /**< The logical key : (eg shift+1 == exclamation) */
1049    const char    *string; /**< A UTF8 string if this keystroke has produced a visible string to be ADDED */
1050    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 */
1051    unsigned int   timestamp;
1052    Evas_Event_Flags  event_flags;
1053    Evas_Device      *dev;
1054 };
1055
1056 struct _Evas_Event_Hold /** Hold change event */
1057 {
1058    int            hold; /**< The hold flag */
1059    void          *data;
1060
1061    unsigned int   timestamp;
1062    Evas_Event_Flags  event_flags;
1063    Evas_Device      *dev;
1064 };
1065
1066 struct _Evas_Event_Touch /** Touch event */
1067 {
1068    Eina_List            *points; /**< Evas_Coord_Touch_Point list */
1069    Evas_Modifier        *modifiers;
1070    unsigned int          timestamp;
1071    Evas_Event_Touch_Type type; /**< Type for Evas_Event_Touch */
1072 };
1073
1074 /**
1075  * How the mouse pointer should be handled by Evas.
1076  *
1077  * In the mode #EVAS_OBJECT_POINTER_MODE_AUTOGRAB, when a mouse button
1078  * is pressed down over an object and held, with the mouse pointer
1079  * being moved outside of it, the pointer still behaves as being bound
1080  * to that object, albeit out of its drawing region. When the button
1081  * is released, the event will be fed to the object, that may check if
1082  * the final position is over it or not and do something about it.
1083  *
1084  * In the mode #EVAS_OBJECT_POINTER_MODE_NOGRAB, the pointer will
1085  * always be bound to the object right below it.
1086  *
1087  * @ingroup Evas_Object_Group_Extras
1088  */
1089 typedef enum _Evas_Object_Pointer_Mode
1090 {
1091    EVAS_OBJECT_POINTER_MODE_AUTOGRAB, /**< default, X11-like */
1092    EVAS_OBJECT_POINTER_MODE_NOGRAB /**< pointer always bound to the object right below it */
1093 } Evas_Object_Pointer_Mode; /**< How the mouse pointer should be handled by Evas. */
1094
1095 typedef void      (*Evas_Smart_Cb) (void *data, Evas_Object *obj, void *event_info); /**< Evas smart objects' "smart callback" function signature */
1096 typedef void      (*Evas_Event_Cb) (void *data, Evas *e, void *event_info); /**< Evas event callback function signature */
1097 typedef Eina_Bool (*Evas_Object_Event_Post_Cb) (void *data, Evas *e);
1098 typedef void      (*Evas_Object_Event_Cb) (void *data, Evas *e, Evas_Object *obj, void *event_info); /**< Evas object event callback function signature */
1099 typedef void      (*Evas_Async_Events_Put_Cb)(void *target, Evas_Callback_Type type, void *event_info);
1100
1101 /**
1102  * @defgroup Evas_Group Top Level Functions
1103  *
1104  * Functions that affect Evas as a whole.
1105  */
1106
1107 /**
1108  * Initialize Evas
1109  *
1110  * @return The init counter value.
1111  *
1112  * This function initializes Evas and increments a counter of the
1113  * number of calls to it. It returns the new counter's value.
1114  *
1115  * @see evas_shutdown().
1116  *
1117  * Most EFL users wouldn't be using this function directly, because
1118  * they wouldn't access Evas directly by themselves. Instead, they
1119  * would be using higher level helpers, like @c ecore_evas_init().
1120  * See http://docs.enlightenment.org/auto/ecore/.
1121  *
1122  * You should be using this if your use is something like the
1123  * following. The buffer engine is just one of the many ones Evas
1124  * provides.
1125  *
1126  * @dontinclude evas-buffer-simple.c
1127  * @skip int main
1128  * @until return -1;
1129  * And being the canvas creation something like:
1130  * @skip static Evas *create_canvas
1131  * @until    evas_output_viewport_set(canvas,
1132  *
1133  * Note that this is code creating an Evas canvas with no usage of
1134  * Ecore helpers at all -- no linkage with Ecore on this scenario,
1135  * thus. Again, this wouldn't be on Evas common usage for most
1136  * developers. See the full @ref Example_Evas_Buffer_Simple "example".
1137  *
1138  * @ingroup Evas_Group
1139  */
1140 EAPI int               evas_init                         (void);
1141
1142 /**
1143  * Shutdown Evas
1144  *
1145  * @return Evas' init counter value.
1146  *
1147  * This function finalizes Evas, decrementing the counter of the
1148  * number of calls to the function evas_init(). This new value for the
1149  * counter is returned.
1150  *
1151  * @see evas_init().
1152  *
1153  * If you were the sole user of Evas, by means of evas_init(), you can
1154  * check if it's being properly shut down by expecting a return value
1155  * of 0.
1156  *
1157  * Example code follows.
1158  * @dontinclude evas-buffer-simple.c
1159  * @skip // NOTE: use ecore_evas_buffer_new
1160  * @until evas_shutdown
1161  * Where that function would contain:
1162  * @skip   evas_free(canvas)
1163  * @until   evas_free(canvas)
1164  *
1165  * Most users would be using ecore_evas_shutdown() instead, like told
1166  * in evas_init(). See the full @ref Example_Evas_Buffer_Simple
1167  * "example".
1168  *
1169  * @ingroup Evas_Group
1170  */
1171 EAPI int               evas_shutdown                     (void);
1172
1173
1174 /**
1175  * Return if any allocation errors have occurred during the prior function
1176  * @return The allocation error flag
1177  *
1178  * This function will return if any memory allocation errors occurred during,
1179  * and what kind they were. The return value will be one of
1180  * EVAS_ALLOC_ERROR_NONE, EVAS_ALLOC_ERROR_FATAL or EVAS_ALLOC_ERROR_RECOVERED
1181  * with each meaning something different.
1182  *
1183  * EVAS_ALLOC_ERROR_NONE means that no errors occurred at all and the function
1184  * worked as expected.
1185  *
1186  * EVAS_ALLOC_ERROR_FATAL means the function was completely unable to perform
1187  * its job and will  have  exited as cleanly as possible. The programmer
1188  * should consider this as a sign of very low memory and should try and safely
1189  * recover from the prior functions failure (or try free up memory elsewhere
1190  * and try again after more memory is freed).
1191  *
1192  * EVAS_ALLOC_ERROR_RECOVERED means that an allocation error occurred, but was
1193  * recovered from by evas finding memory of its own it has allocated and
1194  * freeing what it sees as not really usefully allocated memory. What is freed
1195  * may vary. Evas may reduce the resolution of images, free cached images or
1196  * fonts, trhow out pre-rendered data, reduce the complexity of change lists
1197  * etc. Evas and the program will function as per normal after this, but this
1198  * is a sign of low memory, and it is suggested that the program try and
1199  * identify memory it doesn't need, and free it.
1200  *
1201  * Example:
1202  * @code
1203  * extern Evas_Object *object;
1204  * void callback (void *data, Evas *e, Evas_Object *obj, void *event_info);
1205  *
1206  * evas_object_event_callback_add(object, EVAS_CALLBACK_MOUSE_DOWN, callback, NULL);
1207  * if (evas_alloc_error() == EVAS_ALLOC_ERROR_FATAL)
1208  *   {
1209  *     fprintf(stderr, "ERROR: Completely unable to attach callback. Must\n");
1210  *     fprintf(stderr, "       destroy object now as it cannot be used.\n");
1211  *     evas_object_del(object);
1212  *     object = NULL;
1213  *     fprintf(stderr, "WARNING: Memory is really low. Cleaning out RAM.\n");
1214  *     my_memory_cleanup();
1215  *   }
1216  * if (evas_alloc_error() == EVAS_ALLOC_ERROR_RECOVERED)
1217  *   {
1218  *     fprintf(stderr, "WARNING: Memory is really low. Cleaning out RAM.\n");
1219  *     my_memory_cleanup();
1220  *   }
1221  * @endcode
1222  *
1223  * @ingroup Evas_Group
1224  */
1225 EAPI Evas_Alloc_Error  evas_alloc_error                  (void);
1226
1227
1228 /**
1229  * @brief Get evas' internal asynchronous events read file descriptor.
1230  *
1231  * @return The canvas' asynchronous events read file descriptor.
1232  *
1233  * Evas' asynchronous events are meant to be dealt with internally,
1234  * i. e., when building stuff to be glued together into the EFL
1235  * infrastructure -- a module, for example. The context which demands
1236  * its use is when calculations need to be done out of the main
1237  * thread, asynchronously, and some action must be performed after
1238  * that.
1239  *
1240  * An example of actual use of this API is for image asynchronous
1241  * preload inside evas. If the canvas was instantiated through
1242  * ecore-evas usage, ecore itself will take care of calling those
1243  * events' processing.
1244  *
1245  * This function returns the read file descriptor where to get the
1246  * asynchronous events of the canvas. Naturally, other mainloops,
1247  * apart from ecore, may make use of it.
1248  *
1249  * @ingroup Evas_Group
1250  */
1251 EAPI int               evas_async_events_fd_get          (void) EINA_WARN_UNUSED_RESULT EINA_PURE;
1252
1253 /**
1254  * @brief Trigger the processing of all events waiting on the file
1255  * descriptor returned by evas_async_events_fd_get().
1256  *
1257  * @return The number of events processed.
1258  *
1259  * All asynchronous events queued up by evas_async_events_put() are
1260  * processed here. More precisely, the callback functions, informed
1261  * together with other event parameters, when queued, get called (with
1262  * those parameters), in that order.
1263  *
1264  * @ingroup Evas_Group
1265  */
1266 EAPI int               evas_async_events_process         (void);
1267
1268 /**
1269 * Insert asynchronous events on the canvas.
1270  *
1271  * @param target The target to be affected by the events.
1272  * @param type The type of callback function.
1273  * @param event_info Information about the event.
1274  * @param func The callback function pointer.
1275  *
1276  * This is the way, for a routine running outside evas' main thread,
1277  * to report an asynchronous event. A callback function is informed,
1278  * whose call is to happen after evas_async_events_process() is
1279  * called.
1280  *
1281  * @ingroup Evas_Group
1282  */
1283 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);
1284
1285 /**
1286  * @defgroup Evas_Canvas Canvas Functions
1287  *
1288  * Low level Evas canvas functions. Sub groups will present more high
1289  * level ones, though.
1290  *
1291  * Most of these functions deal with low level Evas actions, like:
1292  * @li create/destroy raw canvases, not bound to any displaying engine
1293  * @li tell a canvas i got focused (in a windowing context, for example)
1294  * @li tell a canvas a region should not be calculated anymore in rendering
1295  * @li tell a canvas to render its contents, immediately
1296  *
1297  * Most users will be using Evas by means of the @c Ecore_Evas
1298  * wrapper, which deals with all the above mentioned issues
1299  * automatically for them. Thus, you'll be looking at this section
1300  * only if you're building low level stuff.
1301  *
1302  * The groups within present you functions that deal with the canvas
1303  * directly, too, and not yet with its @b objects. They are the
1304  * functions you need to use at a minimum to get a working canvas.
1305  *
1306  * Some of the funcions in this group are exemplified @ref
1307  * Example_Evas_Events "here".
1308  */
1309
1310 /**
1311  * Creates a new empty evas.
1312  *
1313  * Note that before you can use the evas, you will to at a minimum:
1314  * @li Set its render method with @ref evas_output_method_set .
1315  * @li Set its viewport size with @ref evas_output_viewport_set .
1316  * @li Set its size of the canvas with @ref evas_output_size_set .
1317  * @li Ensure that the render engine is given the correct settings
1318  *     with @ref evas_engine_info_set .
1319  *
1320  * This function should only fail if the memory allocation fails
1321  *
1322  * @note this function is very low level. Instead of using it
1323  *       directly, consider using the high level functions in
1324  *       Ecore_Evas such as @c ecore_evas_new(). See
1325  *       http://docs.enlightenment.org/auto/ecore/.
1326  *
1327  * @attention it is recommended that one calls evas_init() before
1328  *       creating new canvas.
1329  *
1330  * @return A new uninitialised Evas canvas on success.  Otherwise, @c
1331  * NULL.
1332  * @ingroup Evas_Canvas
1333  */
1334 EAPI Evas             *evas_new                          (void) EINA_WARN_UNUSED_RESULT EINA_MALLOC;
1335
1336 /**
1337  * Frees the given evas and any objects created on it.
1338  *
1339  * Any objects with 'free' callbacks will have those callbacks called
1340  * in this function.
1341  *
1342  * @param   e The given evas.
1343  *
1344  * @ingroup Evas_Canvas
1345  */
1346 EAPI void              evas_free                         (Evas *e)  EINA_ARG_NONNULL(1);
1347
1348 /**
1349  * Inform to the evas that it got the focus.
1350  *
1351  * @param e The evas to change information.
1352  * @ingroup Evas_Canvas
1353  */
1354 EAPI void              evas_focus_in                     (Evas *e);
1355
1356 /**
1357  * Inform to the evas that it lost the focus.
1358  *
1359  * @param e The evas to change information.
1360  * @ingroup Evas_Canvas
1361  */
1362 EAPI void              evas_focus_out                    (Evas *e);
1363
1364 /**
1365  * Get the focus state known by the given evas
1366  *
1367  * @param e The evas to query information.
1368  * @ingroup Evas_Canvas
1369  */
1370 EAPI Eina_Bool         evas_focus_state_get              (const Evas *e) EINA_PURE;
1371
1372 /**
1373  * Push the nochange flag up 1
1374  *
1375  * This tells evas, that while the nochange flag is greater than 0, do not
1376  * mark objects as "changed" when making changes.
1377  *
1378  * @param e The evas to change information.
1379  * @ingroup Evas_Canvas
1380  */
1381 EAPI void              evas_nochange_push                (Evas *e);
1382
1383 /**
1384  * Pop the nochange flag down 1
1385  *
1386  * This tells evas, that while the nochange flag is greater than 0, do not
1387  * mark objects as "changed" when making changes.
1388  *
1389  * @param e The evas to change information.
1390  * @ingroup Evas_Canvas
1391  */
1392 EAPI void              evas_nochange_pop                 (Evas *e);
1393
1394
1395 /**
1396  * Attaches a specific pointer to the evas for fetching later
1397  *
1398  * @param e The canvas to attach the pointer to
1399  * @param data The pointer to attach
1400  * @ingroup Evas_Canvas
1401  */
1402 EAPI void              evas_data_attach_set              (Evas *e, void *data) EINA_ARG_NONNULL(1);
1403
1404 /**
1405  * Returns the pointer attached by evas_data_attach_set()
1406  *
1407  * @param e The canvas to attach the pointer to
1408  * @return The pointer attached
1409  * @ingroup Evas_Canvas
1410  */
1411 EAPI void             *evas_data_attach_get              (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
1412
1413
1414 /**
1415  * Add a damage rectangle.
1416  *
1417  * @param e The given canvas pointer.
1418  * @param x The rectangle's left position.
1419  * @param y The rectangle's top position.
1420  * @param w The rectangle's width.
1421  * @param h The rectangle's height.
1422  *
1423  * This is the function by which one tells evas that a part of the
1424  * canvas has to be repainted.
1425  *
1426  * @ingroup Evas_Canvas
1427  */
1428 EAPI void              evas_damage_rectangle_add         (Evas *e, int x, int y, int w, int h) EINA_ARG_NONNULL(1);
1429
1430 /**
1431  * Add an "obscured region" to an Evas canvas.
1432  *
1433  * @param e The given canvas pointer.
1434  * @param x The rectangle's top left corner's horizontal coordinate.
1435  * @param y The rectangle's top left corner's vertical coordinate
1436  * @param w The rectangle's width.
1437  * @param h The rectangle's height.
1438  *
1439  * This is the function by which one tells an Evas canvas that a part
1440  * of it <b>must not</b> be repainted. The region must be
1441  * rectangular and its coordinates inside the canvas viewport are
1442  * passed in the call. After this call, the region specified won't
1443  * participate in any form in Evas' calculations and actions during
1444  * its rendering updates, having its displaying content frozen as it
1445  * was just after this function took place.
1446  *
1447  * We call it "obscured region" because the most common use case for
1448  * this rendering (partial) freeze is something else (most problaby
1449  * other canvas) being on top of the specified rectangular region,
1450  * thus shading it completely from the user's final scene in a
1451  * display. To avoid unnecessary processing, one should indicate to the
1452  * obscured canvas not to bother about the non-important area.
1453  *
1454  * The majority of users won't have to worry about this funcion, as
1455  * they'll be using just one canvas in their applications, with
1456  * nothing inset or on top of it in any form.
1457  *
1458  * To make this region one that @b has to be repainted again, call the
1459  * function evas_obscured_clear().
1460  *
1461  * @note This is a <b>very low level function</b>, which most of
1462  * Evas' users wouldn't care about.
1463  *
1464  * @note This function does @b not flag the canvas as having its state
1465  * changed. If you want to re-render it afterwards expecting new
1466  * contents, you have to add "damage" regions yourself (see
1467  * evas_damage_rectangle_add()).
1468  *
1469  * @see evas_obscured_clear()
1470  * @see evas_render_updates()
1471  *
1472  * Example code follows.
1473  * @dontinclude evas-events.c
1474  * @skip add an obscured
1475  * @until evas_obscured_clear(evas);
1476  *
1477  * In that example, pressing the "Ctrl" and "o" keys will impose or
1478  * remove an obscured region in the middle of the canvas. You'll get
1479  * the same contents at the time the key was pressed, if toggling it
1480  * on, until you toggle it off again (make sure the animation is
1481  * running on to get the idea better). See the full @ref
1482  * Example_Evas_Events "example".
1483  *
1484  * @ingroup Evas_Canvas
1485  */
1486 EAPI void              evas_obscured_rectangle_add       (Evas *e, int x, int y, int w, int h) EINA_ARG_NONNULL(1);
1487
1488 /**
1489  * Remove all "obscured regions" from an Evas canvas.
1490  *
1491  * @param e The given canvas pointer.
1492  *
1493  * This function removes all the rectangles from the obscured regions
1494  * list of the canvas @p e. It takes obscured areas added with
1495  * evas_obscured_rectangle_add() and make them again a regions that @b
1496  * have to be repainted on rendering updates.
1497  *
1498  * @note This is a <b>very low level function</b>, which most of
1499  * Evas' users wouldn't care about.
1500  *
1501  * @note This function does @b not flag the canvas as having its state
1502  * changed. If you want to re-render it afterwards expecting new
1503  * contents, you have to add "damage" regions yourself (see
1504  * evas_damage_rectangle_add()).
1505  *
1506  * @see evas_obscured_rectangle_add() for an example
1507  * @see evas_render_updates()
1508  *
1509  * @ingroup Evas_Canvas
1510  */
1511 EAPI void              evas_obscured_clear               (Evas *e) EINA_ARG_NONNULL(1);
1512
1513 /**
1514  * Force immediate renderization of the given Evas canvas.
1515  *
1516  * @param e The given canvas pointer.
1517  * @return A newly allocated list of updated rectangles of the canvas
1518  *        (@c Eina_Rectangle structs). Free this list with
1519  *        evas_render_updates_free().
1520  *
1521  * This function forces an immediate renderization update of the given
1522  * canvas @e.
1523  *
1524  * @note This is a <b>very low level function</b>, which most of
1525  * Evas' users wouldn't care about. One would use it, for example, to
1526  * grab an Evas' canvas update regions and paint them back, using the
1527  * canvas' pixmap, on a displaying system working below Evas.
1528  *
1529  * @note Evas is a stateful canvas. If no operations changing its
1530  * state took place since the last rendering action, you won't see no
1531  * changes and this call will be a no-op.
1532  *
1533  * Example code follows.
1534  * @dontinclude evas-events.c
1535  * @skip add an obscured
1536  * @until d.obscured = !d.obscured;
1537  *
1538  * See the full @ref Example_Evas_Events "example".
1539  *
1540  * @ingroup Evas_Canvas
1541  */
1542 EAPI Eina_List        *evas_render_updates               (Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
1543
1544 /**
1545  * Free the rectangles returned by evas_render_updates().
1546  *
1547  * @param updates The list of updated rectangles of the canvas.
1548  *
1549  * This function removes the region from the render updates list. It
1550  * makes the region doesn't be render updated anymore.
1551  *
1552  * @see evas_render_updates() for an example
1553  *
1554  * @ingroup Evas_Canvas
1555  */
1556 EAPI void              evas_render_updates_free          (Eina_List *updates);
1557
1558 /**
1559  * Force renderization of the given canvas.
1560  *
1561  * @param e The given canvas pointer.
1562  *
1563  * @ingroup Evas_Canvas
1564  */
1565 EAPI void              evas_render                       (Evas *e) EINA_ARG_NONNULL(1);
1566
1567 /**
1568  * Update the canvas internal objects but not triggering immediate
1569  * renderization.
1570  *
1571  * @param e The given canvas pointer.
1572  *
1573  * This function updates the canvas internal objects not triggering
1574  * renderization. To force renderization function evas_render() should
1575  * be used.
1576  *
1577  * @see evas_render.
1578  *
1579  * @ingroup Evas_Canvas
1580  */
1581 EAPI void              evas_norender                     (Evas *e) EINA_ARG_NONNULL(1);
1582
1583 /**
1584  * Make the canvas discard internally cached data used for rendering.
1585  *
1586  * @param e The given canvas pointer.
1587  *
1588  * This function flushes the arrays of delete, active and render objects.
1589  * Other things it may also discard are: shared memory segments,
1590  * temporary scratch buffers, cached data to avoid re-compute of that data etc.
1591  *
1592  * @ingroup Evas_Canvas
1593  */
1594 EAPI void              evas_render_idle_flush            (Evas *e) EINA_ARG_NONNULL(1);
1595
1596 /**
1597  * Make the canvas discard as much data as possible used by the engine at
1598  * runtime.
1599  *
1600  * @param e The given canvas pointer.
1601  *
1602  * This function will unload images, delete textures and much more, where
1603  * possible. You may also want to call evas_render_idle_flush() immediately
1604  * prior to this to perhaps discard a little more, though evas_render_dump()
1605  * should implicitly delete most of what evas_render_idle_flush() might
1606  * discard too.
1607  *
1608  * @ingroup Evas_Canvas
1609  */
1610 EAPI void              evas_render_dump                  (Evas *e) EINA_ARG_NONNULL(1);
1611
1612 /**
1613  * @defgroup Evas_Output_Method Render Engine Functions
1614  *
1615  * Functions that are used to set the render engine for a given
1616  * function, and then get that engine working.
1617  *
1618  * The following code snippet shows how they can be used to
1619  * initialise an evas that uses the X11 software engine:
1620  * @code
1621  * Evas *evas;
1622  * Evas_Engine_Info_Software_X11 *einfo;
1623  * extern Display *display;
1624  * extern Window win;
1625  *
1626  * evas_init();
1627  *
1628  * evas = evas_new();
1629  * evas_output_method_set(evas, evas_render_method_lookup("software_x11"));
1630  * evas_output_size_set(evas, 640, 480);
1631  * evas_output_viewport_set(evas, 0, 0, 640, 480);
1632  * einfo = (Evas_Engine_Info_Software_X11 *)evas_engine_info_get(evas);
1633  * einfo->info.display = display;
1634  * einfo->info.visual = DefaultVisual(display, DefaultScreen(display));
1635  * einfo->info.colormap = DefaultColormap(display, DefaultScreen(display));
1636  * einfo->info.drawable = win;
1637  * einfo->info.depth = DefaultDepth(display, DefaultScreen(display));
1638  * evas_engine_info_set(evas, (Evas_Engine_Info *)einfo);
1639  * @endcode
1640  *
1641  * @ingroup Evas_Canvas
1642  */
1643
1644 /**
1645  * Look up a numeric ID from a string name of a rendering engine.
1646  *
1647  * @param name the name string of an engine
1648  * @return A numeric (opaque) ID for the rendering engine
1649  * @ingroup Evas_Output_Method
1650  *
1651  * This function looks up a numeric return value for the named engine
1652  * in the string @p name. This is a normal C string, NUL byte
1653  * terminated. The name is case sensitive. If the rendering engine is
1654  * available, a numeric ID for that engine is returned that is not
1655  * 0. If the engine is not available, 0 is returned, indicating an
1656  * invalid engine.
1657  *
1658  * The programmer should NEVER rely on the numeric ID of an engine
1659  * unless it is returned by this function. Programs should NOT be
1660  * written accessing render method ID's directly, without first
1661  * obtaining it from this function.
1662  *
1663  * @attention it is mandatory that one calls evas_init() before
1664  *       looking up the render method.
1665  *
1666  * Example:
1667  * @code
1668  * int engine_id;
1669  * Evas *evas;
1670  *
1671  * evas_init();
1672  *
1673  * evas = evas_new();
1674  * if (!evas)
1675  *   {
1676  *     fprintf(stderr, "ERROR: Canvas creation failed. Fatal error.\n");
1677  *     exit(-1);
1678  *   }
1679  * engine_id = evas_render_method_lookup("software_x11");
1680  * if (!engine_id)
1681  *   {
1682  *     fprintf(stderr, "ERROR: Requested rendering engine is absent.\n");
1683  *     exit(-1);
1684  *   }
1685  * evas_output_method_set(evas, engine_id);
1686  * @endcode
1687  */
1688 EAPI int               evas_render_method_lookup         (const char *name) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
1689
1690 /**
1691  * List all the rendering engines compiled into the copy of the Evas library
1692  *
1693  * @return A linked list whose data members are C strings of engine names
1694  * @ingroup Evas_Output_Method
1695  *
1696  * Calling this will return a handle (pointer) to an Evas linked
1697  * list. Each node in the linked list will have the data pointer be a
1698  * (char *) pointer to the name string of the rendering engine
1699  * available. The strings should never be modified, neither should the
1700  * list be modified. This list should be cleaned up as soon as the
1701  * program no longer needs it using evas_render_method_list_free(). If
1702  * no engines are available from Evas, NULL will be returned.
1703  *
1704  * Example:
1705  * @code
1706  * Eina_List *engine_list, *l;
1707  * char *engine_name;
1708  *
1709  * engine_list = evas_render_method_list();
1710  * if (!engine_list)
1711  *   {
1712  *     fprintf(stderr, "ERROR: Evas supports no engines! Exit.\n");
1713  *     exit(-1);
1714  *   }
1715  * printf("Available Evas Engines:\n");
1716  * EINA_LIST_FOREACH(engine_list, l, engine_name)
1717  *     printf("%s\n", engine_name);
1718  * evas_render_method_list_free(engine_list);
1719  * @endcode
1720  */
1721 EAPI Eina_List        *evas_render_method_list           (void) EINA_WARN_UNUSED_RESULT;
1722
1723 /**
1724  * This function should be called to free a list of engine names
1725  *
1726  * @param list The Eina_List base pointer for the engine list to be freed
1727  * @ingroup Evas_Output_Method
1728  *
1729  * When this function is called it will free the engine list passed in
1730  * as @p list. The list should only be a list of engines generated by
1731  * calling evas_render_method_list(). If @p list is NULL, nothing will
1732  * happen.
1733  *
1734  * Example:
1735  * @code
1736  * Eina_List *engine_list, *l;
1737  * char *engine_name;
1738  *
1739  * engine_list = evas_render_method_list();
1740  * if (!engine_list)
1741  *   {
1742  *     fprintf(stderr, "ERROR: Evas supports no engines! Exit.\n");
1743  *     exit(-1);
1744  *   }
1745  * printf("Available Evas Engines:\n");
1746  * EINA_LIST_FOREACH(engine_list, l, engine_name)
1747  *     printf("%s\n", engine_name);
1748  * evas_render_method_list_free(engine_list);
1749  * @endcode
1750  */
1751 EAPI void              evas_render_method_list_free      (Eina_List *list);
1752
1753
1754 /**
1755  * Sets the output engine for the given evas.
1756  *
1757  * Once the output engine for an evas is set, any attempt to change it
1758  * will be ignored.  The value for @p render_method can be found using
1759  * @ref evas_render_method_lookup .
1760  *
1761  * @param   e             The given evas.
1762  * @param   render_method The numeric engine value to use.
1763  *
1764  * @attention it is mandatory that one calls evas_init() before
1765  *       setting the output method.
1766  *
1767  * @ingroup Evas_Output_Method
1768  */
1769 EAPI void              evas_output_method_set            (Evas *e, int render_method) EINA_ARG_NONNULL(1);
1770
1771 /**
1772  * Retrieves the number of the output engine used for the given evas.
1773  * @param   e The given evas.
1774  * @return  The ID number of the output engine being used.  @c 0 is
1775  *          returned if there is an error.
1776  * @ingroup Evas_Output_Method
1777  */
1778 EAPI int               evas_output_method_get            (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
1779
1780
1781 /**
1782  * Retrieves the current render engine info struct from the given evas.
1783  *
1784  * The returned structure is publicly modifiable.  The contents are
1785  * valid until either @ref evas_engine_info_set or @ref evas_render
1786  * are called.
1787  *
1788  * This structure does not need to be freed by the caller.
1789  *
1790  * @param   e The given evas.
1791  * @return  A pointer to the Engine Info structure.  @c NULL is returned if
1792  *          an engine has not yet been assigned.
1793  * @ingroup Evas_Output_Method
1794  */
1795 EAPI Evas_Engine_Info *evas_engine_info_get              (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
1796
1797 /**
1798  * Applies the engine settings for the given evas from the given @c
1799  * Evas_Engine_Info structure.
1800  *
1801  * To get the Evas_Engine_Info structure to use, call @ref
1802  * evas_engine_info_get .  Do not try to obtain a pointer to an
1803  * @c Evas_Engine_Info structure in any other way.
1804  *
1805  * You will need to call this function at least once before you can
1806  * create objects on an evas or render that evas.  Some engines allow
1807  * their settings to be changed more than once.
1808  *
1809  * Once called, the @p info pointer should be considered invalid.
1810  *
1811  * @param   e    The pointer to the Evas Canvas
1812  * @param   info The pointer to the Engine Info to use
1813  * @return  1 if no error occurred, 0 otherwise
1814  * @ingroup Evas_Output_Method
1815  */
1816 EAPI Eina_Bool         evas_engine_info_set              (Evas *e, Evas_Engine_Info *info) EINA_ARG_NONNULL(1);
1817
1818 /**
1819  * @defgroup Evas_Output_Size Output and Viewport Resizing Functions
1820  *
1821  * Functions that set and retrieve the output and viewport size of an
1822  * evas.
1823  *
1824  * @ingroup Evas_Canvas
1825  */
1826
1827 /**
1828  * Sets the output size of the render engine of the given evas.
1829  *
1830  * The evas will render to a rectangle of the given size once this
1831  * function is called.  The output size is independent of the viewport
1832  * size.  The viewport will be stretched to fill the given rectangle.
1833  *
1834  * The units used for @p w and @p h depend on the engine used by the
1835  * evas.
1836  *
1837  * @param   e The given evas.
1838  * @param   w The width in output units, usually pixels.
1839  * @param   h The height in output units, usually pixels.
1840  * @ingroup Evas_Output_Size
1841  */
1842 EAPI void              evas_output_size_set              (Evas *e, int w, int h) EINA_ARG_NONNULL(1);
1843
1844 /**
1845  * Retrieve the output size of the render engine of the given evas.
1846  *
1847  * The output size is given in whatever the output units are for the
1848  * engine.
1849  *
1850  * If either @p w or @p h is @c NULL, then it is ignored.  If @p e is
1851  * invalid, the returned results are undefined.
1852  *
1853  * @param   e The given evas.
1854  * @param   w The pointer to an integer to store the width in.
1855  * @param   h The pointer to an integer to store the height in.
1856  * @ingroup Evas_Output_Size
1857  */
1858 EAPI void              evas_output_size_get              (const Evas *e, int *w, int *h) EINA_ARG_NONNULL(1);
1859
1860 /**
1861  * Sets the output viewport of the given evas in evas units.
1862  *
1863  * The output viewport is the area of the evas that will be visible to
1864  * the viewer.  The viewport will be stretched to fit the output
1865  * target of the evas when rendering is performed.
1866  *
1867  * @note The coordinate values do not have to map 1-to-1 with the output
1868  *       target.  However, it is generally advised that it is done for ease
1869  *       of use.
1870  *
1871  * @param   e The given evas.
1872  * @param   x The top-left corner x value of the viewport.
1873  * @param   y The top-left corner y value of the viewport.
1874  * @param   w The width of the viewport.  Must be greater than 0.
1875  * @param   h The height of the viewport.  Must be greater than 0.
1876  * @ingroup Evas_Output_Size
1877  */
1878 EAPI void              evas_output_viewport_set          (Evas *e, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h) EINA_ARG_NONNULL(1);
1879
1880 /**
1881  * Get the render engine's output viewport co-ordinates in canvas units.
1882  * @param e The pointer to the Evas Canvas
1883  * @param x The pointer to a x variable to be filled in
1884  * @param y The pointer to a y variable to be filled in
1885  * @param w The pointer to a width variable to be filled in
1886  * @param h The pointer to a height variable to be filled in
1887  * @ingroup Evas_Output_Size
1888  *
1889  * Calling this function writes the current canvas output viewport
1890  * size and location values into the variables pointed to by @p x, @p
1891  * y, @p w and @p h.  On success the variables have the output
1892  * location and size values written to them in canvas units. Any of @p
1893  * x, @p y, @p w or @p h that are NULL will not be written to. If @p e
1894  * is invalid, the results are undefined.
1895  *
1896  * Example:
1897  * @code
1898  * extern Evas *evas;
1899  * Evas_Coord x, y, width, height;
1900  *
1901  * evas_output_viewport_get(evas, &x, &y, &w, &h);
1902  * @endcode
1903  */
1904 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);
1905
1906 /**
1907  * @defgroup Evas_Coord_Mapping_Group Coordinate Mapping Functions
1908  *
1909  * Functions that are used to map coordinates from the canvas to the
1910  * screen or the screen to the canvas.
1911  *
1912  * @ingroup Evas_Canvas
1913  */
1914
1915 /**
1916  * Convert/scale an ouput screen co-ordinate into canvas co-ordinates
1917  *
1918  * @param e The pointer to the Evas Canvas
1919  * @param x The screen/output x co-ordinate
1920  * @return The screen co-ordinate translated to canvas unit co-ordinates
1921  * @ingroup Evas_Coord_Mapping_Group
1922  *
1923  * This function takes in a horizontal co-ordinate as the @p x
1924  * parameter and converts it into canvas units, accounting for output
1925  * size, viewport size and location, returning it as the function
1926  * return value. If @p e is invalid, the results are undefined.
1927  *
1928  * Example:
1929  * @code
1930  * extern Evas *evas;
1931  * extern int screen_x;
1932  * Evas_Coord canvas_x;
1933  *
1934  * canvas_x = evas_coord_screen_x_to_world(evas, screen_x);
1935  * @endcode
1936  */
1937 EAPI Evas_Coord        evas_coord_screen_x_to_world      (const Evas *e, int x) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
1938
1939 /**
1940  * Convert/scale an ouput screen co-ordinate into canvas co-ordinates
1941  *
1942  * @param e The pointer to the Evas Canvas
1943  * @param y The screen/output y co-ordinate
1944  * @return The screen co-ordinate translated to canvas unit co-ordinates
1945  * @ingroup Evas_Coord_Mapping_Group
1946  *
1947  * This function takes in a vertical co-ordinate as the @p y parameter
1948  * and converts it into canvas units, accounting for output size,
1949  * viewport size and location, returning it as the function return
1950  * value. If @p e is invalid, the results are undefined.
1951  *
1952  * Example:
1953  * @code
1954  * extern Evas *evas;
1955  * extern int screen_y;
1956  * Evas_Coord canvas_y;
1957  *
1958  * canvas_y = evas_coord_screen_y_to_world(evas, screen_y);
1959  * @endcode
1960  */
1961 EAPI Evas_Coord        evas_coord_screen_y_to_world      (const Evas *e, int y) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
1962
1963 /**
1964  * Convert/scale a canvas co-ordinate into output screen co-ordinates
1965  *
1966  * @param e The pointer to the Evas Canvas
1967  * @param x The canvas x co-ordinate
1968  * @return The output/screen co-ordinate translated to output co-ordinates
1969  * @ingroup Evas_Coord_Mapping_Group
1970  *
1971  * This function takes in a horizontal co-ordinate as the @p x
1972  * parameter and converts it into output units, accounting for output
1973  * size, viewport size and location, returning it as the function
1974  * return value. If @p e is invalid, the results are undefined.
1975  *
1976  * Example:
1977  * @code
1978  * extern Evas *evas;
1979  * int screen_x;
1980  * extern Evas_Coord canvas_x;
1981  *
1982  * screen_x = evas_coord_world_x_to_screen(evas, canvas_x);
1983  * @endcode
1984  */
1985 EAPI int               evas_coord_world_x_to_screen      (const Evas *e, Evas_Coord x) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
1986
1987 /**
1988  * Convert/scale a canvas co-ordinate into output screen co-ordinates
1989  *
1990  * @param e The pointer to the Evas Canvas
1991  * @param y The canvas y co-ordinate
1992  * @return The output/screen co-ordinate translated to output co-ordinates
1993  * @ingroup Evas_Coord_Mapping_Group
1994  *
1995  * This function takes in a vertical co-ordinate as the @p x parameter
1996  * and converts it into output units, accounting for output size,
1997  * viewport size and location, returning it as the function return
1998  * value. If @p e is invalid, the results are undefined.
1999  *
2000  * Example:
2001  * @code
2002  * extern Evas *evas;
2003  * int screen_y;
2004  * extern Evas_Coord canvas_y;
2005  *
2006  * screen_y = evas_coord_world_y_to_screen(evas, canvas_y);
2007  * @endcode
2008  */
2009 EAPI int               evas_coord_world_y_to_screen      (const Evas *e, Evas_Coord y) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
2010
2011 /**
2012  * @defgroup Evas_Pointer_Group Pointer (Mouse) Functions
2013  *
2014  * Functions that deal with the status of the pointer (mouse cursor).
2015  *
2016  * @ingroup Evas_Canvas
2017  */
2018
2019 /**
2020  * This function returns the current known pointer co-ordinates
2021  *
2022  * @param e The pointer to the Evas Canvas
2023  * @param x The pointer to an integer to be filled in
2024  * @param y The pointer to an integer to be filled in
2025  * @ingroup Evas_Pointer_Group
2026  *
2027  * This function returns the current known screen/output co-ordinates
2028  * of the mouse pointer and sets the contents of the integers pointed
2029  * to by @p x and @p y to contain these co-ordinates. If @p e is not a
2030  * valid canvas the results of this function are undefined.
2031  *
2032  * Example:
2033  * @code
2034  * extern Evas *evas;
2035  * int mouse_x, mouse_y;
2036  *
2037  * evas_pointer_output_xy_get(evas, &mouse_x, &mouse_y);
2038  * printf("Mouse is at screen position %i, %i\n", mouse_x, mouse_y);
2039  * @endcode
2040  */
2041 EAPI void              evas_pointer_output_xy_get        (const Evas *e, int *x, int *y) EINA_ARG_NONNULL(1);
2042
2043 /**
2044  * This function returns the current known pointer co-ordinates
2045  *
2046  * @param e The pointer to the Evas Canvas
2047  * @param x The pointer to a Evas_Coord to be filled in
2048  * @param y The pointer to a Evas_Coord to be filled in
2049  * @ingroup Evas_Pointer_Group
2050  *
2051  * This function returns the current known canvas unit co-ordinates of
2052  * the mouse pointer and sets the contents of the Evas_Coords pointed
2053  * to by @p x and @p y to contain these co-ordinates. If @p e is not a
2054  * valid canvas the results of this function are undefined.
2055  *
2056  * Example:
2057  * @code
2058  * extern Evas *evas;
2059  * Evas_Coord mouse_x, mouse_y;
2060  *
2061  * evas_pointer_output_xy_get(evas, &mouse_x, &mouse_y);
2062  * printf("Mouse is at canvas position %f, %f\n", mouse_x, mouse_y);
2063  * @endcode
2064  */
2065 EAPI void              evas_pointer_canvas_xy_get        (const Evas *e, Evas_Coord *x, Evas_Coord *y) EINA_ARG_NONNULL(1);
2066
2067 /**
2068  * Returns a bitmask with the mouse buttons currently pressed, set to 1
2069  *
2070  * @param e The pointer to the Evas Canvas
2071  * @return A bitmask of the currently depressed buttons on the cavas
2072  * @ingroup Evas_Pointer_Group
2073  *
2074  * Calling this function will return a 32-bit integer with the
2075  * appropriate bits set to 1 that correspond to a mouse button being
2076  * depressed. This limits Evas to a mouse devices with a maximum of 32
2077  * buttons, but that is generally in excess of any host system's
2078  * pointing device abilities.
2079  *
2080  * A canvas by default begins with no mouse buttons being pressed and
2081  * only calls to evas_event_feed_mouse_down(),
2082  * evas_event_feed_mouse_down_data(), evas_event_feed_mouse_up() and
2083  * evas_event_feed_mouse_up_data() will alter that.
2084  *
2085  * The least significant bit corresponds to the first mouse button
2086  * (button 1) and the most significant bit corresponds to the last
2087  * mouse button (button 32).
2088  *
2089  * If @p e is not a valid canvas, the return value is undefined.
2090  *
2091  * Example:
2092  * @code
2093  * extern Evas *evas;
2094  * int button_mask, i;
2095  *
2096  * button_mask = evas_pointer_button_down_mask_get(evas);
2097  * printf("Buttons currently pressed:\n");
2098  * for (i = 0; i < 32; i++)
2099  *   {
2100  *     if ((button_mask & (1 << i)) != 0) printf("Button %i\n", i + 1);
2101  *   }
2102  * @endcode
2103  */
2104 EAPI int               evas_pointer_button_down_mask_get (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
2105
2106 /**
2107  * Returns whether the mouse pointer is logically inside the canvas
2108  *
2109  * @param e The pointer to the Evas Canvas
2110  * @return An integer that is 1 if the mouse is inside the canvas, 0 otherwise
2111  * @ingroup Evas_Pointer_Group
2112  *
2113  * When this function is called it will return a value of either 0 or
2114  * 1, depending on if evas_event_feed_mouse_in(),
2115  * evas_event_feed_mouse_in_data(), or evas_event_feed_mouse_out(),
2116  * evas_event_feed_mouse_out_data() have been called to feed in a
2117  * mouse enter event into the canvas.
2118  *
2119  * A return value of 1 indicates the mouse is logically inside the
2120  * canvas, and 0 implies it is logically outside the canvas.
2121  *
2122  * A canvas begins with the mouse being assumed outside (0).
2123  *
2124  * If @p e is not a valid canvas, the return value is undefined.
2125  *
2126  * Example:
2127  * @code
2128  * extern Evas *evas;
2129  *
2130  * if (evas_pointer_inside_get(evas)) printf("Mouse is in!\n");
2131  * else printf("Mouse is out!\n");
2132  * @endcode
2133  */
2134 EAPI Eina_Bool         evas_pointer_inside_get           (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
2135    EAPI void              evas_sync(Evas *e) EINA_ARG_NONNULL(1);
2136
2137 /**
2138  * @defgroup Evas_Canvas_Events Canvas Events
2139  *
2140  * Functions relating to canvas events, which are mainly reports on
2141  * its internal states changing (an object got focused, the rendering
2142  * is updated, etc).
2143  *
2144  * Some of the funcions in this group are exemplified @ref
2145  * Example_Evas_Events "here".
2146  *
2147  * @ingroup Evas_Canvas
2148  */
2149
2150 /**
2151  * @addtogroup Evas_Canvas_Events
2152  * @{
2153  */
2154
2155 /**
2156  * Add (register) a callback function to a given canvas event.
2157  *
2158  * @param e Canvas to attach a callback to
2159  * @param type The type of event that will trigger the callback
2160  * @param func The (callback) function to be called when the event is
2161  *        triggered
2162  * @param data The data pointer to be passed to @p func
2163  *
2164  * This function adds a function callback to the canvas @p e when the
2165  * event of type @p type occurs on it. The function pointer is @p
2166  * func.
2167  *
2168  * In the event of a memory allocation error during the addition of
2169  * the callback to the canvas, evas_alloc_error() should be used to
2170  * determine the nature of the error, if any, and the program should
2171  * sensibly try and recover.
2172  *
2173  * A callback function must have the ::Evas_Event_Cb prototype
2174  * definition. The first parameter (@p data) in this definition will
2175  * have the same value passed to evas_event_callback_add() as the @p
2176  * data parameter, at runtime. The second parameter @p e is the canvas
2177  * pointer on which the event occurred. The third parameter @p
2178  * event_info is a pointer to a data structure that may or may not be
2179  * passed to the callback, depending on the event type that triggered
2180  * the callback. This is so because some events don't carry extra
2181  * context with them, but others do.
2182  *
2183  * The event type @p type to trigger the function may be one of
2184  * #EVAS_CALLBACK_RENDER_FLUSH_PRE, #EVAS_CALLBACK_RENDER_FLUSH_POST,
2185  * #EVAS_CALLBACK_CANVAS_FOCUS_IN, #EVAS_CALLBACK_CANVAS_FOCUS_OUT,
2186  * #EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_IN and
2187  * #EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_OUT. This determines the kind of
2188  * event that will trigger the callback to be called. Only the last
2189  * two of the event types listed here provide useful event information
2190  * data -- a pointer to the recently focused Evas object. For the
2191  * others the @p event_info pointer is going to be @c NULL.
2192  *
2193  * Example:
2194  * @dontinclude evas-events.c
2195  * @skip evas_event_callback_add(d.canvas, EVAS_CALLBACK_RENDER_FLUSH_PRE
2196  * @until two canvas event callbacks
2197  *
2198  * Looking to the callbacks registered above,
2199  * @dontinclude evas-events.c
2200  * @skip called when our rectangle gets focus
2201  * @until let's have our events back
2202  *
2203  * we see that the canvas flushes its rendering pipeline
2204  * (#EVAS_CALLBACK_RENDER_FLUSH_PRE) whenever the @c _resize_cb
2205  * routine takes place: it has to redraw that image at a different
2206  * size. Also, the callback on an object being focused comes just
2207  * after we focus it explicitly, on code.
2208  *
2209  * See the full @ref Example_Evas_Events "example".
2210  *
2211  * @note Be careful not to add the same callback multiple times, if
2212  * that's not what you want, because Evas won't check if a callback
2213  * existed before exactly as the one being registered (and thus, call
2214  * it more than once on the event, in this case). This would make
2215  * sense if you passed different functions and/or callback data, only.
2216  */
2217 EAPI void              evas_event_callback_add              (Evas *e, Evas_Callback_Type type, Evas_Event_Cb func, const void *data) EINA_ARG_NONNULL(1, 3);
2218
2219 /**
2220  * Add (register) a callback function to a given canvas event with a
2221  * non-default priority set. Except for the priority field, it's exactly the
2222  * same as @ref evas_event_callback_add
2223  *
2224  * @param e Canvas to attach a callback to
2225  * @param type The type of event that will trigger the callback
2226  * @param priority The priority of the callback, lower values called first.
2227  * @param func The (callback) function to be called when the event is
2228  *        triggered
2229  * @param data The data pointer to be passed to @p func
2230  *
2231  * @see evas_event_callback_add
2232  * @since 1.1.0
2233  */
2234 EAPI void              evas_event_callback_priority_add(Evas *e, Evas_Callback_Type type, Evas_Callback_Priority priority, Evas_Event_Cb func, const void *data) EINA_ARG_NONNULL(1, 4);
2235
2236 /**
2237  * Delete a callback function from the canvas.
2238  *
2239  * @param e Canvas to remove a callback from
2240  * @param type The type of event that was triggering the callback
2241  * @param func The function that was to be called when the event was triggered
2242  * @return The data pointer that was to be passed to the callback
2243  *
2244  * This function removes the most recently added callback from the
2245  * canvas @p e which was triggered by the event type @p type and was
2246  * calling the function @p func when triggered. If the removal is
2247  * successful it will also return the data pointer that was passed to
2248  * evas_event_callback_add() when the callback was added to the
2249  * canvas. If not successful NULL will be returned.
2250  *
2251  * Example:
2252  * @code
2253  * extern Evas *e;
2254  * void *my_data;
2255  * void focus_in_callback(void *data, Evas *e, void *event_info);
2256  *
2257  * my_data = evas_event_callback_del(ebject, EVAS_CALLBACK_CANVAS_FOCUS_IN, focus_in_callback);
2258  * @endcode
2259  */
2260 EAPI void             *evas_event_callback_del              (Evas *e, Evas_Callback_Type type, Evas_Event_Cb func) EINA_ARG_NONNULL(1, 3);
2261
2262 /**
2263  * Delete (unregister) a callback function registered to a given
2264  * canvas event.
2265  *
2266  * @param e Canvas to remove an event callback from
2267  * @param type The type of event that was triggering the callback
2268  * @param func The function that was to be called when the event was
2269  *        triggered
2270  * @param data The data pointer that was to be passed to the callback
2271  * @return The data pointer that was to be passed to the callback
2272  *
2273  * This function removes <b>the first</b> added callback from the
2274  * canvas @p e matching the event type @p type, the registered
2275  * function pointer @p func and the callback data pointer @p data. If
2276  * the removal is successful it will also return the data pointer that
2277  * was passed to evas_event_callback_add() (that will be the same as
2278  * the parameter) when the callback(s) was(were) added to the
2279  * canvas. If not successful @c NULL will be returned. A common use
2280  * would be to remove an exact match of a callback.
2281  *
2282  * Example:
2283  * @dontinclude evas-events.c
2284  * @skip evas_event_callback_del_full(evas, EVAS_CALLBACK_RENDER_FLUSH_PRE,
2285  * @until _object_focus_in_cb, NULL);
2286  *
2287  * See the full @ref Example_Evas_Events "example".
2288  *
2289  * @note For deletion of canvas events callbacks filtering by just
2290  * type and function pointer, user evas_event_callback_del().
2291  */
2292 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);
2293
2294 /**
2295  * Push a callback on the post-event callback stack
2296  *
2297  * @param e Canvas to push the callback on
2298  * @param func The function that to be called when the stack is unwound
2299  * @param data The data pointer to be passed to the callback
2300  *
2301  * Evas has a stack of callbacks that get called after all the callbacks for
2302  * an event have triggered (all the objects it triggers on and al the callbacks
2303  * in each object triggered). When all these have been called, the stack is
2304  * unwond from most recently to least recently pushed item and removed from the
2305  * stack calling the callback set for it.
2306  *
2307  * This is intended for doing reverse logic-like processing, example - when a
2308  * child object that happens to get the event later is meant to be able to
2309  * "steal" functions from a parent and thus on unwind of this stack hav its
2310  * function called first, thus being able to set flags, or return 0 from the
2311  * post-callback that stops all other post-callbacks in the current stack from
2312  * being called (thus basically allowing a child to take control, if the event
2313  * callback prepares information ready for taking action, but the post callback
2314  * actually does the action).
2315  *
2316  */
2317 EAPI void              evas_post_event_callback_push        (Evas *e, Evas_Object_Event_Post_Cb func, const void *data);
2318
2319 /**
2320  * Remove a callback from the post-event callback stack
2321  *
2322  * @param e Canvas to push the callback on
2323  * @param func The function that to be called when the stack is unwound
2324  *
2325  * This removes a callback from the stack added with
2326  * evas_post_event_callback_push(). The first instance of the function in
2327  * the callback stack is removed from being executed when the stack is
2328  * unwound. Further instances may still be run on unwind.
2329  */
2330 EAPI void              evas_post_event_callback_remove      (Evas *e, Evas_Object_Event_Post_Cb func);
2331
2332 /**
2333  * Remove a callback from the post-event callback stack
2334  *
2335  * @param e Canvas to push the callback on
2336  * @param func The function that to be called when the stack is unwound
2337  * @param data The data pointer to be passed to the callback
2338  *
2339  * This removes a callback from the stack added with
2340  * evas_post_event_callback_push(). The first instance of the function and data
2341  * in the callback stack is removed from being executed when the stack is
2342  * unwound. Further instances may still be run on unwind.
2343  */
2344 EAPI void              evas_post_event_callback_remove_full (Evas *e, Evas_Object_Event_Post_Cb func, const void *data);
2345
2346 /**
2347  * @defgroup Evas_Event_Freezing_Group Input Events Freezing Functions
2348  *
2349  * Functions that deal with the freezing of input event processing of
2350  * an Evas canvas.
2351  *
2352  * There might be scenarios during a graphical user interface
2353  * program's use when the developer whishes the users wouldn't be able
2354  * to deliver input events to this application. It may, for example,
2355  * be the time for it to populate a view or to change some
2356  * layout. Assuming proper behavior with user interaction during this
2357  * exact time would be hard, as things are in a changing state. The
2358  * programmer can then tell the canvas to ignore input events,
2359  * bringing it back to normal behavior when he/she wants.
2360  *
2361  * Some of the funcions in this group are exemplified @ref
2362  * Example_Evas_Events "here".
2363  *
2364  * @ingroup Evas_Canvas_Events
2365  */
2366
2367 /**
2368  * @addtogroup Evas_Event_Freezing_Group
2369  * @{
2370  */
2371
2372 /**
2373  * Freeze all input events processing.
2374  *
2375  * @param e The canvas to freeze input events processing on.
2376  *
2377  * This function will indicate to Evas that the canvas @p e is to have
2378  * all input event processing frozen until a matching
2379  * evas_event_thaw() function is called on the same canvas. All events
2380  * of this kind during the freeze will get @b discarded. Every freeze
2381  * call must be matched by a thaw call in order to completely thaw out
2382  * a canvas (i.e. these calls may be nested). The most common use is
2383  * when you don't want the user to interect with your user interface
2384  * when you're populating a view or changing the layout.
2385  *
2386  * Example:
2387  * @dontinclude evas-events.c
2388  * @skip freeze input for 3 seconds
2389  * @until }
2390  * @dontinclude evas-events.c
2391  * @skip let's have our events back
2392  * @until }
2393  *
2394  * See the full @ref Example_Evas_Events "example".
2395  *
2396  * If you run that example, you'll see the canvas ignoring all input
2397  * events for 3 seconds, when the "f" key is pressed. In a more
2398  * realistic code we would be freezing while a toolkit or Edje was
2399  * doing some UI changes, thawing it back afterwards.
2400  */
2401 EAPI void              evas_event_freeze                 (Evas *e) EINA_ARG_NONNULL(1);
2402
2403 /**
2404  * Thaw a canvas out after freezing (for input events).
2405  *
2406  * @param e The canvas to thaw out.
2407  *
2408  * This will thaw out a canvas after a matching evas_event_freeze()
2409  * call. If this call completely thaws out a canvas, i.e., there's no
2410  * other unbalanced call to evas_event_freeze(), events will start to
2411  * be processed again, but any "missed" events will @b not be
2412  * evaluated.
2413  *
2414  * See evas_event_freeze() for an example.
2415  */
2416 EAPI void              evas_event_thaw                   (Evas *e) EINA_ARG_NONNULL(1);
2417
2418 /**
2419  * Return the freeze count on input events of a given canvas.
2420  *
2421  * @param e The canvas to fetch the freeze count from.
2422  *
2423  * This returns the number of times the canvas has been told to freeze
2424  * input events. It is possible to call evas_event_freeze() multiple
2425  * times, and these must be matched by evas_event_thaw() calls. This
2426  * call allows the program to discover just how many times things have
2427  * been frozen in case it may want to break out of a deep freeze state
2428  * where the count is high.
2429  *
2430  * Example:
2431  * @code
2432  * extern Evas *evas;
2433  *
2434  * while (evas_event_freeze_get(evas) > 0) evas_event_thaw(evas);
2435  * @endcode
2436  *
2437  */
2438 EAPI int               evas_event_freeze_get             (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
2439
2440 /**
2441  * After thaw of a canvas, re-evaluate the state of objects and call callbacks
2442  *
2443  * @param e The canvas to evaluate after a thaw
2444  *
2445  * This is normally called after evas_event_thaw() to re-evaluate mouse
2446  * containment and other states and thus also call callbacks for mouse in and
2447  * out on new objects if the state change demands it.
2448  */
2449 EAPI void              evas_event_thaw_eval              (Evas *e) EINA_ARG_NONNULL(1);
2450
2451 /**
2452  * @}
2453  */
2454
2455 /**
2456  * @defgroup Evas_Event_Feeding_Group Input Events Feeding Functions
2457  *
2458  * Functions to tell Evas that input events happened and should be
2459  * processed.
2460  *
2461  * As explained in @ref intro_not_evas, Evas does not know how to poll
2462  * for input events, so the developer should do it and then feed such
2463  * events to the canvas to be processed. This is only required if
2464  * operating Evas directly. Modules such as Ecore_Evas do that for
2465  * you.
2466  *
2467  * Some of the funcions in this group are exemplified @ref
2468  * Example_Evas_Events "here".
2469  *
2470  * @ingroup Evas_Canvas_Events
2471  */
2472
2473 /**
2474  * @addtogroup Evas_Event_Feeding_Group
2475  * @{
2476  */
2477
2478 /**
2479  * Mouse down event feed.
2480  *
2481  * @param e The given canvas pointer.
2482  * @param b The button number.
2483  * @param flags The evas button flags.
2484  * @param timestamp The timestamp of the mouse down event.
2485  * @param data The data for canvas.
2486  *
2487  * This function will set some evas properties that is necessary when
2488  * the mouse button is pressed. It prepares information to be treated
2489  * by the callback function.
2490  *
2491  */
2492 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);
2493
2494 /**
2495  * Mouse up event feed.
2496  *
2497  * @param e The given canvas pointer.
2498  * @param b The button number.
2499  * @param flags evas button flags.
2500  * @param timestamp The timestamp of the mouse up event.
2501  * @param data The data for canvas.
2502  *
2503  * This function will set some evas properties that is necessary when
2504  * the mouse button is released. It prepares information to be treated
2505  * by the callback function.
2506  *
2507  */
2508 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);
2509
2510 /**
2511  * Mouse move event feed.
2512  *
2513  * @param e The given canvas pointer.
2514  * @param x The horizontal position of the mouse pointer.
2515  * @param y The vertical position of the mouse pointer.
2516  * @param timestamp The timestamp of the mouse up event.
2517  * @param data The data for canvas.
2518  *
2519  * This function will set some evas properties that is necessary when
2520  * the mouse is moved from its last position. It prepares information
2521  * to be treated by the callback function.
2522  *
2523  */
2524 EAPI void              evas_event_feed_mouse_move        (Evas *e, int x, int y, unsigned int timestamp, const void *data) EINA_ARG_NONNULL(1);
2525
2526 /**
2527  * Mouse in event feed.
2528  *
2529  * @param e The given canvas pointer.
2530  * @param timestamp The timestamp of the mouse up event.
2531  * @param data The data for canvas.
2532  *
2533  * This function will set some evas properties that is necessary when
2534  * the mouse in event happens. It prepares information to be treated
2535  * by the callback function.
2536  *
2537  */
2538 EAPI void              evas_event_feed_mouse_in          (Evas *e, unsigned int timestamp, const void *data) EINA_ARG_NONNULL(1);
2539
2540 /**
2541  * Mouse out event feed.
2542  *
2543  * @param e The given canvas pointer.
2544  * @param timestamp Timestamp of the mouse up event.
2545  * @param data The data for canvas.
2546  *
2547  * This function will set some evas properties that is necessary when
2548  * the mouse out event happens. It prepares information to be treated
2549  * by the callback function.
2550  *
2551  */
2552 EAPI void              evas_event_feed_mouse_out         (Evas *e, unsigned int timestamp, const void *data) EINA_ARG_NONNULL(1);
2553    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);
2554    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);
2555    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);
2556
2557 /**
2558  * Mouse cancel event feed.
2559  *
2560  * @param e The given canvas pointer.
2561  * @param timestamp The timestamp of the mouse up event.
2562  * @param data The data for canvas.
2563  *
2564  * This function will call evas_event_feed_mouse_up() when a
2565  * mouse cancel event happens.
2566  *
2567  */
2568 EAPI void              evas_event_feed_mouse_cancel      (Evas *e, unsigned int timestamp, const void *data) EINA_ARG_NONNULL(1);
2569
2570 /**
2571  * Mouse wheel event feed.
2572  *
2573  * @param e The given canvas pointer.
2574  * @param direction The wheel mouse direction.
2575  * @param z How much mouse wheel was scrolled up or down.
2576  * @param timestamp The timestamp of the mouse up event.
2577  * @param data The data for canvas.
2578  *
2579  * This function will set some evas properties that is necessary when
2580  * the mouse wheel is scrolled up or down. It prepares information to
2581  * be treated by the callback function.
2582  *
2583  */
2584 EAPI void              evas_event_feed_mouse_wheel       (Evas *e, int direction, int z, unsigned int timestamp, const void *data) EINA_ARG_NONNULL(1);
2585
2586 /**
2587  * Key down event feed
2588  *
2589  * @param e The canvas to thaw out
2590  * @param keyname  Name of the key
2591  * @param key The key pressed.
2592  * @param string A String
2593  * @param compose The compose string
2594  * @param timestamp Timestamp of the mouse up event
2595  * @param data Data for canvas.
2596  *
2597  * This function will set some evas properties that is necessary when
2598  * a key is pressed. It prepares information to be treated by the
2599  * callback function.
2600  *
2601  */
2602 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);
2603
2604 /**
2605  * Key up event feed
2606  *
2607  * @param e The canvas to thaw out
2608  * @param keyname  Name of the key
2609  * @param key The key released.
2610  * @param string string
2611  * @param compose compose
2612  * @param timestamp Timestamp of the mouse up event
2613  * @param data Data for canvas.
2614  *
2615  * This function will set some evas properties that is necessary when
2616  * a key is released. It prepares information to be treated by the
2617  * callback function.
2618  *
2619  */
2620 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);
2621
2622 /**
2623  * Hold event feed
2624  *
2625  * @param e The given canvas pointer.
2626  * @param hold The hold.
2627  * @param timestamp The timestamp of the mouse up event.
2628  * @param data The data for canvas.
2629  *
2630  * This function makes the object to stop sending events.
2631  *
2632  */
2633 EAPI void              evas_event_feed_hold              (Evas *e, int hold, unsigned int timestamp, const void *data) EINA_ARG_NONNULL(1);
2634
2635 /**
2636  * Re feed event.
2637  *
2638  * @param e The given canvas pointer.
2639  * @param event_copy the event to refeed
2640  * @param event_type Event type
2641  *
2642  * This function re-feeds the event pointed by event_copy
2643  *
2644  * This function call evas_event_feed_* functions, so it can
2645  * cause havoc if not used wisely. Please use it responsibly.
2646  */
2647 EAPI void              evas_event_refeed_event           (Evas *e, void *event_copy, Evas_Callback_Type event_type);  EINA_ARG_NONNULL(1);
2648
2649
2650 /**
2651  * @}
2652  */
2653
2654 /**
2655  * @}
2656  */
2657
2658 /**
2659  * @defgroup Evas_Image_Group Image Functions
2660  *
2661  * Functions that deals with images at canvas level.
2662  *
2663  * @ingroup Evas_Canvas
2664  */
2665
2666 /**
2667  * @addtogroup Evas_Image_Group
2668  * @{
2669  */
2670
2671 /**
2672  * Flush the image cache of the canvas.
2673  *
2674  * @param e The given evas pointer.
2675  *
2676  * This function flushes image cache of canvas.
2677  *
2678  */
2679 EAPI void              evas_image_cache_flush            (Evas *e) EINA_ARG_NONNULL(1);
2680
2681 /**
2682  * Reload the image cache
2683  *
2684  * @param e The given evas pointer.
2685  *
2686  * This function reloads the image cache of canvas.
2687  *
2688  */
2689 EAPI void              evas_image_cache_reload           (Evas *e) EINA_ARG_NONNULL(1);
2690
2691 /**
2692  * Set the image cache.
2693  *
2694  * @param e The given evas pointer.
2695  * @param size The cache size.
2696  *
2697  * This function sets the image cache of canvas.
2698  *
2699  */
2700 EAPI void              evas_image_cache_set              (Evas *e, int size) EINA_ARG_NONNULL(1);
2701
2702 /**
2703  * Set the image cache
2704  *
2705  * @param e The given evas pointer.
2706  *
2707  * This function returns the image cache of canvas.
2708  *
2709  */
2710 EAPI int               evas_image_cache_get              (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
2711
2712 /**
2713  * @}
2714  */
2715
2716 /**
2717  * @defgroup Evas_Font_Group Font Functions
2718  *
2719  * Functions that deals with fonts.
2720  *
2721  * @ingroup Evas_Canvas
2722  */
2723
2724 /**
2725  * Changes the font hinting for the given evas.
2726  *
2727  * @param e The given evas.
2728  * @param hinting The hinting to use, one of #EVAS_FONT_HINTING_NONE,
2729  *        #EVAS_FONT_HINTING_AUTO, #EVAS_FONT_HINTING_BYTECODE.
2730  * @ingroup Evas_Font_Group
2731  */
2732 EAPI void                     evas_font_hinting_set        (Evas *e, Evas_Font_Hinting_Flags hinting) EINA_ARG_NONNULL(1);
2733
2734 /**
2735  * Retrieves the font hinting used by the given evas.
2736  *
2737  * @param e The given evas to query.
2738  * @return The hinting in use, one of #EVAS_FONT_HINTING_NONE,
2739  *         #EVAS_FONT_HINTING_AUTO, #EVAS_FONT_HINTING_BYTECODE.
2740  * @ingroup Evas_Font_Group
2741  */
2742 EAPI Evas_Font_Hinting_Flags  evas_font_hinting_get        (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
2743
2744 /**
2745  * Checks if the font hinting is supported by the given evas.
2746  *
2747  * @param e The given evas to query.
2748  * @param hinting The hinting to use, one of #EVAS_FONT_HINTING_NONE,
2749  *        #EVAS_FONT_HINTING_AUTO, #EVAS_FONT_HINTING_BYTECODE.
2750  * @return @c EINA_TRUE if it is supported, @c EINA_FALSE otherwise.
2751  * @ingroup Evas_Font_Group
2752  */
2753 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;
2754
2755
2756 /**
2757  * Force the given evas and associated engine to flush its font cache.
2758  *
2759  * @param e The given evas to flush font cache.
2760  * @ingroup Evas_Font_Group
2761  */
2762 EAPI void                     evas_font_cache_flush        (Evas *e) EINA_ARG_NONNULL(1);
2763
2764 /**
2765  * Changes the size of font cache of the given evas.
2766  *
2767  * @param e The given evas to flush font cache.
2768  * @param size The size, in bytes.
2769  *
2770  * @ingroup Evas_Font_Group
2771  */
2772 EAPI void                     evas_font_cache_set          (Evas *e, int size) EINA_ARG_NONNULL(1);
2773
2774 /**
2775  * Changes the size of font cache of the given evas.
2776  *
2777  * @param e The given evas to flush font cache.
2778  * @return The size, in bytes.
2779  *
2780  * @ingroup Evas_Font_Group
2781  */
2782 EAPI int                      evas_font_cache_get          (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
2783
2784
2785 /**
2786  * List of available font descriptions known or found by this evas.
2787  *
2788  * The list depends on Evas compile time configuration, such as
2789  * fontconfig support, and the paths provided at runtime as explained
2790  * in @ref Evas_Font_Path_Group.
2791  *
2792  * @param e The evas instance to query.
2793  * @return a newly allocated list of strings. Do not change the
2794  *         strings.  Be sure to call evas_font_available_list_free()
2795  *         after you're done.
2796  *
2797  * @ingroup Evas_Font_Group
2798  */
2799 EAPI Eina_List               *evas_font_available_list     (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
2800
2801 /**
2802  * Free list of font descriptions returned by evas_font_dir_available_list().
2803  *
2804  * @param e The evas instance that returned such list.
2805  * @param available the list returned by evas_font_dir_available_list().
2806  *
2807  * @ingroup Evas_Font_Group
2808  */
2809 EAPI void                     evas_font_available_list_free(Evas *e, Eina_List *available) EINA_ARG_NONNULL(1);
2810
2811 /**
2812  * @defgroup Evas_Font_Path_Group Font Path Functions
2813  *
2814  * Functions that edit the paths being used to load fonts.
2815  *
2816  * @ingroup Evas_Font_Group
2817  */
2818
2819 /**
2820  * Removes all font paths loaded into memory for the given evas.
2821  * @param   e The given evas.
2822  * @ingroup Evas_Font_Path_Group
2823  */
2824 EAPI void              evas_font_path_clear              (Evas *e) EINA_ARG_NONNULL(1);
2825
2826 /**
2827  * Appends a font path to the list of font paths used by the given evas.
2828  * @param   e    The given evas.
2829  * @param   path The new font path.
2830  * @ingroup Evas_Font_Path_Group
2831  */
2832 EAPI void              evas_font_path_append             (Evas *e, const char *path) EINA_ARG_NONNULL(1, 2);
2833
2834 /**
2835  * Prepends a font path to the list of font paths used by the given evas.
2836  * @param   e The given evas.
2837  * @param   path The new font path.
2838  * @ingroup Evas_Font_Path_Group
2839  */
2840 EAPI void              evas_font_path_prepend            (Evas *e, const char *path) EINA_ARG_NONNULL(1, 2);
2841
2842 /**
2843  * Retrieves the list of font paths used by the given evas.
2844  * @param   e The given evas.
2845  * @return  The list of font paths used.
2846  * @ingroup Evas_Font_Path_Group
2847  */
2848 EAPI const Eina_List  *evas_font_path_list               (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
2849
2850 /**
2851  * @defgroup Evas_Object_Group Generic Object Functions
2852  *
2853  * Functions that manipulate generic Evas objects.
2854  *
2855  * All Evas displaying units are Evas objects. One handles them all by
2856  * means of the handle ::Evas_Object. Besides Evas treats their
2857  * objects equally, they have @b types, which define their specific
2858  * behavior (and individual API).
2859  *
2860  * Evas comes with a set of built-in object types:
2861  *   - rectangle,
2862  *   - line,
2863  *   - polygon,
2864  *   - text,
2865  *   - textblock and
2866  *   - image.
2867  *
2868  * These functions apply to @b any Evas object, whichever type thay
2869  * may have.
2870  *
2871  * @note The built-in types which are most used are rectangles, text
2872  * and images. In fact, with these ones one can create 2D interfaces
2873  * of arbitrary complexity and EFL makes it easy.
2874  */
2875
2876 /**
2877  * @defgroup Evas_Object_Group_Basic Basic Object Manipulation
2878  *
2879  * Methods that are broadly used, like those that change the color,
2880  * clippers and geometry of an Evas object.
2881  *
2882  * An example on the most used functions in this group can be seen @ref
2883  * Example_Evas_Object_Manipulation "here".
2884  *
2885  * For function dealing with stacking, the examples are gathered  @ref
2886  * Example_Evas_Stacking "here".
2887  *
2888  * @ingroup Evas_Object_Group
2889  */
2890
2891 /**
2892  * @addtogroup Evas_Object_Group_Basic
2893  * @{
2894  */
2895
2896 /**
2897  * Clip one object to another.
2898  *
2899  * @param obj The object to be clipped
2900  * @param clip The object to clip @p obj by
2901  *
2902  * This function will clip the object @p obj to the area occupied by
2903  * the object @p clip. This means the object @p obj will only be
2904  * visible within the area occupied by the clipping object (@p clip).
2905  *
2906  * The color of the object being clipped will be multiplied by the
2907  * color of the clipping one, so the resulting color for the former
2908  * will be <code>RESULT = (OBJ * CLIP) / (255 * 255)</code>, per color
2909  * element (red, green, blue and alpha).
2910  *
2911  * Clipping is recursive, so clipping objects may be clipped by
2912  * others, and their color will in term be multiplied. You may @b not
2913  * set up circular clipping lists (i.e. object 1 clips object 2, which
2914  * clips object 1): the behavior of Evas is undefined in this case.
2915  *
2916  * Objects which do not clip others are visible in the canvas as
2917  * normal; <b>those that clip one or more objects become invisible
2918  * themselves</b>, only affecting what they clip. If an object ceases
2919  * to have other objects being clipped by it, it will become visible
2920  * again.
2921  *
2922  * The visibility of an object affects the objects that are clipped by
2923  * it, so if the object clipping others is not shown (as in
2924  * evas_object_show()), the objects clipped by it will not be shown
2925  * either.
2926  *
2927  * If @p obj was being clipped by another object when this function is
2928  * called, it gets implicitly removed from the old clipper's domain
2929  * and is made now to be clipped by its new clipper.
2930  *
2931  * The following figure illustrates some clipping in Evas:
2932  *
2933  * @image html clipping.png
2934  * @image rtf clipping.png
2935  * @image latex clipping.eps
2936  *
2937  * @note At the moment the <b>only objects that can validly be used to
2938  * clip other objects are rectangle objects</b>. All other object
2939  * types are invalid and the result of using them is undefined. The
2940  * clip object @p clip must be a valid object, but can also be @c
2941  * NULL, in which case the effect of this function is the same as
2942  * calling evas_object_clip_unset() on the @p obj object.
2943  *
2944  * Example:
2945  * @dontinclude evas-object-manipulation.c
2946  * @skip solid white clipper (note that it's the default color for a
2947  * @until evas_object_show(d.clipper);
2948  *
2949  * See the full @ref Example_Evas_Object_Manipulation "example".
2950  */
2951 EAPI void              evas_object_clip_set              (Evas_Object *obj, Evas_Object *clip) EINA_ARG_NONNULL(1, 2);
2952
2953 /**
2954  * Get the object clipping @p obj (if any).
2955  *
2956  * @param obj The object to get the clipper from
2957  *
2958  * This function returns the object clipping @p obj. If @p obj is
2959  * not being clipped at all, @c NULL is returned. The object @p obj
2960  * must be a valid ::Evas_Object.
2961  *
2962  * See also evas_object_clip_set(), evas_object_clip_unset() and
2963  * evas_object_clipees_get().
2964  *
2965  * Example:
2966  * @dontinclude evas-object-manipulation.c
2967  * @skip if (evas_object_clip_get(d.img) == d.clipper)
2968  * @until return
2969  *
2970  * See the full @ref Example_Evas_Object_Manipulation "example".
2971  */
2972 EAPI Evas_Object      *evas_object_clip_get              (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
2973
2974 /**
2975  * Disable/cease clipping on a clipped @p obj object.
2976  *
2977  * @param obj The object to cease clipping on
2978  *
2979  * This function disables clipping for the object @p obj, if it was
2980  * already clipped, i.e., its visibility and color get detached from
2981  * the previous clipper. If it wasn't, this has no effect. The object
2982  * @p obj must be a valid ::Evas_Object.
2983  *
2984  * See also evas_object_clip_set() (for an example),
2985  * evas_object_clipees_get() and evas_object_clip_get().
2986  *
2987  */
2988 EAPI void              evas_object_clip_unset            (Evas_Object *obj);
2989
2990 /**
2991  * Return a list of objects currently clipped by @p obj.
2992  *
2993  * @param obj The object to get a list of clippees from
2994  * @return a list of objects being clipped by @p obj
2995  *
2996  * This returns the internal list handle that contains all objects
2997  * clipped by the object @p obj. If none are clipped by it, the call
2998  * returns @c NULL. This list is only valid until the clip list is
2999  * changed and should be fetched again with another call to
3000  * evas_object_clipees_get() if any objects being clipped by this
3001  * object are unclipped, clipped by a new object, deleted or get the
3002  * clipper deleted. These operations will invalidate the list
3003  * returned, so it should not be used anymore after that point. Any
3004  * use of the list after this may have undefined results, possibly
3005  * leading to crashes. The object @p obj must be a valid
3006  * ::Evas_Object.
3007  *
3008  * See also evas_object_clip_set(), evas_object_clip_unset() and
3009  * evas_object_clip_get().
3010  *
3011  * Example:
3012  * @code
3013  * extern Evas_Object *obj;
3014  * Evas_Object *clipper;
3015  *
3016  * clipper = evas_object_clip_get(obj);
3017  * if (clipper)
3018  *   {
3019  *     Eina_List *clippees, *l;
3020  *     Evas_Object *obj_tmp;
3021  *
3022  *     clippees = evas_object_clipees_get(clipper);
3023  *     printf("Clipper clips %i objects\n", eina_list_count(clippees));
3024  *     EINA_LIST_FOREACH(clippees, l, obj_tmp)
3025  *         evas_object_show(obj_tmp);
3026  *   }
3027  * @endcode
3028  */
3029 EAPI const Eina_List  *evas_object_clipees_get           (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
3030
3031
3032 /**
3033  * Sets or unsets a given object as the currently focused one on its
3034  * canvas.
3035  *
3036  * @param obj The object to be focused or unfocused.
3037  * @param focus @c EINA_TRUE, to set it as focused or @c EINA_FALSE,
3038  * to take away the focus from it.
3039  *
3040  * Changing focus only affects where (key) input events go. There can
3041  * be only one object focused at any time. If @p focus is @c
3042  * EINA_TRUE, @p obj will be set as the currently focused object and
3043  * it will receive all keyboard events that are not exclusive key
3044  * grabs on other objects.
3045  *
3046  * Example:
3047  * @dontinclude evas-events.c
3048  * @skip evas_object_focus_set
3049  * @until evas_object_focus_set
3050  *
3051  * See the full example @ref Example_Evas_Events "here".
3052  *
3053  * @see evas_object_focus_get
3054  * @see evas_focus_get
3055  * @see evas_object_key_grab
3056  * @see evas_object_key_ungrab
3057  */
3058 EAPI void              evas_object_focus_set             (Evas_Object *obj, Eina_Bool focus) EINA_ARG_NONNULL(1);
3059
3060 /**
3061  * Retrieve whether an object has the focus.
3062  *
3063  * @param obj The object to retrieve focus information from.
3064  * @return @c EINA_TRUE if the object has the focus, @c EINA_FALSE
3065  * otherwise.
3066  *
3067  * If the passed object is the currently focused one, @c EINA_TRUE is
3068  * returned. @c EINA_FALSE is returned, otherwise.
3069  *
3070  * Example:
3071  * @dontinclude evas-events.c
3072  * @skip And again
3073  * @until something is bad
3074  *
3075  * See the full example @ref Example_Evas_Events "here".
3076  *
3077  * @see evas_object_focus_set
3078  * @see evas_focus_get
3079  * @see evas_object_key_grab
3080  * @see evas_object_key_ungrab
3081  */
3082 EAPI Eina_Bool         evas_object_focus_get             (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
3083
3084
3085 /**
3086  * Sets the layer of the its canvas that the given object will be part
3087  * of.
3088  *
3089  * @param   obj The given Evas object.
3090  * @param   l   The number of the layer to place the object on.
3091  *          Must be between #EVAS_LAYER_MIN and #EVAS_LAYER_MAX.
3092  *
3093  * If you don't use this function, you'll be dealing with an @b unique
3094  * layer of objects, the default one. Additional layers are handy when
3095  * you don't want a set of objects to interfere with another set with
3096  * regard to @b stacking. Two layers are completely disjoint in that
3097  * matter.
3098  *
3099  * This is a low-level function, which you'd be using when something
3100  * should be always on top, for example.
3101  *
3102  * @warning Be careful, it doesn't make sense to change the layer of
3103  * smart objects' children. Smart objects have a layer of their own,
3104  * which should contain all their children objects.
3105  *
3106  * @see evas_object_layer_get()
3107  */
3108 EAPI void              evas_object_layer_set             (Evas_Object *obj, short l) EINA_ARG_NONNULL(1);
3109
3110 /**
3111  * Retrieves the layer of its canvas that the given object is part of.
3112  *
3113  * @param   obj The given Evas object to query layer from
3114  * @return  Number of the its layer
3115  *
3116  * @see evas_object_layer_set()
3117  */
3118 EAPI short             evas_object_layer_get             (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
3119
3120
3121 /**
3122  * Sets the name of the given Evas object to the given name.
3123  *
3124  * @param   obj  The given object.
3125  * @param   name The given name.
3126  *
3127  * There might be occasions where one would like to name his/her
3128  * objects.
3129  *
3130  * Example:
3131  * @dontinclude evas-events.c
3132  * @skip d.bg = evas_object_rectangle_add(d.canvas);
3133  * @until evas_object_name_set(d.bg, "our dear rectangle");
3134  *
3135  * See the full @ref Example_Evas_Events "example".
3136  */
3137 EAPI void              evas_object_name_set              (Evas_Object *obj, const char *name) EINA_ARG_NONNULL(1);
3138
3139 /**
3140  * Retrieves the name of the given Evas object.
3141  *
3142  * @param   obj The given object.
3143  * @return  The name of the object or @c NULL, if no name has been given
3144  *          to it.
3145  *
3146  * Example:
3147  * @dontinclude evas-events.c
3148  * @skip fprintf(stdout, "An object got focused: %s\n",
3149  * @until evas_focus_get
3150  *
3151  * See the full @ref Example_Evas_Events "example".
3152  */
3153 EAPI const char       *evas_object_name_get              (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
3154
3155
3156 /**
3157  * Increments object reference count to defer its deletion.
3158  *
3159  * @param obj The given Evas object to reference
3160  *
3161  * This increments the reference count of an object, which if greater
3162  * than 0 will defer deletion by evas_object_del() until all
3163  * references are released back (counter back to 0). References cannot
3164  * go below 0 and unreferencing past that will result in the reference
3165  * count being limited to 0. References are limited to <c>2^32 - 1</c>
3166  * for an object. Referencing it more than this will result in it
3167  * being limited to this value.
3168  *
3169  * @see evas_object_unref()
3170  * @see evas_object_del()
3171  *
3172  * @note This is a <b>very simple<b> reference counting mechanism! For
3173  * instance, Evas is not ready to check for pending references on a
3174  * canvas deletion, or things like that. This is useful on scenarios
3175  * where, inside a code block, callbacks exist which would possibly
3176  * delete an object we are operating on afterwards. Then, one would
3177  * evas_object_ref() it on the beginning of the block and
3178  * evas_object_unref() it on the end. It would then be deleted at this
3179  * point, if it should be.
3180  *
3181  * Example:
3182  * @code
3183  *  evas_object_ref(obj);
3184  *
3185  *  // action here...
3186  *  evas_object_smart_callback_call(obj, SIG_SELECTED, NULL);
3187  *  // more action here...
3188  *  evas_object_unref(obj);
3189  * @endcode
3190  *
3191  * @ingroup Evas_Object_Group_Basic
3192  * @since 1.1.0
3193  */
3194 EAPI void              evas_object_ref                   (Evas_Object *obj);
3195
3196 /**
3197  * Decrements object reference count.
3198  *
3199  * @param obj The given Evas object to unreference
3200  *
3201  * This decrements the reference count of an object. If the object has
3202  * had evas_object_del() called on it while references were more than
3203  * 0, it will be deleted at the time this function is called and puts
3204  * the counter back to 0. See evas_object_ref() for more information.
3205  *
3206  * @see evas_object_ref() (for an example)
3207  * @see evas_object_del()
3208  *
3209  * @ingroup Evas_Object_Group_Basic
3210  * @since 1.1.0
3211  */
3212 EAPI void              evas_object_unref                 (Evas_Object *obj);
3213
3214
3215 /**
3216  * Marks the given Evas object for deletion (when Evas will free its
3217  * memory).
3218  *
3219  * @param obj The given Evas object.
3220  *
3221  * This call will mark @p obj for deletion, which will take place
3222  * whenever it has no more references to it (see evas_object_ref() and
3223  * evas_object_unref()).
3224  *
3225  * At actual deletion time, which may or may not be just after this
3226  * call, ::EVAS_CALLBACK_DEL and ::EVAS_CALLBACK_FREE callbacks will
3227  * be called. If the object currently had the focus, its
3228  * ::EVAS_CALLBACK_FOCUS_OUT callback will also be called.
3229  *
3230  * @see evas_object_ref()
3231  * @see evas_object_unref()
3232  *
3233  * @ingroup Evas_Object_Group_Basic
3234  */
3235 EAPI void              evas_object_del                   (Evas_Object *obj) EINA_ARG_NONNULL(1);
3236
3237 /**
3238  * Move the given Evas object to the given location inside its
3239  * canvas' viewport.
3240  *
3241  * @param obj The given Evas object.
3242  * @param x   X position to move the object to, in canvas units.
3243  * @param y   Y position to move the object to, in canvas units.
3244  *
3245  * Besides being moved, the object's ::EVAS_CALLBACK_MOVE callback
3246  * will be called.
3247  *
3248  * @note Naturally, newly created objects are placed at the canvas'
3249  * origin: <code>0, 0</code>.
3250  *
3251  * Example:
3252  * @dontinclude evas-object-manipulation.c
3253  * @skip evas_object_image_border_set(d.clipper_border, 3, 3, 3, 3);
3254  * @until evas_object_show
3255  *
3256  * See the full @ref Example_Evas_Object_Manipulation "example".
3257  *
3258  * @ingroup Evas_Object_Group_Basic
3259  */
3260 EAPI void              evas_object_move                  (Evas_Object *obj, Evas_Coord x, Evas_Coord y) EINA_ARG_NONNULL(1);
3261
3262 /**
3263  * Changes the size of the given Evas object.
3264  *
3265  * @param obj The given Evas object.
3266  * @param w   The new width of the Evas object.
3267  * @param h   The new height of the Evas object.
3268  *
3269  * Besides being resized, the object's ::EVAS_CALLBACK_RESIZE callback
3270  * will be called.
3271  *
3272  * @note Newly created objects have zeroed dimensions. Then, you most
3273  * probably want to use evas_object_resize() on them after they are
3274  * created.
3275  *
3276  * @note Be aware that resizing an object changes its drawing area,
3277  * but that does imply the object is rescaled! For instance, images
3278  * are filled inside their drawing area using the specifications of
3279  * evas_object_image_fill_set(). Thus to scale the image to match
3280  * exactly your drawing area, you need to change the
3281  * evas_object_image_fill_set() as well.
3282  *
3283  * @note This is more evident in images, but text, textblock, lines
3284  * and polygons will behave similarly. Check their specific APIs to
3285  * know how to achieve your desired behavior. Consider the following
3286  * example:
3287  *
3288  * @code
3289  * // rescale image to fill exactly its area without tiling:
3290  * evas_object_resize(img, w, h);
3291  * evas_object_image_fill_set(img, 0, 0, w, h);
3292  * @endcode
3293  *
3294  * @ingroup Evas_Object_Group_Basic
3295  */
3296 EAPI void              evas_object_resize                (Evas_Object *obj, Evas_Coord w, Evas_Coord h) EINA_ARG_NONNULL(1);
3297
3298 /**
3299  * Retrieves the position and (rectangular) size of the given Evas
3300  * object.
3301  *
3302  * @param obj The given Evas object.
3303  * @param x Pointer to an integer in which to store the X coordinate
3304  *          of the object.
3305  * @param y Pointer to an integer in which to store the Y coordinate
3306  *          of the object.
3307  * @param w Pointer to an integer in which to store the width of the
3308  *          object.
3309  * @param h Pointer to an integer in which to store the height of the
3310  *          object.
3311  *
3312  * The position, naturally, will be relative to the top left corner of
3313  * the canvas' viewport.
3314  *
3315  * @note Use @c NULL pointers on the geometry components you're not
3316  * interested in: they'll be ignored by the function.
3317  *
3318  * Example:
3319  * @dontinclude evas-events.c
3320  * @skip int w, h, cw, ch;
3321  * @until return
3322  *
3323  * See the full @ref Example_Evas_Events "example".
3324  *
3325  * @ingroup Evas_Object_Group_Basic
3326  */
3327 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);
3328
3329
3330 /**
3331  * Makes the given Evas object visible.
3332  *
3333  * @param obj The given Evas object.
3334  *
3335  * Besides becoming visible, the object's ::EVAS_CALLBACK_SHOW
3336  * callback will be called.
3337  *
3338  * @see evas_object_hide() for more on object visibility.
3339  * @see evas_object_visible_get()
3340  *
3341  * @ingroup Evas_Object_Group_Basic
3342  */
3343 EAPI void              evas_object_show                  (Evas_Object *obj) EINA_ARG_NONNULL(1);
3344
3345 /**
3346  * Makes the given Evas object invisible.
3347  *
3348  * @param obj The given Evas object.
3349  *
3350  * Hidden objects, besides not being shown at all in your canvas,
3351  * won't be checked for changes on the canvas rendering
3352  * process. Furthermore, they will not catch input events. Thus, they
3353  * are much ligher (in processing needs) than an object that is
3354  * invisible due to indirect causes, such as being clipped or out of
3355  * the canvas' viewport.
3356  *
3357  * Besides becoming hidden, @p obj object's ::EVAS_CALLBACK_SHOW
3358  * callback will be called.
3359  *
3360  * @note All objects are created in the hidden state! If you want them
3361  * shown, use evas_object_show() after their creation.
3362  *
3363  * @see evas_object_show()
3364  * @see evas_object_visible_get()
3365  *
3366  * Example:
3367  * @dontinclude evas-object-manipulation.c
3368  * @skip if (evas_object_visible_get(d.clipper))
3369  * @until return
3370  *
3371  * See the full @ref Example_Evas_Object_Manipulation "example".
3372  *
3373  * @ingroup Evas_Object_Group_Basic
3374  */
3375 EAPI void              evas_object_hide                  (Evas_Object *obj) EINA_ARG_NONNULL(1);
3376
3377 /**
3378  * Retrieves whether or not the given Evas object is visible.
3379  *
3380  * @param   obj The given Evas object.
3381  * @return @c EINA_TRUE if the object is visible, @c EINA_FALSE
3382  * otherwise.
3383  *
3384  * This retrieves an object's visibily as the one enforced by
3385  * evas_object_show() and evas_object_hide().
3386  *
3387  * @note The value returned isn't, by any means, influenced by
3388  * clippers covering @obj, it being out of its canvas' viewport or
3389  * stacked below other object.
3390  *
3391  * @see evas_object_show()
3392  * @see evas_object_hide() (for an example)
3393  *
3394  * @ingroup Evas_Object_Group_Basic
3395  */
3396 EAPI Eina_Bool         evas_object_visible_get           (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
3397
3398
3399 /**
3400  * Sets the general/main color of the given Evas object to the given
3401  * one.
3402  *
3403  * @param obj The given Evas object.
3404  * @param r   The red component of the given color.
3405  * @param g   The green component of the given color.
3406  * @param b   The blue component of the given color.
3407  * @param a   The alpha component of the given color.
3408  *
3409  * @see evas_object_color_get() (for an example)
3410  * @note These color values are expected to be premultiplied by @p a.
3411  *
3412  * @ingroup Evas_Object_Group_Basic
3413  */
3414 EAPI void              evas_object_color_set             (Evas_Object *obj, int r, int g, int b, int a) EINA_ARG_NONNULL(1);
3415
3416 /**
3417  * Retrieves the general/main color of the given Evas object.
3418  *
3419  * @param obj The given Evas object to retrieve color from.
3420  * @param r Pointer to an integer in which to store the red component
3421  *          of the color.
3422  * @param g Pointer to an integer in which to store the green
3423  *          component of the color.
3424  * @param b Pointer to an integer in which to store the blue component
3425  *          of the color.
3426  * @param a Pointer to an integer in which to store the alpha
3427  *          component of the color.
3428  *
3429  * Retrieves the “main” color's RGB component (and alpha channel)
3430  * values, <b>which range from 0 to 255</b>. For the alpha channel,
3431  * which defines the object's transparency level, 0 means totally
3432  * trasparent, while 255 means opaque. These color values are
3433  * premultiplied by the alpha value.
3434  *
3435  * Usually you’ll use this attribute for text and rectangle objects,
3436  * where the “main” color is their unique one. If set for objects
3437  * which themselves have colors, like the images one, those colors get
3438  * modulated by this one.
3439  *
3440  * @note All newly created Evas rectangles get the default color
3441  * values of <code>255 255 255 255</code> (opaque white).
3442  *
3443  * @note Use @c NULL pointers on the components you're not interested
3444  * in: they'll be ignored by the function.
3445  *
3446  * Example:
3447  * @dontinclude evas-object-manipulation.c
3448  * @skip int alpha, r, g, b;
3449  * @until return
3450  *
3451  * See the full @ref Example_Evas_Object_Manipulation "example".
3452  *
3453  * @ingroup Evas_Object_Group_Basic
3454  */
3455 EAPI void              evas_object_color_get             (const Evas_Object *obj, int *r, int *g, int *b, int *a) EINA_ARG_NONNULL(1);
3456
3457
3458 /**
3459  * Retrieves the Evas canvas that the given object lives on.
3460  *
3461  * @param   obj The given Evas object.
3462  * @return  A pointer to the canvas where the object is on.
3463  *
3464  * This function is most useful at code contexts where you need to
3465  * operate on the canvas but have only the object pointer.
3466  *
3467  * @ingroup Evas_Object_Group_Basic
3468  */
3469 EAPI Evas             *evas_object_evas_get              (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
3470
3471 /**
3472  * Retrieves the type of the given Evas object.
3473  *
3474  * @param obj The given object.
3475  * @return The type of the object.
3476  *
3477  * For Evas' builtin types, the return strings will be one of:
3478  *   - <c>"rectangle"</c>,
3479  *   - <c>"line"</c>,
3480  *   - <c>"polygon"</c>,
3481  *   - <c>"text"</c>,
3482  *   - <c>"textblock"</c> and
3483  *   - <c>"image"</c>.
3484  *
3485  * For Evas smart objects (see @ref Evas_Smart_Group), the name of the
3486  * smart class itself is returned on this call. For the built-in smart
3487  * objects, these names are:
3488  *   - <c>"EvasObjectSmartClipped"</c>, for the clipped smart object
3489  *   - <c>"Evas_Object_Box"</c>, for the box object and
3490  *   - <c>"Evas_Object_Table"</c>, for the table object.
3491  *
3492  * Example:
3493  * @dontinclude evas-object-manipulation.c
3494  * @skip d.img = evas_object_image_filled_add(d.canvas);
3495  * @until border on the
3496  *
3497  * See the full @ref Example_Evas_Object_Manipulation "example".
3498  */
3499 EAPI const char       *evas_object_type_get              (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
3500
3501 /**
3502  * Raise @p obj to the bottom of its layer.
3503  *
3504  * @param obj the object to raise
3505  *
3506  * @p obj will, then, be the highest one in the layer it belongs
3507  * to. Object on other layers won't get touched.
3508  *
3509  * @see evas_object_stack_above()
3510  * @see evas_object_stack_below()
3511  * @see evas_object_lower()
3512  */
3513 EAPI void              evas_object_raise                 (Evas_Object *obj) EINA_ARG_NONNULL(1);
3514
3515 /**
3516  * Lower @p obj to the bottom of its layer.
3517  *
3518  * @param obj the object to lower
3519  *
3520  * @p obj will, then, be the lowest one in the layer it belongs
3521  * to. Objects on other layers won't get touched.
3522  *
3523  * @see evas_object_stack_above()
3524  * @see evas_object_stack_below()
3525  * @see evas_object_raise()
3526  */
3527 EAPI void              evas_object_lower                 (Evas_Object *obj) EINA_ARG_NONNULL(1);
3528
3529 /**
3530  * Stack @p obj immediately above @p above
3531  *
3532  * @param obj the object to stack
3533  * @param above the object above which to stack
3534  *
3535  * Objects, in a given canvas, are stacked in the order they get added
3536  * to it.  This means that, if they overlap, the highest ones will
3537  * cover the lowest ones, in that order. This function is a way to
3538  * change the stacking order for the objects.
3539  *
3540  * This function is intended to be used with <b>objects belonging to
3541  * the same layer</b> in a given canvas, otherwise it will fail (and
3542  * accomplish nothing).
3543  *
3544  * If you have smart objects on your canvas and @p obj is a member of
3545  * one of them, then @p above must also be a member of the same
3546  * smart object.
3547  *
3548  * Similarly, if @p obj is not a member of a smart object, @p above
3549  * must not be either.
3550  *
3551  * @see evas_object_layer_get()
3552  * @see evas_object_layer_set()
3553  * @see evas_object_stack_below()
3554  */
3555 EAPI void              evas_object_stack_above           (Evas_Object *obj, Evas_Object *above) EINA_ARG_NONNULL(1, 2);
3556
3557 /**
3558  * Stack @p obj immediately below @p below
3559  *
3560  * @param obj the object to stack
3561  * @param below the object below which to stack
3562  *
3563  * Objects, in a given canvas, are stacked in the order they get added
3564  * to it.  This means that, if they overlap, the highest ones will
3565  * cover the lowest ones, in that order. This function is a way to
3566  * change the stacking order for the objects.
3567  *
3568  * This function is intended to be used with <b>objects belonging to
3569  * the same layer</b> in a given canvas, otherwise it will fail (and
3570  * accomplish nothing).
3571  *
3572  * If you have smart objects on your canvas and @p obj is a member of
3573  * one of them, then @p below must also be a member of the same
3574  * smart object.
3575  *
3576  * Similarly, if @p obj is not a member of a smart object, @p below
3577  * must not be either.
3578  *
3579  * @see evas_object_layer_get()
3580  * @see evas_object_layer_set()
3581  * @see evas_object_stack_below()
3582  */
3583 EAPI void              evas_object_stack_below           (Evas_Object *obj, Evas_Object *below) EINA_ARG_NONNULL(1, 2);
3584
3585 /**
3586  * Get the Evas object stacked right above @p obj
3587  *
3588  * @param obj an #Evas_Object
3589  * @return the #Evas_Object directly above @p obj, if any, or @c NULL,
3590  * if none
3591  *
3592  * This function will traverse layers in its search, if there are
3593  * objects on layers above the one @p obj is placed at.
3594  *
3595  * @see evas_object_layer_get()
3596  * @see evas_object_layer_set()
3597  * @see evas_object_below_get()
3598  *
3599  */
3600 EAPI Evas_Object      *evas_object_above_get             (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
3601
3602 /**
3603  * Get the Evas object stacked right below @p obj
3604  *
3605  * @param obj an #Evas_Object
3606  * @return the #Evas_Object directly below @p obj, if any, or @c NULL,
3607  * if none
3608  *
3609  * This function will traverse layers in its search, if there are
3610  * objects on layers below the one @p obj is placed at.
3611  *
3612  * @see evas_object_layer_get()
3613  * @see evas_object_layer_set()
3614  * @see evas_object_below_get()
3615  */
3616 EAPI Evas_Object      *evas_object_below_get             (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
3617
3618 /**
3619  * @}
3620  */
3621
3622 /**
3623  * @defgroup Evas_Object_Group_Events Object Events
3624  *
3625  * Objects generate events when they are moved, resized, when their
3626  * visibility change, when they are deleted and so on. These methods
3627  * allow one to be notified about and to handle such events.
3628  *
3629  * Objects also generate events on input (keyboard and mouse), if they
3630  * accept them (are visible, focused, etc).
3631  *
3632  * For each of those events, Evas provides a way for one to register
3633  * callback functions to be issued just after they happen.
3634  *
3635  * The following figure illustrates some Evas (event) callbacks:
3636  *
3637  * @image html evas-callbacks.png
3638  * @image rtf evas-callbacks.png
3639  * @image latex evas-callbacks.eps
3640  *
3641  * Thees events have their values in the #Evas_Callback_Type
3642  * enumeration, which has also ones happening on the canvas level (se
3643  * #Evas_Canvas_Events).
3644  *
3645  * Examples on this group of functions can be found @ref
3646  * Example_Evas_Stacking "here" and @ref Example_Evas_Events "here".
3647  *
3648  * @ingroup Evas_Object_Group
3649  */
3650
3651 /**
3652  * @addtogroup Evas_Object_Group_Events
3653  * @{
3654  */
3655
3656 /**
3657  * Add (register) a callback function to a given Evas object event.
3658  *
3659  * @param obj Object to attach a callback to
3660  * @param type The type of event that will trigger the callback
3661  * @param func The function to be called when the event is triggered
3662  * @param data The data pointer to be passed to @p func
3663  *
3664  * This function adds a function callback to an object when the event
3665  * of type @p type occurs on object @p obj. The function is @p func.
3666  *
3667  * In the event of a memory allocation error during addition of the
3668  * callback to the object, evas_alloc_error() should be used to
3669  * determine the nature of the error, if any, and the program should
3670  * sensibly try and recover.
3671  *
3672  * A callback function must have the ::Evas_Object_Event_Cb prototype
3673  * definition. The first parameter (@p data) in this definition will
3674  * have the same value passed to evas_object_event_callback_add() as
3675  * the @p data parameter, at runtime. The second parameter @p e is the
3676  * canvas pointer on which the event occurred. The third parameter is
3677  * a pointer to the object on which event occurred. Finally, the
3678  * fourth parameter @p event_info is a pointer to a data structure
3679  * that may or may not be passed to the callback, depending on the
3680  * event type that triggered the callback. This is so because some
3681  * events don't carry extra context with them, but others do.
3682  *
3683  * The event type @p type to trigger the function may be one of
3684  * #EVAS_CALLBACK_MOUSE_IN, #EVAS_CALLBACK_MOUSE_OUT,
3685  * #EVAS_CALLBACK_MOUSE_DOWN, #EVAS_CALLBACK_MOUSE_UP,
3686  * #EVAS_CALLBACK_MOUSE_MOVE, #EVAS_CALLBACK_MOUSE_WHEEL,
3687  * #EVAS_CALLBACK_MULTI_DOWN, #EVAS_CALLBACK_MULTI_UP,
3688  * #EVAS_CALLBACK_MULTI_MOVE, #EVAS_CALLBACK_FREE,
3689  * #EVAS_CALLBACK_KEY_DOWN, #EVAS_CALLBACK_KEY_UP,
3690  * #EVAS_CALLBACK_FOCUS_IN, #EVAS_CALLBACK_FOCUS_OUT,
3691  * #EVAS_CALLBACK_SHOW, #EVAS_CALLBACK_HIDE, #EVAS_CALLBACK_MOVE,
3692  * #EVAS_CALLBACK_RESIZE, #EVAS_CALLBACK_RESTACK, #EVAS_CALLBACK_DEL,
3693  * #EVAS_CALLBACK_HOLD, #EVAS_CALLBACK_CHANGED_SIZE_HINTS,
3694  * #EVAS_CALLBACK_IMAGE_PRELOADED or #EVAS_CALLBACK_IMAGE_UNLOADED.
3695  *
3696  * This determines the kind of event that will trigger the callback.
3697  * What follows is a list explaining better the nature of each type of
3698  * event, along with their associated @p event_info pointers:
3699  *
3700  * - #EVAS_CALLBACK_MOUSE_IN: @p event_info is a pointer to an
3701  *   #Evas_Event_Mouse_In struct\n\n
3702  *   This event is triggered when the mouse pointer enters the area
3703  *   (not shaded by other objects) of the object @p obj. This may
3704  *   occur by the mouse pointer being moved by
3705  *   evas_event_feed_mouse_move() calls, or by the object being shown,
3706  *   raised, moved, resized, or other objects being moved out of the
3707  *   way, hidden or lowered, whatever may cause the mouse pointer to
3708  *   get on top of @p obj, having been on top of another object
3709  *   previously.
3710  *
3711  * - #EVAS_CALLBACK_MOUSE_OUT: @p event_info is a pointer to an
3712  *   #Evas_Event_Mouse_Out struct\n\n
3713  *   This event is triggered exactly like #EVAS_CALLBACK_MOUSE_IN is,
3714  *   but it occurs when the mouse pointer exits an object's area. Note
3715  *   that no mouse out events will be reported if the mouse pointer is
3716  *   implicitly grabbed to an object (mouse buttons are down, having
3717  *   been pressed while the pointer was over that object). In these
3718  *   cases, mouse out events will be reported once all buttons are
3719  *   released, if the mouse pointer has left the object's area. The
3720  *   indirect ways of taking off the mouse pointer from an object,
3721  *   like cited above, for #EVAS_CALLBACK_MOUSE_IN, also apply here,
3722  *   naturally.
3723  *
3724  * - #EVAS_CALLBACK_MOUSE_DOWN: @p event_info is a pointer to an
3725  *   #Evas_Event_Mouse_Down struct\n\n
3726  *   This event is triggered by a mouse button being pressed while the
3727  *   mouse pointer is over an object. If the pointer mode for Evas is
3728  *   #EVAS_OBJECT_POINTER_MODE_AUTOGRAB (default), this causes this
3729  *   object to <b>passively grab the mouse</b> until all mouse buttons
3730  *   have been released: all future mouse events will be reported to
3731  *   only this object until no buttons are down. That includes mouse
3732  *   move events, mouse in and mouse out events, and further button
3733  *   presses. When all buttons are released, event propagation will
3734  *   occur as normal (see #Evas_Object_Pointer_Mode).
3735  *
3736  * - #EVAS_CALLBACK_MOUSE_UP: @p event_info is a pointer to an
3737  *   #Evas_Event_Mouse_Up struct\n\n
3738  *   This event is triggered by a mouse button being released while
3739  *   the mouse pointer is over an object's area (or when passively
3740  *   grabbed to an object).
3741  *
3742  * - #EVAS_CALLBACK_MOUSE_MOVE: @p event_info is a pointer to an
3743  *   #Evas_Event_Mouse_Move struct\n\n
3744  *   This event is triggered by the mouse pointer being moved while
3745  *   over an object's area (or while passively grabbed to an object).
3746  *
3747  * - #EVAS_CALLBACK_MOUSE_WHEEL: @p event_info is a pointer to an
3748  *   #Evas_Event_Mouse_Wheel struct\n\n
3749  *   This event is triggered by the mouse wheel being rolled while the
3750  *   mouse pointer is over an object (or passively grabbed to an
3751  *   object).
3752  *
3753  * - #EVAS_CALLBACK_MULTI_DOWN: @p event_info is a pointer to an
3754  *   #Evas_Event_Multi_Down struct
3755  *
3756  * - #EVAS_CALLBACK_MULTI_UP: @p event_info is a pointer to an
3757  *   #Evas_Event_Multi_Up struct
3758  *
3759  * - #EVAS_CALLBACK_MULTI_MOVE: @p event_info is a pointer to an
3760  *   #Evas_Event_Multi_Move struct
3761  *
3762  * - #EVAS_CALLBACK_FREE: @p event_info is @c NULL \n\n
3763  *   This event is triggered just before Evas is about to free all
3764  *   memory used by an object and remove all references to it. This is
3765  *   useful for programs to use if they attached data to an object and
3766  *   want to free it when the object is deleted. The object is still
3767  *   valid when this callback is called, but after it returns, there
3768  *   is no guarantee on the object's validity.
3769  *
3770  * - #EVAS_CALLBACK_KEY_DOWN: @p event_info is a pointer to an
3771  *   #Evas_Event_Key_Down struct\n\n
3772  *   This callback is called when a key is pressed and the focus is on
3773  *   the object, or a key has been grabbed to a particular object
3774  *   which wants to intercept the key press regardless of what object
3775  *   has the focus.
3776  *
3777  * - #EVAS_CALLBACK_KEY_UP: @p event_info is a pointer to an
3778  *   #Evas_Event_Key_Up struct \n\n
3779  *   This callback is called when a key is released and the focus is
3780  *   on the object, or a key has been grabbed to a particular object
3781  *   which wants to intercept the key release regardless of what
3782  *   object has the focus.
3783  *
3784  * - #EVAS_CALLBACK_FOCUS_IN: @p event_info is @c NULL \n\n
3785  *   This event is called when an object gains the focus. When it is
3786  *   called the object has already gained the focus.
3787  *
3788  * - #EVAS_CALLBACK_FOCUS_OUT: @p event_info is @c NULL \n\n
3789  *   This event is triggered when an object loses the focus. When it
3790  *   is called the object has already lost the focus.
3791  *
3792  * - #EVAS_CALLBACK_SHOW: @p event_info is @c NULL \n\n
3793  *   This event is triggered by the object being shown by
3794  *   evas_object_show().
3795  *
3796  * - #EVAS_CALLBACK_HIDE: @p event_info is @c NULL \n\n
3797  *   This event is triggered by an object being hidden by
3798  *   evas_object_hide().
3799  *
3800  * - #EVAS_CALLBACK_MOVE: @p event_info is @c NULL \n\n
3801  *   This event is triggered by an object being
3802  *   moved. evas_object_move() can trigger this, as can any
3803  *   object-specific manipulations that would mean the object's origin
3804  *   could move.
3805  *
3806  * - #EVAS_CALLBACK_RESIZE: @p event_info is @c NULL \n\n
3807  *   This event is triggered by an object being resized. Resizes can
3808  *   be triggered by evas_object_resize() or by any object-specific
3809  *   calls that may cause the object to resize.
3810  *
3811  * - #EVAS_CALLBACK_RESTACK: @p event_info is @c NULL \n\n
3812  *   This event is triggered by an object being re-stacked. Stacking
3813  *   changes can be triggered by
3814  *   evas_object_stack_below()/evas_object_stack_above() and others.
3815  *
3816  * - #EVAS_CALLBACK_DEL: @p event_info is @c NULL.
3817  *
3818  * - #EVAS_CALLBACK_HOLD: @p event_info is a pointer to an
3819  *   #Evas_Event_Hold struct
3820  *
3821  * - #EVAS_CALLBACK_CHANGED_SIZE_HINTS: @p event_info is @c NULL.
3822  *
3823  * - #EVAS_CALLBACK_IMAGE_PRELOADED: @p event_info is @c NULL.
3824  *
3825  * - #EVAS_CALLBACK_IMAGE_UNLOADED: @p event_info is @c NULL.
3826  *
3827  * @note Be careful not to add the same callback multiple times, if
3828  * that's not what you want, because Evas won't check if a callback
3829  * existed before exactly as the one being registered (and thus, call
3830  * it more than once on the event, in this case). This would make
3831  * sense if you passed different functions and/or callback data, only.
3832  *
3833  * Example:
3834  * @dontinclude evas-events.c
3835  * @skip evas_object_event_callback_add(
3836  * @until }
3837  *
3838  * See the full example @ref Example_Evas_Events "here".
3839  *
3840  */
3841    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);
3842
3843 /**
3844  * Add (register) a callback function to a given Evas object event with a
3845  * non-default priority set. Except for the priority field, it's exactly the
3846  * same as @ref evas_object_event_callback_add
3847  *
3848  * @param obj Object to attach a callback to
3849  * @param type The type of event that will trigger the callback
3850  * @param priority The priority of the callback, lower values called first.
3851  * @param func The function to be called when the event is triggered
3852  * @param data The data pointer to be passed to @p func
3853  *
3854  * @see evas_object_event_callback_add
3855  * @since 1.1.0
3856  */
3857 EAPI void                 evas_object_event_callback_priority_add(Evas_Object *obj, Evas_Callback_Type type, Evas_Callback_Priority priority, Evas_Object_Event_Cb func, const void *data) EINA_ARG_NONNULL(1, 4);
3858
3859 /**
3860  * Delete a callback function from an object
3861  *
3862  * @param obj Object to remove a callback from
3863  * @param type The type of event that was triggering the callback
3864  * @param func The function that was to be called when the event was triggered
3865  * @return The data pointer that was to be passed to the callback
3866  *
3867  * This function removes the most recently added callback from the
3868  * object @p obj which was triggered by the event type @p type and was
3869  * calling the function @p func when triggered. If the removal is
3870  * successful it will also return the data pointer that was passed to
3871  * evas_object_event_callback_add() when the callback was added to the
3872  * object. If not successful NULL will be returned.
3873  *
3874  * Example:
3875  * @code
3876  * extern Evas_Object *object;
3877  * void *my_data;
3878  * void up_callback(void *data, Evas *e, Evas_Object *obj, void *event_info);
3879  *
3880  * my_data = evas_object_event_callback_del(object, EVAS_CALLBACK_MOUSE_UP, up_callback);
3881  * @endcode
3882  */
3883 EAPI void             *evas_object_event_callback_del     (Evas_Object *obj, Evas_Callback_Type type, Evas_Object_Event_Cb func) EINA_ARG_NONNULL(1, 3);
3884
3885 /**
3886  * Delete (unregister) a callback function registered to a given
3887  * Evas object event.
3888  *
3889  * @param obj Object to remove a callback from
3890  * @param type The type of event that was triggering the callback
3891  * @param func The function that was to be called when the event was
3892  * triggered
3893  * @param data The data pointer that was to be passed to the callback
3894  * @return The data pointer that was to be passed to the callback
3895  *
3896  * This function removes the most recently added callback from the
3897  * object @p obj, which was triggered by the event type @p type and was
3898  * calling the function @p func with data @p data, when triggered. If
3899  * the removal is successful it will also return the data pointer that
3900  * was passed to evas_object_event_callback_add() (that will be the
3901  * same as the parameter) when the callback was added to the
3902  * object. In errors, @c NULL will be returned.
3903  *
3904  * @note For deletion of Evas object events callbacks filtering by
3905  * just type and function pointer, user
3906  * evas_object_event_callback_del().
3907  *
3908  * Example:
3909  * @code
3910  * extern Evas_Object *object;
3911  * void *my_data;
3912  * void up_callback(void *data, Evas *e, Evas_Object *obj, void *event_info);
3913  *
3914  * my_data = evas_object_event_callback_del_full(object, EVAS_CALLBACK_MOUSE_UP, up_callback, data);
3915  * @endcode
3916  */
3917 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);
3918
3919
3920 /**
3921  * Set whether an Evas object is to pass (ignore) events.
3922  *
3923  * @param obj the Evas object to operate on
3924  * @param pass whether @p obj is to pass events (@c EINA_TRUE) or not
3925  * (@c EINA_FALSE)
3926  *
3927  * If @p pass is @c EINA_TRUE, it will make events on @p obj to be @b
3928  * ignored. They will be triggered on the @b next lower object (that
3929  * is not set to pass events), instead (see evas_object_below_get()).
3930  *
3931  * If @p pass is @c EINA_FALSE, events will be processed on that
3932  * object as normal.
3933  *
3934  * @see evas_object_pass_events_get() for an example
3935  * @see evas_object_repeat_events_set()
3936  * @see evas_object_propagate_events_set()
3937  */
3938 EAPI void              evas_object_pass_events_set        (Evas_Object *obj, Eina_Bool pass) EINA_ARG_NONNULL(1);
3939
3940 /**
3941  * Determine whether an object is set to pass (ignore) events.
3942  *
3943  * @param obj the Evas object to get information from.
3944  * @return pass whether @p obj is set to pass events (@c EINA_TRUE) or not
3945  * (@c EINA_FALSE)
3946  *
3947  * Example:
3948  * @dontinclude evas-stacking.c
3949  * @skip if (strcmp(ev->keyname, "p") == 0)
3950  * @until }
3951  *
3952  * See the full @ref Example_Evas_Stacking "example".
3953  *
3954  * @see evas_object_pass_events_set()
3955  * @see evas_object_repeat_events_get()
3956  * @see evas_object_propagate_events_get()
3957  */
3958 EAPI Eina_Bool         evas_object_pass_events_get        (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
3959
3960 /**
3961  * Set whether an Evas object is to repeat events.
3962  *
3963  * @param obj the Evas object to operate on
3964  * @param repeat whether @p obj is to repeat events (@c EINA_TRUE) or not
3965  * (@c EINA_FALSE)
3966  *
3967  * If @p repeat is @c EINA_TRUE, it will make events on @p obj to also
3968  * be repeated for the @b next lower object in the objects' stack (see
3969  * see evas_object_below_get()).
3970  *
3971  * If @p repeat is @c EINA_FALSE, events occurring on @p obj will be
3972  * processed only on it.
3973  *
3974  * Example:
3975  * @dontinclude evas-stacking.c
3976  * @skip if (strcmp(ev->keyname, "r") == 0)
3977  * @until }
3978  *
3979  * See the full @ref Example_Evas_Stacking "example".
3980  *
3981  * @see evas_object_repeat_events_get()
3982  * @see evas_object_pass_events_get()
3983  * @see evas_object_propagate_events_get()
3984  */
3985 EAPI void              evas_object_repeat_events_set      (Evas_Object *obj, Eina_Bool repeat) EINA_ARG_NONNULL(1);
3986
3987 /**
3988  * Determine whether an object is set to repeat events.
3989  *
3990  * @param obj the given Evas object pointer
3991  * @retrieve whether @p obj is set to repeat events (@c EINA_TRUE)
3992  * or not (@c EINA_FALSE)
3993  *
3994  * @see evas_object_repeat_events_set() for an example
3995  * @see evas_object_pass_events_set()
3996  * @see evas_object_propagate_events_set()
3997  */
3998 EAPI Eina_Bool         evas_object_repeat_events_get      (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
3999
4000 /**
4001  * Set whether events on a smart object's member should get propagated
4002  * up to its parent.
4003  *
4004  * @param obj the smart object's child to operate on
4005  * @param prop whether to propagate events (@c EINA_TRUE) or not (@c
4006  * EINA_FALSE)
4007  *
4008  * This function has @b no effect if @p obj is not a member of a smart
4009  * object.
4010  *
4011  * If @p prop is @c EINA_TRUE, events occurring on this object will be
4012  * propagated on to the smart object of which @p obj is a member.  If
4013  * @p prop is @c EINA_FALSE, events occurring on this object will @b
4014  * not be propagated on to the smart object of which @p obj is a
4015  * member.  The default value is @c EINA_TRUE.
4016  *
4017  * @see evas_object_event_callback_add()
4018  * @see evas_object_propagate_events_get()
4019  * @see evas_object_repeat_events_get()
4020  * @see evas_object_pass_events_get()
4021  */
4022 EAPI void              evas_object_propagate_events_set   (Evas_Object *obj, Eina_Bool prop) EINA_ARG_NONNULL(1);
4023
4024 /**
4025  * Retrieve whether an Evas object is set to propagate events.
4026  *
4027  * @param obj the given Evas object pointer
4028  * @return whether @p obj is set to propagate events (@c EINA_TRUE)
4029  * or not (@c EINA_FALSE)
4030  *
4031  * @see evas_object_event_callback_add()
4032  * @see evas_object_propagate_events_set()
4033  * @see evas_object_repeat_events_set()
4034  * @see evas_object_pass_events_set()
4035  */
4036 EAPI Eina_Bool         evas_object_propagate_events_get   (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
4037
4038 /**
4039  * @}
4040  */
4041
4042 /**
4043  * @defgroup Evas_Object_Group_Map UV Mapping (Rotation, Perspective, 3D...)
4044  *
4045  * Evas allows different transformations to be applied to all kinds of
4046  * objects. These are applied by means of UV mapping.
4047  *
4048  * With UV mapping, one maps points in the source object to a 3D space
4049  * positioning at target. This allows rotation, perspective, scale and
4050  * lots of other effects, depending on the map that is used.
4051  *
4052  * Each map point may carry a multiplier color. If properly
4053  * calculated, these can do shading effects on the object, producing
4054  * 3D effects.
4055  *
4056  * As usual, Evas provides both the raw and easy to use methods. The
4057  * raw methods allow developer to create its maps somewhere else,
4058  * maybe load them from some file format. The easy to use methods,
4059  * calculate the points given some high-level parameters, such as
4060  * rotation angle, ambient light and so on.
4061  *
4062  * @note applying mapping will reduce performance, so use with
4063  *       care. The impact on performance depends on engine in
4064  *       use. Software is quite optimized, but not as fast as OpenGL.
4065  *
4066  * @section sec-map-points Map points
4067  * @subsection subsec-rotation Rotation
4068  *
4069  * A map consists of a set of points, currently only four are supported. Each
4070  * of these points contains a set of canvas coordinates @c x and @c y that
4071  * can be used to alter the geometry of the mapped object, and a @c z
4072  * coordinate that indicates the depth of that point. This last coordinate
4073  * does not normally affect the map, but it's used by several of the utility
4074  * functions to calculate the right position of the point given other
4075  * parameters.
4076  *
4077  * The coordinates for each point are set with evas_map_point_coord_set().
4078  * The following image shows a map set to match the geometry of an existing
4079  * object.
4080  *
4081  * @image html map-set-map-points-1.png
4082  * @image rtf map-set-map-points-1.png
4083  * @image latex map-set-map-points-1.eps
4084  *
4085  * This is a common practice, so there are a few functions that help make it
4086  * easier.
4087  *
4088  * evas_map_util_points_populate_from_geometry() sets the coordinates of each
4089  * point in the given map to match the rectangle defined by the function
4090  * parameters.
4091  *
4092  * evas_map_util_points_populate_from_object() and
4093  * evas_map_util_points_populate_from_object_full() both take an object and
4094  * set the map points to match its geometry. The difference between the two
4095  * is that the first function sets the @c z value of all points to 0, while
4096  * the latter receives the value to set in said coordinate as a parameter.
4097  *
4098  * The following lines of code all produce the same result as in the image
4099  * above.
4100  * @code
4101  * evas_map_util_points_populate_from_geometry(m, 100, 100, 200, 200, 0);
4102  * // Assuming o is our original object
4103  * evas_object_move(o, 100, 100);
4104  * evas_object_resize(o, 200, 200);
4105  * evas_map_util_points_populate_from_object(m, o);
4106  * evas_map_util_points_populate_from_object_full(m, o, 0);
4107  * @endcode
4108  *
4109  * Several effects can be applied to an object by simply setting each point
4110  * of the map to the right coordinates. For example, a simulated perspective
4111  * could be achieve as follows.
4112  *
4113  * @image html map-set-map-points-2.png
4114  * @image rtf map-set-map-points-2.png
4115  * @image latex map-set-map-points-2.eps
4116  *
4117  * As said before, the @c z coordinate is unused here so when setting points
4118  * by hand, its value is of no importance.
4119  *
4120  * @image html map-set-map-points-3.png
4121  * @image rtf map-set-map-points-3.png
4122  * @image latex map-set-map-points-3.eps
4123  *
4124  * In all three cases above, setting the map to be used by the object is the
4125  * same.
4126  * @code
4127  * evas_object_map_set(o, m);
4128  * evas_object_map_enable_set(o, EINA_TRUE);
4129  * @endcode
4130  *
4131  * Doing things this way, however, is a lot of work that can be avoided by
4132  * using the provided utility functions, as described in the next section.
4133  *
4134  * @section map-utils Utility functions
4135  *
4136  * Utility functions take an already set up map and alter it to produce a
4137  * specific effect. For example, to rotate an object around its own center
4138  * you would need to take the rotation angle, the coordinates of each corner
4139  * of the object and do all the math to get the new set of coordinates that
4140  * need to tbe set in the map.
4141  *
4142  * Or you can use this code:
4143  * @code
4144  * evas_object_geometry_get(o, &x, &y, &w, &h);
4145  * m = evas_map_new(4);
4146  * evas_map_util_points_populate_from_object(m, o);
4147  * evas_map_util_rotate(m, 45, x + (w / 2), y + (h / 2));
4148  * evas_object_map_set(o, m);
4149  * evas_object_map_enable_set(o, EINA_TRUE);
4150  * evas_map_free(m);
4151  * @endcode
4152  *
4153  * Which will rotate the object around its center point in a 45 degree angle
4154  * in the clockwise direction, taking it from this
4155  *
4156  * @image html map-rotation-2d-1.png
4157  * @image rtf map-rotation-2d-1.png
4158  * @image latex map-rotation-2d-1.eps
4159  *
4160  * to this
4161  *
4162  * @image html map-rotation-2d-2.png
4163  * @image rtf map-rotation-2d-2.png
4164  * @image latex map-rotation-2d-2.eps
4165  *
4166  * Objects may be rotated around any other point just by setting the last two
4167  * paramaters of the evas_map_util_rotate() function to the right values. A
4168  * circle of roughly the diameter of the object overlaid on each image shows
4169  * where the center of rotation is set for each example.
4170  *
4171  * For example, this code
4172  * @code
4173  * evas_object_geometry_get(o, &x, &y, &w, &h);
4174  * m = evas_map_new(4);
4175  * evas_map_util_points_populate_from_object(m, o);
4176  * evas_map_util_rotate(m, 45, x + w - 20, y + h - 20);
4177  * evas_object_map_set(o, m);
4178  * evas_object_map_enable_set(o, EINA_TRUE);
4179  * evas_map_free(m);
4180  * @endcode
4181  *
4182  * produces something like
4183  *
4184  * @image html map-rotation-2d-3.png
4185  * @image rtf map-rotation-2d-3.png
4186  * @image latex map-rotation-2d-3.eps
4187  *
4188  * And the following
4189  * @code
4190  * evas_output_size_get(evas, &w, &h);
4191  * m = evas_map_new(4);
4192  * evas_map_util_points_populate_from_object(m, o);
4193  * evas_map_util_rotate(m, 45, w, h);
4194  * evas_object_map_set(o, m);
4195  * evas_object_map_enable_set(o, EINA_TRUE);
4196  * evas_map_free(m);
4197  * @endcode
4198  *
4199  * rotates the object around the center of the window
4200  *
4201  * @image html map-rotation-2d-4.png
4202  * @image rtf map-rotation-2d-4.png
4203  * @image latex map-rotation-2d-4.eps
4204  *
4205  * @subsection subsec-3d 3D Maps
4206  *
4207  * Maps can also be used to achieve the effect of 3-dimensionality. When doing
4208  * this, the @c z coordinate of each point counts, with higher values meaning
4209  * the point is further into the screen, and smaller values (negative, usually)
4210  * meaning the point is closwer towards the user.
4211  *
4212  * Thinking in 3D also introduces the concept of back-face of an object. An
4213  * object is said to be facing the user when all its points are placed in a
4214  * clockwise fashion. The next image shows this, with each point showing the
4215  * with which is identified within the map.
4216  *
4217  * @image html map-point-order-face.png
4218  * @image rtf map-point-order-face.png
4219  * @image latex map-point-order-face.eps
4220  *
4221  * Rotating this map around the @c Y axis would leave the order of the points
4222  * in a counter-clockwise fashion, as seen in the following image.
4223  *
4224  * @image html map-point-order-back.png
4225  * @image rtf map-point-order-back.png
4226  * @image latex map-point-order-back.eps
4227  *
4228  * This way we can say that we are looking at the back face of the object.
4229  * This will have stronger implications later when we talk about lighting.
4230  *
4231  * To know if a map is facing towards the user or not it's enough to use
4232  * the evas_map_util_clockwise_get() function, but this is normally done
4233  * after all the other operations are applied on the map.
4234  *
4235  * @subsection subsec-3d-rot 3D rotation and perspective
4236  *
4237  * Much like evas_map_util_rotate(), there's the function
4238  * evas_map_util_3d_rotate() that transforms the map to apply a 3D rotation
4239  * to an object. As in its 2D counterpart, the rotation can be applied around
4240  * any point in the canvas, this time with a @c z coordinate too. The rotation
4241  * can also be around any of the 3 axis.
4242  *
4243  * Starting from this simple setup
4244  *
4245  * @image html map-3d-basic-1.png
4246  * @image rtf map-3d-basic-1.png
4247  * @image latex map-3d-basic-1.eps
4248  *
4249  * and setting maps so that the blue square to rotate on all axis around a
4250  * sphere that uses the object as its center, and the red square to rotate
4251  * around the @c Y axis, we get the following. A simple overlay over the image
4252  * shows the original geometry of each object and the axis around which they
4253  * are being rotated, with the @c Z one not appearing due to being orthogonal
4254  * to the screen.
4255  *
4256  * @image html map-3d-basic-2.png
4257  * @image rtf map-3d-basic-2.png
4258  * @image latex map-3d-basic-2.eps
4259  *
4260  * which doesn't look very real. This can be helped by adding perspective
4261  * to the transformation, which can be simply done by calling
4262  * evas_map_util_3d_perspective() on the map after its position has been set.
4263  * The result in this case, making the vanishing point the center of each
4264  * object:
4265  *
4266  * @image html map-3d-basic-3.png
4267  * @image rtf map-3d-basic-3.png
4268  * @image latex map-3d-basic-3.eps
4269  *
4270  * @section sec-color Color and lighting
4271  *
4272  * Each point in a map can be set to a color, which will be multiplied with
4273  * the objects own color and linearly interpolated in between adjacent points.
4274  * This is done with evas_map_point_color_set() for each point of the map,
4275  * or evas_map_util_points_color_set() to set every point to the same color.
4276  *
4277  * When using 3D effects, colors can be used to improve the looks of them by
4278  * simulating a light source. The evas_map_util_3d_lighting() function makes
4279  * this task easier by taking the coordinates of the light source and its
4280  * color, along with the color of the ambient light. Evas then sets the color
4281  * of each point based on the distance to the light source, the angle with
4282  * which the object is facing the light and the ambient light. Here, the
4283  * orientation of each point as explained before, becomes more important.
4284  * If the map is defined counter-clockwise, the object will be facing away
4285  * from the user and thus become obscured, since no light would be reflecting
4286  * from it.
4287  *
4288  * @image html map-light.png
4289  * @image rtf map-light.png
4290  * @image latex map-light.eps
4291  * @note Object facing the light source
4292  *
4293  * @image html map-light2.png
4294  * @image rtf map-light2.png
4295  * @image latex map-light2.eps
4296  * @note Same object facing away from the user
4297  *
4298  * @section Image mapping
4299  *
4300  * @image html map-uv-mapping-1.png
4301  * @image rtf map-uv-mapping-1.png
4302  * @image latex map-uv-mapping-1.eps
4303  *
4304  * Images need some special handlign when mapped. Evas can easily take care
4305  * of objects and do almost anything with them, but it's completely oblivious
4306  * to the content of images, so each point in the map needs to be told to what
4307  * pixel in the source image it belongs. Failing to do may sometimes result
4308  * in the expected behavior, or it may look like a partial work.
4309  *
4310  * The next image illustrates one possibility of a map being set to an image
4311  * object, without setting the right UV mapping for each point. The objects
4312  * themselves are mapped properly to their new geometry, but the image content
4313  * may not be displayed correctly within the mapped object.
4314  *
4315  * @image html map-uv-mapping-2.png
4316  * @image rtf map-uv-mapping-2.png
4317  * @image latex map-uv-mapping-2.eps
4318  *
4319  * Once Evas knows how to handle the source image within the map, it will
4320  * transform it as needed. This is done with evas_map_point_image_uv_set(),
4321  * which tells the map to which pixel in image it maps.
4322  *
4323  * To match our example images to the maps above all we need is the size of
4324  * each image, which can always be found with evas_object_image_size_get().
4325  *
4326  * @code
4327  * evas_map_point_image_uv_set(m, 0, 0, 0);
4328  * evas_map_point_image_uv_set(m, 1, 150, 0);
4329  * evas_map_point_image_uv_set(m, 2, 150, 200);
4330  * evas_map_point_image_uv_set(m, 3, 0, 200);
4331  * evas_object_map_set(o, m);
4332  * evas_object_map_enable_set(o, EINA_TRUE);
4333  *
4334  * evas_map_point_image_uv_set(m, 0, 0, 0);
4335  * evas_map_point_image_uv_set(m, 1, 120, 0);
4336  * evas_map_point_image_uv_set(m, 2, 120, 160);
4337  * evas_map_point_image_uv_set(m, 3, 0, 160);
4338  * evas_object_map_set(o2, m);
4339  * evas_object_map_enable_set(o2, EINA_TRUE);
4340  * @endcode
4341  *
4342  * To get
4343  *
4344  * @image html map-uv-mapping-3.png
4345  * @image rtf map-uv-mapping-3.png
4346  * @image latex map-uv-mapping-3.eps
4347  *
4348  * Maps can also be set to use part of an image only, or even map them inverted,
4349  * and combined with evas_object_image_source_set() it can be used to achieve
4350  * more interesting results.
4351  *
4352  * @code
4353  * evas_object_image_size_get(evas_object_image_source_get(o), &w, &h);
4354  * evas_map_point_image_uv_set(m, 0, 0, h);
4355  * evas_map_point_image_uv_set(m, 1, w, h);
4356  * evas_map_point_image_uv_set(m, 2, w, h / 3);
4357  * evas_map_point_image_uv_set(m, 3, 0, h / 3);
4358  * evas_object_map_set(o, m);
4359  * evas_object_map_enable_set(o, EINA_TRUE);
4360  * @endcode
4361  *
4362  * @image html map-uv-mapping-4.png
4363  * @image rtf map-uv-mapping-4.png
4364  * @image latex map-uv-mapping-4.eps
4365  *
4366  * Examples:
4367  * @li @ref Example_Evas_Map_Overview
4368  *
4369  * @ingroup Evas_Object_Group
4370  *
4371  * @{
4372  */
4373
4374 /**
4375  * Enable or disable the map that is set.
4376  *
4377  * Enable or disable the use of map for the object @p obj.
4378  * On enable, the object geometry will be saved, and the new geometry will
4379  * change (position and size) to reflect the map geometry set.
4380  *
4381  * If the object doesn't have a map set (with evas_object_map_set()), the
4382  * initial geometry will be undefined. It is advised to always set a map
4383  * to the object first, and then call this function to enable its use.
4384  *
4385  * @param obj object to enable the map on
4386  * @param enabled enabled state
4387  */
4388 EAPI void              evas_object_map_enable_set        (Evas_Object *obj, Eina_Bool enabled);
4389
4390 /**
4391  * Get the map enabled state
4392  *
4393  * This returns the currently enabled state of the map on the object indicated.
4394  * The default map enable state is off. You can enable and disable it with
4395  * evas_object_map_enable_set().
4396  *
4397  * @param obj object to get the map enabled state from
4398  * @return the map enabled state
4399  */
4400 EAPI Eina_Bool         evas_object_map_enable_get        (const Evas_Object *obj);
4401
4402 /**
4403  * Set the map source object
4404  *
4405  * This sets the object from which the map is taken - can be any object that
4406  * has map enabled on it.
4407  *
4408  * Currently not implemented. for future use.
4409  *
4410  * @param obj object to set the map source of
4411  * @param src the source object from which the map is taken
4412  */
4413 EAPI void              evas_object_map_source_set        (Evas_Object *obj, Evas_Object *src);
4414
4415 /**
4416  * Get the map source object
4417  *
4418  * @param obj object to set the map source of
4419  * @return the object set as the source
4420  *
4421  * @see evas_object_map_source_set()
4422  */
4423 EAPI Evas_Object      *evas_object_map_source_get        (const Evas_Object *obj);
4424
4425 /**
4426  * Set current object transformation map.
4427  *
4428  * This sets the map on a given object. It is copied from the @p map pointer,
4429  * so there is no need to keep the @p map object if you don't need it anymore.
4430  *
4431  * A map is a set of 4 points which have canvas x, y coordinates per point,
4432  * with an optional z point value as a hint for perspective correction, if it
4433  * is available. As well each point has u and v coordinates. These are like
4434  * "texture coordinates" in OpenGL in that they define a point in the source
4435  * image that is mapped to that map vertex/point. The u corresponds to the x
4436  * coordinate of this mapped point and v, the y coordinate. Note that these
4437  * coordinates describe a bounding region to sample. If you have a 200x100
4438  * source image and want to display it at 200x100 with proper pixel
4439  * precision, then do:
4440  *
4441  * @code
4442  * Evas_Map *m = evas_map_new(4);
4443  * evas_map_point_coord_set(m, 0,   0,   0, 0);
4444  * evas_map_point_coord_set(m, 1, 200,   0, 0);
4445  * evas_map_point_coord_set(m, 2, 200, 100, 0);
4446  * evas_map_point_coord_set(m, 3,   0, 100, 0);
4447  * evas_map_point_image_uv_set(m, 0,   0,   0);
4448  * evas_map_point_image_uv_set(m, 1, 200,   0);
4449  * evas_map_point_image_uv_set(m, 2, 200, 100);
4450  * evas_map_point_image_uv_set(m, 3,   0, 100);
4451  * evas_object_map_set(obj, m);
4452  * evas_map_free(m);
4453  * @endcode
4454  *
4455  * Note that the map points a uv coordinates match the image geometry. If
4456  * the @p map parameter is NULL, the stored map will be freed and geometry
4457  * prior to enabling/setting a map will be restored.
4458  *
4459  * @param obj object to change transformation map
4460  * @param map new map to use
4461  *
4462  * @see evas_map_new()
4463  */
4464 EAPI void              evas_object_map_set               (Evas_Object *obj, const Evas_Map *map);
4465
4466 /**
4467  * Get current object transformation map.
4468  *
4469  * This returns the current internal map set on the indicated object. It is
4470  * intended for read-only acces and is only valid as long as the object is
4471  * not deleted or the map on the object is not changed. If you wish to modify
4472  * the map and set it back do the following:
4473  *
4474  * @code
4475  * const Evas_Map *m = evas_object_map_get(obj);
4476  * Evas_Map *m2 = evas_map_dup(m);
4477  * evas_map_util_rotate(m2, 30.0, 0, 0);
4478  * evas_object_map_set(obj);
4479  * evas_map_free(m2);
4480  * @endcode
4481  *
4482  * @param obj object to query transformation map.
4483  * @return map reference to map in use. This is an internal data structure, so
4484  * do not modify it.
4485  *
4486  * @see evas_object_map_set()
4487  */
4488 EAPI const Evas_Map   *evas_object_map_get               (const Evas_Object *obj);
4489
4490
4491 /**
4492  * Populate source and destination map points to match exactly object.
4493  *
4494  * Usually one initialize map of an object to match it's original
4495  * position and size, then transform these with evas_map_util_*
4496  * functions, such as evas_map_util_rotate() or
4497  * evas_map_util_3d_rotate(). The original set is done by this
4498  * function, avoiding code duplication all around.
4499  *
4500  * @param m map to change all 4 points (must be of size 4).
4501  * @param obj object to use unmapped geometry to populate map coordinates.
4502  * @param z Point Z Coordinate hint (pre-perspective transform). This value
4503  *        will be used for all four points.
4504  *
4505  * @see evas_map_util_points_populate_from_object()
4506  * @see evas_map_point_coord_set()
4507  * @see evas_map_point_image_uv_set()
4508  */
4509 EAPI void              evas_map_util_points_populate_from_object_full(Evas_Map *m, const Evas_Object *obj, Evas_Coord z);
4510
4511 /**
4512  * Populate source and destination map points to match exactly object.
4513  *
4514  * Usually one initialize map of an object to match it's original
4515  * position and size, then transform these with evas_map_util_*
4516  * functions, such as evas_map_util_rotate() or
4517  * evas_map_util_3d_rotate(). The original set is done by this
4518  * function, avoiding code duplication all around.
4519  *
4520  * Z Point coordinate is assumed as 0 (zero).
4521  *
4522  * @param m map to change all 4 points (must be of size 4).
4523  * @param obj object to use unmapped geometry to populate map coordinates.
4524  *
4525  * @see evas_map_util_points_populate_from_object_full()
4526  * @see evas_map_util_points_populate_from_geometry()
4527  * @see evas_map_point_coord_set()
4528  * @see evas_map_point_image_uv_set()
4529  */
4530 EAPI void              evas_map_util_points_populate_from_object     (Evas_Map *m, const Evas_Object *obj);
4531
4532 /**
4533  * Populate source and destination map points to match given geometry.
4534  *
4535  * Similar to evas_map_util_points_populate_from_object_full(), this
4536  * call takes raw values instead of querying object's unmapped
4537  * geometry. The given width will be used to calculate destination
4538  * points (evas_map_point_coord_set()) and set the image uv
4539  * (evas_map_point_image_uv_set()).
4540  *
4541  * @param m map to change all 4 points (must be of size 4).
4542  * @param x Point X Coordinate
4543  * @param y Point Y Coordinate
4544  * @param w width to use to calculate second and third points.
4545  * @param h height to use to calculate third and fourth points.
4546  * @param z Point Z Coordinate hint (pre-perspective transform). This value
4547  *        will be used for all four points.
4548  *
4549  * @see evas_map_util_points_populate_from_object()
4550  * @see evas_map_point_coord_set()
4551  * @see evas_map_point_image_uv_set()
4552  */
4553 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);
4554
4555 /**
4556  * Set color of all points to given color.
4557  *
4558  * This call is useful to reuse maps after they had 3d lightning or
4559  * any other colorization applied before.
4560  *
4561  * @param m map to change the color of.
4562  * @param r red (0 - 255)
4563  * @param g green (0 - 255)
4564  * @param b blue (0 - 255)
4565  * @param a alpha (0 - 255)
4566  *
4567  * @see evas_map_point_color_set()
4568  */
4569 EAPI void              evas_map_util_points_color_set                (Evas_Map *m, int r, int g, int b, int a);
4570
4571 /**
4572  * Change the map to apply the given rotation.
4573  *
4574  * This rotates the indicated map's coordinates around the center coordinate
4575  * given by @p cx and @p cy as the rotation center. The points will have their
4576  * X and Y coordinates rotated clockwise by @p degrees degress (360.0 is a
4577  * full rotation). Negative values for degrees will rotate counter-clockwise
4578  * by that amount. All coordinates are canvas global coordinates.
4579  *
4580  * @param m map to change.
4581  * @param degrees amount of degrees from 0.0 to 360.0 to rotate.
4582  * @param cx rotation's center horizontal position.
4583  * @param cy rotation's center vertical position.
4584  *
4585  * @see evas_map_point_coord_set()
4586  * @see evas_map_util_zoom()
4587  */
4588 EAPI void              evas_map_util_rotate                          (Evas_Map *m, double degrees, Evas_Coord cx, Evas_Coord cy);
4589
4590 /**
4591  * Change the map to apply the given zooming.
4592  *
4593  * Like evas_map_util_rotate(), this zooms the points of the map from a center
4594  * point. That center is defined by @p cx and @p cy. The @p zoomx and @p zoomy
4595  * parameters specify how much to zoom in the X and Y direction respectively.
4596  * A value of 1.0 means "don't zoom". 2.0 means "dobule the size". 0.5 is
4597  * "half the size" etc. All coordinates are canvas global coordinates.
4598  *
4599  * @param m map to change.
4600  * @param zoomx horizontal zoom to use.
4601  * @param zoomy vertical zoom to use.
4602  * @param cx zooming center horizontal position.
4603  * @param cy zooming center vertical position.
4604  *
4605  * @see evas_map_point_coord_set()
4606  * @see evas_map_util_rotate()
4607  */
4608 EAPI void              evas_map_util_zoom                            (Evas_Map *m, double zoomx, double zoomy, Evas_Coord cx, Evas_Coord cy);
4609
4610 /**
4611  * Rotate the map around 3 axes in 3D
4612  *
4613  * This will rotate not just around the "Z" axis as in evas_map_util_rotate()
4614  * (which is a convenience call for those only wanting 2D). This will rotate
4615  * around the X, Y and Z axes. The Z axis points "into" the screen with low
4616  * values at the screen and higher values further away. The X axis runs from
4617  * left to right on the screen and the Y axis from top to bottom. Like with
4618  * evas_map_util_rotate() you provide a center point to rotate around (in 3D).
4619  *
4620  * @param m map to change.
4621  * @param dx amount of degrees from 0.0 to 360.0 to rotate arount X axis.
4622  * @param dy amount of degrees from 0.0 to 360.0 to rotate arount Y axis.
4623  * @param dz amount of degrees from 0.0 to 360.0 to rotate arount Z axis.
4624  * @param cx rotation's center horizontal position.
4625  * @param cy rotation's center vertical position.
4626  * @param cz rotation's center vertical position.
4627  */
4628 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);
4629
4630 /**
4631  * Perform lighting calculations on the given Map
4632  *
4633  * This is used to apply lighting calculations (from a single light source)
4634  * to a given map. The R, G and B values of each vertex will be modified to
4635  * reflect the lighting based on the lixth point coordinates, the light
4636  * color and the ambient color, and at what angle the map is facing the
4637  * light source. A surface should have its points be declared in a
4638  * clockwise fashion if the face is "facing" towards you (as opposed to
4639  * away from you) as faces have a "logical" side for lighting.
4640  *
4641  * @image html map-light3.png
4642  * @image rtf map-light3.png
4643  * @image latex map-light3.eps
4644  * @note Grey object, no lighting used
4645  *
4646  * @image html map-light4.png
4647  * @image rtf map-light4.png
4648  * @image latex map-light4.eps
4649  * @note Lights out! Every color set to 0
4650  *
4651  * @image html map-light5.png
4652  * @image rtf map-light5.png
4653  * @image latex map-light5.eps
4654  * @note Ambient light to full black, red light coming from close at the
4655  * bottom-left vertex
4656  *
4657  * @image html map-light6.png
4658  * @image rtf map-light6.png
4659  * @image latex map-light6.eps
4660  * @note Same light as before, but not the light is set to 0 and ambient light
4661  * is cyan
4662  *
4663  * @image html map-light7.png
4664  * @image rtf map-light7.png
4665  * @image latex map-light7.eps
4666  * @note Both lights are on
4667  *
4668  * @image html map-light8.png
4669  * @image rtf map-light8.png
4670  * @image latex map-light8.eps
4671  * @note Both lights again, but this time both are the same color.
4672  *
4673  * @param m map to change.
4674  * @param lx X coordinate in space of light point
4675  * @param ly Y coordinate in space of light point
4676  * @param lz Z coordinate in space of light point
4677  * @param lr light red value (0 - 255)
4678  * @param lg light green value (0 - 255)
4679  * @param lb light blue value (0 - 255)
4680  * @param ar ambient color red value (0 - 255)
4681  * @param ag ambient color green value (0 - 255)
4682  * @param ab ambient color blue value (0 - 255)
4683  */
4684 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);
4685
4686 /**
4687  * Apply a perspective transform to the map
4688  *
4689  * This applies a given perspective (3D) to the map coordinates. X, Y and Z
4690  * values are used. The px and py points specify the "infinite distance" point
4691  * in the 3D conversion (where all lines converge to like when artists draw
4692  * 3D by hand). The @p z0 value specifis the z value at which there is a 1:1
4693  * mapping between spatial coorinates and screen coordinates. Any points
4694  * on this z value will not have their X and Y values modified in the transform.
4695  * Those further away (Z value higher) will shrink into the distance, and
4696  * those less than this value will expand and become bigger. The @p foc value
4697  * determines the "focal length" of the camera. This is in reality the distance
4698  * between the camera lens plane itself (at or closer than this rendering
4699  * results are undefined) and the "z0" z value. This allows for some "depth"
4700  * control and @p foc must be greater than 0.
4701  *
4702  * @param m map to change.
4703  * @param px The pespective distance X coordinate
4704  * @param py The pespective distance Y coordinate
4705  * @param z0 The "0" z plane value
4706  * @param foc The focal distance
4707  */
4708 EAPI void              evas_map_util_3d_perspective                  (Evas_Map *m, Evas_Coord px, Evas_Coord py, Evas_Coord z0, Evas_Coord foc);
4709
4710 /**
4711  * Get the clockwise state of a map
4712  *
4713  * This determines if the output points (X and Y. Z is not used) are
4714  * clockwise or anti-clockwise. This can be used for "back-face culling". This
4715  * is where you hide objects that "face away" from you. In this case objects
4716  * that are not clockwise.
4717  *
4718  * @param m map to query.
4719  * @return 1 if clockwise, 0 otherwise
4720  */
4721 EAPI Eina_Bool         evas_map_util_clockwise_get                   (Evas_Map *m);
4722
4723
4724 /**
4725  * Create map of transformation points to be later used with an Evas object.
4726  *
4727  * This creates a set of points (currently only 4 is supported. no other
4728  * number for @p count will work). That is empty and ready to be modified
4729  * with evas_map calls.
4730  *
4731  * @param count number of points in the map.
4732  * @return a newly allocated map or @c NULL on errors.
4733  *
4734  * @see evas_map_free()
4735  * @see evas_map_dup()
4736  * @see evas_map_point_coord_set()
4737  * @see evas_map_point_image_uv_set()
4738  * @see evas_map_util_points_populate_from_object_full()
4739  * @see evas_map_util_points_populate_from_object()
4740  *
4741  * @see evas_object_map_set()
4742  */
4743 EAPI Evas_Map         *evas_map_new                      (int count);
4744
4745 /**
4746  * Set the smoothing for map rendering
4747  *
4748  * This sets smoothing for map rendering. If the object is a type that has
4749  * its own smoothing settings, then both the smooth settings for this object
4750  * and the map must be turned off. By default smooth maps are enabled.
4751  *
4752  * @param m map to modify. Must not be NULL.
4753  * @param enabled enable or disable smooth map rendering
4754  */
4755 EAPI void              evas_map_smooth_set               (Evas_Map *m, Eina_Bool enabled);
4756
4757 /**
4758  * get the smoothing for map rendering
4759  *
4760  * This gets smoothing for map rendering.
4761  *
4762  * @param m map to get the smooth from. Must not be NULL.
4763  */
4764 EAPI Eina_Bool         evas_map_smooth_get               (const Evas_Map *m);
4765
4766 /**
4767  * Set the alpha flag for map rendering
4768  *
4769  * This sets alpha flag for map rendering. If the object is a type that has
4770  * its own alpha settings, then this will take precedence. Only image objects
4771  * have this currently.
4772  * Setting this off stops alpha blending of the map area, and is
4773  * useful if you know the object and/or all sub-objects is 100% solid.
4774  *
4775  * @param m map to modify. Must not be NULL.
4776  * @param enabled enable or disable alpha map rendering
4777  */
4778 EAPI void              evas_map_alpha_set                (Evas_Map *m, Eina_Bool enabled);
4779
4780 /**
4781  * get the alpha flag for map rendering
4782  *
4783  * This gets the alph flag for map rendering.
4784  *
4785  * @param m map to get the alpha from. Must not be NULL.
4786  */
4787 EAPI Eina_Bool         evas_map_alpha_get                (const Evas_Map *m);
4788
4789 /**
4790  * Copy a previously allocated map.
4791  *
4792  * This makes a duplicate of the @p m object and returns it.
4793  *
4794  * @param m map to copy. Must not be NULL.
4795  * @return newly allocated map with the same count and contents as @p m.
4796  */
4797 EAPI Evas_Map         *evas_map_dup                      (const Evas_Map *m);
4798
4799 /**
4800  * Free a previously allocated map.
4801  *
4802  * This frees a givem map @p m and all memory associated with it. You must NOT
4803  * free a map returned by evas_object_map_get() as this is internal.
4804  *
4805  * @param m map to free.
4806  */
4807 EAPI void              evas_map_free                     (Evas_Map *m);
4808
4809 /**
4810  * Get a maps size.
4811  *
4812  * Returns the number of points in a map.  Should be at least 4.
4813  *
4814  * @param m map to get size.
4815  * @return -1 on error, points otherwise.
4816  */
4817 EAPI int               evas_map_count_get               (const Evas_Map *m) EINA_CONST;
4818
4819 /**
4820  * Change the map point's coordinate.
4821  *
4822  * This sets the fixed point's coordinate in the map. Note that points
4823  * describe the outline of a quadrangle and are ordered either clockwise
4824  * or anit-clock-wise. It is suggested to keep your quadrangles concave and
4825  * non-complex, though these polygon modes may work, they may not render
4826  * a desired set of output. The quadrangle will use points 0 and 1 , 1 and 2,
4827  * 2 and 3, and 3 and 0 to describe the edges of the quandrangle.
4828  *
4829  * The X and Y and Z coordinates are in canvas units. Z is optional and may
4830  * or may not be honored in drawing. Z is a hint and does not affect the
4831  * X and Y rendered coordinates. It may be used for calculating fills with
4832  * perspective correct rendering.
4833  *
4834  * Remember all coordinates are canvas global ones like with move and reize
4835  * in evas.
4836  *
4837  * @param m map to change point. Must not be @c NULL.
4838  * @param idx index of point to change. Must be smaller than map size.
4839  * @param x Point X Coordinate
4840  * @param y Point Y Coordinate
4841  * @param z Point Z Coordinate hint (pre-perspective transform)
4842  *
4843  * @see evas_map_util_rotate()
4844  * @see evas_map_util_zoom()
4845  * @see evas_map_util_points_populate_from_object_full()
4846  * @see evas_map_util_points_populate_from_object()
4847  */
4848 EAPI void              evas_map_point_coord_set          (Evas_Map *m, int idx, Evas_Coord x, Evas_Coord y, Evas_Coord z);
4849
4850 /**
4851  * Get the map point's coordinate.
4852  *
4853  * This returns the coordinates of the given point in the map.
4854  *
4855  * @param m map to query point.
4856  * @param idx index of point to query. Must be smaller than map size.
4857  * @param x where to return the X coordinate.
4858  * @param y where to return the Y coordinate.
4859  * @param z where to return the Z coordinate.
4860  */
4861 EAPI void              evas_map_point_coord_get          (const Evas_Map *m, int idx, Evas_Coord *x, Evas_Coord *y, Evas_Coord *z);
4862
4863 /**
4864  * Change the map point's U and V texture source point
4865  *
4866  * This sets the U and V coordinates for the point. This determines which
4867  * coordinate in the source image is mapped to the given point, much like
4868  * OpenGL and textures. Notes that these points do select the pixel, but
4869  * are double floating point values to allow for accuracy and sub-pixel
4870  * selection.
4871  *
4872  * @param m map to change the point of.
4873  * @param idx index of point to change. Must be smaller than map size.
4874  * @param u the X coordinate within the image/texture source
4875  * @param v the Y coordinate within the image/texture source
4876  *
4877  * @see evas_map_point_coord_set()
4878  * @see evas_object_map_set()
4879  * @see evas_map_util_points_populate_from_object_full()
4880  * @see evas_map_util_points_populate_from_object()
4881  */
4882 EAPI void              evas_map_point_image_uv_set       (Evas_Map *m, int idx, double u, double v);
4883
4884 /**
4885  * Get the map point's U and V texture source points
4886  *
4887  * This returns the texture points set by evas_map_point_image_uv_set().
4888  *
4889  * @param m map to query point.
4890  * @param idx index of point to query. Must be smaller than map size.
4891  * @param u where to write the X coordinate within the image/texture source
4892  * @param v where to write the Y coordinate within the image/texture source
4893  */
4894 EAPI void              evas_map_point_image_uv_get       (const Evas_Map *m, int idx, double *u, double *v);
4895
4896 /**
4897  * Set the color of a vertex in the map
4898  *
4899  * This sets the color of the vertex in the map. Colors will be linearly
4900  * interpolated between vertex points through the map. Color will multiply
4901  * the "texture" pixels (like GL_MODULATE in OpenGL). The default color of
4902  * a vertex in a map is white solid (255, 255, 255, 255) which means it will
4903  * have no affect on modifying the texture pixels.
4904  *
4905  * @param m map to change the color of.
4906  * @param idx index of point to change. Must be smaller than map size.
4907  * @param r red (0 - 255)
4908  * @param g green (0 - 255)
4909  * @param b blue (0 - 255)
4910  * @param a alpha (0 - 255)
4911  *
4912  * @see evas_map_util_points_color_set()
4913  * @see evas_map_point_coord_set()
4914  * @see evas_object_map_set()
4915  */
4916 EAPI void              evas_map_point_color_set          (Evas_Map *m, int idx, int r, int g, int b, int a);
4917
4918 /**
4919  * Get the color set on a vertex in the map
4920  *
4921  * This gets the color set by evas_map_point_color_set() on the given vertex
4922  * of the map.
4923  *
4924  * @param m map to get the color of the vertex from.
4925  * @param idx index of point get. Must be smaller than map size.
4926  * @param r pointer to red return
4927  * @param g pointer to green return
4928  * @param b pointer to blue return
4929  * @param a pointer to alpha return (0 - 255)
4930  *
4931  * @see evas_map_point_coord_set()
4932  * @see evas_object_map_set()
4933  */
4934 EAPI void              evas_map_point_color_get          (const Evas_Map *m, int idx, int *r, int *g, int *b, int *a);
4935 /**
4936  * @}
4937  */
4938
4939 /**
4940  * @defgroup Evas_Object_Group_Size_Hints Size Hints
4941  *
4942  * Objects may carry hints, so that another object that acts as a
4943  * manager (see @ref Evas_Smart_Object_Group) may know how to properly
4944  * position and resize its subordinate objects. The Size Hints provide
4945  * a common interface that is recommended as the protocol for such
4946  * information.
4947  *
4948  * For example, box objects use alignment hints to align its
4949  * lines/columns inside its container, padding hints to set the
4950  * padding between each individual child, etc.
4951  *
4952  * Examples on their usage:
4953  * - @ref Example_Evas_Size_Hints "evas-hints.c"
4954  * - @ref Example_Evas_Aspect_Hints "evas-aspect-hints.c"
4955  *
4956  * @ingroup Evas_Object_Group
4957  */
4958
4959 /**
4960  * @addtogroup Evas_Object_Group_Size_Hints
4961  * @{
4962  */
4963
4964 /**
4965  * Retrieves the hints for an object's minimum size.
4966  *
4967  * @param obj The given Evas object to query hints from.
4968  * @param w Pointer to an integer in which to store the minimum width.
4969  * @param h Pointer to an integer in which to store the minimum height.
4970  *
4971  * These are hints on the minimim sizes @p obj should have. This is
4972  * not a size enforcement in any way, it's just a hint that should be
4973  * used whenever appropriate.
4974  *
4975  * @note Use @c NULL pointers on the hint components you're not
4976  * interested in: they'll be ignored by the function.
4977  *
4978  * @see evas_object_size_hint_min_set() for an example
4979  */
4980 EAPI void              evas_object_size_hint_min_get     (const Evas_Object *obj, Evas_Coord *w, Evas_Coord *h) EINA_ARG_NONNULL(1);
4981
4982 /**
4983  * Sets the hints for an object's minimum size.
4984  *
4985  * @param obj The given Evas object to query hints from.
4986  * @param w Integer to use as the minimum width hint.
4987  * @param h Integer to use as the minimum height hint.
4988  *
4989  * This is not a size enforcement in any way, it's just a hint that
4990  * should be used whenever appropriate.
4991  *
4992  * Values @c 0 will be treated as unset hint components, when queried
4993  * by managers.
4994  *
4995  * Example:
4996  * @dontinclude evas-hints.c
4997  * @skip evas_object_size_hint_min_set
4998  * @until return
4999  *
5000  * In this example the minimum size hints change de behavior of an
5001  * Evas box when layouting its children. See the full @ref
5002  * Example_Evas_Size_Hints "example".
5003  *
5004  * @see evas_object_size_hint_min_get()
5005  */
5006 EAPI void              evas_object_size_hint_min_set     (Evas_Object *obj, Evas_Coord w, Evas_Coord h) EINA_ARG_NONNULL(1);
5007
5008 /**
5009  * Retrieves the hints for an object's maximum size.
5010  *
5011  * @param obj The given Evas object to query hints from.
5012  * @param w Pointer to an integer in which to store the maximum width.
5013  * @param h Pointer to an integer in which to store the maximum height.
5014  *
5015  * These are hints on the maximum sizes @p obj should have. This is
5016  * not a size enforcement in any way, it's just a hint that should be
5017  * used whenever appropriate.
5018  *
5019  * @note Use @c NULL pointers on the hint components you're not
5020  * interested in: they'll be ignored by the function.
5021  *
5022  * @see evas_object_size_hint_max_set()
5023  */
5024 EAPI void              evas_object_size_hint_max_get     (const Evas_Object *obj, Evas_Coord *w, Evas_Coord *h) EINA_ARG_NONNULL(1);
5025
5026 /**
5027  * Sets the hints for an object's maximum size.
5028  *
5029  * @param obj The given Evas object to query hints from.
5030  * @param w Integer to use as the maximum width hint.
5031  * @param h Integer to use as the maximum height hint.
5032  *
5033  * This is not a size enforcement in any way, it's just a hint that
5034  * should be used whenever appropriate.
5035  *
5036  * Values @c -1 will be treated as unset hint components, when queried
5037  * by managers.
5038  *
5039  * Example:
5040  * @dontinclude evas-hints.c
5041  * @skip evas_object_size_hint_max_set
5042  * @until return
5043  *
5044  * In this example the maximum size hints change de behavior of an
5045  * Evas box when layouting its children. See the full @ref
5046  * Example_Evas_Size_Hints "example".
5047  *
5048  * @see evas_object_size_hint_max_get()
5049  */
5050 EAPI void              evas_object_size_hint_max_set     (Evas_Object *obj, Evas_Coord w, Evas_Coord h) EINA_ARG_NONNULL(1);
5051
5052 /**
5053  * Retrieves the hints for an object's optimum size.
5054  *
5055  * @param obj The given Evas object to query hints from.
5056  * @param w Pointer to an integer in which to store the requested width.
5057  * @param h Pointer to an integer in which to store the requested height.
5058  *
5059  * These are hints on the optimum sizes @p obj should have. This is
5060  * not a size enforcement in any way, it's just a hint that should be
5061  * used whenever appropriate.
5062  *
5063  * @note Use @c NULL pointers on the hint components you're not
5064  * interested in: they'll be ignored by the function.
5065  *
5066  * @see evas_object_size_hint_request_set()
5067  */
5068 EAPI void              evas_object_size_hint_request_get (const Evas_Object *obj, Evas_Coord *w, Evas_Coord *h) EINA_ARG_NONNULL(1);
5069
5070 /**
5071  * Sets the hints for an object's optimum size.
5072  *
5073  * @param obj The given Evas object to query hints from.
5074  * @param w Integer to use as the preferred width hint.
5075  * @param h Integer to use as the preferred height hint.
5076  *
5077  * This is not a size enforcement in any way, it's just a hint that
5078  * should be used whenever appropriate.
5079  *
5080  * Values @c 0 will be treated as unset hint components, when queried
5081  * by managers.
5082  *
5083  * @see evas_object_size_hint_request_get()
5084  */
5085 EAPI void              evas_object_size_hint_request_set (Evas_Object *obj, Evas_Coord w, Evas_Coord h) EINA_ARG_NONNULL(1);
5086
5087 /**
5088  * Retrieves the hints for an object's aspect ratio.
5089  *
5090  * @param obj The given Evas object to query hints from.
5091  * @param aspect Returns the policy/type of aspect ratio applied to @p obj.
5092  * @param w Pointer to an integer in which to store the aspect's width
5093  * ratio term.
5094  * @param h Pointer to an integer in which to store the aspect's
5095  * height ratio term.
5096  *
5097  * The different aspect ratio policies are documented in the
5098  * #Evas_Aspect_Control type. A container respecting these size hints
5099  * would @b resize its children accordingly to those policies.
5100  *
5101  * For any policy, if any of the given aspect ratio terms are @c 0,
5102  * the object's container should ignore the aspect and scale @p obj to
5103  * occupy the whole available area. If they are both positive
5104  * integers, that proportion will be respected, under each scaling
5105  * policy.
5106  *
5107  * These images illustrate some of the #Evas_Aspect_Control policies:
5108  *
5109  * @image html any-policy.png
5110  * @image rtf any-policy.png
5111  * @image latex any-policy.eps
5112  *
5113  * @image html aspect-control-none-neither.png
5114  * @image rtf aspect-control-none-neither.png
5115  * @image latex aspect-control-none-neither.eps
5116  *
5117  * @image html aspect-control-both.png
5118  * @image rtf aspect-control-both.png
5119  * @image latex aspect-control-both.eps
5120  *
5121  * @image html aspect-control-horizontal.png
5122  * @image rtf aspect-control-horizontal.png
5123  * @image latex aspect-control-horizontal.eps
5124  *
5125  * This is not a size enforcement in any way, it's just a hint that
5126  * should be used whenever appropriate.
5127  *
5128  * @note Use @c NULL pointers on the hint components you're not
5129  * interested in: they'll be ignored by the function.
5130  *
5131  * Example:
5132  * @dontinclude evas-aspect-hints.c
5133  * @skip if (strcmp(ev->keyname, "c") == 0)
5134  * @until }
5135  *
5136  * See the full @ref Example_Evas_Aspect_Hints "example".
5137  *
5138  * @see evas_object_size_hint_aspect_set()
5139  */
5140 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);
5141
5142 /**
5143  * Sets the hints for an object's aspect ratio.
5144  *
5145  * @param obj The given Evas object to query hints from.
5146  * @param aspect The policy/type of aspect ratio to apply to @p obj.
5147  * @param w Integer to use as aspect width ratio term.
5148  * @param h Integer to use as aspect height ratio term.
5149  *
5150  * This is not a size enforcement in any way, it's just a hint that should
5151  * be used whenever appropriate.
5152  *
5153  * If any of the given aspect ratio terms are @c 0,
5154  * the object's container will ignore the aspect and scale @p obj to
5155  * occupy the whole available area, for any given policy.
5156  *
5157  * @see evas_object_size_hint_aspect_get() for more information.
5158  */
5159 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);
5160
5161 /**
5162  * Retrieves the hints for on object's alignment.
5163  *
5164  * @param obj The given Evas object to query hints from.
5165  * @param x Pointer to a double in which to store the horizontal
5166  * alignment hint.
5167  * @param y Pointer to a double in which to store the vertical
5168  * alignment hint.
5169  *
5170  * This is not a size enforcement in any way, it's just a hint that
5171  * should be used whenever appropriate.
5172  *
5173  * @note Use @c NULL pointers on the hint components you're not
5174  * interested in: they'll be ignored by the function.
5175  *
5176  * @see evas_object_size_hint_align_set() for more information
5177  */
5178 EAPI void              evas_object_size_hint_align_get   (const Evas_Object *obj, double *x, double *y) EINA_ARG_NONNULL(1);
5179
5180 /**
5181  * Sets the hints for an object's alignment.
5182  *
5183  * @param obj The given Evas object to query hints from.
5184  * @param x Double, ranging from @c 0.0 to @c 1.0 or with the
5185  * special value #EVAS_HINT_FILL, to use as horizontal alignment hint.
5186  * @param y Double, ranging from @c 0.0 to @c 1.0 or with the
5187  * special value #EVAS_HINT_FILL, to use as vertical alignment hint.
5188  *
5189  * These are hints on how to align an object <b>inside the boundaries
5190  * of a container/manager</b>. Accepted values are in the @c 0.0 to @c
5191  * 1.0 range, with the special value #EVAS_HINT_FILL used to specify
5192  * "justify" or "fill" by some users. In this case, maximum size hints
5193  * should be enforced with higher priority, if they are set. Also, any
5194  * padding hint set on objects should add up to the alignment space on
5195  * the final scene composition.
5196  *
5197  * See documentation of possible users: in Evas, they are the @ref
5198  * Evas_Object_Box "box" and @ref Evas_Object_Table "table" smart
5199  * objects.
5200  *
5201  * For the horizontal component, @c 0.0 means to the left, @c 1.0
5202  * means to the right. Analogously, for the vertical component, @c 0.0
5203  * to the top, @c 1.0 means to the bottom.
5204  *
5205  * See the following figure:
5206  *
5207  * @image html alignment-hints.png
5208  * @image rtf alignment-hints.png
5209  * @image latex alignment-hints.eps
5210  *
5211  * This is not a size enforcement in any way, it's just a hint that
5212  * should be used whenever appropriate.
5213  *
5214  * Example:
5215  * @dontinclude evas-hints.c
5216  * @skip evas_object_size_hint_align_set
5217  * @until return
5218  *
5219  * In this example the alignment hints change de behavior of an Evas
5220  * box when layouting its children. See the full @ref
5221  * Example_Evas_Size_Hints "example".
5222  *
5223  * @see evas_object_size_hint_align_get()
5224  * @see evas_object_size_hint_max_set()
5225  * @see evas_object_size_hint_padding_set()
5226  */
5227 EAPI void              evas_object_size_hint_align_set   (Evas_Object *obj, double x, double y) EINA_ARG_NONNULL(1);
5228
5229 /**
5230  * Retrieves the hints for an object's weight.
5231  *
5232  * @param obj The given Evas object to query hints from.
5233  * @param x Pointer to a double in which to store the horizontal weight.
5234  * @param y Pointer to a double in which to store the vertical weight.
5235  *
5236  * Accepted values are zero or positive values. Some users might use
5237  * this hint as a boolean, but some might consider it as a @b
5238  * proportion, see documentation of possible users, which in Evas are
5239  * the @ref Evas_Object_Box "box" and @ref Evas_Object_Table "table"
5240  * smart objects.
5241  *
5242  * This is not a size enforcement in any way, it's just a hint that
5243  * should be used whenever appropriate.
5244  *
5245  * @note Use @c NULL pointers on the hint components you're not
5246  * interested in: they'll be ignored by the function.
5247  *
5248  * @see evas_object_size_hint_weight_set() for an example
5249  */
5250 EAPI void              evas_object_size_hint_weight_get  (const Evas_Object *obj, double *x, double *y) EINA_ARG_NONNULL(1);
5251
5252 /**
5253  * Sets the hints for an object's weight.
5254  *
5255  * @param obj The given Evas object to query hints from.
5256  * @param x Nonnegative double value to use as horizontal weight hint.
5257  * @param y Nonnegative double value to use as vertical weight hint.
5258  *
5259  * This is not a size enforcement in any way, it's just a hint that
5260  * should be used whenever appropriate.
5261  *
5262  * This is a hint on how a container object should @b resize a given
5263  * child within its area. Containers may adhere to the simpler logic
5264  * of just expanding the child object's dimensions to fit its own (see
5265  * the #EVAS_HINT_EXPAND helper weight macro) or the complete one of
5266  * taking each child's weight hint as real @b weights to how much of
5267  * its size to allocate for them in each axis. A container is supposed
5268  * to, after @b normalizing the weights of its children (with weight
5269  * hints), distribute the space it has to layout them by those factors
5270  * -- most weighted children get larger in this process than the least
5271  * ones.
5272  *
5273  * Example:
5274  * @dontinclude evas-hints.c
5275  * @skip evas_object_size_hint_weight_set
5276  * @until return
5277  *
5278  * In this example the weight hints change de behavior of an Evas box
5279  * when layouting its children. See the full @ref
5280  * Example_Evas_Size_Hints "example".
5281  *
5282  * @see evas_object_size_hint_weight_get() for more information
5283  */
5284 EAPI void              evas_object_size_hint_weight_set  (Evas_Object *obj, double x, double y) EINA_ARG_NONNULL(1);
5285
5286 /**
5287  * Retrieves the hints for an object's padding space.
5288  *
5289  * @param obj The given Evas object to query hints from.
5290  * @param l Pointer to an integer in which to store left padding.
5291  * @param r Pointer to an integer in which to store right padding.
5292  * @param t Pointer to an integer in which to store top padding.
5293  * @param b Pointer to an integer in which to store bottom padding.
5294  *
5295  * Padding is extra space an object takes on each of its delimiting
5296  * rectangle sides, in canvas units. This space will be rendered
5297  * transparent, naturally, as in the following figure:
5298  *
5299  * @image html padding-hints.png
5300  * @image rtf padding-hints.png
5301  * @image latex padding-hints.eps
5302  *
5303  * This is not a size enforcement in any way, it's just a hint that
5304  * should be used whenever appropriate.
5305  *
5306  * @note Use @c NULL pointers on the hint components you're not
5307  * interested in: they'll be ignored by the function.
5308  *
5309  * Example:
5310  * @dontinclude evas-hints.c
5311  * @skip evas_object_size_hint_padding_set
5312  * @until return
5313  *
5314  * In this example the padding hints change de behavior of an Evas box
5315  * when layouting its children. See the full @ref
5316  * Example_Evas_Size_Hints "example".
5317  *
5318  * @see evas_object_size_hint_padding_set()
5319  */
5320 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);
5321
5322 /**
5323  * Sets the hints for an object's padding space.
5324  *
5325  * @param obj The given Evas object to query hints from.
5326  * @param l Integer to specify left padding.
5327  * @param r Integer to specify right padding.
5328  * @param t Integer to specify top padding.
5329  * @param b Integer to specify bottom padding.
5330  *
5331  * This is not a size enforcement in any way, it's just a hint that
5332  * should be used whenever appropriate.
5333  *
5334  * @see evas_object_size_hint_padding_get() for more information
5335  */
5336 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);
5337
5338 /**
5339  * @}
5340  */
5341
5342 /**
5343  * @defgroup Evas_Object_Group_Extras Extra Object Manipulation
5344  *
5345  * Miscellaneous functions that also apply to any object, but are less
5346  * used or not implemented by all objects.
5347  *
5348  * Examples on this group of functions can be found @ref
5349  * Example_Evas_Stacking "here" and @ref Example_Evas_Events "here".
5350  *
5351  * @ingroup Evas_Object_Group
5352  */
5353
5354 /**
5355  * @addtogroup Evas_Object_Group_Extras
5356  * @{
5357  */
5358
5359 /**
5360  * Set an attached data pointer to an object with a given string key.
5361  *
5362  * @param obj The object to attach the data pointer to
5363  * @param key The string key for the data to access it
5364  * @param data The ponter to the data to be attached
5365  *
5366  * This attaches the pointer @p data to the object @p obj, given the
5367  * access string @p key. This pointer will stay "hooked" to the object
5368  * until a new pointer with the same string key is attached with
5369  * evas_object_data_set() or it is deleted with
5370  * evas_object_data_del(). On deletion of the object @p obj, the
5371  * pointers will not be accessible from the object anymore.
5372  *
5373  * You can find the pointer attached under a string key using
5374  * evas_object_data_get(). It is the job of the calling application to
5375  * free any data pointed to by @p data when it is no longer required.
5376  *
5377  * If @p data is @c NULL, the old value stored at @p key will be
5378  * removed but no new value will be stored. This is synonymous with
5379  * calling evas_object_data_del() with @p obj and @p key.
5380  *
5381  * @note This function is very handy when you have data associated
5382  * specifically to an Evas object, being of use only when dealing with
5383  * it. Than you don't have the burden to a pointer to it elsewhere,
5384  * using this family of functions.
5385  *
5386  * Example:
5387  *
5388  * @code
5389  * int *my_data;
5390  * extern Evas_Object *obj;
5391  *
5392  * my_data = malloc(500);
5393  * evas_object_data_set(obj, "name_of_data", my_data);
5394  * printf("The data that was attached was %p\n", evas_object_data_get(obj, "name_of_data"));
5395  * @endcode
5396  */
5397 EAPI void                      evas_object_data_set             (Evas_Object *obj, const char *key, const void *data) EINA_ARG_NONNULL(1, 2);
5398
5399 /**
5400  * Return an attached data pointer on an Evas object by its given
5401  * string key.
5402  *
5403  * @param obj The object to which the data was attached
5404  * @param key The string key the data was stored under
5405  * @return The data pointer stored, or @c NULL if none was stored
5406  *
5407  * This function will return the data pointer attached to the object
5408  * @p obj, stored using the string key @p key. If the object is valid
5409  * and a data pointer was stored under the given key, that pointer
5410  * will be returned. If this is not the case, @c NULL will be
5411  * returned, signifying an invalid object or a non-existent key. It is
5412  * possible that a @c NULL pointer was stored given that key, but this
5413  * situation is non-sensical and thus can be considered an error as
5414  * well. @c NULL pointers are never stored as this is the return value
5415  * if an error occurs.
5416  *
5417  * Example:
5418  *
5419  * @code
5420  * int *my_data;
5421  * extern Evas_Object *obj;
5422  *
5423  * my_data = evas_object_data_get(obj, "name_of_my_data");
5424  * if (my_data) printf("Data stored was %p\n", my_data);
5425  * else printf("No data was stored on the object\n");
5426  * @endcode
5427  */
5428 EAPI void                     *evas_object_data_get             (const Evas_Object *obj, const char *key) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2) EINA_PURE;
5429
5430 /**
5431  * Delete an attached data pointer from an object.
5432  *
5433  * @param obj The object to delete the data pointer from
5434  * @param key The string key the data was stored under
5435  * @return The original data pointer stored at @p key on @p obj
5436  *
5437  * This will remove the stored data pointer from @p obj stored under
5438  * @p key and return this same pointer, if actually there was data
5439  * there, or @c NULL, if nothing was stored under that key.
5440  *
5441  * Example:
5442  *
5443  * @code
5444  * int *my_data;
5445  * extern Evas_Object *obj;
5446  *
5447  * my_data = evas_object_data_del(obj, "name_of_my_data");
5448  * @endcode
5449  */
5450 EAPI void                     *evas_object_data_del             (Evas_Object *obj, const char *key) EINA_ARG_NONNULL(1, 2);
5451
5452
5453 /**
5454  * Set pointer behavior.
5455  *
5456  * @param obj
5457  * @param setting desired behavior.
5458  *
5459  * This function has direct effect on event callbacks related to
5460  * mouse.
5461  *
5462  * If @p setting is EVAS_OBJECT_POINTER_MODE_AUTOGRAB, then when mouse
5463  * is down at this object, events will be restricted to it as source,
5464  * mouse moves, for example, will be emitted even if outside this
5465  * object area.
5466  *
5467  * If @p setting is EVAS_OBJECT_POINTER_MODE_NOGRAB, then events will
5468  * be emitted just when inside this object area.
5469  *
5470  * The default value is EVAS_OBJECT_POINTER_MODE_AUTOGRAB.
5471  *
5472  * @ingroup Evas_Object_Group_Extras
5473  */
5474 EAPI void                      evas_object_pointer_mode_set     (Evas_Object *obj, Evas_Object_Pointer_Mode setting) EINA_ARG_NONNULL(1);
5475
5476 /**
5477  * Determine how pointer will behave.
5478  * @param obj
5479  * @return pointer behavior.
5480  * @ingroup Evas_Object_Group_Extras
5481  */
5482 EAPI Evas_Object_Pointer_Mode  evas_object_pointer_mode_get     (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
5483
5484
5485 /**
5486  * Sets whether or not the given Evas object is to be drawn anti-aliased.
5487  *
5488  * @param   obj The given Evas object.
5489  * @param   anti_alias 1 if the object is to be anti_aliased, 0 otherwise.
5490  * @ingroup Evas_Object_Group_Extras
5491  */
5492 EAPI void                      evas_object_anti_alias_set       (Evas_Object *obj, Eina_Bool antialias) EINA_ARG_NONNULL(1);
5493
5494 /**
5495  * Retrieves whether or not the given Evas object is to be drawn anti_aliased.
5496  * @param   obj The given Evas object.
5497  * @return  @c 1 if the object is to be anti_aliased.  @c 0 otherwise.
5498  * @ingroup Evas_Object_Group_Extras
5499  */
5500 EAPI Eina_Bool                 evas_object_anti_alias_get       (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
5501
5502
5503 /**
5504  * Sets the scaling factor for an Evas object. Does not affect all
5505  * objects.
5506  *
5507  * @param obj The given Evas object.
5508  * @param scale The scaling factor. <c>1.0</c> means no scaling,
5509  *        default size.
5510  *
5511  * This will multiply the object's dimension by the given factor, thus
5512  * altering its geometry (width and height). Useful when you want
5513  * scalable UI elements, possibly at run time.
5514  *
5515  * @note Only text and textblock objects have scaling change
5516  * handlers. Other objects won't change visually on this call.
5517  *
5518  * @see evas_object_scale_get()
5519  *
5520  * @ingroup Evas_Object_Group_Extras
5521  */
5522 EAPI void                      evas_object_scale_set            (Evas_Object *obj, double scale) EINA_ARG_NONNULL(1);
5523
5524 /**
5525  * Retrieves the scaling factor for the given Evas object.
5526  *
5527  * @param   obj The given Evas object.
5528  * @return  The scaling factor.
5529  *
5530  * @ingroup Evas_Object_Group_Extras
5531  *
5532  * @see evas_object_scale_set()
5533  */
5534 EAPI double                    evas_object_scale_get            (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
5535
5536
5537 /**
5538  * Sets the render_op to be used for rendering the Evas object.
5539  * @param   obj The given Evas object.
5540  * @param   render_op one of the Evas_Render_Op values.
5541  * @ingroup Evas_Object_Group_Extras
5542  */
5543 EAPI void                      evas_object_render_op_set        (Evas_Object *obj, Evas_Render_Op op) EINA_ARG_NONNULL(1);
5544
5545 /**
5546  * Retrieves the current value of the operation used for rendering the Evas object.
5547  * @param   obj The given Evas object.
5548  * @return  one of the enumerated values in Evas_Render_Op.
5549  * @ingroup Evas_Object_Group_Extras
5550  */
5551 EAPI Evas_Render_Op            evas_object_render_op_get        (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
5552
5553 /**
5554  * Set whether to use precise (usually expensive) point collision
5555  * detection for a given Evas object.
5556  *
5557  * @param obj The given object.
5558  * @param precise whether to use precise point collision detection or
5559  * not The default value is false.
5560  *
5561  * Use this function to make Evas treat objects' transparent areas as
5562  * @b not belonging to it with regard to mouse pointer events. By
5563  * default, all of the object's boundary rectangle will be taken in
5564  * account for them.
5565  *
5566  * @warning By using precise point collision detection you'll be
5567  * making Evas more resource intensive.
5568  *
5569  * Example code follows.
5570  * @dontinclude evas-events.c
5571  * @skip if (strcmp(ev->keyname, "p") == 0)
5572  * @until }
5573  *
5574  * See the full example @ref Example_Evas_Events "here".
5575  *
5576  * @see evas_object_precise_is_inside_get()
5577  * @ingroup Evas_Object_Group_Extras
5578  */
5579    EAPI void                      evas_object_precise_is_inside_set(Evas_Object *obj, Eina_Bool precise) EINA_ARG_NONNULL(1);
5580
5581 /**
5582  * Determine whether an object is set to use precise point collision
5583  * detection.
5584  *
5585  * @param obj The given object.
5586  * @return whether @p obj is set to use precise point collision
5587  * detection or not The default value is false.
5588  *
5589  * @see evas_object_precise_is_inside_set() for an example
5590  *
5591  * @ingroup Evas_Object_Group_Extras
5592  */
5593    EAPI Eina_Bool                 evas_object_precise_is_inside_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
5594
5595 /**
5596  * Set a hint flag on the given Evas object that it's used as a "static
5597  * clipper".
5598  *
5599  * @param obj The given object.
5600  * @param is_static_clip @c EINA_TRUE if it's to be used as a static
5601  * clipper, @c EINA_FALSE otherwise
5602  *
5603  * This is a hint to Evas that this object is used as a big static
5604  * clipper and shouldn't be moved with children and otherwise
5605  * considered specially. The default value for new objects is @c
5606  * EINA_FALSE.
5607  *
5608  * @see evas_object_static_clip_get()
5609  *
5610  * @ingroup Evas_Object_Group_Extras
5611  */
5612    EAPI void                      evas_object_static_clip_set      (Evas_Object *obj, Eina_Bool is_static_clip) EINA_ARG_NONNULL(1);
5613
5614 /**
5615  * Get the "static clipper" hint flag for a given Evas object.
5616  *
5617  * @param obj The given object.
5618  * @returrn @c EINA_TRUE if it's set as a static clipper, @c
5619  * EINA_FALSE otherwise
5620  *
5621  * @see evas_object_static_clip_set() for more details
5622  *
5623  * @ingroup Evas_Object_Group_Extras
5624  */
5625    EAPI Eina_Bool                 evas_object_static_clip_get      (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
5626
5627 /**
5628  * @}
5629  */
5630
5631 /**
5632  * @defgroup Evas_Object_Group_Find Finding Objects
5633  *
5634  * Functions that allows finding objects by their position, name or
5635  * other properties.
5636  *
5637  * @ingroup Evas_Object_Group
5638  */
5639
5640 /**
5641  * @addtogroup Evas_Object_Group_Find
5642  * @{
5643  */
5644
5645 /**
5646  * Retrieve the object that currently has focus.
5647  *
5648  * @param e The Evas canvas to query for focused object on.
5649  * @return The object that has focus or @c NULL if there is not one.
5650  *
5651  * Evas can have (at most) one of its objects focused at a time.
5652  * Focused objects will be the ones having <b>key events</b> delivered
5653  * to, which the programmer can act upon by means of
5654  * evas_object_event_callback_add() usage.
5655  *
5656  * @note Most users wouldn't be dealing directly with Evas' focused
5657  * objects. Instead, they would be using a higher level library for
5658  * that (like a toolkit, as Elementary) to handle focus and who's
5659  * receiving input for them.
5660  *
5661  * This call returns the object that currently has focus on the canvas
5662  * @p e or @c NULL, if none.
5663  *
5664  * @see evas_object_focus_set
5665  * @see evas_object_focus_get
5666  * @see evas_object_key_grab
5667  * @see evas_object_key_ungrab
5668  *
5669  * Example:
5670  * @dontinclude evas-events.c
5671  * @skip evas_event_callback_add(d.canvas, EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_IN,
5672  * @until evas_object_focus_set(d.bg, EINA_TRUE);
5673  * @dontinclude evas-events.c
5674  * @skip called when our rectangle gets focus
5675  * @until }
5676  *
5677  * In this example the @c event_info is exactly a pointer to that
5678  * focused rectangle. See the full @ref Example_Evas_Events "example".
5679  *
5680  * @ingroup Evas_Object_Group_Find
5681  */
5682 EAPI Evas_Object      *evas_focus_get                    (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
5683
5684 /**
5685  * Retrieves the object on the given evas with the given name.
5686  * @param   e    The given evas.
5687  * @param   name The given name.
5688  * @return  If successful, the Evas object with the given name.  Otherwise,
5689  *          @c NULL.
5690  * @ingroup Evas_Object_Group_Find
5691  */
5692 EAPI Evas_Object      *evas_object_name_find             (const Evas *e, const char *name) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
5693
5694 /**
5695  * Retrieve the Evas object stacked at the top of a given position in
5696  * a canvas
5697  *
5698  * @param   e A handle to the canvas.
5699  * @param   x The horizontal coordinate of the position
5700  * @param   y The vertical coordinate of the position
5701  * @param   include_pass_events_objects Boolean flag to include or not
5702  * objects which pass events in this calculation
5703  * @param   include_hidden_objects Boolean flag to include or not hidden
5704  * objects in this calculation
5705  * @return  The Evas object that is over all other objects at the given
5706  * position.
5707  *
5708  * This function will traverse all the layers of the given canvas,
5709  * from top to bottom, querying for objects with areas covering the
5710  * given position. The user can remove from from the query
5711  * objects which are hidden and/or which are set to pass events.
5712  *
5713  * @warning This function will @b skip objects parented by smart
5714  * objects, acting only on the ones at the "top level", with regard to
5715  * object parenting.
5716  */
5717 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;
5718
5719 /**
5720  * Retrieve the Evas object stacked at the top at the position of the
5721  * mouse cursor, over a given canvas
5722  *
5723  * @param   e A handle to the canvas.
5724  * @return  The Evas object that is over all other objects at the mouse
5725  * pointer's position
5726  *
5727  * This function will traverse all the layers of the given canvas,
5728  * from top to bottom, querying for objects with areas covering the
5729  * mouse pointer's position, over @p e.
5730  *
5731  * @warning This function will @b skip objects parented by smart
5732  * objects, acting only on the ones at the "top level", with regard to
5733  * object parenting.
5734  */
5735 EAPI Evas_Object      *evas_object_top_at_pointer_get    (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
5736
5737 /**
5738  * Retrieve the Evas object stacked at the top of a given rectangular
5739  * region in a canvas
5740  *
5741  * @param   e A handle to the canvas.
5742  * @param   x The top left corner's horizontal coordinate for the
5743  * rectangular region
5744  * @param   y The top left corner's vertical coordinate for the
5745  * rectangular region
5746  * @param   w The width of the rectangular region
5747  * @param   h The height of the rectangular region
5748  * @param   include_pass_events_objects Boolean flag to include or not
5749  * objects which pass events in this calculation
5750  * @param   include_hidden_objects Boolean flag to include or not hidden
5751  * objects in this calculation
5752  * @return  The Evas object that is over all other objects at the given
5753  * rectangular region.
5754  *
5755  * This function will traverse all the layers of the given canvas,
5756  * from top to bottom, querying for objects with areas overlapping
5757  * with the given rectangular region inside @p e. The user can remove
5758  * from the query objects which are hidden and/or which are set to
5759  * pass events.
5760  *
5761  * @warning This function will @b skip objects parented by smart
5762  * objects, acting only on the ones at the "top level", with regard to
5763  * object parenting.
5764  */
5765 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;
5766
5767 /**
5768  * Retrieve a list of Evas objects lying over a given position in
5769  * a canvas
5770  *
5771  * @param   e A handle to the canvas.
5772  * @param   x The horizontal coordinate of the position
5773  * @param   y The vertical coordinate of the position
5774  * @param   include_pass_events_objects Boolean flag to include or not
5775  * objects which pass events in this calculation
5776  * @param   include_hidden_objects Boolean flag to include or not hidden
5777  * objects in this calculation
5778  * @return  The list of Evas objects that are over the given position
5779  * in @p e
5780  *
5781  * This function will traverse all the layers of the given canvas,
5782  * from top to bottom, querying for objects with areas covering the
5783  * given position. The user can remove from from the query
5784  * objects which are hidden and/or which are set to pass events.
5785  *
5786  * @warning This function will @b skip objects parented by smart
5787  * objects, acting only on the ones at the "top level", with regard to
5788  * object parenting.
5789  */
5790 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;
5791    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;
5792
5793 /**
5794  * Get the lowest (stacked) Evas object on the canvas @p
5795  *
5796  * @param e a valid canvas pointer
5797  * @return a pointer to the lowest object on it, if any, or @c NULL,
5798  * otherwise
5799  *
5800  * This function will take all populated layers in the canvas into
5801  * account, getting the lowest object for the lowest layer, naturally.
5802  *
5803  * @see evas_object_layer_get()
5804  * @see evas_object_layer_set()
5805  * @see evas_object_below_get()
5806  * @see evas_object_above_get()
5807  *
5808  * @warning This function will @b skip objects parented by smart
5809  * objects, acting only on the ones at the "top level", with regard to
5810  * object parenting.
5811  */
5812 EAPI Evas_Object      *evas_object_bottom_get            (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
5813
5814 /**
5815  * Get the highest (stacked) Evas object on the canvas @p
5816  *
5817  * @param e a valid canvas pointer
5818  * @return a pointer to the highest object on it, if any, or @c NULL,
5819  * otherwise
5820  *
5821  * This function will take all populated layers in the canvas into
5822  * account, getting the highest object for the highest layer,
5823  * naturally.
5824  *
5825  * @see evas_object_layer_get()
5826  * @see evas_object_layer_set()
5827  * @see evas_object_below_get()
5828  * @see evas_object_above_get()
5829  *
5830  * @warning This function will @b skip objects parented by smart
5831  * objects, acting only on the ones at the "top level", with regard to
5832  * object parenting.
5833  */
5834 EAPI Evas_Object      *evas_object_top_get               (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
5835
5836 /**
5837  * @}
5838  */
5839
5840 /**
5841  * @defgroup Evas_Object_Group_Interceptors Object Method Interceptors
5842  *
5843  * Evas provides a way to intercept method calls. The interceptor
5844  * callback may opt to completely deny the call, or may check and
5845  * change the parameters before continuing. The continuation of an
5846  * intercepted call is done by calling the intercepted call again,
5847  * from inside the interceptor callback.
5848  *
5849  * @ingroup Evas_Object_Group
5850  */
5851
5852 /**
5853  * @addtogroup Evas_Object_Group_Interceptors
5854  * @{
5855  */
5856
5857 typedef void (*Evas_Object_Intercept_Show_Cb) (void *data, Evas_Object *obj);
5858 typedef void (*Evas_Object_Intercept_Hide_Cb) (void *data, Evas_Object *obj);
5859 typedef void (*Evas_Object_Intercept_Move_Cb) (void *data, Evas_Object *obj, Evas_Coord x, Evas_Coord y);
5860 typedef void (*Evas_Object_Intercept_Resize_Cb) (void *data, Evas_Object *obj, Evas_Coord w, Evas_Coord h);
5861 typedef void (*Evas_Object_Intercept_Raise_Cb) (void *data, Evas_Object *obj);
5862 typedef void (*Evas_Object_Intercept_Lower_Cb) (void *data, Evas_Object *obj);
5863 typedef void (*Evas_Object_Intercept_Stack_Above_Cb) (void *data, Evas_Object *obj, Evas_Object *above);
5864 typedef void (*Evas_Object_Intercept_Stack_Below_Cb) (void *data, Evas_Object *obj, Evas_Object *above);
5865 typedef void (*Evas_Object_Intercept_Layer_Set_Cb) (void *data, Evas_Object *obj, int l);
5866 typedef void (*Evas_Object_Intercept_Color_Set_Cb) (void *data, Evas_Object *obj, int r, int g, int b, int a);
5867 typedef void (*Evas_Object_Intercept_Clip_Set_Cb) (void *data, Evas_Object *obj, Evas_Object *clip);
5868 typedef void (*Evas_Object_Intercept_Clip_Unset_Cb) (void *data, Evas_Object *obj);
5869
5870 /**
5871  * Set the callback function that intercepts a show event of a object.
5872  *
5873  * @param obj The given canvas object pointer.
5874  * @param func The given function to be the callback function.
5875  * @param data The data passed to the callback function.
5876  *
5877  * This function sets a callback function to intercepts a show event
5878  * of a canvas object.
5879  *
5880  * @see evas_object_intercept_show_callback_del().
5881  *
5882  */
5883 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);
5884
5885 /**
5886  * Unset the callback function that intercepts a show event of a
5887  * object.
5888  *
5889  * @param obj The given canvas object pointer.
5890  * @param func The given callback function.
5891  *
5892  * This function sets a callback function to intercepts a show event
5893  * of a canvas object.
5894  *
5895  * @see evas_object_intercept_show_callback_add().
5896  *
5897  */
5898 EAPI void             *evas_object_intercept_show_callback_del        (Evas_Object *obj, Evas_Object_Intercept_Show_Cb func) EINA_ARG_NONNULL(1, 2);
5899
5900 /**
5901  * Set the callback function that intercepts a hide event of a object.
5902  *
5903  * @param obj The given canvas object pointer.
5904  * @param func The given function to be the callback function.
5905  * @param data The data passed to the callback function.
5906  *
5907  * This function sets a callback function to intercepts a hide event
5908  * of a canvas object.
5909  *
5910  * @see evas_object_intercept_hide_callback_del().
5911  *
5912  */
5913 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);
5914
5915 /**
5916  * Unset the callback function that intercepts a hide event of a
5917  * object.
5918  *
5919  * @param obj The given canvas object pointer.
5920  * @param func The given callback function.
5921  *
5922  * This function sets a callback function to intercepts a hide event
5923  * of a canvas object.
5924  *
5925  * @see evas_object_intercept_hide_callback_add().
5926  *
5927  */
5928 EAPI void             *evas_object_intercept_hide_callback_del        (Evas_Object *obj, Evas_Object_Intercept_Hide_Cb func) EINA_ARG_NONNULL(1, 2);
5929
5930 /**
5931  * Set the callback function that intercepts a move event of a object.
5932  *
5933  * @param obj The given canvas object pointer.
5934  * @param func The given function to be the callback function.
5935  * @param data The data passed to the callback function.
5936  *
5937  * This function sets a callback function to intercepts a move event
5938  * of a canvas object.
5939  *
5940  * @see evas_object_intercept_move_callback_del().
5941  *
5942  */
5943 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);
5944
5945 /**
5946  * Unset the callback function that intercepts a move event of a
5947  * object.
5948  *
5949  * @param obj The given canvas object pointer.
5950  * @param func The given callback function.
5951  *
5952  * This function sets a callback function to intercepts a move event
5953  * of a canvas object.
5954  *
5955  * @see evas_object_intercept_move_callback_add().
5956  *
5957  */
5958 EAPI void             *evas_object_intercept_move_callback_del        (Evas_Object *obj, Evas_Object_Intercept_Move_Cb func) EINA_ARG_NONNULL(1, 2);
5959
5960    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);
5961    EAPI void             *evas_object_intercept_resize_callback_del      (Evas_Object *obj, Evas_Object_Intercept_Resize_Cb func) EINA_ARG_NONNULL(1, 2);
5962    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);
5963    EAPI void             *evas_object_intercept_raise_callback_del       (Evas_Object *obj, Evas_Object_Intercept_Raise_Cb func) EINA_ARG_NONNULL(1, 2);
5964    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);
5965    EAPI void             *evas_object_intercept_lower_callback_del       (Evas_Object *obj, Evas_Object_Intercept_Lower_Cb func) EINA_ARG_NONNULL(1, 2);
5966    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);
5967    EAPI void             *evas_object_intercept_stack_above_callback_del (Evas_Object *obj, Evas_Object_Intercept_Stack_Above_Cb func) EINA_ARG_NONNULL(1, 2);
5968    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);
5969    EAPI void             *evas_object_intercept_stack_below_callback_del (Evas_Object *obj, Evas_Object_Intercept_Stack_Below_Cb func) EINA_ARG_NONNULL(1, 2);
5970    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);
5971    EAPI void             *evas_object_intercept_layer_set_callback_del   (Evas_Object *obj, Evas_Object_Intercept_Layer_Set_Cb func) EINA_ARG_NONNULL(1, 2);
5972    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);
5973    EAPI void             *evas_object_intercept_color_set_callback_del   (Evas_Object *obj, Evas_Object_Intercept_Color_Set_Cb func) EINA_ARG_NONNULL(1, 2);
5974    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);
5975    EAPI void             *evas_object_intercept_clip_set_callback_del    (Evas_Object *obj, Evas_Object_Intercept_Clip_Set_Cb func) EINA_ARG_NONNULL(1, 2);
5976    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);
5977    EAPI void             *evas_object_intercept_clip_unset_callback_del  (Evas_Object *obj, Evas_Object_Intercept_Clip_Unset_Cb func) EINA_ARG_NONNULL(1, 2);
5978
5979 /**
5980  * @}
5981  */
5982
5983 /**
5984  * @defgroup Evas_Object_Specific Specific Object Functions
5985  *
5986  * Functions that work on specific objects.
5987  *
5988  */
5989
5990 /**
5991  * @defgroup Evas_Object_Rectangle Rectangle Object Functions
5992  *
5993  * @brief Function to create evas rectangle objects.
5994  *
5995  * This function may seem useless given there are no functions to manipulate
5996  * the created rectangle, however the rectangle is actually very useful and can
5997  * be manipulate using the generic @ref Evas_Object_Group
5998  * "evas object functions".
5999  *
6000  * For an example of use of an evas_object_rectangle see @ref
6001  * Example_Evas_Object_Manipulation "here".
6002  *
6003  * @ingroup Evas_Object_Specific
6004  */
6005
6006 /**
6007  * Adds a rectangle to the given evas.
6008  * @param   e The given evas.
6009  * @return  The new rectangle object.
6010  *
6011  * @ingroup Evas_Object_Rectangle
6012  */
6013 EAPI Evas_Object      *evas_object_rectangle_add         (Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
6014
6015 /**
6016  * @defgroup Evas_Object_Image Image Object Functions
6017  *
6018  * Here are grouped together functions used to create and manipulate
6019  * image objects. They are available to whichever occasion one needs
6020  * complex imagery on a GUI that could not be achieved by the other
6021  * Evas' primitive object types, or to make image manipulations.
6022  *
6023  * Evas will support whichever image file types it was compiled with
6024  * support to (its image loaders) -- check your software packager for
6025  * that information and see
6026  * evas_object_image_extension_can_load_get().
6027  *
6028  * @section Evas_Object_Image_Basics Image object basics
6029  *
6030  * The most common use of image objects -- to display an image on the
6031  * canvas -- is achieved by a common function triplet:
6032  * @code
6033  * img = evas_object_image_add(canvas);
6034  * evas_object_image_file_set(img, "path/to/img", NULL);
6035  * evas_object_image_fill_set(img, 0, 0, w, h);
6036  * @endcode
6037  * The first function, naturally, is creating the image object. Then,
6038  * one must set an source file on it, so that it knows where to fetch
6039  * image data from. Next, one must set <b>how to fill the image
6040  * object's area</b> with that given pixel data. One could use just a
6041  * sub-region of the original image or even have it tiled repeatedly
6042  * on the image object. For the common case of having the whole source
6043  * image to be displayed on the image object, streched to the
6044  * destination's size, there's also a function helper, to be used
6045  * instead of evas_object_image_fill_set():
6046  * @code
6047  * evas_object_image_filled_set(img, EINA_TRUE);
6048  * @endcode
6049  * See those functions' documentation for more details.
6050  *
6051  * @section Evas_Object_Image_Scale Scale and resizing
6052  *
6053  * Resizing of image objects will scale their respective source images
6054  * to their areas, if they are set to "fill" the object's area
6055  * (evas_object_image_filled_set()). If the user wants any control on
6056  * the aspect ratio of an image for different sizes, he/she has to
6057  * take care of that themselves. There are functions to make images to
6058  * get loaded scaled (up or down) in memory, already, if the user is
6059  * going to use them at pre-determined sizes and wants to save
6060  * computations.
6061  *
6062  * Evas has even a scale cache, which will take care of caching scaled
6063  * versions of images with more often usage/hits. Finally, one can
6064  * have images being rescaled @b smoothly by Evas (more
6065  * computationally expensive) or not.
6066  *
6067  * @section Evas_Object_Image_Performance Performance hints
6068  *
6069  * When dealing with image objects, there are some tricks to boost the
6070  * performance of your application, if it does intense image loading
6071  * and/or manipulations, as in animations on a UI.
6072  *
6073  * @subsection Evas_Object_Image_Load Load hints
6074  *
6075  * In image viewer applications, for example, the user will be looking
6076  * at a given image, at full size, and will desire that the navigation
6077  * to the adjacent images on his/her album be fluid and fast. Thus,
6078  * while displaying a given image, the program can be on the
6079  * background loading the next and previous imagens already, so that
6080  * displaying them on the sequence is just a matter of repainting the
6081  * screen (and not decoding image data).
6082  *
6083  * Evas addresses this issue with <b>image pre-loading</b>. The code
6084  * for the situation above would be something like the following:
6085  * @code
6086  * prev = evas_object_image_filled_add(canvas);
6087  * evas_object_image_file_set(prev, "/path/to/prev", NULL);
6088  * evas_object_image_preload(prev, EINA_TRUE);
6089  *
6090  * next = evas_object_image_filled_add(canvas);
6091  * evas_object_image_file_set(next, "/path/to/next", NULL);
6092  * evas_object_image_preload(next, EINA_TRUE);
6093  * @endcode
6094  *
6095  * If you're loading images which are too big, consider setting
6096  * previously it's loading size to something smaller, in case you
6097  * won't expose them in real size. It may speed up the loading
6098  * considerably:
6099  * @code
6100  * //to load a scaled down version of the image in memory, if that's
6101  * //the size you'll be displaying it anyway
6102  * evas_object_image_load_scale_down_set(img, zoom);
6103  *
6104  * //optional: if you know you'll be showing a sub-set of the image's
6105  * //pixels, you can avoid loading the complementary data
6106  * evas_object_image_load_region_set(img, x, y, w, h);
6107  * @endcode
6108  * Refer to Elementary's Photocam widget for a high level (smart)
6109  * object which does lots of loading speed-ups for you.
6110  *
6111  * @subsection Evas_Object_Image_Animation Animation hints
6112  *
6113  * If you want to animate image objects on a UI (what you'd get by
6114  * concomitant usage of other libraries, like Ecore and Edje), there
6115  * are also some tips on how to boost the performance of your
6116  * application. If the animation involves resizing of an image (thus,
6117  * re-scaling), you'd better turn off smooth scaling on it @b during
6118  * the animation, turning it back on afterwrads, for less
6119  * computations. Also, in this case you'd better flag the image object
6120  * in question not to cache scaled versions of it:
6121  * @code
6122  * evas_object_image_scale_hint_set(wd->img, EVAS_IMAGE_SCALE_HINT_DYNAMIC);
6123  *
6124  * // resizing takes place in between
6125  *
6126  * evas_object_image_scale_hint_set(wd->img, EVAS_IMAGE_SCALE_HINT_STATIC);
6127  * @endcode
6128  *
6129  * Finally, movement of opaque images through the canvas is less
6130  * expensive than of translucid ones, because of blending
6131  * computations.
6132  *
6133  * @section Evas_Object_Image_Borders Borders
6134  *
6135  * Evas provides facilities for one to specify an image's region to be
6136  * treated specially -- as "borders". This will make those regions be
6137  * treated specially on resizing scales, by keeping their aspect. This
6138  * makes setting frames around other objects on UIs easy.
6139  * See the following figures for a visual explanation:\n
6140  * @htmlonly
6141  * <img src="image-borders.png" style="max-width: 100%;" />
6142  * <a href="image-borders.png">Full-size</a>
6143  * @endhtmlonly
6144  * @image rtf image-borders.png
6145  * @image latex image-borders.eps width=\textwidth
6146  * @htmlonly
6147  * <img src="border-effect.png" style="max-width: 100%;" />
6148  * <a href="border-effect.png">Full-size</a>
6149  * @endhtmlonly
6150  * @image rtf border-effect.png
6151  * @image latex border-effect.eps width=\textwidth
6152  *
6153  * @section Evas_Object_Image_Manipulation Manipulating pixels
6154  *
6155  * Evas image objects can be used to manipulate raw pixels in many
6156  * ways.  The meaning of the data in the pixel arrays will depend on
6157  * the image's color space, be warned (see next section). You can set
6158  * your own data as an image's pixel data, fetch an image's pixel data
6159  * for saving/altering, convert images between different color spaces
6160  * and even advanced operations like setting a native surface as image
6161  * objecs' data.
6162  *
6163  * @section Evas_Object_Image_Color_Spaces Color spaces
6164  *
6165  * Image objects may return or accept "image data" in multiple
6166  * formats. This is based on the color space of an object. Here is a
6167  * rundown on formats:
6168  *
6169  * - #EVAS_COLORSPACE_ARGB8888:
6170  *   .
6171  *   This pixel format is a linear block of pixels, starting at the
6172  *   top-left row by row until the bottom right of the image or pixel
6173  *   region. All pixels are 32-bit unsigned int's with the high-byte
6174  *   being alpha and the low byte being blue in the format ARGB. Alpha
6175  *   may or may not be used by evas depending on the alpha flag of the
6176  *   image, but if not used, should be set to 0xff anyway.
6177  *   \n\n
6178  *   This colorspace uses premultiplied alpha. That means that R, G
6179  *   and B cannot exceed A in value. The conversion from
6180  *   non-premultiplied colorspace is:
6181  *   \n\n
6182  *   R = (r * a) / 255; G = (g * a) / 255; B = (b * a) / 255;
6183  *   \n\n
6184  *   So 50% transparent blue will be: 0x80000080. This will not be
6185  *   "dark" - just 50% transparent. Values are 0 == black, 255 ==
6186  *   solid or full red, green or blue.
6187  *
6188  * - #EVAS_COLORSPACE_YCBCR422P601_PL:
6189  *   .
6190  *   This is a pointer-list indirected set of YUV (YCbCr) pixel
6191  *   data. This means that the data returned or set is not actual
6192  *   pixel data, but pointers TO lines of pixel data. The list of
6193  *   pointers will first be N rows of pointers to the Y plane -
6194  *   pointing to the first pixel at the start of each row in the Y
6195  *   plane. N is the height of the image data in pixels. Each pixel in
6196  *   the Y, U and V planes is 1 byte exactly, packed. The next N / 2
6197  *   pointers will point to rows in the U plane, and the next N / 2
6198  *   pointers will point to the V plane rows. U and V planes are half
6199  *   the horizontal and vertical resolution of the Y plane.
6200  *   \n\n
6201  *   Row order is top to bottom and row pixels are stored left to
6202  *   right.
6203  *   \n\n
6204  *   There is a limitation that these images MUST be a multiple of 2
6205  *   pixels in size horizontally or vertically. This is due to the U
6206  *   and V planes being half resolution. Also note that this assumes
6207  *   the itu601 YUV colorspace specification. This is defined for
6208  *   standard television and mpeg streams. HDTV may use the itu709
6209  *   specification.
6210  *   \n\n
6211  *   Values are 0 to 255, indicating full or no signal in that plane
6212  *   respectively.
6213  *
6214  * - #EVAS_COLORSPACE_YCBCR422P709_PL:
6215  *   .
6216  *   Not implemented yet.
6217  *
6218  * - #EVAS_COLORSPACE_RGB565_A5P:
6219  *   .
6220  *   In the process of being implemented in 1 engine only. This may
6221  *   change.
6222  *   \n\n
6223  *   This is a pointer to image data for 16-bit half-word pixel data
6224  *   in 16bpp RGB 565 format (5 bits red, 6 bits green, 5 bits blue),
6225  *   with the high-byte containing red and the low byte containing
6226  *   blue, per pixel. This data is packed row by row from the top-left
6227  *   to the bottom right.
6228  *   \n\n
6229  *   If the image has an alpha channel enabled there will be an extra
6230  *   alpha plane after the color pixel plane. If not, then this data
6231  *   will not exist and should not be accessed in any way. This plane
6232  *   is a set of pixels with 1 byte per pixel defining the alpha
6233  *   values of all pixels in the image from the top-left to the bottom
6234  *   right of the image, row by row. Even though the values of the
6235  *   alpha pixels can be 0 to 255, only values 0 through to 32 are
6236  *   used, 32 being solid and 0 being transparent.
6237  *   \n\n
6238  *   RGB values can be 0 to 31 for red and blue and 0 to 63 for green,
6239  *   with 0 being black and 31 or 63 being full red, green or blue
6240  *   respectively. This colorspace is also pre-multiplied like
6241  *   EVAS_COLORSPACE_ARGB8888 so:
6242  *   \n\n
6243  *   R = (r * a) / 32; G = (g * a) / 32; B = (b * a) / 32;
6244  *
6245  * - #EVAS_COLORSPACE_GRY8:
6246  *   .
6247  *   The image is just a alpha mask (8 bit's per pixel). This is used
6248  *   for alpha masking.
6249  *
6250  * Some examples on this group of functions can be found @ref
6251  * Example_Evas_Images "here".
6252  *
6253  * @ingroup Evas_Object_Specific
6254  */
6255
6256 /**
6257  * @addtogroup Evas_Object_Image
6258  * @{
6259  */
6260
6261 typedef void (*Evas_Object_Image_Pixels_Get_Cb) (void *data, Evas_Object *o);
6262
6263
6264 /**
6265  * Creates a new image object on the given Evas @p e canvas.
6266  *
6267  * @param e The given canvas.
6268  * @return The created image object handle.
6269  *
6270  * @note If you intend to @b display an image somehow in a GUI,
6271  * besides binding it to a real image file/source (with
6272  * evas_object_image_file_set(), for example), you'll have to tell
6273  * this image object how to fill its space with the pixels it can get
6274  * from the source. See evas_object_image_filled_add(), for a helper
6275  * on the common case of scaling up an image source to the whole area
6276  * of the image object.
6277  *
6278  * @see evas_object_image_fill_set()
6279  *
6280  * Example:
6281  * @code
6282  * img = evas_object_image_add(canvas);
6283  * evas_object_image_file_set(img, "/path/to/img", NULL);
6284  * @endcode
6285  */
6286 EAPI Evas_Object             *evas_object_image_add                    (Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
6287
6288 /**
6289  * Creates a new image object that @b automatically scales its bound
6290  * image to the object's area, on both axis.
6291  *
6292  * @param e The given canvas.
6293  * @return The created image object handle.
6294  *
6295  * This is a helper function around evas_object_image_add() and
6296  * evas_object_image_filled_set(). It has the same effect of applying
6297  * those functions in sequence, which is a very common use case.
6298  *
6299  * @note Whenever this object gets resized, the bound image will be
6300  * rescaled, too.
6301  *
6302  * @see evas_object_image_add()
6303  * @see evas_object_image_filled_set()
6304  * @see evas_object_image_fill_set()
6305  */
6306 EAPI Evas_Object             *evas_object_image_filled_add             (Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
6307
6308
6309 /**
6310  * Sets the data for an image from memory to be loaded
6311  *
6312  * This is the same as evas_object_image_file_set() but the file to be loaded
6313  * may exist at an address in memory (the data for the file, not the filename
6314  * itself). The @p data at the address is copied and stored for future use, so
6315  * no @p data needs to be kept after this call is made. It will be managed and
6316  * freed for you when no longer needed. The @p size is limited to 2 gigabytes
6317  * in size, and must be greater than 0. A NULL @p data pointer is also invalid.
6318  * Set the filename to NULL to reset to empty state and have the image file
6319  * data freed from memory using evas_object_image_file_set().
6320  *
6321  * The @p format is optional (pass NULL if you don't need/use it). It is used
6322  * to help Evas guess better which loader to use for the data. It may simply
6323  * be the "extension" of the file as it would normally be on disk such as
6324  * "jpg" or "png" or "gif" etc.
6325  *
6326  * @param obj The given image object.
6327  * @param data The image file data address
6328  * @param size The size of the image file data in bytes
6329  * @param format The format of the file (optional), or @c NULL if not needed
6330  * @param key The image key in file, or @c NULL.
6331  */
6332 EAPI void                     evas_object_image_memfile_set            (Evas_Object *obj, void *data, int size, char *format, char *key) EINA_ARG_NONNULL(1, 2);
6333
6334 /**
6335  * Set the source file from where an image object must fetch the real
6336  * image data (it may be an Eet file, besides pure image ones).
6337  *
6338  * @param obj The given image object.
6339  * @param file The image file path.
6340  * @param key The image key in @p file (if its an Eet one), or @c
6341  * NULL, otherwise.
6342  *
6343  * If the file supports multiple data stored in it (as Eet files do),
6344  * you can specify the key to be used as the index of the image in
6345  * this file.
6346  *
6347  * Example:
6348  * @code
6349  * img = evas_object_image_add(canvas);
6350  * evas_object_image_file_set(img, "/path/to/img", NULL);
6351  * err = evas_object_image_load_error_get(img);
6352  * if (err != EVAS_LOAD_ERROR_NONE)
6353  *   {
6354  *      fprintf(stderr, "could not load image '%s'. error string is \"%s\"\n",
6355  *              valid_path, evas_load_error_str(err));
6356  *   }
6357  * else
6358  *   {
6359  *      evas_object_image_fill_set(img, 0, 0, w, h);
6360  *      evas_object_resize(img, w, h);
6361  *      evas_object_show(img);
6362  *   }
6363  * @endcode
6364  */
6365 EAPI void                     evas_object_image_file_set               (Evas_Object *obj, const char *file, const char *key) EINA_ARG_NONNULL(1);
6366
6367 /**
6368  * Retrieve the source file from where an image object is to fetch the
6369  * real image data (it may be an Eet file, besides pure image ones).
6370  *
6371  * @param obj The given image object.
6372  * @param file Location to store the image file path.
6373  * @param key Location to store the image key (if @p file is an Eet
6374  * one).
6375  *
6376  * You must @b not modify the strings on the returned pointers.
6377  *
6378  * @note Use @c NULL pointers on the file components you're not
6379  * interested in: they'll be ignored by the function.
6380  */
6381 EAPI void                     evas_object_image_file_get               (const Evas_Object *obj, const char **file, const char **key) EINA_ARG_NONNULL(1, 2);
6382
6383 /**
6384  * Set the dimensions for an image object's border, a region which @b
6385  * won't ever be scaled together with its center.
6386  *
6387  * @param obj The given image object.
6388  * @param l The border's left width.
6389  * @param r The border's right width.
6390  * @param t The border's top width.
6391  * @param b The border's bottom width.
6392  *
6393  * When Evas is rendering, an image source may be scaled to fit the
6394  * size of its image object. This function sets an area from the
6395  * borders of the image inwards which is @b not to be scaled. This
6396  * function is useful for making frames and for widget theming, where,
6397  * for example, buttons may be of varying sizes, but their border size
6398  * must remain constant.
6399  *
6400  * The units used for @p l, @p r, @p t and @p b are canvas units.
6401  *
6402  * @note The border region itself @b may be scaled by the
6403  * evas_object_image_border_scale_set() function.
6404  *
6405  * @note By default, image objects have no borders set, i. e. @c l, @c
6406  * r, @c t and @c b start as @c 0.
6407  *
6408  * See the following figures for visual explanation:\n
6409  * @htmlonly
6410  * <img src="image-borders.png" style="max-width: 100%;" />
6411  * <a href="image-borders.png">Full-size</a>
6412  * @endhtmlonly
6413  * @image rtf image-borders.png
6414  * @image latex image-borders.eps width=\textwidth
6415  * @htmlonly
6416  * <img src="border-effect.png" style="max-width: 100%;" />
6417  * <a href="border-effect.png">Full-size</a>
6418  * @endhtmlonly
6419  * @image rtf border-effect.png
6420  * @image latex border-effect.eps width=\textwidth
6421  *
6422  * @see evas_object_image_border_get()
6423  * @see evas_object_image_border_center_fill_set()
6424  */
6425 EAPI void                     evas_object_image_border_set             (Evas_Object *obj, int l, int r, int t, int b) EINA_ARG_NONNULL(1);
6426
6427 /**
6428  * Retrieve the dimensions for an image object's border, a region
6429  * which @b won't ever be scaled together with its center.
6430  *
6431  * @param obj The given image object.
6432  * @param l Location to store the border's left width in.
6433  * @param r Location to store the border's right width in.
6434  * @param t Location to store the border's top width in.
6435  * @param b Location to store the border's bottom width in.
6436  *
6437  * @note Use @c NULL pointers on the border components you're not
6438  * interested in: they'll be ignored by the function.
6439  *
6440  * See @ref evas_object_image_border_set() for more details.
6441  */
6442 EAPI void                     evas_object_image_border_get             (const Evas_Object *obj, int *l, int *r, int *t, int *b) EINA_ARG_NONNULL(1);
6443
6444 /**
6445  * Sets @b how the center part of the given image object (not the
6446  * borders) should be drawn when Evas is rendering it.
6447  *
6448  * @param obj The given image object.
6449  * @param fill Fill mode of the center region of @p obj (a value in
6450  * #Evas_Border_Fill_Mode).
6451  *
6452  * This function sets how the center part of the image object's source
6453  * image is to be drawn, which must be one of the values in
6454  * #Evas_Border_Fill_Mode. By center we mean the complementary part of
6455  * that defined by evas_object_image_border_set(). This one is very
6456  * useful for making frames and decorations. You would most probably
6457  * also be using a filled image (as in evas_object_image_filled_set())
6458  * to use as a frame.
6459  *
6460  * @see evas_object_image_border_center_fill_get()
6461  */
6462 EAPI void                     evas_object_image_border_center_fill_set (Evas_Object *obj, Evas_Border_Fill_Mode fill) EINA_ARG_NONNULL(1);
6463
6464 /**
6465  * Retrieves @b how the center part of the given image object (not the
6466  * borders) is to be drawn when Evas is rendering it.
6467  *
6468  * @param obj The given image object.
6469  * @return fill Fill mode of the center region of @p obj (a value in
6470  * #Evas_Border_Fill_Mode).
6471  *
6472  * See @ref evas_object_image_fill_set() for more details.
6473  */
6474 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;
6475
6476 /**
6477  * Set whether the image object's fill property should track the
6478  * object's size.
6479  *
6480  * @param obj The given image object.
6481  * @param setting @c EINA_TRUE, to make the fill property follow
6482  *        object size or @c EINA_FALSE, otherwise
6483  *
6484  * If @p setting is @c EINA_TRUE, then every evas_object_resize() will
6485  * @b automatically trigger a call to evas_object_image_fill_set()
6486  * with the that new size (and @c 0, @c 0 as source image's origin),
6487  * so the bound image will fill the whole object's area.
6488  *
6489  * @see evas_object_image_filled_add()
6490  * @see evas_object_image_fill_get()
6491  */
6492 EAPI void                     evas_object_image_filled_set             (Evas_Object *obj, Eina_Bool setting) EINA_ARG_NONNULL(1);
6493
6494 /**
6495  * Retrieve whether the image object's fill property should track the
6496  * object's size.
6497  *
6498  * @param obj The given image object.
6499  * @return @c EINA_TRUE if it is tracking, @c EINA_FALSE, if not (and
6500  *         evas_object_fill_set() must be called manually).
6501  *
6502  * @see evas_object_image_filled_set() for more information
6503  */
6504 EAPI Eina_Bool                evas_object_image_filled_get             (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
6505
6506 /**
6507  * Sets the scaling factor (multiplier) for the borders of an image
6508  * object.
6509  *
6510  * @param obj The given image object.
6511  * @param scale The scale factor (default is @c 1.0 - i.e. no scaling)
6512  *
6513  * @see evas_object_image_border_set()
6514  * @see evas_object_image_border_scale_get()
6515  */
6516 EAPI void                     evas_object_image_border_scale_set       (Evas_Object *obj, double scale);
6517
6518 /**
6519  * Retrieves the scaling factor (multiplier) for the borders of an
6520  * image object.
6521  *
6522  * @param obj The given image object.
6523  * @return The scale factor set for its borders
6524  *
6525  * @see evas_object_image_border_set()
6526  * @see evas_object_image_border_scale_set()
6527  */
6528 EAPI double                   evas_object_image_border_scale_get       (const Evas_Object *obj);
6529
6530 /**
6531  * Set how to fill an image object's drawing rectangle given the
6532  * (real) image bound to it.
6533  *
6534  * @param obj The given image object to operate on.
6535  * @param x The x coordinate (from the top left corner of the bound
6536  *          image) to start drawing from.
6537  * @param y The y coordinate (from the top left corner of the bound
6538  *          image) to start drawing from.
6539  * @param w The width the bound image will be displayed at.
6540  * @param h The height the bound image will be displayed at.
6541  *
6542  * Note that if @p w or @p h are smaller than the dimensions of
6543  * @p obj, the displayed image will be @b tiled around the object's
6544  * area. To have only one copy of the bound image drawn, @p x and @p y
6545  * must be 0 and @p w and @p h need to be the exact width and height
6546  * of the image object itself, respectively.
6547  *
6548  * See the following image to better understand the effects of this
6549  * call. On this diagram, both image object and original image source
6550  * have @c a x @c a dimentions and the image itself is a circle, with
6551  * empty space around it:
6552  *
6553  * @image html image-fill.png
6554  * @image rtf image-fill.png
6555  * @image latex image-fill.eps
6556  *
6557  * @warning The default values for the fill parameters are @p x = 0,
6558  * @p y = 0, @p w = 0 and @p h = 0. Thus, if you're not using the
6559  * evas_object_image_filled_add() helper and want your image
6560  * displayed, you'll have to set valid values with this fuction on
6561  * your object.
6562  *
6563  * @note evas_object_image_filled_set() is a helper function which
6564  * will @b override the values set here automatically, for you, in a
6565  * given way.
6566  */
6567 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);
6568
6569 /**
6570  * Retrieve how an image object is to fill its drawing rectangle,
6571  * given the (real) image bound to it.
6572  *
6573  * @param obj The given image object.
6574  * @param x Location to store the x coordinate (from the top left
6575  *          corner of the bound image) to start drawing from.
6576  * @param y Location to store the y coordinate (from the top left
6577  *          corner of the bound image) to start drawing from.
6578  * @param w Location to store the width the bound image is to be
6579  *          displayed at.
6580  * @param h Location to store the height the bound image is to be
6581  *          displayed at.
6582  *
6583  * @note Use @c NULL pointers on the fill components you're not
6584  * interested in: they'll be ignored by the function.
6585  *
6586  * See @ref evas_object_image_fill_set() for more details.
6587  */
6588 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);
6589
6590 /**
6591  * Sets the tiling mode for the given evas image object's fill.
6592  * @param   obj   The given evas image object.
6593  * @param   spread One of EVAS_TEXTURE_REFLECT, EVAS_TEXTURE_REPEAT,
6594  * EVAS_TEXTURE_RESTRICT, or EVAS_TEXTURE_PAD.
6595  */
6596 EAPI void                     evas_object_image_fill_spread_set        (Evas_Object *obj, Evas_Fill_Spread spread) EINA_ARG_NONNULL(1);
6597
6598 /**
6599  * Retrieves the spread (tiling mode) for the given image object's
6600  * fill.
6601  *
6602  * @param   obj The given evas image object.
6603  * @return  The current spread mode of the image object.
6604  */
6605 EAPI Evas_Fill_Spread         evas_object_image_fill_spread_get        (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
6606
6607 /**
6608  * Sets the size of the given image object.
6609  *
6610  * @param obj The given image object.
6611  * @param w The new width of the image.
6612  * @param h The new height of the image.
6613  *
6614  * This function will scale down or crop the image so that it is
6615  * treated as if it were at the given size. If the size given is
6616  * smaller than the image, it will be cropped. If the size given is
6617  * larger, then the image will be treated as if it were in the upper
6618  * left hand corner of a larger image that is otherwise transparent.
6619  */
6620 EAPI void                     evas_object_image_size_set               (Evas_Object *obj, int w, int h) EINA_ARG_NONNULL(1);
6621
6622 /**
6623  * Retrieves the size of the given image object.
6624  *
6625  * @param obj The given image object.
6626  * @param w Location to store the width of the image in, or @c NULL.
6627  * @param h Location to store the height of the image in, or @c NULL.
6628  *
6629  * See @ref evas_object_image_size_set() for more details.
6630  */
6631 EAPI void                     evas_object_image_size_get               (const Evas_Object *obj, int *w, int *h) EINA_ARG_NONNULL(1);
6632
6633 /**
6634  * Retrieves the row stride of the given image object.
6635  *
6636  * @param obj The given image object.
6637  * @return The stride of the image (<b>in bytes</b>).
6638  *
6639  * The row stride is the number of bytes between the start of a row
6640  * and the start of the next row for image data.
6641  */
6642 EAPI int                      evas_object_image_stride_get             (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
6643
6644 /**
6645  * Retrieves a number representing any error that occurred during the
6646  * last loading of the given image object's source image.
6647  *
6648  * @param obj The given image object.
6649  * @return A value giving the last error that occurred. It should be
6650  *         one of the #Evas_Load_Error values. #EVAS_LOAD_ERROR_NONE
6651  *         is returned if there was no error.
6652  */
6653 EAPI Evas_Load_Error          evas_object_image_load_error_get         (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
6654
6655 /**
6656  * Sets the raw image data of the given image object.
6657  *
6658  * @param obj The given image object.
6659  * @param data The raw data, or @c NULL.
6660  *
6661  * Note that the raw data must be of the same size (see
6662  * evas_object_image_size_set(), which has to be called @b before this
6663  * one) and colorspace (see evas_object_image_colorspace_set()) of the
6664  * image. If data is @c NULL, the current image data will be
6665  * freed. Naturally, if one does not set an image object's data
6666  * manually, it will still have one, allocated by Evas.
6667  *
6668  * @see evas_object_image_data_get()
6669  */
6670 EAPI void                     evas_object_image_data_set               (Evas_Object *obj, void *data) EINA_ARG_NONNULL(1);
6671
6672 /**
6673  * Get a pointer to the raw image data of the given image object.
6674  *
6675  * @param obj The given image object.
6676  * @param for_writing Whether the data being retrieved will be
6677  *        modified (@c EINA_TRUE) or not (@c EINA_FALSE).
6678  * @return The raw image data.
6679  *
6680  * This function returns a pointer to an image object's internal pixel
6681  * buffer, for reading only or read/write. If you request it for
6682  * writing, the image will be marked dirty so that it gets redrawn at
6683  * the next update.
6684  *
6685  * Each time you call this function on an image object, its data
6686  * buffer will have an internal reference counter
6687  * incremented. Decrement it back by using
6688  * evas_object_image_data_set(). This is specially important for the
6689  * directfb Evas engine.
6690  *
6691  * This is best suited for when you want to modify an existing image,
6692  * without changing its dimensions.
6693  *
6694  * @note The contents' formart returned by it depend on the color
6695  * space of the given image object.
6696  *
6697  * @note You may want to use evas_object_image_data_update_add() to
6698  * inform data changes, if you did any.
6699  *
6700  * @see evas_object_image_data_set()
6701  */
6702 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;
6703
6704 /**
6705  * Converts the raw image data of the given image object to the
6706  * specified colorspace.
6707  *
6708  * Note that this function does not modify the raw image data.  If the
6709  * requested colorspace is the same as the image colorspace nothing is
6710  * done and NULL is returned. You should use
6711  * evas_object_image_colorspace_get() to check the current image
6712  * colorspace.
6713  *
6714  * See @ref evas_object_image_colorspace_get.
6715  *
6716  * @param obj The given image object.
6717  * @param to_cspace The colorspace to which the image raw data will be converted.
6718  * @return data A newly allocated data in the format specified by to_cspace.
6719  */
6720 EAPI void                    *evas_object_image_data_convert           (Evas_Object *obj, Evas_Colorspace to_cspace) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
6721
6722 /**
6723  * Replaces the raw image data of the given image object.
6724  *
6725  * @param obj The given image object.
6726  * @param data The raw data to replace.
6727  *
6728  * This function lets the application replace an image object's
6729  * internal pixel buffer with an user-allocated one. For best results,
6730  * you should generally first call evas_object_image_size_set() with
6731  * the width and height for the new buffer.
6732  *
6733  * This call is best suited for when you will be using image data with
6734  * different dimensions than the existing image data, if any. If you
6735  * only need to modify the existing image in some fashion, then using
6736  * evas_object_image_data_get() is probably what you are after.
6737  *
6738  * Note that the caller is responsible for freeing the buffer when
6739  * finished with it, as user-set image data will not be automatically
6740  * freed when the image object is deleted.
6741  *
6742  * See @ref evas_object_image_data_get() for more details.
6743  *
6744  */
6745 EAPI void                     evas_object_image_data_copy_set          (Evas_Object *obj, void *data) EINA_ARG_NONNULL(1);
6746
6747 /**
6748  * Mark a sub-region of the given image object to be redrawn.
6749  *
6750  * @param obj The given image object.
6751  * @param x X-offset of the region to be updated.
6752  * @param y Y-offset of the region to be updated.
6753  * @param w Width of the region to be updated.
6754  * @param h Height of the region to be updated.
6755  *
6756  * This function schedules a particular rectangular region of an image
6757  * object to be updated (redrawn) at the next rendering cycle.
6758  */
6759 EAPI void                     evas_object_image_data_update_add        (Evas_Object *obj, int x, int y, int w, int h) EINA_ARG_NONNULL(1);
6760
6761 /**
6762  * Enable or disable alpha channel usage on the given image object.
6763  *
6764  * @param obj The given image object.
6765  * @param has_alpha Whether to use alpha channel (@c EINA_TRUE) data
6766  * or not (@c EINA_FALSE).
6767  *
6768  * This function sets a flag on an image object indicating whether or
6769  * not to use alpha channel data. A value of @c EINA_TRUE makes it use
6770  * alpha channel data, and @c EINA_FALSE makes it ignore that
6771  * data. Note that this has nothing to do with an object's color as
6772  * manipulated by evas_object_color_set().
6773  *
6774  * @see evas_object_image_alpha_get()
6775  */
6776 EAPI void                     evas_object_image_alpha_set              (Evas_Object *obj, Eina_Bool has_alpha) EINA_ARG_NONNULL(1);
6777
6778 /**
6779  * Retrieve whether alpha channel data is being used on the given
6780  * image object.
6781  *
6782  * @param obj The given image object.
6783  * @return Whether the alpha channel data is being used (@c EINA_TRUE)
6784  * or not (@c EINA_FALSE).
6785  *
6786  * This function returns @c EINA_TRUE if the image object's alpha
6787  * channel is being used, or @c EINA_FALSE otherwise.
6788  *
6789  * See @ref evas_object_image_alpha_set() for more details.
6790  */
6791 EAPI Eina_Bool                evas_object_image_alpha_get              (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
6792
6793 /**
6794  * Sets whether to use high-quality image scaling algorithm on the
6795  * given image object.
6796  *
6797  * @param obj The given image object.
6798  * @param smooth_scale Whether to use smooth scale or not.
6799  *
6800  * When enabled, a higher quality image scaling algorithm is used when
6801  * scaling images to sizes other than the source image's original
6802  * one. This gives better results but is more computationally
6803  * expensive.
6804  *
6805  * @note Image objects get created originally with smooth scaling @b
6806  * on.
6807  *
6808  * @see evas_object_image_smooth_scale_get()
6809  */
6810 EAPI void                     evas_object_image_smooth_scale_set       (Evas_Object *obj, Eina_Bool smooth_scale) EINA_ARG_NONNULL(1);
6811
6812 /**
6813  * Retrieves whether the given image object is using high-quality
6814  * image scaling algorithm.
6815  *
6816  * @param obj The given image object.
6817  * @return Whether smooth scale is being used.
6818  *
6819  * See @ref evas_object_image_smooth_scale_set() for more details.
6820  */
6821 EAPI Eina_Bool                evas_object_image_smooth_scale_get       (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
6822
6823 /**
6824  * Preload an image object's image data in the background
6825  *
6826  * @param obj The given image object.
6827  * @param cancel @c EINA_FALSE will add it the preloading work queue,
6828  *               @c EINA_TRUE will remove it (if it was issued before).
6829  *
6830  * This function requests the preload of the data image in the
6831  * background. The work is queued before being processed (because
6832  * there might be other pending requests of this type).
6833  *
6834  * Whenever the image data gets loaded, Evas will call
6835  * #EVAS_CALLBACK_IMAGE_PRELOADED registered callbacks on @p obj (what
6836  * may be immediately, if the data was already preloaded before).
6837  *
6838  * Use @c EINA_TRUE for @p cancel on scenarios where you don't need
6839  * the image data preloaded anymore.
6840  *
6841  * @note Any evas_object_show() call after evas_object_image_preload()
6842  * will make the latter to be @b cancelled, with the loading process
6843  * now taking place @b synchronously (and, thus, blocking the return
6844  * of the former until the image is loaded). It is highly advisable,
6845  * then, that the user preload an image with it being @b hidden, just
6846  * to be shown on the #EVAS_CALLBACK_IMAGE_PRELOADED event's callback.
6847  */
6848 EAPI void                     evas_object_image_preload                (Evas_Object *obj, Eina_Bool cancel) EINA_ARG_NONNULL(1);
6849
6850 /**
6851  * Reload an image object's image data.
6852  *
6853  * @param obj The given image object pointer.
6854  *
6855  * This function reloads the image data bound to image object @p obj.
6856  */
6857 EAPI void                     evas_object_image_reload                 (Evas_Object *obj) EINA_ARG_NONNULL(1);
6858
6859 /**
6860  * Save the given image object's contents to an (image) file.
6861  *
6862  * @param obj The given image object.
6863  * @param file The filename to be used to save the image (extension
6864  *        obligatory).
6865  * @param key The image key in the file (if an Eet one), or @c NULL,
6866  *        otherwise.
6867  * @param flags String containing the flags to be used (@c NULL for
6868  *        none).
6869  *
6870  * The extension suffix on @p file will determine which <b>saver
6871  * module</b> Evas is to use when saving, thus the final file's
6872  * format. If the file supports multiple data stored in it (Eet ones),
6873  * you can specify the key to be used as the index of the image in it.
6874  *
6875  * You can specify some flags when saving the image.  Currently
6876  * acceptable flags are @c quality and @c compress. Eg.: @c
6877  * "quality=100 compress=9"
6878  */
6879 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);
6880
6881 /**
6882  * Import pixels from given source to a given canvas image object.
6883  *
6884  * @param obj The given canvas object.
6885  * @param pixels The pixel's source to be imported.
6886  *
6887  * This function imports pixels from a given source to a given canvas image.
6888  *
6889  */
6890 EAPI Eina_Bool                evas_object_image_pixels_import          (Evas_Object *obj, Evas_Pixel_Import_Source *pixels) EINA_ARG_NONNULL(1, 2);
6891
6892 /**
6893  * Set the callback function to get pixels from a canva's image.
6894  *
6895  * @param obj The given canvas pointer.
6896  * @param func The callback function.
6897  * @param data The data pointer to be passed to @a func.
6898  *
6899  * This functions sets a function to be the callback function that get
6900  * pixes from a image of the canvas.
6901  *
6902  */
6903 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);
6904
6905 /**
6906  * Mark whether the given image object is dirty (needs to be redrawn).
6907  *
6908  * @param obj The given image object.
6909  * @param dirty Whether the image is dirty.
6910  */
6911 EAPI void                     evas_object_image_pixels_dirty_set       (Evas_Object *obj, Eina_Bool dirty) EINA_ARG_NONNULL(1);
6912
6913 /**
6914  * Retrieves whether the given image object is dirty (needs to be redrawn).
6915  *
6916  * @param obj The given image object.
6917  * @return Whether the image is dirty.
6918  */
6919 EAPI Eina_Bool                evas_object_image_pixels_dirty_get       (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
6920
6921 /**
6922  * Set the DPI resolution of an image object's source image.
6923  *
6924  * @param obj The given canvas pointer.
6925  * @param dpi The new DPI resolution.
6926  *
6927  * This function sets the DPI resolution of a given loaded canvas
6928  * image. Most useful for the SVG image loader.
6929  *
6930  * @see evas_object_image_load_dpi_get()
6931  */
6932 EAPI void                     evas_object_image_load_dpi_set           (Evas_Object *obj, double dpi) EINA_ARG_NONNULL(1);
6933
6934 /**
6935  * Get the DPI resolution of a loaded image object in the canvas.
6936  *
6937  * @param obj The given canvas pointer.
6938  * @return The DPI resolution of the given canvas image.
6939  *
6940  * This function returns the DPI resolution of the given canvas image.
6941  *
6942  * @see evas_object_image_load_dpi_set() for more details
6943  */
6944 EAPI double                   evas_object_image_load_dpi_get           (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
6945
6946 /**
6947  * Set the size of a given image object's source image, when loading
6948  * it.
6949  *
6950  * @param obj The given canvas object.
6951  * @param w The new width of the image's load size.
6952  * @param h The new height of the image's load size.
6953  *
6954  * This function sets a new (loading) size for the given canvas
6955  * image.
6956  *
6957  * @see evas_object_image_load_size_get()
6958  */
6959 EAPI void                     evas_object_image_load_size_set          (Evas_Object *obj, int w, int h) EINA_ARG_NONNULL(1);
6960
6961 /**
6962  * Get the size of a given image object's source image, when loading
6963  * it.
6964  *
6965  * @param obj The given image object.
6966  * @param w Where to store the new width of the image's load size.
6967  * @param h Where to store the new height of the image's load size.
6968  *
6969  * @note Use @c NULL pointers on the size components you're not
6970  * interested in: they'll be ignored by the function.
6971  *
6972  * @see evas_object_image_load_size_set() for more details
6973  */
6974 EAPI void                     evas_object_image_load_size_get          (const Evas_Object *obj, int *w, int *h) EINA_ARG_NONNULL(1);
6975
6976 /**
6977  * Set the scale down factor of a given image object's source image,
6978  * when loading it.
6979  *
6980  * @param obj The given image object pointer.
6981  * @param scale_down The scale down factor.
6982  *
6983  * This function sets the scale down factor of a given canvas
6984  * image. Most useful for the SVG image loader.
6985  *
6986  * @see evas_object_image_load_scale_down_get()
6987  */
6988 EAPI void                     evas_object_image_load_scale_down_set    (Evas_Object *obj, int scale_down) EINA_ARG_NONNULL(1);
6989
6990 /**
6991  * get the scale down factor of a given image object's source image,
6992  * when loading it.
6993  *
6994  * @param obj The given image object pointer.
6995  *
6996  * @see evas_object_image_load_scale_down_set() for more details
6997  */
6998 EAPI int                      evas_object_image_load_scale_down_get    (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
6999
7000 /**
7001  * Inform a given image object to load a selective region of its
7002  * source image.
7003  *
7004  * @param obj The given image object pointer.
7005  * @param x X-offset of the region to be loaded.
7006  * @param y Y-offset of the region to be loaded.
7007  * @param w Width of the region to be loaded.
7008  * @param h Height of the region to be loaded.
7009  *
7010  * This function is useful when one is not showing all of an image's
7011  * area on its image object.
7012  *
7013  * @note The image loader for the image format in question has to
7014  * support selective region loading in order to this function to take
7015  * effect.
7016  *
7017  * @see evas_object_image_load_region_get()
7018  */
7019 EAPI void                     evas_object_image_load_region_set        (Evas_Object *obj, int x, int y, int w, int h) EINA_ARG_NONNULL(1);
7020
7021 /**
7022  * Retrieve the coordinates of a given image object's selective
7023  * (source image) load region.
7024  *
7025  * @param obj The given image object pointer.
7026  * @param x Where to store the X-offset of the region to be loaded.
7027  * @param y Where to store the Y-offset of the region to be loaded.
7028  * @param w Where to store the width of the region to be loaded.
7029  * @param h Where to store the height of the region to be loaded.
7030  *
7031  * @note Use @c NULL pointers on the coordinates you're not interested
7032  * in: they'll be ignored by the function.
7033  *
7034  * @see evas_object_image_load_region_get()
7035  */
7036 EAPI void                     evas_object_image_load_region_get        (const Evas_Object *obj, int *x, int *y, int *w, int *h) EINA_ARG_NONNULL(1);
7037
7038 /**
7039  * Define if the orientation information in the image file should be honored.
7040  *
7041  * @param obj The given image object pointer.
7042  * @param enable @p EINA_TRUE means that it should honor the orientation information
7043  * @since 1.1
7044  */
7045 EAPI void                     evas_object_image_load_orientation_set        (Evas_Object *obj, Eina_Bool enable) EINA_ARG_NONNULL(1);
7046
7047 /**
7048  * Get if the orientation information in the image file should be honored.
7049  *
7050  * @param obj The given image object pointer.
7051  * @since 1.1
7052  */
7053 EAPI Eina_Bool                evas_object_image_load_orientation_get        (const Evas_Object *obj) EINA_ARG_NONNULL(1);
7054
7055 /**
7056  * Set the colorspace of a given image of the canvas.
7057  *
7058  * @param obj The given image object pointer.
7059  * @param cspace The new color space.
7060  *
7061  * This function sets the colorspace of given canvas image.
7062  *
7063  */
7064 EAPI void                     evas_object_image_colorspace_set         (Evas_Object *obj, Evas_Colorspace cspace) EINA_ARG_NONNULL(1);
7065
7066 /**
7067  * Get the colorspace of a given image of the canvas.
7068  *
7069  * @param obj The given image object pointer.
7070  * @return The colorspace of the image.
7071  *
7072  * This function returns the colorspace of given canvas image.
7073  *
7074  */
7075 EAPI Evas_Colorspace          evas_object_image_colorspace_get         (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
7076
7077 /**
7078  * Set the native surface of a given image of the canvas
7079  *
7080  * @param obj The given canvas pointer.
7081  * @param surf The new native surface.
7082  *
7083  * This function sets a native surface of a given canvas image.
7084  *
7085  */
7086 EAPI void                     evas_object_image_native_surface_set     (Evas_Object *obj, Evas_Native_Surface *surf) EINA_ARG_NONNULL(1, 2);
7087
7088 /**
7089  * Get the native surface of a given image of the canvas
7090  *
7091  * @param obj The given canvas pointer.
7092  * @return The native surface of the given canvas image.
7093  *
7094  * This function returns the native surface of a given canvas image.
7095  *
7096  */
7097 EAPI Evas_Native_Surface     *evas_object_image_native_surface_get     (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
7098
7099 /**
7100  * Set the video surface linked to a given image of the canvas
7101  *
7102  * @param obj The given canvas pointer.
7103  * @param surf The new video surface.
7104  * @since 1.1.0
7105  *
7106  * This function link a video surface to a given canvas image.
7107  *
7108  */
7109 EAPI void                     evas_object_image_video_surface_set      (Evas_Object *obj, Evas_Video_Surface *surf) EINA_ARG_NONNULL(1, 2);
7110
7111 /**
7112  * Get the video surface linekd to a given image of the canvas
7113  *
7114  * @param obj The given canvas pointer.
7115  * @return The video surface of the given canvas image.
7116  * @since 1.1.0
7117  *
7118  * This function returns the video surface linked to a given canvas image.
7119  *
7120  */
7121 EAPI const Evas_Video_Surface *evas_object_image_video_surface_get      (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
7122
7123 /**
7124  * Set the scale hint of a given image of the canvas.
7125  *
7126  * @param obj The given image object pointer.
7127  * @param hint The scale hint, a value in
7128  * #Evas_Image_Scale_Hint.
7129  *
7130  * This function sets the scale hint value of the given image object
7131  * in the canvas, which will affect how Evas is to cache scaled
7132  * versions of its original source image.
7133  *
7134  * @see evas_object_image_scale_hint_get()
7135  */
7136 EAPI void                     evas_object_image_scale_hint_set         (Evas_Object *obj, Evas_Image_Scale_Hint hint) EINA_ARG_NONNULL(1);
7137
7138 /**
7139  * Get the scale hint of a given image of the canvas.
7140  *
7141  * @param obj The given image object pointer.
7142  * @return The scale hint value set on @p obj, a value in
7143  * #Evas_Image_Scale_Hint.
7144  *
7145  * This function returns the scale hint value of the given image
7146  * object of the canvas.
7147  *
7148  * @see evas_object_image_scale_hint_set() for more details.
7149  */
7150 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;
7151
7152 /**
7153  * Set the content hint setting of a given image object of the canvas.
7154  *
7155  * @param obj The given canvas pointer.
7156  * @param hint The content hint value, one of the
7157  * #Evas_Image_Content_Hint ones.
7158  *
7159  * This function sets the content hint value of the given image of the
7160  * canvas. For example, if you're on the GL engine and your driver
7161  * implementation supports it, setting this hint to
7162  * #EVAS_IMAGE_CONTENT_HINT_DYNAMIC will make it need @b zero copies
7163  * at texture upload time, which is an "expensive" operation.
7164  *
7165  * @see evas_object_image_content_hint_get()
7166  */
7167 EAPI void                     evas_object_image_content_hint_set       (Evas_Object *obj, Evas_Image_Content_Hint hint) EINA_ARG_NONNULL(1);
7168
7169 /**
7170  * Get the content hint setting of a given image object of the canvas.
7171  *
7172  * @param obj The given canvas pointer.
7173  * @return hint The content hint value set on it, one of the
7174  * #Evas_Image_Content_Hint ones (#EVAS_IMAGE_CONTENT_HINT_NONE means
7175  * an error).
7176  *
7177  * This function returns the content hint value of the given image of
7178  * the canvas.
7179  *
7180  * @see evas_object_image_content_hint_set()
7181  */
7182 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;
7183
7184
7185 /**
7186  * Enable an image to be used as an alpha mask.
7187  *
7188  * This will set any flags, and discard any excess image data not used as an
7189  * alpha mask.
7190  *
7191  * Note there is little point in using a image as alpha mask unless it has an
7192  * alpha channel.
7193  *
7194  * @param obj Object to use as an alpha mask.
7195  * @param ismask Use image as alphamask, must be true.
7196  */
7197 EAPI void                     evas_object_image_alpha_mask_set         (Evas_Object *obj, Eina_Bool ismask) EINA_ARG_NONNULL(1);
7198
7199 /**
7200  * Set the source object on an image object to used as a @b proxy.
7201  *
7202  * @param obj Proxy (image) object.
7203  * @param src Source object to use for the proxy.
7204  * @return @c EINA_TRUE on success, @c EINA_FALSE on error.
7205  *
7206  * If an image object is set to behave as a @b proxy, it will mirror
7207  * the rendering contents of a given @b source object in its drawing
7208  * region, without affecting that source in any way. The source must
7209  * be another valid Evas object. Other effects may be applied to the
7210  * proxy, such as a map (see evas_object_map_set()) to create a
7211  * reflection of the original object (for example).
7212  *
7213  * Any existing source object on @p obj will be removed after this
7214  * call. Setting @p src to @c NULL clears the proxy object (not in
7215  * "proxy state" anymore).
7216  *
7217  * @warning You cannot set a proxy as another proxy's source.
7218  *
7219  * @see evas_object_image_source_get()
7220  * @see evas_object_image_source_unset()
7221  */
7222 EAPI Eina_Bool                evas_object_image_source_set             (Evas_Object *obj, Evas_Object *src) EINA_ARG_NONNULL(1);
7223
7224 /**
7225  * Get the current source object of an image object.
7226  *
7227  * @param obj Image object
7228  * @return Source object (if any), or @c NULL, if not in "proxy mode"
7229  * (or on errors).
7230  *
7231  * @see evas_object_image_source_set() for more details
7232  */
7233 EAPI Evas_Object             *evas_object_image_source_get             (Evas_Object *obj) EINA_ARG_NONNULL(1);
7234
7235 /**
7236  * Clear the source object on a proxy image object.
7237  *
7238  * @param obj Image object to clear source of.
7239  * @return @c EINA_TRUE on success, @c EINA_FALSE on error.
7240  *
7241  * This is equivalent to calling evas_object_image_source_set() with a
7242  * @c NULL source.
7243  */
7244 EAPI Eina_Bool                evas_object_image_source_unset           (Evas_Object *obj) EINA_ARG_NONNULL(1);
7245
7246 /**
7247  * Check if a file extension may be supported by @ref Evas_Object_Image.
7248  *
7249  * @param file The file to check
7250  * @return EINA_TRUE if we may be able to opeen it, EINA_FALSE if it's unlikely.
7251  * @since 1.1.0
7252  *
7253  * If file is a Eina_Stringshare, use directly @ref evas_object_image_extension_can_load_fast_get.
7254  *
7255  * This functions is threadsafe.
7256  */
7257 EAPI Eina_Bool evas_object_image_extension_can_load_get(const char *file);
7258
7259 /**
7260  * Check if a file extension may be supported by @ref Evas_Object_Image.
7261  *
7262  * @param file The file to check, it should be an Eina_Stringshare.
7263  * @return EINA_TRUE if we may be able to opeen it, EINA_FALSE if it's unlikely.
7264  * @since 1.1.0
7265  *
7266  * This functions is threadsafe.
7267  */
7268 EAPI Eina_Bool evas_object_image_extension_can_load_fast_get(const char *file);
7269
7270 /**
7271  * Check if an image object can be animated (have multiple frames)
7272  *
7273  * @param obj Image object
7274  * @return whether obj support animation
7275  *
7276  * This returns if the image file of an image object is capable of animation
7277  * such as an animated gif file might. This is only useful to be called once
7278  * the image object file has been set.
7279  * 
7280  * Example:
7281  * @code
7282  * extern Evas_Object *obj;
7283  *
7284  * if (evas_object_image_animated_get(obj))
7285  *   {
7286  *     int frame_count;
7287  *     int loop_count;
7288  *     Evas_Image_Animated_Loop_Hint loop_type;
7289  *     double duration;
7290  *
7291  *     frame_count = evas_object_image_animated_frame_count_get(obj);
7292  *     printf("This image has %d frames\n",frame_count);
7293  *
7294  *     duration = evas_object_image_animated_frame_duration_get(obj,1,0); 
7295  *     printf("Frame 1's duration is %f. You had better set object's frame to 2 after this duration using timer\n");
7296  *     
7297  *     loop_count = evas_object_image_animated_loop_count_get(obj);
7298  *     printf("loop count is %d. You had better run loop %d times\n",loop_count,loop_count);
7299  *
7300  *     loop_type = evas_object_image_animated_loop_type_get(obj);
7301  *     if (loop_type == EVAS_IMAGE_ANIMATED_HINT_LOOP)
7302  *       printf("You had better set frame like 1->2->3->1->2->3...\n");
7303  *     else if (loop_type == EVAS_IMAGE_ANIMATED_HINT_PINGPONG)
7304  *       printf("You had better set frame like 1->2->3->2->1->2...\n");
7305  *     else
7306  *       printf("Unknown loop type\n");
7307  *
7308  *     evas_object_image_animated_frame_set(obj,1);
7309  *     printf("You set image object's frame to 1. You can see frame 1\n");
7310  *   }
7311  * @endcode
7312  * 
7313  * @see evas_object_image_animated_get()
7314  * @see evas_object_image_animated_frame_count_get() 
7315  * @see evas_object_image_animated_loop_type_get()
7316  * @see evas_object_image_animated_loop_count_get()
7317  * @see evas_object_image_animated_frame_duration_get()
7318  * @see evas_object_image_animated_frame_set()
7319  * @since 1.1.0
7320  */
7321 EAPI Eina_Bool evas_object_image_animated_get(const Evas_Object *obj);
7322
7323 /**
7324  * Get the total number of frames of the image object.
7325  *
7326  * @param obj Image object
7327  * @return The number of frames
7328  *
7329  * This returns total number of frames the image object supports (if animated)
7330  * 
7331  * @see evas_object_image_animated_get()
7332  * @see evas_object_image_animated_frame_count_get() 
7333  * @see evas_object_image_animated_loop_type_get()
7334  * @see evas_object_image_animated_loop_count_get()
7335  * @see evas_object_image_animated_frame_duration_get()
7336  * @see evas_object_image_animated_frame_set()
7337  * @since 1.1.0
7338  */
7339 EAPI int evas_object_image_animated_frame_count_get(const Evas_Object *obj);
7340
7341 /**
7342  * Get the kind of looping the image object does.
7343  *
7344  * @param obj Image object
7345  * @return Loop type of the image object
7346  *
7347  * This returns the kind of looping the image object wants to do.
7348  * 
7349  * If it returns EVAS_IMAGE_ANIMATED_HINT_LOOP, you should display frames in a sequence like:
7350  * 1->2->3->1->2->3->1...
7351  * If it returns EVAS_IMAGE_ANIMATED_HINT_PINGPONG, it is better to
7352  * display frames in a sequence like: 1->2->3->2->1->2->3->1...
7353  * 
7354  * The default type is EVAS_IMAGE_ANIMATED_HINT_LOOP.
7355  *
7356  * @see evas_object_image_animated_get()
7357  * @see evas_object_image_animated_frame_count_get() 
7358  * @see evas_object_image_animated_loop_type_get()
7359  * @see evas_object_image_animated_loop_count_get()
7360  * @see evas_object_image_animated_frame_duration_get()
7361  * @see evas_object_image_animated_frame_set()
7362  * @since 1.1.0
7363  */
7364 EAPI Evas_Image_Animated_Loop_Hint evas_object_image_animated_loop_type_get(const Evas_Object *obj);
7365
7366 /**
7367  * Get the number times the animation of the object loops.
7368  *
7369  * @param obj Image object
7370  * @return The number of loop of an animated image object
7371  *
7372  * This returns loop count of image. The loop count is the number of times
7373  * the animation will play fully from first to last frame until the animation
7374  * should stop (at the final frame).
7375  * 
7376  * If 0 is returned, then looping should happen indefinitely (no limit to
7377  * the number of times it loops).
7378  *
7379  * @see evas_object_image_animated_get()
7380  * @see evas_object_image_animated_frame_count_get() 
7381  * @see evas_object_image_animated_loop_type_get()
7382  * @see evas_object_image_animated_loop_count_get()
7383  * @see evas_object_image_animated_frame_duration_get()
7384  * @see evas_object_image_animated_frame_set()
7385  * @since 1.1.0
7386  */
7387 EAPI int evas_object_image_animated_loop_count_get(const Evas_Object *obj);
7388
7389 /**
7390  * Get the duration of a sequence of frames.
7391  *
7392  * @param obj Image object
7393  * @param start_frame The first frame
7394  * @param fram_num Number of frames in the sequence
7395  *
7396  * This returns total duration that the specified sequence of frames should
7397  * take in seconds.
7398  * 
7399  * If you set start_frame to 1 and frame_num 0, you get frame 1's duration
7400  * If you set start_frame to 1 and frame_num 1, you get frame 1's duration + 
7401  * frame2's duration
7402  *
7403  * @see evas_object_image_animated_get()
7404  * @see evas_object_image_animated_frame_count_get() 
7405  * @see evas_object_image_animated_loop_type_get()
7406  * @see evas_object_image_animated_loop_count_get()
7407  * @see evas_object_image_animated_frame_duration_get()
7408  * @see evas_object_image_animated_frame_set()
7409  * @since 1.1.0
7410  */
7411 EAPI double evas_object_image_animated_frame_duration_get(const Evas_Object *obj, int start_frame, int fram_num);
7412
7413 /**
7414  * Set the frame to current frame of an image object
7415  *
7416  * @param obj The given image object.
7417  * @param frame_num The index of current frame
7418  *
7419  * This set image object's current frame to frame_num with 1 being the first
7420  * frame.
7421  *
7422  * @see evas_object_image_animated_get()
7423  * @see evas_object_image_animated_frame_count_get() 
7424  * @see evas_object_image_animated_loop_type_get()
7425  * @see evas_object_image_animated_loop_count_get()
7426  * @see evas_object_image_animated_frame_duration_get()
7427  * @see evas_object_image_animated_frame_set()
7428  * @since 1.1.0
7429  */
7430 EAPI void evas_object_image_animated_frame_set(Evas_Object *obj, int frame_num);
7431 /**
7432  * @}
7433  */
7434
7435 /**
7436  * @defgroup Evas_Object_Text Text Object Functions
7437  *
7438  * Functions that operate on single line, single style text objects.
7439  *
7440  * For multiline and multiple style text, see @ref Evas_Object_Textblock.
7441  *
7442  * See some @ref Example_Evas_Text "examples" on this group of functions.
7443  *
7444  * @ingroup Evas_Object_Specific
7445  */
7446
7447 /**
7448  * @addtogroup Evas_Object_Text
7449  * @{
7450  */
7451
7452 /* basic styles (4 bits allocated use 0->10 now, 5 left) */
7453 #define EVAS_TEXT_STYLE_MASK_BASIC 0xf
7454
7455 /**
7456  * Text style type creation macro. Use style types on the 's'
7457  * arguments, being 'x' your style variable.
7458  */
7459 #define EVAS_TEXT_STYLE_BASIC_SET(x, s) \
7460    do { x = ((x) & ~EVAS_TEXT_STYLE_MASK_BASIC) | (s); } while (0)
7461
7462 #define EVAS_TEXT_STYLE_MASK_SHADOW_DIRECTION (0x7 << 4)
7463
7464 /**
7465  * Text style type creation macro. This one will impose shadow
7466  * directions on the style type variable -- use the @c
7467  * EVAS_TEXT_STYLE_SHADOW_DIRECTION_* values on 's', incremmentally.
7468  */
7469 #define EVAS_TEXT_STYLE_SHADOW_DIRECTION_SET(x, s) \
7470    do { x = ((x) & ~EVAS_TEXT_STYLE_MASK_SHADOW_DIRECTION) | (s); } while (0)
7471
7472    typedef enum _Evas_Text_Style_Type
7473      {
7474         EVAS_TEXT_STYLE_PLAIN, /**< plain, standard text */
7475         EVAS_TEXT_STYLE_SHADOW, /**< text with shadow underneath */
7476         EVAS_TEXT_STYLE_OUTLINE, /**< text with an outline */
7477         EVAS_TEXT_STYLE_SOFT_OUTLINE, /**< text with a soft outline */
7478         EVAS_TEXT_STYLE_GLOW, /**< text with a glow effect */
7479         EVAS_TEXT_STYLE_OUTLINE_SHADOW, /**< text with both outline and shadow effects */
7480         EVAS_TEXT_STYLE_FAR_SHADOW, /**< text with (far) shadow underneath */
7481         EVAS_TEXT_STYLE_OUTLINE_SOFT_SHADOW, /**< text with outline and soft shadow effects combined */
7482         EVAS_TEXT_STYLE_SOFT_SHADOW, /**< text with (soft) shadow underneath */
7483         EVAS_TEXT_STYLE_FAR_SOFT_SHADOW, /**< text with (far soft) shadow underneath */
7484
7485         /* OR these to modify shadow direction (3 bits needed) */
7486         EVAS_TEXT_STYLE_SHADOW_DIRECTION_BOTTOM_RIGHT = (0x0 << 4), /**< shadow growing to bottom right */
7487         EVAS_TEXT_STYLE_SHADOW_DIRECTION_BOTTOM       = (0x1 << 4), /**< shadow growing to the bottom */
7488         EVAS_TEXT_STYLE_SHADOW_DIRECTION_BOTTOM_LEFT  = (0x2 << 4), /**< shadow growing to bottom left */
7489         EVAS_TEXT_STYLE_SHADOW_DIRECTION_LEFT         = (0x3 << 4), /**< shadow growing to the left */
7490         EVAS_TEXT_STYLE_SHADOW_DIRECTION_TOP_LEFT     = (0x4 << 4), /**< shadow growing to top left */
7491         EVAS_TEXT_STYLE_SHADOW_DIRECTION_TOP          = (0x5 << 4), /**< shadow growing to the top */
7492         EVAS_TEXT_STYLE_SHADOW_DIRECTION_TOP_RIGHT    = (0x6 << 4), /**< shadow growing to top right */
7493         EVAS_TEXT_STYLE_SHADOW_DIRECTION_RIGHT        = (0x7 << 4) /**< shadow growing to the right */
7494      } 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 */
7495
7496 /**
7497  * Creates a new text object on the provided canvas.
7498  *
7499  * @param e The canvas to create the text object on.
7500  * @return @c NULL on error, a pointer to a new text object on
7501  * success.
7502  *
7503  * Text objects are for simple, single line text elements. If you want
7504  * more elaborated text blocks, see @ref Evas_Object_Textblock.
7505  *
7506  * @see evas_object_text_font_source_set()
7507  * @see evas_object_text_font_set()
7508  * @see evas_object_text_text_set()
7509  */
7510 EAPI Evas_Object      *evas_object_text_add              (Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
7511
7512 /**
7513  * Set the font (source) file to be used on a given text object.
7514  *
7515  * @param obj The text object to set font for.
7516  * @param font The font file's path.
7517  *
7518  * This function allows the font file to be explicitly set for a given
7519  * text object, overriding system lookup, which will first occur in
7520  * the given file's contents.
7521  *
7522  * @see evas_object_text_font_get()
7523  */
7524 EAPI void              evas_object_text_font_source_set  (Evas_Object *obj, const char *font) EINA_ARG_NONNULL(1);
7525
7526 /**
7527  * Get the font file's path which is being used on a given text
7528  * object.
7529  *
7530  * @param obj The text object to set font for.
7531  * @param font The font file's path.
7532  *
7533  * @see evas_object_text_font_get() for more details
7534  */
7535 EAPI const char       *evas_object_text_font_source_get  (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
7536
7537 /**
7538  * Set the font family and size on a given text object.
7539  *
7540  * @param obj The text object to set font for.
7541  * @param font The font (family) name.
7542  * @param size The font size, in points.
7543  *
7544  * This function allows the font name and size of a text object to be
7545  * set. The @p font string has to follow fontconfig's convention on
7546  * naming fonts, as it's the underlying lybrary used to query system
7547  * fonts by Evas (see the @c fc-list command's output, on your system,
7548  * to get an idea).
7549  *
7550  * @see evas_object_text_font_get()
7551  * @see evas_object_text_font_source_set()
7552  */
7553    EAPI void              evas_object_text_font_set         (Evas_Object *obj, const char *font, Evas_Font_Size size) EINA_ARG_NONNULL(1);
7554
7555 /**
7556  * Retrieve the font family and size in use on a given text object.
7557  *
7558  * @param obj The evas text object to query for font information.
7559  * @param font A pointer to the location to store the font name in.
7560  * @param size A pointer to the location to store the font size in.
7561  *
7562  * This function allows the font name and size of a text object to be
7563  * queried. Be aware that the font name string is still owned by Evas
7564  * and should @b not have free() called on it by the caller of the
7565  * function.
7566  *
7567  * @see evas_object_text_font_set()
7568  */
7569 EAPI void              evas_object_text_font_get         (const Evas_Object *obj, const char **font, Evas_Font_Size *size) EINA_ARG_NONNULL(1, 2);
7570
7571 /**
7572  * Sets the text string to be displayed by the given text object.
7573  *
7574  * @param obj The text object to set text string on.
7575  * @param text Text string to display on it.
7576  *
7577  * @see evas_object_text_text_get()
7578  */
7579 EAPI void              evas_object_text_text_set         (Evas_Object *obj, const char *text) EINA_ARG_NONNULL(1);
7580
7581 /**
7582  * Retrieves the text string currently being displayed by the given
7583  * text object.
7584  *
7585  * @param  obj The given text object.
7586  * @return The text string currently being displayed on it.
7587  *
7588  * @note Do not free() the return value.
7589  *
7590  * @see evas_object_text_text_set()
7591  */
7592 EAPI const char       *evas_object_text_text_get         (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
7593
7594 /**
7595  * @brief Sets the BiDi delimiters used in the textblock.
7596  *
7597  * BiDi delimiters are use for in-paragraph separation of bidi segments. This
7598  * is useful for example in recipients fields of e-mail clients where bidi
7599  * oddities can occur when mixing rtl and ltr.
7600  *
7601  * @param obj The given text object.
7602  * @param delim A null terminated string of delimiters, e.g ",|".
7603  * @since 1.1.0
7604  */
7605 EAPI void              evas_object_text_bidi_delimiters_set(Evas_Object *obj, const char *delim);
7606
7607 /**
7608  * @brief Gets the BiDi delimiters used in the textblock.
7609  *
7610  * BiDi delimiters are use for in-paragraph separation of bidi segments. This
7611  * is useful for example in recipients fields of e-mail clients where bidi
7612  * oddities can occur when mixing rtl and ltr.
7613  *
7614  * @param obj The given text object.
7615  * @return A null terminated string of delimiters, e.g ",|". If empty, returns NULL.
7616  * @since 1.1.0
7617  */
7618 EAPI const char       *evas_object_text_bidi_delimiters_get(const Evas_Object *obj);
7619
7620    EAPI Evas_Coord        evas_object_text_ascent_get       (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
7621    EAPI Evas_Coord        evas_object_text_descent_get      (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
7622    EAPI Evas_Coord        evas_object_text_max_ascent_get   (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
7623    EAPI Evas_Coord        evas_object_text_max_descent_get  (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
7624    EAPI Evas_Coord        evas_object_text_horiz_advance_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
7625    EAPI Evas_Coord        evas_object_text_vert_advance_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
7626    EAPI Evas_Coord        evas_object_text_inset_get        (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
7627
7628 /**
7629  * Retrieve position and dimension information of a character within a text @c Evas_Object.
7630  *
7631  * This function is used to obtain the X, Y, width and height of a the character
7632  * located at @p pos within the @c Evas_Object @p obj. @p obj must be a text object
7633  * as created with evas_object_text_add(). Any of the @c Evas_Coord parameters (@p cx,
7634  * @p cy, @p cw, @p ch) may be NULL in which case no value will be assigned to that
7635  * parameter.
7636  *
7637  * @param obj   The text object to retrieve position information for.
7638  * @param pos   The character position to request co-ordinates for.
7639  * @param cx    A pointer to an @c Evas_Coord to store the X value in (can be NULL).
7640  * @param cy    A pointer to an @c Evas_Coord to store the Y value in (can be NULL).
7641  * @param cw    A pointer to an @c Evas_Coord to store the Width value in (can be NULL).
7642  * @param ch    A pointer to an @c Evas_Coord to store the Height value in (can be NULL).
7643  *
7644  * @returns EINA_FALSE on success, EINA_TRUE on error.
7645  */
7646 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);
7647    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);
7648
7649 /**
7650  * Returns the logical position of the last char in the text
7651  * up to the pos given. this is NOT the position of the last char
7652  * because of the possibility of RTL in the text.
7653  */
7654 EAPI int               evas_object_text_last_up_to_pos   (const Evas_Object *obj, Evas_Coord x, Evas_Coord y) EINA_ARG_NONNULL(1);
7655
7656 /**
7657  * Retrieves the style on use on the given text object.
7658  *
7659  * @param obj the given text object to set style on.
7660  * @return the style type in use.
7661  *
7662  * @see evas_object_text_style_set() for more details.
7663  */
7664 EAPI Evas_Text_Style_Type evas_object_text_style_get     (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
7665
7666 /**
7667  * Sets the style to apply on the given text object.
7668  *
7669  * @param obj the given text object to set style on.
7670  * @param type a style type.
7671  *
7672  * Text object styles are one of the values in
7673  * #Evas_Text_Style_Type. Some of those values are combinations of
7674  * more than one style, and some account for the direction of the
7675  * rendering of shadow effects.
7676  *
7677  * @note One may use the helper macros #EVAS_TEXT_STYLE_BASIC_SET and
7678  * #EVAS_TEXT_STYLE_SHADOW_DIRECTION_SET to assemble a style value.
7679  *
7680  * The following figure illustrates the text styles:
7681  *
7682  * @image html text-styles.png
7683  * @image rtf text-styles.png
7684  * @image latex text-styles.eps
7685  *
7686  * @see evas_object_text_style_get()
7687  * @see evas_object_text_shadow_color_set()
7688  * @see evas_object_text_outline_color_set()
7689  * @see evas_object_text_glow_color_set()
7690  * @see evas_object_text_glow2_color_set()
7691  */
7692 EAPI void              evas_object_text_style_set        (Evas_Object *obj, Evas_Text_Style_Type type) EINA_ARG_NONNULL(1);
7693
7694 /**
7695  * Sets the shadow color for the given text object.
7696  *
7697  * @param obj The given Evas text object.
7698  * @param r The red component of the given color.
7699  * @param g The green component of the given color.
7700  * @param b The blue component of the given color.
7701  * @param a The alpha component of the given color.
7702  *
7703  * Shadow effects, which are fading colors decorating the text
7704  * underneath it, will just be shown if the object is set to one of
7705  * the following styles:
7706  *
7707  * - #EVAS_TEXT_STYLE_SHADOW
7708  * - #EVAS_TEXT_STYLE_OUTLINE_SHADOW
7709  * - #EVAS_TEXT_STYLE_FAR_SHADOW
7710  * - #EVAS_TEXT_STYLE_OUTLINE_SOFT_SHADOW
7711  * - #EVAS_TEXT_STYLE_SOFT_SHADOW
7712  * - #EVAS_TEXT_STYLE_FAR_SOFT_SHADOW
7713  *
7714  * One can also change de direction the shadow grows to, with
7715  * evas_object_text_style_set().
7716  *
7717  * @see evas_object_text_shadow_color_get()
7718  */
7719 EAPI void              evas_object_text_shadow_color_set (Evas_Object *obj, int r, int g, int b, int a) EINA_ARG_NONNULL(1);
7720
7721 /**
7722  * Retrieves the shadow color for the given text object.
7723  *
7724  * @param obj The given Evas text object.
7725  * @param r Pointer to variable to hold the red component of the given
7726  * color.
7727  * @param g Pointer to variable to hold the green component of the
7728  * given color.
7729  * @param b Pointer to variable to hold the blue component of the
7730  * given color.
7731  * @param a Pointer to variable to hold the alpha component of the
7732  * given color.
7733  *
7734  * @note Use @c NULL pointers on the color components you're not
7735  * interested in: they'll be ignored by the function.
7736  *
7737  * @see evas_object_text_shadow_color_set() for more details.
7738  */
7739 EAPI void              evas_object_text_shadow_color_get (const Evas_Object *obj, int *r, int *g, int *b, int *a) EINA_ARG_NONNULL(1);
7740
7741 /**
7742  * Sets the glow color for the given text object.
7743  *
7744  * @param obj The given Evas text object.
7745  * @param r The red component of the given color.
7746  * @param g The green component of the given color.
7747  * @param b The blue component of the given color.
7748  * @param a The alpha component of the given color.
7749  *
7750  * Glow effects, which are glowing colors decorating the text's
7751  * surroundings, will just be shown if the object is set to the
7752  * #EVAS_TEXT_STYLE_GLOW style.
7753  *
7754  * @note Glow effects are placed from a short distance of the text
7755  * itself, but no touching it. For glowing effects right on the
7756  * borders of the glyphs, see 'glow 2' effects
7757  * (evas_object_text_glow2_color_set()).
7758  *
7759  * @see evas_object_text_glow_color_get()
7760  */
7761 EAPI void              evas_object_text_glow_color_set   (Evas_Object *obj, int r, int g, int b, int a) EINA_ARG_NONNULL(1);
7762
7763 /**
7764  * Retrieves the glow color for the given text object.
7765  *
7766  * @param obj The given Evas text object.
7767  * @param r Pointer to variable to hold the red component of the given
7768  * color.
7769  * @param g Pointer to variable to hold the green component of the
7770  * given color.
7771  * @param b Pointer to variable to hold the blue component of the
7772  * given color.
7773  * @param a Pointer to variable to hold the alpha component of the
7774  * given color.
7775  *
7776  * @note Use @c NULL pointers on the color components you're not
7777  * interested in: they'll be ignored by the function.
7778  *
7779  * @see evas_object_text_glow_color_set() for more details.
7780  */
7781 EAPI void              evas_object_text_glow_color_get   (const Evas_Object *obj, int *r, int *g, int *b, int *a) EINA_ARG_NONNULL(1);
7782
7783 /**
7784  * Sets the 'glow 2' color for the given text object.
7785  *
7786  * @param obj The given Evas text object.
7787  * @param r The red component of the given color.
7788  * @param g The green component of the given color.
7789  * @param b The blue component of the given color.
7790  * @param a The alpha component of the given color.
7791  *
7792  * 'Glow 2' effects, which are glowing colors decorating the text's
7793  * (immediate) surroundings, will just be shown if the object is set
7794  * to the #EVAS_TEXT_STYLE_GLOW style. See also
7795  * evas_object_text_glow_color_set().
7796  *
7797  * @see evas_object_text_glow2_color_get()
7798  */
7799 EAPI void              evas_object_text_glow2_color_set  (Evas_Object *obj, int r, int g, int b, int a) EINA_ARG_NONNULL(1);
7800
7801 /**
7802  * Retrieves the 'glow 2' color for the given text object.
7803  *
7804  * @param obj The given Evas text object.
7805  * @param r Pointer to variable to hold the red component of the given
7806  * color.
7807  * @param g Pointer to variable to hold the green component of the
7808  * given color.
7809  * @param b Pointer to variable to hold the blue component of the
7810  * given color.
7811  * @param a Pointer to variable to hold the alpha component of the
7812  * given color.
7813  *
7814  * @note Use @c NULL pointers on the color components you're not
7815  * interested in: they'll be ignored by the function.
7816  *
7817  * @see evas_object_text_glow2_color_set() for more details.
7818  */
7819 EAPI void              evas_object_text_glow2_color_get  (const Evas_Object *obj, int *r, int *g, int *b, int *a) EINA_ARG_NONNULL(1);
7820
7821 /**
7822  * Sets the outline color for the given text object.
7823  *
7824  * @param obj The given Evas text object.
7825  * @param r The red component of the given color.
7826  * @param g The green component of the given color.
7827  * @param b The blue component of the given color.
7828  * @param a The alpha component of the given color.
7829  *
7830  * Outline effects (colored lines around text glyphs) will just be
7831  * shown if the object is set to one of the following styles:
7832  * - #EVAS_TEXT_STYLE_OUTLINE
7833  * - #EVAS_TEXT_STYLE_SOFT_OUTLINE
7834  * - #EVAS_TEXT_STYLE_OUTLINE_SHADOW
7835  * - #EVAS_TEXT_STYLE_OUTLINE_SOFT_SHADOW
7836  *
7837  * @see evas_object_text_outline_color_get()
7838  */
7839 EAPI void              evas_object_text_outline_color_set(Evas_Object *obj, int r, int g, int b, int a) EINA_ARG_NONNULL(1);
7840
7841 /**
7842  * Retrieves the outline color for the given text object.
7843  *
7844  * @param obj The given Evas text object.
7845  * @param r Pointer to variable to hold the red component of the given
7846  * color.
7847  * @param g Pointer to variable to hold the green component of the
7848  * given color.
7849  * @param b Pointer to variable to hold the blue component of the
7850  * given color.
7851  * @param a Pointer to variable to hold the alpha component of the
7852  * given color.
7853  *
7854  * @note Use @c NULL pointers on the color components you're not
7855  * interested in: they'll be ignored by the function.
7856  *
7857  * @see evas_object_text_outline_color_set() for more details.
7858  */
7859 EAPI void              evas_object_text_outline_color_get(const Evas_Object *obj, int *r, int *g, int *b, int *a) EINA_ARG_NONNULL(1);
7860
7861 /**
7862  * Gets the text style pad of a text object.
7863  *
7864  * @param obj The given text object.
7865  * @param l The left pad (or @c NULL).
7866  * @param r The right pad (or @c NULL).
7867  * @param t The top pad (or @c NULL).
7868  * @param b The bottom pad (or @c NULL).
7869  *
7870  */
7871 EAPI void              evas_object_text_style_pad_get    (const Evas_Object *obj, int *l, int *r, int *t, int *b) EINA_ARG_NONNULL(1);
7872
7873 /**
7874  * Retrieves the direction of the text currently being displayed in the
7875  * text object.
7876  * @param  obj The given evas text object.
7877  * @return the direction of the text
7878  */
7879 EAPI Evas_BiDi_Direction evas_object_text_direction_get  (const Evas_Object *obj) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
7880
7881 /**
7882  * @}
7883  */
7884
7885 /**
7886  * @defgroup Evas_Object_Textblock Textblock Object Functions
7887  *
7888  * Functions used to create and manipulate textblock objects. Unlike
7889  * @ref Evas_Object_Text, these handle complex text, doing multiple
7890  * styles and multiline text based on HTML-like tags. Of these extra
7891  * features will be heavier on memory and processing cost.
7892  *
7893  * @section Evas_Object_Textblock_Tutorial Textblock Object Tutorial
7894  *
7895  * This part explains about the textblock object's API and proper usage.
7896  * If you want to develop textblock, you should also refer to @ref Evas_Object_Textblock_Internal.
7897  * The main user of the textblock object is the edje entry object in Edje, so
7898  * that's a good place to learn from, but I think this document is more than
7899  * enough, if it's not, please contact me and I'll update it.
7900  *
7901  * @subsection textblock_intro Introduction
7902  * The textblock objects is, as implied, an object that can show big chunks of
7903  * text. Textblock supports many features including: Text formatting, automatic
7904  * and manual text alignment, embedding items (for example icons) and more.
7905  * Textblock has three important parts, the text paragraphs, the format nodes
7906  * and the cursors.
7907  *
7908  * You can use markup to format text, for example: "<font_size=50>Big!</font_size>".
7909  * You can also put more than one style directive in one tag:
7910  * "<font_size=50 color=#F00>Big and Red!</font_size>".
7911  * Please notice that we used "</font_size>" although the format also included
7912  * color, this is because the first format determines the matching closing tag's
7913  * name. You can also use anonymous tags, like: "<font_size=30>Big</>" which
7914  * just pop any type of format, but it's advised to use the named alternatives
7915  * instead.
7916  *
7917  * @subsection textblock_cursors Textblock Object Cursors
7918  * A textblock Cursor @ref Evas_Textblock_Cursor is data type that represents
7919  * a position in a textblock. Each cursor contains information about the
7920  * paragraph it points to, the position in that paragraph and the object itself.
7921  * Cursors register to textblock objects upon creation, this means that once
7922  * you created a cursor, it belongs to a specific obj and you can't for example
7923  * copy a cursor "into" a cursor of a different object. Registered cursors
7924  * also have the added benefit of updating automatically upon textblock changes,
7925  * this means that if you have a cursor pointing to a specific character, it'll
7926  * still point to it even after you change the whole object completely (as long
7927  * as the char was not deleted), this is not possible without updating, because
7928  * as mentioned, each cursor holds a character position. There are many
7929  * functions that handle cursors, just check out the evas_textblock_cursor*
7930  * functions. For creation and deletion of cursors check out:
7931  * @see evas_object_textblock_cursor_new()
7932  * @see evas_textblock_cursor_free()
7933  * @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).
7934  *
7935  * @subsection textblock_paragraphs Textblock Object Paragraphs
7936  * The textblock object is made out of text splitted to paragraphs (delimited
7937  * by the paragraph separation character). Each paragraph has many (or none)
7938  * format nodes associated with it which are responsible for the formatting
7939  * of that paragraph.
7940  *
7941  * @subsection textblock_format_nodes Textblock Object Format Nodes
7942  * As explained in @ref textblock_paragraphs each one of the format nodes
7943  * is associated with a paragraph.
7944  * There are two types of format nodes, visible and invisible:
7945  * Visible: formats that a cursor can point to, i.e formats that
7946  * occupy space, for example: newlines, tabs, items and etc. Some visible items
7947  * are made of two parts, in this case, only the opening tag is visible.
7948  * A closing tag (i.e a </tag> tag) should NEVER be visible.
7949  * Invisible: formats that don't occupy space, for example: bold and underline.
7950  * Being able to access format nodes is very important for some uses. For
7951  * example, edje uses the "<a>" format to create links in the text (and pop
7952  * popups above them when clicked). For the textblock object a is just a
7953  * formatting instruction (how to color the text), but edje utilizes the access
7954  * to the format nodes to make it do more.
7955  * For more information, take a look at all the evas_textblock_node_format_*
7956  * functions.
7957  * The translation of "<tag>" tags to actual format is done according to the
7958  * tags defined in the style, see @ref evas_textblock_style_set
7959  *
7960  * @subsection textblock_special_formats Special Formats
7961  * Textblock supports various format directives that can be used either in
7962  * markup, or by calling @ref evas_object_textblock_format_append or
7963  * @ref evas_object_textblock_format_prepend. In addition to the mentioned
7964  * format directives, textblock allows creating additional format directives
7965  * using "tags" that can be set in the style see @ref evas_textblock_style_set .
7966  *
7967  * Textblock supports the following formats:
7968  * @li font - Font description in fontconfig like format, e.g: "Sans:style=Italic:lang=hi". or "Serif:style=Bold".
7969  * @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".
7970  * @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".
7971  * @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".
7972  * @li lang - Overrides the language defined in "font". E.g: "lang=he" is the same as "font=:lang=he".
7973  * @li font_fallbacks - A comma delimited list of fonts to try if finding the main font fails.
7974  * @li font_size - The font size in points.
7975  * @li font_source - The source of the font, e.g an eet file.
7976  * @li color - Text color in one of the following formats: "#RRGGBB", "#RRGGBBAA", "#RGB", and "#RGBA".
7977  * @li underline_color - color in one of the following formats: "#RRGGBB", "#RRGGBBAA", "#RGB", and "#RGBA".
7978  * @li underline2_color - color in one of the following formats: "#RRGGBB", "#RRGGBBAA", "#RGB", and "#RGBA".
7979  * @li outline_color - color in one of the following formats: "#RRGGBB", "#RRGGBBAA", "#RGB", and "#RGBA".
7980  * @li shadow_color - color in one of the following formats: "#RRGGBB", "#RRGGBBAA", "#RGB", and "#RGBA".
7981  * @li glow_color - color in one of the following formats: "#RRGGBB", "#RRGGBBAA", "#RGB", and "#RGBA".
7982  * @li glow2_color - color in one of the following formats: "#RRGGBB", "#RRGGBBAA", "#RGB", and "#RGBA".
7983  * @li backing_color - color in one of the following formats: "#RRGGBB", "#RRGGBBAA", "#RGB", and "#RGBA".
7984  * @li strikethrough_color - color in one of the following formats: "#RRGGBB", "#RRGGBBAA", "#RGB", and "#RGBA".
7985  * @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%.
7986  * @li valign - Either "top", "bottom", "middle", "center", "baseline", "base", a value between 0.0 and 1.0, or a value between 0% to 100%.
7987  * @li wrap - "word", "char", "mixed", or "none".
7988  * @li left_margin - Either "reset", or a pixel value indicating the margin.
7989  * @li right_margin - Either "reset", or a pixel value indicating the margin.
7990  * @li underline - "on", "off", "single", or "double".
7991  * @li strikethrough - "on" or "off"
7992  * @li backing - "on" or "off"
7993  * @li style - Either "off", "none", "plain", "shadow", "outline", "soft_outline", "outline_shadow", "outline_soft_shadow", "glow", "far_shadow", "soft_shadow", or "far_soft_shadow".
7994  * @li tabstops - Pixel value for tab width.
7995  * @li linesize - Force a line size in pixels.
7996  * @li linerelsize - Either a floating point value or a percentage indicating the wanted size of the line relative to the calculated size.
7997  * @li linegap - Force a line gap in pixels.
7998  * @li linerelgap - Either a floating point value or a percentage indicating the wanted size of the line relative to the calculated size.
7999  * @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.
8000  * @li linefill - Either a float value or percentage indicating how much to fill the line.
8001  * @li ellipsis - Value between 0.0-1.0 to indicate the type of ellipsis, or -1.0 to indicate ellipsis isn't wanted.
8002  * @li password - "on" or "off". This is used to specifically turn replacing chars with the replacement char (i.e password mode) on and off.
8003  *
8004  *
8005  * @todo put here some usage examples
8006  *
8007  * @ingroup Evas_Object_Specific
8008  *
8009  * @{
8010  */
8011
8012    typedef struct _Evas_Textblock_Style                 Evas_Textblock_Style;
8013    typedef struct _Evas_Textblock_Cursor                Evas_Textblock_Cursor;
8014    /**
8015     * @typedef Evas_Object_Textblock_Node_Format
8016     * A format node.
8017     */
8018    typedef struct _Evas_Object_Textblock_Node_Format    Evas_Object_Textblock_Node_Format;
8019    typedef struct _Evas_Textblock_Rectangle             Evas_Textblock_Rectangle;
8020
8021    struct _Evas_Textblock_Rectangle
8022      {
8023         Evas_Coord x, y, w, h;
8024      };
8025
8026    typedef enum _Evas_Textblock_Text_Type
8027      {
8028         EVAS_TEXTBLOCK_TEXT_RAW,
8029         EVAS_TEXTBLOCK_TEXT_PLAIN,
8030         EVAS_TEXTBLOCK_TEXT_MARKUP
8031      } Evas_Textblock_Text_Type;
8032
8033    typedef enum _Evas_Textblock_Cursor_Type
8034      {
8035         EVAS_TEXTBLOCK_CURSOR_UNDER,
8036         EVAS_TEXTBLOCK_CURSOR_BEFORE
8037      } Evas_Textblock_Cursor_Type;
8038
8039
8040 /**
8041  * Adds a textblock to the given evas.
8042  * @param   e The given evas.
8043  * @return  The new textblock object.
8044  */
8045 EAPI Evas_Object                 *evas_object_textblock_add(Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
8046
8047
8048 /**
8049  * Returns the unescaped version of escape.
8050  * @param escape the string to be escaped
8051  * @return the unescaped version of escape
8052  */
8053 EAPI const char                  *evas_textblock_escape_string_get(const char *escape) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
8054
8055 /**
8056  * Returns the escaped version of the string.
8057  * @param string to escape
8058  * @param len_ret the len of the part of the string that was used.
8059  * @return the escaped string.
8060  */
8061 EAPI const char                  *evas_textblock_string_escape_get(const char *string, int *len_ret) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
8062
8063 /**
8064  * Return the unescaped version of the string between start and end.
8065  *
8066  * @param escape_start the start of the string.
8067  * @param escape_end the end of the string.
8068  * @return the unescaped version of the range
8069  */
8070 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;
8071
8072
8073 /**
8074  * Creates a new textblock style.
8075  * @return  The new textblock style.
8076  */
8077 EAPI Evas_Textblock_Style        *evas_textblock_style_new(void) EINA_WARN_UNUSED_RESULT EINA_MALLOC;
8078
8079 /**
8080  * Destroys a textblock style.
8081  * @param ts The textblock style to free.
8082  */
8083 EAPI void                         evas_textblock_style_free(Evas_Textblock_Style *ts) EINA_ARG_NONNULL(1);
8084
8085 /**
8086  * Sets the style ts to the style passed as text by text.
8087  * Expected a string consisting of many (or none) tag='format' pairs.
8088  *
8089  * @param ts  the style to set.
8090  * @param text the text to parse - NOT NULL.
8091  * @return Returns no value.
8092  */
8093 EAPI void                         evas_textblock_style_set(Evas_Textblock_Style *ts, const char *text) EINA_ARG_NONNULL(1);
8094
8095 /**
8096  * Return the text of the style ts.
8097  * @param ts  the style to get it's text.
8098  * @return the text of the style or null on error.
8099  */
8100 EAPI const char                  *evas_textblock_style_get(const Evas_Textblock_Style *ts) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
8101
8102
8103 /**
8104  * Set the objects style to ts.
8105  * @param obj the Evas object to set the style to.
8106  * @param ts  the style to set.
8107  * @return Returns no value.
8108  */
8109 EAPI void                         evas_object_textblock_style_set(Evas_Object *obj, Evas_Textblock_Style *ts) EINA_ARG_NONNULL(1);
8110
8111 /**
8112  * Return the style of an object.
8113  * @param obj  the object to get the style from.
8114  * @return the style of the object.
8115  */
8116 EAPI const Evas_Textblock_Style  *evas_object_textblock_style_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
8117
8118 /**
8119  * @brief Set the "replacement character" to use for the given textblock object.
8120  *
8121  * @param obj The given textblock object.
8122  * @param ch The charset name.
8123  */
8124 EAPI void                         evas_object_textblock_replace_char_set(Evas_Object *obj, const char *ch) EINA_ARG_NONNULL(1);
8125
8126 /**
8127  * @brief Get the "replacement character" for given textblock object. Returns
8128  * NULL if no replacement character is in use.
8129  *
8130  * @param obj The given textblock object
8131  * @return replacement character or @c NULL
8132  */
8133 EAPI const char                  *evas_object_textblock_replace_char_get(Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
8134
8135 /**
8136  * @brief Sets the vertical alignment of text within the textblock object
8137  * as a whole.
8138  *
8139  * Normally alignment is 0.0 (top of object). Values given should be
8140  * between 0.0 and 1.0 (1.0 bottom of object, 0.5 being vertically centered
8141  * etc.).
8142  *
8143  * @param obj The given textblock object.
8144  * @param align A value between 0.0 and 1.0
8145  * @since 1.1.0
8146  */
8147 EAPI void                         evas_object_textblock_valign_set(Evas_Object *obj, double align);
8148
8149 /**
8150  * @brief Gets the vertical alignment of a textblock
8151  *
8152  * @param obj The given textblock object.
8153  * @return The elignment set for the object
8154  * @since 1.1.0
8155  */
8156 EAPI double                       evas_object_textblock_valign_get(const Evas_Object *obj);
8157
8158 /**
8159  * @brief Sets the BiDi delimiters used in the textblock.
8160  *
8161  * BiDi delimiters are use for in-paragraph separation of bidi segments. This
8162  * is useful for example in recipients fields of e-mail clients where bidi
8163  * oddities can occur when mixing rtl and ltr.
8164  *
8165  * @param obj The given textblock object.
8166  * @param delim A null terminated string of delimiters, e.g ",|".
8167  * @since 1.1.0
8168  */
8169 EAPI void                         evas_object_textblock_bidi_delimiters_set(Evas_Object *obj, const char *delim);
8170
8171 /**
8172  * @brief Gets the BiDi delimiters used in the textblock.
8173  *
8174  * BiDi delimiters are use for in-paragraph separation of bidi segments. This
8175  * is useful for example in recipients fields of e-mail clients where bidi
8176  * oddities can occur when mixing rtl and ltr.
8177  *
8178  * @param obj The given textblock object.
8179  * @return A null terminated string of delimiters, e.g ",|". If empty, returns NULL.
8180  * @since 1.1.0
8181  */
8182 EAPI const char                  *evas_object_textblock_bidi_delimiters_get(const Evas_Object *obj);
8183
8184 /**
8185  * @brief Sets newline mode. When true, newline character will behave
8186  * as a paragraph separator.
8187  *
8188  * @param obj The given textblock object.
8189  * @param mode EINA_TRUE for legacy mode, EINA_FALSE otherwise.
8190  * @since 1.1.0
8191  */
8192 EAPI void                         evas_object_textblock_legacy_newline_set(Evas_Object *obj, Eina_Bool mode) EINA_ARG_NONNULL(1);
8193
8194 /**
8195  * @brief Gets newline mode. When true, newline character behaves
8196  * as a paragraph separator.
8197  *
8198  * @param obj The given textblock object.
8199  * @return EINA_TRUE if in legacy mode, EINA_FALSE otherwise.
8200  * @since 1.1.0
8201  */
8202 EAPI Eina_Bool                    evas_object_textblock_legacy_newline_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
8203
8204
8205 /**
8206  * Sets the tetxblock's text to the markup text.
8207  *
8208  * @note assumes text does not include the unicode object replacement char (0xFFFC)
8209  *
8210  * @param obj  the textblock object.
8211  * @param text the markup text to use.
8212  * @return Return no value.
8213  */
8214 EAPI void                         evas_object_textblock_text_markup_set(Evas_Object *obj, const char *text) EINA_ARG_NONNULL(1);
8215
8216 /**
8217  * Prepends markup to the cursor cur.
8218  *
8219  * @note assumes text does not include the unicode object replacement char (0xFFFC)
8220  *
8221  * @param cur  the cursor to prepend to.
8222  * @param text the markup text to prepend.
8223  * @return Return no value.
8224  */
8225 EAPI void                         evas_object_textblock_text_markup_prepend(Evas_Textblock_Cursor *cur, const char *text) EINA_ARG_NONNULL(1, 2);
8226
8227 /**
8228  * Return the markup of the object.
8229  *
8230  * @param obj the Evas object.
8231  * @return the markup text of the object.
8232  */
8233 EAPI const char                  *evas_object_textblock_text_markup_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
8234
8235
8236 /**
8237  * Return the object's main cursor.
8238  *
8239  * @param obj the object.
8240  * @return the obj's main cursor.
8241  */
8242 EAPI Evas_Textblock_Cursor *evas_object_textblock_cursor_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
8243
8244 /**
8245  * Create a new cursor, associate it to the obj and init it to point
8246  * to the start of the textblock. Association to the object means the cursor
8247  * will be updated when the object will change.
8248  *
8249  * @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).
8250  *
8251  * @param obj the object to associate to.
8252  * @return the new cursor.
8253  */
8254 EAPI Evas_Textblock_Cursor       *evas_object_textblock_cursor_new(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
8255
8256
8257 /**
8258  * Free the cursor and unassociate it from the object.
8259  * @note do not use it to free unassociated cursors.
8260  *
8261  * @param cur the cursor to free.
8262  * @return Returns no value.
8263  */
8264 EAPI void                         evas_textblock_cursor_free(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8265
8266
8267 /**
8268  * Sets the cursor to the start of the first text node.
8269  *
8270  * @param cur the cursor to update.
8271  * @return Returns no value.
8272  */
8273 EAPI void                         evas_textblock_cursor_paragraph_first(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8274
8275 /**
8276  * sets the cursor to the end of the last text node.
8277  *
8278  * @param cur the cursor to set.
8279  * @return Returns no value.
8280  */
8281 EAPI void                         evas_textblock_cursor_paragraph_last(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8282
8283 /**
8284  * Advances to the start of the next text node
8285  *
8286  * @param cur the cursor to update
8287  * @return #EINA_TRUE if it managed to advance a paragraph, #EINA_FALSE otherwise.
8288  */
8289 EAPI Eina_Bool                    evas_textblock_cursor_paragraph_next(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8290
8291 /**
8292  * Advances to the end of the previous text node
8293  *
8294  * @param cur the cursor to update
8295  * @return #EINA_TRUE if it managed to advance a paragraph, #EINA_FALSE otherwise.
8296  */
8297 EAPI Eina_Bool                    evas_textblock_cursor_paragraph_prev(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8298
8299 /**
8300  * Returns the
8301  *
8302  * @param obj The evas, must not be NULL.
8303  * @param anchor the anchor name to get
8304  * @return Returns the list format node corresponding to the anchor, may be null if there are none.
8305  */
8306 EAPI const Eina_List             *evas_textblock_node_format_list_get(const Evas_Object *obj, const char *anchor) EINA_ARG_NONNULL(1, 2);
8307
8308 /**
8309  * Returns the first format node.
8310  *
8311  * @param obj The evas, must not be NULL.
8312  * @return Returns the first format node, may be null if there are none.
8313  */
8314 EAPI const Evas_Object_Textblock_Node_Format *evas_textblock_node_format_first_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
8315
8316 /**
8317  * Returns the last format node.
8318  *
8319  * @param obj The evas textblock, must not be NULL.
8320  * @return Returns the first format node, may be null if there are none.
8321  */
8322 EAPI const Evas_Object_Textblock_Node_Format *evas_textblock_node_format_last_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
8323
8324 /**
8325  * Returns the next format node (after n)
8326  *
8327  * @param n the current format node - not null.
8328  * @return Returns the next format node, may be null.
8329  */
8330 EAPI const Evas_Object_Textblock_Node_Format *evas_textblock_node_format_next_get(const Evas_Object_Textblock_Node_Format *n) EINA_ARG_NONNULL(1);
8331
8332 /**
8333  * Returns the prev format node (after n)
8334  *
8335  * @param n the current format node - not null.
8336  * @return Returns the prev format node, may be null.
8337  */
8338 EAPI const Evas_Object_Textblock_Node_Format *evas_textblock_node_format_prev_get(const Evas_Object_Textblock_Node_Format *n) EINA_ARG_NONNULL(1);
8339
8340 /**
8341  * Remove a format node and it's match. i.e, removes a <tag> </tag> pair.
8342  * Assumes the node is the first part of <tag> i.e, this won't work if
8343  * n is a closing tag.
8344  *
8345  * @param obj the Evas object of the textblock - not null.
8346  * @param n the current format node - not null.
8347  */
8348 EAPI void                         evas_textblock_node_format_remove_pair(Evas_Object *obj, Evas_Object_Textblock_Node_Format *n) EINA_ARG_NONNULL(1, 2);
8349
8350 /**
8351  * Sets the cursor to point to the place where format points to.
8352  *
8353  * @param cur the cursor to update.
8354  * @param n the format node to update according.
8355  * @deprecated duplicate of evas_textblock_cursor_at_format_set
8356  */
8357 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);
8358
8359 /**
8360  * Return the format node at the position pointed by cur.
8361  *
8362  * @param cur the position to look at.
8363  * @return the format node if found, NULL otherwise.
8364  * @see evas_textblock_cursor_format_is_visible_get()
8365  */
8366 EAPI const Evas_Object_Textblock_Node_Format *evas_textblock_cursor_format_get(const Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8367
8368 /**
8369  * Get the text format representation of the format node.
8370  *
8371  * @param fmt the format node.
8372  * @return the textual format of the format node.
8373  */
8374 EAPI const char                  *evas_textblock_node_format_text_get(const Evas_Object_Textblock_Node_Format *fnode) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
8375
8376 /**
8377  * Set the cursor to point to the position of fmt.
8378  *
8379  * @param cur the cursor to update
8380  * @param fmt the format to update according to.
8381  */
8382 EAPI void                         evas_textblock_cursor_at_format_set(Evas_Textblock_Cursor *cur, const Evas_Object_Textblock_Node_Format *fmt) EINA_ARG_NONNULL(1, 2);
8383
8384 /**
8385  * Check if the current cursor position is a visible format. This way is more
8386  * efficient than evas_textblock_cursor_format_get() to check for the existence
8387  * of a visible format.
8388  *
8389  * @param cur the cursor to look at.
8390  * @return #EINA_TRUE if the cursor points to a visible format, #EINA_FALSE otherwise.
8391  * @see evas_textblock_cursor_format_get()
8392  */
8393 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;
8394
8395 /**
8396  * Advances to the next format node
8397  *
8398  * @param cur the cursor to be updated.
8399  * @return #EINA_TRUE on success #EINA_FALSE otherwise.
8400  */
8401 EAPI Eina_Bool                    evas_textblock_cursor_format_next(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8402
8403 /**
8404  * Advances to the previous format node.
8405  *
8406  * @param cur the cursor to update.
8407  * @return #EINA_TRUE on success #EINA_FALSE otherwise.
8408  */
8409 EAPI Eina_Bool                    evas_textblock_cursor_format_prev(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8410
8411 /**
8412  * Returns true if the cursor points to a format.
8413  *
8414  * @param cur the cursor to check.
8415  * @return Returns #EINA_TRUE if a cursor points to a format #EINA_FALSE otherwise.
8416  */
8417 EAPI Eina_Bool                    evas_textblock_cursor_is_format(const Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8418
8419 /**
8420  * Advances 1 char forward.
8421  *
8422  * @param cur the cursor to advance.
8423  * @return #EINA_TRUE on success #EINA_FALSE otherwise.
8424  */
8425 EAPI Eina_Bool                    evas_textblock_cursor_char_next(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8426
8427 /**
8428  * Advances 1 char backward.
8429  *
8430  * @param cur the cursor to advance.
8431  * @return #EINA_TRUE on success #EINA_FALSE otherwise.
8432  */
8433 EAPI Eina_Bool                    evas_textblock_cursor_char_prev(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8434
8435 /**
8436  * Go to the first char in the node the cursor is pointing on.
8437  *
8438  * @param cur the cursor to update.
8439  * @return Returns no value.
8440  */
8441 EAPI void                         evas_textblock_cursor_paragraph_char_first(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8442
8443 /**
8444  * Go to the last char in a text node.
8445  *
8446  * @param cur the cursor to update.
8447  * @return Returns no value.
8448  */
8449 EAPI void                         evas_textblock_cursor_paragraph_char_last(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8450
8451 /**
8452  * Go to the start of the current line
8453  *
8454  * @param cur the cursor to update.
8455  * @return Returns no value.
8456  */
8457 EAPI void                         evas_textblock_cursor_line_char_first(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8458
8459 /**
8460  * Go to the end of the current line.
8461  *
8462  * @param cur the cursor to update.
8463  * @return Returns no value.
8464  */
8465 EAPI void                         evas_textblock_cursor_line_char_last(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8466
8467 /**
8468  * Return the current cursor pos.
8469  *
8470  * @param cur the cursor to take the position from.
8471  * @return the position or -1 on error
8472  */
8473 EAPI int                          evas_textblock_cursor_pos_get(const Evas_Textblock_Cursor *cur) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
8474
8475 /**
8476  * Set the cursor pos.
8477  *
8478  * @param cur the cursor to be set.
8479  * @param pos the pos to set.
8480  */
8481 EAPI void                         evas_textblock_cursor_pos_set(Evas_Textblock_Cursor *cur, int pos) EINA_ARG_NONNULL(1);
8482
8483 /**
8484  * Go to the start of the line passed
8485  *
8486  * @param cur cursor to update.
8487  * @param line numer to set.
8488  * @return #EINA_TRUE on success, #EINA_FALSE on error.
8489  */
8490 EAPI Eina_Bool                    evas_textblock_cursor_line_set(Evas_Textblock_Cursor *cur, int line) EINA_ARG_NONNULL(1);
8491
8492 /**
8493  * Compare two cursors.
8494  *
8495  * @param cur1 the first cursor.
8496  * @param cur2 the second cursor.
8497  * @return -1 if cur1 < cur2, 0 if cur1 == cur2 and 1 otherwise.
8498  */
8499 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;
8500
8501 /**
8502  * Make cur_dest point to the same place as cur. Does not work if they don't
8503  * point to the same object.
8504  *
8505  * @param cur the source cursor.
8506  * @param cur_dest destination cursor.
8507  * @return Returns no value.
8508  */
8509 EAPI void                         evas_textblock_cursor_copy(const Evas_Textblock_Cursor *cur, Evas_Textblock_Cursor *cur_dest) EINA_ARG_NONNULL(1, 2);
8510
8511
8512 /**
8513  * Adds text to the current cursor position and set the cursor to *before*
8514  * the start of the text just added.
8515  *
8516  * @param cur the cursor to where to add text at.
8517  * @param _text the text to add.
8518  * @return Returns the len of the text added.
8519  * @see evas_textblock_cursor_text_prepend()
8520  */
8521 EAPI int                          evas_textblock_cursor_text_append(Evas_Textblock_Cursor *cur, const char *text) EINA_ARG_NONNULL(1, 2);
8522
8523 /**
8524  * Adds text to the current cursor position and set the cursor to *after*
8525  * the start of the text just added.
8526  *
8527  * @param cur the cursor to where to add text at.
8528  * @param _text the text to add.
8529  * @return Returns the len of the text added.
8530  * @see evas_textblock_cursor_text_append()
8531  */
8532 EAPI int                          evas_textblock_cursor_text_prepend(Evas_Textblock_Cursor *cur, const char *text) EINA_ARG_NONNULL(1, 2);
8533
8534
8535 /**
8536  * Adds format to the current cursor position. If the format being added is a
8537  * visible format, add it *before* the cursor position, otherwise, add it after.
8538  * This behavior is because visible formats are like characters and invisible
8539  * should be stacked in a way that the last one is added last.
8540  *
8541  * This function works with native formats, that means that style defined
8542  * tags like <br> won't work here. For those kind of things use markup prepend.
8543  *
8544  * @param cur the cursor to where to add format at.
8545  * @param format the format to add.
8546  * @return Returns true if a visible format was added, false otherwise.
8547  * @see evas_textblock_cursor_format_prepend()
8548  */
8549
8550 /**
8551  * Check if the current cursor position points to the terminating null of the
8552  * last paragraph. (shouldn't be allowed to point to the terminating null of
8553  * any previous paragraph anyway.
8554  *
8555  * @param cur the cursor to look at.
8556  * @return #EINA_TRUE if the cursor points to the terminating null, #EINA_FALSE otherwise.
8557  */
8558 EAPI Eina_Bool                    evas_textblock_cursor_format_append(Evas_Textblock_Cursor *cur, const char *format) EINA_ARG_NONNULL(1, 2);
8559
8560 /**
8561  * Adds format to the current cursor position. If the format being added is a
8562  * visible format, add it *before* the cursor position, otherwise, add it after.
8563  * This behavior is because visible formats are like characters and invisible
8564  * should be stacked in a way that the last one is added last.
8565  * If the format is visible the cursor is advanced after it.
8566  *
8567  * This function works with native formats, that means that style defined
8568  * tags like <br> won't work here. For those kind of things use markup prepend.
8569  *
8570  * @param cur the cursor to where to add format at.
8571  * @param format the format to add.
8572  * @return Returns true if a visible format was added, false otherwise.
8573  * @see evas_textblock_cursor_format_prepend()
8574  */
8575 EAPI Eina_Bool                    evas_textblock_cursor_format_prepend(Evas_Textblock_Cursor *cur, const char *format) EINA_ARG_NONNULL(1, 2);
8576
8577 /**
8578  * Delete the character at the location of the cursor. If there's a format
8579  * pointing to this position, delete it as well.
8580  *
8581  * @param cur the cursor pointing to the current location.
8582  * @return Returns no value.
8583  */
8584 EAPI void                         evas_textblock_cursor_char_delete(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8585
8586 /**
8587  * Delete the range between cur1 and cur2.
8588  *
8589  * @param cur1 one side of the range.
8590  * @param cur2 the second side of the range
8591  * @return Returns no value.
8592  */
8593 EAPI void                         evas_textblock_cursor_range_delete(Evas_Textblock_Cursor *cur1, Evas_Textblock_Cursor *cur2) EINA_ARG_NONNULL(1, 2);
8594
8595
8596 /**
8597  * Return the text of the paragraph cur points to - returns the text in markup..
8598  *
8599  * @param cur the cursor pointing to the paragraph.
8600  * @return the text on success, NULL otherwise.
8601  */
8602 EAPI const char                  *evas_textblock_cursor_paragraph_text_get(const Evas_Textblock_Cursor *cur) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
8603
8604 /**
8605  * Return the length of the paragraph, cheaper the eina_unicode_strlen()
8606  *
8607  * @param cur the position of the paragraph.
8608  * @return the length of the paragraph on success, -1 otehrwise.
8609  */
8610 EAPI int                          evas_textblock_cursor_paragraph_text_length_get(const Evas_Textblock_Cursor *cur) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
8611
8612 /**
8613  * Return the currently visible range.
8614  *
8615  * @param start the start of the range.
8616  * @param end the end of the range.
8617  * @return EINA_TRUE on success. EINA_FALSE otherwise.
8618  * @since 1.1.0
8619  */
8620 Eina_Bool                         evas_textblock_cursor_visible_range_get(Evas_Textblock_Cursor *start, Evas_Textblock_Cursor *end) EINA_ARG_NONNULL(1, 2);
8621
8622 /**
8623  * Return the format nodes in the range between cur1 and cur2.
8624  *
8625  * @param cur1 one side of the range.
8626  * @param cur2 the other side of the range
8627  * @return the foramt nodes in the range. You have to free it.
8628  * @since 1.1.0
8629  */
8630 EAPI Eina_List *                 evas_textblock_cursor_range_formats_get(const Evas_Textblock_Cursor *cur1, const Evas_Textblock_Cursor *cur2) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2) EINA_PURE;
8631
8632 /**
8633  * Return the text in the range between cur1 and cur2
8634  *
8635  * @param cur1 one side of the range.
8636  * @param cur2 the other side of the range
8637  * @param format The form on which to return the text. Markup - in textblock markup. Plain - UTF8.
8638  * @return the text in the range
8639  * @see elm_entry_markup_to_utf8()
8640  */
8641 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;
8642
8643 /**
8644  * Return the content of the cursor.
8645  *
8646  * @param cur the cursor
8647  * @return the text in the range
8648  */
8649 EAPI char                        *evas_textblock_cursor_content_get(const Evas_Textblock_Cursor *cur) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
8650
8651
8652 /**
8653  * Returns the geometry of the cursor. Depends on the type of cursor requested.
8654  * This should be used instead of char_geometry_get because there are weird
8655  * special cases with BiDi text.
8656  * in '_' cursor mode (i.e a line below the char) it's the same as char_geometry
8657  * get, except for the case of the last char of a line which depends on the
8658  * paragraph direction.
8659  *
8660  * in '|' cursor mode (i.e a line between two chars) it is very varyable.
8661  * For example consider the following visual string:
8662  * "abcCBA" (ABC are rtl chars), a cursor pointing on A should actually draw
8663  * a '|' between the c and the C.
8664  *
8665  * @param cur the cursor.
8666  * @param cx the x of the cursor
8667  * @param cy the y of the cursor
8668  * @param cw the width of the cursor
8669  * @param ch the height of the cursor
8670  * @param dir the direction of the cursor, can be NULL.
8671  * @param ctype the type of the cursor.
8672  * @return line number of the char on success, -1 on error.
8673  */
8674 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);
8675
8676 /**
8677  * Returns the geometry of the char at cur.
8678  *
8679  * @param cur the position of the char.
8680  * @param cx the x of the char.
8681  * @param cy the y of the char.
8682  * @param cw the w of the char.
8683  * @param ch the h of the char.
8684  * @return line number of the char on success, -1 on error.
8685  */
8686 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);
8687
8688 /**
8689  * Returns the geometry of the pen at cur.
8690  *
8691  * @param cur the position of the char.
8692  * @param cpen_x the pen_x of the char.
8693  * @param cy the y of the char.
8694  * @param cadv the adv of the char.
8695  * @param ch the h of the char.
8696  * @return line number of the char on success, -1 on error.
8697  */
8698 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);
8699
8700 /**
8701  * Returns the geometry of the line at cur.
8702  *
8703  * @param cur the position of the line.
8704  * @param cx the x of the line.
8705  * @param cy the y of the line.
8706  * @param cw the width of the line.
8707  * @param ch the height of the line.
8708  * @return line number of the line on success, -1 on error.
8709  */
8710 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);
8711
8712 /**
8713  * Set the position of the cursor according to the X and Y coordinates.
8714  *
8715  * @param cur the cursor to set.
8716  * @param x coord to set by.
8717  * @param y coord to set by.
8718  * @return #EINA_TRUE on success, #EINA_FALSE otherwise.
8719  */
8720 EAPI Eina_Bool                    evas_textblock_cursor_char_coord_set(Evas_Textblock_Cursor *cur, Evas_Coord x, Evas_Coord y) EINA_ARG_NONNULL(1);
8721
8722 /**
8723  * Set the cursor position according to the y coord.
8724  *
8725  * @param cur the cur to be set.
8726  * @param y the coord to set by.
8727  * @return the line number found, -1 on error.
8728  */
8729 EAPI int                          evas_textblock_cursor_line_coord_set(Evas_Textblock_Cursor *cur, Evas_Coord y) EINA_ARG_NONNULL(1);
8730
8731 /**
8732  * Get the geometry of a range.
8733  *
8734  * @param cur1 one side of the range.
8735  * @param cur2 other side of the range.
8736  * @return a list of Rectangles representing the geometry of the range.
8737  */
8738 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;
8739    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);
8740
8741
8742 /**
8743  * Checks if the cursor points to the end of the line.
8744  *
8745  * @param cur the cursor to check.
8746  * @return #EINA_TRUE if true, #EINA_FALSE otherwise.
8747  */
8748 EAPI Eina_Bool                    evas_textblock_cursor_eol_get(const Evas_Textblock_Cursor *cur) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
8749
8750
8751 /**
8752  * Get the geometry of a line number.
8753  *
8754  * @param obj the object.
8755  * @param line the line number.
8756  * @param cx x coord of the line.
8757  * @param cy y coord of the line.
8758  * @param cw w coord of the line.
8759  * @param ch h coord of the line.
8760  * @return #EINA_TRUE on success, #EINA_FALSE otherwise.
8761  */
8762 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);
8763
8764 /**
8765  * Clear the textblock object.
8766  * @note Does *NOT* free the Evas object itself.
8767  *
8768  * @param obj the object to clear.
8769  * @return nothing.
8770  */
8771 EAPI void                         evas_object_textblock_clear(Evas_Object *obj) EINA_ARG_NONNULL(1);
8772
8773 /**
8774  * Get the formatted width and height. This calculates the actual size after restricting
8775  * the textblock to the current size of the object.
8776  * The main difference between this and @ref evas_object_textblock_size_native_get
8777  * is that the "native" function does not wrapping into account
8778  * it just calculates the real width of the object if it was placed on an
8779  * infinite canvas, while this function gives the size after wrapping
8780  * according to the size restrictions of the object.
8781  *
8782  * For example for a textblock containing the text: "You shall not pass!"
8783  * with no margins or padding and assuming a monospace font and a size of
8784  * 7x10 char widths (for simplicity) has a native size of 19x1
8785  * and a formatted size of 5x4.
8786  *
8787  *
8788  * @param obj the Evas object.
8789  * @param w[out] the width of the object.
8790  * @param h[out] the height of the object
8791  * @return Returns no value.
8792  * @see evas_object_textblock_size_native_get
8793  */
8794 EAPI void                         evas_object_textblock_size_formatted_get(const Evas_Object *obj, Evas_Coord *w, Evas_Coord *h) EINA_ARG_NONNULL(1);
8795
8796 /**
8797  * Get the native width and height. This calculates the actual size without taking account
8798  * the current size of the object.
8799  * The main difference between this and @ref evas_object_textblock_size_formatted_get
8800  * is that the "native" function does not take wrapping into account
8801  * it just calculates the real width of the object if it was placed on an
8802  * infinite canvas, while the "formatted" function gives the size after
8803  * wrapping text according to the size restrictions of the object.
8804  *
8805  * For example for a textblock containing the text: "You shall not pass!"
8806  * with no margins or padding and assuming a monospace font and a size of
8807  * 7x10 char widths (for simplicity) has a native size of 19x1
8808  * and a formatted size of 5x4.
8809  *
8810  * @param obj the Evas object of the textblock
8811  * @param w[out] the width returned
8812  * @param h[out] the height returned
8813  * @return Returns no value.
8814  */
8815 EAPI void                         evas_object_textblock_size_native_get(const Evas_Object *obj, Evas_Coord *w, Evas_Coord *h) EINA_ARG_NONNULL(1);
8816    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);
8817 /**
8818  * @}
8819  */
8820
8821 /**
8822  * @defgroup Evas_Line_Group Line Object Functions
8823  *
8824  * Functions used to deal with evas line objects.
8825  *
8826  * @ingroup Evas_Object_Specific
8827  *
8828  * @{
8829  */
8830
8831 /**
8832  * Adds a new evas line object to the given evas.
8833  * @param   e The given evas.
8834  * @return  The new evas line object.
8835  */
8836 EAPI Evas_Object      *evas_object_line_add              (Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
8837
8838 /**
8839  * Sets the coordinates of the end points of the given evas line object.
8840  * @param   obj The given evas line object.
8841  * @param   x1  The X coordinate of the first point.
8842  * @param   y1  The Y coordinate of the first point.
8843  * @param   x2  The X coordinate of the second point.
8844  * @param   y2  The Y coordinate of the second point.
8845  */
8846 EAPI void              evas_object_line_xy_set           (Evas_Object *obj, Evas_Coord x1, Evas_Coord y1, Evas_Coord x2, Evas_Coord y2);
8847
8848 /**
8849  * Retrieves the coordinates of the end points of the given evas line object.
8850  * @param obj The given line object.
8851  * @param x1  Pointer to an integer in which to store the X coordinate of the
8852  *            first end point.
8853  * @param y1  Pointer to an integer in which to store the Y coordinate of the
8854  *            first end point.
8855  * @param x2  Pointer to an integer in which to store the X coordinate of the
8856  *            second end point.
8857  * @param y2  Pointer to an integer in which to store the Y coordinate of the
8858  *            second end point.
8859  */
8860 EAPI void              evas_object_line_xy_get           (const Evas_Object *obj, Evas_Coord *x1, Evas_Coord *y1, Evas_Coord *x2, Evas_Coord *y2);
8861 /**
8862  * @}
8863  */
8864
8865 /**
8866  * @defgroup Evas_Object_Polygon Polygon Object Functions
8867  *
8868  * Functions that operate on evas polygon objects.
8869  *
8870  * Hint: as evas does not provide ellipse, smooth paths or circle, one
8871  * can calculate points and convert these to a polygon.
8872  *
8873  * @ingroup Evas_Object_Specific
8874  *
8875  * @{
8876  */
8877
8878 /**
8879  * Adds a new evas polygon object to the given evas.
8880  * @param   e The given evas.
8881  * @return  A new evas polygon object.
8882  */
8883 EAPI Evas_Object      *evas_object_polygon_add           (Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
8884
8885 /**
8886  * Adds the given point to the given evas polygon object.
8887  * @param obj The given evas polygon object.
8888  * @param x   The X coordinate of the given point.
8889  * @param y   The Y coordinate of the given point.
8890  * @ingroup Evas_Polygon_Group
8891  */
8892 EAPI void              evas_object_polygon_point_add     (Evas_Object *obj, Evas_Coord x, Evas_Coord y) EINA_ARG_NONNULL(1);
8893
8894 /**
8895  * Removes all of the points from the given evas polygon object.
8896  * @param   obj The given polygon object.
8897  */
8898 EAPI void              evas_object_polygon_points_clear  (Evas_Object *obj) EINA_ARG_NONNULL(1);
8899 /**
8900  * @}
8901  */
8902
8903 /**
8904  * @defgroup Evas_Smart_Group Smart Functions
8905  *
8906  * Functions that deal with #Evas_Smart structs, creating definition
8907  * (classes) of objects that will have customized behavior for methods
8908  * like evas_object_move(), evas_object_resize(),
8909  * evas_object_clip_set() and others.
8910  *
8911  * These objects will accept the generic methods defined in @ref
8912  * Evas_Object_Group and the extensions defined in @ref
8913  * Evas_Smart_Object_Group. There are a couple of existent smart
8914  * objects in Evas itself (see @ref Evas_Object_Box, @ref
8915  * Evas_Object_Table and @ref Evas_Smart_Object_Clipped).
8916  *
8917  * See also some @ref Example_Evas_Smart_Objects "examples" of this
8918  * group of functions.
8919  */
8920
8921 /**
8922  * @addtogroup Evas_Smart_Group
8923  * @{
8924  */
8925
8926 /**
8927  * @def EVAS_SMART_CLASS_VERSION
8928  *
8929  * The version you have to put into the version field in the
8930  * #Evas_Smart_Class struct. Used to safeguard from binaries with old
8931  * smart object intefaces running with newer ones.
8932  *
8933  * @ingroup Evas_Smart_Group
8934  */
8935 #define EVAS_SMART_CLASS_VERSION 4
8936 /**
8937  * @struct _Evas_Smart_Class
8938  *
8939  * A smart object's @b base class definition
8940  *
8941  * @ingroup Evas_Smart_Group
8942  */
8943 struct _Evas_Smart_Class
8944 {
8945    const char *name; /**< the name string of the class */
8946    int         version;
8947    void  (*add)         (Evas_Object *o); /**< code to be run when adding object to a canvas */
8948    void  (*del)         (Evas_Object *o); /**< code to be run when removing object to a canvas */
8949    void  (*move)        (Evas_Object *o, Evas_Coord x, Evas_Coord y); /**< code to be run when moving object on a canvas */
8950    void  (*resize)      (Evas_Object *o, Evas_Coord w, Evas_Coord h); /**< code to be run when resizing object on a canvas */
8951    void  (*show)        (Evas_Object *o); /**< code to be run when showing object on a canvas */
8952    void  (*hide)        (Evas_Object *o); /**< code to be run when hiding object on a canvas */
8953    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 */
8954    void  (*clip_set)    (Evas_Object *o, Evas_Object *clip); /**< code to be run when setting clipper of object on a canvas */
8955    void  (*clip_unset)  (Evas_Object *o); /**< code to be run when unsetting clipper of object on a canvas */
8956    void  (*calculate)   (Evas_Object *o); /**< code to be run when object has rendering updates on a canvas */
8957    void  (*member_add)  (Evas_Object *o, Evas_Object *child); /**< code to be run when child member is added to object */
8958    void  (*member_del)  (Evas_Object *o, Evas_Object *child); /**< code to be run when child member is removed from object */
8959
8960    const Evas_Smart_Class          *parent; /**< this class inherits from this parent */
8961    const Evas_Smart_Cb_Description *callbacks; /**< callbacks at this level, @c NULL terminated */
8962    void                            *interfaces; /**< to be used in a future near you */
8963    const void                      *data;
8964 };
8965
8966 /**
8967  * @struct _Evas_Smart_Cb_Description
8968  *
8969  * Describes a callback issued by a smart object
8970  * (evas_object_smart_callback_call()), as defined in its smart object
8971  * class. This is particularly useful to explain to end users and
8972  * their code (i.e., introspection) what the parameter @c event_info
8973  * will point to.
8974  *
8975  * @ingroup Evas_Smart_Group
8976  */
8977 struct _Evas_Smart_Cb_Description
8978 {
8979    const char *name; /**< callback name ("changed", for example) */
8980
8981    /**
8982     * @brief Hint on the type of @c event_info parameter's contents on
8983     * a #Evas_Smart_Cb callback.
8984     *
8985     * The type string uses the pattern similar to
8986     * http://dbus.freedesktop.org/doc/dbus-specification.html#message-protocol-signatures,
8987     * but extended to optionally include variable names within
8988     * brackets preceding types. Example:
8989     *
8990     * @li Structure with two integers:
8991     *     @c "(ii)"
8992     *
8993     * @li Structure called 'x' with two integers named 'a' and 'b':
8994     *     @c "[x]([a]i[b]i)"
8995     *
8996     * @li Array of integers:
8997     *     @c "ai"
8998     *
8999     * @li Array called 'x' of struct with two integers:
9000     *     @c "[x]a(ii)"
9001     *
9002     * @note This type string is used as a hint and is @b not validated
9003     *       or enforced in any way. Implementors should make the best
9004     *       use of it to help bindings, documentation and other users
9005     *       of introspection features.
9006     */
9007    const char *type;
9008 };
9009
9010 /**
9011  * @def EVAS_SMART_CLASS_INIT_NULL
9012  * Initializer to zero a whole Evas_Smart_Class structure.
9013  *
9014  * @see EVAS_SMART_CLASS_INIT_VERSION
9015  * @see EVAS_SMART_CLASS_INIT_NAME_VERSION
9016  * @see EVAS_SMART_CLASS_INIT_NAME_VERSION_PARENT
9017  * @see EVAS_SMART_CLASS_INIT_NAME_VERSION_PARENT_CALLBACKS
9018  * @ingroup Evas_Smart_Group
9019  */
9020 #define EVAS_SMART_CLASS_INIT_NULL {NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL}
9021
9022 /**
9023  * @def EVAS_SMART_CLASS_INIT_VERSION
9024  * Initializer to zero a whole Evas_Smart_Class structure and set version.
9025  *
9026  * Similar to EVAS_SMART_CLASS_INIT_NULL, but will set version field to
9027  * latest EVAS_SMART_CLASS_VERSION.
9028  *
9029  * @see EVAS_SMART_CLASS_INIT_NULL
9030  * @see EVAS_SMART_CLASS_INIT_NAME_VERSION
9031  * @see EVAS_SMART_CLASS_INIT_NAME_VERSION_PARENT
9032  * @see EVAS_SMART_CLASS_INIT_NAME_VERSION_PARENT_CALLBACKS
9033  * @ingroup Evas_Smart_Group
9034  */
9035 #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}
9036
9037 /**
9038  * @def EVAS_SMART_CLASS_INIT_NAME_VERSION
9039  * Initializer to zero a whole Evas_Smart_Class structure and set name
9040  * and version.
9041  *
9042  * Similar to EVAS_SMART_CLASS_INIT_NULL, but will set version field to
9043  * latest EVAS_SMART_CLASS_VERSION and name to the specified value.
9044  *
9045  * It will keep a reference to name field as a "const char *", that is,
9046  * name must be available while the structure is used (hint: static or global!)
9047  * and will not be modified.
9048  *
9049  * @see EVAS_SMART_CLASS_INIT_NULL
9050  * @see EVAS_SMART_CLASS_INIT_VERSION
9051  * @see EVAS_SMART_CLASS_INIT_NAME_VERSION_PARENT
9052  * @see EVAS_SMART_CLASS_INIT_NAME_VERSION_PARENT_CALLBACKS
9053  * @ingroup Evas_Smart_Group
9054  */
9055 #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}
9056
9057 /**
9058  * @def EVAS_SMART_CLASS_INIT_NAME_VERSION_PARENT
9059  * Initializer to zero a whole Evas_Smart_Class structure and set name,
9060  * version and parent class.
9061  *
9062  * Similar to EVAS_SMART_CLASS_INIT_NULL, but will set version field to
9063  * latest EVAS_SMART_CLASS_VERSION, name to the specified value and
9064  * parent class.
9065  *
9066  * It will keep a reference to name field as a "const char *", that is,
9067  * name must be available while the structure is used (hint: static or global!)
9068  * and will not be modified. Similarly, parent reference will be kept.
9069  *
9070  * @see EVAS_SMART_CLASS_INIT_NULL
9071  * @see EVAS_SMART_CLASS_INIT_VERSION
9072  * @see EVAS_SMART_CLASS_INIT_NAME_VERSION
9073  * @see EVAS_SMART_CLASS_INIT_NAME_VERSION_PARENT_CALLBACKS
9074  * @ingroup Evas_Smart_Group
9075  */
9076 #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}
9077
9078 /**
9079  * @def EVAS_SMART_CLASS_INIT_NAME_VERSION_PARENT_CALLBACKS
9080  * Initializer to zero a whole Evas_Smart_Class structure and set name,
9081  * version, parent class and callbacks definition.
9082  *
9083  * Similar to EVAS_SMART_CLASS_INIT_NULL, but will set version field to
9084  * latest EVAS_SMART_CLASS_VERSION, name to the specified value, parent
9085  * class and callbacks at this level.
9086  *
9087  * It will keep a reference to name field as a "const char *", that is,
9088  * name must be available while the structure is used (hint: static or global!)
9089  * and will not be modified. Similarly, parent and callbacks reference
9090  * will be kept.
9091  *
9092  * @see EVAS_SMART_CLASS_INIT_NULL
9093  * @see EVAS_SMART_CLASS_INIT_VERSION
9094  * @see EVAS_SMART_CLASS_INIT_NAME_VERSION
9095  * @see EVAS_SMART_CLASS_INIT_NAME_VERSION_PARENT
9096  * @ingroup Evas_Smart_Group
9097  */
9098 #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}
9099
9100 /**
9101  * @def EVAS_SMART_SUBCLASS_NEW
9102  *
9103  * Convenience macro to subclass a given Evas smart class.
9104  *
9105  * @param smart_name The name used for the smart class. e.g:
9106  * @c "Evas_Object_Box".
9107  * @param prefix Prefix used for all variables and functions defined
9108  * and referenced by this macro.
9109  * @param api_type Type of the structure used as API for the smart
9110  * class. Either #Evas_Smart_Class or something derived from it.
9111  * @param parent_type Type of the parent class API.
9112  * @param parent_func Function that gets the parent class. e.g:
9113  * evas_object_box_smart_class_get().
9114  * @param cb_desc Array of callback descriptions for this smart class.
9115  *
9116  * This macro saves some typing when writing a smart class derived
9117  * from another one. In order to work, the user @b must provide some
9118  * functions adhering to the following guidelines:
9119  *  - @<prefix@>_smart_set_user(): the @b internal @c _smart_set
9120  *    function (defined by this macro) will call this one, provided by
9121  *    the user, after inheriting everything from the parent, which
9122  *    should <b>take care of setting the right member functions for
9123  *    the class</b>, both overrides and extensions, if any.
9124  *  - If this new class should be subclassable as well, a @b public @c
9125  *    _smart_set() function is desirable to fill in the class used as
9126  *    parent by the children. It's up to the user to provide this
9127  *    interface, which will most likely call @<prefix@>_smart_set() to
9128  *    get the job done.
9129  *
9130  * After the macro's usage, the following will be defined for use:
9131  *  - @<prefix@>_parent_sc: A pointer to the @b parent smart
9132  *    class. When calling parent functions from overloaded ones, use
9133  *    this global variable.
9134  *  - @<prefix@>_smart_class_new(): this function returns the
9135  *    #Evas_Smart needed to create smart objects with this class,
9136  *    which should be passed to evas_object_smart_add().
9137  *
9138  * @warning @p smart_name has to be a pointer to a globally available
9139  * string! The smart class created here will just have a pointer set
9140  * to that, and all object instances will depend on it for smart class
9141  * name lookup.
9142  *
9143  * @ingroup Evas_Smart_Group
9144  */
9145 #define EVAS_SMART_SUBCLASS_NEW(smart_name, prefix, api_type, parent_type, parent_func, cb_desc) \
9146   static const parent_type * prefix##_parent_sc = NULL;                 \
9147   static void prefix##_smart_set_user(api_type *api);                   \
9148   static void prefix##_smart_set(api_type *api)                         \
9149   {                                                                     \
9150      Evas_Smart_Class *sc;                                              \
9151      if (!(sc = (Evas_Smart_Class *)api))                               \
9152        return;                                                          \
9153      if (!prefix##_parent_sc)                                           \
9154        prefix##_parent_sc = parent_func();                              \
9155      evas_smart_class_inherit(sc, (const Evas_Smart_Class *)prefix##_parent_sc); \
9156      prefix##_smart_set_user(api);                                      \
9157   }                                                                     \
9158   static Evas_Smart * prefix##_smart_class_new(void)                    \
9159   {                                                                     \
9160      static Evas_Smart *smart = NULL;                                   \
9161      static api_type api;                                               \
9162      if (!smart)                                                        \
9163        {                                                                \
9164           Evas_Smart_Class *sc = (Evas_Smart_Class *)&api;              \
9165           memset(&api, 0, sizeof(api_type));                            \
9166           sc->version = EVAS_SMART_CLASS_VERSION;                       \
9167           sc->name = smart_name;                                        \
9168           sc->callbacks = cb_desc;                                      \
9169           prefix##_smart_set(&api);                                     \
9170           smart = evas_smart_class_new(sc);                             \
9171        }                                                                \
9172      return smart;                                                      \
9173   }
9174
9175 /**
9176  * @def EVAS_SMART_DATA_ALLOC
9177  *
9178  * Convenience macro to allocate smart data only if needed.
9179  *
9180  * When writing a subclassable smart object, the @c .add() function
9181  * will need to check if the smart private data was already allocated
9182  * by some child object or not. This macro makes it easier to do it.
9183  *
9184  * @note This is an idiom used when one calls the parent's @c. add()
9185  * after the specialized code. Naturally, the parent's base smart data
9186  * has to be contemplated as the specialized one's first member, for
9187  * things to work.
9188  *
9189  * @param o Evas object passed to the @c .add() function
9190  * @param priv_type The type of the data to allocate
9191  *
9192  * @ingroup Evas_Smart_Group
9193  */
9194 #define EVAS_SMART_DATA_ALLOC(o, priv_type) \
9195    priv_type *priv; \
9196    priv = evas_object_smart_data_get(o); \
9197    if (!priv) { \
9198       priv = (priv_type *)calloc(1, sizeof(priv_type)); \
9199       if (!priv) return; \
9200       evas_object_smart_data_set(o, priv); \
9201    }
9202
9203
9204 /**
9205  * Free an #Evas_Smart struct
9206  *
9207  * @param s the #Evas_Smart struct to free
9208  *
9209  * @warning If this smart handle was created using
9210  * evas_smart_class_new(), the associated #Evas_Smart_Class will not
9211  * be freed.
9212  *
9213  * @note If you're using the #EVAS_SMART_SUBCLASS_NEW schema to create your
9214  * smart object, note that an #Evas_Smart handle will be shared amongst all
9215  * instances of the given smart class, through a static variable.
9216  * Evas will internally count references on #Evas_Smart handles and free them
9217  * when they are not referenced anymore. Thus, this function is of no use
9218  * for Evas users, most probably.
9219  */
9220 EAPI void                             evas_smart_free                     (Evas_Smart *s) EINA_ARG_NONNULL(1);
9221
9222 /**
9223  * Creates a new #Evas_Smart from a given #Evas_Smart_Class struct
9224  *
9225  * @param sc the smart class definition
9226  * @return a new #Evas_Smart pointer
9227  *
9228  * #Evas_Smart handles are necessary to create new @b instances of
9229  * smart objects belonging to the class described by @p sc. That
9230  * handle will contain, besides the smart class interface definition,
9231  * all its smart callbacks infrastructure set, too.
9232  *
9233  * @note If you are willing to subclass a given smart class to
9234  * construct yours, consider using the #EVAS_SMART_SUBCLASS_NEW macro,
9235  * which will make use of this function automatically for you.
9236  */
9237 EAPI Evas_Smart                      *evas_smart_class_new                (const Evas_Smart_Class *sc) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
9238
9239 /**
9240  * Get the #Evas_Smart_Class handle of an #Evas_Smart struct
9241  *
9242  * @param s a valid #Evas_Smart pointer
9243  * @return the #Evas_Smart_Class in it
9244  */
9245 EAPI const Evas_Smart_Class          *evas_smart_class_get                (const Evas_Smart *s) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
9246
9247
9248 /**
9249  * @brief Get the data pointer set on an #Evas_Smart struct
9250  *
9251  * @param s a valid #Evas_Smart handle
9252  *
9253  * This data pointer is set as the data field in the #Evas_Smart_Class
9254  * passed in to evas_smart_class_new().
9255  */
9256 EAPI void                            *evas_smart_data_get                 (const Evas_Smart *s) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
9257
9258 /**
9259  * Get the smart callbacks known by this #Evas_Smart handle's smart
9260  * class hierarchy.
9261  *
9262  * @param s A valid #Evas_Smart handle.
9263  * @param[out] count Returns the number of elements in the returned
9264  * array.
9265  * @return The array with callback descriptions known by this smart
9266  *         class, with its size returned in @a count parameter. It
9267  *         should not be modified in any way. If no callbacks are
9268  *         known, @c NULL is returned. The array is sorted by event
9269  *         names and elements refer to the original values given to
9270  *         evas_smart_class_new()'s #Evas_Smart_Class::callbacks
9271  *         (pointer to them).
9272  *
9273  * This is likely different from
9274  * evas_object_smart_callbacks_descriptions_get() as it will contain
9275  * the callbacks of @b all this class hierarchy sorted, while the
9276  * direct smart class member refers only to that specific class and
9277  * should not include parent's.
9278  *
9279  * If no callbacks are known, this function returns @c NULL.
9280  *
9281  * The array elements and thus their contents will be @b references to
9282  * original values given to evas_smart_class_new() as
9283  * Evas_Smart_Class::callbacks.
9284  *
9285  * The array is sorted by Evas_Smart_Cb_Description::name. The last
9286  * array element is a @c NULL pointer and is not accounted for in @a
9287  * count. Loop iterations can check any of these size indicators.
9288  *
9289  * @note objects may provide per-instance callbacks, use
9290  *       evas_object_smart_callbacks_descriptions_get() to get those
9291  *       as well.
9292  * @see evas_object_smart_callbacks_descriptions_get()
9293  */
9294 EAPI const Evas_Smart_Cb_Description **evas_smart_callbacks_descriptions_get(const Evas_Smart *s, unsigned int *count) EINA_ARG_NONNULL(1, 1);
9295
9296
9297 /**
9298  * Find a callback description for the callback named @a name.
9299  *
9300  * @param s The #Evas_Smart where to search for class registered smart
9301  * event callbacks.
9302  * @param name Name of the desired callback, which must @b not be @c
9303  *        NULL. The search has a special case for @a name being the
9304  *        same pointer as registered with #Evas_Smart_Cb_Description.
9305  *        One can use it to avoid excessive use of strcmp().
9306  * @return A reference to the description if found, or @c NULL, otherwise
9307  *
9308  * @see evas_smart_callbacks_descriptions_get()
9309  */
9310 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;
9311
9312
9313 /**
9314  * Sets one class to inherit from the other.
9315  *
9316  * Copy all function pointers, set @c parent to @a parent_sc and copy
9317  * everything after sizeof(Evas_Smart_Class) present in @a parent_sc,
9318  * using @a parent_sc_size as reference.
9319  *
9320  * This is recommended instead of a single memcpy() since it will take
9321  * care to not modify @a sc name, version, callbacks and possible
9322  * other members.
9323  *
9324  * @param sc child class.
9325  * @param parent_sc parent class, will provide attributes.
9326  * @param parent_sc_size size of parent_sc structure, child should be at least
9327  *        this size. Everything after @c Evas_Smart_Class size is copied
9328  *        using regular memcpy().
9329  */
9330 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);
9331
9332 /**
9333  * Get the number of users of the smart instance
9334  *
9335  * @param s The Evas_Smart to get the usage count of
9336  * @return The number of uses of the smart instance
9337  *
9338  * This function tells you how many more uses of the smart instance are in
9339  * existence. This should be used before freeing/clearing any of the
9340  * Evas_Smart_Class that was used to create the smart instance. The smart
9341  * instance will refer to data in the Evas_Smart_Class used to create it and
9342  * thus you cannot remove the original data until all users of it are gone.
9343  * When the usage count goes to 0, you can evas_smart_free() the smart
9344  * instance @p s and remove from memory any of the Evas_Smart_Class that
9345  * was used to create the smart instance, if you desire. Removing it from
9346  * memory without doing this will cause problems (crashes, undefined
9347  * behavior etc. etc.), so either never remove the original
9348  * Evas_Smart_Class data from memory (have it be a constant structure and
9349  * data), or use this API call and be very careful.
9350  */
9351 EAPI int                              evas_smart_usage_get(const Evas_Smart *s);
9352
9353   /**
9354    * @def evas_smart_class_inherit
9355    * Easy to use version of evas_smart_class_inherit_full().
9356    *
9357    * This version will use sizeof(parent_sc), copying everything.
9358    *
9359    * @param sc child class, will have methods copied from @a parent_sc
9360    * @param parent_sc parent class, will provide contents to be copied.
9361    * @return 1 on success, 0 on failure.
9362    * @ingroup Evas_Smart_Group
9363    */
9364 #define evas_smart_class_inherit(sc, parent_sc) evas_smart_class_inherit_full(sc, parent_sc, sizeof(*parent_sc))
9365
9366 /**
9367  * @}
9368  */
9369
9370 /**
9371  * @defgroup Evas_Smart_Object_Group Smart Object Functions
9372  *
9373  * Functions dealing with Evas smart objects (instances).
9374  *
9375  * Smart objects are groupings of primitive Evas objects that behave
9376  * as a cohesive group. For instance, a file manager icon may be a
9377  * smart object composed of an image object, a text label and two
9378  * rectangles that appear behind the image and text when the icon is
9379  * selected. As a smart object, the normal Evas object API could be
9380  * used on the icon object.
9381  *
9382  * Besides that, generally smart objects implement a <b>specific
9383  * API</b>, so that users interect with its own custom features. The
9384  * API takes form of explicit exported functions one may call and
9385  * <b>smart callbacks</b>.
9386  *
9387  * @section Evas_Smart_Object_Group_Callbacks Smart events and callbacks
9388  *
9389  * Smart objects can elect events (smart events, from now on) ocurring
9390  * inside of them to be reported back to their users via callback
9391  * functions (smart callbacks). This way, you can extend Evas' own
9392  * object events. They are defined by an <b>event string</b>, which
9393  * identifies them uniquely. There's also a function prototype
9394  * definition for the callback functions: #Evas_Smart_Cb.
9395  *
9396  * When defining an #Evas_Smart_Class, smart object implementors are
9397  * strongly encorauged to properly set the Evas_Smart_Class::callbacks
9398  * callbacks description array, so that the users of the smart object
9399  * can have introspection on its events API <b>at run time</b>.
9400  *
9401  * See some @ref Example_Evas_Smart_Objects "examples" of this group
9402  * of functions.
9403  *
9404  * @see @ref Evas_Smart_Group for class definitions.
9405  */
9406
9407 /**
9408  * @addtogroup Evas_Smart_Object_Group
9409  * @{
9410  */
9411
9412 /**
9413  * Instantiates a new smart object described by @p s.
9414  *
9415  * @param e the canvas on which to add the object
9416  * @param s the #Evas_Smart describing the smart object
9417  * @return a new #Evas_Object handle
9418  *
9419  * This is the function one should use when defining the public
9420  * function @b adding an instance of the new smart object to a given
9421  * canvas. It will take care of setting all of its internals to work
9422  * as they should, if the user set things properly, as seem on the
9423  * #EVAS_SMART_SUBCLASS_NEW, for example.
9424  *
9425  * @ingroup Evas_Smart_Object_Group
9426  */
9427 EAPI Evas_Object      *evas_object_smart_add             (Evas *e, Evas_Smart *s) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2) EINA_MALLOC;
9428
9429 /**
9430  * Set an Evas object as a member of a given smart object.
9431  *
9432  * @param obj The member object
9433  * @param smart_obj The smart object
9434  *
9435  * Members will automatically be stacked and layered together with the
9436  * smart object. The various stacking functions will operate on
9437  * members relative to the other members instead of the entire canvas,
9438  * since they now live on an exclusive layer (see
9439  * evas_object_stack_above(), for more details).
9440  *
9441  * Any @p smart_obj object's specific implementation of the @c
9442  * member_add() smart function will take place too, naturally.
9443  *
9444  * @see evas_object_smart_member_del()
9445  * @see evas_object_smart_members_get()
9446  *
9447  * @ingroup Evas_Smart_Object_Group
9448  */
9449 EAPI void              evas_object_smart_member_add      (Evas_Object *obj, Evas_Object *smart_obj) EINA_ARG_NONNULL(1, 2);
9450
9451 /**
9452  * Removes a member object from a given smart object.
9453  *
9454  * @param obj the member object
9455  * @ingroup Evas_Smart_Object_Group
9456  *
9457  * This removes a member object from a smart object, if it was added
9458  * to any. The object will still be on the canvas, but no longer
9459  * associated with whichever smart object it was associated with.
9460  *
9461  * @see evas_object_smart_member_add() for more details
9462  * @see evas_object_smart_members_get()
9463  */
9464 EAPI void              evas_object_smart_member_del      (Evas_Object *obj) EINA_ARG_NONNULL(1);
9465
9466 /**
9467  * Retrieves the list of the member objects of a given Evas smart
9468  * object
9469  *
9470  * @param obj the smart object to get members from
9471  * @return Returns the list of the member objects of @p obj.
9472  *
9473  * The returned list should be freed with @c eina_list_free() when you
9474  * no longer need it.
9475  *
9476  * @see evas_object_smart_member_add()
9477  * @see evas_object_smart_member_del()
9478 */
9479 EAPI Eina_List        *evas_object_smart_members_get     (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
9480
9481 /**
9482  * Gets the parent smart object of a given Evas object, if it has one.
9483  *
9484  * @param obj the Evas object you want to get the parent smart object
9485  * from
9486  * @return Returns the parent smart object of @a obj or @c NULL, if @a
9487  * obj is not a smart member of any
9488  *
9489  * @ingroup Evas_Smart_Object_Group
9490  */
9491 EAPI Evas_Object      *evas_object_smart_parent_get      (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
9492
9493 /**
9494  * Checks whether a given smart object or any of its smart object
9495  * parents is of a given smart class.
9496  *
9497  * @param obj An Evas smart object to check the type of
9498  * @param type The @b name (type) of the smart class to check for
9499  * @return @c EINA_TRUE, if @a obj or any of its parents is of type @a
9500  * type, @c EINA_FALSE otherwise
9501  *
9502  * If @p obj is not a smart object, this call will fail
9503  * immediately. Otherwise, make sure evas_smart_class_inherit() or its
9504  * sibling functions were used correctly when creating the smart
9505  * object's class, so it has a valid @b parent smart class pointer
9506  * set.
9507  *
9508  * The checks use smart classes names and <b>string
9509  * comparison</b>. There is a version of this same check using
9510  * <b>pointer comparison</b>, since a smart class' name is a single
9511  * string in Evas.
9512  *
9513  * @see evas_object_smart_type_check_ptr()
9514  * @see #EVAS_SMART_SUBCLASS_NEW
9515  *
9516  * @ingroup Evas_Smart_Object_Group
9517  */
9518 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;
9519
9520 /**
9521  * Checks whether a given smart object or any of its smart object
9522  * parents is of a given smart class, <b>using pointer comparison</b>.
9523  *
9524  * @param obj An Evas smart object to check the type of
9525  * @param type The type (name string) to check for. Must be the name
9526  * @return @c EINA_TRUE, if @a obj or any of its parents is of type @a
9527  * type, @c EINA_FALSE otherwise
9528  *
9529  * @see evas_object_smart_type_check() for more details
9530  *
9531  * @ingroup Evas_Smart_Object_Group
9532  */
9533 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;
9534
9535 /**
9536  * Get the #Evas_Smart from which @p obj smart object was created.
9537  *
9538  * @param obj a smart object
9539  * @return the #Evas_Smart handle or @c NULL, on errors
9540  *
9541  * @ingroup Evas_Smart_Object_Group
9542  */
9543 EAPI Evas_Smart       *evas_object_smart_smart_get       (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
9544
9545 /**
9546  * Retrieve user data stored on a given smart object.
9547  *
9548  * @param obj The smart object's handle
9549  * @return A pointer to data stored using
9550  *         evas_object_smart_data_set(), or @c NULL, if none has been
9551  *         set.
9552  *
9553  * @see evas_object_smart_data_set()
9554  *
9555  * @ingroup Evas_Smart_Object_Group
9556  */
9557 EAPI void             *evas_object_smart_data_get        (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
9558
9559 /**
9560  * Store a pointer to user data for a given smart object.
9561  *
9562  * @param obj The smart object's handle
9563  * @param data A pointer to user data
9564  *
9565  * This data is stored @b independently of the one set by
9566  * evas_object_data_set(), naturally.
9567  *
9568  * @see evas_object_smart_data_get()
9569  *
9570  * @ingroup Evas_Smart_Object_Group
9571  */
9572 EAPI void              evas_object_smart_data_set        (Evas_Object *obj, void *data) EINA_ARG_NONNULL(1);
9573
9574 /**
9575  * Add (register) a callback function to the smart event specified by
9576  * @p event on the smart object @p obj.
9577  *
9578  * @param obj a smart object
9579  * @param event the event's name string
9580  * @param func the callback function
9581  * @param data user data to be passed to the callback function
9582  *
9583  * Smart callbacks look very similar to Evas callbacks, but are
9584  * implemented as smart object's custom ones.
9585  *
9586  * This function adds a function callback to an smart object when the
9587  * event named @p event occurs in it. The function is @p func.
9588  *
9589  * In the event of a memory allocation error during addition of the
9590  * callback to the object, evas_alloc_error() should be used to
9591  * determine the nature of the error, if any, and the program should
9592  * sensibly try and recover.
9593  *
9594  * A smart callback function must have the ::Evas_Smart_Cb prototype
9595  * definition. The first parameter (@p data) in this definition will
9596  * have the same value passed to evas_object_smart_callback_add() as
9597  * the @p data parameter, at runtime. The second parameter @p obj is a
9598  * handle to the object on which the event occurred. The third
9599  * parameter, @p event_info, is a pointer to data which is totally
9600  * dependent on the smart object's implementation and semantic for the
9601  * given event.
9602  *
9603  * There is an infrastructure for introspection on smart objects'
9604  * events (see evas_smart_callbacks_descriptions_get()), but no
9605  * internal smart objects on Evas implement them yet.
9606  *
9607  * @see @ref Evas_Smart_Object_Group_Callbacks for more details.
9608  *
9609  * @see evas_object_smart_callback_del()
9610  * @ingroup Evas_Smart_Object_Group
9611  */
9612 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);
9613
9614 /**
9615  * Add (register) a callback function to the smart event specified by
9616  * @p event on the smart object @p obj. Except for the priority field,
9617  * it's exactly the same as @ref evas_object_smart_callback_add
9618  *
9619  * @param obj a smart object
9620  * @param event the event's name string
9621  * @param priority The priority of the callback, lower values called first.
9622  * @param func the callback function
9623  * @param data user data to be passed to the callback function
9624  *
9625  * @see evas_object_smart_callback_add
9626  * @since 1.1.0
9627  * @ingroup Evas_Smart_Object_Group
9628  */
9629 EAPI void              evas_object_smart_callback_priority_add(Evas_Object *obj, const char *event, Evas_Callback_Priority priority, Evas_Smart_Cb func, const void *data);
9630
9631 /**
9632  * Delete (unregister) a callback function from the smart event
9633  * specified by @p event on the smart object @p obj.
9634  *
9635  * @param obj a smart object
9636  * @param event the event's name string
9637  * @param func the callback function
9638  * @return the data pointer
9639  *
9640  * This function removes <b>the first</b> added smart callback on the
9641  * object @p obj matching the event name @p event and the registered
9642  * function pointer @p func. If the removal is successful it will also
9643  * return the data pointer that was passed to
9644  * evas_object_smart_callback_add() (that will be the same as the
9645  * parameter) when the callback(s) was(were) added to the canvas. If
9646  * not successful @c NULL will be returned.
9647  *
9648  * @see evas_object_smart_callback_add() for more details.
9649  *
9650  * @ingroup Evas_Smart_Object_Group
9651  */
9652 EAPI void             *evas_object_smart_callback_del    (Evas_Object *obj, const char *event, Evas_Smart_Cb func) EINA_ARG_NONNULL(1, 2, 3);
9653
9654 /**
9655  * Call a given smart callback on the smart object @p obj.
9656  *
9657  * @param obj the smart object
9658  * @param event the event's name string
9659  * @param event_info pointer to an event specific struct or information to
9660  * pass to the callback functions registered on this smart event
9661  *
9662  * This should be called @b internally, from the smart object's own
9663  * code, when some specific event has occurred and the implementor
9664  * wants is to pertain to the object's events API (see @ref
9665  * Evas_Smart_Object_Group_Callbacks). The documentation for the smart
9666  * object should include a list of possible events and what type of @p
9667  * event_info to expect for each of them. Also, when defining an
9668  * #Evas_Smart_Class, smart object implementors are strongly
9669  * encorauged to properly set the Evas_Smart_Class::callbacks
9670  * callbacks description array, so that the users of the smart object
9671  * can have introspection on its events API <b>at run time</b>.
9672  *
9673  * @ingroup Evas_Smart_Object_Group
9674  */
9675 EAPI void              evas_object_smart_callback_call   (Evas_Object *obj, const char *event, void *event_info) EINA_ARG_NONNULL(1, 2);
9676
9677
9678 /**
9679  * Set an smart object @b instance's smart callbacks descriptions.
9680  *
9681  * @param obj A smart object
9682  * @param descriptions @c NULL terminated array with
9683  * #Evas_Smart_Cb_Description descriptions. Array elements won't be
9684  * modified at run time, but references to them and their contents
9685  * will be made, so this array should be kept alive during the whole
9686  * object's lifetime.
9687  * @return @c EINA_TRUE on success, @c EINA_FALSE on failure.
9688  *
9689  * These descriptions are hints to be used by introspection and are
9690  * not enforced in any way.
9691  *
9692  * It will not be checked if instance callbacks descriptions have the
9693  * same name as respective possibly registered in the smart object
9694  * @b class. Both are kept in different arrays and users of
9695  * evas_object_smart_callbacks_descriptions_get() should handle this
9696  * case as they wish.
9697  *
9698  * @note Becase @p descriptions must be @c NULL terminated, and
9699  *        because a @c NULL name makes little sense, too,
9700  *        Evas_Smart_Cb_Description::name must @b not be @c NULL.
9701  *
9702  * @note While instance callbacks descriptions are possible, they are
9703  *       @b not recommended. Use @b class callbacks descriptions
9704  *       instead as they make you smart object user's life simpler and
9705  *       will use less memory, as descriptions and arrays will be
9706  *       shared among all instances.
9707  *
9708  * @ingroup Evas_Smart_Object_Group
9709  */
9710 EAPI Eina_Bool         evas_object_smart_callbacks_descriptions_set(Evas_Object *obj, const Evas_Smart_Cb_Description *descriptions) EINA_ARG_NONNULL(1);
9711
9712 /**
9713  * Retrieve an smart object's know smart callback descriptions (both
9714  * instance and class ones).
9715  *
9716  * @param obj The smart object to get callback descriptions from.
9717  * @param class_descriptions Where to store class callbacks
9718  *        descriptions array, if any is known. If no descriptions are
9719  *        known, @c NULL is returned
9720  * @param class_count Returns how many class callbacks descriptions
9721  *        are known.
9722  * @param instance_descriptions Where to store instance callbacks
9723  *        descriptions array, if any is known. If no descriptions are
9724  *        known, @c NULL is returned.
9725  * @param instance_count Returns how many instance callbacks
9726  *        descriptions are known.
9727  *
9728  * This call searchs for registered callback descriptions for both
9729  * instance and class of the given smart object. These arrays will be
9730  * sorted by Evas_Smart_Cb_Description::name and also @c NULL
9731  * terminated, so both @a class_count and @a instance_count can be
9732  * ignored, if the caller wishes so. The terminator @c NULL is not
9733  * counted in these values.
9734  *
9735  * @note If just class descriptions are of interest, try
9736  *       evas_smart_callbacks_descriptions_get() instead.
9737  *
9738  * @note Use @c NULL pointers on the descriptions/counters you're not
9739  * interested in: they'll be ignored by the function.
9740  *
9741  * @see evas_smart_callbacks_descriptions_get()
9742  *
9743  * @ingroup Evas_Smart_Object_Group
9744  */
9745 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);
9746
9747 /**
9748  * Find callback description for callback called @a name.
9749  *
9750  * @param obj the smart object.
9751  * @param name name of desired callback, must @b not be @c NULL.  The
9752  *        search have a special case for @a name being the same
9753  *        pointer as registered with Evas_Smart_Cb_Description, one
9754  *        can use it to avoid excessive use of strcmp().
9755  * @param class_description pointer to return class description or @c
9756  *        NULL if not found. If parameter is @c NULL, no search will
9757  *        be done on class descriptions.
9758  * @param instance_description pointer to return instance description
9759  *        or @c NULL if not found. If parameter is @c NULL, no search
9760  *        will be done on instance descriptions.
9761  * @return reference to description if found, @c NULL if not found.
9762  */
9763 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);
9764
9765
9766 /**
9767  * Mark smart object as changed, dirty.
9768  *
9769  * @param obj The given Evas smart object
9770  *
9771  * This will flag the given object as needing recalculation,
9772  * forcefully. As an effect, on the next rendering cycle it's @b
9773  * calculate() (see #Evas_Smart_Class) smart function will be called.
9774  *
9775  * @see evas_object_smart_need_recalculate_set().
9776  * @see evas_object_smart_calculate().
9777  *
9778  * @ingroup Evas_Smart_Object_Group
9779  */
9780 EAPI void              evas_object_smart_changed         (Evas_Object *obj) EINA_ARG_NONNULL(1);
9781
9782 /**
9783  * Set or unset the flag signalling that a given smart object needs to
9784  * get recalculated.
9785  *
9786  * @param obj the smart object
9787  * @param value whether one wants to set (@c EINA_TRUE) or to unset
9788  * (@c EINA_FALSE) the flag.
9789  *
9790  * If this flag is set, then the @c calculate() smart function of @p
9791  * obj will be called, if one is provided, during rendering phase of
9792  * Evas (see evas_render()), after which this flag will be
9793  * automatically unset.
9794  *
9795  * If that smart function is not provided for the given object, this
9796  * flag will be left unchanged.
9797  *
9798  * @note just setting this flag will not make the canvas' whole scene
9799  *       dirty, by itself, and evas_render() will have no effect. To
9800  *       force that, use evas_object_smart_changed(), that will also
9801  *       automatically call this function automatically, with @c
9802  *       EINA_TRUE as parameter.
9803  *
9804  * @see evas_object_smart_need_recalculate_get()
9805  * @see evas_object_smart_calculate()
9806  * @see evas_smart_objects_calculate()
9807  *
9808  * @ingroup Evas_Smart_Object_Group
9809  */
9810 EAPI void              evas_object_smart_need_recalculate_set(Evas_Object *obj, Eina_Bool value) EINA_ARG_NONNULL(1);
9811
9812 /**
9813  * Get the value of the flag signalling that a given smart object needs to
9814  * get recalculated.
9815  *
9816  * @param obj the smart object
9817  * @return if flag is set or not.
9818  *
9819  * @note this flag will be unset during the rendering phase, when the
9820  *       @c calculate() smart function is called, if one is provided.
9821  *       If it's not provided, then the flag will be left unchanged
9822  *       after the rendering phase.
9823  *
9824  * @see evas_object_smart_need_recalculate_set(), for more details
9825  *
9826  * @ingroup Evas_Smart_Object_Group
9827  */
9828 EAPI Eina_Bool         evas_object_smart_need_recalculate_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
9829
9830 /**
9831  * Call the @b calculate() smart function immediataly on a given smart
9832  * object.
9833  *
9834  * @param obj the smart object's handle
9835  *
9836  * This will force immediate calculations (see #Evas_Smart_Class)
9837  * needed for renderization of this object and, besides, unset the
9838  * flag on it telling it needs recalculation for the next rendering
9839  * phase.
9840  *
9841  * @see evas_object_smart_need_recalculate_set()
9842  *
9843  * @ingroup Evas_Smart_Object_Group
9844  */
9845 EAPI void              evas_object_smart_calculate       (Evas_Object *obj) EINA_ARG_NONNULL(1);
9846
9847 /**
9848  * Call user-provided @c calculate() smart functions and unset the
9849  * flag signalling that the object needs to get recalculated to @b all
9850  * smart objects in the canvas.
9851  *
9852  * @param e The canvas to calculate all smart objects in
9853  *
9854  * @see evas_object_smart_need_recalculate_set()
9855  *
9856  * @ingroup Evas_Smart_Object_Group
9857  */
9858 EAPI void              evas_smart_objects_calculate      (Evas *e);
9859
9860 /**
9861  * This gets the internal counter that counts the number of smart calculations
9862  * 
9863  * @param e The canvas to get the calculate counter from
9864  * 
9865  * Whenever evas performs smart object calculations on the whole canvas
9866  * it increments a counter by 1. This is the smart object calculate counter
9867  * that this function returns the value of. It starts at the value of 0 and
9868  * will increase (and eventually wrap around to negative values and so on) by
9869  * 1 every time objects are calculated. You can use this counter to ensure
9870  * you dont re-do calculations withint the same calculation generation/run
9871  * if the calculations maybe cause self-feeding effects.
9872  * 
9873  * @ingroup Evas_Smart_Object_Group
9874  * @since 1.1
9875  */
9876 EAPI int               evas_smart_objects_calculate_count_get (const Evas *e);
9877    
9878 /**
9879  * Moves all children objects of a given smart object relative to a
9880  * given offset.
9881  *
9882  * @param obj the smart object.
9883  * @param dx horizontal offset (delta).
9884  * @param dy vertical offset (delta).
9885  *
9886  * This will make each of @p obj object's children to move, from where
9887  * they before, with those delta values (offsets) on both directions.
9888  *
9889  * @note This is most useful on custom smart @c move() functions.
9890  *
9891  * @note Clipped smart objects already make use of this function on
9892  * their @c move() smart function definition.
9893  */
9894 EAPI void                    evas_object_smart_move_children_relative(Evas_Object *obj, Evas_Coord dx, Evas_Coord dy) EINA_ARG_NONNULL(1);
9895
9896 /**
9897  * @}
9898  */
9899
9900 /**
9901  * @defgroup Evas_Smart_Object_Clipped Clipped Smart Object
9902  *
9903  * Clipped smart object is a base to construct other smart objects
9904  * based on the concept of having an internal clipper that is applied
9905  * to all children objects. This clipper will control the visibility,
9906  * clipping and color of sibling objects (remember that the clipping
9907  * is recursive, and clipper color modulates the color of its
9908  * clippees). By default, this base will also move children relatively
9909  * to the parent, and delete them when parent is deleted. In other
9910  * words, it is the base for simple object grouping.
9911  *
9912  * See some @ref Example_Evas_Smart_Objects "examples" of this group
9913  * of functions.
9914  *
9915  * @see evas_object_smart_clipped_smart_set()
9916  *
9917  * @ingroup Evas_Smart_Object_Group
9918  */
9919
9920 /**
9921  * @addtogroup Evas_Smart_Object_Clipped
9922  * @{
9923  */
9924
9925 /**
9926  * Every subclass should provide this at the beginning of their own
9927  * data set with evas_object_smart_data_set().
9928  */
9929   typedef struct _Evas_Object_Smart_Clipped_Data Evas_Object_Smart_Clipped_Data;
9930   struct _Evas_Object_Smart_Clipped_Data
9931   {
9932      Evas_Object *clipper;
9933      Evas        *evas;
9934   };
9935
9936
9937 /**
9938  * Get the clipper object for the given clipped smart object.
9939  *
9940  * @param obj the clipped smart object to retrieve associated clipper
9941  * from.
9942  * @return the clipper object.
9943  *
9944  * Use this function if you want to change any of this clipper's
9945  * properties, like colors.
9946  *
9947  * @see evas_object_smart_clipped_smart_add()
9948  */
9949 EAPI Evas_Object            *evas_object_smart_clipped_clipper_get   (Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
9950
9951 /**
9952  * Set a given smart class' callbacks so it implements the <b>clipped smart
9953  * object"</b>'s interface.
9954  *
9955  * @param sc The smart class handle to operate on
9956  *
9957  * This call will assign all the required methods of the @p sc
9958  * #Evas_Smart_Class instance to the implementations set for clipped
9959  * smart objects. If one wants to "subclass" it, call this function
9960  * and then override desired values. If one wants to call any original
9961  * method, save it somewhere. Example:
9962  *
9963  * @code
9964  * static Evas_Smart_Class parent_sc = EVAS_SMART_CLASS_INIT_NULL;
9965  *
9966  * static void my_class_smart_add(Evas_Object *o)
9967  * {
9968  *    parent_sc.add(o);
9969  *    evas_object_color_set(evas_object_smart_clipped_clipper_get(o),
9970  *                          255, 0, 0, 255);
9971  * }
9972  *
9973  * Evas_Smart_Class *my_class_new(void)
9974  * {
9975  *    static Evas_Smart_Class sc = EVAS_SMART_CLASS_INIT_NAME_VERSION("MyClass");
9976  *    if (!parent_sc.name)
9977  *      {
9978  *         evas_object_smart_clipped_smart_set(&sc);
9979  *         parent_sc = sc;
9980  *         sc.add = my_class_smart_add;
9981  *      }
9982  *    return &sc;
9983  * }
9984  * @endcode
9985  *
9986  * Default behavior for each of #Evas_Smart_Class functions on a
9987  * clipped smart object are:
9988  * - @c add: creates a hidden clipper with "infinite" size, to clip
9989  *    any incoming members;
9990  *  - @c del: delete all children objects;
9991  *  - @c move: move all objects relative relatively;
9992  *  - @c resize: <b>not defined</b>;
9993  *  - @c show: if there are children objects, show clipper;
9994  *  - @c hide: hides clipper;
9995  *  - @c color_set: set the color of clipper;
9996  *  - @c clip_set: set clipper of clipper;
9997  *  - @c clip_unset: unset the clipper of clipper;
9998  *
9999  * @note There are other means of assigning parent smart classes to
10000  * child ones, like the #EVAS_SMART_SUBCLASS_NEW macro or the
10001  * evas_smart_class_inherit_full() function.
10002  */
10003 EAPI void                    evas_object_smart_clipped_smart_set     (Evas_Smart_Class *sc) EINA_ARG_NONNULL(1);
10004
10005 /**
10006  * Get a pointer to the <b>clipped smart object's</b> class, to use
10007  * for proper inheritance
10008  *
10009  * @see #Evas_Smart_Object_Clipped for more information on this smart
10010  * class
10011  */
10012 EAPI const Evas_Smart_Class *evas_object_smart_clipped_class_get     (void) EINA_CONST;
10013
10014 /**
10015  * @}
10016  */
10017
10018 /**
10019  * @defgroup Evas_Object_Box Box Smart Object
10020  *
10021  * A box is a convenience smart object that packs children inside it
10022  * in @b sequence, using a layouting function specified by the
10023  * user. There are a couple of pre-made layouting functions <b>built-in
10024  * in Evas</b>, all of them using children size hints to define their
10025  * size and alignment inside their cell space.
10026  *
10027  * Examples on this smart object's usage:
10028  * - @ref Example_Evas_Box
10029  * - @ref Example_Evas_Size_Hints
10030  *
10031  * @see @ref Evas_Object_Group_Size_Hints
10032  *
10033  * @ingroup Evas_Smart_Object_Group
10034  */
10035
10036 /**
10037  * @addtogroup Evas_Object_Box
10038  * @{
10039  */
10040
10041 /**
10042  * @typedef Evas_Object_Box_Api
10043  *
10044  * Smart class extension, providing extra box object requirements.
10045  *
10046  * @ingroup Evas_Object_Box
10047  */
10048    typedef struct _Evas_Object_Box_Api        Evas_Object_Box_Api;
10049
10050 /**
10051  * @typedef Evas_Object_Box_Data
10052  *
10053  * Smart object instance data, providing box object requirements.
10054  *
10055  * @ingroup Evas_Object_Box
10056  */
10057    typedef struct _Evas_Object_Box_Data       Evas_Object_Box_Data;
10058
10059 /**
10060  * @typedef Evas_Object_Box_Option
10061  *
10062  * The base structure for a box option. Box options are a way of
10063  * extending box items properties, which will be taken into account
10064  * for layouting decisions. The box layouting functions provided by
10065  * Evas will only rely on objects' canonical size hints to layout
10066  * them, so the basic box option has @b no (custom) property set.
10067  *
10068  * Users creating their own layouts, but not depending on extra child
10069  * items' properties, would be fine just using
10070  * evas_object_box_layout_set(). But if one desires a layout depending
10071  * on extra child properties, he/she has to @b subclass the box smart
10072  * object. Thus, by using evas_object_box_smart_class_get() and
10073  * evas_object_box_smart_set(), the @c option_new() and @c
10074  * option_free() smart class functions should be properly
10075  * redefined/extended.
10076  *
10077  * Object properties are bound to an integer identifier and must have
10078  * a name string. Their values are open to any data. See the API on
10079  * option properties for more details.
10080  *
10081  * @ingroup Evas_Object_Box
10082  */
10083    typedef struct _Evas_Object_Box_Option     Evas_Object_Box_Option;
10084
10085 /**
10086  * @typedef Evas_Object_Box_Layout
10087  *
10088  * Function signature for an Evas box object layouting routine. By
10089  * @a o it will be passed the box object in question, by @a priv it will
10090  * be passed the box's internal data and, by @a user_data, it will be
10091  * passed any custom data one could have set to a given box layouting
10092  * function, with evas_object_box_layout_set().
10093  *
10094  * @ingroup Evas_Object_Box
10095  */
10096    typedef void (*Evas_Object_Box_Layout) (Evas_Object *o, Evas_Object_Box_Data *priv, void *user_data);
10097
10098 /**
10099  * @def EVAS_OBJECT_BOX_API_VERSION
10100  *
10101  * Current version for Evas box object smart class, a value which goes
10102  * to _Evas_Object_Box_Api::version.
10103  *
10104  * @ingroup Evas_Object_Box
10105  */
10106 #define EVAS_OBJECT_BOX_API_VERSION 1
10107
10108 /**
10109  * @struct _Evas_Object_Box_Api
10110  *
10111  * This structure should be used by any smart class inheriting from
10112  * the box's one, to provide custom box behavior which could not be
10113  * achieved only by providing a layout function, with
10114  * evas_object_box_layout_set().
10115  *
10116  * @extends Evas_Smart_Class
10117  * @ingroup Evas_Object_Box
10118  */
10119    struct _Evas_Object_Box_Api
10120    {
10121       Evas_Smart_Class          base; /**< Base smart class struct, need for all smart objects */
10122       int                       version; /**< Version of this smart class definition */
10123       Evas_Object_Box_Option *(*append)           (Evas_Object *o, Evas_Object_Box_Data *priv, Evas_Object *child); /**< Smart function to append child elements in boxes */
10124       Evas_Object_Box_Option *(*prepend)          (Evas_Object *o, Evas_Object_Box_Data *priv, Evas_Object *child); /**< Smart function to prepend child elements in boxes */
10125       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 */
10126       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 */
10127       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 */
10128       Evas_Object            *(*remove)           (Evas_Object *o, Evas_Object_Box_Data *priv, Evas_Object *child); /**< Smart function to remove a child element from boxes */
10129       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 */
10130       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 */
10131       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 */
10132       const char             *(*property_name_get)(Evas_Object *o, int property); /**< Smart function to get the name of a custom property of box children */
10133       int                     (*property_id_get)  (Evas_Object *o, const char *name); /**< Smart function to get the numerical ID of a custom property of box children */
10134       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 */
10135       void                    (*option_free)      (Evas_Object *o, Evas_Object_Box_Data *priv, Evas_Object_Box_Option *opt); /**< Smart function to delete a box option struct */
10136    };
10137
10138 /**
10139  * @def EVAS_OBJECT_BOX_API_INIT
10140  *
10141  * Initializer for a whole #Evas_Object_Box_Api structure, with
10142  * @c NULL values on its specific fields.
10143  *
10144  * @param smart_class_init initializer to use for the "base" field
10145  * (#Evas_Smart_Class).
10146  *
10147  * @see EVAS_SMART_CLASS_INIT_NULL
10148  * @see EVAS_SMART_CLASS_INIT_VERSION
10149  * @see EVAS_SMART_CLASS_INIT_NAME_VERSION
10150  * @see EVAS_OBJECT_BOX_API_INIT_NULL
10151  * @see EVAS_OBJECT_BOX_API_INIT_VERSION
10152  * @see EVAS_OBJECT_BOX_API_INIT_NAME_VERSION
10153  * @ingroup Evas_Object_Box
10154  */
10155 #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}
10156
10157 /**
10158  * @def EVAS_OBJECT_BOX_API_INIT_NULL
10159  *
10160  * Initializer to zero out a whole #Evas_Object_Box_Api structure.
10161  *
10162  * @see EVAS_OBJECT_BOX_API_INIT_VERSION
10163  * @see EVAS_OBJECT_BOX_API_INIT_NAME_VERSION
10164  * @see EVAS_OBJECT_BOX_API_INIT
10165  * @ingroup Evas_Object_Box
10166  */
10167 #define EVAS_OBJECT_BOX_API_INIT_NULL EVAS_OBJECT_BOX_API_INIT(EVAS_SMART_CLASS_INIT_NULL)
10168
10169 /**
10170  * @def EVAS_OBJECT_BOX_API_INIT_VERSION
10171  *
10172  * Initializer to zero out a whole #Evas_Object_Box_Api structure and
10173  * set a specific version on it.
10174  *
10175  * This is similar to #EVAS_OBJECT_BOX_API_INIT_NULL, but it will set
10176  * the version field of #Evas_Smart_Class (base field) to the latest
10177  * #EVAS_SMART_CLASS_VERSION.
10178  *
10179  * @see EVAS_OBJECT_BOX_API_INIT_NULL
10180  * @see EVAS_OBJECT_BOX_API_INIT_NAME_VERSION
10181  * @see EVAS_OBJECT_BOX_API_INIT
10182  * @ingroup Evas_Object_Box
10183  */
10184 #define EVAS_OBJECT_BOX_API_INIT_VERSION EVAS_OBJECT_BOX_API_INIT(EVAS_SMART_CLASS_INIT_VERSION)
10185
10186 /**
10187  * @def EVAS_OBJECT_BOX_API_INIT_NAME_VERSION
10188  *
10189  * Initializer to zero out a whole #Evas_Object_Box_Api structure and
10190  * set its name and version.
10191  *
10192  * This is similar to #EVAS_OBJECT_BOX_API_INIT_NULL, but it will also
10193  * set the version field of #Evas_Smart_Class (base field) to the
10194  * latest #EVAS_SMART_CLASS_VERSION and name it to the specific value.
10195  *
10196  * It will keep a reference to the name field as a <c>"const char *"</c>,
10197  * i.e., the name must be available while the structure is
10198  * used (hint: static or global variable!) and must not be modified.
10199  *
10200  * @see EVAS_OBJECT_BOX_API_INIT_NULL
10201  * @see EVAS_OBJECT_BOX_API_INIT_VERSION
10202  * @see EVAS_OBJECT_BOX_API_INIT
10203  * @ingroup Evas_Object_Box
10204  */
10205 #define EVAS_OBJECT_BOX_API_INIT_NAME_VERSION(name) EVAS_OBJECT_BOX_API_INIT(EVAS_SMART_CLASS_INIT_NAME_VERSION(name))
10206
10207 /**
10208  * @struct _Evas_Object_Box_Data
10209  *
10210  * This structure augments clipped smart object's instance data,
10211  * providing extra members required by generic box implementation. If
10212  * a subclass inherits from #Evas_Object_Box_Api, then it may augment
10213  * #Evas_Object_Box_Data to fit its own needs.
10214  *
10215  * @extends Evas_Object_Smart_Clipped_Data
10216  * @ingroup Evas_Object_Box
10217  */
10218    struct _Evas_Object_Box_Data
10219    {
10220       Evas_Object_Smart_Clipped_Data   base;
10221       const Evas_Object_Box_Api       *api;
10222       struct {
10223          double                        h, v;
10224       } align;
10225       struct {
10226          Evas_Coord                    h, v;
10227       } pad;
10228       Eina_List                       *children;
10229       struct {
10230          Evas_Object_Box_Layout        cb;
10231          void                         *data;
10232          void                        (*free_data)(void *data);
10233       } layout;
10234       Eina_Bool                        layouting : 1;
10235       Eina_Bool                        children_changed : 1;
10236    };
10237
10238    struct _Evas_Object_Box_Option
10239    {
10240       Evas_Object *obj; /**< Pointer to the box child object, itself */
10241       Eina_Bool    max_reached:1;
10242       Eina_Bool    min_reached:1;
10243       Evas_Coord   alloc_size;
10244    }; /**< #Evas_Object_Box_Option struct fields */
10245
10246 /**
10247  * Set the default box @a api struct (Evas_Object_Box_Api)
10248  * with the default values. May be used to extend that API.
10249  *
10250  * @param api The box API struct to set back, most probably with
10251  * overriden fields (on class extensions scenarios)
10252  */
10253 EAPI void                       evas_object_box_smart_set                             (Evas_Object_Box_Api *api) EINA_ARG_NONNULL(1);
10254
10255 /**
10256  * Get the Evas box smart class, for inheritance purposes.
10257  *
10258  * @return the (canonical) Evas box smart class.
10259  *
10260  * The returned value is @b not to be modified, just use it as your
10261  * parent class.
10262  */
10263 EAPI const Evas_Object_Box_Api *evas_object_box_smart_class_get                       (void) EINA_CONST;
10264
10265 /**
10266  * Set a new layouting function to a given box object
10267  *
10268  * @param o The box object to operate on.
10269  * @param cb The new layout function to set on @p o.
10270  * @param data Data pointer to be passed to @p cb.
10271  * @param free_data Function to free @p data, if need be.
10272  *
10273  * A box layout function affects how a box object displays child
10274  * elements within its area. The list of pre-defined box layouts
10275  * available in Evas is:
10276  * - evas_object_box_layout_horizontal()
10277  * - evas_object_box_layout_vertical()
10278  * - evas_object_box_layout_homogeneous_horizontal()
10279  * - evas_object_box_layout_homogeneous_vertical()
10280  * - evas_object_box_layout_homogeneous_max_size_horizontal()
10281  * - evas_object_box_layout_homogeneous_max_size_vertical()
10282  * - evas_object_box_layout_flow_horizontal()
10283  * - evas_object_box_layout_flow_vertical()
10284  * - evas_object_box_layout_stack()
10285  *
10286  * Refer to each of their documentation texts for details on them.
10287  *
10288  * @note A box layouting function will be triggered by the @c
10289  * 'calculate' smart callback of the box's smart class.
10290  */
10291 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);
10292
10293 /**
10294  * Add a new box object on the provided canvas.
10295  *
10296  * @param evas The canvas to create the box object on.
10297  * @return @c NULL on error, a pointer to a new box object on
10298  * success.
10299  *
10300  * After instantiation, if a box object hasn't its layout function
10301  * set, via evas_object_box_layout_set(), it will have it by default
10302  * set to evas_object_box_layout_horizontal(). The remaining
10303  * properties of the box must be set/retrieved via
10304  * <c>evas_object_box_{h,v}_{align,padding}_{get,set)()</c>.
10305  */
10306 EAPI Evas_Object               *evas_object_box_add                                   (Evas *evas) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
10307
10308 /**
10309  * Add a new box as a @b child of a given smart object.
10310  *
10311  * @param parent The parent smart object to put the new box in.
10312  * @return @c NULL on error, a pointer to a new box object on
10313  * success.
10314  *
10315  * This is a helper function that has the same effect of putting a new
10316  * box object into @p parent by use of evas_object_smart_member_add().
10317  *
10318  * @see evas_object_box_add()
10319  */
10320 EAPI Evas_Object               *evas_object_box_add_to                                (Evas_Object *parent) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
10321
10322 /**
10323  * Layout function which sets the box @a o to a (basic) horizontal box
10324  *
10325  * @param o The box object in question
10326  * @param priv The smart data of the @p o
10327  * @param data The data pointer passed on
10328  * evas_object_box_layout_set(), if any
10329  *
10330  * In this layout, the box object's overall behavior is controlled by
10331  * its padding/alignment properties, which are set by the
10332  * <c>evas_object_box_{h,v}_{align,padding}_set()</c> family of
10333  * functions. The size hints of the elements in the box -- set by the
10334  * <c>evas_object_size_hint_{align,padding,weight}_set()</c> functions
10335  * -- also control the way this function works.
10336  *
10337  * \par Box's properties:
10338  * @c align_h controls the horizontal alignment of the child objects
10339  * relative to the containing box. When set to @c 0.0, children are
10340  * aligned to the left. A value of @c 1.0 makes them aligned to the
10341  * right border. Values in between align them proportionally. Note
10342  * that if the size required by the children, which is given by their
10343  * widths and the @c padding_h property of the box, is bigger than the
10344  * their container's width, the children will be displayed out of the
10345  * box's bounds. A negative value of @c align_h makes the box to
10346  * @b justify its children. The padding between them, in this case, is
10347  * corrected so that the leftmost one touches the left border and the
10348  * rightmost one touches the right border (even if they must
10349  * overlap). The @c align_v and @c padding_v properties of the box
10350  * @b don't contribute to its behaviour when this layout is chosen.
10351  *
10352  * \par Child element's properties:
10353  * @c align_x does @b not influence the box's behavior. @c padding_l
10354  * and @c padding_r sum up to the container's horizontal padding
10355  * between elements. The child's @c padding_t, @c padding_b and
10356  * @c align_y properties apply for padding/alignment relative to the
10357  * overall height of the box. Finally, there is the @c weight_x
10358  * property, which, if set to a non-zero value, tells the container
10359  * that the child width is @b not pre-defined. If the container can't
10360  * accommodate all its children, it sets the widths of the ones
10361  * <b>with weights</b> to sizes as small as they can all fit into
10362  * it. If the size required by the children is less than the
10363  * available, the box increases its childrens' (which have weights)
10364  * widths as to fit the remaining space. The @c weight_x property,
10365  * besides telling the element is resizable, gives a @b weight for the
10366  * resizing process.  The parent box will try to distribute (or take
10367  * off) widths accordingly to the @b normalized list of weigths: most
10368  * weighted children remain/get larger in this process than the least
10369  * ones. @c weight_y does not influence the layout.
10370  *
10371  * If one desires that, besides having weights, child elements must be
10372  * resized bounded to a minimum or maximum size, those size hints must
10373  * be set, by the <c>evas_object_size_hint_{min,max}_set()</c>
10374  * functions.
10375  */
10376 EAPI void                       evas_object_box_layout_horizontal                     (Evas_Object *o, Evas_Object_Box_Data *priv, void *data) EINA_ARG_NONNULL(1, 2);
10377
10378 /**
10379  * Layout function which sets the box @a o to a (basic) vertical box
10380  *
10381  * This function behaves analogously to
10382  * evas_object_box_layout_horizontal(). The description of its
10383  * behaviour can be derived from that function's documentation.
10384  */
10385 EAPI void                       evas_object_box_layout_vertical                       (Evas_Object *o, Evas_Object_Box_Data *priv, void *data) EINA_ARG_NONNULL(1, 2);
10386
10387 /**
10388  * Layout function which sets the box @a o to a @b homogeneous
10389  * vertical box
10390  *
10391  * This function behaves analogously to
10392  * evas_object_box_layout_homogeneous_horizontal().  The description
10393  * of its behaviour can be derived from that function's documentation.
10394  */
10395 EAPI void                       evas_object_box_layout_homogeneous_vertical           (Evas_Object *o, Evas_Object_Box_Data *priv, void *data) EINA_ARG_NONNULL(1, 2);
10396
10397 /**
10398  * Layout function which sets the box @a o to a @b homogeneous
10399  * horizontal box
10400  *
10401  * @param o The box object in question
10402  * @param priv The smart data of the @p o
10403  * @param data The data pointer passed on
10404  * evas_object_box_layout_set(), if any
10405  *
10406  * In a homogeneous horizontal box, its width is divided @b equally
10407  * between the contained objects. The box's overall behavior is
10408  * controlled by its padding/alignment properties, which are set by
10409  * the <c>evas_object_box_{h,v}_{align,padding}_set()</c> family of
10410  * functions.  The size hints the elements in the box -- set by the
10411  * <c>evas_object_size_hint_{align,padding,weight}_set()</c> functions
10412  * -- also control the way this function works.
10413  *
10414  * \par Box's properties:
10415  * @c align_h has no influence on the box for this layout.
10416  * @c padding_h tells the box to draw empty spaces of that size, in
10417  * pixels, between the (equal) child objects's cells. The @c align_v
10418  * and @c padding_v properties of the box don't contribute to its
10419  * behaviour when this layout is chosen.
10420  *
10421  * \par Child element's properties:
10422  * @c padding_l and @c padding_r sum up to the required width of the
10423  * child element. The @c align_x property tells the relative position
10424  * of this overall child width in its allocated cell (@r 0.0 to
10425  * extreme left, @c 1.0 to extreme right). A value of @c -1.0 to
10426  * @c align_x makes the box try to resize this child element to the exact
10427  * width of its cell (respecting the minimum and maximum size hints on
10428  * the child's width and accounting for its horizontal padding
10429  * hints). The child's @c padding_t, @c padding_b and @c align_y
10430  * properties apply for padding/alignment relative to the overall
10431  * height of the box. A value of @c -1.0 to @c align_y makes the box
10432  * try to resize this child element to the exact height of its parent
10433  * (respecting the maximum size hint on the child's height).
10434  */
10435 EAPI void                       evas_object_box_layout_homogeneous_horizontal         (Evas_Object *o, Evas_Object_Box_Data *priv, void *data) EINA_ARG_NONNULL(1, 2);
10436
10437 /**
10438  * Layout function which sets the box @a o to a <b>maximum size,
10439  * homogeneous</b> horizontal box
10440  *
10441  * @param o The box object in question
10442  * @param priv The smart data of the @p o
10443  * @param data The data pointer passed on
10444  * evas_object_box_layout_set(), if any
10445  *
10446  * In a maximum size, homogeneous horizontal box, besides having cells
10447  * of <b>equal size</b> reserved for the child objects, this size will
10448  * be defined by the size of the @b largest child in the box (in
10449  * width). The box's overall behavior is controlled by its properties,
10450  * which are set by the
10451  * <c>evas_object_box_{h,v}_{align,padding}_set()</c> family of
10452  * functions.  The size hints of the elements in the box -- set by the
10453  * <c>evas_object_size_hint_{align,padding,weight}_set()</c> functions
10454  * -- also control the way this function works.
10455  *
10456  * \par Box's properties:
10457  * @c padding_h tells the box to draw empty spaces of that size, in
10458  * pixels, between the child objects's cells. @c align_h controls the
10459  * horizontal alignment of the child objects, relative to the
10460  * containing box. When set to @c 0.0, children are aligned to the
10461  * left. A value of @c 1.0 lets them aligned to the right
10462  * border. Values in between align them proportionally. A negative
10463  * value of @c align_h makes the box to @b justify its children
10464  * cells. The padding between them, in this case, is corrected so that
10465  * the leftmost one touches the left border and the rightmost one
10466  * touches the right border (even if they must overlap). The
10467  * @c align_v and @c padding_v properties of the box don't contribute to
10468  * its behaviour when this layout is chosen.
10469  *
10470  * \par Child element's properties:
10471  * @c padding_l and @c padding_r sum up to the required width of the
10472  * child element. The @c align_x property tells the relative position
10473  * of this overall child width in its allocated cell (@c 0.0 to
10474  * extreme left, @c 1.0 to extreme right). A value of @c -1.0 to
10475  * @c align_x makes the box try to resize this child element to the exact
10476  * width of its cell (respecting the minimun and maximum size hints on
10477  * the child's width and accounting for its horizontal padding
10478  * hints). The child's @c padding_t, @c padding_b and @c align_y
10479  * properties apply for padding/alignment relative to the overall
10480  * height of the box. A value of @c -1.0 to @c align_y makes the box
10481  * try to resize this child element to the exact height of its parent
10482  * (respecting the max hint on the child's height).
10483  */
10484 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);
10485
10486 /**
10487  * Layout function which sets the box @a o to a <b>maximum size,
10488  * homogeneous</b> vertical box
10489  *
10490  * This function behaves analogously to
10491  * evas_object_box_layout_homogeneous_max_size_horizontal(). The
10492  * description of its behaviour can be derived from that function's
10493  * documentation.
10494  */
10495 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);
10496
10497 /**
10498  * Layout function which sets the box @a o to a @b flow horizontal
10499  * box.
10500  *
10501  * @param o The box object in question
10502  * @param priv The smart data of the @p o
10503  * @param data The data pointer passed on
10504  * evas_object_box_layout_set(), if any
10505  *
10506  * In a flow horizontal box, the box's child elements are placed in
10507  * @b rows (think of text as an analogy). A row has as much elements as
10508  * can fit into the box's width. The box's overall behavior is
10509  * controlled by its properties, which are set by the
10510  * <c>evas_object_box_{h,v}_{align,padding}_set()</c> family of
10511  * functions.  The size hints of the elements in the box -- set by the
10512  * <c>evas_object_size_hint_{align,padding,weight}_set()</c> functions
10513  * -- also control the way this function works.
10514  *
10515  * \par Box's properties:
10516  * @c padding_h tells the box to draw empty spaces of that size, in
10517  * pixels, between the child objects's cells. @c align_h dictates the
10518  * horizontal alignment of the rows (@c 0.0 to left align them, @c 1.0
10519  * to right align). A value of @c -1.0 to @c align_h lets the rows
10520  * @b justified horizontally. @c align_v controls the vertical alignment
10521  * of the entire set of rows (@c 0.0 to top, @c 1.0 to bottom). A
10522  * value of @c -1.0 to @c align_v makes the box to @b justify the rows
10523  * vertically. The padding between them, in this case, is corrected so
10524  * that the first row touches the top border and the last one touches
10525  * the bottom border (even if they must overlap). @c padding_v has no
10526  * influence on the layout.
10527  *
10528  * \par Child element's properties:
10529  * @c padding_l and @c padding_r sum up to the required width of the
10530  * child element. The @c align_x property has no influence on the
10531  * layout. The child's @c padding_t and @c padding_b sum up to the
10532  * required height of the child element and is the only means (besides
10533  * row justifying) of setting space between rows. Note, however, that
10534  * @c align_y dictates positioning relative to the <b>largest
10535  * height</b> required by a child object in the actual row.
10536  */
10537 EAPI void                       evas_object_box_layout_flow_horizontal                (Evas_Object *o, Evas_Object_Box_Data *priv, void *data) EINA_ARG_NONNULL(1, 2);
10538
10539 /**
10540  * Layout function which sets the box @a o to a @b flow vertical box.
10541  *
10542  * This function behaves analogously to
10543  * evas_object_box_layout_flow_horizontal(). The description of its
10544  * behaviour can be derived from that function's documentation.
10545  */
10546 EAPI void                       evas_object_box_layout_flow_vertical                  (Evas_Object *o, Evas_Object_Box_Data *priv, void *data) EINA_ARG_NONNULL(1, 2);
10547
10548 /**
10549  * Layout function which sets the box @a o to a @b stacking box
10550  *
10551  * @param o The box object in question
10552  * @param priv The smart data of the @p o
10553  * @param data The data pointer passed on
10554  * evas_object_box_layout_set(), if any
10555  *
10556  * In a stacking box, all children will be given the same size -- the
10557  * box's own size -- and they will be stacked one above the other, so
10558  * that the first object in @p o's internal list of child elements
10559  * will be the bottommost in the stack.
10560  *
10561  * \par Box's properties:
10562  * No box properties are used.
10563  *
10564  * \par Child element's properties:
10565  * @c padding_l and @c padding_r sum up to the required width of the
10566  * child element. The @c align_x property tells the relative position
10567  * of this overall child width in its allocated cell (@c 0.0 to
10568  * extreme left, @c 1.0 to extreme right). A value of @c -1.0 to @c
10569  * align_x makes the box try to resize this child element to the exact
10570  * width of its cell (respecting the min and max hints on the child's
10571  * width and accounting for its horizontal padding properties). The
10572  * same applies to the vertical axis.
10573  */
10574 EAPI void                       evas_object_box_layout_stack                          (Evas_Object *o, Evas_Object_Box_Data *priv, void *data) EINA_ARG_NONNULL(1, 2);
10575
10576 /**
10577  * Set the alignment of the whole bounding box of contents, for a
10578  * given box object.
10579  *
10580  * @param o The given box object to set alignment from
10581  * @param horizontal The horizontal alignment, in pixels
10582  * @param vertical the vertical alignment, in pixels
10583  *
10584  * This will influence how a box object is to align its bounding box
10585  * of contents within its own area. The values @b must be in the range
10586  * @c 0.0 - @c 1.0, or undefined behavior is expected. For horizontal
10587  * alignment, @c 0.0 means to the left, with @c 1.0 meaning to the
10588  * right. For vertical alignment, @c 0.0 means to the top, with @c 1.0
10589  * meaning to the bottom.
10590  *
10591  * @note The default values for both alignments is @c 0.5.
10592  *
10593  * @see evas_object_box_align_get()
10594  */
10595 EAPI void                       evas_object_box_align_set                             (Evas_Object *o, double horizontal, double vertical) EINA_ARG_NONNULL(1);
10596
10597 /**
10598  * Get the alignment of the whole bounding box of contents, for a
10599  * given box object.
10600  *
10601  * @param o The given box object to get alignment from
10602  * @param horizontal Pointer to a variable where to store the
10603  * horizontal alignment
10604  * @param vertical Pointer to a variable where to store the vertical
10605  * alignment
10606  *
10607  * @see evas_object_box_align_set() for more information
10608  */
10609 EAPI void                       evas_object_box_align_get                             (const Evas_Object *o, double *horizontal, double *vertical) EINA_ARG_NONNULL(1);
10610
10611 /**
10612  * Set the (space) padding between cells set for a given box object.
10613  *
10614  * @param o The given box object to set padding from
10615  * @param horizontal The horizontal padding, in pixels
10616  * @param vertical the vertical padding, in pixels
10617  *
10618  * @note The default values for both padding components is @c 0.
10619  *
10620  * @see evas_object_box_padding_get()
10621  */
10622 EAPI void                       evas_object_box_padding_set                           (Evas_Object *o, Evas_Coord horizontal, Evas_Coord vertical) EINA_ARG_NONNULL(1);
10623
10624 /**
10625  * Get the (space) padding between cells set for a given box object.
10626  *
10627  * @param o The given box object to get padding from
10628  * @param horizontal Pointer to a variable where to store the
10629  * horizontal padding
10630  * @param vertical Pointer to a variable where to store the vertical
10631  * padding
10632  *
10633  * @see evas_object_box_padding_set()
10634  */
10635 EAPI void                       evas_object_box_padding_get                           (const Evas_Object *o, Evas_Coord *horizontal, Evas_Coord *vertical) EINA_ARG_NONNULL(1);
10636
10637 /**
10638  * Append a new @a child object to the given box object @a o.
10639  *
10640  * @param o The given box object
10641  * @param child A child Evas object to be made a member of @p o
10642  * @return A box option bound to the recently added box item or @c
10643  * NULL, on errors
10644  *
10645  * On success, the @c "child,added" smart event will take place.
10646  *
10647  * @note The actual placing of the item relative to @p o's area will
10648  * depend on the layout set to it. For example, on horizontal layouts
10649  * an item in the end of the box's list of children will appear on its
10650  * right.
10651  *
10652  * @note This call will trigger the box's _Evas_Object_Box_Api::append
10653  * smart function.
10654  */
10655 EAPI Evas_Object_Box_Option    *evas_object_box_append                                (Evas_Object *o, Evas_Object *child) EINA_ARG_NONNULL(1, 2);
10656
10657 /**
10658  * Prepend a new @a child object to the given box object @a o.
10659  *
10660  * @param o The given box object
10661  * @param child A child Evas object to be made a member of @p o
10662  * @return A box option bound to the recently added box item or @c
10663  * NULL, on errors
10664  *
10665  * On success, the @c "child,added" smart event will take place.
10666  *
10667  * @note The actual placing of the item relative to @p o's area will
10668  * depend on the layout set to it. For example, on horizontal layouts
10669  * an item in the beginning of the box's list of children will appear
10670  * on its left.
10671  *
10672  * @note This call will trigger the box's
10673  * _Evas_Object_Box_Api::prepend smart function.
10674  */
10675 EAPI Evas_Object_Box_Option    *evas_object_box_prepend                               (Evas_Object *o, Evas_Object *child) EINA_ARG_NONNULL(1, 2);
10676
10677 /**
10678  * Insert a new @a child object <b>before another existing one</b>, in
10679  * a given box object @a o.
10680  *
10681  * @param o The given box object
10682  * @param child A child Evas object to be made a member of @p o
10683  * @param reference The child object to place this new one before
10684  * @return A box option bound to the recently added box item or @c
10685  * NULL, on errors
10686  *
10687  * On success, the @c "child,added" smart event will take place.
10688  *
10689  * @note This function will fail if @p reference is not a member of @p
10690  * o.
10691  *
10692  * @note The actual placing of the item relative to @p o's area will
10693  * depend on the layout set to it.
10694  *
10695  * @note This call will trigger the box's
10696  * _Evas_Object_Box_Api::insert_before smart function.
10697  */
10698 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);
10699
10700 /**
10701  * Insert a new @a child object <b>after another existing one</b>, in
10702  * a given box object @a o.
10703  *
10704  * @param o The given box object
10705  * @param child A child Evas object to be made a member of @p o
10706  * @param reference The child object to place this new one after
10707  * @return A box option bound to the recently added box item or @c
10708  * NULL, on errors
10709  *
10710  * On success, the @c "child,added" smart event will take place.
10711  *
10712  * @note This function will fail if @p reference is not a member of @p
10713  * o.
10714  *
10715  * @note The actual placing of the item relative to @p o's area will
10716  * depend on the layout set to it.
10717  *
10718  * @note This call will trigger the box's
10719  * _Evas_Object_Box_Api::insert_after smart function.
10720  */
10721 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);
10722
10723 /**
10724  * Insert a new @a child object <b>at a given position</b>, in a given
10725  * box object @a o.
10726  *
10727  * @param o The given box object
10728  * @param child A child Evas object to be made a member of @p o
10729  * @param pos The numeric position (starting from @c 0) to place the
10730  * new child object at
10731  * @return A box option bound to the recently added box item or @c
10732  * NULL, on errors
10733  *
10734  * On success, the @c "child,added" smart event will take place.
10735  *
10736  * @note This function will fail if the given position is invalid,
10737  * given @p o's internal list of elements.
10738  *
10739  * @note The actual placing of the item relative to @p o's area will
10740  * depend on the layout set to it.
10741  *
10742  * @note This call will trigger the box's
10743  * _Evas_Object_Box_Api::insert_at smart function.
10744  */
10745 EAPI Evas_Object_Box_Option    *evas_object_box_insert_at                             (Evas_Object *o, Evas_Object *child, unsigned int pos) EINA_ARG_NONNULL(1, 2);
10746
10747 /**
10748  * Remove a given object from a box object, unparenting it again.
10749  *
10750  * @param o The box object to remove a child object from
10751  * @param child The handle to the child object to be removed
10752  * @return @c EINA_TRUE, on success, @c EINA_FALSE otherwise
10753  *
10754  * On removal, you'll get an unparented object again, just as it was
10755  * before you inserted it in the box. The
10756  * _Evas_Object_Box_Api::option_free box smart callback will be called
10757  * automatilly for you and, also, the @c "child,removed" smart event
10758  * will take place.
10759  *
10760  * @note This call will trigger the box's _Evas_Object_Box_Api::remove
10761  * smart function.
10762  */
10763 EAPI Eina_Bool                  evas_object_box_remove                                (Evas_Object *o, Evas_Object *child) EINA_ARG_NONNULL(1, 2);
10764
10765 /**
10766  * Remove an object, <b>bound to a given position</b> in a box object,
10767  * unparenting it again.
10768  *
10769  * @param o The box object to remove a child object from
10770  * @param in The numeric position (starting from @c 0) of the child
10771  * object to be removed
10772  * @return @c EINA_TRUE, on success, @c EINA_FALSE otherwise
10773  *
10774  * On removal, you'll get an unparented object again, just as it was
10775  * before you inserted it in the box. The @c option_free() box smart
10776  * callback will be called automatilly for you and, also, the
10777  * @c "child,removed" smart event will take place.
10778  *
10779  * @note This function will fail if the given position is invalid,
10780  * given @p o's internal list of elements.
10781  *
10782  * @note This call will trigger the box's
10783  * _Evas_Object_Box_Api::remove_at smart function.
10784  */
10785 EAPI Eina_Bool                  evas_object_box_remove_at                             (Evas_Object *o, unsigned int pos) EINA_ARG_NONNULL(1);
10786
10787 /**
10788  * Remove @b all child objects from a box object, unparenting them
10789  * again.
10790  *
10791  * @param o The box object to remove a child object from
10792  * @param child The handle to the child object to be removed
10793  * @return @c EINA_TRUE, on success, @c EINA_FALSE otherwise
10794  *
10795  * This has the same effect of calling evas_object_box_remove() on
10796  * each of @p o's child objects, in sequence. If, and only if, all
10797  * those calls succeed, so does this one.
10798  */
10799 EAPI Eina_Bool                  evas_object_box_remove_all                            (Evas_Object *o, Eina_Bool clear) EINA_ARG_NONNULL(1);
10800
10801 /**
10802  * Get an iterator to walk the list of children of a given box object.
10803  *
10804  * @param o The box to retrieve an items iterator from
10805  * @return An iterator on @p o's child objects, on success, or @c NULL,
10806  * on errors
10807  *
10808  * @note Do @b not remove or delete objects while walking the list.
10809  */
10810 EAPI Eina_Iterator             *evas_object_box_iterator_new                          (const Evas_Object *o) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
10811
10812 /**
10813  * Get an accessor (a structure providing random items access) to the
10814  * list of children of a given box object.
10815  *
10816  * @param o The box to retrieve an items iterator from
10817  * @return An accessor on @p o's child objects, on success, or @c NULL,
10818  * on errors
10819  *
10820  * @note Do not remove or delete objects while walking the list.
10821  */
10822 EAPI Eina_Accessor             *evas_object_box_accessor_new                          (const Evas_Object *o) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
10823
10824 /**
10825  * Get the list of children objects in a given box object.
10826  *
10827  * @param o The box to retrieve an items list from
10828  * @return A list of @p o's child objects, on success, or @c NULL,
10829  * on errors (or if it has no child objects)
10830  *
10831  * The returned list should be freed with @c eina_list_free() when you
10832  * no longer need it.
10833  *
10834  * @note This is a duplicate of the list kept by the box internally.
10835  *       It's up to the user to destroy it when it no longer needs it.
10836  *       It's possible to remove objects from the box when walking
10837  *       this list, but these removals won't be reflected on it.
10838  */
10839 EAPI Eina_List                 *evas_object_box_children_get                          (const Evas_Object *o) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
10840
10841 /**
10842  * Get the name of the property of the child elements of the box @a o
10843  * which have @a id as identifier
10844  *
10845  * @param o The box to search child options from
10846  * @param id The numerical identifier of the option being searched, for
10847  * its name
10848  * @return The name of the given property or @c NULL, on errors.
10849  *
10850  * @note This call won't do anything for a canonical Evas box. Only
10851  * users which have @b subclassed it, setting custom box items options
10852  * (see #Evas_Object_Box_Option) on it, would benefit from this
10853  * function. They'd have to implement it and set it to be the
10854  * _Evas_Object_Box_Api::property_name_get smart class function of the
10855  * box, which is originally set to @c NULL.
10856  */
10857 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;
10858
10859 /**
10860  * Get the numerical identifier of the property of the child elements
10861  * of the box @a o which have @a name as name string
10862  *
10863  * @param o The box to search child options from
10864  * @param name The name string of the option being searched, for
10865  * its ID
10866  * @return The numerical ID of the given property or @c -1, on
10867  * errors.
10868  *
10869  * @note This call won't do anything for a canonical Evas box. Only
10870  * users which have @b subclassed it, setting custom box items options
10871  * (see #Evas_Object_Box_Option) on it, would benefit from this
10872  * function. They'd have to implement it and set it to be the
10873  * _Evas_Object_Box_Api::property_id_get smart class function of the
10874  * box, which is originally set to @c NULL.
10875  */
10876 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;
10877
10878 /**
10879  * Set a property value (by its given numerical identifier), on a
10880  * given box child element
10881  *
10882  * @param o The box parenting the child element
10883  * @param opt The box option structure bound to the child box element
10884  * to set a property on
10885  * @param id The numerical ID of the given property
10886  * @param ... (List of) actual value(s) to be set for this
10887  * property. It (they) @b must be of the same type the user has
10888  * defined for it (them).
10889  * @return @c EINA_TRUE on success, @c EINA_FALSE on failure.
10890  *
10891  * @note This call won't do anything for a canonical Evas box. Only
10892  * users which have @b subclassed it, setting custom box items options
10893  * (see #Evas_Object_Box_Option) on it, would benefit from this
10894  * function. They'd have to implement it and set it to be the
10895  * _Evas_Object_Box_Api::property_set smart class function of the box,
10896  * which is originally set to @c NULL.
10897  *
10898  * @note This function will internally create a variable argument
10899  * list, with the values passed after @p property, and call
10900  * evas_object_box_option_property_vset() with this list and the same
10901  * previous arguments.
10902  */
10903 EAPI Eina_Bool                  evas_object_box_option_property_set                   (Evas_Object *o, Evas_Object_Box_Option *opt, int property, ...) EINA_ARG_NONNULL(1, 2);
10904
10905 /**
10906  * Set a property value (by its given numerical identifier), on a
10907  * given box child element -- by a variable argument list
10908  *
10909  * @param o The box parenting the child element
10910  * @param opt The box option structure bound to the child box element
10911  * to set a property on
10912  * @param id The numerical ID of the given property
10913  * @param va_list The variable argument list implementing the value to
10914  * be set for this property. It @b must be of the same type the user has
10915  * defined for it.
10916  * @return @c EINA_TRUE on success, @c EINA_FALSE on failure.
10917  *
10918  * This is a variable argument list variant of the
10919  * evas_object_box_option_property_set(). See its documentation for
10920  * more details.
10921  */
10922 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);
10923
10924 /**
10925  * Get a property's value (by its given numerical identifier), on a
10926  * given box child element
10927  *
10928  * @param o The box parenting the child element
10929  * @param opt The box option structure bound to the child box element
10930  * to get a property from
10931  * @param id The numerical ID of the given property
10932  * @param ... (List of) pointer(s) where to store the value(s) set for
10933  * this property. It (they) @b must point to variable(s) of the same
10934  * type the user has defined for it (them).
10935  * @return @c EINA_TRUE on success, @c EINA_FALSE on failure.
10936  *
10937  * @note This call won't do anything for a canonical Evas box. Only
10938  * users which have @b subclassed it, getting custom box items options
10939  * (see #Evas_Object_Box_Option) on it, would benefit from this
10940  * function. They'd have to implement it and get it to be the
10941  * _Evas_Object_Box_Api::property_get smart class function of the
10942  * box, which is originally get to @c NULL.
10943  *
10944  * @note This function will internally create a variable argument
10945  * list, with the values passed after @p property, and call
10946  * evas_object_box_option_property_vget() with this list and the same
10947  * previous arguments.
10948  */
10949 EAPI Eina_Bool                  evas_object_box_option_property_get                   (Evas_Object *o, Evas_Object_Box_Option *opt, int property, ...) EINA_ARG_NONNULL(1, 2);
10950
10951 /**
10952  * Get a property's value (by its given numerical identifier), on a
10953  * given box child element -- by a variable argument list
10954  *
10955  * @param o The box parenting the child element
10956  * @param opt The box option structure bound to the child box element
10957  * to get a property from
10958  * @param id The numerical ID of the given property
10959  * @param va_list The variable argument list with pointers to where to
10960  * store the values of this property. They @b must point to variables
10961  * of the same type the user has defined for them.
10962  * @return @c EINA_TRUE on success, @c EINA_FALSE on failure.
10963  *
10964  * This is a variable argument list variant of the
10965  * evas_object_box_option_property_get(). See its documentation for
10966  * more details.
10967  */
10968 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);
10969
10970 /**
10971  * @}
10972  */
10973
10974 /**
10975  * @defgroup Evas_Object_Table Table Smart Object.
10976  *
10977  * Convenience smart object that packs children using a tabular
10978  * layout using children size hints to define their size and
10979  * alignment inside their cell space.
10980  *
10981  * @ref tutorial_table shows how to use this Evas_Object.
10982  *
10983  * @see @ref Evas_Object_Group_Size_Hints
10984  *
10985  * @ingroup Evas_Smart_Object_Group
10986  *
10987  * @{
10988  */
10989
10990 /**
10991  * @brief Create a new table.
10992  *
10993  * @param evas Canvas in which table will be added.
10994  */
10995 EAPI Evas_Object                        *evas_object_table_add             (Evas *evas) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
10996
10997 /**
10998  * @brief Create a table that is child of a given element @a parent.
10999  *
11000  * @see evas_object_table_add()
11001  */
11002 EAPI Evas_Object                        *evas_object_table_add_to          (Evas_Object *parent) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
11003
11004 /**
11005  * @brief Set how this table should layout children.
11006  *
11007  * @todo consider aspect hint and respect it.
11008  *
11009  * @par EVAS_OBJECT_TABLE_HOMOGENEOUS_NONE
11010  * If table does not use homogeneous mode then columns and rows will
11011  * be calculated based on hints of individual cells. This operation
11012  * mode is more flexible, but more complex and heavy to calculate as
11013  * well. @b Weight properties are handled as a boolean expand. Negative
11014  * alignment will be considered as 0.5. This is the default.
11015  *
11016  * @todo @c EVAS_OBJECT_TABLE_HOMOGENEOUS_NONE should balance weight.
11017  *
11018  * @par EVAS_OBJECT_TABLE_HOMOGENEOUS_TABLE
11019  * When homogeneous is relative to table the own table size is divided
11020  * equally among children, filling the whole table area. That is, if
11021  * table has @c WIDTH and @c COLUMNS, each cell will get <tt>WIDTH /
11022  * COLUMNS</tt> pixels. If children have minimum size that is larger
11023  * than this amount (including padding), then it will overflow and be
11024  * aligned respecting the alignment hint, possible overlapping sibling
11025  * cells. @b Weight hint is used as a boolean, if greater than zero it
11026  * will make the child expand in that axis, taking as much space as
11027  * possible (bounded to maximum size hint). Negative alignment will be
11028  * considered as 0.5.
11029  *
11030  * @par EVAS_OBJECT_TABLE_HOMOGENEOUS_ITEM
11031  * When homogeneous is relative to item it means the greatest minimum
11032  * cell size will be used. That is, if no element is set to expand,
11033  * the table will have its contents to a minimum size, the bounding
11034  * box of all these children will be aligned relatively to the table
11035  * object using evas_object_table_align_get(). If the table area is
11036  * too small to hold this minimum bounding box, then the objects will
11037  * keep their size and the bounding box will overflow the box area,
11038  * still respecting the alignment. @b Weight hint is used as a
11039  * boolean, if greater than zero it will make that cell expand in that
11040  * axis, toggling the <b>expand mode</b>, which makes the table behave
11041  * much like @b EVAS_OBJECT_TABLE_HOMOGENEOUS_TABLE, except that the
11042  * bounding box will overflow and items will not overlap siblings. If
11043  * no minimum size is provided at all then the table will fallback to
11044  * expand mode as well.
11045  */
11046 EAPI void                                evas_object_table_homogeneous_set (Evas_Object *o, Evas_Object_Table_Homogeneous_Mode homogeneous) EINA_ARG_NONNULL(1);
11047
11048 /**
11049  * Get the current layout homogeneous mode.
11050  *
11051  * @see evas_object_table_homogeneous_set()
11052  */
11053 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;
11054
11055 /**
11056  * Set padding between cells.
11057  */
11058 EAPI void                                evas_object_table_padding_set     (Evas_Object *o, Evas_Coord horizontal, Evas_Coord vertical) EINA_ARG_NONNULL(1);
11059
11060 /**
11061  * Get padding between cells.
11062  */
11063 EAPI void                                evas_object_table_padding_get     (const Evas_Object *o, Evas_Coord *horizontal, Evas_Coord *vertical) EINA_ARG_NONNULL(1);
11064
11065 /**
11066  * Set the alignment of the whole bounding box of contents.
11067  */
11068 EAPI void                                evas_object_table_align_set       (Evas_Object *o, double horizontal, double vertical) EINA_ARG_NONNULL(1);
11069
11070 /**
11071  * Get alignment of the whole bounding box of contents.
11072  */
11073 EAPI void                                evas_object_table_align_get       (const Evas_Object *o, double *horizontal, double *vertical) EINA_ARG_NONNULL(1);
11074
11075 /**
11076  * Sets the mirrored mode of the table. In mirrored mode the table items go
11077  * from right to left instead of left to right. That is, 1,1 is top right, not
11078  * top left.
11079  *
11080  * @param obj The table object.
11081  * @param mirrored the mirrored mode to set
11082  * @since 1.1.0
11083  */
11084 EAPI void                                evas_object_table_mirrored_set    (Evas_Object *o, Eina_Bool mirrored) EINA_ARG_NONNULL(1);
11085
11086 /**
11087  * Gets the mirrored mode of the table.
11088  *
11089  * @param obj The table object.
11090  * @return EINA_TRUE if it's a mirrored table, EINA_FALSE otherwise.
11091  * @since 1.1.0
11092  * @see evas_object_table_mirrored_set()
11093  */
11094 EAPI Eina_Bool                           evas_object_table_mirrored_get    (const Evas_Object *o) EINA_ARG_NONNULL(1);
11095
11096 /**
11097  * Get packing location of a child of table
11098  *
11099  * @param o The given table object.
11100  * @param child The child object to add.
11101  * @param col pointer to store relative-horizontal position to place child.
11102  * @param row pointer to store relative-vertical position to place child.
11103  * @param colspan pointer to store how many relative-horizontal position to use for this child.
11104  * @param rowspan pointer to store how many relative-vertical position to use for this child.
11105  *
11106  * @return 1 on success, 0 on failure.
11107  * @since 1.1.0
11108  */
11109 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);
11110
11111 /**
11112  * Add a new child to a table object or set its current packing.
11113  *
11114  * @param o The given table object.
11115  * @param child The child object to add.
11116  * @param col relative-horizontal position to place child.
11117  * @param row relative-vertical position to place child.
11118  * @param colspan how many relative-horizontal position to use for this child.
11119  * @param rowspan how many relative-vertical position to use for this child.
11120  *
11121  * @return 1 on success, 0 on failure.
11122  */
11123 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);
11124
11125 /**
11126  * Remove child from table.
11127  *
11128  * @note removing a child will immediately call a walk over children in order
11129  *       to recalculate numbers of columns and rows. If you plan to remove
11130  *       all children, use evas_object_table_clear() instead.
11131  *
11132  * @return 1 on success, 0 on failure.
11133  */
11134 EAPI Eina_Bool                           evas_object_table_unpack          (Evas_Object *o, Evas_Object *child) EINA_ARG_NONNULL(1, 2);
11135
11136 /**
11137  * Faster way to remove all child objects from a table object.
11138  *
11139  * @param o The given table object.
11140  * @param clear if true, it will delete just removed children.
11141  */
11142 EAPI void                                evas_object_table_clear           (Evas_Object *o, Eina_Bool clear) EINA_ARG_NONNULL(1);
11143
11144 /**
11145  * Get the number of columns and rows this table takes.
11146  *
11147  * @note columns and rows are virtual entities, one can specify a table
11148  *       with a single object that takes 4 columns and 5 rows. The only
11149  *       difference for a single cell table is that paddings will be
11150  *       accounted proportionally.
11151  */
11152 EAPI void                                evas_object_table_col_row_size_get(const Evas_Object *o, int *cols, int *rows) EINA_ARG_NONNULL(1);
11153
11154 /**
11155  * Get an iterator to walk the list of children for the table.
11156  *
11157  * @note Do not remove or delete objects while walking the list.
11158  */
11159 EAPI Eina_Iterator                      *evas_object_table_iterator_new    (const Evas_Object *o) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
11160
11161 /**
11162  * Get an accessor to get random access to the list of children for the table.
11163  *
11164  * @note Do not remove or delete objects while walking the list.
11165  */
11166 EAPI Eina_Accessor                      *evas_object_table_accessor_new    (const Evas_Object *o) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
11167
11168 /**
11169  * Get the list of children for the table.
11170  *
11171  * @note This is a duplicate of the list kept by the table internally.
11172  *       It's up to the user to destroy it when it no longer needs it.
11173  *       It's possible to remove objects from the table when walking this
11174  *       list, but these removals won't be reflected on it.
11175  */
11176 EAPI Eina_List                          *evas_object_table_children_get    (const Evas_Object *o) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
11177
11178 /**
11179  * Get the child of the table at the given coordinates
11180  *
11181  * @note This does not take into account col/row spanning
11182  */
11183 EAPI Evas_Object                        *evas_object_table_child_get       (const Evas_Object *o, unsigned short col, unsigned short row) EINA_ARG_NONNULL(1);
11184 /**
11185  * @}
11186  */
11187
11188 /**
11189  * @defgroup Evas_Object_Grid Grid Smart Object.
11190  *
11191  * Convenience smart object that packs children under a regular grid
11192  * layout, using their virtual grid location and size to determine
11193  * children's positions inside the grid object's area.
11194  *
11195  * @ingroup Evas_Smart_Object_Group
11196  * @since 1.1.0
11197  */
11198
11199 /**
11200  * @addtogroup Evas_Object_Grid
11201  * @{
11202  */
11203
11204 /**
11205  * Create a new grid.
11206  *
11207  * It's set to a virtual size of 1x1 by default and add children with
11208  * evas_object_grid_pack().
11209  * @since 1.1.0
11210  */
11211 EAPI Evas_Object                        *evas_object_grid_add             (Evas *evas) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
11212
11213 /**
11214  * Create a grid that is child of a given element @a parent.
11215  *
11216  * @see evas_object_grid_add()
11217  * @since 1.1.0
11218  */
11219 EAPI Evas_Object                        *evas_object_grid_add_to          (Evas_Object *parent) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
11220
11221 /**
11222  * Set the virtual resolution for the grid
11223  *
11224  * @param o The grid object to modify
11225  * @param w The virtual horizontal size (resolution) in integer units
11226  * @param h The virtual vertical size (resolution) in integer units
11227  * @since 1.1.0
11228  */
11229 EAPI void                                evas_object_grid_size_set        (Evas_Object *o, int w, int h) EINA_ARG_NONNULL(1);
11230
11231 /**
11232  * Get the current virtual resolution
11233  *
11234  * @param o The grid object to query
11235  * @param w A pointer to an integer to store the virtual width
11236  * @param h A pointer to an integer to store the virtual height
11237  * @see evas_object_grid_size_set()
11238  * @since 1.1.0
11239  */
11240 EAPI void                                evas_object_grid_size_get        (const Evas_Object *o, int *w, int *h) EINA_ARG_NONNULL(1) EINA_PURE;
11241
11242 /**
11243  * Sets the mirrored mode of the grid. In mirrored mode the grid items go
11244  * from right to left instead of left to right. That is, 0,0 is top right, not
11245  * to left.
11246  *
11247  * @param obj The grid object.
11248  * @param mirrored the mirrored mode to set
11249  * @since 1.1.0
11250  */
11251 EAPI void                                evas_object_grid_mirrored_set    (Evas_Object *o, Eina_Bool mirrored) EINA_ARG_NONNULL(1);
11252
11253 /**
11254  * Gets the mirrored mode of the grid.
11255  *
11256  * @param obj The grid object.
11257  * @return EINA_TRUE if it's a mirrored grid, EINA_FALSE otherwise.
11258  * @see evas_object_grid_mirrored_set()
11259  * @since 1.1.0
11260  */
11261 EAPI Eina_Bool                           evas_object_grid_mirrored_get    (const Evas_Object *o) EINA_ARG_NONNULL(1);
11262
11263 /**
11264  * Add a new child to a grid object.
11265  *
11266  * @param o The given grid object.
11267  * @param child The child object to add.
11268  * @param x The virtual x coordinate of the child
11269  * @param y The virtual y coordinate of the child
11270  * @param w The virtual width of the child
11271  * @param h The virtual height of the child
11272  * @return 1 on success, 0 on failure.
11273  * @since 1.1.0
11274  */
11275 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);
11276
11277 /**
11278  * Remove child from grid.
11279  *
11280  * @note removing a child will immediately call a walk over children in order
11281  *       to recalculate numbers of columns and rows. If you plan to remove
11282  *       all children, use evas_object_grid_clear() instead.
11283  *
11284  * @return 1 on success, 0 on failure.
11285  * @since 1.1.0
11286  */
11287 EAPI Eina_Bool                           evas_object_grid_unpack          (Evas_Object *o, Evas_Object *child) EINA_ARG_NONNULL(1, 2);
11288
11289 /**
11290  * Faster way to remove all child objects from a grid object.
11291  *
11292  * @param o The given grid object.
11293  * @param clear if true, it will delete just removed children.
11294  * @since 1.1.0
11295  */
11296 EAPI void                                evas_object_grid_clear           (Evas_Object *o, Eina_Bool clear) EINA_ARG_NONNULL(1);
11297
11298 /**
11299  * Get the pack options for a grid child
11300  *
11301  * Get the pack x, y, width and height in virtual coordinates set by
11302  * evas_object_grid_pack()
11303  * @param o The grid object
11304  * @param child The grid child to query for coordinates
11305  * @param x The pointer to where the x coordinate will be returned
11306  * @param y The pointer to where the y coordinate will be returned
11307  * @param w The pointer to where the width will be returned
11308  * @param h The pointer to where the height will be returned
11309  * @return 1 on success, 0 on failure.
11310  * @since 1.1.0
11311  */
11312 EAPI Eina_Bool                           evas_object_grid_pack_get        (Evas_Object *o, Evas_Object *child, int *x, int *y, int *w, int *h);
11313
11314 /**
11315  * Get an iterator to walk the list of children for the grid.
11316  *
11317  * @note Do not remove or delete objects while walking the list.
11318  * @since 1.1.0
11319  */
11320 EAPI Eina_Iterator                      *evas_object_grid_iterator_new    (const Evas_Object *o) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
11321
11322 /**
11323  * Get an accessor to get random access to the list of children for the grid.
11324  *
11325  * @note Do not remove or delete objects while walking the list.
11326  * @since 1.1.0
11327  */
11328 EAPI Eina_Accessor                      *evas_object_grid_accessor_new    (const Evas_Object *o) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
11329
11330 /**
11331  * Get the list of children for the grid.
11332  *
11333  * @note This is a duplicate of the list kept by the grid internally.
11334  *       It's up to the user to destroy it when it no longer needs it.
11335  *       It's possible to remove objects from the grid when walking this
11336  *       list, but these removals won't be reflected on it.
11337  * @since 1.1.0
11338  */
11339 EAPI Eina_List                          *evas_object_grid_children_get    (const Evas_Object *o) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
11340
11341 /**
11342  * @}
11343  */
11344
11345 /**
11346  * @defgroup Evas_Cserve Shared Image Cache Server
11347  *
11348  * Evas has an (optional) module which provides client-server
11349  * infrastructure to <b>share bitmaps across multiple processes</b>,
11350  * saving data and processing power.
11351  *
11352  * Be warned that it @b doesn't work when <b>threaded image
11353  * preloading</b> is enabled for Evas, though.
11354  */
11355    typedef struct _Evas_Cserve_Stats       Evas_Cserve_Stats;
11356    typedef struct _Evas_Cserve_Image_Cache Evas_Cserve_Image_Cache;
11357    typedef struct _Evas_Cserve_Image       Evas_Cserve_Image;
11358    typedef struct _Evas_Cserve_Config      Evas_Cserve_Config;
11359
11360 /**
11361  * Statistics about the server that shares cached bitmaps.
11362  * @ingroup Evas_Cserve
11363  */
11364    struct _Evas_Cserve_Stats
11365      {
11366         int    saved_memory; /**< current amount of saved memory, in bytes */
11367         int    wasted_memory; /**< current amount of wasted memory, in bytes */
11368         int    saved_memory_peak; /**< peak ammount of saved memory, in bytes */
11369         int    wasted_memory_peak; /**< peak ammount of wasted memory, in bytes */
11370         double saved_time_image_header_load; /**< time, in seconds, saved in header loads by sharing cached loads instead */
11371         double saved_time_image_data_load; /**< time, in seconds, saved in data loads by sharing cached loads instead */
11372      };
11373
11374 /**
11375  * A handle of a cache of images shared by a server.
11376  * @ingroup Evas_Cserve
11377  */
11378    struct _Evas_Cserve_Image_Cache
11379      {
11380         struct {
11381            int     mem_total;
11382            int     count;
11383         } active, cached;
11384         Eina_List *images;
11385      };
11386
11387 /**
11388  * A handle to an image shared by a server.
11389  * @ingroup Evas_Cserve
11390  */
11391    struct _Evas_Cserve_Image
11392      {
11393         const char *file, *key;
11394         int         w, h;
11395         time_t      file_mod_time;
11396         time_t      file_checked_time;
11397         time_t      cached_time;
11398         int         refcount;
11399         int         data_refcount;
11400         int         memory_footprint;
11401         double      head_load_time;
11402         double      data_load_time;
11403         Eina_Bool   alpha : 1;
11404         Eina_Bool   data_loaded : 1;
11405         Eina_Bool   active : 1;
11406         Eina_Bool   dead : 1;
11407         Eina_Bool   useless : 1;
11408      };
11409
11410 /**
11411  * Configuration that controls the server that shares cached bitmaps.
11412  * @ingroup Evas_Cserve
11413  */
11414     struct _Evas_Cserve_Config
11415      {
11416         int cache_max_usage;
11417         int cache_item_timeout;
11418         int cache_item_timeout_check;
11419      };
11420
11421
11422 /**
11423  * Retrieves if the system wants to share bitmaps using the server.
11424  * @return @c EINA_TRUE if it wants, @c EINA_FALSE otherwise.
11425  * @ingroup Evas_Cserve
11426  */
11427 EAPI Eina_Bool         evas_cserve_want_get                   (void) EINA_WARN_UNUSED_RESULT EINA_PURE;
11428
11429 /**
11430  * Retrieves if the system is connected to the server used to share
11431  * bitmaps.
11432  *
11433  * @return @c EINA_TRUE if it's connected, @c EINA_FALSE otherwise.
11434  * @ingroup Evas_Cserve
11435  */
11436 EAPI Eina_Bool         evas_cserve_connected_get              (void) EINA_WARN_UNUSED_RESULT;
11437
11438 /**
11439  * Retrieves statistics from a running bitmap sharing server.
11440  * @param stats pointer to structure to fill with statistics about the
11441  *        bitmap cache server.
11442  *
11443  * @return @c EINA_TRUE if @p stats were filled with data,
11444  *         @c EINA_FALSE otherwise (when @p stats is untouched)
11445  * @ingroup Evas_Cserve
11446  */
11447 EAPI Eina_Bool         evas_cserve_stats_get                  (Evas_Cserve_Stats *stats) EINA_WARN_UNUSED_RESULT;
11448
11449 /**
11450  * Completely discard/clean a given images cache, thus re-setting it.
11451  *
11452  * @param cache A handle to the given images cache.
11453  */
11454 EAPI void              evas_cserve_image_cache_contents_clean (Evas_Cserve_Image_Cache *cache) EINA_PURE;
11455
11456 /**
11457  * Retrieves the current configuration of the Evas image caching
11458  * server.
11459  *
11460  * @param config where to store current image caching server's
11461  * configuration.
11462  *
11463  * @return @c EINA_TRUE if @p config was filled with data,
11464  *         @c EINA_FALSE otherwise (when @p config is untouched)
11465  *
11466  * The fields of @p config will be altered to reflect the current
11467  * configuration's values.
11468  *
11469  * @see evas_cserve_config_set()
11470  *
11471  * @ingroup Evas_Cserve
11472  */
11473 EAPI Eina_Bool         evas_cserve_config_get                 (Evas_Cserve_Config *config) EINA_WARN_UNUSED_RESULT EINA_PURE;
11474
11475 /**
11476  * Changes the configurations of the Evas image caching server.
11477  *
11478  * @param config A bitmap cache configuration handle with fields set
11479  * to desired configuration values.
11480  * @return @c EINA_TRUE if @p config was successfully applied,
11481  *         @c EINA_FALSE otherwise.
11482  *
11483  * @see evas_cserve_config_get()
11484  *
11485  * @ingroup Evas_Cserve
11486  */
11487 EAPI Eina_Bool         evas_cserve_config_set                 (const Evas_Cserve_Config *config) EINA_WARN_UNUSED_RESULT EINA_PURE;
11488
11489 /**
11490  * Force the system to disconnect from the bitmap caching server.
11491  *
11492  * @ingroup Evas_Cserve
11493  */
11494 EAPI void              evas_cserve_disconnect                 (void);
11495
11496 /**
11497  * @defgroup Evas_Utils General Utilities
11498  *
11499  * Some functions that are handy but are not specific of canvas or
11500  * objects.
11501  */
11502
11503 /**
11504  * Converts the given Evas image load error code into a string
11505  * describing it in english.
11506  *
11507  * @param error the error code, a value in ::Evas_Load_Error.
11508  * @return Always returns a valid string. If the given @p error is not
11509  *         supported, <code>"Unknown error"</code> is returned.
11510  *
11511  * Mostly evas_object_image_file_set() would be the function setting
11512  * that error value afterwards, but also evas_object_image_load(),
11513  * evas_object_image_save(), evas_object_image_data_get(),
11514  * evas_object_image_data_convert(), evas_object_image_pixels_import()
11515  * and evas_object_image_is_inside(). This function is meant to be
11516  * used in conjunction with evas_object_image_load_error_get(), as in:
11517  *
11518  * Example code:
11519  * @dontinclude evas-load-error-str.c
11520  * @skip img1 =
11521  * @until ecore_main_loop_begin(
11522  *
11523  * Here, being @c valid_path the path to a valid image and @c
11524  * bogus_path a path to a file which does not exist, the two outputs
11525  * of evas_load_error_str() would be (if no other errors occur):
11526  * <code>"No error on load"</code> and <code>"File (or file path) does
11527  * not exist"</code>, respectively. See the full @ref
11528  * Example_Evas_Images "example".
11529  *
11530  * @ingroup Evas_Utils
11531  */
11532 EAPI const char       *evas_load_error_str               (Evas_Load_Error error);
11533
11534 /* Evas utility routines for color space conversions */
11535 /* hsv color space has h in the range 0.0 to 360.0, and s,v in the range 0.0 to 1.0 */
11536 /* rgb color space has r,g,b in the range 0 to 255 */
11537
11538 /**
11539  * Convert a given color from HSV to RGB format.
11540  *
11541  * @param h The Hue component of the color.
11542  * @param s The Saturation component of the color.
11543  * @param v The Value component of the color.
11544  * @param r The Red component of the color.
11545  * @param g The Green component of the color.
11546  * @param b The Blue component of the color.
11547  *
11548  * This function converts a given color in HSV color format to RGB
11549  * color format.
11550  *
11551  * @ingroup Evas_Utils
11552  **/
11553 EAPI void              evas_color_hsv_to_rgb             (float h, float s, float v, int *r, int *g, int *b);
11554
11555 /**
11556  * Convert a given color from RGB to HSV format.
11557  *
11558  * @param r The Red component of the color.
11559  * @param g The Green component of the color.
11560  * @param b The Blue component of the color.
11561  * @param h The Hue component of the color.
11562  * @param s The Saturation component of the color.
11563  * @param v The Value component of the color.
11564  *
11565  * This function converts a given color in RGB color format to HSV
11566  * color format.
11567  *
11568  * @ingroup Evas_Utils
11569  **/
11570 EAPI void              evas_color_rgb_to_hsv             (int r, int g, int b, float *h, float *s, float *v);
11571
11572 /* argb color space has a,r,g,b in the range 0 to 255 */
11573
11574 /**
11575  * Pre-multiplies a rgb triplet by an alpha factor.
11576  *
11577  * @param a The alpha factor.
11578  * @param r The Red component of the color.
11579  * @param g The Green component of the color.
11580  * @param b The Blue component of the color.
11581  *
11582  * This function pre-multiplies a given rbg triplet by an alpha
11583  * factor. Alpha factor is used to define transparency.
11584  *
11585  * @ingroup Evas_Utils
11586  **/
11587 EAPI void              evas_color_argb_premul            (int a, int *r, int *g, int *b);
11588
11589 /**
11590  * Undo pre-multiplication of a rgb triplet by an alpha factor.
11591  *
11592  * @param a The alpha factor.
11593  * @param r The Red component of the color.
11594  * @param g The Green component of the color.
11595  * @param b The Blue component of the color.
11596  *
11597  * This function undoes pre-multiplication a given rbg triplet by an
11598  * alpha factor. Alpha factor is used to define transparency.
11599  *
11600  * @see evas_color_argb_premul().
11601  *
11602  * @ingroup Evas_Utils
11603  **/
11604 EAPI void              evas_color_argb_unpremul          (int a, int *r, int *g, int *b);
11605
11606
11607 /**
11608  * Pre-multiplies data by an alpha factor.
11609  *
11610  * @param data The data value.
11611  * @param len  The length value.
11612  *
11613  * This function pre-multiplies a given data by an alpha
11614  * factor. Alpha factor is used to define transparency.
11615  *
11616  * @ingroup Evas_Utils
11617  **/
11618 EAPI void              evas_data_argb_premul             (unsigned int *data, unsigned int len);
11619
11620 /**
11621  * Undo pre-multiplication data by an alpha factor.
11622  *
11623  * @param data The data value.
11624  * @param len  The length value.
11625  *
11626  * This function undoes pre-multiplication of a given data by an alpha
11627  * factor. Alpha factor is used to define transparency.
11628  *
11629  * @ingroup Evas_Utils
11630  **/
11631 EAPI void              evas_data_argb_unpremul           (unsigned int *data, unsigned int len);
11632
11633 /* string and font handling */
11634
11635 /**
11636  * Gets the next character in the string
11637  *
11638  * Given the UTF-8 string in @p str, and starting byte position in @p pos,
11639  * this function will place in @p decoded the decoded code point at @p pos
11640  * and return the byte index for the next character in the string.
11641  *
11642  * The only boundary check done is that @p pos must be >= 0. Other than that,
11643  * no checks are performed, so passing an index value that's not within the
11644  * length of the string will result in undefined behavior.
11645  *
11646  * @param str The UTF-8 string
11647  * @param pos The byte index where to start
11648  * @param decoded Address where to store the decoded code point. Optional.
11649  *
11650  * @return The byte index of the next character
11651  *
11652  * @ingroup Evas_Utils
11653  */
11654 EAPI int               evas_string_char_next_get         (const char *str, int pos, int *decoded) EINA_ARG_NONNULL(1);
11655
11656 /**
11657  * Gets the previous character in the string
11658  *
11659  * Given the UTF-8 string in @p str, and starting byte position in @p pos,
11660  * this function will place in @p decoded the decoded code point at @p pos
11661  * and return the byte index for the previous character in the string.
11662  *
11663  * The only boundary check done is that @p pos must be >= 1. Other than that,
11664  * no checks are performed, so passing an index value that's not within the
11665  * length of the string will result in undefined behavior.
11666  *
11667  * @param str The UTF-8 string
11668  * @param pos The byte index where to start
11669  * @param decoded Address where to store the decoded code point. Optional.
11670  *
11671  * @return The byte index of the previous character
11672  *
11673  * @ingroup Evas_Utils
11674  */
11675 EAPI int               evas_string_char_prev_get         (const char *str, int pos, int *decoded) EINA_ARG_NONNULL(1);
11676
11677 /**
11678  * Get the length in characters of the string.
11679  * @param  str The string to get the length of.
11680  * @return The length in characters (not bytes)
11681  * @ingroup Evas_Utils
11682  */
11683 EAPI int               evas_string_char_len_get          (const char *str) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
11684
11685 /**
11686  * @defgroup Evas_Keys Key Input Functions
11687  *
11688  * Functions which feed key events to the canvas.
11689  *
11690  * As explained in @ref intro_not_evas, Evas is @b not aware of input
11691  * systems at all. Then, the user, if using it crudely (evas_new()),
11692  * will have to feed it with input events, so that it can react
11693  * somehow. If, however, the user creates a canvas by means of the
11694  * Ecore_Evas wrapper, it will automatically bind the chosen display
11695  * engine's input events to the canvas, for you.
11696  *
11697  * This group presents the functions dealing with the feeding of key
11698  * events to the canvas. On most of them, one has to reference a given
11699  * key by a name (<code>keyname</code> argument). Those are
11700  * <b>platform dependent</b> symbolic names for the keys. Sometimes
11701  * you'll get the right <code>keyname</code> by simply using an ASCII
11702  * value of the key name, but it won't be like that always.
11703  *
11704  * Typical platforms are Linux frame buffer (Ecore_FB) and X server
11705  * (Ecore_X) when using Evas with Ecore and Ecore_Evas. Please refer
11706  * to your display engine's documentation when using evas through an
11707  * Ecore helper wrapper when you need the <code>keyname</code>s.
11708  *
11709  * Example:
11710  * @dontinclude evas-events.c
11711  * @skip mods = evas_key_modifier_get(evas);
11712  * @until {
11713  *
11714  * All the other @c evas_key functions behave on the same manner. See
11715  * the full @ref Example_Evas_Events "example".
11716  *
11717  * @ingroup Evas_Canvas
11718  */
11719
11720 /**
11721  * @addtogroup Evas_Keys
11722  * @{
11723  */
11724
11725 /**
11726  * Returns a handle to the list of modifier keys registered in the
11727  * canvas @p e. This is required to check for which modifiers are set
11728  * at a given time with the evas_key_modifier_is_set() function.
11729  *
11730  * @param e The pointer to the Evas canvas
11731  *
11732  * @see evas_key_modifier_add
11733  * @see evas_key_modifier_del
11734  * @see evas_key_modifier_on
11735  * @see evas_key_modifier_off
11736  * @see evas_key_modifier_is_set
11737  *
11738  * @return An ::Evas_Modifier handle to query Evas' keys subsystem
11739  *      with evas_key_modifier_is_set(), or @c NULL on error.
11740  */
11741 EAPI const Evas_Modifier *evas_key_modifier_get          (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
11742
11743 /**
11744  * Returns a handle to the list of lock keys registered in the canvas
11745  * @p e. This is required to check for which locks are set at a given
11746  * time with the evas_key_lock_is_set() function.
11747  *
11748  * @param e The pointer to the Evas canvas
11749  *
11750  * @see evas_key_lock_add
11751  * @see evas_key_lock_del
11752  * @see evas_key_lock_on
11753  * @see evas_key_lock_off
11754  * @see evas_key_lock_is_set
11755  *
11756  * @return An ::Evas_Lock handle to query Evas' keys subsystem with
11757  *      evas_key_lock_is_set(), or @c NULL on error.
11758  */
11759 EAPI const Evas_Lock     *evas_key_lock_get              (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
11760
11761
11762 /**
11763  * Checks the state of a given modifier key, at the time of the
11764  * call. If the modifier is set, such as shift being pressed, this
11765  * function returns @c Eina_True.
11766  *
11767  * @param m The current modifiers set, as returned by
11768  *        evas_key_modifier_get().
11769  * @param keyname The name of the modifier key to check status for.
11770  *
11771  * @return @c Eina_True if the modifier key named @p keyname is on, @c
11772  *         Eina_False otherwise.
11773  *
11774  * @see evas_key_modifier_add
11775  * @see evas_key_modifier_del
11776  * @see evas_key_modifier_get
11777  * @see evas_key_modifier_on
11778  * @see evas_key_modifier_off
11779  */
11780 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;
11781
11782
11783 /**
11784  * Checks the state of a given lock key, at the time of the call. If
11785  * the lock is set, such as caps lock, this function returns @c
11786  * Eina_True.
11787  *
11788  * @param l The current locks set, as returned by evas_key_lock_get().
11789  * @param keyname The name of the lock key to check status for.
11790  *
11791  * @return @c Eina_True if the @p keyname lock key is set, @c
11792  *        Eina_False otherwise.
11793  *
11794  * @see evas_key_lock_get
11795  * @see evas_key_lock_add
11796  * @see evas_key_lock_del
11797  * @see evas_key_lock_on
11798  * @see evas_key_lock_off
11799  */
11800 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;
11801
11802
11803 /**
11804  * Adds the @p keyname key to the current list of modifier keys.
11805  *
11806  * @param e The pointer to the Evas canvas
11807  * @param keyname The name of the modifier key to add to the list of
11808  *        Evas modifiers.
11809  *
11810  * Modifiers are keys like shift, alt and ctrl, i.e., keys which are
11811  * meant to be pressed together with others, altering the behavior of
11812  * the secondly pressed keys somehow. Evas is so that these keys can
11813  * be user defined.
11814  *
11815  * This call allows custom modifiers to be added to the Evas system at
11816  * run time. It is then possible to set and unset modifier keys
11817  * programmatically for other parts of the program to check and act
11818  * on. Programmers using Evas would check for modifier keys on key
11819  * event callbacks using evas_key_modifier_is_set().
11820  *
11821  * @see evas_key_modifier_del
11822  * @see evas_key_modifier_get
11823  * @see evas_key_modifier_on
11824  * @see evas_key_modifier_off
11825  * @see evas_key_modifier_is_set
11826  *
11827  * @note If the programmer instantiates the canvas by means of the
11828  *       ecore_evas_new() family of helper functions, Ecore will take
11829  *       care of registering on it all standard modifiers: "Shift",
11830  *       "Control", "Alt", "Meta", "Hyper", "Super".
11831  */
11832 EAPI void                 evas_key_modifier_add          (Evas *e, const char *keyname) EINA_ARG_NONNULL(1, 2);
11833
11834 /**
11835  * Removes the @p keyname key from the current list of modifier keys
11836  * on canvas @e.
11837  *
11838  * @param e The pointer to the Evas canvas
11839  * @param keyname The name of the key to remove from the modifiers list.
11840  *
11841  * @see evas_key_modifier_add
11842  * @see evas_key_modifier_get
11843  * @see evas_key_modifier_on
11844  * @see evas_key_modifier_off
11845  * @see evas_key_modifier_is_set
11846  */
11847 EAPI void                 evas_key_modifier_del          (Evas *e, const char *keyname) EINA_ARG_NONNULL(1, 2);
11848
11849 /**
11850  * Adds the @p keyname key to the current list of lock keys.
11851  *
11852  * @param e The pointer to the Evas canvas
11853  * @param keyname The name of the key to add to the locks list.
11854  *
11855  * Locks are keys like caps lock, num lock or scroll lock, i.e., keys
11856  * which are meant to be pressed once -- toggling a binary state which
11857  * is bound to it -- and thus altering the behavior of all
11858  * subsequently pressed keys somehow, depending on its state. Evas is
11859  * so that these keys can be defined by the user.
11860  *
11861  * This allows custom locks to be added to the evas system at run
11862  * time. It is then possible to set and unset lock keys
11863  * programmatically for other parts of the program to check and act
11864  * on. Programmers using Evas would check for lock keys on key event
11865  * callbacks using evas_key_lock_is_set().
11866  *
11867  * @see evas_key_lock_get
11868  * @see evas_key_lock_del
11869  * @see evas_key_lock_on
11870  * @see evas_key_lock_off
11871  * @see evas_key_lock_is_set
11872  *
11873  * @note If the programmer instantiates the canvas by means of the
11874  *       ecore_evas_new() family of helper functions, Ecore will take
11875  *       care of registering on it all standard lock keys: "Caps_Lock",
11876  *       "Num_Lock", "Scroll_Lock".
11877  */
11878 EAPI void                 evas_key_lock_add              (Evas *e, const char *keyname) EINA_ARG_NONNULL(1, 2);
11879
11880 /**
11881  * Removes the @p keyname key from the current list of lock keys on
11882  * canvas @e.
11883  *
11884  * @param e The pointer to the Evas canvas
11885  * @param keyname The name of the key to remove from the locks list.
11886  *
11887  * @see evas_key_lock_get
11888  * @see evas_key_lock_add
11889  * @see evas_key_lock_on
11890  * @see evas_key_lock_off
11891  */
11892 EAPI void                 evas_key_lock_del              (Evas *e, const char *keyname) EINA_ARG_NONNULL(1, 2);
11893
11894
11895 /**
11896  * Enables or turns on programmatically the modifier key with name @p
11897  * keyname.
11898  *
11899  * @param e The pointer to the Evas canvas
11900  * @param keyname The name of the modifier to enable.
11901  *
11902  * The effect will be as if the key was pressed for the whole time
11903  * between this call and a matching evas_key_modifier_off().
11904  *
11905  * @see evas_key_modifier_add
11906  * @see evas_key_modifier_get
11907  * @see evas_key_modifier_off
11908  * @see evas_key_modifier_is_set
11909  */
11910 EAPI void                 evas_key_modifier_on           (Evas *e, const char *keyname) EINA_ARG_NONNULL(1, 2);
11911
11912 /**
11913  * Disables or turns off programmatically the modifier key with name
11914  * @p keyname.
11915  *
11916  * @param e The pointer to the Evas canvas
11917  * @param keyname The name of the modifier to disable.
11918  *
11919  * @see evas_key_modifier_add
11920  * @see evas_key_modifier_get
11921  * @see evas_key_modifier_on
11922  * @see evas_key_modifier_is_set
11923  */
11924 EAPI void                 evas_key_modifier_off          (Evas *e, const char *keyname) EINA_ARG_NONNULL(1, 2);
11925
11926 /**
11927  * Enables or turns on programmatically the lock key with name @p
11928  * keyname.
11929  *
11930  * @param e The pointer to the Evas canvas
11931  * @param keyname The name of the lock to enable.
11932  *
11933  * The effect will be as if the key was put on its active state after
11934  * this call.
11935  *
11936  * @see evas_key_lock_get
11937  * @see evas_key_lock_add
11938  * @see evas_key_lock_del
11939  * @see evas_key_lock_off
11940  */
11941 EAPI void                 evas_key_lock_on               (Evas *e, const char *keyname) EINA_ARG_NONNULL(1, 2);
11942
11943 /**
11944  * Disables or turns off programmatically the lock key with name @p
11945  * keyname.
11946  *
11947  * @param e The pointer to the Evas canvas
11948  * @param keyname The name of the lock to disable.
11949  *
11950  * The effect will be as if the key was put on its inactive state
11951  * after this call.
11952  *
11953  * @see evas_key_lock_get
11954  * @see evas_key_lock_add
11955  * @see evas_key_lock_del
11956  * @see evas_key_lock_on
11957  */
11958 EAPI void                 evas_key_lock_off              (Evas *e, const char *keyname) EINA_ARG_NONNULL(1, 2);
11959
11960
11961 /**
11962  * Creates a bit mask from the @p keyname @b modifier key. Values
11963  * returned from different calls to it may be ORed together,
11964  * naturally.
11965  *
11966  * @param e The canvas whom to query the bit mask from.
11967  * @param keyname The name of the modifier key to create the mask for.
11968  *
11969  * @returns the bit mask or 0 if the @p keyname key wasn't registered as a
11970  *          modifier for canvas @p e.
11971  *
11972  * This function is meant to be using in conjunction with
11973  * evas_object_key_grab()/evas_object_key_ungrab(). Go check their
11974  * documentation for more information.
11975  *
11976  * @see evas_key_modifier_add
11977  * @see evas_key_modifier_get
11978  * @see evas_key_modifier_on
11979  * @see evas_key_modifier_off
11980  * @see evas_key_modifier_is_set
11981  * @see evas_object_key_grab
11982  * @see evas_object_key_ungrab
11983  */
11984 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;
11985
11986
11987 /**
11988  * Requests @p keyname key events be directed to @p obj.
11989  *
11990  * @param obj the object to direct @p keyname events to.
11991  * @param keyname the key to request events for.
11992  * @param modifiers a mask of modifiers that must be present to
11993  * trigger the event.
11994  * @param not_modifiers a mask of modifiers that must @b not be present
11995  * to trigger the event.
11996  * @param exclusive request that the @p obj is the only object
11997  * receiving the @p keyname events.
11998  * @return @c EINA_TRUE, if the call succeeded, @c EINA_FALSE otherwise.
11999  *
12000  * Key grabs allow one or more objects to receive key events for
12001  * specific key strokes even if other objects have focus. Whenever a
12002  * key is grabbed, only the objects grabbing it will get the events
12003  * for the given keys.
12004  *
12005  * @p keyname is a platform dependent symbolic name for the key
12006  * pressed (see @ref Evas_Keys for more information).
12007  *
12008  * @p modifiers and @p not_modifiers are bit masks of all the
12009  * modifiers that must and mustn't, respectively, be pressed along
12010  * with @p keyname key in order to trigger this new key
12011  * grab. Modifiers can be things such as Shift and Ctrl as well as
12012  * user defigned types via evas_key_modifier_add(). Retrieve them with
12013  * evas_key_modifier_mask_get() or use @c 0 for empty masks.
12014  *
12015  * @p exclusive will make the given object the only one permitted to
12016  * grab the given key. If given @c EINA_TRUE, subsequent calls on this
12017  * function with different @p obj arguments will fail, unless the key
12018  * is ungrabbed again.
12019  *
12020  * Example code follows.
12021  * @dontinclude evas-events.c
12022  * @skip if (d.focus)
12023  * @until else
12024  *
12025  * See the full example @ref Example_Evas_Events "here".
12026  *
12027  * @see evas_object_key_ungrab
12028  * @see evas_object_focus_set
12029  * @see evas_object_focus_get
12030  * @see evas_focus_get
12031  * @see evas_key_modifier_add
12032  */
12033 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);
12034
12035 /**
12036  * Removes the grab on @p keyname key events by @p obj.
12037  *
12038  * @param obj the object that has an existing key grab.
12039  * @param keyname the key the grab is set for.
12040  * @param modifiers a mask of modifiers that must be present to
12041  * trigger the event.
12042  * @param not_modifiers a mask of modifiers that must not not be
12043  * present to trigger the event.
12044  *
12045  * Removes a key grab on @p obj if @p keyname, @p modifiers, and @p
12046  * not_modifiers match.
12047  *
12048  * Example code follows.
12049  * @dontinclude evas-events.c
12050  * @skip got here by key grabs
12051  * @until }
12052  *
12053  * See the full example @ref Example_Evas_Events "here".
12054  *
12055  * @see evas_object_key_grab
12056  * @see evas_object_focus_set
12057  * @see evas_object_focus_get
12058  * @see evas_focus_get
12059  */
12060 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);
12061
12062 /**
12063  * @}
12064  */
12065
12066 #ifdef __cplusplus
12067 }
12068 #endif
12069
12070 #endif