update all versions in @sincs, README's and configure.ac's etc. to
[framework/uifw/evas.git] / src / lib / Evas.h
1 /**
2    @mainpage Evas
3
4    @version 1.2
5    @date 2000-2012
6
7    Please see the @ref authors page for contact details.
8    @link Evas.h Evas API @endlink
9
10    @link Evas.h Evas API @endlink
11
12    @section toc Table of Contents
13
14    @li @ref intro
15    @li @ref work
16    @li @ref compiling
17    @li @ref install
18    @li @ref next_steps
19    @li @ref intro_example
20
21
22    @section intro What is Evas?
23
24    Evas is a clean display canvas API for several target display systems
25    that can draw anti-aliased text, smooth super and sub-sampled scaled
26    images, alpha-blend objects and much more.
27
28    It abstracts any need to know much about what the characteristics of
29    your display system are or what graphics calls are used to draw them
30    and how. It deals on an object level where all you do is create and
31    manipulate objects in a canvas, set their properties, and the rest is
32    done for you.
33
34    Evas optimises the rendering pipeline to minimise effort in redrawing
35    changes made to the canvas and so takes this work out of the
36    programmers hand, saving a lot of time and energy.
37
38    It's small and lean, designed to work on embedded systems all the way
39    to large and powerful multi-cpu workstations. It can be compiled to
40    only have the features you need for your target platform if you so
41    wish, thus keeping it small and lean. It has several display
42    back-ends, letting it display on several display systems, making it
43    portable for cross-device and cross-platform development.
44
45    @subsection intro_not_evas What Evas is not?
46
47    Evas is not a widget set or widget toolkit, however it is their
48    base. See Elementary (http://docs.enlightenment.org/auto/elementary/)
49    for a toolkit based on Evas, Edje, Ecore and other Enlightenment
50    technologies.
51
52    It is not dependent or aware of main loops, input or output
53    systems. Input should be polled from various sources and fed to
54    Evas. Similarly, it will not create windows or report windows updates
55    to your system, rather just drawing the pixels and reporting to the
56    user the areas that were changed. Of course these operations are quite
57    common and thus they are ready to use in Ecore, particularly in
58    Ecore_Evas (http://docs.enlightenment.org/auto/ecore/).
59
60
61    @section work How does Evas work?
62
63    Evas is a canvas display library. This is markedly different from most
64    display and windowing systems as a canvas is structural and is also a
65    state engine, whereas most display and windowing systems are immediate
66    mode display targets. Evas handles the logic between a structural
67    display via its state engine, and controls the target windowing system
68    in order to produce rendered results of the current canvas' state on
69    the display.
70
71    Immediate mode display systems retain very little, or no state. A
72    program will execute a series of commands, as in the pseudo code:
73
74    @verbatim
75    draw line from position (0, 0) to position (100, 200);
76
77    draw rectangle from position (10, 30) to position (50, 500);
78
79    bitmap_handle = create_bitmap();
80    scale bitmap_handle to size 100 x 100;
81    draw image bitmap_handle at position (10, 30);
82    @endverbatim
83
84    The series of commands is executed by the windowing system and the
85    results are displayed on the screen (normally). Once the commands are
86    executed the display system has little or no idea of how to reproduce
87    this image again, and so has to be instructed by the application how
88    to redraw sections of the screen whenever needed. Each successive
89    command will be executed as instructed by the application and either
90    emulated by software or sent to the graphics hardware on the device to
91    be performed.
92
93    The advantage of such a system is that it is simple, and gives a
94    program tight control over how something looks and is drawn. Given the
95    increasing complexity of displays and demands by users to have better
96    looking interfaces, more and more work is needing to be done at this
97    level by the internals of widget sets, custom display widgets and
98    other programs. This means more and more logic and display rendering
99    code needs to be written time and time again, each time the
100    application needs to figure out how to minimise redraws so that
101    display is fast and interactive, and keep track of redraw logic. The
102    power comes at a high-price, lots of extra code and work.  Programmers
103    not very familiar with graphics programming will often make mistakes
104    at this level and produce code that is sub optimal. Those familiar
105    with this kind of programming will simply get bored by writing the
106    same code again and again.
107
108    For example, if in the above scene, the windowing system requires the
109    application to redraw the area from 0, 0 to 50, 50 (also referred as
110    "expose event"), then the programmer must calculate manually the
111    updates and repaint it again:
112
113    @verbatim
114    Redraw from position (0, 0) to position (50, 50):
115
116    // what was in area (0, 0, 50, 50)?
117
118    // 1. intersection part of line (0, 0) to (100, 200)?
119       draw line from position (0, 0) to position (25, 50);
120
121    // 2. intersection part of rectangle (10, 30) to (50, 500)?
122       draw rectangle from position (10, 30) to position (50, 50)
123
124    // 3. intersection part of image at (10, 30), size 100 x 100?
125       bitmap_subimage = subregion from position (0, 0) to position (40, 20)
126       draw image bitmap_subimage at position (10, 30);
127    @endverbatim
128
129    The clever reader might have noticed that, if all elements in the
130    above scene are opaque, then the system is doing useless paints: part
131    of the line is behind the rectangle, and part of the rectangle is
132    behind the image. These useless paints tend to be very costly, as
133    pixels tend to be 4 bytes in size, thus an overlapping region of 100 x
134    100 pixels is around 40000 useless writes! The developer could write
135    code to calculate the overlapping areas and avoid painting then, but
136    then it should be mixed with the "expose event" handling mentioned
137    above and quickly one realizes the initially simpler method became
138    really complex.
139
140    Evas is a structural system in which the programmer creates and
141    manages display objects and their properties, and as a result of this
142    higher level state management, the canvas is able to redraw the set of
143    objects when needed to represent the current state of the canvas.
144
145    For example, the pseudo code:
146
147    @verbatim
148    line_handle = create_line();
149    set line_handle from position (0, 0) to position (100, 200);
150    show line_handle;
151
152    rectangle_handle = create_rectangle();
153    move rectangle_handle to position (10, 30);
154    resize rectangle_handle to size 40 x 470;
155    show rectangle_handle;
156
157    bitmap_handle = create_bitmap();
158    scale bitmap_handle to size 100 x 100;
159    move bitmap_handle to position (10, 30);
160    show bitmap_handle;
161
162    render scene;
163    @endverbatim
164
165    This may look longer, but when the display needs to be refreshed or
166    updated, the programmer only moves, resizes, shows, hides etc. the
167    objects that need to change. The programmer simply thinks at the
168    object logic level, and the canvas software does the rest of the work
169    for them, figuring out what actually changed in the canvas since it
170    was last drawn, how to most efficiently redraw the canvas and its
171    contents to reflect the current state, and then it can go off and do
172    the actual drawing of the canvas.
173
174    This lets the programmer think in a more natural way when dealing with
175    a display, and saves time and effort of working out how to load and
176    display images, render given the current display system etc. Since
177    Evas also is portable across different display systems, this also
178    gives the programmer the ability to have their code ported and
179    displayed on different display systems with very little work.
180
181    Evas can be seen as a display system that stands somewhere between a
182    widget set and an immediate mode display system. It retains basic
183    display logic, but does very little high-level logic such as
184    scrollbars, sliders, push buttons etc.
185
186
187    @section compiling How to compile using Evas ?
188
189    Evas is a library your application links to. The procedure for this is
190    very simple. You simply have to compile your application with the
191    appropriate compiler flags that the @c pkg-config script outputs. For
192    example:
193
194    Compiling C or C++ files into object files:
195
196    @verbatim
197    gcc -c -o main.o main.c `pkg-config --cflags evas`
198    @endverbatim
199
200    Linking object files into a binary executable:
201
202    @verbatim
203    gcc -o my_application main.o `pkg-config --libs evas`
204    @endverbatim
205
206    You simply have to make sure that @c pkg-config is in your shell's @c
207    PATH (see the manual page for your appropriate shell) and @c evas.pc
208    in @c /usr/lib/pkgconfig or its path in the @c PKG_CONFIG_PATH
209    environment variable. It's that simple to link and use Evas once you
210    have written your code to use it.
211
212    Since the program is linked to Evas, it is now able to use any
213    advertised API calls to display graphics in a canvas managed by it, as
214    well as use the API calls provided to manage data.
215
216    You should make sure you add any extra compile and link flags to your
217    compile commands that your application may need as well. The above
218    example is only guaranteed to make Evas add it's own requirements.
219
220
221    @section install How is it installed?
222
223    Simple:
224
225    @verbatim
226    ./configure
227    make
228    su -
229    ...
230    make install
231    @endverbatim
232
233    @section next_steps Next Steps
234
235    After you understood what Evas is and installed it in your system you
236    should proceed understanding the programming interface for all
237    objects, then see the specific for the most used elements. We'd
238    recommend you to take a while to learn Ecore
239    (http://docs.enlightenment.org/auto/ecore/) and Edje
240    (http://docs.enlightenment.org/auto/edje/) as they will likely save
241    you tons of work compared to using just Evas directly.
242
243    Recommended reading:
244
245    @li @ref Evas_Object_Group, where you'll get how to basically
246     manipulate generic objects lying on an Evas canvas, handle canvas
247     and object events, etc.
248    @li @ref Evas_Object_Rectangle, to learn about the most basic object
249     type on Evas -- the rectangle.
250    @li @ref Evas_Object_Polygon, to learn how to create polygon elements
251     on the canvas.
252    @li @ref Evas_Line_Group, to learn how to create line elements on the
253     canvas.
254    @li @ref Evas_Object_Image, to learn about image objects, over which
255     Evas can do a plethora of operations.
256    @li @ref Evas_Object_Text, to learn how to create textual elements on
257     the canvas.
258    @li @ref Evas_Object_Textblock, to learn how to create multiline
259     textual elements on the canvas.
260    @li @ref Evas_Smart_Object_Group and @ref Evas_Smart_Group, to define
261     new objects that provide @b custom functions to handle clipping,
262     hiding, moving, resizing, color setting and more. These could
263     be as simple as a group of objects that move together (see @ref
264     Evas_Smart_Object_Clipped) up to implementations of what
265     ends to be a widget, providing some intelligence (thus the name)
266     to Evas objects -- like a button or check box, for example.
267
268    @section intro_example Introductory Example
269
270    @include evas-buffer-simple.c
271  */
272
273 /**
274    @page authors Authors
275    @author Carsten Haitzler <raster@@rasterman.com>
276    @author Till Adam <till@@adam-lilienthal.de>
277    @author Steve Ireland <sireland@@pobox.com>
278    @author Brett Nash <nash@@nash.id.au>
279    @author Tilman Sauerbeck <tilman@@code-monkey.de>
280    @author Corey Donohoe <atmos@@atmos.org>
281    @author Yuri Hudobin <glassy_ape@@users.sourceforge.net>
282    @author Nathan Ingersoll <ningerso@@d.umn.edu>
283    @author Willem Monsuwe <willem@@stack.nl>
284    @author Jose O Gonzalez <jose_ogp@@juno.com>
285    @author Bernhard Nemec <Bernhard.Nemec@@viasyshc.com>
286    @author Jorge Luis Zapata Muga <jorgeluis.zapata@@gmail.com>
287    @author Cedric Bail <cedric.bail@@free.fr>
288    @author Gustavo Sverzut Barbieri <barbieri@@profusion.mobi>
289    @author Vincent Torri <vtorri@@univ-evry.fr>
290    @author Tim Horton <hortont424@@gmail.com>
291    @author Tom Hacohen <tom@@stosb.com>
292    @author Mathieu Taillefumier <mathieu.taillefumier@@free.fr>
293    @author Iván Briano <ivan@@profusion.mobi>
294    @author Gustavo Lima Chaves <glima@@profusion.mobi>
295    @author Samsung Electronics
296    @author Samsung SAIT
297    @author Sung W. Park <sungwoo@@gmail.com>
298    @author Jiyoun Park <jy0703.park@@samsung.com>
299    @author Myoungwoon Roy Kim(roy_kim) <myoungwoon.kim@@samsung.com> <myoungwoon@@gmail.com>
300    @author Thierry el Borgi <thierry@@substantiel.fr>
301    @author Shilpa Singh <shilpa.singh@@samsung.com> <shilpasingh.o@@gmail.com>
302    @author ChunEon Park <hermet@@hermet.pe.kr>
303    @author Christopher 'devilhorns' Michael <cpmichael1@@comcast.net>
304    @author Seungsoo Woo <om101.woo@@samsung.com>
305    @author Youness Alaoui <kakaroto@@kakaroto.homelinux.net>
306    @author Jim Kukunas <james.t.kukunas@@linux.intel.com>
307    @author Nicolas Aguirre <aguirre.nicolas@@gmail.com>
308    @author Rafal Krypa <r.krypa@@samsung.com>
309    @author Hyoyoung Chang <hyoyoung@@gmail.com>
310    @author Jérôme Pinot <ngc891@@gmail.com>
311    @author Rafael Antognolli <antognolli@@profusion.mobi>
312
313    Please contact <enlightenment-devel@lists.sourceforge.net> to get in
314    contact with the developers and maintainers.
315  */
316
317 #ifndef _EVAS_H
318 #define _EVAS_H
319
320 #include <time.h>
321
322 #include <Eina.h>
323
324 #ifdef EAPI
325 # undef EAPI
326 #endif
327
328 #ifdef _WIN32
329 # ifdef EFL_EVAS_BUILD
330 #  ifdef DLL_EXPORT
331 #   define EAPI __declspec(dllexport)
332 #  else
333 #   define EAPI
334 #  endif /* ! DLL_EXPORT */
335 # else
336 #  define EAPI __declspec(dllimport)
337 # endif /* ! EFL_EVAS_BUILD */
338 #else
339 # ifdef __GNUC__
340 #  if __GNUC__ >= 4
341 #   define EAPI __attribute__ ((visibility("default")))
342 #  else
343 #   define EAPI
344 #  endif
345 # else
346 #  define EAPI
347 # endif
348 #endif /* ! _WIN32 */
349
350 #ifdef __cplusplus
351 extern "C" {
352 #endif
353
354 #define EVAS_VERSION_MAJOR 1
355 #define EVAS_VERSION_MINOR 2
356
357 typedef struct _Evas_Version
358 {
359    int major;
360    int minor;
361    int micro;
362    int revision;
363 } Evas_Version;
364
365 EAPI extern Evas_Version * evas_version;
366
367 /**
368  * @file
369  * @brief These routines are used for Evas library interaction.
370  *
371  * @todo check boolean return values and convert to Eina_Bool
372  * @todo change all api to use EINA_SAFETY_*
373  * @todo finish api documentation
374  */
375
376 /* BiDi exposed stuff */
377 /*FIXME: document */
378 typedef enum _Evas_BiDi_Direction
379 {
380    EVAS_BIDI_DIRECTION_NATURAL,
381    EVAS_BIDI_DIRECTION_NEUTRAL = EVAS_BIDI_DIRECTION_NATURAL,
382    EVAS_BIDI_DIRECTION_LTR,
383    EVAS_BIDI_DIRECTION_RTL
384 } Evas_BiDi_Direction;
385
386 /**
387  * Identifier of callbacks to be set for Evas canvases or Evas
388  * objects.
389  *
390  * The following figure illustrates some Evas callbacks:
391  *
392  * @image html evas-callbacks.png
393  * @image rtf evas-callbacks.png
394  * @image latex evas-callbacks.eps
395  *
396  * @see evas_object_event_callback_add()
397  * @see evas_event_callback_add()
398  */
399 typedef enum _Evas_Callback_Type
400 {
401    /*
402     * The following events are only for use with Evas objects, with
403     * evas_object_event_callback_add():
404     */
405    EVAS_CALLBACK_MOUSE_IN, /**< Mouse In Event */
406    EVAS_CALLBACK_MOUSE_OUT, /**< Mouse Out Event */
407    EVAS_CALLBACK_MOUSE_DOWN, /**< Mouse Button Down Event */
408    EVAS_CALLBACK_MOUSE_UP, /**< Mouse Button Up Event */
409    EVAS_CALLBACK_MOUSE_MOVE, /**< Mouse Move Event */
410    EVAS_CALLBACK_MOUSE_WHEEL, /**< Mouse Wheel Event */
411    EVAS_CALLBACK_MULTI_DOWN, /**< Multi-touch Down Event */
412    EVAS_CALLBACK_MULTI_UP, /**< Multi-touch Up Event */
413    EVAS_CALLBACK_MULTI_MOVE, /**< Multi-touch Move Event */
414    EVAS_CALLBACK_FREE, /**< Object Being Freed (Called after Del) */
415    EVAS_CALLBACK_KEY_DOWN, /**< Key Press Event */
416    EVAS_CALLBACK_KEY_UP, /**< Key Release Event */
417    EVAS_CALLBACK_FOCUS_IN, /**< Focus In Event */
418    EVAS_CALLBACK_FOCUS_OUT, /**< Focus Out Event */
419    EVAS_CALLBACK_SHOW, /**< Show Event */
420    EVAS_CALLBACK_HIDE, /**< Hide Event */
421    EVAS_CALLBACK_MOVE, /**< Move Event */
422    EVAS_CALLBACK_RESIZE, /**< Resize Event */
423    EVAS_CALLBACK_RESTACK, /**< Restack Event */
424    EVAS_CALLBACK_DEL, /**< Object Being Deleted (called before Free) */
425    EVAS_CALLBACK_HOLD, /**< Events go on/off hold */
426    EVAS_CALLBACK_CHANGED_SIZE_HINTS, /**< Size hints changed event */
427    EVAS_CALLBACK_IMAGE_PRELOADED, /**< Image has been preloaded */
428
429    /*
430     * The following events are only for use with Evas canvases, with
431     * evas_event_callback_add():
432     */
433    EVAS_CALLBACK_CANVAS_FOCUS_IN, /**< Canvas got focus as a whole */
434    EVAS_CALLBACK_CANVAS_FOCUS_OUT, /**< Canvas lost focus as a whole */
435    EVAS_CALLBACK_RENDER_FLUSH_PRE, /**< Called just before rendering is updated on the canvas target */
436    EVAS_CALLBACK_RENDER_FLUSH_POST, /**< Called just after rendering is updated on the canvas target */
437    EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_IN, /**< Canvas object got focus */
438    EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_OUT, /**< Canvas object lost focus */
439
440    /*
441     * More Evas object event types - see evas_object_event_callback_add():
442     */
443    EVAS_CALLBACK_IMAGE_UNLOADED, /**< Image data has been unloaded (by some mechanism in Evas that throw out original image data) */
444
445    EVAS_CALLBACK_RENDER_PRE, /**< Called just before rendering starts on the canvas target @since 1.2 */
446    EVAS_CALLBACK_RENDER_POST, /**< Called just after rendering stops on the canvas target @since 1.2 */
447
448    EVAS_CALLBACK_LAST /**< kept as last element/sentinel -- not really an event */
449 } Evas_Callback_Type; /**< The types of events triggering a callback */
450
451 /**
452  * @def EVAS_CALLBACK_PRIORITY_BEFORE
453  * Slightly more prioritized than default.
454  * @since 1.1
455  */
456 #define EVAS_CALLBACK_PRIORITY_BEFORE  -100
457 /**
458  * @def EVAS_CALLBACK_PRIORITY_DEFAULT
459  * Default callback priority level
460  * @since 1.1
461  */
462 #define EVAS_CALLBACK_PRIORITY_DEFAULT 0
463 /**
464  * @def EVAS_CALLBACK_PRIORITY_AFTER
465  * Slightly less prioritized than default.
466  * @since 1.1
467  */
468 #define EVAS_CALLBACK_PRIORITY_AFTER   100
469
470 /**
471  * @typedef Evas_Callback_Priority
472  *
473  * Callback priority value. Range is -32k - 32k. The lower the number, the
474  * bigger the priority.
475  *
476  * @see EVAS_CALLBACK_PRIORITY_AFTER
477  * @see EVAS_CALLBACK_PRIORITY_BEFORE
478  * @see EVAS_CALLBACK_PRIORITY_DEFAULT
479  *
480  * @since 1.1
481  */
482 typedef short Evas_Callback_Priority;
483
484 /**
485  * Flags for Mouse Button events
486  */
487 typedef enum _Evas_Button_Flags
488 {
489    EVAS_BUTTON_NONE = 0, /**< No extra mouse button data */
490    EVAS_BUTTON_DOUBLE_CLICK = (1 << 0), /**< This mouse button press was the 2nd press of a double click */
491    EVAS_BUTTON_TRIPLE_CLICK = (1 << 1) /**< This mouse button press was the 3rd press of a triple click */
492 } Evas_Button_Flags; /**< Flags for Mouse Button events */
493
494 /**
495  * Flags for Events
496  */
497 typedef enum _Evas_Event_Flags
498 {
499    EVAS_EVENT_FLAG_NONE = 0, /**< No fancy flags set */
500    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 */
501    EVAS_EVENT_FLAG_ON_SCROLL = (1 << 1) /**< This event flag indicates the event occurs while scrolling; for example, DOWN event occurs during scrolling; the event should be used for informational purposes and maybe some indications visually, but not actually perform anything */
502 } Evas_Event_Flags; /**< Flags for Events */
503
504 /**
505  * State of Evas_Coord_Touch_Point
506  */
507 typedef enum _Evas_Touch_Point_State
508 {
509    EVAS_TOUCH_POINT_DOWN, /**< Touch point is pressed down */
510    EVAS_TOUCH_POINT_UP, /**< Touch point is released */
511    EVAS_TOUCH_POINT_MOVE, /**< Touch point is moved */
512    EVAS_TOUCH_POINT_STILL, /**< Touch point is not moved after pressed */
513    EVAS_TOUCH_POINT_CANCEL /**< Touch point is cancelled */
514 } Evas_Touch_Point_State;
515
516 /**
517  * Flags for Font Hinting
518  * @ingroup Evas_Font_Group
519  */
520 typedef enum _Evas_Font_Hinting_Flags
521 {
522    EVAS_FONT_HINTING_NONE, /**< No font hinting */
523    EVAS_FONT_HINTING_AUTO, /**< Automatic font hinting */
524    EVAS_FONT_HINTING_BYTECODE /**< Bytecode font hinting */
525 } Evas_Font_Hinting_Flags; /**< Flags for Font Hinting */
526
527 /**
528  * Colorspaces for pixel data supported by Evas
529  * @ingroup Evas_Object_Image
530  */
531 typedef enum _Evas_Colorspace
532 {
533    EVAS_COLORSPACE_ARGB8888, /**< ARGB 32 bits per pixel, high-byte is Alpha, accessed 1 32bit word at a time */
534    /* these are not currently supported - but planned for the future */
535    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 */
536    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 */
537    EVAS_COLORSPACE_RGB565_A5P, /**< 16bit rgb565 + Alpha plane at end - 5 bits of the 8 being used per alpha byte */
538    EVAS_COLORSPACE_GRY8, /**< 8bit grayscale */
539    EVAS_COLORSPACE_YCBCR422601_PL, /**<  YCbCr 4:2:2, ITU.BT-601 specifications. The data pointed to is just an array of row pointer, pointing to line of Y,Cb,Y,Cr bytes */
540    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. */
541    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. */
542 } Evas_Colorspace; /**< Colorspaces for pixel data supported by Evas */
543
544 /**
545  * How to pack items into cells in a table.
546  * @ingroup Evas_Object_Table
547  *
548  * @see evas_object_table_homogeneous_set() for an explanation of the function of
549  * each one.
550  */
551 typedef enum _Evas_Object_Table_Homogeneous_Mode
552 {
553    EVAS_OBJECT_TABLE_HOMOGENEOUS_NONE = 0,
554    EVAS_OBJECT_TABLE_HOMOGENEOUS_TABLE = 1,
555    EVAS_OBJECT_TABLE_HOMOGENEOUS_ITEM = 2
556 } Evas_Object_Table_Homogeneous_Mode; /**< Table cell pack mode. */
557
558 typedef struct _Evas_Coord_Rectangle       Evas_Coord_Rectangle; /**< A generic rectangle handle */
559 typedef struct _Evas_Point                 Evas_Point;   /**< integer point */
560
561 typedef struct _Evas_Coord_Point           Evas_Coord_Point;    /**< Evas_Coord point */
562 typedef struct _Evas_Coord_Precision_Point Evas_Coord_Precision_Point;   /**< Evas_Coord point with sub-pixel precision */
563
564 typedef struct _Evas_Position              Evas_Position;   /**< associates given point in Canvas and Output */
565 typedef struct _Evas_Precision_Position    Evas_Precision_Position;   /**< associates given point in Canvas and Output, with sub-pixel precision */
566
567 /**
568  * @typedef Evas_Smart_Class
569  *
570  * A smart object's @b base class definition
571  *
572  * @ingroup Evas_Smart_Group
573  */
574 typedef struct _Evas_Smart_Class Evas_Smart_Class;
575
576 /**
577  * @typedef Evas_Smart_Interface
578  *
579  * A smart object's @b base interface definition
580  *
581  * An Evas interface is exactly like the OO-concept: an 'contract' or
582  * API a given object is declared to support. A smart object may have
583  * more than one interface, thus extending the behavior it gets from
584  * sub-classing.
585  *
586  * @since 1.7
587  *
588  * @ingroup Evas_Smart_Group
589  */
590 typedef struct _Evas_Smart_Interface         Evas_Smart_Interface;
591
592 /**
593  * @typedef Evas_Smart_Cb_Description
594  *
595  * A smart object callback description, used to provide introspection
596  *
597  * @ingroup Evas_Smart_Group
598  */
599 typedef struct _Evas_Smart_Cb_Description Evas_Smart_Cb_Description;
600
601 /**
602  * @typedef Evas_Map
603  *
604  * An opaque handle to map points
605  *
606  * @see evas_map_new()
607  * @see evas_map_free()
608  * @see evas_map_dup()
609  *
610  * @ingroup Evas_Object_Group_Map
611  */
612 typedef struct _Evas_Map Evas_Map;
613
614 /**
615  * @typedef Evas
616  *
617  * An opaque handle to an Evas canvas.
618  *
619  * @see evas_new()
620  * @see evas_free()
621  *
622  * @ingroup Evas_Canvas
623  */
624 typedef struct _Evas Evas;
625
626 /**
627  * @typedef Evas_Object
628  * An Evas Object handle.
629  * @ingroup Evas_Object_Group
630  */
631 typedef struct _Evas_Object         Evas_Object;
632
633 typedef void                        Evas_Performance; /**< An Evas Performance handle */
634 typedef struct _Evas_Modifier       Evas_Modifier; /**< An opaque type containing information on which modifier keys are registered in an Evas canvas */
635 typedef struct _Evas_Lock           Evas_Lock; /**< An opaque type containing information on which lock keys are registered in an Evas canvas */
636 typedef struct _Evas_Smart          Evas_Smart; /**< An Evas Smart Object handle */
637 typedef struct _Evas_Native_Surface Evas_Native_Surface; /**< A generic datatype for engine specific native surface information */
638
639 /**
640  * @typedef Evas_Video_Surface
641  *
642  * A generic datatype for video specific surface information
643  * @see evas_object_image_video_surface_set
644  * @see evas_object_image_video_surface_get
645  * @since 1.1
646  */
647 typedef struct _Evas_Video_Surface Evas_Video_Surface;
648
649 typedef unsigned long long         Evas_Modifier_Mask;  /**< An Evas modifier mask type */
650
651 typedef int                        Evas_Coord;
652 typedef int                        Evas_Font_Size;
653 typedef int                        Evas_Angle;
654
655 struct _Evas_Coord_Rectangle /**< A rectangle in Evas_Coord */
656 {
657    Evas_Coord x; /**< top-left x co-ordinate of rectangle */
658    Evas_Coord y; /**< top-left y co-ordinate of rectangle */
659    Evas_Coord w; /**< width of rectangle */
660    Evas_Coord h; /**< height of rectangle */
661 };
662
663 struct _Evas_Point
664 {
665    int x, y;
666 };
667
668 struct _Evas_Coord_Point
669 {
670    Evas_Coord x, y;
671 };
672
673 struct _Evas_Coord_Precision_Point
674 {
675    Evas_Coord x, y;
676    double     xsub, ysub;
677 };
678
679 struct _Evas_Position
680 {
681    Evas_Point       output;
682    Evas_Coord_Point canvas;
683 };
684
685 struct _Evas_Precision_Position
686 {
687    Evas_Point                 output;
688    Evas_Coord_Precision_Point canvas;
689 };
690
691 typedef enum _Evas_Aspect_Control
692 {
693    EVAS_ASPECT_CONTROL_NONE = 0, /**< Preference on scaling unset */
694    EVAS_ASPECT_CONTROL_NEITHER = 1, /**< Same effect as unset preference on scaling */
695    EVAS_ASPECT_CONTROL_HORIZONTAL = 2, /**< Use all horizontal container space to place an object, using the given aspect */
696    EVAS_ASPECT_CONTROL_VERTICAL = 3, /**< Use all vertical container space to place an object, using the given aspect */
697    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 */
698 } Evas_Aspect_Control; /**< Aspect types/policies for scaling size hints, used for evas_object_size_hint_aspect_set() */
699
700 typedef struct _Evas_Pixel_Import_Source Evas_Pixel_Import_Source; /**< A source description of pixels for importing pixels */
701 typedef struct _Evas_Engine_Info         Evas_Engine_Info; /**< A generic Evas Engine information structure */
702 typedef struct _Evas_Device              Evas_Device; /**< A source device handle - where the event came from */
703 typedef struct _Evas_Event_Mouse_Down    Evas_Event_Mouse_Down; /**< Event structure for #EVAS_CALLBACK_MOUSE_DOWN event callbacks */
704 typedef struct _Evas_Event_Mouse_Up      Evas_Event_Mouse_Up; /**< Event structure for #EVAS_CALLBACK_MOUSE_UP event callbacks */
705 typedef struct _Evas_Event_Mouse_In      Evas_Event_Mouse_In; /**< Event structure for #EVAS_CALLBACK_MOUSE_IN event callbacks */
706 typedef struct _Evas_Event_Mouse_Out     Evas_Event_Mouse_Out; /**< Event structure for #EVAS_CALLBACK_MOUSE_OUT event callbacks */
707 typedef struct _Evas_Event_Mouse_Move    Evas_Event_Mouse_Move; /**< Event structure for #EVAS_CALLBACK_MOUSE_MOVE event callbacks */
708 typedef struct _Evas_Event_Mouse_Wheel   Evas_Event_Mouse_Wheel; /**< Event structure for #EVAS_CALLBACK_MOUSE_WHEEL event callbacks */
709 typedef struct _Evas_Event_Multi_Down    Evas_Event_Multi_Down; /**< Event structure for #EVAS_CALLBACK_MULTI_DOWN event callbacks */
710 typedef struct _Evas_Event_Multi_Up      Evas_Event_Multi_Up; /**< Event structure for #EVAS_CALLBACK_MULTI_UP event callbacks */
711 typedef struct _Evas_Event_Multi_Move    Evas_Event_Multi_Move; /**< Event structure for #EVAS_CALLBACK_MULTI_MOVE event callbacks */
712 typedef struct _Evas_Event_Key_Down      Evas_Event_Key_Down; /**< Event structure for #EVAS_CALLBACK_KEY_DOWN event callbacks */
713 typedef struct _Evas_Event_Key_Up        Evas_Event_Key_Up; /**< Event structure for #EVAS_CALLBACK_KEY_UP event callbacks */
714 typedef struct _Evas_Event_Hold          Evas_Event_Hold; /**< Event structure for #EVAS_CALLBACK_HOLD event callbacks */
715
716 typedef enum _Evas_Load_Error
717 {
718    EVAS_LOAD_ERROR_NONE = 0, /**< No error on load */
719    EVAS_LOAD_ERROR_GENERIC = 1, /**< A non-specific error occurred */
720    EVAS_LOAD_ERROR_DOES_NOT_EXIST = 2, /**< File (or file path) does not exist */
721    EVAS_LOAD_ERROR_PERMISSION_DENIED = 3, /**< Permission denied to an existing file (or path) */
722    EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED = 4, /**< Allocation of resources failure prevented load */
723    EVAS_LOAD_ERROR_CORRUPT_FILE = 5, /**< File corrupt (but was detected as a known format) */
724    EVAS_LOAD_ERROR_UNKNOWN_FORMAT = 6 /**< File is not a known format */
725 } Evas_Load_Error; /**< Evas image load error codes one can get - see evas_load_error_str() too. */
726
727 typedef enum _Evas_Alloc_Error
728 {
729    EVAS_ALLOC_ERROR_NONE = 0, /**< No allocation error */
730    EVAS_ALLOC_ERROR_FATAL = 1, /**< Allocation failed despite attempts to free up memory */
731    EVAS_ALLOC_ERROR_RECOVERED = 2 /**< Allocation succeeded, but extra memory had to be found by freeing up speculative resources */
732 } Evas_Alloc_Error; /**< Possible allocation errors returned by evas_alloc_error() */
733
734 typedef enum _Evas_Fill_Spread
735 {
736    EVAS_TEXTURE_REFLECT = 0, /**< image fill tiling mode - tiling reflects */
737    EVAS_TEXTURE_REPEAT = 1, /**< tiling repeats */
738    EVAS_TEXTURE_RESTRICT = 2, /**< tiling clamps - range offset ignored */
739    EVAS_TEXTURE_RESTRICT_REFLECT = 3, /**< tiling clamps and any range offset reflects */
740    EVAS_TEXTURE_RESTRICT_REPEAT = 4, /**< tiling clamps and any range offset repeats */
741    EVAS_TEXTURE_PAD = 5 /**< tiling extends with end values */
742 } Evas_Fill_Spread; /**< Fill types used for evas_object_image_fill_spread_set() */
743
744 typedef enum _Evas_Pixel_Import_Pixel_Format
745 {
746    EVAS_PIXEL_FORMAT_NONE = 0, /**< No pixel format */
747    EVAS_PIXEL_FORMAT_ARGB32 = 1, /**< ARGB 32bit pixel format with A in the high byte per 32bit pixel word */
748    EVAS_PIXEL_FORMAT_YUV420P_601 = 2 /**< YUV 420 Planar format with CCIR 601 color encoding with contiguous planes in the order Y, U and V */
749 } Evas_Pixel_Import_Pixel_Format; /**< Pixel format for import call. See evas_object_image_pixels_import() */
750
751 struct _Evas_Pixel_Import_Source
752 {
753    Evas_Pixel_Import_Pixel_Format format; /**< pixel format type ie ARGB32, YUV420P_601 etc. */
754    int                            w, h; /**< width and height of source in pixels */
755    void                         **rows; /**< an array of pointers (size depends on format) pointing to left edge of each scanline */
756 };
757
758 /* magic version number to know what the native surf struct looks like */
759 #define EVAS_NATIVE_SURFACE_VERSION 2
760
761 typedef enum _Evas_Native_Surface_Type
762 {
763    EVAS_NATIVE_SURFACE_NONE,
764    EVAS_NATIVE_SURFACE_X11,
765    EVAS_NATIVE_SURFACE_OPENGL
766 } Evas_Native_Surface_Type;
767
768 struct _Evas_Native_Surface
769 {
770    int                      version;
771    Evas_Native_Surface_Type type;
772    union {
773       struct
774       {
775          void         *visual; /**< visual of the pixmap to use (Visual) */
776          unsigned long pixmap; /**< pixmap id to use (Pixmap) */
777       } x11;
778       struct
779       {
780          unsigned int texture_id; /**< opengl texture id to use from glGenTextures() */
781          unsigned int framebuffer_id; /**< 0 if not a FBO, FBO id otherwise from glGenFramebuffers() */
782          unsigned int internal_format; /**< same as 'internalFormat' for glTexImage2D() */
783          unsigned int format; /**< same as 'format' for glTexImage2D() */
784          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) */
785       } opengl;
786    } data;
787 };
788
789 /**
790  * @def EVAS_VIDEO_SURFACE_VERSION
791  * Magic version number to know what the video surf struct looks like
792  * @since 1.1
793  */
794 #define EVAS_VIDEO_SURFACE_VERSION 1
795
796 typedef void (*Evas_Video_Cb)(void *data, Evas_Object *obj, const Evas_Video_Surface *surface);
797 typedef void (*Evas_Video_Coord_Cb)(void *data, Evas_Object *obj, const Evas_Video_Surface *surface, Evas_Coord a, Evas_Coord b);
798
799 struct _Evas_Video_Surface
800 {
801    int                 version;
802
803    Evas_Video_Coord_Cb move; /**< Move the video surface to this position */
804    Evas_Video_Coord_Cb resize; /**< Resize the video surface to that size */
805    Evas_Video_Cb       show; /**< Show the video overlay surface */
806    Evas_Video_Cb       hide; /**< Hide the video overlay surface */
807    Evas_Video_Cb       update_pixels; /**< Please update the Evas_Object_Image pixels when called */
808
809    Evas_Object        *parent;
810    void               *data;
811 };
812
813 #define EVAS_LAYER_MIN                   -32768 /**< bottom-most layer number */
814 #define EVAS_LAYER_MAX                   32767 /**< top-most layer number */
815
816 #define EVAS_COLOR_SPACE_ARGB            0 /**< Not used for anything */
817 #define EVAS_COLOR_SPACE_AHSV            1 /**< Not used for anything */
818 #define EVAS_TEXT_INVALID                -1 /**< Not used for anything */
819 #define EVAS_TEXT_SPECIAL                -2 /**< Not used for anything */
820
821 #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() */
822 #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() */
823 #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) */
824 #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) */
825 #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 */
826 #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 */
827
828 /**
829  * How the object should be rendered to output.
830  * @ingroup Evas_Object_Group_Extras
831  */
832 typedef enum _Evas_Render_Op
833 {
834    EVAS_RENDER_BLEND = 0, /**< default op: d = d*(1-sa) + s */
835    EVAS_RENDER_BLEND_REL = 1, /**< d = d*(1 - sa) + s*da */
836    EVAS_RENDER_COPY = 2, /**< d = s */
837    EVAS_RENDER_COPY_REL = 3, /**< d = s*da */
838    EVAS_RENDER_ADD = 4, /* d = d + s */
839    EVAS_RENDER_ADD_REL = 5, /**< d = d + s*da */
840    EVAS_RENDER_SUB = 6, /**< d = d - s */
841    EVAS_RENDER_SUB_REL = 7, /* d = d - s*da */
842    EVAS_RENDER_TINT = 8, /**< d = d*s + d*(1 - sa) + s*(1 - da) */
843    EVAS_RENDER_TINT_REL = 9, /**< d = d*(1 - sa + s) */
844    EVAS_RENDER_MASK = 10, /**< d = d*sa */
845    EVAS_RENDER_MUL = 11 /**< d = d*s */
846 } Evas_Render_Op; /**< How the object should be rendered to output. */
847
848 typedef enum _Evas_Border_Fill_Mode
849 {
850    EVAS_BORDER_FILL_NONE = 0, /**< Image's center region is @b not to be rendered */
851    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 */
852    EVAS_BORDER_FILL_SOLID = 2 /**< Image's center region is to be made solid, even if it has transparency on it */
853 } Evas_Border_Fill_Mode; /**< How an image's center region (the complement to the border region) should be rendered by Evas */
854
855 typedef enum _Evas_Image_Scale_Hint
856 {
857    EVAS_IMAGE_SCALE_HINT_NONE = 0, /**< No scale hint at all */
858    EVAS_IMAGE_SCALE_HINT_DYNAMIC = 1, /**< Image is being re-scaled over time, thus turning scaling cache @b off for its data */
859    EVAS_IMAGE_SCALE_HINT_STATIC = 2 /**< Image is not being re-scaled over time, thus turning scaling cache @b on for its data */
860 } Evas_Image_Scale_Hint; /**< How an image's data is to be treated by Evas, with regard to scaling cache */
861
862 typedef enum _Evas_Image_Animated_Loop_Hint
863 {
864    EVAS_IMAGE_ANIMATED_HINT_NONE = 0,
865    EVAS_IMAGE_ANIMATED_HINT_LOOP = 1, /**< Image's animation mode is loop like 1->2->3->1->2->3 */
866    EVAS_IMAGE_ANIMATED_HINT_PINGPONG = 2 /**< Image's animation mode is pingpong like 1->2->3->2->1-> ... */
867 } Evas_Image_Animated_Loop_Hint;
868
869 typedef enum _Evas_Engine_Render_Mode
870 {
871    EVAS_RENDER_MODE_BLOCKING = 0,
872    EVAS_RENDER_MODE_NONBLOCKING = 1,
873 } Evas_Engine_Render_Mode;
874
875 typedef enum _Evas_Image_Content_Hint
876 {
877    EVAS_IMAGE_CONTENT_HINT_NONE = 0, /**< No hint at all */
878    EVAS_IMAGE_CONTENT_HINT_DYNAMIC = 1, /**< The contents will change over time */
879    EVAS_IMAGE_CONTENT_HINT_STATIC = 2 /**< The contents won't change over time */
880 } Evas_Image_Content_Hint; /**< How an image's data is to be treated by Evas, for optimization */
881
882 struct _Evas_Engine_Info /** Generic engine information. Generic info is useless */
883 {
884    int magic; /**< Magic number */
885 };
886
887 struct _Evas_Event_Mouse_Down /** Mouse button press event */
888 {
889    int               button; /**< Mouse button number that went down (1 - 32) */
890
891    Evas_Point        output; /**< The X/Y location of the cursor */
892    Evas_Coord_Point  canvas; /**< The X/Y location of the cursor */
893
894    void             *data;
895    Evas_Modifier    *modifiers; /**< modifier keys pressed during the event */
896    Evas_Lock        *locks;
897
898    Evas_Button_Flags flags; /**< button flags set during the event */
899    unsigned int      timestamp;
900    Evas_Event_Flags  event_flags;
901    Evas_Device      *dev;
902 };
903
904 struct _Evas_Event_Mouse_Up /** Mouse button release event */
905 {
906    int               button; /**< Mouse button number that was raised (1 - 32) */
907
908    Evas_Point        output;
909    Evas_Coord_Point  canvas;
910
911    void             *data;
912    Evas_Modifier    *modifiers;
913    Evas_Lock        *locks;
914
915    Evas_Button_Flags flags;
916    unsigned int      timestamp;
917    Evas_Event_Flags  event_flags;
918    Evas_Device      *dev;
919 };
920
921 struct _Evas_Event_Mouse_In /** Mouse enter event */
922 {
923    int              buttons; /**< Button pressed mask, Bits set to 1 are buttons currently pressed (bit 0 = mouse button 1, bit 1 = mouse button 2 etc.) */
924
925    Evas_Point       output;
926    Evas_Coord_Point canvas;
927
928    void            *data;
929    Evas_Modifier   *modifiers;
930    Evas_Lock       *locks;
931    unsigned int     timestamp;
932    Evas_Event_Flags event_flags;
933    Evas_Device     *dev;
934 };
935
936 struct _Evas_Event_Mouse_Out /** Mouse leave event */
937 {
938    int              buttons; /**< Button pressed mask, Bits set to 1 are buttons currently pressed (bit 0 = mouse button 1, bit 1 = mouse button 2 etc.) */
939
940    Evas_Point       output;
941    Evas_Coord_Point canvas;
942
943    void            *data;
944    Evas_Modifier   *modifiers;
945    Evas_Lock       *locks;
946    unsigned int     timestamp;
947    Evas_Event_Flags event_flags;
948    Evas_Device     *dev;
949 };
950
951 struct _Evas_Event_Mouse_Move /** Mouse button down event */
952 {
953    int              buttons; /**< Button pressed mask, Bits set to 1 are buttons currently pressed (bit 0 = mouse button 1, bit 1 = mouse button 2 etc.) */
954
955    Evas_Position    cur, prev;
956
957    void            *data;
958    Evas_Modifier   *modifiers;
959    Evas_Lock       *locks;
960    unsigned int     timestamp;
961    Evas_Event_Flags event_flags;
962    Evas_Device     *dev;
963 };
964
965 struct _Evas_Event_Mouse_Wheel /** Wheel event */
966 {
967    int              direction; /* 0 = default up/down wheel FIXME: more wheel types */
968    int              z; /* ...,-2,-1 = down, 1,2,... = up */
969
970    Evas_Point       output;
971    Evas_Coord_Point canvas;
972
973    void            *data;
974    Evas_Modifier   *modifiers;
975    Evas_Lock       *locks;
976    unsigned int     timestamp;
977    Evas_Event_Flags event_flags;
978    Evas_Device     *dev;
979 };
980
981 struct _Evas_Event_Multi_Down /** Multi button press event */
982 {
983    int                        device; /**< Multi device number that went down (1 or more for extra touches) */
984    double                     radius, radius_x, radius_y;
985    double                     pressure, angle;
986
987    Evas_Point                 output;
988    Evas_Coord_Precision_Point canvas;
989
990    void                      *data;
991    Evas_Modifier             *modifiers;
992    Evas_Lock                 *locks;
993
994    Evas_Button_Flags          flags;
995    unsigned int               timestamp;
996    Evas_Event_Flags           event_flags;
997    Evas_Device               *dev;
998 };
999
1000 struct _Evas_Event_Multi_Up /** Multi button release event */
1001 {
1002    int                        device; /**< Multi device number that went up (1 or more for extra touches) */
1003    double                     radius, radius_x, radius_y;
1004    double                     pressure, angle;
1005
1006    Evas_Point                 output;
1007    Evas_Coord_Precision_Point canvas;
1008
1009    void                      *data;
1010    Evas_Modifier             *modifiers;
1011    Evas_Lock                 *locks;
1012
1013    Evas_Button_Flags          flags;
1014    unsigned int               timestamp;
1015    Evas_Event_Flags           event_flags;
1016    Evas_Device               *dev;
1017 };
1018
1019 struct _Evas_Event_Multi_Move /** Multi button down event */
1020 {
1021    int                     device; /**< Multi device number that moved (1 or more for extra touches) */
1022    double                  radius, radius_x, radius_y;
1023    double                  pressure, angle;
1024
1025    Evas_Precision_Position cur;
1026
1027    void                   *data;
1028    Evas_Modifier          *modifiers;
1029    Evas_Lock              *locks;
1030    unsigned int            timestamp;
1031    Evas_Event_Flags        event_flags;
1032    Evas_Device            *dev;
1033 };
1034
1035 struct _Evas_Event_Key_Down /** Key press event */
1036 {
1037    char            *keyname; /**< the name string of the key pressed */
1038    void            *data;
1039    Evas_Modifier   *modifiers;
1040    Evas_Lock       *locks;
1041
1042    const char      *key; /**< The logical key : (eg shift+1 == exclamation) */
1043    const char      *string; /**< A UTF8 string if this keystroke has produced a visible string to be ADDED */
1044    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 */
1045    unsigned int     timestamp;
1046    Evas_Event_Flags event_flags;
1047    Evas_Device     *dev;
1048 };
1049
1050 struct _Evas_Event_Key_Up /** Key release event */
1051 {
1052    char            *keyname; /**< the name string of the key released */
1053    void            *data;
1054    Evas_Modifier   *modifiers;
1055    Evas_Lock       *locks;
1056
1057    const char      *key; /**< The logical key : (eg shift+1 == exclamation) */
1058    const char      *string; /**< A UTF8 string if this keystroke has produced a visible string to be ADDED */
1059    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 */
1060    unsigned int     timestamp;
1061    Evas_Event_Flags event_flags;
1062    Evas_Device     *dev;
1063 };
1064
1065 struct _Evas_Event_Hold /** Hold change event */
1066 {
1067    int              hold; /**< The hold flag */
1068    void            *data;
1069
1070    unsigned int     timestamp;
1071    Evas_Event_Flags event_flags;
1072    Evas_Device     *dev;
1073 };
1074
1075 /**
1076  * How the mouse pointer should be handled by Evas.
1077  *
1078  * In the mode #EVAS_OBJECT_POINTER_MODE_AUTOGRAB, when a mouse button
1079  * is pressed down over an object and held, with the mouse pointer
1080  * being moved outside of it, the pointer still behaves as being bound
1081  * to that object, albeit out of its drawing region. When the button
1082  * is released, the event will be fed to the object, that may check if
1083  * the final position is over it or not and do something about it.
1084  *
1085  * In the mode #EVAS_OBJECT_POINTER_MODE_NOGRAB, the pointer will
1086  * always be bound to the object right below it.
1087  *
1088  * @ingroup Evas_Object_Group_Extras
1089  */
1090 typedef enum _Evas_Object_Pointer_Mode
1091 {
1092    EVAS_OBJECT_POINTER_MODE_AUTOGRAB, /**< default, X11-like */
1093    EVAS_OBJECT_POINTER_MODE_NOGRAB, /**< pointer always bound to the object right below it */
1094    EVAS_OBJECT_POINTER_MODE_NOGRAB_NO_REPEAT_UPDOWN /**< useful on object with "repeat events" enabled, where mouse/touch up and down events WONT be repeated to objects and these objects wont be auto-grabbed. @since 1.2 */
1095 } Evas_Object_Pointer_Mode; /**< How the mouse pointer should be handled by Evas. */
1096
1097 typedef void      (*Evas_Smart_Cb)(void *data, Evas_Object *obj, void *event_info);  /**< Evas smart objects' "smart callback" function signature */
1098 typedef void      (*Evas_Event_Cb)(void *data, Evas *e, void *event_info);  /**< Evas event callback function signature */
1099 typedef Eina_Bool (*Evas_Object_Event_Post_Cb)(void *data, Evas *e);
1100 typedef void      (*Evas_Object_Event_Cb)(void *data, Evas *e, Evas_Object *obj, void *event_info);  /**< Evas object event callback function signature */
1101 typedef void      (*Evas_Async_Events_Put_Cb)(void *target, Evas_Callback_Type type, void *event_info);
1102
1103 /**
1104  * @defgroup Evas_Group Top Level Functions
1105  *
1106  * Functions that affect Evas as a whole.
1107  */
1108
1109 /**
1110  * Initialize Evas
1111  *
1112  * @return The init counter value.
1113  *
1114  * This function initializes Evas and increments a counter of the
1115  * number of calls to it. It returns the new counter's value.
1116  *
1117  * @see evas_shutdown().
1118  *
1119  * Most EFL users wouldn't be using this function directly, because
1120  * they wouldn't access Evas directly by themselves. Instead, they
1121  * would be using higher level helpers, like @c ecore_evas_init().
1122  * See http://docs.enlightenment.org/auto/ecore/.
1123  *
1124  * You should be using this if your use is something like the
1125  * following. The buffer engine is just one of the many ones Evas
1126  * provides.
1127  *
1128  * @dontinclude evas-buffer-simple.c
1129  * @skip int main
1130  * @until return -1;
1131  * And being the canvas creation something like:
1132  * @skip static Evas *create_canvas
1133  * @until    evas_output_viewport_set(canvas,
1134  *
1135  * Note that this is code creating an Evas canvas with no usage of
1136  * Ecore helpers at all -- no linkage with Ecore on this scenario,
1137  * thus. Again, this wouldn't be on Evas common usage for most
1138  * developers. See the full @ref Example_Evas_Buffer_Simple "example".
1139  *
1140  * @ingroup Evas_Group
1141  */
1142 EAPI int               evas_init(void);
1143
1144 /**
1145  * Shutdown Evas
1146  *
1147  * @return Evas' init counter value.
1148  *
1149  * This function finalizes Evas, decrementing the counter of the
1150  * number of calls to the function evas_init(). This new value for the
1151  * counter is returned.
1152  *
1153  * @see evas_init().
1154  *
1155  * If you were the sole user of Evas, by means of evas_init(), you can
1156  * check if it's being properly shut down by expecting a return value
1157  * of 0.
1158  *
1159  * Example code follows.
1160  * @dontinclude evas-buffer-simple.c
1161  * @skip // NOTE: use ecore_evas_buffer_new
1162  * @until evas_shutdown
1163  * Where that function would contain:
1164  * @skip   evas_free(canvas)
1165  * @until   evas_free(canvas)
1166  *
1167  * Most users would be using ecore_evas_shutdown() instead, like told
1168  * in evas_init(). See the full @ref Example_Evas_Buffer_Simple
1169  * "example".
1170  *
1171  * @ingroup Evas_Group
1172  */
1173 EAPI int               evas_shutdown(void);
1174
1175 /**
1176  * Return if any allocation errors have occurred during the prior function
1177  * @return The allocation error flag
1178  *
1179  * This function will return if any memory allocation errors occurred during,
1180  * and what kind they were. The return value will be one of
1181  * EVAS_ALLOC_ERROR_NONE, EVAS_ALLOC_ERROR_FATAL or EVAS_ALLOC_ERROR_RECOVERED
1182  * with each meaning something different.
1183  *
1184  * EVAS_ALLOC_ERROR_NONE means that no errors occurred at all and the function
1185  * worked as expected.
1186  *
1187  * EVAS_ALLOC_ERROR_FATAL means the function was completely unable to perform
1188  * its job and will  have  exited as cleanly as possible. The programmer
1189  * should consider this as a sign of very low memory and should try and safely
1190  * recover from the prior functions failure (or try free up memory elsewhere
1191  * and try again after more memory is freed).
1192  *
1193  * EVAS_ALLOC_ERROR_RECOVERED means that an allocation error occurred, but was
1194  * recovered from by evas finding memory of its own it has allocated and
1195  * freeing what it sees as not really usefully allocated memory. What is freed
1196  * may vary. Evas may reduce the resolution of images, free cached images or
1197  * fonts, trhow out pre-rendered data, reduce the complexity of change lists
1198  * etc. Evas and the program will function as per normal after this, but this
1199  * is a sign of low memory, and it is suggested that the program try and
1200  * identify memory it doesn't need, and free it.
1201  *
1202  * Example:
1203  * @code
1204  * extern Evas_Object *object;
1205  * void callback (void *data, Evas *e, Evas_Object *obj, void *event_info);
1206  *
1207  * evas_object_event_callback_add(object, EVAS_CALLBACK_MOUSE_DOWN, callback, NULL);
1208  * if (evas_alloc_error() == EVAS_ALLOC_ERROR_FATAL)
1209  *   {
1210  *     fprintf(stderr, "ERROR: Completely unable to attach callback. Must\n");
1211  *     fprintf(stderr, "       destroy object now as it cannot be used.\n");
1212  *     evas_object_del(object);
1213  *     object = NULL;
1214  *     fprintf(stderr, "WARNING: Memory is really low. Cleaning out RAM.\n");
1215  *     my_memory_cleanup();
1216  *   }
1217  * if (evas_alloc_error() == EVAS_ALLOC_ERROR_RECOVERED)
1218  *   {
1219  *     fprintf(stderr, "WARNING: Memory is really low. Cleaning out RAM.\n");
1220  *     my_memory_cleanup();
1221  *   }
1222  * @endcode
1223  *
1224  * @ingroup Evas_Group
1225  */
1226 EAPI Evas_Alloc_Error  evas_alloc_error(void);
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;
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 functions 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 NULL.
1331  * @ingroup Evas_Canvas
1332  */
1333 EAPI Evas             *evas_new(void) EINA_WARN_UNUSED_RESULT EINA_MALLOC;
1334
1335 /**
1336  * Frees the given evas and any objects created on it.
1337  *
1338  * Any objects with 'free' callbacks will have those callbacks called
1339  * in this function.
1340  *
1341  * @param   e The given evas.
1342  *
1343  * @ingroup Evas_Canvas
1344  */
1345 EAPI void              evas_free(Evas *e)  EINA_ARG_NONNULL(1);
1346
1347 /**
1348  * Inform to the evas that it got the focus.
1349  *
1350  * @param e The evas to change information.
1351  * @ingroup Evas_Canvas
1352  */
1353 EAPI void              evas_focus_in(Evas *e);
1354
1355 /**
1356  * Inform to the evas that it lost the focus.
1357  *
1358  * @param e The evas to change information.
1359  * @ingroup Evas_Canvas
1360  */
1361 EAPI void              evas_focus_out(Evas *e);
1362
1363 /**
1364  * Get the focus state known by the given evas
1365  *
1366  * @param e The evas to query information.
1367  * @ingroup Evas_Canvas
1368  */
1369 EAPI Eina_Bool         evas_focus_state_get(const Evas *e);
1370
1371 /**
1372  * Push the nochange flag up 1
1373  *
1374  * This tells evas, that while the nochange flag is greater than 0, do not
1375  * mark objects as "changed" when making changes.
1376  *
1377  * @param e The evas to change information.
1378  * @ingroup Evas_Canvas
1379  */
1380 EAPI void              evas_nochange_push(Evas *e);
1381
1382 /**
1383  * Pop the nochange flag down 1
1384  *
1385  * This tells evas, that while the nochange flag is greater than 0, do not
1386  * mark objects as "changed" when making changes.
1387  *
1388  * @param e The evas to change information.
1389  * @ingroup Evas_Canvas
1390  */
1391 EAPI void              evas_nochange_pop(Evas *e);
1392
1393 /**
1394  * Attaches a specific pointer to the evas for fetching later
1395  *
1396  * @param e The canvas to attach the pointer to
1397  * @param data The pointer to attach
1398  * @ingroup Evas_Canvas
1399  */
1400 EAPI void              evas_data_attach_set(Evas *e, void *data) EINA_ARG_NONNULL(1);
1401
1402 /**
1403  * Returns the pointer attached by evas_data_attach_set()
1404  *
1405  * @param e The canvas to attach the pointer to
1406  * @return The pointer attached
1407  * @ingroup Evas_Canvas
1408  */
1409 EAPI void             *evas_data_attach_get(const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
1410
1411 /**
1412  * Add a damage rectangle.
1413  *
1414  * @param e The given canvas pointer.
1415  * @param x The rectangle's left position.
1416  * @param y The rectangle's top position.
1417  * @param w The rectangle's width.
1418  * @param h The rectangle's height.
1419  *
1420  * This is the function by which one tells evas that a part of the
1421  * canvas has to be repainted.
1422  *
1423  * @note All newly created Evas rectangles get the default color values of 255 255 255 255 (opaque white).
1424  *
1425  * @ingroup Evas_Canvas
1426  */
1427 EAPI void              evas_damage_rectangle_add(Evas *e, int x, int y, int w, int h) EINA_ARG_NONNULL(1);
1428
1429 /**
1430  * Add an "obscured region" to an Evas canvas.
1431  *
1432  * @param e The given canvas pointer.
1433  * @param x The rectangle's top left corner's horizontal coordinate.
1434  * @param y The rectangle's top left corner's vertical coordinate
1435  * @param w The rectangle's width.
1436  * @param h The rectangle's height.
1437  *
1438  * This is the function by which one tells an Evas canvas that a part
1439  * of it <b>must not</b> be repainted. The region must be
1440  * rectangular and its coordinates inside the canvas viewport are
1441  * passed in the call. After this call, the region specified won't
1442  * participate in any form in Evas' calculations and actions during
1443  * its rendering updates, having its displaying content frozen as it
1444  * was just after this function took place.
1445  *
1446  * We call it "obscured region" because the most common use case for
1447  * this rendering (partial) freeze is something else (most probably
1448  * other canvas) being on top of the specified rectangular region,
1449  * thus shading it completely from the user's final scene in a
1450  * display. To avoid unnecessary processing, one should indicate to the
1451  * obscured canvas not to bother about the non-important area.
1452  *
1453  * The majority of users won't have to worry about this function, as
1454  * they'll be using just one canvas in their applications, with
1455  * nothing inset or on top of it in any form.
1456  *
1457  * To make this region one that @b has to be repainted again, call the
1458  * function evas_obscured_clear().
1459  *
1460  * @note This is a <b>very low level function</b>, which most of
1461  * Evas' users wouldn't care about.
1462  *
1463  * @note This function does @b not flag the canvas as having its state
1464  * changed. If you want to re-render it afterwards expecting new
1465  * contents, you have to add "damage" regions yourself (see
1466  * evas_damage_rectangle_add()).
1467  *
1468  * @see evas_obscured_clear()
1469  * @see evas_render_updates()
1470  *
1471  * Example code follows.
1472  * @dontinclude evas-events.c
1473  * @skip add an obscured
1474  * @until evas_obscured_clear(evas);
1475  *
1476  * In that example, pressing the "Ctrl" and "o" keys will impose or
1477  * remove an obscured region in the middle of the canvas. You'll get
1478  * the same contents at the time the key was pressed, if toggling it
1479  * on, until you toggle it off again (make sure the animation is
1480  * running on to get the idea better). See the full @ref
1481  * Example_Evas_Events "example".
1482  *
1483  * @ingroup Evas_Canvas
1484  */
1485 EAPI void              evas_obscured_rectangle_add(Evas *e, int x, int y, int w, int h) EINA_ARG_NONNULL(1);
1486
1487 /**
1488  * Remove all "obscured regions" from an Evas canvas.
1489  *
1490  * @param e The given canvas pointer.
1491  *
1492  * This function removes all the rectangles from the obscured regions
1493  * list of the canvas @p e. It takes obscured areas added with
1494  * evas_obscured_rectangle_add() and make them again a regions that @b
1495  * have to be repainted on rendering updates.
1496  *
1497  * @note This is a <b>very low level function</b>, which most of
1498  * Evas' users wouldn't care about.
1499  *
1500  * @note This function does @b not flag the canvas as having its state
1501  * changed. If you want to re-render it afterwards expecting new
1502  * contents, you have to add "damage" regions yourself (see
1503  * evas_damage_rectangle_add()).
1504  *
1505  * @see evas_obscured_rectangle_add() for an example
1506  * @see evas_render_updates()
1507  *
1508  * @ingroup Evas_Canvas
1509  */
1510 EAPI void              evas_obscured_clear(Evas *e) EINA_ARG_NONNULL(1);
1511
1512 /**
1513  * Force immediate renderization of the given Evas canvas.
1514  *
1515  * @param e The given canvas pointer.
1516  * @return A newly allocated list of updated rectangles of the canvas
1517  *        (@c Eina_Rectangle structs). Free this list with
1518  *        evas_render_updates_free().
1519  *
1520  * This function forces an immediate renderization update of the given
1521  * canvas @p e.
1522  *
1523  * @note This is a <b>very low level function</b>, which most of
1524  * Evas' users wouldn't care about. One would use it, for example, to
1525  * grab an Evas' canvas update regions and paint them back, using the
1526  * canvas' pixmap, on a displaying system working below Evas.
1527  *
1528  * @note Evas is a stateful canvas. If no operations changing its
1529  * state took place since the last rendering action, you won't see no
1530  * changes and this call will be a no-op.
1531  *
1532  * Example code follows.
1533  * @dontinclude evas-events.c
1534  * @skip add an obscured
1535  * @until d.obscured = !d.obscured;
1536  *
1537  * See the full @ref Example_Evas_Events "example".
1538  *
1539  * @ingroup Evas_Canvas
1540  */
1541 EAPI Eina_List        *evas_render_updates(Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
1542
1543 /**
1544  * Free the rectangles returned by evas_render_updates().
1545  *
1546  * @param updates The list of updated rectangles of the canvas.
1547  *
1548  * This function removes the region from the render updates list. It
1549  * makes the region doesn't be render updated anymore.
1550  *
1551  * @see evas_render_updates() for an example
1552  *
1553  * @ingroup Evas_Canvas
1554  */
1555 EAPI void              evas_render_updates_free(Eina_List *updates);
1556
1557 /**
1558  * Force renderization of the given canvas.
1559  *
1560  * @param e The given canvas pointer.
1561  *
1562  * @ingroup Evas_Canvas
1563  */
1564 EAPI void              evas_render(Evas *e) EINA_ARG_NONNULL(1);
1565
1566 /**
1567  * Update the canvas internal objects but not triggering immediate
1568  * renderization.
1569  *
1570  * @param e The given canvas pointer.
1571  *
1572  * This function updates the canvas internal objects not triggering
1573  * renderization. To force renderization function evas_render() should
1574  * be used.
1575  *
1576  * @see evas_render.
1577  *
1578  * @ingroup Evas_Canvas
1579  */
1580 EAPI void              evas_norender(Evas *e) EINA_ARG_NONNULL(1);
1581
1582 /**
1583  * Make the canvas discard internally cached data used for rendering.
1584  *
1585  * @param e The given canvas pointer.
1586  *
1587  * This function flushes the arrays of delete, active and render objects.
1588  * Other things it may also discard are: shared memory segments,
1589  * temporary scratch buffers, cached data to avoid re-compute of that data etc.
1590  *
1591  * @ingroup Evas_Canvas
1592  */
1593 EAPI void              evas_render_idle_flush(Evas *e) EINA_ARG_NONNULL(1);
1594
1595 /**
1596  * Make the canvas discard as much data as possible used by the engine at
1597  * runtime.
1598  *
1599  * @param e The given canvas pointer.
1600  *
1601  * This function will unload images, delete textures and much more, where
1602  * possible. You may also want to call evas_render_idle_flush() immediately
1603  * prior to this to perhaps discard a little more, though evas_render_dump()
1604  * should implicitly delete most of what evas_render_idle_flush() might
1605  * discard too.
1606  *
1607  * @ingroup Evas_Canvas
1608  */
1609 EAPI void              evas_render_dump(Evas *e) EINA_ARG_NONNULL(1);
1610
1611 /**
1612  * @defgroup Evas_Output_Method Render Engine Functions
1613  *
1614  * Functions that are used to set the render engine for a given
1615  * function, and then get that engine working.
1616  *
1617  * The following code snippet shows how they can be used to
1618  * initialise an evas that uses the X11 software engine:
1619  * @code
1620  * Evas *evas;
1621  * Evas_Engine_Info_Software_X11 *einfo;
1622  * extern Display *display;
1623  * extern Window win;
1624  *
1625  * evas_init();
1626  *
1627  * evas = evas_new();
1628  * evas_output_method_set(evas, evas_render_method_lookup("software_x11"));
1629  * evas_output_size_set(evas, 640, 480);
1630  * evas_output_viewport_set(evas, 0, 0, 640, 480);
1631  * einfo = (Evas_Engine_Info_Software_X11 *)evas_engine_info_get(evas);
1632  * einfo->info.display = display;
1633  * einfo->info.visual = DefaultVisual(display, DefaultScreen(display));
1634  * einfo->info.colormap = DefaultColormap(display, DefaultScreen(display));
1635  * einfo->info.drawable = win;
1636  * einfo->info.depth = DefaultDepth(display, DefaultScreen(display));
1637  * evas_engine_info_set(evas, (Evas_Engine_Info *)einfo);
1638  * @endcode
1639  *
1640  * @ingroup Evas_Canvas
1641  */
1642
1643 /**
1644  * Look up a numeric ID from a string name of a rendering engine.
1645  *
1646  * @param name the name string of an engine
1647  * @return A numeric (opaque) ID for the rendering engine
1648  * @ingroup Evas_Output_Method
1649  *
1650  * This function looks up a numeric return value for the named engine
1651  * in the string @p name. This is a normal C string, NUL byte
1652  * terminated. The name is case sensitive. If the rendering engine is
1653  * available, a numeric ID for that engine is returned that is not
1654  * 0. If the engine is not available, 0 is returned, indicating an
1655  * invalid engine.
1656  *
1657  * The programmer should NEVER rely on the numeric ID of an engine
1658  * unless it is returned by this function. Programs should NOT be
1659  * written accessing render method ID's directly, without first
1660  * obtaining it from this function.
1661  *
1662  * @attention it is mandatory that one calls evas_init() before
1663  *       looking up the render method.
1664  *
1665  * Example:
1666  * @code
1667  * int engine_id;
1668  * Evas *evas;
1669  *
1670  * evas_init();
1671  *
1672  * evas = evas_new();
1673  * if (!evas)
1674  *   {
1675  *     fprintf(stderr, "ERROR: Canvas creation failed. Fatal error.\n");
1676  *     exit(-1);
1677  *   }
1678  * engine_id = evas_render_method_lookup("software_x11");
1679  * if (!engine_id)
1680  *   {
1681  *     fprintf(stderr, "ERROR: Requested rendering engine is absent.\n");
1682  *     exit(-1);
1683  *   }
1684  * evas_output_method_set(evas, engine_id);
1685  * @endcode
1686  */
1687 EAPI int               evas_render_method_lookup(const char *name) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
1688
1689 /**
1690  * List all the rendering engines compiled into the copy of the Evas library
1691  *
1692  * @return A linked list whose data members are C strings of engine names
1693  * @ingroup Evas_Output_Method
1694  *
1695  * Calling this will return a handle (pointer) to an Evas linked
1696  * list. Each node in the linked list will have the data pointer be a
1697  * (char *) pointer to the name string of the rendering engine
1698  * available. The strings should never be modified, neither should the
1699  * list be modified. This list should be cleaned up as soon as the
1700  * program no longer needs it using evas_render_method_list_free(). If
1701  * no engines are available from Evas, @c NULL will be returned.
1702  *
1703  * Example:
1704  * @code
1705  * Eina_List *engine_list, *l;
1706  * char *engine_name;
1707  *
1708  * engine_list = evas_render_method_list();
1709  * if (!engine_list)
1710  *   {
1711  *     fprintf(stderr, "ERROR: Evas supports no engines! Exit.\n");
1712  *     exit(-1);
1713  *   }
1714  * printf("Available Evas Engines:\n");
1715  * EINA_LIST_FOREACH(engine_list, l, engine_name)
1716  *     printf("%s\n", engine_name);
1717  * evas_render_method_list_free(engine_list);
1718  * @endcode
1719  */
1720 EAPI Eina_List        *evas_render_method_list(void) EINA_WARN_UNUSED_RESULT;
1721
1722 /**
1723  * This function should be called to free a list of engine names
1724  *
1725  * @param list The Eina_List base pointer for the engine list to be freed
1726  * @ingroup Evas_Output_Method
1727  *
1728  * When this function is called it will free the engine list passed in
1729  * as @p list. The list should only be a list of engines generated by
1730  * calling evas_render_method_list(). If @p list is NULL, nothing will
1731  * happen.
1732  *
1733  * Example:
1734  * @code
1735  * Eina_List *engine_list, *l;
1736  * char *engine_name;
1737  *
1738  * engine_list = evas_render_method_list();
1739  * if (!engine_list)
1740  *   {
1741  *     fprintf(stderr, "ERROR: Evas supports no engines! Exit.\n");
1742  *     exit(-1);
1743  *   }
1744  * printf("Available Evas Engines:\n");
1745  * EINA_LIST_FOREACH(engine_list, l, engine_name)
1746  *     printf("%s\n", engine_name);
1747  * evas_render_method_list_free(engine_list);
1748  * @endcode
1749  */
1750 EAPI void              evas_render_method_list_free(Eina_List *list);
1751
1752 /**
1753  * Sets the output engine for the given evas.
1754  *
1755  * Once the output engine for an evas is set, any attempt to change it
1756  * will be ignored.  The value for @p render_method can be found using
1757  * @ref evas_render_method_lookup .
1758  *
1759  * @param   e             The given evas.
1760  * @param   render_method The numeric engine value to use.
1761  *
1762  * @attention it is mandatory that one calls evas_init() before
1763  *       setting the output method.
1764  *
1765  * @ingroup Evas_Output_Method
1766  */
1767 EAPI void              evas_output_method_set(Evas *e, int render_method) EINA_ARG_NONNULL(1);
1768
1769 /**
1770  * Retrieves the number of the output engine used for the given evas.
1771  * @param   e The given evas.
1772  * @return  The ID number of the output engine being used.  @c 0 is
1773  *          returned if there is an error.
1774  * @ingroup Evas_Output_Method
1775  */
1776 EAPI int               evas_output_method_get(const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
1777
1778 /**
1779  * Retrieves the current render engine info struct from the given evas.
1780  *
1781  * The returned structure is publicly modifiable.  The contents are
1782  * valid until either @ref evas_engine_info_set or @ref evas_render
1783  * are called.
1784  *
1785  * This structure does not need to be freed by the caller.
1786  *
1787  * @param   e The given evas.
1788  * @return  A pointer to the Engine Info structure.  @c NULL is returned if
1789  *          an engine has not yet been assigned.
1790  * @ingroup Evas_Output_Method
1791  */
1792 EAPI Evas_Engine_Info *evas_engine_info_get(const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
1793
1794 /**
1795  * Applies the engine settings for the given evas from the given @c
1796  * Evas_Engine_Info structure.
1797  *
1798  * To get the Evas_Engine_Info structure to use, call @ref
1799  * evas_engine_info_get .  Do not try to obtain a pointer to an
1800  * @c Evas_Engine_Info structure in any other way.
1801  *
1802  * You will need to call this function at least once before you can
1803  * create objects on an evas or render that evas.  Some engines allow
1804  * their settings to be changed more than once.
1805  *
1806  * Once called, the @p info pointer should be considered invalid.
1807  *
1808  * @param   e    The pointer to the Evas Canvas
1809  * @param   info The pointer to the Engine Info to use
1810  * @return  @c EINA_TRUE if no error occurred, @c EINA_FALSE otherwise.
1811  * @ingroup Evas_Output_Method
1812  */
1813 EAPI Eina_Bool         evas_engine_info_set(Evas *e, Evas_Engine_Info *info) EINA_ARG_NONNULL(1);
1814
1815 /**
1816  * @defgroup Evas_Output_Size Output and Viewport Resizing Functions
1817  *
1818  * Functions that set and retrieve the output and viewport size of an
1819  * evas.
1820  *
1821  * @ingroup Evas_Canvas
1822  */
1823
1824 /**
1825  * Sets the output size of the render engine of the given evas.
1826  *
1827  * The evas will render to a rectangle of the given size once this
1828  * function is called.  The output size is independent of the viewport
1829  * size.  The viewport will be stretched to fill the given rectangle.
1830  *
1831  * The units used for @p w and @p h depend on the engine used by the
1832  * evas.
1833  *
1834  * @param   e The given evas.
1835  * @param   w The width in output units, usually pixels.
1836  * @param   h The height in output units, usually pixels.
1837  * @ingroup Evas_Output_Size
1838  */
1839 EAPI void              evas_output_size_set(Evas *e, int w, int h) EINA_ARG_NONNULL(1);
1840
1841 /**
1842  * Retrieve the output size of the render engine of the given evas.
1843  *
1844  * The output size is given in whatever the output units are for the
1845  * engine.
1846  *
1847  * If either @p w or @p h is @c NULL, then it is ignored.  If @p e is
1848  * invalid, the returned results are undefined.
1849  *
1850  * @param   e The given evas.
1851  * @param   w The pointer to an integer to store the width in.
1852  * @param   h The pointer to an integer to store the height in.
1853  * @ingroup Evas_Output_Size
1854  */
1855 EAPI void              evas_output_size_get(const Evas *e, int *w, int *h) EINA_ARG_NONNULL(1);
1856
1857 /**
1858  * Sets the output viewport of the given evas in evas units.
1859  *
1860  * The output viewport is the area of the evas that will be visible to
1861  * the viewer.  The viewport will be stretched to fit the output
1862  * target of the evas when rendering is performed.
1863  *
1864  * @note The coordinate values do not have to map 1-to-1 with the output
1865  *       target.  However, it is generally advised that it is done for ease
1866  *       of use.
1867  *
1868  * @param   e The given evas.
1869  * @param   x The top-left corner x value of the viewport.
1870  * @param   y The top-left corner y value of the viewport.
1871  * @param   w The width of the viewport.  Must be greater than 0.
1872  * @param   h The height of the viewport.  Must be greater than 0.
1873  * @ingroup Evas_Output_Size
1874  */
1875 EAPI void              evas_output_viewport_set(Evas *e, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h) EINA_ARG_NONNULL(1);
1876
1877 /**
1878  * Get the render engine's output viewport co-ordinates in canvas units.
1879  * @param e The pointer to the Evas Canvas
1880  * @param x The pointer to a x variable to be filled in
1881  * @param y The pointer to a y variable to be filled in
1882  * @param w The pointer to a width variable to be filled in
1883  * @param h The pointer to a height variable to be filled in
1884  * @ingroup Evas_Output_Size
1885  *
1886  * Calling this function writes the current canvas output viewport
1887  * size and location values into the variables pointed to by @p x, @p
1888  * y, @p w and @p h.  On success the variables have the output
1889  * location and size values written to them in canvas units. Any of @p
1890  * x, @p y, @p w or @p h that are @c NULL will not be written to. If @p e
1891  * is invalid, the results are undefined.
1892  *
1893  * Example:
1894  * @code
1895  * extern Evas *evas;
1896  * Evas_Coord x, y, width, height;
1897  *
1898  * evas_output_viewport_get(evas, &x, &y, &w, &h);
1899  * @endcode
1900  */
1901 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);
1902
1903 /**
1904  * Sets the output framespace size of the render engine of the given evas.
1905  *
1906  * The framespace size is used in the Wayland engines to denote space where
1907  * the output is not drawn. This is mainly used in ecore_evas to draw borders
1908  *
1909  * The units used for @p w and @p h depend on the engine used by the
1910  * evas.
1911  *
1912  * @param   e The given evas.
1913  * @param   x The left coordinate in output units, usually pixels.
1914  * @param   y The top coordinate in output units, usually pixels.
1915  * @param   w The width in output units, usually pixels.
1916  * @param   h The height in output units, usually pixels.
1917  * @ingroup Evas_Output_Size
1918  * @since 1.1
1919  */
1920 EAPI void              evas_output_framespace_set(Evas *e, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h);
1921
1922 /**
1923  * Get the render engine's output framespace co-ordinates in canvas units.
1924  *
1925  * @param e The pointer to the Evas Canvas
1926  * @param x The pointer to a x variable to be filled in
1927  * @param y The pointer to a y variable to be filled in
1928  * @param w The pointer to a width variable to be filled in
1929  * @param h The pointer to a height variable to be filled in
1930  * @ingroup Evas_Output_Size
1931  * @since 1.1
1932  */
1933 EAPI void              evas_output_framespace_get(const Evas *e, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h);
1934
1935 /**
1936  * @defgroup Evas_Coord_Mapping_Group Coordinate Mapping Functions
1937  *
1938  * Functions that are used to map coordinates from the canvas to the
1939  * screen or the screen to the canvas.
1940  *
1941  * @ingroup Evas_Canvas
1942  */
1943
1944 /**
1945  * Convert/scale an ouput screen co-ordinate into canvas co-ordinates
1946  *
1947  * @param e The pointer to the Evas Canvas
1948  * @param x The screen/output x co-ordinate
1949  * @return The screen co-ordinate translated to canvas unit co-ordinates
1950  * @ingroup Evas_Coord_Mapping_Group
1951  *
1952  * This function takes in a horizontal co-ordinate as the @p x
1953  * parameter and converts it into canvas units, accounting for output
1954  * size, viewport size and location, returning it as the function
1955  * return value. If @p e is invalid, the results are undefined.
1956  *
1957  * Example:
1958  * @code
1959  * extern Evas *evas;
1960  * extern int screen_x;
1961  * Evas_Coord canvas_x;
1962  *
1963  * canvas_x = evas_coord_screen_x_to_world(evas, screen_x);
1964  * @endcode
1965  */
1966 EAPI Evas_Coord        evas_coord_screen_x_to_world(const Evas *e, int x) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
1967
1968 /**
1969  * Convert/scale an ouput screen co-ordinate into canvas co-ordinates
1970  *
1971  * @param e The pointer to the Evas Canvas
1972  * @param y The screen/output y co-ordinate
1973  * @return The screen co-ordinate translated to canvas unit co-ordinates
1974  * @ingroup Evas_Coord_Mapping_Group
1975  *
1976  * This function takes in a vertical co-ordinate as the @p y parameter
1977  * and converts it into canvas units, accounting for output size,
1978  * viewport size and location, returning it as the function return
1979  * value. If @p e is invalid, the results are undefined.
1980  *
1981  * Example:
1982  * @code
1983  * extern Evas *evas;
1984  * extern int screen_y;
1985  * Evas_Coord canvas_y;
1986  *
1987  * canvas_y = evas_coord_screen_y_to_world(evas, screen_y);
1988  * @endcode
1989  */
1990 EAPI Evas_Coord        evas_coord_screen_y_to_world(const Evas *e, int y) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
1991
1992 /**
1993  * Convert/scale a canvas co-ordinate into output screen co-ordinates
1994  *
1995  * @param e The pointer to the Evas Canvas
1996  * @param x The canvas x co-ordinate
1997  * @return The output/screen co-ordinate translated to output co-ordinates
1998  * @ingroup Evas_Coord_Mapping_Group
1999  *
2000  * This function takes in a horizontal co-ordinate as the @p x
2001  * parameter and converts it into output units, accounting for output
2002  * size, viewport size and location, returning it as the function
2003  * return value. If @p e is invalid, the results are undefined.
2004  *
2005  * Example:
2006  * @code
2007  * extern Evas *evas;
2008  * int screen_x;
2009  * extern Evas_Coord canvas_x;
2010  *
2011  * screen_x = evas_coord_world_x_to_screen(evas, canvas_x);
2012  * @endcode
2013  */
2014 EAPI int               evas_coord_world_x_to_screen(const Evas *e, Evas_Coord x) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
2015
2016 /**
2017  * Convert/scale a canvas co-ordinate into output screen co-ordinates
2018  *
2019  * @param e The pointer to the Evas Canvas
2020  * @param y The canvas y co-ordinate
2021  * @return The output/screen co-ordinate translated to output co-ordinates
2022  * @ingroup Evas_Coord_Mapping_Group
2023  *
2024  * This function takes in a vertical co-ordinate as the @p x parameter
2025  * and converts it into output units, accounting for output size,
2026  * viewport size and location, returning it as the function return
2027  * value. If @p e is invalid, the results are undefined.
2028  *
2029  * Example:
2030  * @code
2031  * extern Evas *evas;
2032  * int screen_y;
2033  * extern Evas_Coord canvas_y;
2034  *
2035  * screen_y = evas_coord_world_y_to_screen(evas, canvas_y);
2036  * @endcode
2037  */
2038 EAPI int               evas_coord_world_y_to_screen(const Evas *e, Evas_Coord y) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
2039
2040 /**
2041  * @defgroup Evas_Pointer_Group Pointer (Mouse) Functions
2042  *
2043  * Functions that deal with the status of the pointer (mouse cursor).
2044  *
2045  * @ingroup Evas_Canvas
2046  */
2047
2048 /**
2049  * This function returns the current known pointer co-ordinates
2050  *
2051  * @param e The pointer to the Evas Canvas
2052  * @param x The pointer to an integer to be filled in
2053  * @param y The pointer to an integer to be filled in
2054  * @ingroup Evas_Pointer_Group
2055  *
2056  * This function returns the current known screen/output co-ordinates
2057  * of the mouse pointer and sets the contents of the integers pointed
2058  * to by @p x and @p y to contain these co-ordinates. If @p e is not a
2059  * valid canvas the results of this function are undefined.
2060  *
2061  * Example:
2062  * @code
2063  * extern Evas *evas;
2064  * int mouse_x, mouse_y;
2065  *
2066  * evas_pointer_output_xy_get(evas, &mouse_x, &mouse_y);
2067  * printf("Mouse is at screen position %i, %i\n", mouse_x, mouse_y);
2068  * @endcode
2069  */
2070 EAPI void              evas_pointer_output_xy_get(const Evas *e, int *x, int *y) EINA_ARG_NONNULL(1);
2071
2072 /**
2073  * This function returns the current known pointer co-ordinates
2074  *
2075  * @param e The pointer to the Evas Canvas
2076  * @param x The pointer to a Evas_Coord to be filled in
2077  * @param y The pointer to a Evas_Coord to be filled in
2078  * @ingroup Evas_Pointer_Group
2079  *
2080  * This function returns the current known canvas unit co-ordinates of
2081  * the mouse pointer and sets the contents of the Evas_Coords pointed
2082  * to by @p x and @p y to contain these co-ordinates. If @p e is not a
2083  * valid canvas the results of this function are undefined.
2084  *
2085  * Example:
2086  * @code
2087  * extern Evas *evas;
2088  * Evas_Coord mouse_x, mouse_y;
2089  *
2090  * evas_pointer_output_xy_get(evas, &mouse_x, &mouse_y);
2091  * printf("Mouse is at canvas position %f, %f\n", mouse_x, mouse_y);
2092  * @endcode
2093  */
2094 EAPI void              evas_pointer_canvas_xy_get(const Evas *e, Evas_Coord *x, Evas_Coord *y) EINA_ARG_NONNULL(1);
2095
2096 /**
2097  * Returns a bitmask with the mouse buttons currently pressed, set to 1
2098  *
2099  * @param e The pointer to the Evas Canvas
2100  * @return A bitmask of the currently depressed buttons on the canvas
2101  * @ingroup Evas_Pointer_Group
2102  *
2103  * Calling this function will return a 32-bit integer with the
2104  * appropriate bits set to 1 that correspond to a mouse button being
2105  * depressed. This limits Evas to a mouse devices with a maximum of 32
2106  * buttons, but that is generally in excess of any host system's
2107  * pointing device abilities.
2108  *
2109  * A canvas by default begins with no mouse buttons being pressed and
2110  * only calls to evas_event_feed_mouse_down(),
2111  * evas_event_feed_mouse_down_data(), evas_event_feed_mouse_up() and
2112  * evas_event_feed_mouse_up_data() will alter that.
2113  *
2114  * The least significant bit corresponds to the first mouse button
2115  * (button 1) and the most significant bit corresponds to the last
2116  * mouse button (button 32).
2117  *
2118  * If @p e is not a valid canvas, the return value is undefined.
2119  *
2120  * Example:
2121  * @code
2122  * extern Evas *evas;
2123  * int button_mask, i;
2124  *
2125  * button_mask = evas_pointer_button_down_mask_get(evas);
2126  * printf("Buttons currently pressed:\n");
2127  * for (i = 0; i < 32; i++)
2128  *   {
2129  *     if ((button_mask & (1 << i)) != 0) printf("Button %i\n", i + 1);
2130  *   }
2131  * @endcode
2132  */
2133 EAPI int               evas_pointer_button_down_mask_get(const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
2134
2135 /**
2136  * Returns whether the mouse pointer is logically inside the canvas
2137  *
2138  * @param e The pointer to the Evas Canvas
2139  * @return An integer that is 1 if the mouse is inside the canvas, 0 otherwise
2140  * @ingroup Evas_Pointer_Group
2141  *
2142  * When this function is called it will return a value of either 0 or
2143  * 1, depending on if evas_event_feed_mouse_in(),
2144  * evas_event_feed_mouse_in_data(), or evas_event_feed_mouse_out(),
2145  * evas_event_feed_mouse_out_data() have been called to feed in a
2146  * mouse enter event into the canvas.
2147  *
2148  * A return value of 1 indicates the mouse is logically inside the
2149  * canvas, and 0 implies it is logically outside the canvas.
2150  *
2151  * A canvas begins with the mouse being assumed outside (0).
2152  *
2153  * If @p e is not a valid canvas, the return value is undefined.
2154  *
2155  * Example:
2156  * @code
2157  * extern Evas *evas;
2158  *
2159  * if (evas_pointer_inside_get(evas)) printf("Mouse is in!\n");
2160  * else printf("Mouse is out!\n");
2161  * @endcode
2162  */
2163 EAPI Eina_Bool         evas_pointer_inside_get(const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
2164 EAPI void              evas_sync(Evas *e) EINA_ARG_NONNULL(1);
2165
2166 /**
2167  * @defgroup Evas_Canvas_Events Canvas Events
2168  *
2169  * Functions relating to canvas events, which are mainly reports on
2170  * its internal states changing (an object got focused, the rendering
2171  * is updated, etc).
2172  *
2173  * Some of the functions in this group are exemplified @ref
2174  * Example_Evas_Events "here".
2175  *
2176  * @ingroup Evas_Canvas
2177  */
2178
2179 /**
2180  * @addtogroup Evas_Canvas_Events
2181  * @{
2182  */
2183
2184 /**
2185  * Add (register) a callback function to a given canvas event.
2186  *
2187  * @param e Canvas to attach a callback to
2188  * @param type The type of event that will trigger the callback
2189  * @param func The (callback) function to be called when the event is
2190  *        triggered
2191  * @param data The data pointer to be passed to @p func
2192  *
2193  * This function adds a function callback to the canvas @p e when the
2194  * event of type @p type occurs on it. The function pointer is @p
2195  * func.
2196  *
2197  * In the event of a memory allocation error during the addition of
2198  * the callback to the canvas, evas_alloc_error() should be used to
2199  * determine the nature of the error, if any, and the program should
2200  * sensibly try and recover.
2201  *
2202  * A callback function must have the ::Evas_Event_Cb prototype
2203  * definition. The first parameter (@p data) in this definition will
2204  * have the same value passed to evas_event_callback_add() as the @p
2205  * data parameter, at runtime. The second parameter @p e is the canvas
2206  * pointer on which the event occurred. The third parameter @p
2207  * event_info is a pointer to a data structure that may or may not be
2208  * passed to the callback, depending on the event type that triggered
2209  * the callback. This is so because some events don't carry extra
2210  * context with them, but others do.
2211  *
2212  * The event type @p type to trigger the function may be one of
2213  * #EVAS_CALLBACK_RENDER_FLUSH_PRE, #EVAS_CALLBACK_RENDER_FLUSH_POST,
2214  * #EVAS_CALLBACK_CANVAS_FOCUS_IN, #EVAS_CALLBACK_CANVAS_FOCUS_OUT,
2215  * #EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_IN and
2216  * #EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_OUT. This determines the kind of
2217  * event that will trigger the callback to be called. Only the last
2218  * two of the event types listed here provide useful event information
2219  * data -- a pointer to the recently focused Evas object. For the
2220  * others the @p event_info pointer is going to be @c NULL.
2221  *
2222  * Example:
2223  * @dontinclude evas-events.c
2224  * @skip evas_event_callback_add(d.canvas, EVAS_CALLBACK_RENDER_FLUSH_PRE
2225  * @until two canvas event callbacks
2226  *
2227  * Looking to the callbacks registered above,
2228  * @dontinclude evas-events.c
2229  * @skip called when our rectangle gets focus
2230  * @until let's have our events back
2231  *
2232  * we see that the canvas flushes its rendering pipeline
2233  * (#EVAS_CALLBACK_RENDER_FLUSH_PRE) whenever the @c _resize_cb
2234  * routine takes place: it has to redraw that image at a different
2235  * size. Also, the callback on an object being focused comes just
2236  * after we focus it explicitly, on code.
2237  *
2238  * See the full @ref Example_Evas_Events "example".
2239  *
2240  * @note Be careful not to add the same callback multiple times, if
2241  * that's not what you want, because Evas won't check if a callback
2242  * existed before exactly as the one being registered (and thus, call
2243  * it more than once on the event, in this case). This would make
2244  * sense if you passed different functions and/or callback data, only.
2245  */
2246 EAPI void  evas_event_callback_add(Evas *e, Evas_Callback_Type type, Evas_Event_Cb func, const void *data) EINA_ARG_NONNULL(1, 3);
2247
2248 /**
2249  * Add (register) a callback function to a given canvas event with a
2250  * non-default priority set. Except for the priority field, it's exactly the
2251  * same as @ref evas_event_callback_add
2252  *
2253  * @param e Canvas to attach a callback to
2254  * @param type The type of event that will trigger the callback
2255  * @param priority The priority of the callback, lower values called first.
2256  * @param func The (callback) function to be called when the event is
2257  *        triggered
2258  * @param data The data pointer to be passed to @p func
2259  *
2260  * @see evas_event_callback_add
2261  * @since 1.1
2262  */
2263 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);
2264
2265 /**
2266  * Delete a callback function from the canvas.
2267  *
2268  * @param e Canvas to remove a callback from
2269  * @param type The type of event that was triggering the callback
2270  * @param func The function that was to be called when the event was triggered
2271  * @return The data pointer that was to be passed to the callback
2272  *
2273  * This function removes the most recently added callback from the
2274  * canvas @p e which was triggered by the event type @p type and was
2275  * calling the function @p func when triggered. If the removal is
2276  * successful it will also return the data pointer that was passed to
2277  * evas_event_callback_add() when the callback was added to the
2278  * canvas. If not successful @c NULL will be returned.
2279  *
2280  * Example:
2281  * @code
2282  * extern Evas *e;
2283  * void *my_data;
2284  * void focus_in_callback(void *data, Evas *e, void *event_info);
2285  *
2286  * my_data = evas_event_callback_del(ebject, EVAS_CALLBACK_CANVAS_FOCUS_IN, focus_in_callback);
2287  * @endcode
2288  */
2289 EAPI void *evas_event_callback_del(Evas *e, Evas_Callback_Type type, Evas_Event_Cb func) EINA_ARG_NONNULL(1, 3);
2290
2291 /**
2292  * Delete (unregister) a callback function registered to a given
2293  * canvas event.
2294  *
2295  * @param e Canvas to remove an event callback from
2296  * @param type The type of event that was triggering the callback
2297  * @param func The function that was to be called when the event was
2298  *        triggered
2299  * @param data The data pointer that was to be passed to the callback
2300  * @return The data pointer that was to be passed to the callback
2301  *
2302  * This function removes <b>the first</b> added callback from the
2303  * canvas @p e matching the event type @p type, the registered
2304  * function pointer @p func and the callback data pointer @p data. If
2305  * the removal is successful it will also return the data pointer that
2306  * was passed to evas_event_callback_add() (that will be the same as
2307  * the parameter) when the callback(s) was(were) added to the
2308  * canvas. If not successful @c NULL will be returned. A common use
2309  * would be to remove an exact match of a callback.
2310  *
2311  * Example:
2312  * @dontinclude evas-events.c
2313  * @skip evas_event_callback_del_full(evas, EVAS_CALLBACK_RENDER_FLUSH_PRE,
2314  * @until _object_focus_in_cb, NULL);
2315  *
2316  * See the full @ref Example_Evas_Events "example".
2317  *
2318  * @note For deletion of canvas events callbacks filtering by just
2319  * type and function pointer, user evas_event_callback_del().
2320  */
2321 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);
2322
2323 /**
2324  * Push a callback on the post-event callback stack
2325  *
2326  * @param e Canvas to push the callback on
2327  * @param func The function that to be called when the stack is unwound
2328  * @param data The data pointer to be passed to the callback
2329  *
2330  * Evas has a stack of callbacks that get called after all the callbacks for
2331  * an event have triggered (all the objects it triggers on and all the callbacks
2332  * in each object triggered). When all these have been called, the stack is
2333  * unwond from most recently to least recently pushed item and removed from the
2334  * stack calling the callback set for it.
2335  *
2336  * This is intended for doing reverse logic-like processing, example - when a
2337  * child object that happens to get the event later is meant to be able to
2338  * "steal" functions from a parent and thus on unwind of this stack have its
2339  * function called first, thus being able to set flags, or return 0 from the
2340  * post-callback that stops all other post-callbacks in the current stack from
2341  * being called (thus basically allowing a child to take control, if the event
2342  * callback prepares information ready for taking action, but the post callback
2343  * actually does the action).
2344  *
2345  */
2346 EAPI void  evas_post_event_callback_push(Evas *e, Evas_Object_Event_Post_Cb func, const void *data);
2347
2348 /**
2349  * Remove a callback from the post-event callback stack
2350  *
2351  * @param e Canvas to push the callback on
2352  * @param func The function that to be called when the stack is unwound
2353  *
2354  * This removes a callback from the stack added with
2355  * evas_post_event_callback_push(). The first instance of the function in
2356  * the callback stack is removed from being executed when the stack is
2357  * unwound. Further instances may still be run on unwind.
2358  */
2359 EAPI void  evas_post_event_callback_remove(Evas *e, Evas_Object_Event_Post_Cb func);
2360
2361 /**
2362  * Remove a callback from the post-event callback stack
2363  *
2364  * @param e Canvas to push the callback on
2365  * @param func The function that to be called when the stack is unwound
2366  * @param data The data pointer to be passed to the callback
2367  *
2368  * This removes a callback from the stack added with
2369  * evas_post_event_callback_push(). The first instance of the function and data
2370  * in the callback stack is removed from being executed when the stack is
2371  * unwound. Further instances may still be run on unwind.
2372  */
2373 EAPI void  evas_post_event_callback_remove_full(Evas *e, Evas_Object_Event_Post_Cb func, const void *data);
2374
2375 /**
2376  * @defgroup Evas_Event_Freezing_Group Input Events Freezing Functions
2377  *
2378  * Functions that deal with the freezing of input event processing of
2379  * an Evas canvas.
2380  *
2381  * There might be scenarios during a graphical user interface
2382  * program's use when the developer wishes the users wouldn't be able
2383  * to deliver input events to this application. It may, for example,
2384  * be the time for it to populate a view or to change some
2385  * layout. Assuming proper behavior with user interaction during this
2386  * exact time would be hard, as things are in a changing state. The
2387  * programmer can then tell the canvas to ignore input events,
2388  * bringing it back to normal behavior when he/she wants.
2389  *
2390  * Most of the time use of freezing events is done like this:
2391  * @code
2392  * evas_event_freeze(my_evas_canvas);
2393  * function_that_does_work_which_cant_be_interrupted_by_events();
2394  * evas_event_thaw(my_evas_canvas);
2395  * @endcode
2396  *
2397  * Some of the functions in this group are exemplified @ref
2398  * Example_Evas_Events "here".
2399  *
2400  * @ingroup Evas_Canvas_Events
2401  */
2402
2403 /**
2404  * @addtogroup Evas_Event_Freezing_Group
2405  * @{
2406  */
2407
2408 /**
2409  * Set the default set of flags an event begins with
2410  *
2411  * @param e The canvas to set the default event flags of
2412  * @param flags The default flags to use
2413  *
2414  * Events in evas can have an event_flags member. This starts out with
2415  * and initial value (no flags). this lets you set the default flags that
2416  * an event begins with to be @p flags
2417  *
2418  * @since 1.2
2419  */
2420 EAPI void             evas_event_default_flags_set(Evas *e, Evas_Event_Flags flags) EINA_ARG_NONNULL(1);
2421
2422 /**
2423  * Get the defaulty set of flags an event begins with
2424  *
2425  * @param e The canvas to get the default event flags from
2426  * @return The default event flags for that canvas
2427  *
2428  * This gets the default event flags events are produced with when fed in.
2429  *
2430  * @see evas_event_default_flags_set()
2431  * @since 1.2
2432  */
2433 EAPI Evas_Event_Flags evas_event_default_flags_get(const Evas *e) EINA_ARG_NONNULL(1);
2434
2435 /**
2436  * Freeze all input events processing.
2437  *
2438  * @param e The canvas to freeze input events processing on.
2439  *
2440  * This function will indicate to Evas that the canvas @p e is to have
2441  * all input event processing frozen until a matching
2442  * evas_event_thaw() function is called on the same canvas. All events
2443  * of this kind during the freeze will get @b discarded. Every freeze
2444  * call must be matched by a thaw call in order to completely thaw out
2445  * a canvas (i.e. these calls may be nested). The most common use is
2446  * when you don't want the user to interact with your user interface
2447  * when you're populating a view or changing the layout.
2448  *
2449  * Example:
2450  * @dontinclude evas-events.c
2451  * @skip freeze input for 3 seconds
2452  * @until }
2453  * @dontinclude evas-events.c
2454  * @skip let's have our events back
2455  * @until }
2456  *
2457  * See the full @ref Example_Evas_Events "example".
2458  *
2459  * If you run that example, you'll see the canvas ignoring all input
2460  * events for 3 seconds, when the "f" key is pressed. In a more
2461  * realistic code we would be freezing while a toolkit or Edje was
2462  * doing some UI changes, thawing it back afterwards.
2463  */
2464 EAPI void             evas_event_freeze(Evas *e) EINA_ARG_NONNULL(1);
2465
2466 /**
2467  * Thaw a canvas out after freezing (for input events).
2468  *
2469  * @param e The canvas to thaw out.
2470  *
2471  * This will thaw out a canvas after a matching evas_event_freeze()
2472  * call. If this call completely thaws out a canvas, i.e., there's no
2473  * other unbalanced call to evas_event_freeze(), events will start to
2474  * be processed again, but any "missed" events will @b not be
2475  * evaluated.
2476  *
2477  * See evas_event_freeze() for an example.
2478  */
2479 EAPI void             evas_event_thaw(Evas *e) EINA_ARG_NONNULL(1);
2480
2481 /**
2482  * Return the freeze count on input events of a given canvas.
2483  *
2484  * @param e The canvas to fetch the freeze count from.
2485  *
2486  * This returns the number of times the canvas has been told to freeze
2487  * input events. It is possible to call evas_event_freeze() multiple
2488  * times, and these must be matched by evas_event_thaw() calls. This
2489  * call allows the program to discover just how many times things have
2490  * been frozen in case it may want to break out of a deep freeze state
2491  * where the count is high.
2492  *
2493  * Example:
2494  * @code
2495  * extern Evas *evas;
2496  *
2497  * while (evas_event_freeze_get(evas) > 0) evas_event_thaw(evas);
2498  * @endcode
2499  *
2500  */
2501 EAPI int              evas_event_freeze_get(const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
2502
2503 /**
2504  * After thaw of a canvas, re-evaluate the state of objects and call callbacks
2505  *
2506  * @param e The canvas to evaluate after a thaw
2507  *
2508  * This is normally called after evas_event_thaw() to re-evaluate mouse
2509  * containment and other states and thus also call callbacks for mouse in and
2510  * out on new objects if the state change demands it.
2511  */
2512 EAPI void             evas_event_thaw_eval(Evas *e) EINA_ARG_NONNULL(1);
2513
2514 /**
2515  * @}
2516  */
2517
2518 /**
2519  * @defgroup Evas_Event_Feeding_Group Input Events Feeding Functions
2520  *
2521  * Functions to tell Evas that input events happened and should be
2522  * processed.
2523  *
2524  * @warning Most of the time these functions are @b not what you're looking for.
2525  * These functions should only be used if you're not working with ecore evas(or
2526  * another input handling system). If you're not using ecore evas please
2527  * consider using it, in most situation it will make life a lot easier.
2528  *
2529  * As explained in @ref intro_not_evas, Evas does not know how to poll
2530  * for input events, so the developer should do it and then feed such
2531  * events to the canvas to be processed. This is only required if
2532  * operating Evas directly. Modules such as Ecore_Evas do that for
2533  * you.
2534  *
2535  * Some of the functions in this group are exemplified @ref
2536  * Example_Evas_Events "here".
2537  *
2538  * @ingroup Evas_Canvas_Events
2539  */
2540
2541 /**
2542  * @addtogroup Evas_Event_Feeding_Group
2543  * @{
2544  */
2545
2546 /**
2547  * Get the number of mouse or multi presses currently active
2548  *
2549  * @p e The given canvas pointer.
2550  * @return The numer of presses (0 if none active).
2551  *
2552  * @since 1.2
2553  */
2554 EAPI int  evas_event_down_count_get(const Evas *e) EINA_ARG_NONNULL(1);
2555
2556 /**
2557  * Mouse down event feed.
2558  *
2559  * @param e The given canvas pointer.
2560  * @param b The button number.
2561  * @param flags The evas button flags.
2562  * @param timestamp The timestamp of the mouse down event.
2563  * @param data The data for canvas.
2564  *
2565  * This function will set some evas properties that is necessary when
2566  * the mouse button is pressed. It prepares information to be treated
2567  * by the callback function.
2568  *
2569  */
2570 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);
2571
2572 /**
2573  * Mouse up event feed.
2574  *
2575  * @param e The given canvas pointer.
2576  * @param b The button number.
2577  * @param flags evas button flags.
2578  * @param timestamp The timestamp of the mouse up event.
2579  * @param data The data for canvas.
2580  *
2581  * This function will set some evas properties that is necessary when
2582  * the mouse button is released. It prepares information to be treated
2583  * by the callback function.
2584  *
2585  */
2586 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);
2587
2588 /**
2589  * Mouse move event feed.
2590  *
2591  * @param e The given canvas pointer.
2592  * @param x The horizontal position of the mouse pointer.
2593  * @param y The vertical position of the mouse pointer.
2594  * @param timestamp The timestamp of the mouse up event.
2595  * @param data The data for canvas.
2596  *
2597  * This function will set some evas properties that is necessary when
2598  * the mouse is moved from its last position. It prepares information
2599  * to be treated by the callback function.
2600  *
2601  */
2602 EAPI void evas_event_feed_mouse_move(Evas *e, int x, int y, unsigned int timestamp, const void *data) EINA_ARG_NONNULL(1);
2603
2604 /**
2605  * Mouse in event feed.
2606  *
2607  * @param e The given canvas pointer.
2608  * @param timestamp The timestamp of the mouse up event.
2609  * @param data The data for canvas.
2610  *
2611  * This function will set some evas properties that is necessary when
2612  * the mouse in event happens. It prepares information to be treated
2613  * by the callback function.
2614  *
2615  */
2616 EAPI void evas_event_feed_mouse_in(Evas *e, unsigned int timestamp, const void *data) EINA_ARG_NONNULL(1);
2617
2618 /**
2619  * Mouse out event feed.
2620  *
2621  * @param e The given canvas pointer.
2622  * @param timestamp Timestamp of the mouse up event.
2623  * @param data The data for canvas.
2624  *
2625  * This function will set some evas properties that is necessary when
2626  * the mouse out event happens. It prepares information to be treated
2627  * by the callback function.
2628  *
2629  */
2630 EAPI void evas_event_feed_mouse_out(Evas *e, unsigned int timestamp, const void *data) EINA_ARG_NONNULL(1);
2631 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);
2632 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);
2633 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);
2634
2635 /**
2636  * Mouse cancel event feed.
2637  *
2638  * @param e The given canvas pointer.
2639  * @param timestamp The timestamp of the mouse up event.
2640  * @param data The data for canvas.
2641  *
2642  * This function will call evas_event_feed_mouse_up() when a
2643  * mouse cancel event happens.
2644  *
2645  */
2646 EAPI void evas_event_feed_mouse_cancel(Evas *e, unsigned int timestamp, const void *data) EINA_ARG_NONNULL(1);
2647
2648 /**
2649  * Mouse wheel event feed.
2650  *
2651  * @param e The given canvas pointer.
2652  * @param direction The wheel mouse direction.
2653  * @param z How much mouse wheel was scrolled up or down.
2654  * @param timestamp The timestamp of the mouse up event.
2655  * @param data The data for canvas.
2656  *
2657  * This function will set some evas properties that is necessary when
2658  * the mouse wheel is scrolled up or down. It prepares information to
2659  * be treated by the callback function.
2660  *
2661  */
2662 EAPI void evas_event_feed_mouse_wheel(Evas *e, int direction, int z, unsigned int timestamp, const void *data) EINA_ARG_NONNULL(1);
2663
2664 /**
2665  * Key down event feed
2666  *
2667  * @param e The canvas to thaw out
2668  * @param keyname  Name of the key
2669  * @param key The key pressed.
2670  * @param string A String
2671  * @param compose The compose string
2672  * @param timestamp Timestamp of the mouse up event
2673  * @param data Data for canvas.
2674  *
2675  * This function will set some evas properties that is necessary when
2676  * a key is pressed. It prepares information to be treated by the
2677  * callback function.
2678  *
2679  */
2680 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);
2681
2682 /**
2683  * Key up event feed
2684  *
2685  * @param e The canvas to thaw out
2686  * @param keyname  Name of the key
2687  * @param key The key released.
2688  * @param string string
2689  * @param compose compose
2690  * @param timestamp Timestamp of the mouse up event
2691  * @param data Data for canvas.
2692  *
2693  * This function will set some evas properties that is necessary when
2694  * a key is released. It prepares information to be treated by the
2695  * callback function.
2696  *
2697  */
2698 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);
2699
2700 /**
2701  * Hold event feed
2702  *
2703  * @param e The given canvas pointer.
2704  * @param hold The hold.
2705  * @param timestamp The timestamp of the mouse up event.
2706  * @param data The data for canvas.
2707  *
2708  * This function makes the object to stop sending events.
2709  *
2710  */
2711 EAPI void evas_event_feed_hold(Evas *e, int hold, unsigned int timestamp, const void *data) EINA_ARG_NONNULL(1);
2712
2713 /**
2714  * Re feed event.
2715  *
2716  * @param e The given canvas pointer.
2717  * @param event_copy the event to refeed
2718  * @param event_type Event type
2719  *
2720  * This function re-feeds the event pointed by event_copy
2721  *
2722  * This function call evas_event_feed_* functions, so it can
2723  * cause havoc if not used wisely. Please use it responsibly.
2724  */
2725 EAPI void evas_event_refeed_event(Evas *e, void *event_copy, Evas_Callback_Type event_type) EINA_ARG_NONNULL(1);
2726
2727 /**
2728  * @}
2729  */
2730
2731 /**
2732  * @}
2733  */
2734
2735 /**
2736  * @defgroup Evas_Image_Group Image Functions
2737  *
2738  * Functions that deals with images at canvas level.
2739  *
2740  * @ingroup Evas_Canvas
2741  */
2742
2743 /**
2744  * @addtogroup Evas_Image_Group
2745  * @{
2746  */
2747
2748 /**
2749  * Flush the image cache of the canvas.
2750  *
2751  * @param e The given evas pointer.
2752  *
2753  * This function flushes image cache of canvas.
2754  *
2755  */
2756 EAPI void      evas_image_cache_flush(Evas *e) EINA_ARG_NONNULL(1);
2757
2758 /**
2759  * Reload the image cache
2760  *
2761  * @param e The given evas pointer.
2762  *
2763  * This function reloads the image cache of canvas.
2764  *
2765  */
2766 EAPI void      evas_image_cache_reload(Evas *e) EINA_ARG_NONNULL(1);
2767
2768 /**
2769  * Set the image cache.
2770  *
2771  * @param e The given evas pointer.
2772  * @param size The cache size.
2773  *
2774  * This function sets the image cache of canvas in bytes.
2775  *
2776  */
2777 EAPI void      evas_image_cache_set(Evas *e, int size) EINA_ARG_NONNULL(1);
2778
2779 /**
2780  * Get the image cache
2781  *
2782  * @param e The given evas pointer.
2783  *
2784  * This function returns the image cache size of canvas in bytes.
2785  *
2786  */
2787 EAPI int       evas_image_cache_get(const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
2788
2789 /**
2790  * Get the maximum image size evas can possibly handle
2791  *
2792  * @param e The given evas pointer.
2793  * @param maxw Pointer to hold the return value in pixels of the maxumum width
2794  * @param maxh Pointer to hold the return value in pixels of the maximum height
2795  *
2796  * This function returns the larges image or surface size that evas can handle
2797  * in pixels, and if there is one, returns @c EINA_TRUE. It returns
2798  * @c EINA_FALSE if no extra constraint on maximum image size exists. You still
2799  * should check the return values of @p maxw and @p maxh as there may still be
2800  * a limit, just a much higher one.
2801  *
2802  * @since 1.1
2803  */
2804 EAPI Eina_Bool evas_image_max_size_get(const Evas *e, int *maxw, int *maxh) EINA_ARG_NONNULL(1);
2805
2806 /**
2807  * @}
2808  */
2809
2810 /**
2811  * @defgroup Evas_Font_Group Font Functions
2812  *
2813  * Functions that deals with fonts.
2814  *
2815  * @ingroup Evas_Canvas
2816  */
2817
2818 /**
2819  * Changes the font hinting for the given evas.
2820  *
2821  * @param e The given evas.
2822  * @param hinting The hinting to use, one of #EVAS_FONT_HINTING_NONE,
2823  *        #EVAS_FONT_HINTING_AUTO, #EVAS_FONT_HINTING_BYTECODE.
2824  * @ingroup Evas_Font_Group
2825  */
2826 EAPI void                    evas_font_hinting_set(Evas *e, Evas_Font_Hinting_Flags hinting) EINA_ARG_NONNULL(1);
2827
2828 /**
2829  * Retrieves the font hinting used by the given evas.
2830  *
2831  * @param e The given evas to query.
2832  * @return The hinting in use, one of #EVAS_FONT_HINTING_NONE,
2833  *         #EVAS_FONT_HINTING_AUTO, #EVAS_FONT_HINTING_BYTECODE.
2834  * @ingroup Evas_Font_Group
2835  */
2836 EAPI Evas_Font_Hinting_Flags evas_font_hinting_get(const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
2837
2838 /**
2839  * Checks if the font hinting is supported by the given evas.
2840  *
2841  * @param e The given evas to query.
2842  * @param hinting The hinting to use, one of #EVAS_FONT_HINTING_NONE,
2843  *        #EVAS_FONT_HINTING_AUTO, #EVAS_FONT_HINTING_BYTECODE.
2844  * @return @c EINA_TRUE if it is supported, @c EINA_FALSE otherwise.
2845  * @ingroup Evas_Font_Group
2846  */
2847 EAPI Eina_Bool               evas_font_hinting_can_hint(const Evas *e, Evas_Font_Hinting_Flags hinting) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
2848
2849 /**
2850  * Force the given evas and associated engine to flush its font cache.
2851  *
2852  * @param e The given evas to flush font cache.
2853  * @ingroup Evas_Font_Group
2854  */
2855 EAPI void                    evas_font_cache_flush(Evas *e) EINA_ARG_NONNULL(1);
2856
2857 /**
2858  * Changes the size of font cache of the given evas.
2859  *
2860  * @param e The given evas to flush font cache.
2861  * @param size The size, in bytes.
2862  *
2863  * @ingroup Evas_Font_Group
2864  */
2865 EAPI void                    evas_font_cache_set(Evas *e, int size) EINA_ARG_NONNULL(1);
2866
2867 /**
2868  * Changes the size of font cache of the given evas.
2869  *
2870  * @param e The given evas to flush font cache.
2871  * @return The size, in bytes.
2872  *
2873  * @ingroup Evas_Font_Group
2874  */
2875 EAPI int                     evas_font_cache_get(const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
2876
2877 /**
2878  * List of available font descriptions known or found by this evas.
2879  *
2880  * The list depends on Evas compile time configuration, such as
2881  * fontconfig support, and the paths provided at runtime as explained
2882  * in @ref Evas_Font_Path_Group.
2883  *
2884  * @param e The evas instance to query.
2885  * @return a newly allocated list of strings. Do not change the
2886  *         strings.  Be sure to call evas_font_available_list_free()
2887  *         after you're done.
2888  *
2889  * @ingroup Evas_Font_Group
2890  */
2891 EAPI Eina_List              *evas_font_available_list(const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
2892
2893 /**
2894  * Free list of font descriptions returned by evas_font_dir_available_list().
2895  *
2896  * @param e The evas instance that returned such list.
2897  * @param available the list returned by evas_font_dir_available_list().
2898  *
2899  * @ingroup Evas_Font_Group
2900  */
2901 EAPI void                    evas_font_available_list_free(Evas *e, Eina_List *available) EINA_ARG_NONNULL(1);
2902
2903 /**
2904  * @defgroup Evas_Font_Path_Group Font Path Functions
2905  *
2906  * Functions that edit the paths being used to load fonts.
2907  *
2908  * @ingroup Evas_Font_Group
2909  */
2910
2911 /**
2912  * Removes all font paths loaded into memory for the given evas.
2913  * @param   e The given evas.
2914  * @ingroup Evas_Font_Path_Group
2915  */
2916 EAPI void                    evas_font_path_clear(Evas *e) EINA_ARG_NONNULL(1);
2917
2918 /**
2919  * Appends a font path to the list of font paths used by the given evas.
2920  * @param   e    The given evas.
2921  * @param   path The new font path.
2922  * @ingroup Evas_Font_Path_Group
2923  */
2924 EAPI void                    evas_font_path_append(Evas *e, const char *path) EINA_ARG_NONNULL(1, 2);
2925
2926 /**
2927  * Prepends a font path to the list of font paths used by the given evas.
2928  * @param   e The given evas.
2929  * @param   path The new font path.
2930  * @ingroup Evas_Font_Path_Group
2931  */
2932 EAPI void                    evas_font_path_prepend(Evas *e, const char *path) EINA_ARG_NONNULL(1, 2);
2933
2934 /**
2935  * Retrieves the list of font paths used by the given evas.
2936  * @param   e The given evas.
2937  * @return  The list of font paths used.
2938  * @ingroup Evas_Font_Path_Group
2939  */
2940 EAPI const Eina_List        *evas_font_path_list(const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
2941
2942 /**
2943  * @defgroup Evas_Object_Group Generic Object Functions
2944  *
2945  * Functions that manipulate generic Evas objects.
2946  *
2947  * All Evas displaying units are Evas objects. One handles them all by
2948  * means of the handle ::Evas_Object. Besides Evas treats their
2949  * objects equally, they have @b types, which define their specific
2950  * behavior (and individual API).
2951  *
2952  * Evas comes with a set of built-in object types:
2953  *   - rectangle,
2954  *   - line,
2955  *   - polygon,
2956  *   - text,
2957  *   - textblock and
2958  *   - image.
2959  *
2960  * These functions apply to @b any Evas object, whichever type that
2961  * may have.
2962  *
2963  * @note The built-in types which are most used are rectangles, text
2964  * and images. In fact, with these ones one can create 2D interfaces
2965  * of arbitrary complexity and EFL makes it easy.
2966  */
2967
2968 /**
2969  * @defgroup Evas_Object_Group_Basic Basic Object Manipulation
2970  *
2971  * Almost every evas object created will have some generic function used to
2972  * manipulate it. That's because there are a number of basic actions to be done
2973  * to objects that are irrespective of the object's type, things like:
2974  * @li Showing/Hiding
2975  * @li Setting(and getting) geometry
2976  * @li Bring up or down a layer
2977  * @li Color management
2978  * @li Handling focus
2979  * @li Clipping
2980  * @li Reference counting
2981  *
2982  * All of this issues are handled through the functions here grouped. Examples
2983  * of these function can be seen in @ref Example_Evas_Object_Manipulation(which
2984  * deals with the most common ones) and in @ref Example_Evas_Stacking(which
2985  * deals with stacking functions).
2986  *
2987  * @ingroup Evas_Object_Group
2988  */
2989
2990 /**
2991  * @addtogroup Evas_Object_Group_Basic
2992  * @{
2993  */
2994
2995 /**
2996  * Clip one object to another.
2997  *
2998  * @param obj The object to be clipped
2999  * @param clip The object to clip @p obj by
3000  *
3001  * This function will clip the object @p obj to the area occupied by
3002  * the object @p clip. This means the object @p obj will only be
3003  * visible within the area occupied by the clipping object (@p clip).
3004  *
3005  * The color of the object being clipped will be multiplied by the
3006  * color of the clipping one, so the resulting color for the former
3007  * will be <code>RESULT = (OBJ * CLIP) / (255 * 255)</code>, per color
3008  * element (red, green, blue and alpha).
3009  *
3010  * Clipping is recursive, so clipping objects may be clipped by
3011  * others, and their color will in term be multiplied. You may @b not
3012  * set up circular clipping lists (i.e. object 1 clips object 2, which
3013  * clips object 1): the behavior of Evas is undefined in this case.
3014  *
3015  * Objects which do not clip others are visible in the canvas as
3016  * normal; <b>those that clip one or more objects become invisible
3017  * themselves</b>, only affecting what they clip. If an object ceases
3018  * to have other objects being clipped by it, it will become visible
3019  * again.
3020  *
3021  * The visibility of an object affects the objects that are clipped by
3022  * it, so if the object clipping others is not shown (as in
3023  * evas_object_show()), the objects clipped by it will not be shown
3024  * either.
3025  *
3026  * If @p obj was being clipped by another object when this function is
3027  * called, it gets implicitly removed from the old clipper's domain
3028  * and is made now to be clipped by its new clipper.
3029  *
3030  * The following figure illustrates some clipping in Evas:
3031  *
3032  * @image html clipping.png
3033  * @image rtf clipping.png
3034  * @image latex clipping.eps
3035  *
3036  * @note At the moment the <b>only objects that can validly be used to
3037  * clip other objects are rectangle objects</b>. All other object
3038  * types are invalid and the result of using them is undefined. The
3039  * clip object @p clip must be a valid object, but can also be @c
3040  * NULL, in which case the effect of this function is the same as
3041  * calling evas_object_clip_unset() on the @p obj object.
3042  *
3043  * Example:
3044  * @dontinclude evas-object-manipulation.c
3045  * @skip solid white clipper (note that it's the default color for a
3046  * @until evas_object_show(d.clipper);
3047  *
3048  * See the full @ref Example_Evas_Object_Manipulation "example".
3049  */
3050 EAPI void             evas_object_clip_set(Evas_Object *obj, Evas_Object *clip) EINA_ARG_NONNULL(1, 2);
3051
3052 /**
3053  * Get the object clipping @p obj (if any).
3054  *
3055  * @param obj The object to get the clipper from
3056  *
3057  * This function returns the object clipping @p obj. If @p obj is
3058  * not being clipped at all, @c NULL is returned. The object @p obj
3059  * must be a valid ::Evas_Object.
3060  *
3061  * See also evas_object_clip_set(), evas_object_clip_unset() and
3062  * evas_object_clipees_get().
3063  *
3064  * Example:
3065  * @dontinclude evas-object-manipulation.c
3066  * @skip if (evas_object_clip_get(d.img) == d.clipper)
3067  * @until return
3068  *
3069  * See the full @ref Example_Evas_Object_Manipulation "example".
3070  */
3071 EAPI Evas_Object     *evas_object_clip_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
3072
3073 /**
3074  * Disable/cease clipping on a clipped @p obj object.
3075  *
3076  * @param obj The object to cease clipping on
3077  *
3078  * This function disables clipping for the object @p obj, if it was
3079  * already clipped, i.e., its visibility and color get detached from
3080  * the previous clipper. If it wasn't, this has no effect. The object
3081  * @p obj must be a valid ::Evas_Object.
3082  *
3083  * See also evas_object_clip_set() (for an example),
3084  * evas_object_clipees_get() and evas_object_clip_get().
3085  *
3086  */
3087 EAPI void             evas_object_clip_unset(Evas_Object *obj);
3088
3089 /**
3090  * Return a list of objects currently clipped by @p obj.
3091  *
3092  * @param obj The object to get a list of clippees from
3093  * @return a list of objects being clipped by @p obj
3094  *
3095  * This returns the internal list handle that contains all objects
3096  * clipped by the object @p obj. If none are clipped by it, the call
3097  * returns @c NULL. This list is only valid until the clip list is
3098  * changed and should be fetched again with another call to
3099  * evas_object_clipees_get() if any objects being clipped by this
3100  * object are unclipped, clipped by a new object, deleted or get the
3101  * clipper deleted. These operations will invalidate the list
3102  * returned, so it should not be used anymore after that point. Any
3103  * use of the list after this may have undefined results, possibly
3104  * leading to crashes. The object @p obj must be a valid
3105  * ::Evas_Object.
3106  *
3107  * See also evas_object_clip_set(), evas_object_clip_unset() and
3108  * evas_object_clip_get().
3109  *
3110  * Example:
3111  * @code
3112  * extern Evas_Object *obj;
3113  * Evas_Object *clipper;
3114  *
3115  * clipper = evas_object_clip_get(obj);
3116  * if (clipper)
3117  *   {
3118  *     Eina_List *clippees, *l;
3119  *     Evas_Object *obj_tmp;
3120  *
3121  *     clippees = evas_object_clipees_get(clipper);
3122  *     printf("Clipper clips %i objects\n", eina_list_count(clippees));
3123  *     EINA_LIST_FOREACH(clippees, l, obj_tmp)
3124  *         evas_object_show(obj_tmp);
3125  *   }
3126  * @endcode
3127  */
3128 EAPI const Eina_List *evas_object_clipees_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
3129
3130 /**
3131  * Sets or unsets a given object as the currently focused one on its
3132  * canvas.
3133  *
3134  * @param obj The object to be focused or unfocused.
3135  * @param focus @c EINA_TRUE, to set it as focused or @c EINA_FALSE,
3136  * to take away the focus from it.
3137  *
3138  * Changing focus only affects where (key) input events go. There can
3139  * be only one object focused at any time. If @p focus is @c EINA_TRUE,
3140  * @p obj will be set as the currently focused object and it will
3141  * receive all keyboard events that are not exclusive key grabs on
3142  * other objects.
3143  *
3144  * Example:
3145  * @dontinclude evas-events.c
3146  * @skip evas_object_focus_set
3147  * @until evas_object_focus_set
3148  *
3149  * See the full example @ref Example_Evas_Events "here".
3150  *
3151  * @see evas_object_focus_get
3152  * @see evas_focus_get
3153  * @see evas_object_key_grab
3154  * @see evas_object_key_ungrab
3155  */
3156 EAPI void             evas_object_focus_set(Evas_Object *obj, Eina_Bool focus) EINA_ARG_NONNULL(1);
3157
3158 /**
3159  * Retrieve whether an object has the focus.
3160  *
3161  * @param obj The object to retrieve focus information from.
3162  * @return @c EINA_TRUE if the object has the focus, @c EINA_FALSE otherwise.
3163  *
3164  * If the passed object is the currently focused one, @c EINA_TRUE is
3165  * returned. @c EINA_FALSE is returned, otherwise.
3166  *
3167  * Example:
3168  * @dontinclude evas-events.c
3169  * @skip And again
3170  * @until something is bad
3171  *
3172  * See the full example @ref Example_Evas_Events "here".
3173  *
3174  * @see evas_object_focus_set
3175  * @see evas_focus_get
3176  * @see evas_object_key_grab
3177  * @see evas_object_key_ungrab
3178  */
3179 EAPI Eina_Bool        evas_object_focus_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
3180
3181 /**
3182  * Sets the layer of its canvas that the given object will be part of.
3183  *
3184  * @param   obj The given Evas object.
3185  * @param   l   The number of the layer to place the object on.
3186  *          Must be between #EVAS_LAYER_MIN and #EVAS_LAYER_MAX.
3187  *
3188  * If you don't use this function, you'll be dealing with an @b unique
3189  * layer of objects, the default one. Additional layers are handy when
3190  * you don't want a set of objects to interfere with another set with
3191  * regard to @b stacking. Two layers are completely disjoint in that
3192  * matter.
3193  *
3194  * This is a low-level function, which you'd be using when something
3195  * should be always on top, for example.
3196  *
3197  * @warning Be careful, it doesn't make sense to change the layer of
3198  * smart objects' children. Smart objects have a layer of their own,
3199  * which should contain all their children objects.
3200  *
3201  * @see evas_object_layer_get()
3202  */
3203 EAPI void             evas_object_layer_set(Evas_Object *obj, short l) EINA_ARG_NONNULL(1);
3204
3205 /**
3206  * Retrieves the layer of its canvas that the given object is part of.
3207  *
3208  * @param   obj The given Evas object to query layer from
3209  * @return  Number of its layer
3210  *
3211  * @see evas_object_layer_set()
3212  */
3213 EAPI short            evas_object_layer_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
3214
3215 /**
3216  * Sets the name of the given Evas object to the given name.
3217  *
3218  * @param   obj  The given object.
3219  * @param   name The given name.
3220  *
3221  * There might be occasions where one would like to name his/her
3222  * objects.
3223  *
3224  * Example:
3225  * @dontinclude evas-events.c
3226  * @skip d.bg = evas_object_rectangle_add(d.canvas);
3227  * @until evas_object_name_set(d.bg, "our dear rectangle");
3228  *
3229  * See the full @ref Example_Evas_Events "example".
3230  */
3231 EAPI void             evas_object_name_set(Evas_Object *obj, const char *name) EINA_ARG_NONNULL(1);
3232
3233 /**
3234  * Retrieves the name of the given Evas object.
3235  *
3236  * @param   obj The given object.
3237  * @return  The name of the object or @c NULL, if no name has been given
3238  *          to it.
3239  *
3240  * Example:
3241  * @dontinclude evas-events.c
3242  * @skip fprintf(stdout, "An object got focused: %s\n",
3243  * @until evas_focus_get
3244  *
3245  * See the full @ref Example_Evas_Events "example".
3246  */
3247 EAPI const char      *evas_object_name_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
3248
3249 /**
3250  * Increments object reference count to defer its deletion.
3251  *
3252  * @param obj The given Evas object to reference
3253  *
3254  * This increments the reference count of an object, which if greater
3255  * than 0 will defer deletion by evas_object_del() until all
3256  * references are released back (counter back to 0). References cannot
3257  * go below 0 and unreferencing past that will result in the reference
3258  * count being limited to 0. References are limited to <c>2^32 - 1</c>
3259  * for an object. Referencing it more than this will result in it
3260  * being limited to this value.
3261  *
3262  * @see evas_object_unref()
3263  * @see evas_object_del()
3264  *
3265  * @note This is a <b>very simple</b> reference counting mechanism! For
3266  * instance, Evas is not ready to check for pending references on a
3267  * canvas deletion, or things like that. This is useful on scenarios
3268  * where, inside a code block, callbacks exist which would possibly
3269  * delete an object we are operating on afterwards. Then, one would
3270  * evas_object_ref() it on the beginning of the block and
3271  * evas_object_unref() it on the end. It would then be deleted at this
3272  * point, if it should be.
3273  *
3274  * Example:
3275  * @code
3276  *  evas_object_ref(obj);
3277  *
3278  *  // action here...
3279  *  evas_object_smart_callback_call(obj, SIG_SELECTED, NULL);
3280  *  // more action here...
3281  *  evas_object_unref(obj);
3282  * @endcode
3283  *
3284  * @ingroup Evas_Object_Group_Basic
3285  * @since 1.1
3286  */
3287 EAPI void             evas_object_ref(Evas_Object *obj);
3288
3289 /**
3290  * Decrements object reference count.
3291  *
3292  * @param obj The given Evas object to unreference
3293  *
3294  * This decrements the reference count of an object. If the object has
3295  * had evas_object_del() called on it while references were more than
3296  * 0, it will be deleted at the time this function is called and puts
3297  * the counter back to 0. See evas_object_ref() for more information.
3298  *
3299  * @see evas_object_ref() (for an example)
3300  * @see evas_object_del()
3301  *
3302  * @ingroup Evas_Object_Group_Basic
3303  * @since 1.1
3304  */
3305 EAPI void             evas_object_unref(Evas_Object *obj);
3306
3307 /**
3308  * Get the object reference count.
3309  *
3310  * @param obj The given Evas object to query
3311  *
3312  * This gets the reference count for an object (normally 0 until it is
3313  * referenced). Values of 1 or greater mean that someone is holding a
3314  * reference to this object that needs to be unreffed before it can be
3315  * deleted.
3316  *
3317  * @see evas_object_ref()
3318  * @see evas_object_unref()
3319  * @see evas_object_del()
3320  *
3321  * @ingroup Evas_Object_Group_Basic
3322  * @since 1.2
3323  */
3324 EAPI int              evas_object_ref_get(const Evas_Object *obj);
3325
3326 /**
3327  * Marks the given Evas object for deletion (when Evas will free its
3328  * memory).
3329  *
3330  * @param obj The given Evas object.
3331  *
3332  * This call will mark @p obj for deletion, which will take place
3333  * whenever it has no more references to it (see evas_object_ref() and
3334  * evas_object_unref()).
3335  *
3336  * At actual deletion time, which may or may not be just after this
3337  * call, ::EVAS_CALLBACK_DEL and ::EVAS_CALLBACK_FREE callbacks will
3338  * be called. If the object currently had the focus, its
3339  * ::EVAS_CALLBACK_FOCUS_OUT callback will also be called.
3340  *
3341  * @see evas_object_ref()
3342  * @see evas_object_unref()
3343  *
3344  * @ingroup Evas_Object_Group_Basic
3345  */
3346 EAPI void             evas_object_del(Evas_Object *obj) EINA_ARG_NONNULL(1);
3347
3348 /**
3349  * Move the given Evas object to the given location inside its
3350  * canvas' viewport.
3351  *
3352  * @param obj The given Evas object.
3353  * @param x   X position to move the object to, in canvas units.
3354  * @param y   Y position to move the object to, in canvas units.
3355  *
3356  * Besides being moved, the object's ::EVAS_CALLBACK_MOVE callback
3357  * will be called.
3358  *
3359  * @note Naturally, newly created objects are placed at the canvas'
3360  * origin: <code>0, 0</code>.
3361  *
3362  * Example:
3363  * @dontinclude evas-object-manipulation.c
3364  * @skip evas_object_image_border_set(d.clipper_border, 3, 3, 3, 3);
3365  * @until evas_object_show
3366  *
3367  * See the full @ref Example_Evas_Object_Manipulation "example".
3368  *
3369  * @ingroup Evas_Object_Group_Basic
3370  */
3371 EAPI void             evas_object_move(Evas_Object *obj, Evas_Coord x, Evas_Coord y) EINA_ARG_NONNULL(1);
3372
3373 /**
3374  * Changes the size of the given Evas object.
3375  *
3376  * @param obj The given Evas object.
3377  * @param w   The new width of the Evas object.
3378  * @param h   The new height of the Evas object.
3379  *
3380  * Besides being resized, the object's ::EVAS_CALLBACK_RESIZE callback
3381  * will be called.
3382  *
3383  * @note Newly created objects have zeroed dimensions. Then, you most
3384  * probably want to use evas_object_resize() on them after they are
3385  * created.
3386  *
3387  * @note Be aware that resizing an object changes its drawing area,
3388  * but that does imply the object is rescaled! For instance, images
3389  * are filled inside their drawing area using the specifications of
3390  * evas_object_image_fill_set(). Thus to scale the image to match
3391  * exactly your drawing area, you need to change the
3392  * evas_object_image_fill_set() as well.
3393  *
3394  * @note This is more evident in images, but text, textblock, lines
3395  * and polygons will behave similarly. Check their specific APIs to
3396  * know how to achieve your desired behavior. Consider the following
3397  * example:
3398  *
3399  * @code
3400  * // rescale image to fill exactly its area without tiling:
3401  * evas_object_resize(img, w, h);
3402  * evas_object_image_fill_set(img, 0, 0, w, h);
3403  * @endcode
3404  *
3405  * @ingroup Evas_Object_Group_Basic
3406  */
3407 EAPI void             evas_object_resize(Evas_Object *obj, Evas_Coord w, Evas_Coord h) EINA_ARG_NONNULL(1);
3408
3409 /**
3410  * Retrieves the position and (rectangular) size of the given Evas
3411  * object.
3412  *
3413  * @param obj The given Evas object.
3414  * @param x Pointer to an integer in which to store the X coordinate
3415  *          of the object.
3416  * @param y Pointer to an integer in which to store the Y coordinate
3417  *          of the object.
3418  * @param w Pointer to an integer in which to store the width of the
3419  *          object.
3420  * @param h Pointer to an integer in which to store the height of the
3421  *          object.
3422  *
3423  * The position, naturally, will be relative to the top left corner of
3424  * the canvas' viewport.
3425  *
3426  * @note Use @c NULL pointers on the geometry components you're not
3427  * interested in: they'll be ignored by the function.
3428  *
3429  * Example:
3430  * @dontinclude evas-events.c
3431  * @skip int w, h, cw, ch;
3432  * @until return
3433  *
3434  * See the full @ref Example_Evas_Events "example".
3435  *
3436  * @ingroup Evas_Object_Group_Basic
3437  */
3438 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);
3439
3440 /**
3441  * Makes the given Evas object visible.
3442  *
3443  * @param obj The given Evas object.
3444  *
3445  * Besides becoming visible, the object's ::EVAS_CALLBACK_SHOW
3446  * callback will be called.
3447  *
3448  * @see evas_object_hide() for more on object visibility.
3449  * @see evas_object_visible_get()
3450  *
3451  * @ingroup Evas_Object_Group_Basic
3452  */
3453 EAPI void             evas_object_show(Evas_Object *obj) EINA_ARG_NONNULL(1);
3454
3455 /**
3456  * Makes the given Evas object invisible.
3457  *
3458  * @param obj The given Evas object.
3459  *
3460  * Hidden objects, besides not being shown at all in your canvas,
3461  * won't be checked for changes on the canvas rendering
3462  * process. Furthermore, they will not catch input events. Thus, they
3463  * are much ligher (in processing needs) than an object that is
3464  * invisible due to indirect causes, such as being clipped or out of
3465  * the canvas' viewport.
3466  *
3467  * Besides becoming hidden, @p obj object's ::EVAS_CALLBACK_SHOW
3468  * callback will be called.
3469  *
3470  * @note All objects are created in the hidden state! If you want them
3471  * shown, use evas_object_show() after their creation.
3472  *
3473  * @see evas_object_show()
3474  * @see evas_object_visible_get()
3475  *
3476  * Example:
3477  * @dontinclude evas-object-manipulation.c
3478  * @skip if (evas_object_visible_get(d.clipper))
3479  * @until return
3480  *
3481  * See the full @ref Example_Evas_Object_Manipulation "example".
3482  *
3483  * @ingroup Evas_Object_Group_Basic
3484  */
3485 EAPI void             evas_object_hide(Evas_Object *obj) EINA_ARG_NONNULL(1);
3486
3487 /**
3488  * Retrieves whether or not the given Evas object is visible.
3489  *
3490  * @param   obj The given Evas object.
3491  * @return @c EINA_TRUE if the object is visible, @c EINA_FALSE
3492  * otherwise.
3493  *
3494  * This retrieves an object's visibility as the one enforced by
3495  * evas_object_show() and evas_object_hide().
3496  *
3497  * @note The value returned isn't, by any means, influenced by
3498  * clippers covering @p obj, it being out of its canvas' viewport or
3499  * stacked below other object.
3500  *
3501  * @see evas_object_show()
3502  * @see evas_object_hide() (for an example)
3503  *
3504  * @ingroup Evas_Object_Group_Basic
3505  */
3506 EAPI Eina_Bool        evas_object_visible_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
3507
3508 /**
3509  * Sets the general/main color of the given Evas object to the given
3510  * one.
3511  *
3512  * @param obj The given Evas object.
3513  * @param r   The red component of the given color.
3514  * @param g   The green component of the given color.
3515  * @param b   The blue component of the given color.
3516  * @param a   The alpha component of the given color.
3517  *
3518  * @see evas_object_color_get() (for an example)
3519  * @note These color values are expected to be premultiplied by @p a.
3520  *
3521  * @ingroup Evas_Object_Group_Basic
3522  */
3523 EAPI void             evas_object_color_set(Evas_Object *obj, int r, int g, int b, int a) EINA_ARG_NONNULL(1);
3524
3525 /**
3526  * Retrieves the general/main color of the given Evas object.
3527  *
3528  * @param obj The given Evas object to retrieve color from.
3529  * @param r Pointer to an integer in which to store the red component
3530  *          of the color.
3531  * @param g Pointer to an integer in which to store the green
3532  *          component of the color.
3533  * @param b Pointer to an integer in which to store the blue component
3534  *          of the color.
3535  * @param a Pointer to an integer in which to store the alpha
3536  *          component of the color.
3537  *
3538  * Retrieves the “main” color's RGB component (and alpha channel)
3539  * values, <b>which range from 0 to 255</b>. For the alpha channel,
3540  * which defines the object's transparency level, 0 means totally
3541  * transparent, while 255 means opaque. These color values are
3542  * premultiplied by the alpha value.
3543  *
3544  * Usually you’ll use this attribute for text and rectangle objects,
3545  * where the “main” color is their unique one. If set for objects
3546  * which themselves have colors, like the images one, those colors get
3547  * modulated by this one.
3548  *
3549  * @note All newly created Evas rectangles get the default color
3550  * values of <code>255 255 255 255</code> (opaque white).
3551  *
3552  * @note Use @c NULL pointers on the components you're not interested
3553  * in: they'll be ignored by the function.
3554  *
3555  * Example:
3556  * @dontinclude evas-object-manipulation.c
3557  * @skip int alpha, r, g, b;
3558  * @until return
3559  *
3560  * See the full @ref Example_Evas_Object_Manipulation "example".
3561  *
3562  * @ingroup Evas_Object_Group_Basic
3563  */
3564 EAPI void             evas_object_color_get(const Evas_Object *obj, int *r, int *g, int *b, int *a) EINA_ARG_NONNULL(1);
3565
3566 /**
3567  * Retrieves the Evas canvas that the given object lives on.
3568  *
3569  * @param   obj The given Evas object.
3570  * @return  A pointer to the canvas where the object is on.
3571  *
3572  * This function is most useful at code contexts where you need to
3573  * operate on the canvas but have only the object pointer.
3574  *
3575  * @ingroup Evas_Object_Group_Basic
3576  */
3577 EAPI Evas            *evas_object_evas_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
3578
3579 /**
3580  * Retrieves the type of the given Evas object.
3581  *
3582  * @param obj The given object.
3583  * @return The type of the object.
3584  *
3585  * For Evas' builtin types, the return strings will be one of:
3586  *   - <c>"rectangle"</c>,
3587  *   - <c>"line"</c>,
3588  *   - <c>"polygon"</c>,
3589  *   - <c>"text"</c>,
3590  *   - <c>"textblock"</c> and
3591  *   - <c>"image"</c>.
3592  *
3593  * For Evas smart objects (see @ref Evas_Smart_Group), the name of the
3594  * smart class itself is returned on this call. For the built-in smart
3595  * objects, these names are:
3596  *   - <c>"EvasObjectSmartClipped"</c>, for the clipped smart object
3597  *   - <c>"Evas_Object_Box"</c>, for the box object and
3598  *   - <c>"Evas_Object_Table"</c>, for the table object.
3599  *
3600  * Example:
3601  * @dontinclude evas-object-manipulation.c
3602  * @skip d.img = evas_object_image_filled_add(d.canvas);
3603  * @until border on the
3604  *
3605  * See the full @ref Example_Evas_Object_Manipulation "example".
3606  */
3607 EAPI const char      *evas_object_type_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
3608
3609 /**
3610  * Raise @p obj to the top of its layer.
3611  *
3612  * @param obj the object to raise
3613  *
3614  * @p obj will, then, be the highest one in the layer it belongs
3615  * to. Object on other layers won't get touched.
3616  *
3617  * @see evas_object_stack_above()
3618  * @see evas_object_stack_below()
3619  * @see evas_object_lower()
3620  */
3621 EAPI void             evas_object_raise(Evas_Object *obj) EINA_ARG_NONNULL(1);
3622
3623 /**
3624  * Lower @p obj to the bottom of its layer.
3625  *
3626  * @param obj the object to lower
3627  *
3628  * @p obj will, then, be the lowest one in the layer it belongs
3629  * to. Objects on other layers won't get touched.
3630  *
3631  * @see evas_object_stack_above()
3632  * @see evas_object_stack_below()
3633  * @see evas_object_raise()
3634  */
3635 EAPI void             evas_object_lower(Evas_Object *obj) EINA_ARG_NONNULL(1);
3636
3637 /**
3638  * Stack @p obj immediately above @p above
3639  *
3640  * @param obj the object to stack
3641  * @param above the object above which to stack
3642  *
3643  * Objects, in a given canvas, are stacked in the order they get added
3644  * to it.  This means that, if they overlap, the highest ones will
3645  * cover the lowest ones, in that order. This function is a way to
3646  * change the stacking order for the objects.
3647  *
3648  * This function is intended to be used with <b>objects belonging to
3649  * the same layer</b> in a given canvas, otherwise it will fail (and
3650  * accomplish nothing).
3651  *
3652  * If you have smart objects on your canvas and @p obj is a member of
3653  * one of them, then @p above must also be a member of the same
3654  * smart object.
3655  *
3656  * Similarly, if @p obj is not a member of a smart object, @p above
3657  * must not be either.
3658  *
3659  * @see evas_object_layer_get()
3660  * @see evas_object_layer_set()
3661  * @see evas_object_stack_below()
3662  */
3663 EAPI void             evas_object_stack_above(Evas_Object *obj, Evas_Object *above) EINA_ARG_NONNULL(1, 2);
3664
3665 /**
3666  * Stack @p obj immediately below @p below
3667  *
3668  * @param obj the object to stack
3669  * @param below the object below which to stack
3670  *
3671  * Objects, in a given canvas, are stacked in the order they get added
3672  * to it.  This means that, if they overlap, the highest ones will
3673  * cover the lowest ones, in that order. This function is a way to
3674  * change the stacking order for the objects.
3675  *
3676  * This function is intended to be used with <b>objects belonging to
3677  * the same layer</b> in a given canvas, otherwise it will fail (and
3678  * accomplish nothing).
3679  *
3680  * If you have smart objects on your canvas and @p obj is a member of
3681  * one of them, then @p below must also be a member of the same
3682  * smart object.
3683  *
3684  * Similarly, if @p obj is not a member of a smart object, @p below
3685  * must not be either.
3686  *
3687  * @see evas_object_layer_get()
3688  * @see evas_object_layer_set()
3689  * @see evas_object_stack_below()
3690  */
3691 EAPI void             evas_object_stack_below(Evas_Object *obj, Evas_Object *below) EINA_ARG_NONNULL(1, 2);
3692
3693 /**
3694  * Get the Evas object stacked right above @p obj
3695  *
3696  * @param obj an #Evas_Object
3697  * @return the #Evas_Object directly above @p obj, if any, or @c NULL,
3698  * if none
3699  *
3700  * This function will traverse layers in its search, if there are
3701  * objects on layers above the one @p obj is placed at.
3702  *
3703  * @see evas_object_layer_get()
3704  * @see evas_object_layer_set()
3705  * @see evas_object_below_get()
3706  *
3707  */
3708 EAPI Evas_Object     *evas_object_above_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
3709
3710 /**
3711  * Get the Evas object stacked right below @p obj
3712  *
3713  * @param obj an #Evas_Object
3714  * @return the #Evas_Object directly below @p obj, if any, or @c NULL,
3715  * if none
3716  *
3717  * This function will traverse layers in its search, if there are
3718  * objects on layers below the one @p obj is placed at.
3719  *
3720  * @see evas_object_layer_get()
3721  * @see evas_object_layer_set()
3722  * @see evas_object_below_get()
3723  */
3724 EAPI Evas_Object     *evas_object_below_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
3725
3726 /**
3727  * @}
3728  */
3729
3730 /**
3731  * @defgroup Evas_Object_Group_Events Object Events
3732  *
3733  * Objects generate events when they are moved, resized, when their
3734  * visibility change, when they are deleted and so on. These methods
3735  * allow one to be notified about and to handle such events.
3736  *
3737  * Objects also generate events on input (keyboard and mouse), if they
3738  * accept them (are visible, focused, etc).
3739  *
3740  * For each of those events, Evas provides a way for one to register
3741  * callback functions to be issued just after they happen.
3742  *
3743  * The following figure illustrates some Evas (event) callbacks:
3744  *
3745  * @image html evas-callbacks.png
3746  * @image rtf evas-callbacks.png
3747  * @image latex evas-callbacks.eps
3748  *
3749  * These events have their values in the #Evas_Callback_Type
3750  * enumeration, which has also ones happening on the canvas level (see
3751  * @ref Evas_Canvas_Events ).
3752  *
3753  * Examples on this group of functions can be found @ref
3754  * Example_Evas_Stacking "here" and @ref Example_Evas_Events "here".
3755  *
3756  * @ingroup Evas_Object_Group
3757  */
3758
3759 /**
3760  * @addtogroup Evas_Object_Group_Events
3761  * @{
3762  */
3763
3764 /**
3765  * Add (register) a callback function to a given Evas object event.
3766  *
3767  * @param obj Object to attach a callback to
3768  * @param type The type of event that will trigger the callback
3769  * @param func The function to be called when the event is triggered
3770  * @param data The data pointer to be passed to @p func
3771  *
3772  * This function adds a function callback to an object when the event
3773  * of type @p type occurs on object @p obj. The function is @p func.
3774  *
3775  * In the event of a memory allocation error during addition of the
3776  * callback to the object, evas_alloc_error() should be used to
3777  * determine the nature of the error, if any, and the program should
3778  * sensibly try and recover.
3779  *
3780  * A callback function must have the ::Evas_Object_Event_Cb prototype
3781  * definition. The first parameter (@p data) in this definition will
3782  * have the same value passed to evas_object_event_callback_add() as
3783  * the @p data parameter, at runtime. The second parameter @p e is the
3784  * canvas pointer on which the event occurred. The third parameter is
3785  * a pointer to the object on which event occurred. Finally, the
3786  * fourth parameter @p event_info is a pointer to a data structure
3787  * that may or may not be passed to the callback, depending on the
3788  * event type that triggered the callback. This is so because some
3789  * events don't carry extra context with them, but others do.
3790  *
3791  * The event type @p type to trigger the function may be one of
3792  * #EVAS_CALLBACK_MOUSE_IN, #EVAS_CALLBACK_MOUSE_OUT,
3793  * #EVAS_CALLBACK_MOUSE_DOWN, #EVAS_CALLBACK_MOUSE_UP,
3794  * #EVAS_CALLBACK_MOUSE_MOVE, #EVAS_CALLBACK_MOUSE_WHEEL,
3795  * #EVAS_CALLBACK_MULTI_DOWN, #EVAS_CALLBACK_MULTI_UP,
3796  * #EVAS_CALLBACK_MULTI_MOVE, #EVAS_CALLBACK_FREE,
3797  * #EVAS_CALLBACK_KEY_DOWN, #EVAS_CALLBACK_KEY_UP,
3798  * #EVAS_CALLBACK_FOCUS_IN, #EVAS_CALLBACK_FOCUS_OUT,
3799  * #EVAS_CALLBACK_SHOW, #EVAS_CALLBACK_HIDE, #EVAS_CALLBACK_MOVE,
3800  * #EVAS_CALLBACK_RESIZE, #EVAS_CALLBACK_RESTACK, #EVAS_CALLBACK_DEL,
3801  * #EVAS_CALLBACK_HOLD, #EVAS_CALLBACK_CHANGED_SIZE_HINTS,
3802  * #EVAS_CALLBACK_IMAGE_PRELOADED or #EVAS_CALLBACK_IMAGE_UNLOADED.
3803  *
3804  * This determines the kind of event that will trigger the callback.
3805  * What follows is a list explaining better the nature of each type of
3806  * event, along with their associated @p event_info pointers:
3807  *
3808  * - #EVAS_CALLBACK_MOUSE_IN: @p event_info is a pointer to an
3809  *   #Evas_Event_Mouse_In struct\n\n
3810  *   This event is triggered when the mouse pointer enters the area
3811  *   (not shaded by other objects) of the object @p obj. This may
3812  *   occur by the mouse pointer being moved by
3813  *   evas_event_feed_mouse_move() calls, or by the object being shown,
3814  *   raised, moved, resized, or other objects being moved out of the
3815  *   way, hidden or lowered, whatever may cause the mouse pointer to
3816  *   get on top of @p obj, having been on top of another object
3817  *   previously.
3818  *
3819  * - #EVAS_CALLBACK_MOUSE_OUT: @p event_info is a pointer to an
3820  *   #Evas_Event_Mouse_Out struct\n\n
3821  *   This event is triggered exactly like #EVAS_CALLBACK_MOUSE_IN is,
3822  *   but it occurs when the mouse pointer exits an object's area. Note
3823  *   that no mouse out events will be reported if the mouse pointer is
3824  *   implicitly grabbed to an object (mouse buttons are down, having
3825  *   been pressed while the pointer was over that object). In these
3826  *   cases, mouse out events will be reported once all buttons are
3827  *   released, if the mouse pointer has left the object's area. The
3828  *   indirect ways of taking off the mouse pointer from an object,
3829  *   like cited above, for #EVAS_CALLBACK_MOUSE_IN, also apply here,
3830  *   naturally.
3831  *
3832  * - #EVAS_CALLBACK_MOUSE_DOWN: @p event_info is a pointer to an
3833  *   #Evas_Event_Mouse_Down struct\n\n
3834  *   This event is triggered by a mouse button being pressed while the
3835  *   mouse pointer is over an object. If the pointer mode for Evas is
3836  *   #EVAS_OBJECT_POINTER_MODE_AUTOGRAB (default), this causes this
3837  *   object to <b>passively grab the mouse</b> until all mouse buttons
3838  *   have been released: all future mouse events will be reported to
3839  *   only this object until no buttons are down. That includes mouse
3840  *   move events, mouse in and mouse out events, and further button
3841  *   presses. When all buttons are released, event propagation will
3842  *   occur as normal (see #Evas_Object_Pointer_Mode).
3843  *
3844  * - #EVAS_CALLBACK_MOUSE_UP: @p event_info is a pointer to an
3845  *   #Evas_Event_Mouse_Up struct\n\n
3846  *   This event is triggered by a mouse button being released while
3847  *   the mouse pointer is over an object's area (or when passively
3848  *   grabbed to an object).
3849  *
3850  * - #EVAS_CALLBACK_MOUSE_MOVE: @p event_info is a pointer to an
3851  *   #Evas_Event_Mouse_Move struct\n\n
3852  *   This event is triggered by the mouse pointer being moved while
3853  *   over an object's area (or while passively grabbed to an object).
3854  *
3855  * - #EVAS_CALLBACK_MOUSE_WHEEL: @p event_info is a pointer to an
3856  *   #Evas_Event_Mouse_Wheel struct\n\n
3857  *   This event is triggered by the mouse wheel being rolled while the
3858  *   mouse pointer is over an object (or passively grabbed to an
3859  *   object).
3860  *
3861  * - #EVAS_CALLBACK_MULTI_DOWN: @p event_info is a pointer to an
3862  *   #Evas_Event_Multi_Down struct
3863  *
3864  * - #EVAS_CALLBACK_MULTI_UP: @p event_info is a pointer to an
3865  *   #Evas_Event_Multi_Up struct
3866  *
3867  * - #EVAS_CALLBACK_MULTI_MOVE: @p event_info is a pointer to an
3868  *   #Evas_Event_Multi_Move struct
3869  *
3870  * - #EVAS_CALLBACK_FREE: @p event_info is @c NULL \n\n
3871  *   This event is triggered just before Evas is about to free all
3872  *   memory used by an object and remove all references to it. This is
3873  *   useful for programs to use if they attached data to an object and
3874  *   want to free it when the object is deleted. The object is still
3875  *   valid when this callback is called, but after it returns, there
3876  *   is no guarantee on the object's validity.
3877  *
3878  * - #EVAS_CALLBACK_KEY_DOWN: @p event_info is a pointer to an
3879  *   #Evas_Event_Key_Down struct\n\n
3880  *   This callback is called when a key is pressed and the focus is on
3881  *   the object, or a key has been grabbed to a particular object
3882  *   which wants to intercept the key press regardless of what object
3883  *   has the focus.
3884  *
3885  * - #EVAS_CALLBACK_KEY_UP: @p event_info is a pointer to an
3886  *   #Evas_Event_Key_Up struct \n\n
3887  *   This callback is called when a key is released and the focus is
3888  *   on the object, or a key has been grabbed to a particular object
3889  *   which wants to intercept the key release regardless of what
3890  *   object has the focus.
3891  *
3892  * - #EVAS_CALLBACK_FOCUS_IN: @p event_info is @c NULL \n\n
3893  *   This event is called when an object gains the focus. When it is
3894  *   called the object has already gained the focus.
3895  *
3896  * - #EVAS_CALLBACK_FOCUS_OUT: @p event_info is @c NULL \n\n
3897  *   This event is triggered when an object loses the focus. When it
3898  *   is called the object has already lost the focus.
3899  *
3900  * - #EVAS_CALLBACK_SHOW: @p event_info is @c NULL \n\n
3901  *   This event is triggered by the object being shown by
3902  *   evas_object_show().
3903  *
3904  * - #EVAS_CALLBACK_HIDE: @p event_info is @c NULL \n\n
3905  *   This event is triggered by an object being hidden by
3906  *   evas_object_hide().
3907  *
3908  * - #EVAS_CALLBACK_MOVE: @p event_info is @c NULL \n\n
3909  *   This event is triggered by an object being
3910  *   moved. evas_object_move() can trigger this, as can any
3911  *   object-specific manipulations that would mean the object's origin
3912  *   could move.
3913  *
3914  * - #EVAS_CALLBACK_RESIZE: @p event_info is @c NULL \n\n
3915  *   This event is triggered by an object being resized. Resizes can
3916  *   be triggered by evas_object_resize() or by any object-specific
3917  *   calls that may cause the object to resize.
3918  *
3919  * - #EVAS_CALLBACK_RESTACK: @p event_info is @c NULL \n\n
3920  *   This event is triggered by an object being re-stacked. Stacking
3921  *   changes can be triggered by
3922  *   evas_object_stack_below()/evas_object_stack_above() and others.
3923  *
3924  * - #EVAS_CALLBACK_DEL: @p event_info is @c NULL.
3925  *
3926  * - #EVAS_CALLBACK_HOLD: @p event_info is a pointer to an
3927  *   #Evas_Event_Hold struct
3928  *
3929  * - #EVAS_CALLBACK_CHANGED_SIZE_HINTS: @p event_info is @c NULL.
3930  *
3931  * - #EVAS_CALLBACK_IMAGE_PRELOADED: @p event_info is @c NULL.
3932  *
3933  * - #EVAS_CALLBACK_IMAGE_UNLOADED: @p event_info is @c NULL.
3934  *
3935  * @note Be careful not to add the same callback multiple times, if
3936  * that's not what you want, because Evas won't check if a callback
3937  * existed before exactly as the one being registered (and thus, call
3938  * it more than once on the event, in this case). This would make
3939  * sense if you passed different functions and/or callback data, only.
3940  *
3941  * Example:
3942  * @dontinclude evas-events.c
3943  * @skip evas_object_event_callback_add(
3944  * @until }
3945  *
3946  * See the full example @ref Example_Evas_Events "here".
3947  *
3948  */
3949 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);
3950
3951 /**
3952  * Add (register) a callback function to a given Evas object event with a
3953  * non-default priority set. Except for the priority field, it's exactly the
3954  * same as @ref evas_object_event_callback_add
3955  *
3956  * @param obj Object to attach a callback to
3957  * @param type The type of event that will trigger the callback
3958  * @param priority The priority of the callback, lower values called first.
3959  * @param func The function to be called when the event is triggered
3960  * @param data The data pointer to be passed to @p func
3961  *
3962  * @see evas_object_event_callback_add
3963  * @since 1.1
3964  */
3965 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);
3966
3967 /**
3968  * Delete a callback function from an object
3969  *
3970  * @param obj Object to remove a callback from
3971  * @param type The type of event that was triggering the callback
3972  * @param func The function that was to be called when the event was triggered
3973  * @return The data pointer that was to be passed to the callback
3974  *
3975  * This function removes the most recently added callback from the
3976  * object @p obj which was triggered by the event type @p type and was
3977  * calling the function @p func when triggered. If the removal is
3978  * successful it will also return the data pointer that was passed to
3979  * evas_object_event_callback_add() when the callback was added to the
3980  * object. If not successful @c NULL will be returned.
3981  *
3982  * Example:
3983  * @code
3984  * extern Evas_Object *object;
3985  * void *my_data;
3986  * void up_callback(void *data, Evas *e, Evas_Object *obj, void *event_info);
3987  *
3988  * my_data = evas_object_event_callback_del(object, EVAS_CALLBACK_MOUSE_UP, up_callback);
3989  * @endcode
3990  */
3991 EAPI void     *evas_object_event_callback_del(Evas_Object *obj, Evas_Callback_Type type, Evas_Object_Event_Cb func) EINA_ARG_NONNULL(1, 3);
3992
3993 /**
3994  * Delete (unregister) a callback function registered to a given
3995  * Evas object event.
3996  *
3997  * @param obj Object to remove a callback from
3998  * @param type The type of event that was triggering the callback
3999  * @param func The function that was to be called when the event was
4000  * triggered
4001  * @param data The data pointer that was to be passed to the callback
4002  * @return The data pointer that was to be passed to the callback
4003  *
4004  * This function removes the most recently added callback from the
4005  * object @p obj, which was triggered by the event type @p type and was
4006  * calling the function @p func with data @p data, when triggered. If
4007  * the removal is successful it will also return the data pointer that
4008  * was passed to evas_object_event_callback_add() (that will be the
4009  * same as the parameter) when the callback was added to the
4010  * object. In errors, @c NULL will be returned.
4011  *
4012  * @note For deletion of Evas object events callbacks filtering by
4013  * just type and function pointer, user
4014  * evas_object_event_callback_del().
4015  *
4016  * Example:
4017  * @code
4018  * extern Evas_Object *object;
4019  * void *my_data;
4020  * void up_callback(void *data, Evas *e, Evas_Object *obj, void *event_info);
4021  *
4022  * my_data = evas_object_event_callback_del_full(object, EVAS_CALLBACK_MOUSE_UP, up_callback, data);
4023  * @endcode
4024  */
4025 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);
4026
4027 /**
4028  * Set whether an Evas object is to pass (ignore) events.
4029  *
4030  * @param obj the Evas object to operate on
4031  * @param pass whether @p obj is to pass events (@c EINA_TRUE) or not
4032  * (@c EINA_FALSE)
4033  *
4034  * If @p pass is @c EINA_TRUE, it will make events on @p obj to be @b
4035  * ignored. They will be triggered on the @b next lower object (that
4036  * is not set to pass events), instead (see evas_object_below_get()).
4037  *
4038  * If @p pass is @c EINA_FALSE, events will be processed on that
4039  * object as normal.
4040  *
4041  * @see evas_object_pass_events_get() for an example
4042  * @see evas_object_repeat_events_set()
4043  * @see evas_object_propagate_events_set()
4044  * @see evas_object_freeze_events_set()
4045  */
4046 EAPI void      evas_object_pass_events_set(Evas_Object *obj, Eina_Bool pass) EINA_ARG_NONNULL(1);
4047
4048 /**
4049  * Determine whether an object is set to pass (ignore) events.
4050  *
4051  * @param obj the Evas object to get information from.
4052  * @return pass whether @p obj is set to pass events (@c EINA_TRUE) or not
4053  * (@c EINA_FALSE)
4054  *
4055  * Example:
4056  * @dontinclude evas-stacking.c
4057  * @skip if (strcmp(ev->keyname, "p") == 0)
4058  * @until }
4059  *
4060  * See the full @ref Example_Evas_Stacking "example".
4061  *
4062  * @see evas_object_pass_events_set()
4063  * @see evas_object_repeat_events_get()
4064  * @see evas_object_propagate_events_get()
4065  * @see evas_object_freeze_events_get()
4066  */
4067 EAPI Eina_Bool evas_object_pass_events_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
4068
4069 /**
4070  * Set whether an Evas object is to repeat events.
4071  *
4072  * @param obj the Evas object to operate on
4073  * @param repeat whether @p obj is to repeat events (@c EINA_TRUE) or not
4074  * (@c EINA_FALSE)
4075  *
4076  * If @p repeat is @c EINA_TRUE, it will make events on @p obj to also
4077  * be repeated for the @b next lower object in the objects' stack (see
4078  * see evas_object_below_get()).
4079  *
4080  * If @p repeat is @c EINA_FALSE, events occurring on @p obj will be
4081  * processed only on it.
4082  *
4083  * Example:
4084  * @dontinclude evas-stacking.c
4085  * @skip if (strcmp(ev->keyname, "r") == 0)
4086  * @until }
4087  *
4088  * See the full @ref Example_Evas_Stacking "example".
4089  *
4090  * @see evas_object_repeat_events_get()
4091  * @see evas_object_pass_events_set()
4092  * @see evas_object_propagate_events_set()
4093  * @see evas_object_freeze_events_set()
4094  */
4095 EAPI void      evas_object_repeat_events_set(Evas_Object *obj, Eina_Bool repeat) EINA_ARG_NONNULL(1);
4096
4097 /**
4098  * Determine whether an object is set to repeat events.
4099  *
4100  * @param obj the given Evas object pointer
4101  * @return whether @p obj is set to repeat events (@c EINA_TRUE)
4102  * or not (@c EINA_FALSE)
4103  *
4104  * @see evas_object_repeat_events_set() for an example
4105  * @see evas_object_pass_events_get()
4106  * @see evas_object_propagate_events_get()
4107  * @see evas_object_freeze_events_get()
4108  */
4109 EAPI Eina_Bool evas_object_repeat_events_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
4110
4111 /**
4112  * Set whether events on a smart object's member should get propagated
4113  * up to its parent.
4114  *
4115  * @param obj the smart object's child to operate on
4116  * @param prop whether to propagate events (@c EINA_TRUE) or not
4117  * (@c EINA_FALSE)
4118  *
4119  * This function has @b no effect if @p obj is not a member of a smart
4120  * object.
4121  *
4122  * If @p prop is @c EINA_TRUE, events occurring on this object will be
4123  * propagated on to the smart object of which @p obj is a member.  If
4124  * @p prop is @c EINA_FALSE, events occurring on this object will @b
4125  * not be propagated on to the smart object of which @p obj is a
4126  * member.  The default value is @c EINA_TRUE.
4127  *
4128  * @see evas_object_propagate_events_get()
4129  * @see evas_object_repeat_events_set()
4130  * @see evas_object_pass_events_set()
4131  * @see evas_object_freeze_events_set()
4132  */
4133 EAPI void      evas_object_propagate_events_set(Evas_Object *obj, Eina_Bool prop) EINA_ARG_NONNULL(1);
4134
4135 /**
4136  * Retrieve whether an Evas object is set to propagate events.
4137  *
4138  * @param obj the given Evas object pointer
4139  * @return whether @p obj is set to propagate events (@c EINA_TRUE)
4140  * or not (@c EINA_FALSE)
4141  *
4142  * @see evas_object_propagate_events_set()
4143  * @see evas_object_repeat_events_get()
4144  * @see evas_object_pass_events_get()
4145  * @see evas_object_freeze_events_get()
4146  */
4147 EAPI Eina_Bool evas_object_propagate_events_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
4148
4149 /**
4150  * Set whether an Evas object is to freeze (discard) events.
4151  *
4152  * @param obj the Evas object to operate on
4153  * @param freeze pass whether @p obj is to freeze events (@c EINA_TRUE) or not
4154  * (@c EINA_FALSE)
4155  *
4156  * If @p freeze is @c EINA_TRUE, it will make events on @p obj to be @b
4157  * discarded. Unlike evas_object_pass_events_set(), events will not be
4158  * passed to @b next lower object. This API can be used for blocking
4159  * events while @p obj is on transiting.
4160  *
4161  * If @p freeze is @c EINA_FALSE, events will be processed on that
4162  * object as normal.
4163  *
4164  * @see evas_object_freeze_events_get()
4165  * @see evas_object_pass_events_set()
4166  * @see evas_object_repeat_events_set()
4167  * @see evas_object_propagate_events_set()
4168  * @since 1.1
4169  */
4170 EAPI void      evas_object_freeze_events_set(Evas_Object *obj, Eina_Bool freeze) EINA_ARG_NONNULL(1);
4171
4172 /**
4173  * Determine whether an object is set to freeze (discard) events.
4174  *
4175  * @param obj the Evas object to get information from.
4176  * @return freeze whether @p obj is set to freeze events (@c EINA_TRUE) or
4177  * not (@c EINA_FALSE)
4178  *
4179  * @see evas_object_freeze_events_set()
4180  * @see evas_object_pass_events_get()
4181  * @see evas_object_repeat_events_get()
4182  * @see evas_object_propagate_events_get()
4183  * @since 1.1
4184  */
4185 EAPI Eina_Bool evas_object_freeze_events_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
4186
4187 /**
4188  * @}
4189  */
4190
4191 /**
4192  * @defgroup Evas_Object_Group_Map UV Mapping (Rotation, Perspective, 3D...)
4193  *
4194  * Evas allows different transformations to be applied to all kinds of
4195  * objects. These are applied by means of UV mapping.
4196  *
4197  * With UV mapping, one maps points in the source object to a 3D space
4198  * positioning at target. This allows rotation, perspective, scale and
4199  * lots of other effects, depending on the map that is used.
4200  *
4201  * Each map point may carry a multiplier color. If properly
4202  * calculated, these can do shading effects on the object, producing
4203  * 3D effects.
4204  *
4205  * As usual, Evas provides both the raw and easy to use methods. The
4206  * raw methods allow developers to create their maps somewhere else,
4207  * possibly loading them from some file format. The easy to use methods
4208  * calculate the points given some high-level parameters such as
4209  * rotation angle, ambient light, and so on.
4210  *
4211  * @note applying mapping will reduce performance, so use with
4212  *       care. The impact on performance depends on engine in
4213  *       use. Software is quite optimized, but not as fast as OpenGL.
4214  *
4215  * @section sec-map-points Map points
4216  * @subsection subsec-rotation Rotation
4217  *
4218  * A map consists of a set of points, currently only four are supported. Each
4219  * of these points contains a set of canvas coordinates @c x and @c y that
4220  * can be used to alter the geometry of the mapped object, and a @c z
4221  * coordinate that indicates the depth of that point. This last coordinate
4222  * does not normally affect the map, but it's used by several of the utility
4223  * functions to calculate the right position of the point given other
4224  * parameters.
4225  *
4226  * The coordinates for each point are set with evas_map_point_coord_set().
4227  * The following image shows a map set to match the geometry of an existing
4228  * object.
4229  *
4230  * @image html map-set-map-points-1.png
4231  * @image rtf map-set-map-points-1.png
4232  * @image latex map-set-map-points-1.eps
4233  *
4234  * This is a common practice, so there are a few functions that help make it
4235  * easier.
4236  *
4237  * evas_map_util_points_populate_from_geometry() sets the coordinates of each
4238  * point in the given map to match the rectangle defined by the function
4239  * parameters.
4240  *
4241  * evas_map_util_points_populate_from_object() and
4242  * evas_map_util_points_populate_from_object_full() both take an object and
4243  * set the map points to match its geometry. The difference between the two
4244  * is that the first function sets the @c z value of all points to 0, while
4245  * the latter receives the value to set in said coordinate as a parameter.
4246  *
4247  * The following lines of code all produce the same result as in the image
4248  * above.
4249  * @code
4250  * evas_map_util_points_populate_from_geometry(m, 100, 100, 200, 200, 0);
4251  * // Assuming o is our original object
4252  * evas_object_move(o, 100, 100);
4253  * evas_object_resize(o, 200, 200);
4254  * evas_map_util_points_populate_from_object(m, o);
4255  * evas_map_util_points_populate_from_object_full(m, o, 0);
4256  * @endcode
4257  *
4258  * Several effects can be applied to an object by simply setting each point
4259  * of the map to the right coordinates. For example, a simulated perspective
4260  * could be achieve as follows.
4261  *
4262  * @image html map-set-map-points-2.png
4263  * @image rtf map-set-map-points-2.png
4264  * @image latex map-set-map-points-2.eps
4265  *
4266  * As said before, the @c z coordinate is unused here so when setting points
4267  * by hand, its value is of no importance.
4268  *
4269  * @image html map-set-map-points-3.png
4270  * @image rtf map-set-map-points-3.png
4271  * @image latex map-set-map-points-3.eps
4272  *
4273  * In all three cases above, setting the map to be used by the object is the
4274  * same.
4275  * @code
4276  * evas_object_map_set(o, m);
4277  * evas_object_map_enable_set(o, EINA_TRUE);
4278  * @endcode
4279  *
4280  * Doing things this way, however, is a lot of work that can be avoided by
4281  * using the provided utility functions, as described in the next section.
4282  *
4283  * @section map-utils Utility functions
4284  *
4285  * Utility functions take an already set up map and alter it to produce a
4286  * specific effect. For example, to rotate an object around its own center
4287  * you would need to take the rotation angle, the coordinates of each corner
4288  * of the object and do all the math to get the new set of coordinates that
4289  * need to tbe set in the map.
4290  *
4291  * Or you can use this code:
4292  * @code
4293  * evas_object_geometry_get(o, &x, &y, &w, &h);
4294  * m = evas_map_new(4);
4295  * evas_map_util_points_populate_from_object(m, o);
4296  * evas_map_util_rotate(m, 45, x + (w / 2), y + (h / 2));
4297  * evas_object_map_set(o, m);
4298  * evas_object_map_enable_set(o, EINA_TRUE);
4299  * evas_map_free(m);
4300  * @endcode
4301  *
4302  * Which will rotate the object around its center point in a 45 degree angle
4303  * in the clockwise direction, taking it from this
4304  *
4305  * @image html map-rotation-2d-1.png
4306  * @image rtf map-rotation-2d-1.png
4307  * @image latex map-rotation-2d-1.eps
4308  *
4309  * to this
4310  *
4311  * @image html map-rotation-2d-2.png
4312  * @image rtf map-rotation-2d-2.png
4313  * @image latex map-rotation-2d-2.eps
4314  *
4315  * Objects may be rotated around any other point just by setting the last two
4316  * paramaters of the evas_map_util_rotate() function to the right values. A
4317  * circle of roughly the diameter of the object overlaid on each image shows
4318  * where the center of rotation is set for each example.
4319  *
4320  * For example, this code
4321  * @code
4322  * evas_object_geometry_get(o, &x, &y, &w, &h);
4323  * m = evas_map_new(4);
4324  * evas_map_util_points_populate_from_object(m, o);
4325  * evas_map_util_rotate(m, 45, x + w - 20, y + h - 20);
4326  * evas_object_map_set(o, m);
4327  * evas_object_map_enable_set(o, EINA_TRUE);
4328  * evas_map_free(m);
4329  * @endcode
4330  *
4331  * produces something like
4332  *
4333  * @image html map-rotation-2d-3.png
4334  * @image rtf map-rotation-2d-3.png
4335  * @image latex map-rotation-2d-3.eps
4336  *
4337  * And the following
4338  * @code
4339  * evas_output_size_get(evas, &w, &h);
4340  * m = evas_map_new(4);
4341  * evas_map_util_points_populate_from_object(m, o);
4342  * evas_map_util_rotate(m, 45, w, h);
4343  * evas_object_map_set(o, m);
4344  * evas_object_map_enable_set(o, EINA_TRUE);
4345  * evas_map_free(m);
4346  * @endcode
4347  *
4348  * rotates the object around the center of the window
4349  *
4350  * @image html map-rotation-2d-4.png
4351  * @image rtf map-rotation-2d-4.png
4352  * @image latex map-rotation-2d-4.eps
4353  *
4354  * @subsection subsec-3d 3D Maps
4355  *
4356  * Maps can also be used to achieve the effect of 3-dimensionality. When doing
4357  * this, the @c z coordinate of each point counts, with higher values meaning
4358  * the point is further into the screen, and smaller values (negative, usually)
4359  * meaning the point is closwer towards the user.
4360  *
4361  * Thinking in 3D also introduces the concept of back-face of an object. An
4362  * object is said to be facing the user when all its points are placed in a
4363  * clockwise fashion. The next image shows this, with each point showing the
4364  * with which is identified within the map.
4365  *
4366  * @image html map-point-order-face.png
4367  * @image rtf map-point-order-face.png
4368  * @image latex map-point-order-face.eps
4369  *
4370  * Rotating this map around the @c Y axis would leave the order of the points
4371  * in a counter-clockwise fashion, as seen in the following image.
4372  *
4373  * @image html map-point-order-back.png
4374  * @image rtf map-point-order-back.png
4375  * @image latex map-point-order-back.eps
4376  *
4377  * This way we can say that we are looking at the back face of the object.
4378  * This will have stronger implications later when we talk about lighting.
4379  *
4380  * To know if a map is facing towards the user or not it's enough to use
4381  * the evas_map_util_clockwise_get() function, but this is normally done
4382  * after all the other operations are applied on the map.
4383  *
4384  * @subsection subsec-3d-rot 3D rotation and perspective
4385  *
4386  * Much like evas_map_util_rotate(), there's the function
4387  * evas_map_util_3d_rotate() that transforms the map to apply a 3D rotation
4388  * to an object. As in its 2D counterpart, the rotation can be applied around
4389  * any point in the canvas, this time with a @c z coordinate too. The rotation
4390  * can also be around any of the 3 axis.
4391  *
4392  * Starting from this simple setup
4393  *
4394  * @image html map-3d-basic-1.png
4395  * @image rtf map-3d-basic-1.png
4396  * @image latex map-3d-basic-1.eps
4397  *
4398  * and setting maps so that the blue square to rotate on all axis around a
4399  * sphere that uses the object as its center, and the red square to rotate
4400  * around the @c Y axis, we get the following. A simple overlay over the image
4401  * shows the original geometry of each object and the axis around which they
4402  * are being rotated, with the @c Z one not appearing due to being orthogonal
4403  * to the screen.
4404  *
4405  * @image html map-3d-basic-2.png
4406  * @image rtf map-3d-basic-2.png
4407  * @image latex map-3d-basic-2.eps
4408  *
4409  * which doesn't look very real. This can be helped by adding perspective
4410  * to the transformation, which can be simply done by calling
4411  * evas_map_util_3d_perspective() on the map after its position has been set.
4412  * The result in this case, making the vanishing point the center of each
4413  * object:
4414  *
4415  * @image html map-3d-basic-3.png
4416  * @image rtf map-3d-basic-3.png
4417  * @image latex map-3d-basic-3.eps
4418  *
4419  * @section sec-color Color and lighting
4420  *
4421  * Each point in a map can be set to a color, which will be multiplied with
4422  * the objects own color and linearly interpolated in between adjacent points.
4423  * This is done with evas_map_point_color_set() for each point of the map,
4424  * or evas_map_util_points_color_set() to set every point to the same color.
4425  *
4426  * When using 3D effects, colors can be used to improve the looks of them by
4427  * simulating a light source. The evas_map_util_3d_lighting() function makes
4428  * this task easier by taking the coordinates of the light source and its
4429  * color, along with the color of the ambient light. Evas then sets the color
4430  * of each point based on the distance to the light source, the angle with
4431  * which the object is facing the light and the ambient light. Here, the
4432  * orientation of each point as explained before, becomes more important.
4433  * If the map is defined counter-clockwise, the object will be facing away
4434  * from the user and thus become obscured, since no light would be reflecting
4435  * from it.
4436  *
4437  * @image html map-light.png
4438  * @image rtf map-light.png
4439  * @image latex map-light.eps
4440  * @note Object facing the light source
4441  *
4442  * @image html map-light2.png
4443  * @image rtf map-light2.png
4444  * @image latex map-light2.eps
4445  * @note Same object facing away from the user
4446  *
4447  * @section Image mapping
4448  *
4449  * @image html map-uv-mapping-1.png
4450  * @image rtf map-uv-mapping-1.png
4451  * @image latex map-uv-mapping-1.eps
4452  *
4453  * Images need some special handling when mapped. Evas can easily take care
4454  * of objects and do almost anything with them, but it's completely oblivious
4455  * to the content of images, so each point in the map needs to be told to what
4456  * pixel in the source image it belongs. Failing to do may sometimes result
4457  * in the expected behavior, or it may look like a partial work.
4458  *
4459  * The next image illustrates one possibility of a map being set to an image
4460  * object, without setting the right UV mapping for each point. The objects
4461  * themselves are mapped properly to their new geometry, but the image content
4462  * may not be displayed correctly within the mapped object.
4463  *
4464  * @image html map-uv-mapping-2.png
4465  * @image rtf map-uv-mapping-2.png
4466  * @image latex map-uv-mapping-2.eps
4467  *
4468  * Once Evas knows how to handle the source image within the map, it will
4469  * transform it as needed. This is done with evas_map_point_image_uv_set(),
4470  * which tells the map to which pixel in image it maps.
4471  *
4472  * To match our example images to the maps above all we need is the size of
4473  * each image, which can always be found with evas_object_image_size_get().
4474  *
4475  * @code
4476  * evas_map_point_image_uv_set(m, 0, 0, 0);
4477  * evas_map_point_image_uv_set(m, 1, 150, 0);
4478  * evas_map_point_image_uv_set(m, 2, 150, 200);
4479  * evas_map_point_image_uv_set(m, 3, 0, 200);
4480  * evas_object_map_set(o, m);
4481  * evas_object_map_enable_set(o, EINA_TRUE);
4482  *
4483  * evas_map_point_image_uv_set(m, 0, 0, 0);
4484  * evas_map_point_image_uv_set(m, 1, 120, 0);
4485  * evas_map_point_image_uv_set(m, 2, 120, 160);
4486  * evas_map_point_image_uv_set(m, 3, 0, 160);
4487  * evas_object_map_set(o2, m);
4488  * evas_object_map_enable_set(o2, EINA_TRUE);
4489  * @endcode
4490  *
4491  * To get
4492  *
4493  * @image html map-uv-mapping-3.png
4494  * @image rtf map-uv-mapping-3.png
4495  * @image latex map-uv-mapping-3.eps
4496  *
4497  * Maps can also be set to use part of an image only, or even map them inverted,
4498  * and combined with evas_object_image_source_set() it can be used to achieve
4499  * more interesting results.
4500  *
4501  * @code
4502  * evas_object_image_size_get(evas_object_image_source_get(o), &w, &h);
4503  * evas_map_point_image_uv_set(m, 0, 0, h);
4504  * evas_map_point_image_uv_set(m, 1, w, h);
4505  * evas_map_point_image_uv_set(m, 2, w, h / 3);
4506  * evas_map_point_image_uv_set(m, 3, 0, h / 3);
4507  * evas_object_map_set(o, m);
4508  * evas_object_map_enable_set(o, EINA_TRUE);
4509  * @endcode
4510  *
4511  * @image html map-uv-mapping-4.png
4512  * @image rtf map-uv-mapping-4.png
4513  * @image latex map-uv-mapping-4.eps
4514  *
4515  * Examples:
4516  * @li @ref Example_Evas_Map_Overview
4517  *
4518  * @ingroup Evas_Object_Group
4519  *
4520  * @{
4521  */
4522
4523 /**
4524  * Enable or disable the map that is set.
4525  *
4526  * Enable or disable the use of map for the object @p obj.
4527  * On enable, the object geometry will be saved, and the new geometry will
4528  * change (position and size) to reflect the map geometry set.
4529  *
4530  * If the object doesn't have a map set (with evas_object_map_set()), the
4531  * initial geometry will be undefined. It is advised to always set a map
4532  * to the object first, and then call this function to enable its use.
4533  *
4534  * @param obj object to enable the map on
4535  * @param enabled enabled state
4536  */
4537 EAPI void            evas_object_map_enable_set(Evas_Object *obj, Eina_Bool enabled);
4538
4539 /**
4540  * Get the map enabled state
4541  *
4542  * This returns the currently enabled state of the map on the object indicated.
4543  * The default map enable state is off. You can enable and disable it with
4544  * evas_object_map_enable_set().
4545  *
4546  * @param obj object to get the map enabled state from
4547  * @return the map enabled state
4548  */
4549 EAPI Eina_Bool       evas_object_map_enable_get(const Evas_Object *obj);
4550
4551 /**
4552  * Set current object transformation map.
4553  *
4554  * This sets the map on a given object. It is copied from the @p map pointer,
4555  * so there is no need to keep the @p map object if you don't need it anymore.
4556  *
4557  * A map is a set of 4 points which have canvas x, y coordinates per point,
4558  * with an optional z point value as a hint for perspective correction, if it
4559  * is available. As well each point has u and v coordinates. These are like
4560  * "texture coordinates" in OpenGL in that they define a point in the source
4561  * image that is mapped to that map vertex/point. The u corresponds to the x
4562  * coordinate of this mapped point and v, the y coordinate. Note that these
4563  * coordinates describe a bounding region to sample. If you have a 200x100
4564  * source image and want to display it at 200x100 with proper pixel
4565  * precision, then do:
4566  *
4567  * @code
4568  * Evas_Map *m = evas_map_new(4);
4569  * evas_map_point_coord_set(m, 0,   0,   0, 0);
4570  * evas_map_point_coord_set(m, 1, 200,   0, 0);
4571  * evas_map_point_coord_set(m, 2, 200, 100, 0);
4572  * evas_map_point_coord_set(m, 3,   0, 100, 0);
4573  * evas_map_point_image_uv_set(m, 0,   0,   0);
4574  * evas_map_point_image_uv_set(m, 1, 200,   0);
4575  * evas_map_point_image_uv_set(m, 2, 200, 100);
4576  * evas_map_point_image_uv_set(m, 3,   0, 100);
4577  * evas_object_map_set(obj, m);
4578  * evas_map_free(m);
4579  * @endcode
4580  *
4581  * Note that the map points a uv coordinates match the image geometry. If
4582  * the @p map parameter is NULL, the stored map will be freed and geometry
4583  * prior to enabling/setting a map will be restored.
4584  *
4585  * @param obj object to change transformation map
4586  * @param map new map to use
4587  *
4588  * @see evas_map_new()
4589  */
4590 EAPI void            evas_object_map_set(Evas_Object *obj, const Evas_Map *map);
4591
4592 /**
4593  * Get current object transformation map.
4594  *
4595  * This returns the current internal map set on the indicated object. It is
4596  * intended for read-only access and is only valid as long as the object is
4597  * not deleted or the map on the object is not changed. If you wish to modify
4598  * the map and set it back do the following:
4599  *
4600  * @code
4601  * const Evas_Map *m = evas_object_map_get(obj);
4602  * Evas_Map *m2 = evas_map_dup(m);
4603  * evas_map_util_rotate(m2, 30.0, 0, 0);
4604  * evas_object_map_set(obj);
4605  * evas_map_free(m2);
4606  * @endcode
4607  *
4608  * @param obj object to query transformation map.
4609  * @return map reference to map in use. This is an internal data structure, so
4610  * do not modify it.
4611  *
4612  * @see evas_object_map_set()
4613  */
4614 EAPI const Evas_Map *evas_object_map_get(const Evas_Object *obj);
4615
4616 /**
4617  * Populate source and destination map points to match exactly object.
4618  *
4619  * Usually one initialize map of an object to match it's original
4620  * position and size, then transform these with evas_map_util_*
4621  * functions, such as evas_map_util_rotate() or
4622  * evas_map_util_3d_rotate(). The original set is done by this
4623  * function, avoiding code duplication all around.
4624  *
4625  * @param m map to change all 4 points (must be of size 4).
4626  * @param obj object to use unmapped geometry to populate map coordinates.
4627  * @param z Point Z Coordinate hint (pre-perspective transform). This value
4628  *        will be used for all four points.
4629  *
4630  * @see evas_map_util_points_populate_from_object()
4631  * @see evas_map_point_coord_set()
4632  * @see evas_map_point_image_uv_set()
4633  */
4634 EAPI void            evas_map_util_points_populate_from_object_full(Evas_Map *m, const Evas_Object *obj, Evas_Coord z);
4635
4636 /**
4637  * Populate source and destination map points to match exactly object.
4638  *
4639  * Usually one initialize map of an object to match it's original
4640  * position and size, then transform these with evas_map_util_*
4641  * functions, such as evas_map_util_rotate() or
4642  * evas_map_util_3d_rotate(). The original set is done by this
4643  * function, avoiding code duplication all around.
4644  *
4645  * Z Point coordinate is assumed as 0 (zero).
4646  *
4647  * @param m map to change all 4 points (must be of size 4).
4648  * @param obj object to use unmapped geometry to populate map coordinates.
4649  *
4650  * @see evas_map_util_points_populate_from_object_full()
4651  * @see evas_map_util_points_populate_from_geometry()
4652  * @see evas_map_point_coord_set()
4653  * @see evas_map_point_image_uv_set()
4654  */
4655 EAPI void            evas_map_util_points_populate_from_object(Evas_Map *m, const Evas_Object *obj);
4656
4657 /**
4658  * Populate source and destination map points to match given geometry.
4659  *
4660  * Similar to evas_map_util_points_populate_from_object_full(), this
4661  * call takes raw values instead of querying object's unmapped
4662  * geometry. The given width will be used to calculate destination
4663  * points (evas_map_point_coord_set()) and set the image uv
4664  * (evas_map_point_image_uv_set()).
4665  *
4666  * @param m map to change all 4 points (must be of size 4).
4667  * @param x Point X Coordinate
4668  * @param y Point Y Coordinate
4669  * @param w width to use to calculate second and third points.
4670  * @param h height to use to calculate third and fourth points.
4671  * @param z Point Z Coordinate hint (pre-perspective transform). This value
4672  *        will be used for all four points.
4673  *
4674  * @see evas_map_util_points_populate_from_object()
4675  * @see evas_map_point_coord_set()
4676  * @see evas_map_point_image_uv_set()
4677  */
4678 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);
4679
4680 /**
4681  * Set color of all points to given color.
4682  *
4683  * This call is useful to reuse maps after they had 3d lightning or
4684  * any other colorization applied before.
4685  *
4686  * @param m map to change the color of.
4687  * @param r red (0 - 255)
4688  * @param g green (0 - 255)
4689  * @param b blue (0 - 255)
4690  * @param a alpha (0 - 255)
4691  *
4692  * @see evas_map_point_color_set()
4693  */
4694 EAPI void            evas_map_util_points_color_set(Evas_Map *m, int r, int g, int b, int a);
4695
4696 /**
4697  * Change the map to apply the given rotation.
4698  *
4699  * This rotates the indicated map's coordinates around the center coordinate
4700  * given by @p cx and @p cy as the rotation center. The points will have their
4701  * X and Y coordinates rotated clockwise by @p degrees degrees (360.0 is a
4702  * full rotation). Negative values for degrees will rotate counter-clockwise
4703  * by that amount. All coordinates are canvas global coordinates.
4704  *
4705  * @param m map to change.
4706  * @param degrees amount of degrees from 0.0 to 360.0 to rotate.
4707  * @param cx rotation's center horizontal position.
4708  * @param cy rotation's center vertical position.
4709  *
4710  * @see evas_map_point_coord_set()
4711  * @see evas_map_util_zoom()
4712  */
4713 EAPI void            evas_map_util_rotate(Evas_Map *m, double degrees, Evas_Coord cx, Evas_Coord cy);
4714
4715 /**
4716  * Change the map to apply the given zooming.
4717  *
4718  * Like evas_map_util_rotate(), this zooms the points of the map from a center
4719  * point. That center is defined by @p cx and @p cy. The @p zoomx and @p zoomy
4720  * parameters specify how much to zoom in the X and Y direction respectively.
4721  * A value of 1.0 means "don't zoom". 2.0 means "double the size". 0.5 is
4722  * "half the size" etc. All coordinates are canvas global coordinates.
4723  *
4724  * @param m map to change.
4725  * @param zoomx horizontal zoom to use.
4726  * @param zoomy vertical zoom to use.
4727  * @param cx zooming center horizontal position.
4728  * @param cy zooming center vertical position.
4729  *
4730  * @see evas_map_point_coord_set()
4731  * @see evas_map_util_rotate()
4732  */
4733 EAPI void            evas_map_util_zoom(Evas_Map *m, double zoomx, double zoomy, Evas_Coord cx, Evas_Coord cy);
4734
4735 /**
4736  * Rotate the map around 3 axes in 3D
4737  *
4738  * This will rotate not just around the "Z" axis as in evas_map_util_rotate()
4739  * (which is a convenience call for those only wanting 2D). This will rotate
4740  * around the X, Y and Z axes. The Z axis points "into" the screen with low
4741  * values at the screen and higher values further away. The X axis runs from
4742  * left to right on the screen and the Y axis from top to bottom. Like with
4743  * evas_map_util_rotate() you provide a center point to rotate around (in 3D).
4744  *
4745  * @param m map to change.
4746  * @param dx amount of degrees from 0.0 to 360.0 to rotate around X axis.
4747  * @param dy amount of degrees from 0.0 to 360.0 to rotate around Y axis.
4748  * @param dz amount of degrees from 0.0 to 360.0 to rotate around Z axis.
4749  * @param cx rotation's center horizontal position.
4750  * @param cy rotation's center vertical position.
4751  * @param cz rotation's center vertical position.
4752  */
4753 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);
4754
4755 /**
4756  * Perform lighting calculations on the given Map
4757  *
4758  * This is used to apply lighting calculations (from a single light source)
4759  * to a given map. The R, G and B values of each vertex will be modified to
4760  * reflect the lighting based on the lixth point coordinates, the light
4761  * color and the ambient color, and at what angle the map is facing the
4762  * light source. A surface should have its points be declared in a
4763  * clockwise fashion if the face is "facing" towards you (as opposed to
4764  * away from you) as faces have a "logical" side for lighting.
4765  *
4766  * @image html map-light3.png
4767  * @image rtf map-light3.png
4768  * @image latex map-light3.eps
4769  * @note Grey object, no lighting used
4770  *
4771  * @image html map-light4.png
4772  * @image rtf map-light4.png
4773  * @image latex map-light4.eps
4774  * @note Lights out! Every color set to 0
4775  *
4776  * @image html map-light5.png
4777  * @image rtf map-light5.png
4778  * @image latex map-light5.eps
4779  * @note Ambient light to full black, red light coming from close at the
4780  * bottom-left vertex
4781  *
4782  * @image html map-light6.png
4783  * @image rtf map-light6.png
4784  * @image latex map-light6.eps
4785  * @note Same light as before, but not the light is set to 0 and ambient light
4786  * is cyan
4787  *
4788  * @image html map-light7.png
4789  * @image rtf map-light7.png
4790  * @image latex map-light7.eps
4791  * @note Both lights are on
4792  *
4793  * @image html map-light8.png
4794  * @image rtf map-light8.png
4795  * @image latex map-light8.eps
4796  * @note Both lights again, but this time both are the same color.
4797  *
4798  * @param m map to change.
4799  * @param lx X coordinate in space of light point
4800  * @param ly Y coordinate in space of light point
4801  * @param lz Z coordinate in space of light point
4802  * @param lr light red value (0 - 255)
4803  * @param lg light green value (0 - 255)
4804  * @param lb light blue value (0 - 255)
4805  * @param ar ambient color red value (0 - 255)
4806  * @param ag ambient color green value (0 - 255)
4807  * @param ab ambient color blue value (0 - 255)
4808  */
4809 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);
4810
4811 /**
4812  * Apply a perspective transform to the map
4813  *
4814  * This applies a given perspective (3D) to the map coordinates. X, Y and Z
4815  * values are used. The px and py points specify the "infinite distance" point
4816  * in the 3D conversion (where all lines converge to like when artists draw
4817  * 3D by hand). The @p z0 value specifies the z value at which there is a 1:1
4818  * mapping between spatial coordinates and screen coordinates. Any points
4819  * on this z value will not have their X and Y values modified in the transform.
4820  * Those further away (Z value higher) will shrink into the distance, and
4821  * those less than this value will expand and become bigger. The @p foc value
4822  * determines the "focal length" of the camera. This is in reality the distance
4823  * between the camera lens plane itself (at or closer than this rendering
4824  * results are undefined) and the "z0" z value. This allows for some "depth"
4825  * control and @p foc must be greater than 0.
4826  *
4827  * @param m map to change.
4828  * @param px The perspective distance X coordinate
4829  * @param py The perspective distance Y coordinate
4830  * @param z0 The "0" z plane value
4831  * @param foc The focal distance
4832  */
4833 EAPI void            evas_map_util_3d_perspective(Evas_Map *m, Evas_Coord px, Evas_Coord py, Evas_Coord z0, Evas_Coord foc);
4834
4835 /**
4836  * Get the clockwise state of a map
4837  *
4838  * This determines if the output points (X and Y. Z is not used) are
4839  * clockwise or anti-clockwise. This can be used for "back-face culling". This
4840  * is where you hide objects that "face away" from you. In this case objects
4841  * that are not clockwise.
4842  *
4843  * @param m map to query.
4844  * @return 1 if clockwise, 0 otherwise
4845  */
4846 EAPI Eina_Bool       evas_map_util_clockwise_get(Evas_Map *m);
4847
4848 /**
4849  * Create map of transformation points to be later used with an Evas object.
4850  *
4851  * This creates a set of points (currently only 4 is supported. no other
4852  * number for @p count will work). That is empty and ready to be modified
4853  * with evas_map calls.
4854  *
4855  * @param count number of points in the map.
4856  * @return a newly allocated map or @c NULL on errors.
4857  *
4858  * @see evas_map_free()
4859  * @see evas_map_dup()
4860  * @see evas_map_point_coord_set()
4861  * @see evas_map_point_image_uv_set()
4862  * @see evas_map_util_points_populate_from_object_full()
4863  * @see evas_map_util_points_populate_from_object()
4864  *
4865  * @see evas_object_map_set()
4866  */
4867 EAPI Evas_Map       *evas_map_new(int count);
4868
4869 /**
4870  * Set the smoothing for map rendering
4871  *
4872  * This sets smoothing for map rendering. If the object is a type that has
4873  * its own smoothing settings, then both the smooth settings for this object
4874  * and the map must be turned off. By default smooth maps are enabled.
4875  *
4876  * @param m map to modify. Must not be NULL.
4877  * @param enabled enable or disable smooth map rendering
4878  */
4879 EAPI void            evas_map_smooth_set(Evas_Map *m, Eina_Bool enabled);
4880
4881 /**
4882  * get the smoothing for map rendering
4883  *
4884  * This gets smoothing for map rendering.
4885  *
4886  * @param m map to get the smooth from. Must not be NULL.
4887  */
4888 EAPI Eina_Bool       evas_map_smooth_get(const Evas_Map *m);
4889
4890 /**
4891  * Set the alpha flag for map rendering
4892  *
4893  * This sets alpha flag for map rendering. If the object is a type that has
4894  * its own alpha settings, then this will take precedence. Only image objects
4895  * have this currently.
4896  * Setting this off stops alpha blending of the map area, and is
4897  * useful if you know the object and/or all sub-objects is 100% solid.
4898  *
4899  * @param m map to modify. Must not be NULL.
4900  * @param enabled enable or disable alpha map rendering
4901  */
4902 EAPI void            evas_map_alpha_set(Evas_Map *m, Eina_Bool enabled);
4903
4904 /**
4905  * get the alpha flag for map rendering
4906  *
4907  * This gets the alpha flag for map rendering.
4908  *
4909  * @param m map to get the alpha from. Must not be NULL.
4910  */
4911 EAPI Eina_Bool       evas_map_alpha_get(const Evas_Map *m);
4912
4913 /**
4914  * Copy a previously allocated map.
4915  *
4916  * This makes a duplicate of the @p m object and returns it.
4917  *
4918  * @param m map to copy. Must not be NULL.
4919  * @return newly allocated map with the same count and contents as @p m.
4920  */
4921 EAPI Evas_Map       *evas_map_dup(const Evas_Map *m);
4922
4923 /**
4924  * Free a previously allocated map.
4925  *
4926  * This frees a givem map @p m and all memory associated with it. You must NOT
4927  * free a map returned by evas_object_map_get() as this is internal.
4928  *
4929  * @param m map to free.
4930  */
4931 EAPI void            evas_map_free(Evas_Map *m);
4932
4933 /**
4934  * Get a maps size.
4935  *
4936  * Returns the number of points in a map.  Should be at least 4.
4937  *
4938  * @param m map to get size.
4939  * @return -1 on error, points otherwise.
4940  */
4941 EAPI int             evas_map_count_get(const Evas_Map *m) EINA_CONST;
4942
4943 /**
4944  * Change the map point's coordinate.
4945  *
4946  * This sets the fixed point's coordinate in the map. Note that points
4947  * describe the outline of a quadrangle and are ordered either clockwise
4948  * or anti-clock-wise. It is suggested to keep your quadrangles concave and
4949  * non-complex, though these polygon modes may work, they may not render
4950  * a desired set of output. The quadrangle will use points 0 and 1 , 1 and 2,
4951  * 2 and 3, and 3 and 0 to describe the edges of the quadrangle.
4952  *
4953  * The X and Y and Z coordinates are in canvas units. Z is optional and may
4954  * or may not be honored in drawing. Z is a hint and does not affect the
4955  * X and Y rendered coordinates. It may be used for calculating fills with
4956  * perspective correct rendering.
4957  *
4958  * Remember all coordinates are canvas global ones like with move and resize
4959  * in evas.
4960  *
4961  * @param m map to change point. Must not be @c NULL.
4962  * @param idx index of point to change. Must be smaller than map size.
4963  * @param x Point X Coordinate
4964  * @param y Point Y Coordinate
4965  * @param z Point Z Coordinate hint (pre-perspective transform)
4966  *
4967  * @see evas_map_util_rotate()
4968  * @see evas_map_util_zoom()
4969  * @see evas_map_util_points_populate_from_object_full()
4970  * @see evas_map_util_points_populate_from_object()
4971  */
4972 EAPI void            evas_map_point_coord_set(Evas_Map *m, int idx, Evas_Coord x, Evas_Coord y, Evas_Coord z);
4973
4974 /**
4975  * Get the map point's coordinate.
4976  *
4977  * This returns the coordinates of the given point in the map.
4978  *
4979  * @param m map to query point.
4980  * @param idx index of point to query. Must be smaller than map size.
4981  * @param x where to return the X coordinate.
4982  * @param y where to return the Y coordinate.
4983  * @param z where to return the Z coordinate.
4984  */
4985 EAPI void            evas_map_point_coord_get(const Evas_Map *m, int idx, Evas_Coord *x, Evas_Coord *y, Evas_Coord *z);
4986
4987 /**
4988  * Change the map point's U and V texture source point
4989  *
4990  * This sets the U and V coordinates for the point. This determines which
4991  * coordinate in the source image is mapped to the given point, much like
4992  * OpenGL and textures. Notes that these points do select the pixel, but
4993  * are double floating point values to allow for accuracy and sub-pixel
4994  * selection.
4995  *
4996  * @param m map to change the point of.
4997  * @param idx index of point to change. Must be smaller than map size.
4998  * @param u the X coordinate within the image/texture source
4999  * @param v the Y coordinate within the image/texture source
5000  *
5001  * @see evas_map_point_coord_set()
5002  * @see evas_object_map_set()
5003  * @see evas_map_util_points_populate_from_object_full()
5004  * @see evas_map_util_points_populate_from_object()
5005  */
5006 EAPI void            evas_map_point_image_uv_set(Evas_Map *m, int idx, double u, double v);
5007
5008 /**
5009  * Get the map point's U and V texture source points
5010  *
5011  * This returns the texture points set by evas_map_point_image_uv_set().
5012  *
5013  * @param m map to query point.
5014  * @param idx index of point to query. Must be smaller than map size.
5015  * @param u where to write the X coordinate within the image/texture source
5016  * @param v where to write the Y coordinate within the image/texture source
5017  */
5018 EAPI void            evas_map_point_image_uv_get(const Evas_Map *m, int idx, double *u, double *v);
5019
5020 /**
5021  * Set the color of a vertex in the map
5022  *
5023  * This sets the color of the vertex in the map. Colors will be linearly
5024  * interpolated between vertex points through the map. Color will multiply
5025  * the "texture" pixels (like GL_MODULATE in OpenGL). The default color of
5026  * a vertex in a map is white solid (255, 255, 255, 255) which means it will
5027  * have no affect on modifying the texture pixels.
5028  *
5029  * @param m map to change the color of.
5030  * @param idx index of point to change. Must be smaller than map size.
5031  * @param r red (0 - 255)
5032  * @param g green (0 - 255)
5033  * @param b blue (0 - 255)
5034  * @param a alpha (0 - 255)
5035  *
5036  * @see evas_map_util_points_color_set()
5037  * @see evas_map_point_coord_set()
5038  * @see evas_object_map_set()
5039  */
5040 EAPI void            evas_map_point_color_set(Evas_Map *m, int idx, int r, int g, int b, int a);
5041
5042 /**
5043  * Get the color set on a vertex in the map
5044  *
5045  * This gets the color set by evas_map_point_color_set() on the given vertex
5046  * of the map.
5047  *
5048  * @param m map to get the color of the vertex from.
5049  * @param idx index of point get. Must be smaller than map size.
5050  * @param r pointer to red return
5051  * @param g pointer to green return
5052  * @param b pointer to blue return
5053  * @param a pointer to alpha return (0 - 255)
5054  *
5055  * @see evas_map_point_coord_set()
5056  * @see evas_object_map_set()
5057  */
5058 EAPI void            evas_map_point_color_get(const Evas_Map *m, int idx, int *r, int *g, int *b, int *a);
5059 /**
5060  * @}
5061  */
5062
5063 /**
5064  * @defgroup Evas_Object_Group_Size_Hints Size Hints
5065  *
5066  * Objects may carry hints, so that another object that acts as a
5067  * manager (see @ref Evas_Smart_Object_Group) may know how to properly
5068  * position and resize its subordinate objects. The Size Hints provide
5069  * a common interface that is recommended as the protocol for such
5070  * information.
5071  *
5072  * For example, box objects use alignment hints to align its
5073  * lines/columns inside its container, padding hints to set the
5074  * padding between each individual child, etc.
5075  *
5076  * Examples on their usage:
5077  * - @ref Example_Evas_Size_Hints "evas-hints.c"
5078  * - @ref Example_Evas_Aspect_Hints "evas-aspect-hints.c"
5079  *
5080  * @ingroup Evas_Object_Group
5081  */
5082
5083 /**
5084  * @addtogroup Evas_Object_Group_Size_Hints
5085  * @{
5086  */
5087
5088 /**
5089  * Retrieves the hints for an object's minimum size.
5090  *
5091  * @param obj The given Evas object to query hints from.
5092  * @param w Pointer to an integer in which to store the minimum width.
5093  * @param h Pointer to an integer in which to store the minimum height.
5094  *
5095  * These are hints on the minimim sizes @p obj should have. This is
5096  * not a size enforcement in any way, it's just a hint that should be
5097  * used whenever appropriate.
5098  *
5099  * @note Use @c NULL pointers on the hint components you're not
5100  * interested in: they'll be ignored by the function.
5101  *
5102  * @see evas_object_size_hint_min_set() for an example
5103  */
5104 EAPI void evas_object_size_hint_min_get(const Evas_Object *obj, Evas_Coord *w, Evas_Coord *h) EINA_ARG_NONNULL(1);
5105
5106 /**
5107  * Sets the hints for an object's minimum size.
5108  *
5109  * @param obj The given Evas object to query hints from.
5110  * @param w Integer to use as the minimum width hint.
5111  * @param h Integer to use as the minimum height hint.
5112  *
5113  * This is not a size enforcement in any way, it's just a hint that
5114  * should be used whenever appropriate.
5115  *
5116  * Values @c 0 will be treated as unset hint components, when queried
5117  * by managers.
5118  *
5119  * Example:
5120  * @dontinclude evas-hints.c
5121  * @skip evas_object_size_hint_min_set
5122  * @until return
5123  *
5124  * In this example the minimum size hints change the behavior of an
5125  * Evas box when layouting its children. See the full @ref
5126  * Example_Evas_Size_Hints "example".
5127  *
5128  * @see evas_object_size_hint_min_get()
5129  */
5130 EAPI void evas_object_size_hint_min_set(Evas_Object *obj, Evas_Coord w, Evas_Coord h) EINA_ARG_NONNULL(1);
5131
5132 /**
5133  * Retrieves the hints for an object's maximum size.
5134  *
5135  * @param obj The given Evas object to query hints from.
5136  * @param w Pointer to an integer in which to store the maximum width.
5137  * @param h Pointer to an integer in which to store the maximum height.
5138  *
5139  * These are hints on the maximum sizes @p obj should have. This is
5140  * not a size enforcement in any way, it's just a hint that should be
5141  * used whenever appropriate.
5142  *
5143  * @note Use @c NULL pointers on the hint components you're not
5144  * interested in: they'll be ignored by the function.
5145  *
5146  * @see evas_object_size_hint_max_set()
5147  */
5148 EAPI void evas_object_size_hint_max_get(const Evas_Object *obj, Evas_Coord *w, Evas_Coord *h) EINA_ARG_NONNULL(1);
5149
5150 /**
5151  * Sets the hints for an object's maximum size.
5152  *
5153  * @param obj The given Evas object to query hints from.
5154  * @param w Integer to use as the maximum width hint.
5155  * @param h Integer to use as the maximum height hint.
5156  *
5157  * This is not a size enforcement in any way, it's just a hint that
5158  * should be used whenever appropriate.
5159  *
5160  * Values @c -1 will be treated as unset hint components, when queried
5161  * by managers.
5162  *
5163  * Example:
5164  * @dontinclude evas-hints.c
5165  * @skip evas_object_size_hint_max_set
5166  * @until return
5167  *
5168  * In this example the maximum size hints change the behavior of an
5169  * Evas box when layouting its children. See the full @ref
5170  * Example_Evas_Size_Hints "example".
5171  *
5172  * @see evas_object_size_hint_max_get()
5173  */
5174 EAPI void evas_object_size_hint_max_set(Evas_Object *obj, Evas_Coord w, Evas_Coord h) EINA_ARG_NONNULL(1);
5175
5176 /**
5177  * Retrieves the hints for an object's optimum size.
5178  *
5179  * @param obj The given Evas object to query hints from.
5180  * @param w Pointer to an integer in which to store the requested width.
5181  * @param h Pointer to an integer in which to store the requested height.
5182  *
5183  * These are hints on the optimum sizes @p obj should have. This is
5184  * not a size enforcement in any way, it's just a hint that should be
5185  * used whenever appropriate.
5186  *
5187  * @note Use @c NULL pointers on the hint components you're not
5188  * interested in: they'll be ignored by the function.
5189  *
5190  * @see evas_object_size_hint_request_set()
5191  */
5192 EAPI void evas_object_size_hint_request_get(const Evas_Object *obj, Evas_Coord *w, Evas_Coord *h) EINA_ARG_NONNULL(1);
5193
5194 /**
5195  * Sets the hints for an object's optimum size.
5196  *
5197  * @param obj The given Evas object to query hints from.
5198  * @param w Integer to use as the preferred width hint.
5199  * @param h Integer to use as the preferred height hint.
5200  *
5201  * This is not a size enforcement in any way, it's just a hint that
5202  * should be used whenever appropriate.
5203  *
5204  * Values @c 0 will be treated as unset hint components, when queried
5205  * by managers.
5206  *
5207  * @see evas_object_size_hint_request_get()
5208  */
5209 EAPI void evas_object_size_hint_request_set(Evas_Object *obj, Evas_Coord w, Evas_Coord h) EINA_ARG_NONNULL(1);
5210
5211 /**
5212  * Retrieves the hints for an object's aspect ratio.
5213  *
5214  * @param obj The given Evas object to query hints from.
5215  * @param aspect Returns the policy/type of aspect ratio applied to @p obj.
5216  * @param w Pointer to an integer in which to store the aspect's width
5217  * ratio term.
5218  * @param h Pointer to an integer in which to store the aspect's
5219  * height ratio term.
5220  *
5221  * The different aspect ratio policies are documented in the
5222  * #Evas_Aspect_Control type. A container respecting these size hints
5223  * would @b resize its children accordingly to those policies.
5224  *
5225  * For any policy, if any of the given aspect ratio terms are @c 0,
5226  * the object's container should ignore the aspect and scale @p obj to
5227  * occupy the whole available area. If they are both positive
5228  * integers, that proportion will be respected, under each scaling
5229  * policy.
5230  *
5231  * These images illustrate some of the #Evas_Aspect_Control policies:
5232  *
5233  * @image html any-policy.png
5234  * @image rtf any-policy.png
5235  * @image latex any-policy.eps
5236  *
5237  * @image html aspect-control-none-neither.png
5238  * @image rtf aspect-control-none-neither.png
5239  * @image latex aspect-control-none-neither.eps
5240  *
5241  * @image html aspect-control-both.png
5242  * @image rtf aspect-control-both.png
5243  * @image latex aspect-control-both.eps
5244  *
5245  * @image html aspect-control-horizontal.png
5246  * @image rtf aspect-control-horizontal.png
5247  * @image latex aspect-control-horizontal.eps
5248  *
5249  * This is not a size enforcement in any way, it's just a hint that
5250  * should be used whenever appropriate.
5251  *
5252  * @note Use @c NULL pointers on the hint components you're not
5253  * interested in: they'll be ignored by the function.
5254  *
5255  * Example:
5256  * @dontinclude evas-aspect-hints.c
5257  * @skip if (strcmp(ev->keyname, "c") == 0)
5258  * @until }
5259  *
5260  * See the full @ref Example_Evas_Aspect_Hints "example".
5261  *
5262  * @see evas_object_size_hint_aspect_set()
5263  */
5264 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);
5265
5266 /**
5267  * Sets the hints for an object's aspect ratio.
5268  *
5269  * @param obj The given Evas object to query hints from.
5270  * @param aspect The policy/type of aspect ratio to apply to @p obj.
5271  * @param w Integer to use as aspect width ratio term.
5272  * @param h Integer to use as aspect height ratio term.
5273  *
5274  * This is not a size enforcement in any way, it's just a hint that should
5275  * be used whenever appropriate.
5276  *
5277  * If any of the given aspect ratio terms are @c 0,
5278  * the object's container will ignore the aspect and scale @p obj to
5279  * occupy the whole available area, for any given policy.
5280  *
5281  * @see evas_object_size_hint_aspect_get() for more information.
5282  */
5283 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);
5284
5285 /**
5286  * Retrieves the hints for on object's alignment.
5287  *
5288  * @param obj The given Evas object to query hints from.
5289  * @param x Pointer to a double in which to store the horizontal
5290  * alignment hint.
5291  * @param y Pointer to a double in which to store the vertical
5292  * alignment hint.
5293  *
5294  * This is not a size enforcement in any way, it's just a hint that
5295  * should be used whenever appropriate.
5296  *
5297  * @note Use @c NULL pointers on the hint components you're not
5298  * interested in: they'll be ignored by the function.
5299  * @note If @c obj is invalid, then the hint components will be set with 0.5
5300  *
5301  * @see evas_object_size_hint_align_set() for more information
5302  */
5303 EAPI void evas_object_size_hint_align_get(const Evas_Object *obj, double *x, double *y) EINA_ARG_NONNULL(1);
5304
5305 /**
5306  * Sets the hints for an object's alignment.
5307  *
5308  * @param obj The given Evas object to query hints from.
5309  * @param x Double, ranging from @c 0.0 to @c 1.0 or with the
5310  * special value #EVAS_HINT_FILL, to use as horizontal alignment hint.
5311  * @param y Double, ranging from @c 0.0 to @c 1.0 or with the
5312  * special value #EVAS_HINT_FILL, to use as vertical alignment hint.
5313  *
5314  * These are hints on how to align an object <b>inside the boundaries
5315  * of a container/manager</b>. Accepted values are in the @c 0.0 to @c
5316  * 1.0 range, with the special value #EVAS_HINT_FILL used to specify
5317  * "justify" or "fill" by some users. In this case, maximum size hints
5318  * should be enforced with higher priority, if they are set. Also, any
5319  * padding hint set on objects should add up to the alignment space on
5320  * the final scene composition.
5321  *
5322  * See documentation of possible users: in Evas, they are the @ref
5323  * Evas_Object_Box "box" and @ref Evas_Object_Table "table" smart
5324  * objects.
5325  *
5326  * For the horizontal component, @c 0.0 means to the left, @c 1.0
5327  * means to the right. Analogously, for the vertical component, @c 0.0
5328  * to the top, @c 1.0 means to the bottom.
5329  *
5330  * See the following figure:
5331  *
5332  * @image html alignment-hints.png
5333  * @image rtf alignment-hints.png
5334  * @image latex alignment-hints.eps
5335  *
5336  * This is not a size enforcement in any way, it's just a hint that
5337  * should be used whenever appropriate.
5338  *
5339  * Example:
5340  * @dontinclude evas-hints.c
5341  * @skip evas_object_size_hint_align_set
5342  * @until return
5343  *
5344  * In this example the alignment hints change the behavior of an Evas
5345  * box when layouting its children. See the full @ref
5346  * Example_Evas_Size_Hints "example".
5347  *
5348  * @see evas_object_size_hint_align_get()
5349  * @see evas_object_size_hint_max_set()
5350  * @see evas_object_size_hint_padding_set()
5351  */
5352 EAPI void evas_object_size_hint_align_set(Evas_Object *obj, double x, double y) EINA_ARG_NONNULL(1);
5353
5354 /**
5355  * Retrieves the hints for an object's weight.
5356  *
5357  * @param obj The given Evas object to query hints from.
5358  * @param x Pointer to a double in which to store the horizontal weight.
5359  * @param y Pointer to a double in which to store the vertical weight.
5360  *
5361  * Accepted values are zero or positive values. Some users might use
5362  * this hint as a boolean, but some might consider it as a @b
5363  * proportion, see documentation of possible users, which in Evas are
5364  * the @ref Evas_Object_Box "box" and @ref Evas_Object_Table "table"
5365  * smart objects.
5366  *
5367  * This is not a size enforcement in any way, it's just a hint that
5368  * should be used whenever appropriate.
5369  *
5370  * @note Use @c NULL pointers on the hint components you're not
5371  * interested in: they'll be ignored by the function.
5372  * @note If @c obj is invalid, then the hint components will be set with 0.0
5373  *
5374  * @see evas_object_size_hint_weight_set() for an example
5375  */
5376 EAPI void evas_object_size_hint_weight_get(const Evas_Object *obj, double *x, double *y) EINA_ARG_NONNULL(1);
5377
5378 /**
5379  * Sets the hints for an object's weight.
5380  *
5381  * @param obj The given Evas object to query hints from.
5382  * @param x Nonnegative double value to use as horizontal weight hint.
5383  * @param y Nonnegative double value to use as vertical weight hint.
5384  *
5385  * This is not a size enforcement in any way, it's just a hint that
5386  * should be used whenever appropriate.
5387  *
5388  * This is a hint on how a container object should @b resize a given
5389  * child within its area. Containers may adhere to the simpler logic
5390  * of just expanding the child object's dimensions to fit its own (see
5391  * the #EVAS_HINT_EXPAND helper weight macro) or the complete one of
5392  * taking each child's weight hint as real @b weights to how much of
5393  * its size to allocate for them in each axis. A container is supposed
5394  * to, after @b normalizing the weights of its children (with weight
5395  * hints), distribute the space it has to layout them by those factors
5396  * -- most weighted children get larger in this process than the least
5397  * ones.
5398  *
5399  * Example:
5400  * @dontinclude evas-hints.c
5401  * @skip evas_object_size_hint_weight_set
5402  * @until return
5403  *
5404  * In this example the weight hints change the behavior of an Evas box
5405  * when layouting its children. See the full @ref
5406  * Example_Evas_Size_Hints "example".
5407  *
5408  * @see evas_object_size_hint_weight_get() for more information
5409  */
5410 EAPI void evas_object_size_hint_weight_set(Evas_Object *obj, double x, double y) EINA_ARG_NONNULL(1);
5411
5412 /**
5413  * Retrieves the hints for an object's padding space.
5414  *
5415  * @param obj The given Evas object to query hints from.
5416  * @param l Pointer to an integer in which to store left padding.
5417  * @param r Pointer to an integer in which to store right padding.
5418  * @param t Pointer to an integer in which to store top padding.
5419  * @param b Pointer to an integer in which to store bottom padding.
5420  *
5421  * Padding is extra space an object takes on each of its delimiting
5422  * rectangle sides, in canvas units. This space will be rendered
5423  * transparent, naturally, as in the following figure:
5424  *
5425  * @image html padding-hints.png
5426  * @image rtf padding-hints.png
5427  * @image latex padding-hints.eps
5428  *
5429  * This is not a size enforcement in any way, it's just a hint that
5430  * should be used whenever appropriate.
5431  *
5432  * @note Use @c NULL pointers on the hint components you're not
5433  * interested in: they'll be ignored by the function.
5434  *
5435  * Example:
5436  * @dontinclude evas-hints.c
5437  * @skip evas_object_size_hint_padding_set
5438  * @until return
5439  *
5440  * In this example the padding hints change the behavior of an Evas box
5441  * when layouting its children. See the full @ref
5442  * Example_Evas_Size_Hints "example".
5443  *
5444  * @see evas_object_size_hint_padding_set()
5445  */
5446 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);
5447
5448 /**
5449  * Sets the hints for an object's padding space.
5450  *
5451  * @param obj The given Evas object to query hints from.
5452  * @param l Integer to specify left padding.
5453  * @param r Integer to specify right padding.
5454  * @param t Integer to specify top padding.
5455  * @param b Integer to specify bottom padding.
5456  *
5457  * This is not a size enforcement in any way, it's just a hint that
5458  * should be used whenever appropriate.
5459  *
5460  * @see evas_object_size_hint_padding_get() for more information
5461  */
5462 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);
5463
5464 /**
5465  * @}
5466  */
5467
5468 /**
5469  * @defgroup Evas_Object_Group_Extras Extra Object Manipulation
5470  *
5471  * Miscellaneous functions that also apply to any object, but are less
5472  * used or not implemented by all objects.
5473  *
5474  * Examples on this group of functions can be found @ref
5475  * Example_Evas_Stacking "here" and @ref Example_Evas_Events "here".
5476  *
5477  * @ingroup Evas_Object_Group
5478  */
5479
5480 /**
5481  * @addtogroup Evas_Object_Group_Extras
5482  * @{
5483  */
5484
5485 /**
5486  * Set an attached data pointer to an object with a given string key.
5487  *
5488  * @param obj The object to attach the data pointer to
5489  * @param key The string key for the data to access it
5490  * @param data The pointer to the data to be attached
5491  *
5492  * This attaches the pointer @p data to the object @p obj, given the
5493  * access string @p key. This pointer will stay "hooked" to the object
5494  * until a new pointer with the same string key is attached with
5495  * evas_object_data_set() or it is deleted with
5496  * evas_object_data_del(). On deletion of the object @p obj, the
5497  * pointers will not be accessible from the object anymore.
5498  *
5499  * You can find the pointer attached under a string key using
5500  * evas_object_data_get(). It is the job of the calling application to
5501  * free any data pointed to by @p data when it is no longer required.
5502  *
5503  * If @p data is @c NULL, the old value stored at @p key will be
5504  * removed but no new value will be stored. This is synonymous with
5505  * calling evas_object_data_del() with @p obj and @p key.
5506  *
5507  * @note This function is very handy when you have data associated
5508  * specifically to an Evas object, being of use only when dealing with
5509  * it. Than you don't have the burden to a pointer to it elsewhere,
5510  * using this family of functions.
5511  *
5512  * Example:
5513  *
5514  * @code
5515  * int *my_data;
5516  * extern Evas_Object *obj;
5517  *
5518  * my_data = malloc(500);
5519  * evas_object_data_set(obj, "name_of_data", my_data);
5520  * printf("The data that was attached was %p\n", evas_object_data_get(obj, "name_of_data"));
5521  * @endcode
5522  */
5523 EAPI void                     evas_object_data_set(Evas_Object *obj, const char *key, const void *data) EINA_ARG_NONNULL(1, 2);
5524
5525 /**
5526  * Return an attached data pointer on an Evas object by its given
5527  * string key.
5528  *
5529  * @param obj The object to which the data was attached
5530  * @param key The string key the data was stored under
5531  * @return The data pointer stored, or @c NULL if none was stored
5532  *
5533  * This function will return the data pointer attached to the object
5534  * @p obj, stored using the string key @p key. If the object is valid
5535  * and a data pointer was stored under the given key, that pointer
5536  * will be returned. If this is not the case, @c NULL will be
5537  * returned, signifying an invalid object or a non-existent key. It is
5538  * possible that a @c NULL pointer was stored given that key, but this
5539  * situation is non-sensical and thus can be considered an error as
5540  * well. @c NULL pointers are never stored as this is the return value
5541  * if an error occurs.
5542  *
5543  * Example:
5544  *
5545  * @code
5546  * int *my_data;
5547  * extern Evas_Object *obj;
5548  *
5549  * my_data = evas_object_data_get(obj, "name_of_my_data");
5550  * if (my_data) printf("Data stored was %p\n", my_data);
5551  * else printf("No data was stored on the object\n");
5552  * @endcode
5553  */
5554 EAPI void                    *evas_object_data_get(const Evas_Object *obj, const char *key) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2);
5555
5556 /**
5557  * Delete an attached data pointer from an object.
5558  *
5559  * @param obj The object to delete the data pointer from
5560  * @param key The string key the data was stored under
5561  * @return The original data pointer stored at @p key on @p obj
5562  *
5563  * This will remove the stored data pointer from @p obj stored under
5564  * @p key and return this same pointer, if actually there was data
5565  * there, or @c NULL, if nothing was stored under that key.
5566  *
5567  * Example:
5568  *
5569  * @code
5570  * int *my_data;
5571  * extern Evas_Object *obj;
5572  *
5573  * my_data = evas_object_data_del(obj, "name_of_my_data");
5574  * @endcode
5575  */
5576 EAPI void                    *evas_object_data_del(Evas_Object *obj, const char *key) EINA_ARG_NONNULL(1, 2);
5577
5578 /**
5579  * Set pointer behavior.
5580  *
5581  * @param obj
5582  * @param setting desired behavior.
5583  *
5584  * This function has direct effect on event callbacks related to
5585  * mouse.
5586  *
5587  * If @p setting is EVAS_OBJECT_POINTER_MODE_AUTOGRAB, then when mouse
5588  * is down at this object, events will be restricted to it as source,
5589  * mouse moves, for example, will be emitted even if outside this
5590  * object area.
5591  *
5592  * If @p setting is EVAS_OBJECT_POINTER_MODE_NOGRAB, then events will
5593  * be emitted just when inside this object area.
5594  *
5595  * The default value is EVAS_OBJECT_POINTER_MODE_AUTOGRAB.
5596  *
5597  * @ingroup Evas_Object_Group_Extras
5598  */
5599 EAPI void                     evas_object_pointer_mode_set(Evas_Object *obj, Evas_Object_Pointer_Mode setting) EINA_ARG_NONNULL(1);
5600
5601 /**
5602  * Determine how pointer will behave.
5603  * @param obj
5604  * @return pointer behavior.
5605  * @ingroup Evas_Object_Group_Extras
5606  */
5607 EAPI Evas_Object_Pointer_Mode evas_object_pointer_mode_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
5608
5609 /**
5610  * Sets whether or not the given Evas object is to be drawn anti-aliased.
5611  *
5612  * @param   obj The given Evas object.
5613  * @param   antialias 1 if the object is to be anti_aliased, 0 otherwise.
5614  * @ingroup Evas_Object_Group_Extras
5615  */
5616 EAPI void                     evas_object_anti_alias_set(Evas_Object *obj, Eina_Bool antialias) EINA_ARG_NONNULL(1);
5617
5618 /**
5619  * Retrieves whether or not the given Evas object is to be drawn anti_aliased.
5620  * @param   obj The given Evas object.
5621  * @return  @c 1 if the object is to be anti_aliased.  @c 0 otherwise.
5622  * @ingroup Evas_Object_Group_Extras
5623  */
5624 EAPI Eina_Bool                evas_object_anti_alias_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
5625
5626 /**
5627  * Sets the scaling factor for an Evas object. Does not affect all
5628  * objects.
5629  *
5630  * @param obj The given Evas object.
5631  * @param scale The scaling factor. <c>1.0</c> means no scaling,
5632  *        default size.
5633  *
5634  * This will multiply the object's dimension by the given factor, thus
5635  * altering its geometry (width and height). Useful when you want
5636  * scalable UI elements, possibly at run time.
5637  *
5638  * @note Only text and textblock objects have scaling change
5639  * handlers. Other objects won't change visually on this call.
5640  *
5641  * @see evas_object_scale_get()
5642  *
5643  * @ingroup Evas_Object_Group_Extras
5644  */
5645 EAPI void                     evas_object_scale_set(Evas_Object *obj, double scale) EINA_ARG_NONNULL(1);
5646
5647 /**
5648  * Retrieves the scaling factor for the given Evas object.
5649  *
5650  * @param   obj The given Evas object.
5651  * @return  The scaling factor.
5652  *
5653  * @ingroup Evas_Object_Group_Extras
5654  *
5655  * @see evas_object_scale_set()
5656  */
5657 EAPI double                   evas_object_scale_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
5658
5659 /**
5660  * Sets the render_op to be used for rendering the Evas object.
5661  * @param   obj The given Evas object.
5662  * @param   op one of the Evas_Render_Op values.
5663  * @ingroup Evas_Object_Group_Extras
5664  */
5665 EAPI void                     evas_object_render_op_set(Evas_Object *obj, Evas_Render_Op op) EINA_ARG_NONNULL(1);
5666
5667 /**
5668  * Retrieves the current value of the operation used for rendering the Evas object.
5669  * @param   obj The given Evas object.
5670  * @return  one of the enumerated values in Evas_Render_Op.
5671  * @ingroup Evas_Object_Group_Extras
5672  */
5673 EAPI Evas_Render_Op           evas_object_render_op_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
5674
5675 /**
5676  * Set whether to use precise (usually expensive) point collision
5677  * detection for a given Evas object.
5678  *
5679  * @param obj The given object.
5680  * @param precise Whether to use precise point collision detection or
5681  * not. The default value is false.
5682  *
5683  * Use this function to make Evas treat objects' transparent areas as
5684  * @b not belonging to it with regard to mouse pointer events. By
5685  * default, all of the object's boundary rectangle will be taken in
5686  * account for them.
5687  *
5688  * @warning By using precise point collision detection you'll be
5689  * making Evas more resource intensive.
5690  *
5691  * Example code follows.
5692  * @dontinclude evas-events.c
5693  * @skip if (strcmp(ev->keyname, "p") == 0)
5694  * @until }
5695  *
5696  * See the full example @ref Example_Evas_Events "here".
5697  *
5698  * @see evas_object_precise_is_inside_get()
5699  * @ingroup Evas_Object_Group_Extras
5700  */
5701 EAPI void                     evas_object_precise_is_inside_set(Evas_Object *obj, Eina_Bool precise) EINA_ARG_NONNULL(1);
5702
5703 /**
5704  * Determine whether an object is set to use precise point collision
5705  * detection.
5706  *
5707  * @param obj The given object.
5708  * @return whether @p obj is set to use precise point collision
5709  * detection or not The default value is false.
5710  *
5711  * @see evas_object_precise_is_inside_set() for an example
5712  *
5713  * @ingroup Evas_Object_Group_Extras
5714  */
5715 EAPI Eina_Bool                evas_object_precise_is_inside_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
5716
5717 /**
5718  * Set a hint flag on the given Evas object that it's used as a "static
5719  * clipper".
5720  *
5721  * @param obj The given object.
5722  * @param is_static_clip @c EINA_TRUE if it's to be used as a static
5723  * clipper, @c EINA_FALSE otherwise.
5724  *
5725  * This is a hint to Evas that this object is used as a big static
5726  * clipper and shouldn't be moved with children and otherwise
5727  * considered specially. The default value for new objects is
5728  * @c EINA_FALSE.
5729  *
5730  * @see evas_object_static_clip_get()
5731  *
5732  * @ingroup Evas_Object_Group_Extras
5733  */
5734 EAPI void                     evas_object_static_clip_set(Evas_Object *obj, Eina_Bool is_static_clip) EINA_ARG_NONNULL(1);
5735
5736 /**
5737  * Get the "static clipper" hint flag for a given Evas object.
5738  *
5739  * @param obj The given object.
5740  * @return @c EINA_TRUE if it's set as a static clipper,
5741  * @c EINA_FALSE otherwise.
5742  *
5743  * @see evas_object_static_clip_set() for more details
5744  *
5745  * @ingroup Evas_Object_Group_Extras
5746  */
5747 EAPI Eina_Bool                evas_object_static_clip_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
5748
5749 /**
5750  * @}
5751  */
5752
5753 /**
5754  * @defgroup Evas_Object_Group_Find Finding Objects
5755  *
5756  * Functions that allows finding objects by their position, name or
5757  * other properties.
5758  *
5759  * @ingroup Evas_Object_Group
5760  */
5761
5762 /**
5763  * @addtogroup Evas_Object_Group_Find
5764  * @{
5765  */
5766
5767 /**
5768  * Retrieve the object that currently has focus.
5769  *
5770  * @param e The Evas canvas to query for focused object on.
5771  * @return The object that has focus or @c NULL if there is not one.
5772  *
5773  * Evas can have (at most) one of its objects focused at a time.
5774  * Focused objects will be the ones having <b>key events</b> delivered
5775  * to, which the programmer can act upon by means of
5776  * evas_object_event_callback_add() usage.
5777  *
5778  * @note Most users wouldn't be dealing directly with Evas' focused
5779  * objects. Instead, they would be using a higher level library for
5780  * that (like a toolkit, as Elementary) to handle focus and who's
5781  * receiving input for them.
5782  *
5783  * This call returns the object that currently has focus on the canvas
5784  * @p e or @c NULL, if none.
5785  *
5786  * @see evas_object_focus_set
5787  * @see evas_object_focus_get
5788  * @see evas_object_key_grab
5789  * @see evas_object_key_ungrab
5790  *
5791  * Example:
5792  * @dontinclude evas-events.c
5793  * @skip evas_event_callback_add(d.canvas, EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_IN,
5794  * @until evas_object_focus_set(d.bg, EINA_TRUE);
5795  * @dontinclude evas-events.c
5796  * @skip called when our rectangle gets focus
5797  * @until }
5798  *
5799  * In this example the @c event_info is exactly a pointer to that
5800  * focused rectangle. See the full @ref Example_Evas_Events "example".
5801  *
5802  * @ingroup Evas_Object_Group_Find
5803  */
5804 EAPI Evas_Object *evas_focus_get(const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
5805
5806 /**
5807  * Retrieves the object on the given evas with the given name.
5808  * @param   e    The given evas.
5809  * @param   name The given name.
5810  * @return  If successful, the Evas object with the given name.  Otherwise,
5811  *          @c NULL.
5812  *
5813  * This looks for the evas object given a name by evas_object_name_set(). If
5814  * the name is not unique canvas-wide, then which one of the many objects
5815  * with that name is returned is undefined, so only use this if you can ensure
5816  * the object name is unique.
5817  *
5818  * @ingroup Evas_Object_Group_Find
5819  */
5820 EAPI Evas_Object *evas_object_name_find(const Evas *e, const char *name) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
5821
5822 /**
5823  * Retrieves the object from children of the given object with the given name.
5824  * @param   obj  The parent (smart) object whose children to search.
5825  * @param   name The given name.
5826  * @param   recurse Set to the number of child levels to recurse (0 == don't recurse, 1 == only look at the children of @p obj or their immediate children, but no further etc.).
5827  * @return  If successful, the Evas object with the given name.  Otherwise,
5828  *          @c NULL.
5829  *
5830  * This looks for the evas object given a name by evas_object_name_set(), but
5831  * it ONLY looks at the children of the object *p obj, and will only recurse
5832  * into those children if @p recurse is greater than 0. If the name is not
5833  * unique within immediate children (or the whole child tree) then it is not
5834  * defined which child object will be returned. If @p recurse is set to -1 then
5835  * it will recurse without limit.
5836  *
5837  * @since 1.2
5838  *
5839  * @ingroup Evas_Object_Group_Find
5840  */
5841 EAPI Evas_Object *evas_object_name_child_find(const Evas_Object *obj, const char *name, int recurse) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
5842
5843 /**
5844  * Retrieve the Evas object stacked at the top of a given position in
5845  * a canvas
5846  *
5847  * @param   e A handle to the canvas.
5848  * @param   x The horizontal coordinate of the position
5849  * @param   y The vertical coordinate of the position
5850  * @param   include_pass_events_objects Boolean flag to include or not
5851  * objects which pass events in this calculation
5852  * @param   include_hidden_objects Boolean flag to include or not hidden
5853  * objects in this calculation
5854  * @return  The Evas object that is over all other objects at the given
5855  * position.
5856  *
5857  * This function will traverse all the layers of the given canvas,
5858  * from top to bottom, querying for objects with areas covering the
5859  * given position. The user can remove from from the query
5860  * objects which are hidden and/or which are set to pass events.
5861  *
5862  * @warning This function will @b skip objects parented by smart
5863  * objects, acting only on the ones at the "top level", with regard to
5864  * object parenting.
5865  */
5866 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);
5867
5868 /**
5869  * Retrieve the Evas object stacked at the top at the position of the
5870  * mouse cursor, over a given canvas
5871  *
5872  * @param   e A handle to the canvas.
5873  * @return  The Evas object that is over all other objects at the mouse
5874  * pointer's position
5875  *
5876  * This function will traverse all the layers of the given canvas,
5877  * from top to bottom, querying for objects with areas covering the
5878  * mouse pointer's position, over @p e.
5879  *
5880  * @warning This function will @b skip objects parented by smart
5881  * objects, acting only on the ones at the "top level", with regard to
5882  * object parenting.
5883  */
5884 EAPI Evas_Object *evas_object_top_at_pointer_get(const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
5885
5886 /**
5887  * Retrieve the Evas object stacked at the top of a given rectangular
5888  * region in a canvas
5889  *
5890  * @param   e A handle to the canvas.
5891  * @param   x The top left corner's horizontal coordinate for the
5892  * rectangular region
5893  * @param   y The top left corner's vertical coordinate for the
5894  * rectangular region
5895  * @param   w The width of the rectangular region
5896  * @param   h The height of the rectangular region
5897  * @param   include_pass_events_objects Boolean flag to include or not
5898  * objects which pass events in this calculation
5899  * @param   include_hidden_objects Boolean flag to include or not hidden
5900  * objects in this calculation
5901  * @return  The Evas object that is over all other objects at the given
5902  * rectangular region.
5903  *
5904  * This function will traverse all the layers of the given canvas,
5905  * from top to bottom, querying for objects with areas overlapping
5906  * with the given rectangular region inside @p e. The user can remove
5907  * from the query objects which are hidden and/or which are set to
5908  * pass events.
5909  *
5910  * @warning This function will @b skip objects parented by smart
5911  * objects, acting only on the ones at the "top level", with regard to
5912  * object parenting.
5913  */
5914 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);
5915
5916 /**
5917  * Retrieve a list of Evas objects lying over a given position in
5918  * a canvas
5919  *
5920  * @param   e A handle to the canvas.
5921  * @param   x The horizontal coordinate of the position
5922  * @param   y The vertical coordinate of the position
5923  * @param   include_pass_events_objects Boolean flag to include or not
5924  * objects which pass events in this calculation
5925  * @param   include_hidden_objects Boolean flag to include or not hidden
5926  * objects in this calculation
5927  * @return  The list of Evas objects that are over the given position
5928  * in @p e
5929  *
5930  * This function will traverse all the layers of the given canvas,
5931  * from top to bottom, querying for objects with areas covering the
5932  * given position. The user can remove from from the query
5933  * objects which are hidden and/or which are set to pass events.
5934  *
5935  * @warning This function will @b skip objects parented by smart
5936  * objects, acting only on the ones at the "top level", with regard to
5937  * object parenting.
5938  */
5939 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);
5940 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);
5941
5942 /**
5943  * Get the lowest (stacked) Evas object on the canvas @p e.
5944  *
5945  * @param e a valid canvas pointer
5946  * @return a pointer to the lowest object on it, if any, or @c NULL,
5947  * otherwise
5948  *
5949  * This function will take all populated layers in the canvas into
5950  * account, getting the lowest object for the lowest layer, naturally.
5951  *
5952  * @see evas_object_layer_get()
5953  * @see evas_object_layer_set()
5954  * @see evas_object_below_get()
5955  * @see evas_object_above_get()
5956  *
5957  * @warning This function will @b skip objects parented by smart
5958  * objects, acting only on the ones at the "top level", with regard to
5959  * object parenting.
5960  */
5961 EAPI Evas_Object *evas_object_bottom_get(const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
5962
5963 /**
5964  * Get the highest (stacked) Evas object on the canvas @p e.
5965  *
5966  * @param e a valid canvas pointer
5967  * @return a pointer to the highest object on it, if any, or @c NULL,
5968  * otherwise
5969  *
5970  * This function will take all populated layers in the canvas into
5971  * account, getting the highest object for the highest layer,
5972  * naturally.
5973  *
5974  * @see evas_object_layer_get()
5975  * @see evas_object_layer_set()
5976  * @see evas_object_below_get()
5977  * @see evas_object_above_get()
5978  *
5979  * @warning This function will @b skip objects parented by smart
5980  * objects, acting only on the ones at the "top level", with regard to
5981  * object parenting.
5982  */
5983 EAPI Evas_Object *evas_object_top_get(const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
5984
5985 /**
5986  * @}
5987  */
5988
5989 /**
5990  * @defgroup Evas_Object_Group_Interceptors Object Method Interceptors
5991  *
5992  * Evas provides a way to intercept method calls. The interceptor
5993  * callback may opt to completely deny the call, or may check and
5994  * change the parameters before continuing. The continuation of an
5995  * intercepted call is done by calling the intercepted call again,
5996  * from inside the interceptor callback.
5997  *
5998  * @ingroup Evas_Object_Group
5999  */
6000
6001 /**
6002  * @addtogroup Evas_Object_Group_Interceptors
6003  * @{
6004  */
6005
6006 typedef void (*Evas_Object_Intercept_Show_Cb)(void *data, Evas_Object *obj);
6007 typedef void (*Evas_Object_Intercept_Hide_Cb)(void *data, Evas_Object *obj);
6008 typedef void (*Evas_Object_Intercept_Move_Cb)(void *data, Evas_Object *obj, Evas_Coord x, Evas_Coord y);
6009 typedef void (*Evas_Object_Intercept_Resize_Cb)(void *data, Evas_Object *obj, Evas_Coord w, Evas_Coord h);
6010 typedef void (*Evas_Object_Intercept_Raise_Cb)(void *data, Evas_Object *obj);
6011 typedef void (*Evas_Object_Intercept_Lower_Cb)(void *data, Evas_Object *obj);
6012 typedef void (*Evas_Object_Intercept_Stack_Above_Cb)(void *data, Evas_Object *obj, Evas_Object *above);
6013 typedef void (*Evas_Object_Intercept_Stack_Below_Cb)(void *data, Evas_Object *obj, Evas_Object *above);
6014 typedef void (*Evas_Object_Intercept_Layer_Set_Cb)(void *data, Evas_Object *obj, int l);
6015 typedef void (*Evas_Object_Intercept_Color_Set_Cb)(void *data, Evas_Object *obj, int r, int g, int b, int a);
6016 typedef void (*Evas_Object_Intercept_Clip_Set_Cb)(void *data, Evas_Object *obj, Evas_Object *clip);
6017 typedef void (*Evas_Object_Intercept_Clip_Unset_Cb)(void *data, Evas_Object *obj);
6018
6019 /**
6020  * Set the callback function that intercepts a show event of a object.
6021  *
6022  * @param obj The given canvas object pointer.
6023  * @param func The given function to be the callback function.
6024  * @param data The data passed to the callback function.
6025  *
6026  * This function sets a callback function to intercepts a show event
6027  * of a canvas object.
6028  *
6029  * @see evas_object_intercept_show_callback_del().
6030  *
6031  */
6032 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);
6033
6034 /**
6035  * Unset the callback function that intercepts a show event of a
6036  * object.
6037  *
6038  * @param obj The given canvas object pointer.
6039  * @param func The given callback function.
6040  *
6041  * This function sets a callback function to intercepts a show event
6042  * of a canvas object.
6043  *
6044  * @see evas_object_intercept_show_callback_add().
6045  *
6046  */
6047 EAPI void *evas_object_intercept_show_callback_del(Evas_Object *obj, Evas_Object_Intercept_Show_Cb func) EINA_ARG_NONNULL(1, 2);
6048
6049 /**
6050  * Set the callback function that intercepts a hide event of a object.
6051  *
6052  * @param obj The given canvas object pointer.
6053  * @param func The given function to be the callback function.
6054  * @param data The data passed to the callback function.
6055  *
6056  * This function sets a callback function to intercepts a hide event
6057  * of a canvas object.
6058  *
6059  * @see evas_object_intercept_hide_callback_del().
6060  *
6061  */
6062 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);
6063
6064 /**
6065  * Unset the callback function that intercepts a hide event of a
6066  * object.
6067  *
6068  * @param obj The given canvas object pointer.
6069  * @param func The given callback function.
6070  *
6071  * This function sets a callback function to intercepts a hide event
6072  * of a canvas object.
6073  *
6074  * @see evas_object_intercept_hide_callback_add().
6075  *
6076  */
6077 EAPI void *evas_object_intercept_hide_callback_del(Evas_Object *obj, Evas_Object_Intercept_Hide_Cb func) EINA_ARG_NONNULL(1, 2);
6078
6079 /**
6080  * Set the callback function that intercepts a move event of a object.
6081  *
6082  * @param obj The given canvas object pointer.
6083  * @param func The given function to be the callback function.
6084  * @param data The data passed to the callback function.
6085  *
6086  * This function sets a callback function to intercepts a move event
6087  * of a canvas object.
6088  *
6089  * @see evas_object_intercept_move_callback_del().
6090  *
6091  */
6092 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);
6093
6094 /**
6095  * Unset the callback function that intercepts a move event of a
6096  * object.
6097  *
6098  * @param obj The given canvas object pointer.
6099  * @param func The given callback function.
6100  *
6101  * This function sets a callback function to intercepts a move event
6102  * of a canvas object.
6103  *
6104  * @see evas_object_intercept_move_callback_add().
6105  *
6106  */
6107 EAPI void *evas_object_intercept_move_callback_del(Evas_Object *obj, Evas_Object_Intercept_Move_Cb func) EINA_ARG_NONNULL(1, 2);
6108
6109 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);
6110 EAPI void *evas_object_intercept_resize_callback_del(Evas_Object *obj, Evas_Object_Intercept_Resize_Cb func) EINA_ARG_NONNULL(1, 2);
6111 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);
6112 EAPI void *evas_object_intercept_raise_callback_del(Evas_Object *obj, Evas_Object_Intercept_Raise_Cb func) EINA_ARG_NONNULL(1, 2);
6113 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);
6114 EAPI void *evas_object_intercept_lower_callback_del(Evas_Object *obj, Evas_Object_Intercept_Lower_Cb func) EINA_ARG_NONNULL(1, 2);
6115 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);
6116 EAPI void *evas_object_intercept_stack_above_callback_del(Evas_Object *obj, Evas_Object_Intercept_Stack_Above_Cb func) EINA_ARG_NONNULL(1, 2);
6117 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);
6118 EAPI void *evas_object_intercept_stack_below_callback_del(Evas_Object *obj, Evas_Object_Intercept_Stack_Below_Cb func) EINA_ARG_NONNULL(1, 2);
6119 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);
6120 EAPI void *evas_object_intercept_layer_set_callback_del(Evas_Object *obj, Evas_Object_Intercept_Layer_Set_Cb func) EINA_ARG_NONNULL(1, 2);
6121 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);
6122 EAPI void *evas_object_intercept_color_set_callback_del(Evas_Object *obj, Evas_Object_Intercept_Color_Set_Cb func) EINA_ARG_NONNULL(1, 2);
6123 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);
6124 EAPI void *evas_object_intercept_clip_set_callback_del(Evas_Object *obj, Evas_Object_Intercept_Clip_Set_Cb func) EINA_ARG_NONNULL(1, 2);
6125 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);
6126 EAPI void *evas_object_intercept_clip_unset_callback_del(Evas_Object *obj, Evas_Object_Intercept_Clip_Unset_Cb func) EINA_ARG_NONNULL(1, 2);
6127
6128 /**
6129  * @}
6130  */
6131
6132 /**
6133  * @defgroup Evas_Object_Specific Specific Object Functions
6134  *
6135  * Functions that work on specific objects.
6136  *
6137  */
6138
6139 /**
6140  * @defgroup Evas_Object_Rectangle Rectangle Object Functions
6141  *
6142  * @brief Function to create evas rectangle objects.
6143  *
6144  * There is only one function to deal with rectangle objects, this may make this
6145  * function seem useless given there are no functions to manipulate the created
6146  * rectangle, however the rectangle is actually very useful and should be
6147  * manipulated using the generic @ref Evas_Object_Group "evas object functions".
6148  *
6149  * The evas rectangle serves a number of key functions when working on evas
6150  * programs:
6151  * @li Background
6152  * @li Debugging
6153  * @li Clipper
6154  *
6155  * @section Background
6156  *
6157  * One extremely common requirement of evas programs is to have a solid color
6158  * background, this can be accomplished with the following very simple code:
6159  * @code
6160  * Evas_Object *bg = evas_object_rectangle_add(evas_canvas);
6161  * //Here we set the rectangles red, green, blue and opacity levels
6162  * evas_object_color_set(bg, 255, 255, 255, 255); // opaque white background
6163  * evas_object_resize(bg, WIDTH, HEIGHT); // covers full canvas
6164  * evas_object_show(bg);
6165  * @endcode
6166  *
6167  * This however will have issues if the @c evas_canvas is resized, however most
6168  * windows are created using ecore evas and that has a solution to using the
6169  * rectangle as a background:
6170  * @code
6171  * Evas_Object *bg = evas_object_rectangle_add(ecore_evas_get(ee));
6172  * //Here we set the rectangles red, green, blue and opacity levels
6173  * evas_object_color_set(bg, 255, 255, 255, 255); // opaque white background
6174  * evas_object_resize(bg, WIDTH, HEIGHT); // covers full canvas
6175  * evas_object_show(bg);
6176  * ecore_evas_object_associate(ee, bg, ECORE_EVAS_OBJECT_ASSOCIATE_BASE);
6177  * @endcode
6178  * So this gives us a white background to our window that will be resized
6179  * together with it.
6180  *
6181  * @section Debugging
6182  *
6183  * Debugging is a major part of any programmers task and when debugging visual
6184  * issues with evas programs the rectangle is an extremely useful tool. The
6185  * rectangle's simplicity means that it's easier to pinpoint issues with it than
6186  * with more complex objects. Therefore a common technique to use when writing
6187  * an evas program and not getting the desired visual result is to replace the
6188  * misbehaving object for a solid color rectangle and seeing how it interacts
6189  * with the other elements, this often allows us to notice clipping, parenting
6190  * or positioning issues. Once the issues have been identified and corrected the
6191  * rectangle can be replaced for the original part and in all likelihood any
6192  * remaining issues will be specific to that object's type.
6193  *
6194  * @section clipping Clipping
6195  *
6196  * Clipping serves two main functions:
6197  * @li Limiting visibility(i.e. hiding portions of an object).
6198  * @li Applying a layer of color to an object.
6199  *
6200  * @subsection hiding Limiting visibility
6201  *
6202  * It is often necessary to show only parts of an object, while it may be
6203  * possible to create an object that corresponds only to the part that must be
6204  * shown(and it isn't always possible) it's usually easier to use a a clipper. A
6205  * clipper is a rectangle that defines what's visible and what is not. The way
6206  * to do this is to create a solid white rectangle(which is the default, no need
6207  * to call evas_object_color_set()) and give it a position and size of what
6208  * should be visible. The following code exemplifies showing the center half of
6209  * @c my_evas_object:
6210  * @code
6211  * Evas_Object *clipper = evas_object_rectangle_add(evas_canvas);
6212  * evas_object_move(clipper, my_evas_object_x / 4, my_evas_object_y / 4);
6213  * evas_object_resize(clipper, my_evas_object_width / 2, my_evas_object_height / 2);
6214  * evas_object_clip_set(my_evas_object, clipper);
6215  * evas_object_show(clipper);
6216  * @endcode
6217  *
6218  * @subsection color Layer of color
6219  *
6220  * In the @ref clipping section we used a solid white clipper, which produced no
6221  * change in the color of the clipped object, it just hid what was outside the
6222  * clippers area. It is however sometimes desirable to change the of color an
6223  * object, this can be accomplished using a clipper that has a non-white color.
6224  * Clippers with color work by multiplying the colors of clipped object. The
6225  * following code will show how to remove all the red from an object:
6226  * @code
6227  * Evas_Object *clipper = evas_object_rectangle_add(evas);
6228  * evas_object_move(clipper, my_evas_object_x, my_evas_object_y);
6229  * evas_object_resize(clipper, my_evas_object_width, my_evas_object_height);
6230  * evas_object_color_set(clipper, 0, 255, 255, 255);
6231  * evas_object_clip_set(obj, clipper);
6232  * evas_object_show(clipper);
6233  * @endcode
6234  *
6235  * @warning We don't guarantee any proper results if you create a Rectangle
6236  * object without setting the evas engine.
6237  *
6238  * For an example that more fully exercise the use of an evas object rectangle
6239  * see @ref Example_Evas_Object_Manipulation.
6240  *
6241  * @ingroup Evas_Object_Specific
6242  */
6243
6244 /**
6245  * Adds a rectangle to the given evas.
6246  * @param   e The given evas.
6247  * @return  The new rectangle object.
6248  *
6249  * @ingroup Evas_Object_Rectangle
6250  */
6251 EAPI Evas_Object *evas_object_rectangle_add(Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
6252
6253 /**
6254  * @defgroup Evas_Object_Image Image Object Functions
6255  *
6256  * Here are grouped together functions used to create and manipulate
6257  * image objects. They are available to whichever occasion one needs
6258  * complex imagery on a GUI that could not be achieved by the other
6259  * Evas' primitive object types, or to make image manipulations.
6260  *
6261  * Evas will support whichever image file types it was compiled with
6262  * support to (its image loaders) -- check your software packager for
6263  * that information and see
6264  * evas_object_image_extension_can_load_get().
6265  *
6266  * @section Evas_Object_Image_Basics Image object basics
6267  *
6268  * The most common use of image objects -- to display an image on the
6269  * canvas -- is achieved by a common function triplet:
6270  * @code
6271  * img = evas_object_image_add(canvas);
6272  * evas_object_image_file_set(img, "path/to/img", NULL);
6273  * evas_object_image_fill_set(img, 0, 0, w, h);
6274  * @endcode
6275  * The first function, naturally, is creating the image object. Then,
6276  * one must set an source file on it, so that it knows where to fetch
6277  * image data from. Next, one must set <b>how to fill the image
6278  * object's area</b> with that given pixel data. One could use just a
6279  * sub-region of the original image or even have it tiled repeatedly
6280  * on the image object. For the common case of having the whole source
6281  * image to be displayed on the image object, stretched to the
6282  * destination's size, there's also a function helper, to be used
6283  * instead of evas_object_image_fill_set():
6284  * @code
6285  * evas_object_image_filled_set(img, EINA_TRUE);
6286  * @endcode
6287  * See those functions' documentation for more details.
6288  *
6289  * @section Evas_Object_Image_Scale Scale and resizing
6290  *
6291  * Resizing of image objects will scale their respective source images
6292  * to their areas, if they are set to "fill" the object's area
6293  * (evas_object_image_filled_set()). If the user wants any control on
6294  * the aspect ratio of an image for different sizes, he/she has to
6295  * take care of that themselves. There are functions to make images to
6296  * get loaded scaled (up or down) in memory, already, if the user is
6297  * going to use them at pre-determined sizes and wants to save
6298  * computations.
6299  *
6300  * Evas has even a scale cache, which will take care of caching scaled
6301  * versions of images with more often usage/hits. Finally, one can
6302  * have images being rescaled @b smoothly by Evas (more
6303  * computationally expensive) or not.
6304  *
6305  * @section Evas_Object_Image_Performance Performance hints
6306  *
6307  * When dealing with image objects, there are some tricks to boost the
6308  * performance of your application, if it does intense image loading
6309  * and/or manipulations, as in animations on a UI.
6310  *
6311  * @subsection Evas_Object_Image_Load Load hints
6312  *
6313  * In image viewer applications, for example, the user will be looking
6314  * at a given image, at full size, and will desire that the navigation
6315  * to the adjacent images on his/her album be fluid and fast. Thus,
6316  * while displaying a given image, the program can be on the
6317  * background loading the next and previous images already, so that
6318  * displaying them on the sequence is just a matter of repainting the
6319  * screen (and not decoding image data).
6320  *
6321  * Evas addresses this issue with <b>image pre-loading</b>. The code
6322  * for the situation above would be something like the following:
6323  * @code
6324  * prev = evas_object_image_filled_add(canvas);
6325  * evas_object_image_file_set(prev, "/path/to/prev", NULL);
6326  * evas_object_image_preload(prev, EINA_TRUE);
6327  *
6328  * next = evas_object_image_filled_add(canvas);
6329  * evas_object_image_file_set(next, "/path/to/next", NULL);
6330  * evas_object_image_preload(next, EINA_TRUE);
6331  * @endcode
6332  *
6333  * If you're loading images which are too big, consider setting
6334  * previously it's loading size to something smaller, in case you
6335  * won't expose them in real size. It may speed up the loading
6336  * considerably:
6337  * @code
6338  * //to load a scaled down version of the image in memory, if that's
6339  * //the size you'll be displaying it anyway
6340  * evas_object_image_load_scale_down_set(img, zoom);
6341  *
6342  * //optional: if you know you'll be showing a sub-set of the image's
6343  * //pixels, you can avoid loading the complementary data
6344  * evas_object_image_load_region_set(img, x, y, w, h);
6345  * @endcode
6346  * Refer to Elementary's Photocam widget for a high level (smart)
6347  * object which does lots of loading speed-ups for you.
6348  *
6349  * @subsection Evas_Object_Image_Animation Animation hints
6350  *
6351  * If you want to animate image objects on a UI (what you'd get by
6352  * concomitant usage of other libraries, like Ecore and Edje), there
6353  * are also some tips on how to boost the performance of your
6354  * application. If the animation involves resizing of an image (thus,
6355  * re-scaling), you'd better turn off smooth scaling on it @b during
6356  * the animation, turning it back on afterwards, for less
6357  * computations. Also, in this case you'd better flag the image object
6358  * in question not to cache scaled versions of it:
6359  * @code
6360  * evas_object_image_scale_hint_set(wd->img, EVAS_IMAGE_SCALE_HINT_DYNAMIC);
6361  *
6362  * // resizing takes place in between
6363  *
6364  * evas_object_image_scale_hint_set(wd->img, EVAS_IMAGE_SCALE_HINT_STATIC);
6365  * @endcode
6366  *
6367  * Finally, movement of opaque images through the canvas is less
6368  * expensive than of translucid ones, because of blending
6369  * computations.
6370  *
6371  * @section Evas_Object_Image_Borders Borders
6372  *
6373  * Evas provides facilities for one to specify an image's region to be
6374  * treated specially -- as "borders". This will make those regions be
6375  * treated specially on resizing scales, by keeping their aspect. This
6376  * makes setting frames around other objects on UIs easy.
6377  * See the following figures for a visual explanation:\n
6378  * @htmlonly
6379  * <img src="image-borders.png" style="max-width: 100%;" />
6380  * <a href="image-borders.png">Full-size</a>
6381  * @endhtmlonly
6382  * @image rtf image-borders.png
6383  * @image latex image-borders.eps width=\textwidth
6384  * @htmlonly
6385  * <img src="border-effect.png" style="max-width: 100%;" />
6386  * <a href="border-effect.png">Full-size</a>
6387  * @endhtmlonly
6388  * @image rtf border-effect.png
6389  * @image latex border-effect.eps width=\textwidth
6390  *
6391  * @section Evas_Object_Image_Manipulation Manipulating pixels
6392  *
6393  * Evas image objects can be used to manipulate raw pixels in many
6394  * ways.  The meaning of the data in the pixel arrays will depend on
6395  * the image's color space, be warned (see next section). You can set
6396  * your own data as an image's pixel data, fetch an image's pixel data
6397  * for saving/altering, convert images between different color spaces
6398  * and even advanced operations like setting a native surface as image
6399  * objects' data.
6400  *
6401  * @section Evas_Object_Image_Color_Spaces Color spaces
6402  *
6403  * Image objects may return or accept "image data" in multiple
6404  * formats. This is based on the color space of an object. Here is a
6405  * rundown on formats:
6406  *
6407  * - #EVAS_COLORSPACE_ARGB8888:
6408  *   This pixel format is a linear block of pixels, starting at the
6409  *   top-left row by row until the bottom right of the image or pixel
6410  *   region. All pixels are 32-bit unsigned int's with the high-byte
6411  *   being alpha and the low byte being blue in the format ARGB. Alpha
6412  *   may or may not be used by evas depending on the alpha flag of the
6413  *   image, but if not used, should be set to 0xff anyway.
6414  *   \n\n
6415  *   This colorspace uses premultiplied alpha. That means that R, G
6416  *   and B cannot exceed A in value. The conversion from
6417  *   non-premultiplied colorspace is:
6418  *   \n\n
6419  *   R = (r * a) / 255; G = (g * a) / 255; B = (b * a) / 255;
6420  *   \n\n
6421  *   So 50% transparent blue will be: 0x80000080. This will not be
6422  *   "dark" - just 50% transparent. Values are 0 == black, 255 ==
6423  *   solid or full red, green or blue.
6424  * .
6425  * - #EVAS_COLORSPACE_YCBCR422P601_PL:
6426  *   This is a pointer-list indirected set of YUV (YCbCr) pixel
6427  *   data. This means that the data returned or set is not actual
6428  *   pixel data, but pointers TO lines of pixel data. The list of
6429  *   pointers will first be N rows of pointers to the Y plane -
6430  *   pointing to the first pixel at the start of each row in the Y
6431  *   plane. N is the height of the image data in pixels. Each pixel in
6432  *   the Y, U and V planes is 1 byte exactly, packed. The next N / 2
6433  *   pointers will point to rows in the U plane, and the next N / 2
6434  *   pointers will point to the V plane rows. U and V planes are half
6435  *   the horizontal and vertical resolution of the Y plane.
6436  *   \n\n
6437  *   Row order is top to bottom and row pixels are stored left to
6438  *   right.
6439  *   \n\n
6440  *   There is a limitation that these images MUST be a multiple of 2
6441  *   pixels in size horizontally or vertically. This is due to the U
6442  *   and V planes being half resolution. Also note that this assumes
6443  *   the itu601 YUV colorspace specification. This is defined for
6444  *   standard television and mpeg streams. HDTV may use the itu709
6445  *   specification.
6446  *   \n\n
6447  *   Values are 0 to 255, indicating full or no signal in that plane
6448  *   respectively.
6449  * .
6450  * - #EVAS_COLORSPACE_YCBCR422P709_PL:
6451  *   Not implemented yet.
6452  * .
6453  * - #EVAS_COLORSPACE_RGB565_A5P:
6454  *   In the process of being implemented in 1 engine only. This may
6455  *   change.
6456  *   \n\n
6457  *   This is a pointer to image data for 16-bit half-word pixel data
6458  *   in 16bpp RGB 565 format (5 bits red, 6 bits green, 5 bits blue),
6459  *   with the high-byte containing red and the low byte containing
6460  *   blue, per pixel. This data is packed row by row from the top-left
6461  *   to the bottom right.
6462  *   \n\n
6463  *   If the image has an alpha channel enabled there will be an extra
6464  *   alpha plane after the color pixel plane. If not, then this data
6465  *   will not exist and should not be accessed in any way. This plane
6466  *   is a set of pixels with 1 byte per pixel defining the alpha
6467  *   values of all pixels in the image from the top-left to the bottom
6468  *   right of the image, row by row. Even though the values of the
6469  *   alpha pixels can be 0 to 255, only values 0 through to 32 are
6470  *   used, 32 being solid and 0 being transparent.
6471  *   \n\n
6472  *   RGB values can be 0 to 31 for red and blue and 0 to 63 for green,
6473  *   with 0 being black and 31 or 63 being full red, green or blue
6474  *   respectively. This colorspace is also pre-multiplied like
6475  *   EVAS_COLORSPACE_ARGB8888 so:
6476  *   \n\n
6477  *   R = (r * a) / 32; G = (g * a) / 32; B = (b * a) / 32;
6478  * .
6479  * - #EVAS_COLORSPACE_GRY8:
6480  *   The image is just a alpha mask (8 bit's per pixel). This is used
6481  *   for alpha masking.
6482  *
6483  * @warning We don't guarantee any proper results if you create a Image object
6484  * without setting the evas engine.
6485  *
6486  * Some examples on this group of functions can be found @ref
6487  * Example_Evas_Images "here".
6488  *
6489  * @ingroup Evas_Object_Specific
6490  */
6491
6492 /**
6493  * @addtogroup Evas_Object_Image
6494  * @{
6495  */
6496
6497 typedef void (*Evas_Object_Image_Pixels_Get_Cb)(void *data, Evas_Object *o);
6498
6499 /**
6500  * Creates a new image object on the given Evas @p e canvas.
6501  *
6502  * @param e The given canvas.
6503  * @return The created image object handle.
6504  *
6505  * @note If you intend to @b display an image somehow in a GUI,
6506  * besides binding it to a real image file/source (with
6507  * evas_object_image_file_set(), for example), you'll have to tell
6508  * this image object how to fill its space with the pixels it can get
6509  * from the source. See evas_object_image_filled_add(), for a helper
6510  * on the common case of scaling up an image source to the whole area
6511  * of the image object.
6512  *
6513  * @see evas_object_image_fill_set()
6514  *
6515  * Example:
6516  * @code
6517  * img = evas_object_image_add(canvas);
6518  * evas_object_image_file_set(img, "/path/to/img", NULL);
6519  * @endcode
6520  */
6521 EAPI Evas_Object                  *evas_object_image_add(Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
6522
6523 /**
6524  * Creates a new image object that @b automatically scales its bound
6525  * image to the object's area, on both axis.
6526  *
6527  * @param e The given canvas.
6528  * @return The created image object handle.
6529  *
6530  * This is a helper function around evas_object_image_add() and
6531  * evas_object_image_filled_set(). It has the same effect of applying
6532  * those functions in sequence, which is a very common use case.
6533  *
6534  * @note Whenever this object gets resized, the bound image will be
6535  * rescaled, too.
6536  *
6537  * @see evas_object_image_add()
6538  * @see evas_object_image_filled_set()
6539  * @see evas_object_image_fill_set()
6540  */
6541 EAPI Evas_Object                  *evas_object_image_filled_add(Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
6542
6543 /**
6544  * Sets the data for an image from memory to be loaded
6545  *
6546  * This is the same as evas_object_image_file_set() but the file to be loaded
6547  * may exist at an address in memory (the data for the file, not the filename
6548  * itself). The @p data at the address is copied and stored for future use, so
6549  * no @p data needs to be kept after this call is made. It will be managed and
6550  * freed for you when no longer needed. The @p size is limited to 2 gigabytes
6551  * in size, and must be greater than 0. A @c NULL @p data pointer is also
6552  * invalid. Set the filename to @c NULL to reset to empty state and have the
6553  * image file data freed from memory using evas_object_image_file_set().
6554  *
6555  * The @p format is optional (pass @c NULL if you don't need/use it). It is
6556  * used to help Evas guess better which loader to use for the data. It may
6557  * simply be the "extension" of the file as it would normally be on disk
6558  * such as "jpg" or "png" or "gif" etc.
6559  *
6560  * @param obj The given image object.
6561  * @param data The image file data address
6562  * @param size The size of the image file data in bytes
6563  * @param format The format of the file (optional), or @c NULL if not needed
6564  * @param key The image key in file, or @c NULL.
6565  */
6566 EAPI void                          evas_object_image_memfile_set(Evas_Object *obj, void *data, int size, char *format, char *key) EINA_ARG_NONNULL(1, 2);
6567
6568 /**
6569  * Set the source file from where an image object must fetch the real
6570  * image data (it may be an Eet file, besides pure image ones).
6571  *
6572  * @param obj The given image object.
6573  * @param file The image file path.
6574  * @param key The image key in @p file (if its an Eet one), or @c
6575  * NULL, otherwise.
6576  *
6577  * If the file supports multiple data stored in it (as Eet files do),
6578  * you can specify the key to be used as the index of the image in
6579  * this file.
6580  *
6581  * Example:
6582  * @code
6583  * img = evas_object_image_add(canvas);
6584  * evas_object_image_file_set(img, "/path/to/img", NULL);
6585  * err = evas_object_image_load_error_get(img);
6586  * if (err != EVAS_LOAD_ERROR_NONE)
6587  *   {
6588  *      fprintf(stderr, "could not load image '%s'. error string is \"%s\"\n",
6589  *              valid_path, evas_load_error_str(err));
6590  *   }
6591  * else
6592  *   {
6593  *      evas_object_image_fill_set(img, 0, 0, w, h);
6594  *      evas_object_resize(img, w, h);
6595  *      evas_object_show(img);
6596  *   }
6597  * @endcode
6598  */
6599 EAPI void                          evas_object_image_file_set(Evas_Object *obj, const char *file, const char *key) EINA_ARG_NONNULL(1);
6600
6601 /**
6602  * Retrieve the source file from where an image object is to fetch the
6603  * real image data (it may be an Eet file, besides pure image ones).
6604  *
6605  * @param obj The given image object.
6606  * @param file Location to store the image file path.
6607  * @param key Location to store the image key (if @p file is an Eet
6608  * one).
6609  *
6610  * You must @b not modify the strings on the returned pointers.
6611  *
6612  * @note Use @c NULL pointers on the file components you're not
6613  * interested in: they'll be ignored by the function.
6614  */
6615 EAPI void                          evas_object_image_file_get(const Evas_Object *obj, const char **file, const char **key) EINA_ARG_NONNULL(1, 2);
6616
6617 /**
6618  * Set the dimensions for an image object's border, a region which @b
6619  * won't ever be scaled together with its center.
6620  *
6621  * @param obj The given image object.
6622  * @param l The border's left width.
6623  * @param r The border's right width.
6624  * @param t The border's top width.
6625  * @param b The border's bottom width.
6626  *
6627  * When Evas is rendering, an image source may be scaled to fit the
6628  * size of its image object. This function sets an area from the
6629  * borders of the image inwards which is @b not to be scaled. This
6630  * function is useful for making frames and for widget theming, where,
6631  * for example, buttons may be of varying sizes, but their border size
6632  * must remain constant.
6633  *
6634  * The units used for @p l, @p r, @p t and @p b are canvas units.
6635  *
6636  * @note The border region itself @b may be scaled by the
6637  * evas_object_image_border_scale_set() function.
6638  *
6639  * @note By default, image objects have no borders set, i. e. @c l, @c
6640  * r, @c t and @c b start as @c 0.
6641  *
6642  * See the following figures for visual explanation:\n
6643  * @htmlonly
6644  * <img src="image-borders.png" style="max-width: 100%;" />
6645  * <a href="image-borders.png">Full-size</a>
6646  * @endhtmlonly
6647  * @image rtf image-borders.png
6648  * @image latex image-borders.eps width=\textwidth
6649  * @htmlonly
6650  * <img src="border-effect.png" style="max-width: 100%;" />
6651  * <a href="border-effect.png">Full-size</a>
6652  * @endhtmlonly
6653  * @image rtf border-effect.png
6654  * @image latex border-effect.eps width=\textwidth
6655  *
6656  * @see evas_object_image_border_get()
6657  * @see evas_object_image_border_center_fill_set()
6658  */
6659 EAPI void                          evas_object_image_border_set(Evas_Object *obj, int l, int r, int t, int b) EINA_ARG_NONNULL(1);
6660
6661 /**
6662  * Retrieve the dimensions for an image object's border, a region
6663  * which @b won't ever be scaled together with its center.
6664  *
6665  * @param obj The given image object.
6666  * @param l Location to store the border's left width in.
6667  * @param r Location to store the border's right width in.
6668  * @param t Location to store the border's top width in.
6669  * @param b Location to store the border's bottom width in.
6670  *
6671  * @note Use @c NULL pointers on the border components you're not
6672  * interested in: they'll be ignored by the function.
6673  *
6674  * See @ref evas_object_image_border_set() for more details.
6675  */
6676 EAPI void                          evas_object_image_border_get(const Evas_Object *obj, int *l, int *r, int *t, int *b) EINA_ARG_NONNULL(1);
6677
6678 /**
6679  * Sets @b how the center part of the given image object (not the
6680  * borders) should be drawn when Evas is rendering it.
6681  *
6682  * @param obj The given image object.
6683  * @param fill Fill mode of the center region of @p obj (a value in
6684  * #Evas_Border_Fill_Mode).
6685  *
6686  * This function sets how the center part of the image object's source
6687  * image is to be drawn, which must be one of the values in
6688  * #Evas_Border_Fill_Mode. By center we mean the complementary part of
6689  * that defined by evas_object_image_border_set(). This one is very
6690  * useful for making frames and decorations. You would most probably
6691  * also be using a filled image (as in evas_object_image_filled_set())
6692  * to use as a frame.
6693  *
6694  * @see evas_object_image_border_center_fill_get()
6695  */
6696 EAPI void                          evas_object_image_border_center_fill_set(Evas_Object *obj, Evas_Border_Fill_Mode fill) EINA_ARG_NONNULL(1);
6697
6698 /**
6699  * Retrieves @b how the center part of the given image object (not the
6700  * borders) is to be drawn when Evas is rendering it.
6701  *
6702  * @param obj The given image object.
6703  * @return fill Fill mode of the center region of @p obj (a value in
6704  * #Evas_Border_Fill_Mode).
6705  *
6706  * See @ref evas_object_image_fill_set() for more details.
6707  */
6708 EAPI Evas_Border_Fill_Mode         evas_object_image_border_center_fill_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
6709
6710 /**
6711  * Set whether the image object's fill property should track the
6712  * object's size.
6713  *
6714  * @param obj The given image object.
6715  * @param setting @c EINA_TRUE, to make the fill property follow
6716  *        object size or @c EINA_FALSE, otherwise.
6717  *
6718  * If @p setting is @c EINA_TRUE, then every evas_object_resize() will
6719  * @b automatically trigger a call to evas_object_image_fill_set()
6720  * with the that new size (and @c 0, @c 0 as source image's origin),
6721  * so the bound image will fill the whole object's area.
6722  *
6723  * @see evas_object_image_filled_add()
6724  * @see evas_object_image_fill_get()
6725  */
6726 EAPI void                          evas_object_image_filled_set(Evas_Object *obj, Eina_Bool setting) EINA_ARG_NONNULL(1);
6727
6728 /**
6729  * Retrieve whether the image object's fill property should track the
6730  * object's size.
6731  *
6732  * @param obj The given image object.
6733  * @return @c EINA_TRUE if it is tracking, @c EINA_FALSE, if not (and
6734  *         evas_object_fill_set() must be called manually).
6735  *
6736  * @see evas_object_image_filled_set() for more information
6737  */
6738 EAPI Eina_Bool                     evas_object_image_filled_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
6739
6740 /**
6741  * Sets the scaling factor (multiplier) for the borders of an image
6742  * object.
6743  *
6744  * @param obj The given image object.
6745  * @param scale The scale factor (default is @c 1.0 - i.e. no scaling)
6746  *
6747  * @see evas_object_image_border_set()
6748  * @see evas_object_image_border_scale_get()
6749  */
6750 EAPI void                          evas_object_image_border_scale_set(Evas_Object *obj, double scale);
6751
6752 /**
6753  * Retrieves the scaling factor (multiplier) for the borders of an
6754  * image object.
6755  *
6756  * @param obj The given image object.
6757  * @return The scale factor set for its borders
6758  *
6759  * @see evas_object_image_border_set()
6760  * @see evas_object_image_border_scale_set()
6761  */
6762 EAPI double                        evas_object_image_border_scale_get(const Evas_Object *obj);
6763
6764 /**
6765  * Set how to fill an image object's drawing rectangle given the
6766  * (real) image bound to it.
6767  *
6768  * @param obj The given image object to operate on.
6769  * @param x The x coordinate (from the top left corner of the bound
6770  *          image) to start drawing from.
6771  * @param y The y coordinate (from the top left corner of the bound
6772  *          image) to start drawing from.
6773  * @param w The width the bound image will be displayed at.
6774  * @param h The height the bound image will be displayed at.
6775  *
6776  * Note that if @p w or @p h are smaller than the dimensions of
6777  * @p obj, the displayed image will be @b tiled around the object's
6778  * area. To have only one copy of the bound image drawn, @p x and @p y
6779  * must be 0 and @p w and @p h need to be the exact width and height
6780  * of the image object itself, respectively.
6781  *
6782  * See the following image to better understand the effects of this
6783  * call. On this diagram, both image object and original image source
6784  * have @c a x @c a dimensions and the image itself is a circle, with
6785  * empty space around it:
6786  *
6787  * @image html image-fill.png
6788  * @image rtf image-fill.png
6789  * @image latex image-fill.eps
6790  *
6791  * @warning The default values for the fill parameters are @p x = 0,
6792  * @p y = 0, @p w = 0 and @p h = 0. Thus, if you're not using the
6793  * evas_object_image_filled_add() helper and want your image
6794  * displayed, you'll have to set valid values with this function on
6795  * your object.
6796  *
6797  * @note evas_object_image_filled_set() is a helper function which
6798  * will @b override the values set here automatically, for you, in a
6799  * given way.
6800  */
6801 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);
6802
6803 /**
6804  * Retrieve how an image object is to fill its drawing rectangle,
6805  * given the (real) image bound to it.
6806  *
6807  * @param obj The given image object.
6808  * @param x Location to store the x coordinate (from the top left
6809  *          corner of the bound image) to start drawing from.
6810  * @param y Location to store the y coordinate (from the top left
6811  *          corner of the bound image) to start drawing from.
6812  * @param w Location to store the width the bound image is to be
6813  *          displayed at.
6814  * @param h Location to store the height the bound image is to be
6815  *          displayed at.
6816  *
6817  * @note Use @c NULL pointers on the fill components you're not
6818  * interested in: they'll be ignored by the function.
6819  *
6820  * See @ref evas_object_image_fill_set() for more details.
6821  */
6822 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);
6823
6824 /**
6825  * Sets the tiling mode for the given evas image object's fill.
6826  * @param   obj   The given evas image object.
6827  * @param   spread One of EVAS_TEXTURE_REFLECT, EVAS_TEXTURE_REPEAT,
6828  * EVAS_TEXTURE_RESTRICT, or EVAS_TEXTURE_PAD.
6829  */
6830 EAPI void                          evas_object_image_fill_spread_set(Evas_Object *obj, Evas_Fill_Spread spread) EINA_ARG_NONNULL(1);
6831
6832 /**
6833  * Retrieves the spread (tiling mode) for the given image object's
6834  * fill.
6835  *
6836  * @param   obj The given evas image object.
6837  * @return  The current spread mode of the image object.
6838  */
6839 EAPI Evas_Fill_Spread              evas_object_image_fill_spread_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
6840
6841 /**
6842  * Sets the size of the given image object.
6843  *
6844  * @param obj The given image object.
6845  * @param w The new width of the image.
6846  * @param h The new height of the image.
6847  *
6848  * This function will scale down or crop the image so that it is
6849  * treated as if it were at the given size. If the size given is
6850  * smaller than the image, it will be cropped. If the size given is
6851  * larger, then the image will be treated as if it were in the upper
6852  * left hand corner of a larger image that is otherwise transparent.
6853  */
6854 EAPI void                          evas_object_image_size_set(Evas_Object *obj, int w, int h) EINA_ARG_NONNULL(1);
6855
6856 /**
6857  * Retrieves the size of the given image object.
6858  *
6859  * @param obj The given image object.
6860  * @param w Location to store the width of the image in, or @c NULL.
6861  * @param h Location to store the height of the image in, or @c NULL.
6862  *
6863  * See @ref evas_object_image_size_set() for more details.
6864  */
6865 EAPI void                          evas_object_image_size_get(const Evas_Object *obj, int *w, int *h) EINA_ARG_NONNULL(1);
6866
6867 /**
6868  * Retrieves the row stride of the given image object.
6869  *
6870  * @param obj The given image object.
6871  * @return The stride of the image (<b>in bytes</b>).
6872  *
6873  * The row stride is the number of bytes between the start of a row
6874  * and the start of the next row for image data.
6875  */
6876 EAPI int                           evas_object_image_stride_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
6877
6878 /**
6879  * Retrieves a number representing any error that occurred during the
6880  * last loading of the given image object's source image.
6881  *
6882  * @param obj The given image object.
6883  * @return A value giving the last error that occurred. It should be
6884  *         one of the #Evas_Load_Error values. #EVAS_LOAD_ERROR_NONE
6885  *         is returned if there was no error.
6886  */
6887 EAPI Evas_Load_Error               evas_object_image_load_error_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
6888
6889 /**
6890  * Sets the raw image data of the given image object.
6891  *
6892  * @param obj The given image object.
6893  * @param data The raw data, or @c NULL.
6894  *
6895  * Note that the raw data must be of the same size (see
6896  * evas_object_image_size_set(), which has to be called @b before this
6897  * one) and colorspace (see evas_object_image_colorspace_set()) of the
6898  * image. If data is @c NULL, the current image data will be
6899  * freed. Naturally, if one does not set an image object's data
6900  * manually, it will still have one, allocated by Evas.
6901  *
6902  * @see evas_object_image_data_get()
6903  */
6904 EAPI void                          evas_object_image_data_set(Evas_Object *obj, void *data) EINA_ARG_NONNULL(1);
6905
6906 /**
6907  * Get a pointer to the raw image data of the given image object.
6908  *
6909  * @param obj The given image object.
6910  * @param for_writing Whether the data being retrieved will be
6911  *        modified (@c EINA_TRUE) or not (@c EINA_FALSE).
6912  * @return The raw image data.
6913  *
6914  * This function returns a pointer to an image object's internal pixel
6915  * buffer, for reading only or read/write. If you request it for
6916  * writing, the image will be marked dirty so that it gets redrawn at
6917  * the next update.
6918  *
6919  * Each time you call this function on an image object, its data
6920  * buffer will have an internal reference counter
6921  * incremented. Decrement it back by using
6922  * evas_object_image_data_set(). This is specially important for the
6923  * directfb Evas engine.
6924  *
6925  * This is best suited for when you want to modify an existing image,
6926  * without changing its dimensions.
6927  *
6928  * @note The contents' format returned by it depend on the color
6929  * space of the given image object.
6930  *
6931  * @note You may want to use evas_object_image_data_update_add() to
6932  * inform data changes, if you did any.
6933  *
6934  * @see evas_object_image_data_set()
6935  */
6936 EAPI void                         *evas_object_image_data_get(const Evas_Object *obj, Eina_Bool for_writing) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
6937
6938 /**
6939  * Converts the raw image data of the given image object to the
6940  * specified colorspace.
6941  *
6942  * Note that this function does not modify the raw image data.  If the
6943  * requested colorspace is the same as the image colorspace nothing is
6944  * done and @c NULL is returned. You should use
6945  * evas_object_image_colorspace_get() to check the current image
6946  * colorspace.
6947  *
6948  * See @ref evas_object_image_colorspace_get.
6949  *
6950  * @param obj The given image object.
6951  * @param to_cspace The colorspace to which the image raw data will be converted.
6952  * @return data A newly allocated data in the format specified by to_cspace.
6953  */
6954 EAPI void                         *evas_object_image_data_convert(Evas_Object *obj, Evas_Colorspace to_cspace) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
6955
6956 /**
6957  * Replaces the raw image data of the given image object.
6958  *
6959  * @param obj The given image object.
6960  * @param data The raw data to replace.
6961  *
6962  * This function lets the application replace an image object's
6963  * internal pixel buffer with an user-allocated one. For best results,
6964  * you should generally first call evas_object_image_size_set() with
6965  * the width and height for the new buffer.
6966  *
6967  * This call is best suited for when you will be using image data with
6968  * different dimensions than the existing image data, if any. If you
6969  * only need to modify the existing image in some fashion, then using
6970  * evas_object_image_data_get() is probably what you are after.
6971  *
6972  * Note that the caller is responsible for freeing the buffer when
6973  * finished with it, as user-set image data will not be automatically
6974  * freed when the image object is deleted.
6975  *
6976  * See @ref evas_object_image_data_get() for more details.
6977  *
6978  */
6979 EAPI void                          evas_object_image_data_copy_set(Evas_Object *obj, void *data) EINA_ARG_NONNULL(1);
6980
6981 /**
6982  * Mark a sub-region of the given image object to be redrawn.
6983  *
6984  * @param obj The given image object.
6985  * @param x X-offset of the region to be updated.
6986  * @param y Y-offset of the region to be updated.
6987  * @param w Width of the region to be updated.
6988  * @param h Height of the region to be updated.
6989  *
6990  * This function schedules a particular rectangular region of an image
6991  * object to be updated (redrawn) at the next rendering cycle.
6992  */
6993 EAPI void                          evas_object_image_data_update_add(Evas_Object *obj, int x, int y, int w, int h) EINA_ARG_NONNULL(1);
6994
6995 /**
6996  * Enable or disable alpha channel usage on the given image object.
6997  *
6998  * @param obj The given image object.
6999  * @param has_alpha Whether to use alpha channel (@c EINA_TRUE) data
7000  * or not (@c EINA_FALSE).
7001  *
7002  * This function sets a flag on an image object indicating whether or
7003  * not to use alpha channel data. A value of @c EINA_TRUE makes it use
7004  * alpha channel data, and @c EINA_FALSE makes it ignore that
7005  * data. Note that this has nothing to do with an object's color as
7006  * manipulated by evas_object_color_set().
7007  *
7008  * @see evas_object_image_alpha_get()
7009  */
7010 EAPI void                          evas_object_image_alpha_set(Evas_Object *obj, Eina_Bool has_alpha) EINA_ARG_NONNULL(1);
7011
7012 /**
7013  * Retrieve whether alpha channel data is being used on the given
7014  * image object.
7015  *
7016  * @param obj The given image object.
7017  * @return Whether the alpha channel data is being used (@c EINA_TRUE)
7018  * or not (@c EINA_FALSE).
7019  *
7020  * This function returns @c EINA_TRUE if the image object's alpha
7021  * channel is being used, or @c EINA_FALSE otherwise.
7022  *
7023  * See @ref evas_object_image_alpha_set() for more details.
7024  */
7025 EAPI Eina_Bool                     evas_object_image_alpha_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
7026
7027 /**
7028  * Sets whether to use high-quality image scaling algorithm on the
7029  * given image object.
7030  *
7031  * @param obj The given image object.
7032  * @param smooth_scale Whether to use smooth scale or not.
7033  *
7034  * When enabled, a higher quality image scaling algorithm is used when
7035  * scaling images to sizes other than the source image's original
7036  * one. This gives better results but is more computationally
7037  * expensive.
7038  *
7039  * @note Image objects get created originally with smooth scaling @b
7040  * on.
7041  *
7042  * @see evas_object_image_smooth_scale_get()
7043  */
7044 EAPI void                          evas_object_image_smooth_scale_set(Evas_Object *obj, Eina_Bool smooth_scale) EINA_ARG_NONNULL(1);
7045
7046 /**
7047  * Retrieves whether the given image object is using high-quality
7048  * image scaling algorithm.
7049  *
7050  * @param obj The given image object.
7051  * @return Whether smooth scale is being used.
7052  *
7053  * See @ref evas_object_image_smooth_scale_set() for more details.
7054  */
7055 EAPI Eina_Bool                     evas_object_image_smooth_scale_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
7056
7057 /**
7058  * Preload an image object's image data in the background
7059  *
7060  * @param obj The given image object.
7061  * @param cancel @c EINA_FALSE will add it the preloading work queue,
7062  *               @c EINA_TRUE will remove it (if it was issued before).
7063  *
7064  * This function requests the preload of the data image in the
7065  * background. The work is queued before being processed (because
7066  * there might be other pending requests of this type).
7067  *
7068  * Whenever the image data gets loaded, Evas will call
7069  * #EVAS_CALLBACK_IMAGE_PRELOADED registered callbacks on @p obj (what
7070  * may be immediately, if the data was already preloaded before).
7071  *
7072  * Use @c EINA_TRUE for @p cancel on scenarios where you don't need
7073  * the image data preloaded anymore.
7074  *
7075  * @note Any evas_object_show() call after evas_object_image_preload()
7076  * will make the latter to be @b cancelled, with the loading process
7077  * now taking place @b synchronously (and, thus, blocking the return
7078  * of the former until the image is loaded). It is highly advisable,
7079  * then, that the user preload an image with it being @b hidden, just
7080  * to be shown on the #EVAS_CALLBACK_IMAGE_PRELOADED event's callback.
7081  */
7082 EAPI void                          evas_object_image_preload(Evas_Object *obj, Eina_Bool cancel) EINA_ARG_NONNULL(1);
7083
7084 /**
7085  * Reload an image object's image data.
7086  *
7087  * @param obj The given image object pointer.
7088  *
7089  * This function reloads the image data bound to image object @p obj.
7090  */
7091 EAPI void                          evas_object_image_reload(Evas_Object *obj) EINA_ARG_NONNULL(1);
7092
7093 /**
7094  * Save the given image object's contents to an (image) file.
7095  *
7096  * @param obj The given image object.
7097  * @param file The filename to be used to save the image (extension
7098  *        obligatory).
7099  * @param key The image key in the file (if an Eet one), or @c NULL,
7100  *        otherwise.
7101  * @param flags String containing the flags to be used (@c NULL for
7102  *        none).
7103  *
7104  * The extension suffix on @p file will determine which <b>saver
7105  * module</b> Evas is to use when saving, thus the final file's
7106  * format. If the file supports multiple data stored in it (Eet ones),
7107  * you can specify the key to be used as the index of the image in it.
7108  *
7109  * You can specify some flags when saving the image.  Currently
7110  * acceptable flags are @c quality and @c compress. Eg.: @c
7111  * "quality=100 compress=9"
7112  */
7113 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);
7114
7115 /**
7116  * Import pixels from given source to a given canvas image object.
7117  *
7118  * @param obj The given canvas object.
7119  * @param pixels The pixel's source to be imported.
7120  *
7121  * This function imports pixels from a given source to a given canvas image.
7122  *
7123  */
7124 EAPI Eina_Bool                     evas_object_image_pixels_import(Evas_Object *obj, Evas_Pixel_Import_Source *pixels) EINA_ARG_NONNULL(1, 2);
7125
7126 /**
7127  * Set the callback function to get pixels from a canvas' image.
7128  *
7129  * @param obj The given canvas pointer.
7130  * @param func The callback function.
7131  * @param data The data pointer to be passed to @a func.
7132  *
7133  * This functions sets a function to be the callback function that get
7134  * pixes from a image of the canvas.
7135  *
7136  */
7137 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);
7138
7139 /**
7140  * Mark whether the given image object is dirty (needs to be redrawn).
7141  *
7142  * @param obj The given image object.
7143  * @param dirty Whether the image is dirty.
7144  */
7145 EAPI void                          evas_object_image_pixels_dirty_set(Evas_Object *obj, Eina_Bool dirty) EINA_ARG_NONNULL(1);
7146
7147 /**
7148  * Retrieves whether the given image object is dirty (needs to be redrawn).
7149  *
7150  * @param obj The given image object.
7151  * @return Whether the image is dirty.
7152  */
7153 EAPI Eina_Bool                     evas_object_image_pixels_dirty_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
7154
7155 /**
7156  * Set the DPI resolution of an image object's source image.
7157  *
7158  * @param obj The given canvas pointer.
7159  * @param dpi The new DPI resolution.
7160  *
7161  * This function sets the DPI resolution of a given loaded canvas
7162  * image. Most useful for the SVG image loader.
7163  *
7164  * @see evas_object_image_load_dpi_get()
7165  */
7166 EAPI void                          evas_object_image_load_dpi_set(Evas_Object *obj, double dpi) EINA_ARG_NONNULL(1);
7167
7168 /**
7169  * Get the DPI resolution of a loaded image object in the canvas.
7170  *
7171  * @param obj The given canvas pointer.
7172  * @return The DPI resolution of the given canvas image.
7173  *
7174  * This function returns the DPI resolution of the given canvas image.
7175  *
7176  * @see evas_object_image_load_dpi_set() for more details
7177  */
7178 EAPI double                        evas_object_image_load_dpi_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
7179
7180 /**
7181  * Set the size of a given image object's source image, when loading
7182  * it.
7183  *
7184  * @param obj The given canvas object.
7185  * @param w The new width of the image's load size.
7186  * @param h The new height of the image's load size.
7187  *
7188  * This function sets a new (loading) size for the given canvas
7189  * image.
7190  *
7191  * @see evas_object_image_load_size_get()
7192  */
7193 EAPI void                          evas_object_image_load_size_set(Evas_Object *obj, int w, int h) EINA_ARG_NONNULL(1);
7194
7195 /**
7196  * Get the size of a given image object's source image, when loading
7197  * it.
7198  *
7199  * @param obj The given image object.
7200  * @param w Where to store the new width of the image's load size.
7201  * @param h Where to store the new height of the image's load size.
7202  *
7203  * @note Use @c NULL pointers on the size components you're not
7204  * interested in: they'll be ignored by the function.
7205  *
7206  * @see evas_object_image_load_size_set() for more details
7207  */
7208 EAPI void                          evas_object_image_load_size_get(const Evas_Object *obj, int *w, int *h) EINA_ARG_NONNULL(1);
7209
7210 /**
7211  * Set the scale down factor of a given image object's source image,
7212  * when loading it.
7213  *
7214  * @param obj The given image object pointer.
7215  * @param scale_down The scale down factor.
7216  *
7217  * This function sets the scale down factor of a given canvas
7218  * image. Most useful for the SVG image loader.
7219  *
7220  * @see evas_object_image_load_scale_down_get()
7221  */
7222 EAPI void                          evas_object_image_load_scale_down_set(Evas_Object *obj, int scale_down) EINA_ARG_NONNULL(1);
7223
7224 /**
7225  * get the scale down factor of a given image object's source image,
7226  * when loading it.
7227  *
7228  * @param obj The given image object pointer.
7229  *
7230  * @see evas_object_image_load_scale_down_set() for more details
7231  */
7232 EAPI int                           evas_object_image_load_scale_down_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
7233
7234 /**
7235  * Inform a given image object to load a selective region of its
7236  * source image.
7237  *
7238  * @param obj The given image object pointer.
7239  * @param x X-offset of the region to be loaded.
7240  * @param y Y-offset of the region to be loaded.
7241  * @param w Width of the region to be loaded.
7242  * @param h Height of the region to be loaded.
7243  *
7244  * This function is useful when one is not showing all of an image's
7245  * area on its image object.
7246  *
7247  * @note The image loader for the image format in question has to
7248  * support selective region loading in order to this function to take
7249  * effect.
7250  *
7251  * @see evas_object_image_load_region_get()
7252  */
7253 EAPI void                          evas_object_image_load_region_set(Evas_Object *obj, int x, int y, int w, int h) EINA_ARG_NONNULL(1);
7254
7255 /**
7256  * Retrieve the coordinates of a given image object's selective
7257  * (source image) load region.
7258  *
7259  * @param obj The given image object pointer.
7260  * @param x Where to store the X-offset of the region to be loaded.
7261  * @param y Where to store the Y-offset of the region to be loaded.
7262  * @param w Where to store the width of the region to be loaded.
7263  * @param h Where to store the height of the region to be loaded.
7264  *
7265  * @note Use @c NULL pointers on the coordinates you're not interested
7266  * in: they'll be ignored by the function.
7267  *
7268  * @see evas_object_image_load_region_get()
7269  */
7270 EAPI void                          evas_object_image_load_region_get(const Evas_Object *obj, int *x, int *y, int *w, int *h) EINA_ARG_NONNULL(1);
7271
7272 /**
7273  * Define if the orientation information in the image file should be honored.
7274  *
7275  * @param obj The given image object pointer.
7276  * @param enable @c EINA_TRUE means that it should honor the orientation information
7277  * @since 1.1
7278  */
7279 EAPI void                          evas_object_image_load_orientation_set(Evas_Object *obj, Eina_Bool enable) EINA_ARG_NONNULL(1);
7280
7281 /**
7282  * Get if the orientation information in the image file should be honored.
7283  *
7284  * @param obj The given image object pointer.
7285  * @since 1.1
7286  */
7287 EAPI Eina_Bool                     evas_object_image_load_orientation_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
7288
7289 /**
7290  * Set the colorspace of a given image of the canvas.
7291  *
7292  * @param obj The given image object pointer.
7293  * @param cspace The new color space.
7294  *
7295  * This function sets the colorspace of given canvas image.
7296  *
7297  */
7298 EAPI void                          evas_object_image_colorspace_set(Evas_Object *obj, Evas_Colorspace cspace) EINA_ARG_NONNULL(1);
7299
7300 /**
7301  * Get the colorspace of a given image of the canvas.
7302  *
7303  * @param obj The given image object pointer.
7304  * @return The colorspace of the image.
7305  *
7306  * This function returns the colorspace of given canvas image.
7307  *
7308  */
7309 EAPI Evas_Colorspace               evas_object_image_colorspace_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
7310
7311 /**
7312  * Get the support state of a given image
7313  *
7314  * @param obj The given image object pointer
7315  * @return The region support state
7316  * @since 1.2
7317  *
7318  * This function returns the state of the region support of given image
7319  */
7320 EAPI Eina_Bool                     evas_object_image_region_support_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
7321
7322 /**
7323  * Set the native surface of a given image of the canvas
7324  *
7325  * @param obj The given canvas pointer.
7326  * @param surf The new native surface.
7327  *
7328  * This function sets a native surface of a given canvas image.
7329  *
7330  */
7331 EAPI void                          evas_object_image_native_surface_set(Evas_Object *obj, Evas_Native_Surface *surf) EINA_ARG_NONNULL(1, 2);
7332
7333 /**
7334  * Get the native surface of a given image of the canvas
7335  *
7336  * @param obj The given canvas pointer.
7337  * @return The native surface of the given canvas image.
7338  *
7339  * This function returns the native surface of a given canvas image.
7340  *
7341  */
7342 EAPI Evas_Native_Surface          *evas_object_image_native_surface_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
7343
7344 /**
7345  * Set the video surface linked to a given image of the canvas
7346  *
7347  * @param obj The given canvas pointer.
7348  * @param surf The new video surface.
7349  * @since 1.1
7350  *
7351  * This function link a video surface to a given canvas image.
7352  *
7353  */
7354 EAPI void                          evas_object_image_video_surface_set(Evas_Object *obj, Evas_Video_Surface *surf) EINA_ARG_NONNULL(1);
7355
7356 /**
7357  * Get the video surface linekd to a given image of the canvas
7358  *
7359  * @param obj The given canvas pointer.
7360  * @return The video surface of the given canvas image.
7361  * @since 1.1
7362  *
7363  * This function returns the video surface linked to a given canvas image.
7364  *
7365  */
7366 EAPI const Evas_Video_Surface     *evas_object_image_video_surface_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
7367
7368 /**
7369  * Set the scale hint of a given image of the canvas.
7370  *
7371  * @param obj The given image object pointer.
7372  * @param hint The scale hint, a value in
7373  * #Evas_Image_Scale_Hint.
7374  *
7375  * This function sets the scale hint value of the given image object
7376  * in the canvas, which will affect how Evas is to cache scaled
7377  * versions of its original source image.
7378  *
7379  * @see evas_object_image_scale_hint_get()
7380  */
7381 EAPI void                          evas_object_image_scale_hint_set(Evas_Object *obj, Evas_Image_Scale_Hint hint) EINA_ARG_NONNULL(1);
7382
7383 /**
7384  * Get the scale hint of a given image of the canvas.
7385  *
7386  * @param obj The given image object pointer.
7387  * @return The scale hint value set on @p obj, a value in
7388  * #Evas_Image_Scale_Hint.
7389  *
7390  * This function returns the scale hint value of the given image
7391  * object of the canvas.
7392  *
7393  * @see evas_object_image_scale_hint_set() for more details.
7394  */
7395 EAPI Evas_Image_Scale_Hint         evas_object_image_scale_hint_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
7396
7397 /**
7398  * Set the content hint setting of a given image object of the canvas.
7399  *
7400  * @param obj The given canvas pointer.
7401  * @param hint The content hint value, one of the
7402  * #Evas_Image_Content_Hint ones.
7403  *
7404  * This function sets the content hint value of the given image of the
7405  * canvas. For example, if you're on the GL engine and your driver
7406  * implementation supports it, setting this hint to
7407  * #EVAS_IMAGE_CONTENT_HINT_DYNAMIC will make it need @b zero copies
7408  * at texture upload time, which is an "expensive" operation.
7409  *
7410  * @see evas_object_image_content_hint_get()
7411  */
7412 EAPI void                          evas_object_image_content_hint_set(Evas_Object *obj, Evas_Image_Content_Hint hint) EINA_ARG_NONNULL(1);
7413
7414 /**
7415  * Get the content hint setting of a given image object of the canvas.
7416  *
7417  * @param obj The given canvas pointer.
7418  * @return hint The content hint value set on it, one of the
7419  * #Evas_Image_Content_Hint ones (#EVAS_IMAGE_CONTENT_HINT_NONE means
7420  * an error).
7421  *
7422  * This function returns the content hint value of the given image of
7423  * the canvas.
7424  *
7425  * @see evas_object_image_content_hint_set()
7426  */
7427 EAPI Evas_Image_Content_Hint       evas_object_image_content_hint_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
7428
7429 /**
7430  * Enable an image to be used as an alpha mask.
7431  *
7432  * This will set any flags, and discard any excess image data not used as an
7433  * alpha mask.
7434  *
7435  * Note there is little point in using a image as alpha mask unless it has an
7436  * alpha channel.
7437  *
7438  * @param obj Object to use as an alpha mask.
7439  * @param ismask Use image as alphamask, must be true.
7440  */
7441 EAPI void                          evas_object_image_alpha_mask_set(Evas_Object *obj, Eina_Bool ismask) EINA_ARG_NONNULL(1);
7442
7443 /**
7444  * Set the source object on an image object to used as a @b proxy.
7445  *
7446  * @param obj Proxy (image) object.
7447  * @param src Source object to use for the proxy.
7448  * @return @c EINA_TRUE on success, @c EINA_FALSE on error.
7449  *
7450  * If an image object is set to behave as a @b proxy, it will mirror
7451  * the rendering contents of a given @b source object in its drawing
7452  * region, without affecting that source in any way. The source must
7453  * be another valid Evas object. Other effects may be applied to the
7454  * proxy, such as a map (see evas_object_map_set()) to create a
7455  * reflection of the original object (for example).
7456  *
7457  * Any existing source object on @p obj will be removed after this
7458  * call. Setting @p src to @c NULL clears the proxy object (not in
7459  * "proxy state" anymore).
7460  *
7461  * @warning You cannot set a proxy as another proxy's source.
7462  *
7463  * @see evas_object_image_source_get()
7464  * @see evas_object_image_source_unset()
7465  */
7466 EAPI Eina_Bool                     evas_object_image_source_set(Evas_Object *obj, Evas_Object *src) EINA_ARG_NONNULL(1);
7467
7468 /**
7469  * Get the current source object of an image object.
7470  *
7471  * @param obj Image object
7472  * @return Source object (if any), or @c NULL, if not in "proxy mode"
7473  * (or on errors).
7474  *
7475  * @see evas_object_image_source_set() for more details
7476  */
7477 EAPI Evas_Object                  *evas_object_image_source_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
7478
7479 /**
7480  * Clear the source object on a proxy image object.
7481  *
7482  * @param obj Image object to clear source of.
7483  * @return @c EINA_TRUE on success, @c EINA_FALSE on error.
7484  *
7485  * This is equivalent to calling evas_object_image_source_set() with a
7486  * @c NULL source.
7487  */
7488 EAPI Eina_Bool                     evas_object_image_source_unset(Evas_Object *obj) EINA_ARG_NONNULL(1);
7489
7490 /**
7491  * Check if a file extension may be supported by @ref Evas_Object_Image.
7492  *
7493  * @param file The file to check
7494  * @return @c EINA_TRUE if we may be able to open it, @c EINA_FALSE if it's
7495  * unlikely.
7496  * @since 1.1
7497  *
7498  * If file is a Eina_Stringshare, use directly @ref evas_object_image_extension_can_load_fast_get.
7499  *
7500  * This functions is threadsafe.
7501  */
7502 EAPI Eina_Bool                     evas_object_image_extension_can_load_get(const char *file);
7503
7504 /**
7505  * Check if a file extension may be supported by @ref Evas_Object_Image.
7506  *
7507  * @param file The file to check, it should be an Eina_Stringshare.
7508  * @return @c EINA_TRUE if we may be able to open it, @c EINA_FALSE if it's
7509  * unlikely.
7510  * @since 1.1
7511  *
7512  * This functions is threadsafe.
7513  */
7514 EAPI Eina_Bool                     evas_object_image_extension_can_load_fast_get(const char *file);
7515
7516 /**
7517  * Check if an image object can be animated (have multiple frames)
7518  *
7519  * @param obj Image object
7520  * @return whether obj support animation
7521  *
7522  * This returns if the image file of an image object is capable of animation
7523  * such as an animated gif file might. This is only useful to be called once
7524  * the image object file has been set.
7525  *
7526  * Example:
7527  * @code
7528  * extern Evas_Object *obj;
7529  *
7530  * if (evas_object_image_animated_get(obj))
7531  *   {
7532  *     int frame_count;
7533  *     int loop_count;
7534  *     Evas_Image_Animated_Loop_Hint loop_type;
7535  *     double duration;
7536  *
7537  *     frame_count = evas_object_image_animated_frame_count_get(obj);
7538  *     printf("This image has %d frames\n",frame_count);
7539  *
7540  *     duration = evas_object_image_animated_frame_duration_get(obj,1,0);
7541  *     printf("Frame 1's duration is %f. You had better set object's frame to 2 after this duration using timer\n");
7542  *
7543  *     loop_count = evas_object_image_animated_loop_count_get(obj);
7544  *     printf("loop count is %d. You had better run loop %d times\n",loop_count,loop_count);
7545  *
7546  *     loop_type = evas_object_image_animated_loop_type_get(obj);
7547  *     if (loop_type == EVAS_IMAGE_ANIMATED_HINT_LOOP)
7548  *       printf("You had better set frame like 1->2->3->1->2->3...\n");
7549  *     else if (loop_type == EVAS_IMAGE_ANIMATED_HINT_PINGPONG)
7550  *       printf("You had better set frame like 1->2->3->2->1->2...\n");
7551  *     else
7552  *       printf("Unknown loop type\n");
7553  *
7554  *     evas_object_image_animated_frame_set(obj,1);
7555  *     printf("You set image object's frame to 1. You can see frame 1\n");
7556  *   }
7557  * @endcode
7558  *
7559  * @see evas_object_image_animated_get()
7560  * @see evas_object_image_animated_frame_count_get()
7561  * @see evas_object_image_animated_loop_type_get()
7562  * @see evas_object_image_animated_loop_count_get()
7563  * @see evas_object_image_animated_frame_duration_get()
7564  * @see evas_object_image_animated_frame_set()
7565  * @since 1.1
7566  */
7567 EAPI Eina_Bool                     evas_object_image_animated_get(const Evas_Object *obj);
7568
7569 /**
7570  * Get the total number of frames of the image object.
7571  *
7572  * @param obj Image object
7573  * @return The number of frames
7574  *
7575  * This returns total number of frames the image object supports (if animated)
7576  *
7577  * @see evas_object_image_animated_get()
7578  * @see evas_object_image_animated_frame_count_get()
7579  * @see evas_object_image_animated_loop_type_get()
7580  * @see evas_object_image_animated_loop_count_get()
7581  * @see evas_object_image_animated_frame_duration_get()
7582  * @see evas_object_image_animated_frame_set()
7583  * @since 1.1
7584  */
7585 EAPI int                           evas_object_image_animated_frame_count_get(const Evas_Object *obj);
7586
7587 /**
7588  * Get the kind of looping the image object does.
7589  *
7590  * @param obj Image object
7591  * @return Loop type of the image object
7592  *
7593  * This returns the kind of looping the image object wants to do.
7594  *
7595  * If it returns EVAS_IMAGE_ANIMATED_HINT_LOOP, you should display frames in a sequence like:
7596  * 1->2->3->1->2->3->1...
7597  * If it returns EVAS_IMAGE_ANIMATED_HINT_PINGPONG, it is better to
7598  * display frames in a sequence like: 1->2->3->2->1->2->3->1...
7599  *
7600  * The default type is EVAS_IMAGE_ANIMATED_HINT_LOOP.
7601  *
7602  * @see evas_object_image_animated_get()
7603  * @see evas_object_image_animated_frame_count_get()
7604  * @see evas_object_image_animated_loop_type_get()
7605  * @see evas_object_image_animated_loop_count_get()
7606  * @see evas_object_image_animated_frame_duration_get()
7607  * @see evas_object_image_animated_frame_set()
7608  * @since 1.1
7609  */
7610 EAPI Evas_Image_Animated_Loop_Hint evas_object_image_animated_loop_type_get(const Evas_Object *obj);
7611
7612 /**
7613  * Get the number times the animation of the object loops.
7614  *
7615  * @param obj Image object
7616  * @return The number of loop of an animated image object
7617  *
7618  * This returns loop count of image. The loop count is the number of times
7619  * the animation will play fully from first to last frame until the animation
7620  * should stop (at the final frame).
7621  *
7622  * If 0 is returned, then looping should happen indefinitely (no limit to
7623  * the number of times it loops).
7624  *
7625  * @see evas_object_image_animated_get()
7626  * @see evas_object_image_animated_frame_count_get()
7627  * @see evas_object_image_animated_loop_type_get()
7628  * @see evas_object_image_animated_loop_count_get()
7629  * @see evas_object_image_animated_frame_duration_get()
7630  * @see evas_object_image_animated_frame_set()
7631  * @since 1.1
7632  */
7633 EAPI int                           evas_object_image_animated_loop_count_get(const Evas_Object *obj);
7634
7635 /**
7636  * Get the duration of a sequence of frames.
7637  *
7638  * @param obj Image object
7639  * @param start_frame The first frame
7640  * @param fram_num Number of frames in the sequence
7641  *
7642  * This returns total duration that the specified sequence of frames should
7643  * take in seconds.
7644  *
7645  * If you set start_frame to 1 and frame_num 0, you get frame 1's duration
7646  * If you set start_frame to 1 and frame_num 1, you get frame 1's duration +
7647  * frame2's duration
7648  *
7649  * @see evas_object_image_animated_get()
7650  * @see evas_object_image_animated_frame_count_get()
7651  * @see evas_object_image_animated_loop_type_get()
7652  * @see evas_object_image_animated_loop_count_get()
7653  * @see evas_object_image_animated_frame_duration_get()
7654  * @see evas_object_image_animated_frame_set()
7655  * @since 1.1
7656  */
7657 EAPI double                        evas_object_image_animated_frame_duration_get(const Evas_Object *obj, int start_frame, int fram_num);
7658
7659 /**
7660  * Set the frame to current frame of an image object
7661  *
7662  * @param obj The given image object.
7663  * @param frame_num The index of current frame
7664  *
7665  * This set image object's current frame to frame_num with 1 being the first
7666  * frame.
7667  *
7668  * @see evas_object_image_animated_get()
7669  * @see evas_object_image_animated_frame_count_get()
7670  * @see evas_object_image_animated_loop_type_get()
7671  * @see evas_object_image_animated_loop_count_get()
7672  * @see evas_object_image_animated_frame_duration_get()
7673  * @see evas_object_image_animated_frame_set()
7674  * @since 1.1
7675  */
7676 EAPI void                          evas_object_image_animated_frame_set(Evas_Object *obj, int frame_num);
7677 /**
7678  * @}
7679  */
7680
7681 /**
7682  * @defgroup Evas_Object_Text Text Object Functions
7683  *
7684  * Functions that operate on single line, single style text objects.
7685  *
7686  * For multiline and multiple style text, see @ref Evas_Object_Textblock.
7687  *
7688  * See some @ref Example_Evas_Text "examples" on this group of functions.
7689  *
7690  * @warning We don't guarantee any proper results if you create a Text object
7691  * without setting the evas engine.
7692  *
7693  * @ingroup Evas_Object_Specific
7694  */
7695
7696 /**
7697  * @addtogroup Evas_Object_Text
7698  * @{
7699  */
7700
7701 /* basic styles (4 bits allocated use 0->10 now, 5 left) */
7702 #define EVAS_TEXT_STYLE_MASK_BASIC 0xf
7703
7704 /**
7705  * Text style type creation macro. Use style types on the 's'
7706  * arguments, being 'x' your style variable.
7707  */
7708 #define EVAS_TEXT_STYLE_BASIC_SET(x, s) \
7709   do { x = ((x) & ~EVAS_TEXT_STYLE_MASK_BASIC) | (s); } while (0)
7710
7711 #define EVAS_TEXT_STYLE_MASK_SHADOW_DIRECTION (0x7 << 4)
7712
7713 /**
7714  * Text style type creation macro. This one will impose shadow
7715  * directions on the style type variable -- use the @c
7716  * EVAS_TEXT_STYLE_SHADOW_DIRECTION_* values on 's', incrementally.
7717  */
7718 #define EVAS_TEXT_STYLE_SHADOW_DIRECTION_SET(x, s) \
7719   do { x = ((x) & ~EVAS_TEXT_STYLE_MASK_SHADOW_DIRECTION) | (s); } while (0)
7720
7721 typedef enum _Evas_Text_Style_Type
7722 {
7723    EVAS_TEXT_STYLE_PLAIN,      /**< plain, standard text */
7724    EVAS_TEXT_STYLE_SHADOW,      /**< text with shadow underneath */
7725    EVAS_TEXT_STYLE_OUTLINE,      /**< text with an outline */
7726    EVAS_TEXT_STYLE_SOFT_OUTLINE,      /**< text with a soft outline */
7727    EVAS_TEXT_STYLE_GLOW,      /**< text with a glow effect */
7728    EVAS_TEXT_STYLE_OUTLINE_SHADOW,      /**< text with both outline and shadow effects */
7729    EVAS_TEXT_STYLE_FAR_SHADOW,      /**< text with (far) shadow underneath */
7730    EVAS_TEXT_STYLE_OUTLINE_SOFT_SHADOW,      /**< text with outline and soft shadow effects combined */
7731    EVAS_TEXT_STYLE_SOFT_SHADOW,      /**< text with (soft) shadow underneath */
7732    EVAS_TEXT_STYLE_FAR_SOFT_SHADOW,      /**< text with (far soft) shadow underneath */
7733
7734    /* OR these to modify shadow direction (3 bits needed) */
7735    EVAS_TEXT_STYLE_SHADOW_DIRECTION_BOTTOM_RIGHT = (0x0 << 4),      /**< shadow growing to bottom right */
7736    EVAS_TEXT_STYLE_SHADOW_DIRECTION_BOTTOM = (0x1 << 4),            /**< shadow growing to the bottom */
7737    EVAS_TEXT_STYLE_SHADOW_DIRECTION_BOTTOM_LEFT = (0x2 << 4),       /**< shadow growing to bottom left */
7738    EVAS_TEXT_STYLE_SHADOW_DIRECTION_LEFT = (0x3 << 4),              /**< shadow growing to the left */
7739    EVAS_TEXT_STYLE_SHADOW_DIRECTION_TOP_LEFT = (0x4 << 4),          /**< shadow growing to top left */
7740    EVAS_TEXT_STYLE_SHADOW_DIRECTION_TOP = (0x5 << 4),               /**< shadow growing to the top */
7741    EVAS_TEXT_STYLE_SHADOW_DIRECTION_TOP_RIGHT = (0x6 << 4),         /**< shadow growing to top right */
7742    EVAS_TEXT_STYLE_SHADOW_DIRECTION_RIGHT = (0x7 << 4)             /**< shadow growing to the right */
7743 } 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 */
7744
7745 /**
7746  * Creates a new text object on the provided canvas.
7747  *
7748  * @param e The canvas to create the text object on.
7749  * @return @c NULL on error, a pointer to a new text object on
7750  * success.
7751  *
7752  * Text objects are for simple, single line text elements. If you want
7753  * more elaborated text blocks, see @ref Evas_Object_Textblock.
7754  *
7755  * @see evas_object_text_font_source_set()
7756  * @see evas_object_text_font_set()
7757  * @see evas_object_text_text_set()
7758  */
7759 EAPI Evas_Object         *evas_object_text_add(Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
7760
7761 /**
7762  * Set the font (source) file to be used on a given text object.
7763  *
7764  * @param obj The text object to set font for.
7765  * @param font The font file's path.
7766  *
7767  * This function allows the font file to be explicitly set for a given
7768  * text object, overriding system lookup, which will first occur in
7769  * the given file's contents.
7770  *
7771  * @see evas_object_text_font_get()
7772  */
7773 EAPI void                 evas_object_text_font_source_set(Evas_Object *obj, const char *font) EINA_ARG_NONNULL(1);
7774
7775 /**
7776  * Get the font file's path which is being used on a given text
7777  * object.
7778  *
7779  * @param obj The text object to set font for.
7780  * @return The font file's path.
7781  *
7782  * @see evas_object_text_font_get() for more details
7783  */
7784 EAPI const char          *evas_object_text_font_source_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
7785
7786 /**
7787  * Set the font family and size on a given text object.
7788  *
7789  * @param obj The text object to set font for.
7790  * @param font The font (family) name.
7791  * @param size The font size, in points.
7792  *
7793  * This function allows the font name and size of a text object to be
7794  * set. The @p font string has to follow fontconfig's convention on
7795  * naming fonts, as it's the underlying library used to query system
7796  * fonts by Evas (see the @c fc-list command's output, on your system,
7797  * to get an idea).
7798  *
7799  * @see evas_object_text_font_get()
7800  * @see evas_object_text_font_source_set()
7801  */
7802 EAPI void                 evas_object_text_font_set(Evas_Object *obj, const char *font, Evas_Font_Size size) EINA_ARG_NONNULL(1);
7803
7804 /**
7805  * Retrieve the font family and size in use on a given text object.
7806  *
7807  * @param obj The evas text object to query for font information.
7808  * @param font A pointer to the location to store the font name in.
7809  * @param size A pointer to the location to store the font size in.
7810  *
7811  * This function allows the font name and size of a text object to be
7812  * queried. Be aware that the font name string is still owned by Evas
7813  * and should @b not have free() called on it by the caller of the
7814  * function.
7815  *
7816  * @see evas_object_text_font_set()
7817  */
7818 EAPI void                 evas_object_text_font_get(const Evas_Object *obj, const char **font, Evas_Font_Size *size) EINA_ARG_NONNULL(1);
7819
7820 /**
7821  * Sets the text string to be displayed by the given text object.
7822  *
7823  * @param obj The text object to set text string on.
7824  * @param text Text string to display on it.
7825  *
7826  * @see evas_object_text_text_get()
7827  */
7828 EAPI void                 evas_object_text_text_set(Evas_Object *obj, const char *text) EINA_ARG_NONNULL(1);
7829
7830 /**
7831  * Retrieves the text string currently being displayed by the given
7832  * text object.
7833  *
7834  * @param  obj The given text object.
7835  * @return The text string currently being displayed on it.
7836  *
7837  * @note Do not free() the return value.
7838  *
7839  * @see evas_object_text_text_set()
7840  */
7841 EAPI const char          *evas_object_text_text_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
7842
7843 /**
7844  * @brief Sets the BiDi delimiters used in the textblock.
7845  *
7846  * BiDi delimiters are use for in-paragraph separation of bidi segments. This
7847  * is useful for example in recipients fields of e-mail clients where bidi
7848  * oddities can occur when mixing RTL and LTR.
7849  *
7850  * @param obj The given text object.
7851  * @param delim A null terminated string of delimiters, e.g ",|".
7852  * @since 1.1
7853  */
7854 EAPI void                 evas_object_text_bidi_delimiters_set(Evas_Object *obj, const char *delim);
7855
7856 /**
7857  * @brief Gets the BiDi delimiters used in the textblock.
7858  *
7859  * BiDi delimiters are use for in-paragraph separation of bidi segments. This
7860  * is useful for example in recipients fields of e-mail clients where bidi
7861  * oddities can occur when mixing RTL and LTR.
7862  *
7863  * @param obj The given text object.
7864  * @return A null terminated string of delimiters, e.g ",|". If empty, returns NULL.
7865  * @since 1.1
7866  */
7867 EAPI const char          *evas_object_text_bidi_delimiters_get(const Evas_Object *obj);
7868
7869 EAPI Evas_Coord           evas_object_text_ascent_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
7870 EAPI Evas_Coord           evas_object_text_descent_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
7871 EAPI Evas_Coord           evas_object_text_max_ascent_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
7872 EAPI Evas_Coord           evas_object_text_max_descent_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
7873 EAPI Evas_Coord           evas_object_text_horiz_advance_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
7874 EAPI Evas_Coord           evas_object_text_vert_advance_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
7875 EAPI Evas_Coord           evas_object_text_inset_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
7876
7877 /**
7878  * Retrieve position and dimension information of a character within a text @c Evas_Object.
7879  *
7880  * This function is used to obtain the X, Y, width and height of a the character
7881  * located at @p pos within the @c Evas_Object @p obj. @p obj must be a text object
7882  * as created with evas_object_text_add(). Any of the @c Evas_Coord parameters (@p cx,
7883  * @p cy, @p cw, @p ch) may be @c NULL in which case no value will be assigned to that
7884  * parameter.
7885  *
7886  * @param obj   The text object to retrieve position information for.
7887  * @param pos   The character position to request co-ordinates for.
7888  * @param cx    A pointer to an @c Evas_Coord to store the X value in (can be NULL).
7889  * @param cy    A pointer to an @c Evas_Coord to store the Y value in (can be NULL).
7890  * @param cw    A pointer to an @c Evas_Coord to store the Width value in (can be NULL).
7891  * @param ch    A pointer to an @c Evas_Coord to store the Height value in (can be NULL).
7892  *
7893  * @return @c EINA_FALSE on success, @c EINA_TRUE on error.
7894  */
7895 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);
7896 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);
7897
7898 /**
7899  * Returns the logical position of the last char in the text
7900  * up to the pos given. this is NOT the position of the last char
7901  * because of the possibility of RTL in the text.
7902  */
7903 EAPI int                  evas_object_text_last_up_to_pos(const Evas_Object *obj, Evas_Coord x, Evas_Coord y) EINA_ARG_NONNULL(1);
7904
7905 /**
7906  * Retrieves the style on use on the given text object.
7907  *
7908  * @param obj the given text object to set style on.
7909  * @return the style type in use.
7910  *
7911  * @see evas_object_text_style_set() for more details.
7912  */
7913 EAPI Evas_Text_Style_Type evas_object_text_style_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
7914
7915 /**
7916  * Sets the style to apply on the given text object.
7917  *
7918  * @param obj the given text object to set style on.
7919  * @param type a style type.
7920  *
7921  * Text object styles are one of the values in
7922  * #Evas_Text_Style_Type. Some of those values are combinations of
7923  * more than one style, and some account for the direction of the
7924  * rendering of shadow effects.
7925  *
7926  * @note One may use the helper macros #EVAS_TEXT_STYLE_BASIC_SET and
7927  * #EVAS_TEXT_STYLE_SHADOW_DIRECTION_SET to assemble a style value.
7928  *
7929  * The following figure illustrates the text styles:
7930  *
7931  * @image html text-styles.png
7932  * @image rtf text-styles.png
7933  * @image latex text-styles.eps
7934  *
7935  * @see evas_object_text_style_get()
7936  * @see evas_object_text_shadow_color_set()
7937  * @see evas_object_text_outline_color_set()
7938  * @see evas_object_text_glow_color_set()
7939  * @see evas_object_text_glow2_color_set()
7940  */
7941 EAPI void                 evas_object_text_style_set(Evas_Object *obj, Evas_Text_Style_Type type) EINA_ARG_NONNULL(1);
7942
7943 /**
7944  * Sets the shadow color for the given text object.
7945  *
7946  * @param obj The given Evas text object.
7947  * @param r The red component of the given color.
7948  * @param g The green component of the given color.
7949  * @param b The blue component of the given color.
7950  * @param a The alpha component of the given color.
7951  *
7952  * Shadow effects, which are fading colors decorating the text
7953  * underneath it, will just be shown if the object is set to one of
7954  * the following styles:
7955  *
7956  * - #EVAS_TEXT_STYLE_SHADOW
7957  * - #EVAS_TEXT_STYLE_OUTLINE_SHADOW
7958  * - #EVAS_TEXT_STYLE_FAR_SHADOW
7959  * - #EVAS_TEXT_STYLE_OUTLINE_SOFT_SHADOW
7960  * - #EVAS_TEXT_STYLE_SOFT_SHADOW
7961  * - #EVAS_TEXT_STYLE_FAR_SOFT_SHADOW
7962  *
7963  * One can also change the direction where the shadow grows to, with
7964  * evas_object_text_style_set().
7965  *
7966  * @see evas_object_text_shadow_color_get()
7967  */
7968 EAPI void                 evas_object_text_shadow_color_set(Evas_Object *obj, int r, int g, int b, int a) EINA_ARG_NONNULL(1);
7969
7970 /**
7971  * Retrieves the shadow color for the given text object.
7972  *
7973  * @param obj The given Evas text object.
7974  * @param r Pointer to variable to hold the red component of the given
7975  * color.
7976  * @param g Pointer to variable to hold the green component of the
7977  * given color.
7978  * @param b Pointer to variable to hold the blue component of the
7979  * given color.
7980  * @param a Pointer to variable to hold the alpha component of the
7981  * given color.
7982  *
7983  * @note Use @c NULL pointers on the color components you're not
7984  * interested in: they'll be ignored by the function.
7985  *
7986  * @see evas_object_text_shadow_color_set() for more details.
7987  */
7988 EAPI void                 evas_object_text_shadow_color_get(const Evas_Object *obj, int *r, int *g, int *b, int *a) EINA_ARG_NONNULL(1);
7989
7990 /**
7991  * Sets the glow color for the given text object.
7992  *
7993  * @param obj The given Evas text object.
7994  * @param r The red component of the given color.
7995  * @param g The green component of the given color.
7996  * @param b The blue component of the given color.
7997  * @param a The alpha component of the given color.
7998  *
7999  * Glow effects, which are glowing colors decorating the text's
8000  * surroundings, will just be shown if the object is set to the
8001  * #EVAS_TEXT_STYLE_GLOW style.
8002  *
8003  * @note Glow effects are placed from a short distance of the text
8004  * itself, but no touching it. For glowing effects right on the
8005  * borders of the glyphs, see 'glow 2' effects
8006  * (evas_object_text_glow2_color_set()).
8007  *
8008  * @see evas_object_text_glow_color_get()
8009  */
8010 EAPI void                 evas_object_text_glow_color_set(Evas_Object *obj, int r, int g, int b, int a) EINA_ARG_NONNULL(1);
8011
8012 /**
8013  * Retrieves the glow color for the given text object.
8014  *
8015  * @param obj The given Evas text object.
8016  * @param r Pointer to variable to hold the red component of the given
8017  * color.
8018  * @param g Pointer to variable to hold the green component of the
8019  * given color.
8020  * @param b Pointer to variable to hold the blue component of the
8021  * given color.
8022  * @param a Pointer to variable to hold the alpha component of the
8023  * given color.
8024  *
8025  * @note Use @c NULL pointers on the color components you're not
8026  * interested in: they'll be ignored by the function.
8027  *
8028  * @see evas_object_text_glow_color_set() for more details.
8029  */
8030 EAPI void                 evas_object_text_glow_color_get(const Evas_Object *obj, int *r, int *g, int *b, int *a) EINA_ARG_NONNULL(1);
8031
8032 /**
8033  * Sets the 'glow 2' color for the given text object.
8034  *
8035  * @param obj The given Evas text object.
8036  * @param r The red component of the given color.
8037  * @param g The green component of the given color.
8038  * @param b The blue component of the given color.
8039  * @param a The alpha component of the given color.
8040  *
8041  * 'Glow 2' effects, which are glowing colors decorating the text's
8042  * (immediate) surroundings, will just be shown if the object is set
8043  * to the #EVAS_TEXT_STYLE_GLOW style. See also
8044  * evas_object_text_glow_color_set().
8045  *
8046  * @see evas_object_text_glow2_color_get()
8047  */
8048 EAPI void                 evas_object_text_glow2_color_set(Evas_Object *obj, int r, int g, int b, int a) EINA_ARG_NONNULL(1);
8049
8050 /**
8051  * Retrieves the 'glow 2' color for the given text object.
8052  *
8053  * @param obj The given Evas text object.
8054  * @param r Pointer to variable to hold the red component of the given
8055  * color.
8056  * @param g Pointer to variable to hold the green component of the
8057  * given color.
8058  * @param b Pointer to variable to hold the blue component of the
8059  * given color.
8060  * @param a Pointer to variable to hold the alpha component of the
8061  * given color.
8062  *
8063  * @note Use @c NULL pointers on the color components you're not
8064  * interested in: they'll be ignored by the function.
8065  *
8066  * @see evas_object_text_glow2_color_set() for more details.
8067  */
8068 EAPI void                 evas_object_text_glow2_color_get(const Evas_Object *obj, int *r, int *g, int *b, int *a) EINA_ARG_NONNULL(1);
8069
8070 /**
8071  * Sets the outline color for the given text object.
8072  *
8073  * @param obj The given Evas text object.
8074  * @param r The red component of the given color.
8075  * @param g The green component of the given color.
8076  * @param b The blue component of the given color.
8077  * @param a The alpha component of the given color.
8078  *
8079  * Outline effects (colored lines around text glyphs) will just be
8080  * shown if the object is set to one of the following styles:
8081  * - #EVAS_TEXT_STYLE_OUTLINE
8082  * - #EVAS_TEXT_STYLE_SOFT_OUTLINE
8083  * - #EVAS_TEXT_STYLE_OUTLINE_SHADOW
8084  * - #EVAS_TEXT_STYLE_OUTLINE_SOFT_SHADOW
8085  *
8086  * @see evas_object_text_outline_color_get()
8087  */
8088 EAPI void                 evas_object_text_outline_color_set(Evas_Object *obj, int r, int g, int b, int a) EINA_ARG_NONNULL(1);
8089
8090 /**
8091  * Retrieves the outline color for the given text object.
8092  *
8093  * @param obj The given Evas text object.
8094  * @param r Pointer to variable to hold the red component of the given
8095  * color.
8096  * @param g Pointer to variable to hold the green component of the
8097  * given color.
8098  * @param b Pointer to variable to hold the blue component of the
8099  * given color.
8100  * @param a Pointer to variable to hold the alpha component of the
8101  * given color.
8102  *
8103  * @note Use @c NULL pointers on the color components you're not
8104  * interested in: they'll be ignored by the function.
8105  *
8106  * @see evas_object_text_outline_color_set() for more details.
8107  */
8108 EAPI void                 evas_object_text_outline_color_get(const Evas_Object *obj, int *r, int *g, int *b, int *a) EINA_ARG_NONNULL(1);
8109
8110 /**
8111  * Gets the text style pad of a text object.
8112  *
8113  * @param obj The given text object.
8114  * @param l The left pad (or @c NULL).
8115  * @param r The right pad (or @c NULL).
8116  * @param t The top pad (or @c NULL).
8117  * @param b The bottom pad (or @c NULL).
8118  *
8119  */
8120 EAPI void                 evas_object_text_style_pad_get(const Evas_Object *obj, int *l, int *r, int *t, int *b) EINA_ARG_NONNULL(1);
8121
8122 /**
8123  * Retrieves the direction of the text currently being displayed in the
8124  * text object.
8125  * @param  obj The given evas text object.
8126  * @return the direction of the text
8127  */
8128 EAPI Evas_BiDi_Direction  evas_object_text_direction_get(const Evas_Object *obj) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
8129
8130 /**
8131  * @}
8132  */
8133
8134 /**
8135  * @defgroup Evas_Object_Textblock Textblock Object Functions
8136  *
8137  * Functions used to create and manipulate textblock objects. Unlike
8138  * @ref Evas_Object_Text, these handle complex text, doing multiple
8139  * styles and multiline text based on HTML-like tags. Of these extra
8140  * features will be heavier on memory and processing cost.
8141  *
8142  * @section Evas_Object_Textblock_Tutorial Textblock Object Tutorial
8143  *
8144  * This part explains about the textblock object's API and proper usage.
8145  * The main user of the textblock object is the edje entry object in Edje, so
8146  * that's a good place to learn from, but I think this document is more than
8147  * enough, if it's not, please contact me and I'll update it.
8148  *
8149  * @subsection textblock_intro Introduction
8150  * The textblock objects is, as implied, an object that can show big chunks of
8151  * text. Textblock supports many features including: Text formatting, automatic
8152  * and manual text alignment, embedding items (for example icons) and more.
8153  * Textblock has three important parts, the text paragraphs, the format nodes
8154  * and the cursors.
8155  *
8156  * You can use markup to format text, for example: "<font_size=50>Big!</font_size>".
8157  * You can also put more than one style directive in one tag:
8158  * "<font_size=50 color=#F00>Big and Red!</font_size>".
8159  * Please notice that we used "</font_size>" although the format also included
8160  * color, this is because the first format determines the matching closing tag's
8161  * name. You can also use anonymous tags, like: "<font_size=30>Big</>" which
8162  * just pop any type of format, but it's advised to use the named alternatives
8163  * instead.
8164  *
8165  * @subsection textblock_cursors Textblock Object Cursors
8166  * A textblock Cursor is data type that represents
8167  * a position in a textblock. Each cursor contains information about the
8168  * paragraph it points to, the position in that paragraph and the object itself.
8169  * Cursors register to textblock objects upon creation, this means that once
8170  * you created a cursor, it belongs to a specific obj and you can't for example
8171  * copy a cursor "into" a cursor of a different object. Registered cursors
8172  * also have the added benefit of updating automatically upon textblock changes,
8173  * this means that if you have a cursor pointing to a specific character, it'll
8174  * still point to it even after you change the whole object completely (as long
8175  * as the char was not deleted), this is not possible without updating, because
8176  * as mentioned, each cursor holds a character position. There are many
8177  * functions that handle cursors, just check out the evas_textblock_cursor*
8178  * functions. For creation and deletion of cursors check out:
8179  * @see evas_object_textblock_cursor_new()
8180  * @see evas_textblock_cursor_free()
8181  * @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).
8182  *
8183  * @subsection textblock_paragraphs Textblock Object Paragraphs
8184  * The textblock object is made out of text splitted to paragraphs (delimited
8185  * by the paragraph separation character). Each paragraph has many (or none)
8186  * format nodes associated with it which are responsible for the formatting
8187  * of that paragraph.
8188  *
8189  * @subsection textblock_format_nodes Textblock Object Format Nodes
8190  * As explained in @ref textblock_paragraphs each one of the format nodes
8191  * is associated with a paragraph.
8192  * There are two types of format nodes, visible and invisible:
8193  * Visible: formats that a cursor can point to, i.e formats that
8194  * occupy space, for example: newlines, tabs, items and etc. Some visible items
8195  * are made of two parts, in this case, only the opening tag is visible.
8196  * A closing tag (i.e a \</tag\> tag) should NEVER be visible.
8197  * Invisible: formats that don't occupy space, for example: bold and underline.
8198  * Being able to access format nodes is very important for some uses. For
8199  * example, edje uses the "<a>" format to create links in the text (and pop
8200  * popups above them when clicked). For the textblock object a is just a
8201  * formatting instruction (how to color the text), but edje utilizes the access
8202  * to the format nodes to make it do more.
8203  * For more information, take a look at all the evas_textblock_node_format_*
8204  * functions.
8205  * The translation of "<tag>" tags to actual format is done according to the
8206  * tags defined in the style, see @ref evas_textblock_style_set
8207  *
8208  * @subsection textblock_special_formats Special Formats
8209  * Textblock supports various format directives that can be used in markup. In
8210  * addition to the mentioned format directives, textblock allows creating
8211  * additional format directives using "tags" that can be set in the style see
8212  * @ref evas_textblock_style_set .
8213  *
8214  * Textblock supports the following formats:
8215  * @li font - Font description in fontconfig like format, e.g: "Sans:style=Italic:lang=hi". or "Serif:style=Bold".
8216  * @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".
8217  * @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".
8218  * @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".
8219  * @li lang - Overrides the language defined in "font". E.g: "lang=he" is the same as "font=:lang=he".
8220  * @li font_fallbacks - A comma delimited list of fonts to try if finding the main font fails.
8221  * @li font_size - The font size in points.
8222  * @li font_source - The source of the font, e.g an eet file.
8223  * @li color - Text color in one of the following formats: "#RRGGBB", "#RRGGBBAA", "#RGB", and "#RGBA".
8224  * @li underline_color - color in one of the following formats: "#RRGGBB", "#RRGGBBAA", "#RGB", and "#RGBA".
8225  * @li underline2_color - color in one of the following formats: "#RRGGBB", "#RRGGBBAA", "#RGB", and "#RGBA".
8226  * @li outline_color - color in one of the following formats: "#RRGGBB", "#RRGGBBAA", "#RGB", and "#RGBA".
8227  * @li shadow_color - color in one of the following formats: "#RRGGBB", "#RRGGBBAA", "#RGB", and "#RGBA".
8228  * @li glow_color - color in one of the following formats: "#RRGGBB", "#RRGGBBAA", "#RGB", and "#RGBA".
8229  * @li glow2_color - color in one of the following formats: "#RRGGBB", "#RRGGBBAA", "#RGB", and "#RGBA".
8230  * @li backing_color - color in one of the following formats: "#RRGGBB", "#RRGGBBAA", "#RGB", and "#RGBA".
8231  * @li strikethrough_color - color in one of the following formats: "#RRGGBB", "#RRGGBBAA", "#RGB", and "#RGBA".
8232  * @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%.
8233  * @li valign - Either "top", "bottom", "middle", "center", "baseline", "base", a value between 0.0 and 1.0, or a value between 0% to 100%.
8234  * @li wrap - "word", "char", "mixed", or "none".
8235  * @li left_margin - Either "reset", or a pixel value indicating the margin.
8236  * @li right_margin - Either "reset", or a pixel value indicating the margin.
8237  * @li underline - "on", "off", "single", or "double".
8238  * @li strikethrough - "on" or "off"
8239  * @li backing - "on" or "off"
8240  * @li style - Either "off", "none", "plain", "shadow", "outline", "soft_outline", "outline_shadow", "outline_soft_shadow", "glow", "far_shadow", "soft_shadow", or "far_soft_shadow".
8241  * @li tabstops - Pixel value for tab width.
8242  * @li linesize - Force a line size in pixels.
8243  * @li linerelsize - Either a floating point value or a percentage indicating the wanted size of the line relative to the calculated size.
8244  * @li linegap - Force a line gap in pixels.
8245  * @li linerelgap - Either a floating point value or a percentage indicating the wanted size of the line relative to the calculated size.
8246  * @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.
8247  * @li linefill - Either a float value or percentage indicating how much to fill the line.
8248  * @li ellipsis - Value between 0.0-1.0 to indicate the type of ellipsis, or -1.0 to indicate ellipsis isn't wanted.
8249  * @li password - "on" or "off". This is used to specifically turn replacing chars with the replacement char (i.e password mode) on and off.
8250  *
8251  * @warning We don't guarantee any proper results if you create a Textblock
8252  * object
8253  * without setting the evas engine.
8254  *
8255  * @todo put here some usage examples
8256  *
8257  * @ingroup Evas_Object_Specific
8258  *
8259  * @{
8260  */
8261
8262 typedef struct _Evas_Textblock_Style              Evas_Textblock_Style;
8263 typedef struct _Evas_Textblock_Cursor             Evas_Textblock_Cursor;
8264 /**
8265  * @typedef Evas_Object_Textblock_Node_Format
8266  * A format node.
8267  */
8268 typedef struct _Evas_Object_Textblock_Node_Format Evas_Object_Textblock_Node_Format;
8269 typedef struct _Evas_Textblock_Rectangle          Evas_Textblock_Rectangle;
8270
8271 struct _Evas_Textblock_Rectangle
8272 {
8273    Evas_Coord x, y, w, h;
8274 };
8275
8276 typedef enum _Evas_Textblock_Text_Type
8277 {
8278    EVAS_TEXTBLOCK_TEXT_RAW,
8279    EVAS_TEXTBLOCK_TEXT_PLAIN,
8280    EVAS_TEXTBLOCK_TEXT_MARKUP
8281 } Evas_Textblock_Text_Type;
8282
8283 typedef enum _Evas_Textblock_Cursor_Type
8284 {
8285    EVAS_TEXTBLOCK_CURSOR_UNDER,
8286    EVAS_TEXTBLOCK_CURSOR_BEFORE
8287 } Evas_Textblock_Cursor_Type;
8288
8289 /**
8290  * Adds a textblock to the given evas.
8291  * @param   e The given evas.
8292  * @return  The new textblock object.
8293  */
8294 EAPI Evas_Object                             *evas_object_textblock_add(Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
8295
8296 /**
8297  * Returns the unescaped version of escape.
8298  * @param escape the string to be escaped
8299  * @return the unescaped version of escape
8300  */
8301 EAPI const char                              *evas_textblock_escape_string_get(const char *escape) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
8302
8303 /**
8304  * Returns the escaped version of the string.
8305  * @param string to escape
8306  * @param len_ret the len of the part of the string that was used.
8307  * @return the escaped string.
8308  */
8309 EAPI const char                              *evas_textblock_string_escape_get(const char *string, int *len_ret) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
8310
8311 /**
8312  * Return the unescaped version of the string between start and end.
8313  *
8314  * @param escape_start the start of the string.
8315  * @param escape_end the end of the string.
8316  * @return the unescaped version of the range
8317  */
8318 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);
8319
8320 /**
8321  * Return the plain version of the markup.
8322  *
8323  * Works as if you set the markup to a textblock and then retrieve the plain
8324  * version of the text. i.e: <br> and <\n> will be replaced with \n, &...; with
8325  * the actual char and etc.
8326  *
8327  * @param obj The textblock object to work with. (if @c NULL, tries the
8328  * default).
8329  * @param text The markup text (if @c NULL, return @c NULL).
8330  * @return An allocated plain text version of the markup.
8331  * @since 1.2
8332  */
8333 EAPI char                                    *evas_textblock_text_markup_to_utf8(const Evas_Object *obj, const char *text) EINA_WARN_UNUSED_RESULT EINA_MALLOC;
8334
8335 /**
8336  * Return the markup version of the plain text.
8337  *
8338  * Replaces \\n -\> \<br/\> \\t -\> \<tab/\> and etc. Generally needed before you pass
8339  * plain text to be set in a textblock.
8340  *
8341  * @param obj the textblock object to work with (if @c NULL, it just does the
8342  * default behaviour, i.e with no extra object information).
8343  * @param text The markup text (if @c NULL, return @c NULL).
8344  * @return An allocated plain text version of the markup.
8345  * @since 1.2
8346  */
8347 EAPI char                                    *evas_textblock_text_utf8_to_markup(const Evas_Object *obj, const char *text) EINA_WARN_UNUSED_RESULT EINA_MALLOC;
8348
8349 /**
8350  * Creates a new textblock style.
8351  * @return  The new textblock style.
8352  */
8353 EAPI Evas_Textblock_Style                    *evas_textblock_style_new(void) EINA_WARN_UNUSED_RESULT EINA_MALLOC;
8354
8355 /**
8356  * Destroys a textblock style.
8357  * @param ts The textblock style to free.
8358  */
8359 EAPI void                                     evas_textblock_style_free(Evas_Textblock_Style *ts) EINA_ARG_NONNULL(1);
8360
8361 /**
8362  * Sets the style ts to the style passed as text by text.
8363  * Expected a string consisting of many (or none) tag='format' pairs.
8364  *
8365  * @param ts  the style to set.
8366  * @param text the text to parse - NOT NULL.
8367  * @return Returns no value.
8368  */
8369 EAPI void                                     evas_textblock_style_set(Evas_Textblock_Style *ts, const char *text) EINA_ARG_NONNULL(1);
8370
8371 /**
8372  * Return the text of the style ts.
8373  * @param ts  the style to get it's text.
8374  * @return the text of the style or null on error.
8375  */
8376 EAPI const char                              *evas_textblock_style_get(const Evas_Textblock_Style *ts) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
8377
8378 /**
8379  * Set the objects style to ts.
8380  * @param obj the Evas object to set the style to.
8381  * @param ts  the style to set.
8382  * @return Returns no value.
8383  */
8384 EAPI void                                     evas_object_textblock_style_set(Evas_Object *obj, Evas_Textblock_Style *ts) EINA_ARG_NONNULL(1);
8385
8386 /**
8387  * Return the style of an object.
8388  * @param obj  the object to get the style from.
8389  * @return the style of the object.
8390  */
8391 EAPI const Evas_Textblock_Style              *evas_object_textblock_style_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
8392
8393 /**
8394  * Push ts to the top of the user style stack.
8395  *
8396  * FIXME: API is solid but currently only supports 1 style in the stack.
8397  *
8398  * The user style overrides the corresponding elements of the regular style.
8399  * This is the proper way to do theme overrides in code.
8400  * @param obj the Evas object to set the style to.
8401  * @param ts  the style to set.
8402  * @return Returns no value.
8403  * @see evas_object_textblock_style_set
8404  * @since 1.2
8405  */
8406 EAPI void                                     evas_object_textblock_style_user_push(Evas_Object *obj, Evas_Textblock_Style *ts) EINA_ARG_NONNULL(1);
8407
8408 /**
8409  * Del the from the top of the user style stack.
8410  *
8411  * @param obj  the object to get the style from.
8412  * @see evas_object_textblock_style_get
8413  * @since 1.2
8414  */
8415 EAPI void                                     evas_object_textblock_style_user_pop(Evas_Object *obj) EINA_ARG_NONNULL(1);
8416
8417 /**
8418  * Get (don't remove) the style at the top of the user style stack.
8419  *
8420  * @param obj  the object to get the style from.
8421  * @return the style of the object.
8422  * @see evas_object_textblock_style_get
8423  * @since 1.2
8424  */
8425 EAPI const Evas_Textblock_Style              *evas_object_textblock_style_user_peek(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
8426
8427 /**
8428  * @brief Set the "replacement character" to use for the given textblock object.
8429  *
8430  * @param obj The given textblock object.
8431  * @param ch The charset name.
8432  */
8433 EAPI void                                     evas_object_textblock_replace_char_set(Evas_Object *obj, const char *ch) EINA_ARG_NONNULL(1);
8434
8435 /**
8436  * @brief Get the "replacement character" for given textblock object. Returns
8437  * @c NULL if no replacement character is in use.
8438  *
8439  * @param obj The given textblock object
8440  * @return Replacement character or @c NULL.
8441  */
8442 EAPI const char                              *evas_object_textblock_replace_char_get(Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
8443
8444 /**
8445  * @brief Sets the vertical alignment of text within the textblock object
8446  * as a whole.
8447  *
8448  * Normally alignment is 0.0 (top of object). Values given should be
8449  * between 0.0 and 1.0 (1.0 bottom of object, 0.5 being vertically centered
8450  * etc.).
8451  *
8452  * @param obj The given textblock object.
8453  * @param align A value between @c 0.0 and @c 1.0.
8454  * @since 1.1
8455  */
8456 EAPI void                                     evas_object_textblock_valign_set(Evas_Object *obj, double align);
8457
8458 /**
8459  * @brief Gets the vertical alignment of a textblock
8460  *
8461  * @param obj The given textblock object.
8462  * @return The alignment set for the object.
8463  * @since 1.1
8464  */
8465 EAPI double                                   evas_object_textblock_valign_get(const Evas_Object *obj);
8466
8467 /**
8468  * @brief Sets the BiDi delimiters used in the textblock.
8469  *
8470  * BiDi delimiters are use for in-paragraph separation of bidi segments. This
8471  * is useful for example in recipients fields of e-mail clients where bidi
8472  * oddities can occur when mixing RTL and LTR.
8473  *
8474  * @param obj The given textblock object.
8475  * @param delim A null terminated string of delimiters, e.g ",|".
8476  * @since 1.1
8477  */
8478 EAPI void                                     evas_object_textblock_bidi_delimiters_set(Evas_Object *obj, const char *delim);
8479
8480 /**
8481  * @brief Gets the BiDi delimiters used in the textblock.
8482  *
8483  * BiDi delimiters are use for in-paragraph separation of bidi segments. This
8484  * is useful for example in recipients fields of e-mail clients where bidi
8485  * oddities can occur when mixing RTL and LTR.
8486  *
8487  * @param obj The given textblock object.
8488  * @return A null terminated string of delimiters, e.g ",|". If empty, returns
8489  * @c NULL.
8490  * @since 1.1
8491  */
8492 EAPI const char                              *evas_object_textblock_bidi_delimiters_get(const Evas_Object *obj);
8493
8494 /**
8495  * @brief Sets newline mode. When true, newline character will behave
8496  * as a paragraph separator.
8497  *
8498  * @param obj The given textblock object.
8499  * @param mode @c EINA_TRUE for legacy mode, @c EINA_FALSE otherwise.
8500  * @since 1.1
8501  */
8502 EAPI void                                     evas_object_textblock_legacy_newline_set(Evas_Object *obj, Eina_Bool mode) EINA_ARG_NONNULL(1);
8503
8504 /**
8505  * @brief Gets newline mode. When true, newline character behaves
8506  * as a paragraph separator.
8507  *
8508  * @param obj The given textblock object.
8509  * @return @c EINA_TRUE if in legacy mode, @c EINA_FALSE otherwise.
8510  * @since 1.1
8511  */
8512 EAPI Eina_Bool                                evas_object_textblock_legacy_newline_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
8513
8514 /**
8515  * Sets the tetxblock's text to the markup text.
8516  *
8517  * @note assumes text does not include the unicode object replacement char (0xFFFC)
8518  *
8519  * @param obj  the textblock object.
8520  * @param text the markup text to use.
8521  * @return Return no value.
8522  */
8523 EAPI void                                     evas_object_textblock_text_markup_set(Evas_Object *obj, const char *text) EINA_ARG_NONNULL(1);
8524
8525 /**
8526  * Prepends markup to the cursor cur.
8527  *
8528  * @note assumes text does not include the unicode object replacement char (0xFFFC)
8529  *
8530  * @param cur  the cursor to prepend to.
8531  * @param text the markup text to prepend.
8532  * @return Return no value.
8533  */
8534 EAPI void                                     evas_object_textblock_text_markup_prepend(Evas_Textblock_Cursor *cur, const char *text) EINA_ARG_NONNULL(1, 2);
8535
8536 /**
8537  * Return the markup of the object.
8538  *
8539  * @param obj the Evas object.
8540  * @return the markup text of the object.
8541  */
8542 EAPI const char                              *evas_object_textblock_text_markup_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
8543
8544 /**
8545  * Return the object's main cursor.
8546  *
8547  * @param obj the object.
8548  * @return The @p obj's main cursor.
8549  */
8550 EAPI Evas_Textblock_Cursor                   *evas_object_textblock_cursor_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
8551
8552 /**
8553  * Create a new cursor, associate it to the obj and init it to point
8554  * to the start of the textblock. Association to the object means the cursor
8555  * will be updated when the object will change.
8556  *
8557  * @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).
8558  *
8559  * @param obj the object to associate to.
8560  * @return the new cursor.
8561  */
8562 EAPI Evas_Textblock_Cursor                   *evas_object_textblock_cursor_new(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
8563
8564 /**
8565  * Free the cursor and unassociate it from the object.
8566  * @note do not use it to free unassociated cursors.
8567  *
8568  * @param cur the cursor to free.
8569  * @return Returns no value.
8570  */
8571 EAPI void                                     evas_textblock_cursor_free(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8572
8573 /**
8574  * Sets the cursor to the start of the first text node.
8575  *
8576  * @param cur the cursor to update.
8577  * @return Returns no value.
8578  */
8579 EAPI void                                     evas_textblock_cursor_paragraph_first(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8580
8581 /**
8582  * sets the cursor to the end of the last text node.
8583  *
8584  * @param cur the cursor to set.
8585  * @return Returns no value.
8586  */
8587 EAPI void                                     evas_textblock_cursor_paragraph_last(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8588
8589 /**
8590  * Advances to the start of the next text node
8591  *
8592  * @param cur the cursor to update
8593  * @return @c EINA_TRUE if it managed to advance a paragraph, @c EINA_FALSE
8594  * otherwise.
8595  */
8596 EAPI Eina_Bool                                evas_textblock_cursor_paragraph_next(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8597
8598 /**
8599  * Advances to the end of the previous text node
8600  *
8601  * @param cur the cursor to update
8602  * @return @c EINA_TRUE if it managed to advance a paragraph, @c EINA_FALSE
8603  * otherwise.
8604  */
8605 EAPI Eina_Bool                                evas_textblock_cursor_paragraph_prev(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8606
8607 /**
8608  * Returns the
8609  *
8610  * @param obj The evas, must not be @c NULL.
8611  * @param anchor the anchor name to get
8612  * @return Returns the list format node corresponding to the anchor, may be null if there are none.
8613  */
8614 EAPI const Eina_List                         *evas_textblock_node_format_list_get(const Evas_Object *obj, const char *anchor) EINA_ARG_NONNULL(1, 2);
8615
8616 /**
8617  * Returns the first format node.
8618  *
8619  * @param obj The evas, must not be @c NULL.
8620  * @return Returns the first format node, may be null if there are none.
8621  */
8622 EAPI const Evas_Object_Textblock_Node_Format *evas_textblock_node_format_first_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
8623
8624 /**
8625  * Returns the last format node.
8626  *
8627  * @param obj The evas textblock, must not be NULL.
8628  * @return Returns the first format node, may be null if there are none.
8629  */
8630 EAPI const Evas_Object_Textblock_Node_Format *evas_textblock_node_format_last_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
8631
8632 /**
8633  * Returns the next format node (after n)
8634  *
8635  * @param n the current format node - not null.
8636  * @return Returns the next format node, may be null.
8637  */
8638 EAPI const Evas_Object_Textblock_Node_Format *evas_textblock_node_format_next_get(const Evas_Object_Textblock_Node_Format *n) EINA_ARG_NONNULL(1);
8639
8640 /**
8641  * Returns the prev format node (after n)
8642  *
8643  * @param n the current format node - not null.
8644  * @return Returns the prev format node, may be null.
8645  */
8646 EAPI const Evas_Object_Textblock_Node_Format *evas_textblock_node_format_prev_get(const Evas_Object_Textblock_Node_Format *n) EINA_ARG_NONNULL(1);
8647
8648 /**
8649  * Remove a format node and it's match. i.e, removes a \<tag\> \</tag\> pair.
8650  * Assumes the node is the first part of \<tag\> i.e, this won't work if
8651  * n is a closing tag.
8652  *
8653  * @param obj the Evas object of the textblock - not null.
8654  * @param n the current format node - not null.
8655  */
8656 EAPI void                                     evas_textblock_node_format_remove_pair(Evas_Object *obj, Evas_Object_Textblock_Node_Format *n) EINA_ARG_NONNULL(1, 2);
8657
8658 /**
8659  * Sets the cursor to point to the place where format points to.
8660  *
8661  * @param cur the cursor to update.
8662  * @param n the format node to update according.
8663  * @deprecated duplicate of evas_textblock_cursor_at_format_set
8664  */
8665 EAPI void                                     evas_textblock_cursor_set_at_format(Evas_Textblock_Cursor *cur, const Evas_Object_Textblock_Node_Format *n) EINA_ARG_NONNULL(1, 2);
8666
8667 /**
8668  * Return the format node at the position pointed by cur.
8669  *
8670  * @param cur the position to look at.
8671  * @return the format node if found, @c NULL otherwise.
8672  * @see evas_textblock_cursor_format_is_visible_get()
8673  */
8674 EAPI const Evas_Object_Textblock_Node_Format *evas_textblock_cursor_format_get(const Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8675
8676 /**
8677  * Get the text format representation of the format node.
8678  *
8679  * @param fnode the format node.
8680  * @return the textual format of the format node.
8681  */
8682 EAPI const char                              *evas_textblock_node_format_text_get(const Evas_Object_Textblock_Node_Format *fnode) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
8683
8684 /**
8685  * Set the cursor to point to the position of fmt.
8686  *
8687  * @param cur the cursor to update
8688  * @param fmt the format to update according to.
8689  */
8690 EAPI void                                     evas_textblock_cursor_at_format_set(Evas_Textblock_Cursor *cur, const Evas_Object_Textblock_Node_Format *fmt) EINA_ARG_NONNULL(1, 2);
8691
8692 /**
8693  * Check if the current cursor position is a visible format. This way is more
8694  * efficient than evas_textblock_cursor_format_get() to check for the existence
8695  * of a visible format.
8696  *
8697  * @param cur the cursor to look at.
8698  * @return @c EINA_TRUE if the cursor points to a visible format, @c EINA_FALSE
8699  * otherwise.
8700  * @see evas_textblock_cursor_format_get()
8701  */
8702 EAPI Eina_Bool                                evas_textblock_cursor_format_is_visible_get(const Evas_Textblock_Cursor *cur) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
8703
8704 /**
8705  * Advances to the next format node
8706  *
8707  * @param cur the cursor to be updated.
8708  * @return @c EINA_TRUE on success @c EINA_FALSE otherwise.
8709  */
8710 EAPI Eina_Bool                                evas_textblock_cursor_format_next(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8711
8712 /**
8713  * Advances to the previous format node.
8714  *
8715  * @param cur the cursor to update.
8716  * @return @c EINA_TRUE on success @c EINA_FALSE otherwise.
8717  */
8718 EAPI Eina_Bool                                evas_textblock_cursor_format_prev(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8719
8720 /**
8721  * Returns true if the cursor points to a format.
8722  *
8723  * @param cur the cursor to check.
8724  * @return  @c EINA_TRUE if a cursor points to a format @c EINA_FALSE
8725  * otherwise.
8726  */
8727 EAPI Eina_Bool                                evas_textblock_cursor_is_format(const Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8728
8729 /**
8730  * Advances 1 char forward.
8731  *
8732  * @param cur the cursor to advance.
8733  * @return @c EINA_TRUE on success @c EINA_FALSE otherwise.
8734  */
8735 EAPI Eina_Bool                                evas_textblock_cursor_char_next(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8736
8737 /**
8738  * Advances 1 char backward.
8739  *
8740  * @param cur the cursor to advance.
8741  * @return @c EINA_TRUE on success @c EINA_FALSE otherwise.
8742  */
8743 EAPI Eina_Bool                                evas_textblock_cursor_char_prev(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8744
8745 /**
8746  * Moves the cursor to the start of the word under the cursor.
8747  *
8748  * @param cur the cursor to move.
8749  * @return @c EINA_TRUE on success @c EINA_FALSE otherwise.
8750  * @since 1.2
8751  */
8752 EAPI Eina_Bool                                evas_textblock_cursor_word_start(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8753
8754 /**
8755  * Moves the cursor to the end of the word under the cursor.
8756  *
8757  * @param cur the cursor to move.
8758  * @return @c EINA_TRUE on success @c EINA_FALSE otherwise.
8759  * @since 1.2
8760  */
8761 EAPI Eina_Bool                                evas_textblock_cursor_word_end(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8762
8763 /**
8764  * Go to the first char in the node the cursor is pointing on.
8765  *
8766  * @param cur the cursor to update.
8767  * @return Returns no value.
8768  */
8769 EAPI void                                     evas_textblock_cursor_paragraph_char_first(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8770
8771 /**
8772  * Go to the last char in a text node.
8773  *
8774  * @param cur the cursor to update.
8775  * @return Returns no value.
8776  */
8777 EAPI void                                     evas_textblock_cursor_paragraph_char_last(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8778
8779 /**
8780  * Go to the start of the current line
8781  *
8782  * @param cur the cursor to update.
8783  * @return Returns no value.
8784  */
8785 EAPI void                                     evas_textblock_cursor_line_char_first(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8786
8787 /**
8788  * Go to the end of the current line.
8789  *
8790  * @param cur the cursor to update.
8791  * @return Returns no value.
8792  */
8793 EAPI void                                     evas_textblock_cursor_line_char_last(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8794
8795 /**
8796  * Return the current cursor pos.
8797  *
8798  * @param cur the cursor to take the position from.
8799  * @return the position or -1 on error
8800  */
8801 EAPI int                                      evas_textblock_cursor_pos_get(const Evas_Textblock_Cursor *cur) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
8802
8803 /**
8804  * Set the cursor pos.
8805  *
8806  * @param cur the cursor to be set.
8807  * @param pos the pos to set.
8808  */
8809 EAPI void                                     evas_textblock_cursor_pos_set(Evas_Textblock_Cursor *cur, int pos) EINA_ARG_NONNULL(1);
8810
8811 /**
8812  * Go to the start of the line passed
8813  *
8814  * @param cur cursor to update.
8815  * @param line numer to set.
8816  * @return @c EINA_TRUE on success, @c EINA_FALSE on error.
8817  */
8818 EAPI Eina_Bool                                evas_textblock_cursor_line_set(Evas_Textblock_Cursor *cur, int line) EINA_ARG_NONNULL(1);
8819
8820 /**
8821  * Compare two cursors.
8822  *
8823  * @param cur1 the first cursor.
8824  * @param cur2 the second cursor.
8825  * @return -1 if cur1 < cur2, 0 if cur1 == cur2 and 1 otherwise.
8826  */
8827 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);
8828
8829 /**
8830  * Make cur_dest point to the same place as cur. Does not work if they don't
8831  * point to the same object.
8832  *
8833  * @param cur the source cursor.
8834  * @param cur_dest destination cursor.
8835  * @return Returns no value.
8836  */
8837 EAPI void                                     evas_textblock_cursor_copy(const Evas_Textblock_Cursor *cur, Evas_Textblock_Cursor *cur_dest) EINA_ARG_NONNULL(1, 2);
8838
8839 /**
8840  * Adds text to the current cursor position and set the cursor to *before*
8841  * the start of the text just added.
8842  *
8843  * @param cur the cursor to where to add text at.
8844  * @param text the text to add.
8845  * @return Returns the len of the text added.
8846  * @see evas_textblock_cursor_text_prepend()
8847  */
8848 EAPI int                                      evas_textblock_cursor_text_append(Evas_Textblock_Cursor *cur, const char *text) EINA_ARG_NONNULL(1, 2);
8849
8850 /**
8851  * Adds text to the current cursor position and set the cursor to *after*
8852  * the start of the text just added.
8853  *
8854  * @param cur the cursor to where to add text at.
8855  * @param text the text to add.
8856  * @return Returns the len of the text added.
8857  * @see evas_textblock_cursor_text_append()
8858  */
8859 EAPI int                                      evas_textblock_cursor_text_prepend(Evas_Textblock_Cursor *cur, const char *text) EINA_ARG_NONNULL(1, 2);
8860
8861 /**
8862  * Adds format to the current cursor position. If the format being added is a
8863  * visible format, add it *before* the cursor position, otherwise, add it after.
8864  * This behavior is because visible formats are like characters and invisible
8865  * should be stacked in a way that the last one is added last.
8866  *
8867  * This function works with native formats, that means that style defined
8868  * tags like <br> won't work here. For those kind of things use markup prepend.
8869  *
8870  * @param cur the cursor to where to add format at.
8871  * @param format the format to add.
8872  * @return Returns true if a visible format was added, false otherwise.
8873  * @see evas_textblock_cursor_format_prepend()
8874  */
8875
8876 /**
8877  * Check if the current cursor position points to the terminating null of the
8878  * last paragraph. (shouldn't be allowed to point to the terminating null of
8879  * any previous paragraph anyway.
8880  *
8881  * @param cur the cursor to look at.
8882  * @return @c EINA_TRUE if the cursor points to the terminating null, @c EINA_FALSE otherwise.
8883  */
8884 EAPI Eina_Bool                                evas_textblock_cursor_format_append(Evas_Textblock_Cursor *cur, const char *format) EINA_ARG_NONNULL(1, 2);
8885
8886 /**
8887  * Adds format to the current cursor position. If the format being added is a
8888  * visible format, add it *before* the cursor position, otherwise, add it after.
8889  * This behavior is because visible formats are like characters and invisible
8890  * should be stacked in a way that the last one is added last.
8891  * If the format is visible the cursor is advanced after it.
8892  *
8893  * This function works with native formats, that means that style defined
8894  * tags like <br> won't work here. For those kind of things use markup prepend.
8895  *
8896  * @param cur the cursor to where to add format at.
8897  * @param format the format to add.
8898  * @return Returns true if a visible format was added, false otherwise.
8899  * @see evas_textblock_cursor_format_prepend()
8900  */
8901 EAPI Eina_Bool                                evas_textblock_cursor_format_prepend(Evas_Textblock_Cursor *cur, const char *format) EINA_ARG_NONNULL(1, 2);
8902
8903 /**
8904  * Delete the character at the location of the cursor. If there's a format
8905  * pointing to this position, delete it as well.
8906  *
8907  * @param cur the cursor pointing to the current location.
8908  * @return Returns no value.
8909  */
8910 EAPI void                                     evas_textblock_cursor_char_delete(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8911
8912 /**
8913  * Delete the range between cur1 and cur2.
8914  *
8915  * @param cur1 one side of the range.
8916  * @param cur2 the second side of the range
8917  * @return Returns no value.
8918  */
8919 EAPI void                                     evas_textblock_cursor_range_delete(Evas_Textblock_Cursor *cur1, Evas_Textblock_Cursor *cur2) EINA_ARG_NONNULL(1, 2);
8920
8921 /**
8922  * Return the text of the paragraph cur points to - returns the text in markup.
8923  *
8924  * @param cur the cursor pointing to the paragraph.
8925  * @return the text on success, @c NULL otherwise.
8926  */
8927 EAPI const char                              *evas_textblock_cursor_paragraph_text_get(const Evas_Textblock_Cursor *cur) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
8928
8929 /**
8930  * Return the length of the paragraph, cheaper the eina_unicode_strlen()
8931  *
8932  * @param cur the position of the paragraph.
8933  * @return the length of the paragraph on success, -1 otehrwise.
8934  */
8935 EAPI int                                      evas_textblock_cursor_paragraph_text_length_get(const Evas_Textblock_Cursor *cur) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
8936
8937 /**
8938  * Return the currently visible range.
8939  *
8940  * @param start the start of the range.
8941  * @param end the end of the range.
8942  * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
8943  * @since 1.1
8944  */
8945 EAPI Eina_Bool                                evas_textblock_cursor_visible_range_get(Evas_Textblock_Cursor *start, Evas_Textblock_Cursor *end) EINA_ARG_NONNULL(1, 2);
8946
8947 /**
8948  * Return the format nodes in the range between cur1 and cur2.
8949  *
8950  * @param cur1 one side of the range.
8951  * @param cur2 the other side of the range
8952  * @return the foramt nodes in the range. You have to free it.
8953  * @since 1.1
8954  */
8955 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);
8956
8957 /**
8958  * Return the text in the range between cur1 and cur2
8959  *
8960  * @param cur1 one side of the range.
8961  * @param cur2 the other side of the range
8962  * @param format The form on which to return the text. Markup - in textblock markup. Plain - UTF8.
8963  * @return the text in the range
8964  * @see elm_entry_markup_to_utf8()
8965  */
8966 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);
8967
8968 /**
8969  * Return the content of the cursor.
8970  *
8971  * Free the returned string pointer when done (if it is not NULL).
8972  *
8973  * @param cur the cursor
8974  * @return the text in the range, terminated by a nul byte (may be utf8).
8975  */
8976 EAPI char                                    *evas_textblock_cursor_content_get(const Evas_Textblock_Cursor *cur) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
8977
8978 /**
8979  * Returns the geometry of the cursor. Depends on the type of cursor requested.
8980  * This should be used instead of char_geometry_get because there are weird
8981  * special cases with BiDi text.
8982  * in '_' cursor mode (i.e a line below the char) it's the same as char_geometry
8983  * get, except for the case of the last char of a line which depends on the
8984  * paragraph direction.
8985  *
8986  * in '|' cursor mode (i.e a line between two chars) it is very variable.
8987  * For example consider the following visual string:
8988  * "abcCBA" (ABC are rtl chars), a cursor pointing on A should actually draw
8989  * a '|' between the c and the C.
8990  *
8991  * @param cur the cursor.
8992  * @param cx the x of the cursor
8993  * @param cy the y of the cursor
8994  * @param cw the width of the cursor
8995  * @param ch the height of the cursor
8996  * @param dir the direction of the cursor, can be NULL.
8997  * @param ctype the type of the cursor.
8998  * @return line number of the char on success, -1 on error.
8999  */
9000 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);
9001
9002 /**
9003  * Returns the geometry of the char at cur.
9004  *
9005  * @param cur the position of the char.
9006  * @param cx the x of the char.
9007  * @param cy the y of the char.
9008  * @param cw the w of the char.
9009  * @param ch the h of the char.
9010  * @return line number of the char on success, -1 on error.
9011  */
9012 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);
9013
9014 /**
9015  * Returns the geometry of the pen at cur.
9016  *
9017  * @param cur the position of the char.
9018  * @param cpen_x the pen_x of the char.
9019  * @param cy the y of the char.
9020  * @param cadv the adv of the char.
9021  * @param ch the h of the char.
9022  * @return line number of the char on success, -1 on error.
9023  */
9024 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);
9025
9026 /**
9027  * Returns the geometry of the line at cur.
9028  *
9029  * @param cur the position of the line.
9030  * @param cx the x of the line.
9031  * @param cy the y of the line.
9032  * @param cw the width of the line.
9033  * @param ch the height of the line.
9034  * @return line number of the line on success, -1 on error.
9035  */
9036 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);
9037
9038 /**
9039  * Set the position of the cursor according to the X and Y coordinates.
9040  *
9041  * @param cur the cursor to set.
9042  * @param x coord to set by.
9043  * @param y coord to set by.
9044  * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
9045  */
9046 EAPI Eina_Bool                                evas_textblock_cursor_char_coord_set(Evas_Textblock_Cursor *cur, Evas_Coord x, Evas_Coord y) EINA_ARG_NONNULL(1);
9047
9048 /**
9049  * Set the cursor position according to the y coord.
9050  *
9051  * @param cur the cur to be set.
9052  * @param y the coord to set by.
9053  * @return the line number found, -1 on error.
9054  */
9055 EAPI int                                      evas_textblock_cursor_line_coord_set(Evas_Textblock_Cursor *cur, Evas_Coord y) EINA_ARG_NONNULL(1);
9056
9057 /**
9058  * Get the geometry of a range.
9059  *
9060  * @param cur1 one side of the range.
9061  * @param cur2 other side of the range.
9062  * @return a list of Rectangles representing the geometry of the range.
9063  */
9064 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);
9065 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);
9066
9067 /**
9068  * Checks if the cursor points to the end of the line.
9069  *
9070  * @param cur the cursor to check.
9071  * @return @c EINA_TRUE if true, @c EINA_FALSE otherwise.
9072  */
9073 EAPI Eina_Bool                                evas_textblock_cursor_eol_get(const Evas_Textblock_Cursor *cur) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
9074
9075 /**
9076  * Get the geometry of a line number.
9077  *
9078  * @param obj the object.
9079  * @param line the line number.
9080  * @param cx x coord of the line.
9081  * @param cy y coord of the line.
9082  * @param cw w coord of the line.
9083  * @param ch h coord of the line.
9084  * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
9085  */
9086 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);
9087
9088 /**
9089  * Clear the textblock object.
9090  * @note Does *NOT* free the Evas object itself.
9091  *
9092  * @param obj the object to clear.
9093  * @return nothing.
9094  */
9095 EAPI void                                     evas_object_textblock_clear(Evas_Object *obj) EINA_ARG_NONNULL(1);
9096
9097 /**
9098  * Get the formatted width and height. This calculates the actual size after restricting
9099  * the textblock to the current size of the object.
9100  * The main difference between this and @ref evas_object_textblock_size_native_get
9101  * is that the "native" function does not wrapping into account
9102  * it just calculates the real width of the object if it was placed on an
9103  * infinite canvas, while this function gives the size after wrapping
9104  * according to the size restrictions of the object.
9105  *
9106  * For example for a textblock containing the text: "You shall not pass!"
9107  * with no margins or padding and assuming a monospace font and a size of
9108  * 7x10 char widths (for simplicity) has a native size of 19x1
9109  * and a formatted size of 5x4.
9110  *
9111  *
9112  * @param obj the Evas object.
9113  * @param w the width of the object.
9114  * @param h the height of the object
9115  * @return Returns no value.
9116  * @see evas_object_textblock_size_native_get
9117  */
9118 EAPI void                                     evas_object_textblock_size_formatted_get(const Evas_Object *obj, Evas_Coord *w, Evas_Coord *h) EINA_ARG_NONNULL(1);
9119
9120 /**
9121  * Get the native width and height. This calculates the actual size without taking account
9122  * the current size of the object.
9123  * The main difference between this and @ref evas_object_textblock_size_formatted_get
9124  * is that the "native" function does not take wrapping into account
9125  * it just calculates the real width of the object if it was placed on an
9126  * infinite canvas, while the "formatted" function gives the size after
9127  * wrapping text according to the size restrictions of the object.
9128  *
9129  * For example for a textblock containing the text: "You shall not pass!"
9130  * with no margins or padding and assuming a monospace font and a size of
9131  * 7x10 char widths (for simplicity) has a native size of 19x1
9132  * and a formatted size of 5x4.
9133  *
9134  * @param obj the Evas object of the textblock
9135  * @param w the width returned
9136  * @param h the height returned
9137  * @return Returns no value.
9138  */
9139 EAPI void                                     evas_object_textblock_size_native_get(const Evas_Object *obj, Evas_Coord *w, Evas_Coord *h) EINA_ARG_NONNULL(1);
9140 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);
9141
9142 /**
9143  * @}
9144  */
9145
9146
9147 /**
9148  * @defgroup Evas_Object_Textgrid Textgrid Object Functions
9149  *
9150  * @todo put here some usage examples
9151  *
9152  * @since 1.7
9153  *
9154  * @ingroup Evas_Object_Specific
9155  *
9156  * @{
9157  */
9158
9159 /**
9160  * @typedef Evas_Textgrid_Palette
9161  *
9162  * The palette to use for the forgraound and background colors.
9163  *
9164  * @since 1.7
9165  */
9166 typedef enum
9167 {
9168    EVAS_TEXTGRID_PALETTE_NONE,     /**< No palette is used */
9169    EVAS_TEXTGRID_PALETTE_STANDARD, /**< standard palette (around 16 colors) */
9170    EVAS_TEXTGRID_PALETTE_EXTENDED, /**< extended palette (at max 256 colors) */
9171    EVAS_TEXTGRID_PALETTE_LAST      /**< ignore it */
9172 } Evas_Textgrid_Palette;
9173
9174 /**
9175  * @typedef Evas_Textgrid_Font_Style
9176  *
9177  * The style to give to each character of the grid.
9178  *
9179  * @since 1.7
9180  */
9181 typedef enum
9182 {
9183    EVAS_TEXTGRID_FONT_STYLE_NORMAL = (1 << 0), /**< Normal style */
9184    EVAS_TEXTGRID_FONT_STYLE_BOLD   = (1 << 1), /**< Bold style */
9185    EVAS_TEXTGRID_FONT_STYLE_ITALIC = (1 << 2)  /**< Oblique style */
9186 } Evas_Textgrid_Font_Style;
9187
9188 /**
9189  * @typedef Evas_Textgrid_Cell
9190  *
9191  * The values that describes each cell.
9192  *
9193  * @since 1.7
9194  */
9195 typedef struct _Evas_Textgrid_Cell Evas_Textgrid_Cell;
9196
9197 /**
9198  * @struct _Evas_Textgrid_Cell
9199  *
9200  * The values that describes each cell.
9201  *
9202  * @since 1.7
9203  */
9204 struct _Evas_Textgrid_Cell
9205 {
9206    Eina_Unicode   codepoint;         /**< the UNICODE value of the character */
9207    unsigned char  fg;                /**< the index of the palette for the foreground color */
9208    unsigned char  bg;                /**< the index of the palette for the background color */
9209    unsigned short bold          : 1; /**< whether the character is bold */
9210    unsigned short italic        : 1; /**< whether the character is oblique */
9211    unsigned short underline     : 1; /**< whether the character is underlined */
9212    unsigned short strikethrough : 1; /**< whether the character is strikethrough'ed */
9213    unsigned short fg_extended   : 1; /**< whether the extended palette is used for the foreground color */
9214    unsigned short bg_extended   : 1; /**< whether the extended palette is used for the background color */
9215    unsigned short double_width  : 1; /**< if the codepoint is merged with the following cell to the right visually (cells must be in pairs with 2nd cell being a duplicate in all ways except codepoint is 0) */
9216 };
9217
9218 /**
9219  * @brief Add a textgrid to the given Evas.
9220  *
9221  * @param e The given evas.
9222  * @return The new textgrid object.
9223  *
9224  * This function adds a new textgrid object to the Evas @p e and returns the object.
9225  *
9226  * @since 1.7
9227  */
9228 EAPI Evas_Object *evas_object_textgrid_add(Evas *e);
9229
9230 /**
9231  * @brief Set the size of the textgrid object.
9232  *
9233  * @param obj The textgrid object.
9234  * @param w The number of columns (width in cells) of the grid.
9235  * @param h The number of rows (height in cells) of the grid.
9236  *
9237  * This function sets the number of lines @p h and the number
9238  * of columns @p w to the textgrid object @p obj. If
9239  * @p w or @p h are less or equal than 0, this
9240  * functiond does nothing.
9241  *
9242  * @since 1.7
9243  */
9244 EAPI void evas_object_textgrid_size_set(Evas_Object *obj, int w, int h);
9245
9246 /**
9247  * @brief Get the size of the textgrid object.
9248  *
9249  * @param obj The textgrid object.
9250  * @param w The number of columns of the grid.
9251  * @param h The number of rows of the grid.
9252  *
9253  * This function retrieves the number of lines in the buffer @p
9254  * h and the number of columns in the buffer @p w of
9255  * the textgrid object @p obj. @p w or @p h can be
9256  * @c NULL. On error, their value is 0.
9257  *
9258  * @since 1.7
9259  */
9260 EAPI void evas_object_textgrid_size_get(const Evas_Object *obj, int *w, int *h);
9261
9262 /**
9263  * @brief Set the font (source) file to be used on a given textgrid object.
9264  *
9265  * @param obj The textgrid object to set font for.
9266  * @param font_source The font file's path.
9267  *
9268  * This function allows the font file @p font_source to be explicitly
9269  * set for the textgrid object @p obj, overriding system lookup, which
9270  * will first occur in the given file's contents. If @font_source is
9271  * @c NULL or is an empty string, or the same font_source has already
9272  * been set, or on error, this function does nothing.
9273  *
9274  * @see evas_object_textgrid_font_get()
9275  * @see evas_object_textgrid_font_set()
9276  * @see evas_object_textgrid_font_source_get()
9277  *
9278  * @since 1.7
9279  */
9280 EAPI void evas_object_textgrid_font_source_set(Evas_Object *obj, const char *font_source);
9281
9282 /**
9283  * @brief Get the font file's path which is being used on a given textgrid object.
9284  *
9285  * @param obj The textgrid object to set font for.
9286  * @return The font file's path.
9287  *
9288  * This function returns the font source path of the textgrid object
9289  * @p obj. If the font source path has not been set, or on error,
9290  * @c NULL is returned.
9291  *
9292  * @see evas_object_textgrid_font_get()
9293  * @see evas_object_textgrid_font_set()
9294  * @see evas_object_textgrid_font_source_set()
9295  *
9296  * @since 1.7
9297  */
9298 EAPI const char *evas_object_textgrid_font_source_get(const Evas_Object *obj);
9299
9300 /**
9301  * @brief Set the font family and size on a given textgrid object.
9302  *
9303  * @param obj The textgrid object to set font for.
9304  * @param font_name The font (family) name.
9305  * @param font_size The font size, in points.
9306  *
9307  * This function allows the font name @p font_name and size
9308  * @p font_size of the textgrid object @p obj to be set. The @p font_name
9309  * string has to follow fontconfig's convention on naming fonts, as
9310  * it's the underlying library used to query system fonts by Evas (see
9311  * the @c fc-list command's output, on your system, to get an
9312  * idea). It also has to be a monospace font. If @p font_name is
9313  * @c NULL, or if it is an empty string, or if @p font_size is less or
9314  * equal than 0, or on error, this function does nothing.
9315  *
9316  * @see evas_object_textgrid_font_get()
9317  * @see evas_object_textgrid_font_source_set()
9318  * @see evas_object_textgrid_font_source_get()
9319  *
9320  * @since 1.7
9321  */
9322 EAPI void evas_object_textgrid_font_set(Evas_Object *obj, const char *font_name, Evas_Font_Size font_size);
9323
9324 /**
9325  * @brief Retrieve the font family and size in use on a given textgrid object.
9326  *
9327  * @param obj The textgrid object to query for font information.
9328  * @param font_name A pointer to the location to store the font name in.
9329  * @param font_size A pointer to the location to store the font size in.
9330  *
9331  * This function allows the font name and size of a textgrid object
9332  * @p obj to be queried and stored respectively in the buffers
9333  * @p font_name and @p font_size. Be aware that the font name string is
9334  * still owned by Evas and should @b not have free() called on it by
9335  * the caller of the function. On error, the font name is the empty
9336  * string and the font size is 0. @p font_name and @p font_source can
9337  * be @c NULL.
9338  *
9339  * @see evas_object_textgrid_font_set()
9340  * @see evas_object_textgrid_font_source_set()
9341  * @see evas_object_textgrid_font_source_get()
9342  *
9343  * @since 1.7
9344  */
9345 EAPI void evas_object_textgrid_font_get(const Evas_Object *obj, const char **font_name, Evas_Font_Size *font_size);
9346
9347 /**
9348  * @brief Retrieve the size of a cell of the given textgrid object in pixels.
9349  *
9350  * @param obj The textgrid object to query for font information.
9351  * @param width A pointer to the location to store the width in pixels of a cell.
9352  * @param height A pointer to the location to store the height in
9353  * pixels of a cell.
9354  *
9355  * This functions retrieves the width and height, in pixels, of a cell
9356  * of the textgrid object @p obj and store them respectively in the
9357  * buffers @p width and @p height. Their value depends on the
9358  * monospace font used for the textgrid object, as well as the
9359  * style. @p width and @p height can be @c NULL. On error, they are
9360  * set to 0.
9361  *
9362  * @see evas_object_textgrid_font_set()
9363  * @see evas_object_textgrid_supported_font_styles_set()
9364  *
9365  * @since 1.7
9366  */
9367 EAPI void evas_object_textgrid_cell_size_get(const Evas_Object *obj, Evas_Coord *w, Evas_Coord *h);
9368
9369 /**
9370  * @brief The set color to the given palette at the given index of the given textgrid object.
9371  *
9372  * @param obj The textgrid object to query for font information.
9373  * @param pal The type of the palette to set the color.
9374  * @param idx The index of the paletter to wich the color is stored.
9375  * @param r The red component of the color.
9376  * @param g The green component of the color.
9377  * @param b The blue component of the color.
9378  * @param a The alpha component of the color.
9379  *
9380  * This function sets the color for the palette of type @p pal at the
9381  * index @p idx of the textgrid object @p obj. The ARGB components are
9382  * given by @p r, @p g, @p b and @p a. This color can be used when
9383  * setting the #Evas_Textgrid_Cell structure. The components must set
9384  * a pre-multiplied color. If pal is #EVAS_TEXTGRID_PALETTE_NONE or
9385  * #EVAS_TEXTGRID_PALETTE_LAST, or if @p idx is not between 0 and 255,
9386  * or on error, this function does nothing. The color components are
9387  * clamped between 0 and 255. If @p idx is greater than the latest set
9388  * color, the colors between this last index and @p idx - 1 are set to
9389  * black (0, 0, 0, 0).
9390  *
9391  * @see evas_object_textgrid_palette_get()
9392  *
9393  * @since 1.7
9394  */
9395 EAPI void evas_object_textgrid_palette_set(Evas_Object *obj, Evas_Textgrid_Palette pal, int idx, int r, int g, int b, int a);
9396
9397 /**
9398  * @brief The retrieve color to the given palette at the given index of the given textgrid object.
9399  *
9400  * @param obj The textgrid object to query for font information.
9401  * @param pal The type of the palette to set the color.
9402  * @param idx The index of the paletter to wich the color is stored.
9403  * @param r A pointer to the red component of the color.
9404  * @param g A pointer to the green component of the color.
9405  * @param b A pointer to the blue component of the color.
9406  * @param a A pointer to the alpha component of the color.
9407  *
9408  * This function retrieves the color for the palette of type @p pal at the
9409  * index @p idx of the textgrid object @p obj. The ARGB components are
9410  * stored in the buffers @p r, @p g, @p b and @p a. If @p idx is not
9411  * between 0 and the index of the latest set color, or if @p pal is
9412  * #EVAS_TEXTGRID_PALETTE_NONE or #EVAS_TEXTGRID_PALETTE_LAST, the
9413  * values of the components are 0. @p r, @p g, @pb and @p a can be
9414  * @c NULL.
9415  *
9416  * @see evas_object_textgrid_palette_set()
9417  *
9418  * @since 1.7
9419  */
9420 EAPI void evas_object_textgrid_palette_get(const Evas_Object *obj, Evas_Textgrid_Palette pal, int idx, int *r, int *g, int *b, int *a);
9421
9422 EAPI void evas_object_textgrid_supported_font_styles_set(Evas_Object *obj, Evas_Textgrid_Font_Style styles);
9423 EAPI Evas_Textgrid_Font_Style evas_object_textgrid_supported_font_styles_get(const Evas_Object *obj);
9424
9425 /**
9426  * @brief Set the string at the given row of the given textgrid object.
9427  *
9428  * @param obj The textgrid object to query for font information.
9429  * @param y The row index of the grid.
9430  * @param The string as a sequence of #Evas_Textgrid_Cell.
9431  *
9432  * This function returns cells to the textgrid taken by
9433  * evas_object_textgrid_cellrow_get(). The row pointer @p row should be the
9434  * same row pointer returned by evas_object_textgrid_cellrow_get() for the
9435  * same row @p y.
9436  *
9437  * @see evas_object_textgrid_cellrow_get()
9438  * @see evas_object_textgrid_size_set()
9439  * @see evas_object_textgrid_update_add()
9440  *
9441  * @since 1.7
9442  */
9443 EAPI void evas_object_textgrid_cellrow_set(Evas_Object *obj, int y, const Evas_Textgrid_Cell *row);
9444
9445 /**
9446  * @brief Get the string at the given row of the given textgrid object.
9447  *
9448  * @param obj The textgrid object to query for font information.
9449  * @param y The row index of the grid.
9450  * @return A pointer to the first cell of the given row.
9451  *
9452  * This function returns a pointer to the first cell of the line @p y
9453  * of the textgrid object @p obj. If @p y is not between 0 and the
9454  * number of lines of the grid - 1, or on error, this function return @c NULL.
9455  *
9456  * @see evas_object_textgrid_cellrow_set()
9457  * @see evas_object_textgrid_size_set()
9458  * @see evas_object_textgrid_update_add()
9459  *
9460  * @since 1.7
9461  */
9462 EAPI Evas_Textgrid_Cell *evas_object_textgrid_cellrow_get(const Evas_Object *obj, int y);
9463
9464 /**
9465  * @brief Get the string at the given row of the given textgrid object.
9466  *
9467  * @param obj The textgrid object to query for font information.
9468  * @param x The rect region of cells top-left x (column)
9469  * @param y The rect region of cells top-left y (row)
9470  * @param w The rect region size in number of cells (columns)
9471  * @param h The rect region size in number of cells (rows)
9472  *
9473  * This function delcares to evas that a region of cells was updated by
9474  * code and needs refreshing. An application should modify cells like this
9475  * as an example:
9476  * 
9477  * @code
9478  * Evas_Textgrid_Cell *cells;
9479  * int i;
9480  * 
9481  * cells = evas_object_textgrid_cellrow_get(obj, row);
9482  * for (i = 0; i < width; i++) cells[i].codepoint = 'E';
9483  * evas_object_textgrid_cellrow_set(obj, row, cells);
9484  * evas_object_textgrid_update_add(obj, 0, row, width, 1);
9485  * @endcode
9486  *
9487  * @see evas_object_textgrid_cellrow_set()
9488  * @see evas_object_textgrid_cellrow_get()
9489  * @see evas_object_textgrid_size_set()
9490  *
9491  * @since 1.7
9492  */
9493 EAPI void evas_object_textgrid_update_add(Evas_Object *obj, int x, int y, int w, int h);
9494
9495 /**
9496  * @}
9497  */
9498
9499 /**
9500  * @defgroup Evas_Line_Group Line Object Functions
9501  *
9502  * Functions used to deal with evas line objects.
9503  *
9504  * @warning We don't guarantee any proper results if you create a Line object
9505  * without setting the evas engine.
9506  *
9507  * @ingroup Evas_Object_Specific
9508  *
9509  * @{
9510  */
9511
9512 /**
9513  * Adds a new evas line object to the given evas.
9514  * @param   e The given evas.
9515  * @return  The new evas line object.
9516  */
9517 EAPI Evas_Object *evas_object_line_add(Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
9518
9519 /**
9520  * Sets the coordinates of the end points of the given evas line object.
9521  * @param   obj The given evas line object.
9522  * @param   x1  The X coordinate of the first point.
9523  * @param   y1  The Y coordinate of the first point.
9524  * @param   x2  The X coordinate of the second point.
9525  * @param   y2  The Y coordinate of the second point.
9526  */
9527 EAPI void         evas_object_line_xy_set(Evas_Object *obj, Evas_Coord x1, Evas_Coord y1, Evas_Coord x2, Evas_Coord y2);
9528
9529 /**
9530  * Retrieves the coordinates of the end points of the given evas line object.
9531  * @param obj The given line object.
9532  * @param x1  Pointer to an integer in which to store the X coordinate of the
9533  *            first end point.
9534  * @param y1  Pointer to an integer in which to store the Y coordinate of the
9535  *            first end point.
9536  * @param x2  Pointer to an integer in which to store the X coordinate of the
9537  *            second end point.
9538  * @param y2  Pointer to an integer in which to store the Y coordinate of the
9539  *            second end point.
9540  */
9541 EAPI void         evas_object_line_xy_get(const Evas_Object *obj, Evas_Coord *x1, Evas_Coord *y1, Evas_Coord *x2, Evas_Coord *y2);
9542 /**
9543  * @}
9544  */
9545
9546 /**
9547  * @defgroup Evas_Object_Polygon Polygon Object Functions
9548  *
9549  * Functions that operate on evas polygon objects.
9550  *
9551  * Hint: as evas does not provide ellipse, smooth paths or circle, one
9552  * can calculate points and convert these to a polygon.
9553  *
9554  * @warning We don't guarantee any proper results if you create a Polygon
9555  * object without setting the evas engine.
9556  *
9557  * @ingroup Evas_Object_Specific
9558  *
9559  * @{
9560  */
9561
9562 /**
9563  * Adds a new evas polygon object to the given evas.
9564  * @param   e The given evas.
9565  * @return  A new evas polygon object.
9566  */
9567 EAPI Evas_Object *evas_object_polygon_add(Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
9568
9569 /**
9570  * Adds the given point to the given evas polygon object.
9571  * @param obj The given evas polygon object.
9572  * @param x   The X coordinate of the given point.
9573  * @param y   The Y coordinate of the given point.
9574  * @ingroup Evas_Polygon_Group
9575  */
9576 EAPI void         evas_object_polygon_point_add(Evas_Object *obj, Evas_Coord x, Evas_Coord y) EINA_ARG_NONNULL(1);
9577
9578 /**
9579  * Removes all of the points from the given evas polygon object.
9580  * @param   obj The given polygon object.
9581  */
9582 EAPI void         evas_object_polygon_points_clear(Evas_Object *obj) EINA_ARG_NONNULL(1);
9583 /**
9584  * @}
9585  */
9586
9587 /* @since 1.2 */
9588 EAPI void         evas_object_is_frame_object_set(Evas_Object *obj, Eina_Bool is_frame);
9589
9590 /* @since 1.2 */
9591 EAPI Eina_Bool    evas_object_is_frame_object_get(Evas_Object *obj);
9592
9593 /**
9594  * @defgroup Evas_Smart_Group Smart Functions
9595  *
9596  * Functions that deal with #Evas_Smart structs, creating definition
9597  * (classes) of objects that will have customized behavior for methods
9598  * like evas_object_move(), evas_object_resize(),
9599  * evas_object_clip_set() and others.
9600  *
9601  * These objects will accept the generic methods defined in @ref
9602  * Evas_Object_Group and the extensions defined in @ref
9603  * Evas_Smart_Object_Group. There are a couple of existent smart
9604  * objects in Evas itself (see @ref Evas_Object_Box, @ref
9605  * Evas_Object_Table and @ref Evas_Smart_Object_Clipped).
9606  *
9607  * See also some @ref Example_Evas_Smart_Objects "examples" of this
9608  * group of functions.
9609  */
9610
9611 /**
9612  * @addtogroup Evas_Smart_Group
9613  * @{
9614  */
9615
9616 /**
9617  * @def EVAS_SMART_CLASS_VERSION
9618  *
9619  * The version you have to put into the version field in the
9620  * #Evas_Smart_Class struct. Used to safeguard from binaries with old
9621  * smart object intefaces running with newer ones.
9622  *
9623  * @ingroup Evas_Smart_Group
9624  */
9625 #define EVAS_SMART_CLASS_VERSION 4
9626 /**
9627  * @struct _Evas_Smart_Class
9628  *
9629  * A smart object's @b base class definition
9630  *
9631  * @ingroup Evas_Smart_Group
9632  */
9633 struct _Evas_Smart_Class
9634 {
9635    const char                      *name; /**< the name string of the class */
9636    int                              version;
9637    void                             (*add)(Evas_Object *o); /**< code to be run when adding object to a canvas */
9638    void                             (*del)(Evas_Object *o); /**< code to be run when removing object from a canvas */
9639    void                             (*move)(Evas_Object *o, Evas_Coord x, Evas_Coord y); /**< code to be run when moving object on a canvas. @a x and @a y will be new coordinates one applied to the object. use evas_object_geometry_get() if you need the old values, during this call. after that, the old values will be lost. */
9640    void                             (*resize)(Evas_Object *o, Evas_Coord w, Evas_Coord h); /**< code to be run when resizing object on a canvas. @a w and @a h will be new dimensions one applied to the object. use evas_object_geometry_get() if you need the old values, during this call. after that, the old values will be lost. */
9641    void                             (*show)(Evas_Object *o); /**< code to be run when showing object on a canvas */
9642    void                             (*hide)(Evas_Object *o); /**< code to be run when hiding object on a canvas */
9643    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. @a r, @a g, @a b and @a y will be new color components one applied to the object. use evas_object_color_get() if you need the old values, during this call. after that, the old values will be lost. */
9644    void                             (*clip_set)(Evas_Object *o, Evas_Object *clip); /**< code to be run when setting clipper of object on a canvas. @a clip will be new clipper one applied to the object. use evas_object_clip_get() if you need the old one, during this call. after that, the old (object pointer) value will be lost. */
9645    void                             (*clip_unset)(Evas_Object *o); /**< code to be run when unsetting clipper of object on a canvas. if you need the pointer to a previous set clipper, during this call, use evas_object_clip_get(). after that, the old (object pointer) value will be lost. */
9646    void                             (*calculate)(Evas_Object *o); /**< code to be run when object has rendering updates on a canvas */
9647    void                             (*member_add)(Evas_Object *o, Evas_Object *child); /**< code to be run when a child member is added to object */
9648    void                             (*member_del)(Evas_Object *o, Evas_Object *child); /**< code to be run when a child member is removed from object */
9649
9650    const Evas_Smart_Class          *parent; /**< this class inherits from this parent */
9651    const Evas_Smart_Cb_Description *callbacks; /**< callbacks at this level, @c NULL terminated */
9652    const Evas_Smart_Interface     **interfaces; /**< #Evas_Smart_Interface pointers array, @c NULL terminated. These will be the interfaces supported at this level for an object (parents may have others) @since 1.7 */
9653    const void                      *data;
9654 };
9655
9656 /**
9657  * @struct _Evas_Smart_Interface
9658  *
9659  * A smart object's @b base interface definition
9660  *
9661  * Every Evas interface must have a name field, pointing to a global,
9662  * constant string variable. This string pointer will be the only way
9663  * of retrieving back a given interface from a smart object. Two
9664  * function pointers must be defined, too, which will be called at
9665  * object creation and deletion times.
9666  *
9667  * See also some @ref Example_Evas_Smart_Interfaces "examples" on
9668  * smart interfaces.
9669  *
9670  * @since 1.7
9671  *
9672  * @ingroup Evas_Smart_Group
9673  */
9674 struct _Evas_Smart_Interface
9675 {
9676    const char *name; /**< Name of the given interface */
9677    unsigned    private_size; /**< Size, in bytes, of the interface's private dada blob. This will be allocated and freed automatically for you. Get it with evas_object_smart_interface_data_get(). */
9678    Eina_Bool   (*add)(Evas_Object *obj); /**< Function to be called at object creation time */
9679    void        (*del)(Evas_Object *obj); /**< Function to be called at object deletion time */
9680 };
9681
9682 /**
9683  * @struct _Evas_Smart_Cb_Description
9684  *
9685  * Describes a callback issued by a smart object
9686  * (evas_object_smart_callback_call()), as defined in its smart object
9687  * class. This is particularly useful to explain to end users and
9688  * their code (i.e., introspection) what the parameter @c event_info
9689  * will point to.
9690  *
9691  * @ingroup Evas_Smart_Group
9692  */
9693 struct _Evas_Smart_Cb_Description
9694 {
9695    const char *name; /**< callback name ("changed", for example) */
9696
9697    /**
9698     * @brief Hint on the type of @c event_info parameter's contents on
9699     * a #Evas_Smart_Cb callback.
9700     *
9701     * The type string uses the pattern similar to
9702     * http://dbus.freedesktop.org/doc/dbus-specification.html#message-protocol-signatures,
9703     * but extended to optionally include variable names within
9704     * brackets preceding types. Example:
9705     *
9706     * @li Structure with two integers:
9707     *     @c "(ii)"
9708     *
9709     * @li Structure called 'x' with two integers named 'a' and 'b':
9710     *     @c "[x]([a]i[b]i)"
9711     *
9712     * @li Array of integers:
9713     *     @c "ai"
9714     *
9715     * @li Array called 'x' of struct with two integers:
9716     *     @c "[x]a(ii)"
9717     *
9718     * @note This type string is used as a hint and is @b not validated
9719     *       or enforced in any way. Implementors should make the best
9720     *       use of it to help bindings, documentation and other users
9721     *       of introspection features.
9722     */
9723    const char *type;
9724 };
9725
9726 /**
9727  * @def EVAS_SMART_CLASS_INIT_NULL
9728  * Initializer to zero a whole Evas_Smart_Class structure.
9729  *
9730  * @see EVAS_SMART_CLASS_INIT_VERSION
9731  * @see EVAS_SMART_CLASS_INIT_NAME_VERSION
9732  * @see EVAS_SMART_CLASS_INIT_NAME_VERSION_PARENT
9733  * @see EVAS_SMART_CLASS_INIT_NAME_VERSION_PARENT_CALLBACKS
9734  * @ingroup Evas_Smart_Group
9735  */
9736 #define EVAS_SMART_CLASS_INIT_NULL    {NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL}
9737
9738 /**
9739  * @def EVAS_SMART_CLASS_INIT_VERSION
9740  * Initializer to zero a whole Evas_Smart_Class structure and set version.
9741  *
9742  * Similar to EVAS_SMART_CLASS_INIT_NULL, but will set version field to
9743  * latest EVAS_SMART_CLASS_VERSION.
9744  *
9745  * @see EVAS_SMART_CLASS_INIT_NULL
9746  * @see EVAS_SMART_CLASS_INIT_NAME_VERSION
9747  * @see EVAS_SMART_CLASS_INIT_NAME_VERSION_PARENT
9748  * @see EVAS_SMART_CLASS_INIT_NAME_VERSION_PARENT_CALLBACKS
9749  * @ingroup Evas_Smart_Group
9750  */
9751 #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}
9752
9753 /**
9754  * @def EVAS_SMART_CLASS_INIT_NAME_VERSION
9755  * Initializer to zero a whole Evas_Smart_Class structure and set name
9756  * and version.
9757  *
9758  * Similar to EVAS_SMART_CLASS_INIT_NULL, but will set version field to
9759  * latest EVAS_SMART_CLASS_VERSION and name to the specified value.
9760  *
9761  * It will keep a reference to name field as a "const char *", that is,
9762  * name must be available while the structure is used (hint: static or global!)
9763  * and will not be modified.
9764  *
9765  * @see EVAS_SMART_CLASS_INIT_NULL
9766  * @see EVAS_SMART_CLASS_INIT_VERSION
9767  * @see EVAS_SMART_CLASS_INIT_NAME_VERSION_PARENT
9768  * @see EVAS_SMART_CLASS_INIT_NAME_VERSION_PARENT_CALLBACKS
9769  * @ingroup Evas_Smart_Group
9770  */
9771 #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}
9772
9773 /**
9774  * @def EVAS_SMART_CLASS_INIT_NAME_VERSION_PARENT
9775  * Initializer to zero a whole Evas_Smart_Class structure and set name,
9776  * version and parent class.
9777  *
9778  * Similar to EVAS_SMART_CLASS_INIT_NULL, but will set version field to
9779  * latest EVAS_SMART_CLASS_VERSION, name to the specified value and
9780  * parent class.
9781  *
9782  * It will keep a reference to name field as a "const char *", that is,
9783  * name must be available while the structure is used (hint: static or global!)
9784  * and will not be modified. Similarly, parent reference will be kept.
9785  *
9786  * @see EVAS_SMART_CLASS_INIT_NULL
9787  * @see EVAS_SMART_CLASS_INIT_VERSION
9788  * @see EVAS_SMART_CLASS_INIT_NAME_VERSION
9789  * @see EVAS_SMART_CLASS_INIT_NAME_VERSION_PARENT_CALLBACKS
9790  * @ingroup Evas_Smart_Group
9791  */
9792 #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}
9793
9794 /**
9795  * @def EVAS_SMART_CLASS_INIT_NAME_VERSION_PARENT_CALLBACKS
9796  * Initializer to zero a whole Evas_Smart_Class structure and set name,
9797  * version, parent class and callbacks definition.
9798  *
9799  * Similar to EVAS_SMART_CLASS_INIT_NULL, but will set version field to
9800  * latest EVAS_SMART_CLASS_VERSION, name to the specified value, parent
9801  * class and callbacks at this level.
9802  *
9803  * It will keep a reference to name field as a "const char *", that is,
9804  * name must be available while the structure is used (hint: static or global!)
9805  * and will not be modified. Similarly, parent and callbacks reference
9806  * will be kept.
9807  *
9808  * @see EVAS_SMART_CLASS_INIT_NULL
9809  * @see EVAS_SMART_CLASS_INIT_VERSION
9810  * @see EVAS_SMART_CLASS_INIT_NAME_VERSION
9811  * @see EVAS_SMART_CLASS_INIT_NAME_VERSION_PARENT
9812  * @ingroup Evas_Smart_Group
9813  */
9814 #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}
9815
9816 /**
9817  * @def EVAS_SMART_SUBCLASS_NEW
9818  *
9819  * Convenience macro to subclass a given Evas smart class.
9820  *
9821  * @param smart_name The name used for the smart class. e.g:
9822  * @c "Evas_Object_Box".
9823  * @param prefix Prefix used for all variables and functions defined
9824  * and referenced by this macro.
9825  * @param api_type Type of the structure used as API for the smart
9826  * class. Either #Evas_Smart_Class or something derived from it.
9827  * @param parent_type Type of the parent class API.
9828  * @param parent_func Function that gets the parent class. e.g:
9829  * evas_object_box_smart_class_get().
9830  * @param cb_desc Array of callback descriptions for this smart class.
9831  *
9832  * This macro saves some typing when writing a smart class derived
9833  * from another one. In order to work, the user @b must provide some
9834  * functions adhering to the following guidelines:
9835  *  - @<prefix@>_smart_set_user(): the @b internal @c _smart_set
9836  *    function (defined by this macro) will call this one, provided by
9837  *    the user, after inheriting everything from the parent, which
9838  *    should <b>take care of setting the right member functions for
9839  *    the class</b>, both overrides and extensions, if any.
9840  *  - If this new class should be subclassable as well, a @b public
9841  *    @c _smart_set() function is desirable to fill in the class used as
9842  *    parent by the children. It's up to the user to provide this
9843  *    interface, which will most likely call @<prefix@>_smart_set() to
9844  *    get the job done.
9845  *
9846  * After the macro's usage, the following will be defined for use:
9847  *  - @<prefix@>_parent_sc: A pointer to the @b parent smart
9848  *    class. When calling parent functions from overloaded ones, use
9849  *    this global variable.
9850  *  - @<prefix@>_smart_class_new(): this function returns the
9851  *    #Evas_Smart needed to create smart objects with this class,
9852  *    which should be passed to evas_object_smart_add().
9853  *
9854  * @warning @p smart_name has to be a pointer to a globally available
9855  * string! The smart class created here will just have a pointer set
9856  * to that, and all object instances will depend on it for smart class
9857  * name lookup.
9858  *
9859  * @ingroup Evas_Smart_Group
9860  */
9861 #define EVAS_SMART_SUBCLASS_NEW(smart_name, prefix, api_type, parent_type, parent_func, cb_desc) \
9862   static const parent_type * prefix##_parent_sc = NULL;                                          \
9863   static void prefix##_smart_set_user(api_type * api);                                           \
9864   static void prefix##_smart_set(api_type * api)                                                 \
9865   {                                                                                              \
9866      Evas_Smart_Class *sc;                                                                       \
9867      if (!(sc = (Evas_Smart_Class *)api))                                                        \
9868        return;                                                                                   \
9869      if (!prefix##_parent_sc)                                                                    \
9870        prefix##_parent_sc = parent_func();                                                       \
9871      evas_smart_class_inherit(sc, prefix##_parent_sc);                                           \
9872      prefix##_smart_set_user(api);                                                               \
9873   }                                                                                              \
9874   static Evas_Smart *prefix##_smart_class_new(void)                                              \
9875   {                                                                                              \
9876      static Evas_Smart *smart = NULL;                                                            \
9877      static api_type api;                                                                        \
9878      if (!smart)                                                                                 \
9879        {                                                                                         \
9880           Evas_Smart_Class *sc = (Evas_Smart_Class *)&api;                                       \
9881           memset(&api, 0, sizeof(api_type));                                                     \
9882           sc->version = EVAS_SMART_CLASS_VERSION;                                                \
9883           sc->name = smart_name;                                                                 \
9884           sc->callbacks = cb_desc;                                                               \
9885           prefix##_smart_set(&api);                                                              \
9886           smart = evas_smart_class_new(sc);                                                      \
9887        }                                                                                         \
9888      return smart;                                                                               \
9889   }
9890
9891 /**
9892  * @def EVAS_SMART_SUBCLASS_IFACE_NEW
9893  *
9894  * @since 1.7
9895  *
9896  * Convenience macro to subclass a given Evas smart class. This is the
9897  * same as #EVAS_SMART_SUBCLASS_NEW, but now <b>declaring smart
9898  * interfaces</b> besides the smart callbacks.
9899  *
9900  * @param smart_name The name used for the smart class. e.g:
9901  *                   @c "Evas_Object_Box".
9902  * @param prefix Prefix used for all variables and functions defined
9903  *               and referenced by this macro.
9904  * @param api_type Type of the structure used as API for the smart
9905  *                 class. Either #Evas_Smart_Class or something
9906  *                 derived from it.
9907  * @param parent_type Type of the parent class API.
9908  * @param parent_func Function that gets the parent class. e.g:
9909  *                    evas_object_box_smart_class_get().
9910  * @param cb_desc Array of smart callback descriptions for this smart
9911  *                class.
9912  * @param ifaces Array of Evas smart interafaces for this smart
9913  *               class.
9914  *
9915  * This macro saves some typing when writing a smart class derived
9916  * from another one. In order to work, the user @b must provide some
9917  * functions adhering to the following guidelines:
9918  *  - @<prefix@>_smart_set_user(): the @b internal @c _smart_set
9919  *    function (defined by this macro) will call this one, provided by
9920  *    the user, after inheriting everything from the parent, which
9921  *    should <b>take care of setting the right member functions for
9922  *    the class</b>, both overrides and extensions, if any.
9923  *  - If this new class should be subclassable as well, a @b public
9924  *    @c _smart_set() function is desirable to fill in the class used as
9925  *    parent by the children. It's up to the user to provide this
9926  *    interface, which will most likely call @<prefix@>_smart_set() to
9927  *    get the job done.
9928  *
9929  * After the macro's usage, the following will be defined for use:
9930  *  - @<prefix@>_parent_sc: A pointer to the @b parent smart
9931  *    class. When calling parent functions from overloaded ones, use
9932  *    this global variable.
9933  *  - @<prefix@>_smart_class_new(): this function returns the
9934  *    #Evas_Smart needed to create smart objects with this class,
9935  *    which should be passed to evas_object_smart_add().
9936  *
9937  * @warning @p smart_name has to be a pointer to a globally available
9938  * string! The smart class created here will just have a pointer set
9939  * to that, and all object instances will depend on it for smart class
9940  * name lookup.
9941  *
9942  * @ingroup Evas_Smart_Group
9943  */
9944 #define EVAS_SMART_SUBCLASS_IFACE_NEW(smart_name,          \
9945                                       prefix,              \
9946                                       api_type,            \
9947                                       parent_type,         \
9948                                       parent_func,         \
9949                                       cb_desc,             \
9950                                       ifaces)              \
9951   static const parent_type * prefix##_parent_sc = NULL;    \
9952   static void prefix##_smart_set_user(api_type * api);     \
9953   static void prefix##_smart_set(api_type * api)           \
9954   {                                                        \
9955      Evas_Smart_Class *sc;                                 \
9956      if (!(sc = (Evas_Smart_Class *)api))                  \
9957        return;                                             \
9958      if (!prefix##_parent_sc)                              \
9959        prefix##_parent_sc = parent_func();                 \
9960      evas_smart_class_inherit(sc, prefix##_parent_sc);     \
9961      prefix##_smart_set_user(api);                         \
9962   }                                                        \
9963   static Evas_Smart *prefix##_smart_class_new(void)        \
9964   {                                                        \
9965      static Evas_Smart *smart = NULL;                      \
9966      static api_type api;                                  \
9967      if (!smart)                                           \
9968        {                                                   \
9969           Evas_Smart_Class *sc = (Evas_Smart_Class *)&api; \
9970           memset(&api, 0, sizeof(api_type));               \
9971           sc->version = EVAS_SMART_CLASS_VERSION;          \
9972           sc->name = smart_name;                           \
9973           sc->callbacks = cb_desc;                         \
9974           sc->interfaces = ifaces;                         \
9975           prefix##_smart_set(&api);                        \
9976           smart = evas_smart_class_new(sc);                \
9977        }                                                   \
9978      return smart;                                         \
9979   }
9980
9981 /**
9982  * @def EVAS_SMART_DATA_ALLOC
9983  *
9984  * Convenience macro to allocate smart data only if needed.
9985  *
9986  * When writing a subclassable smart object, the @c .add() function
9987  * will need to check if the smart private data was already allocated
9988  * by some child object or not. This macro makes it easier to do it.
9989  *
9990  * @note This is an idiom used when one calls the parent's @c .add()
9991  * after the specialized code. Naturally, the parent's base smart data
9992  * has to be contemplated as the specialized one's first member, for
9993  * things to work.
9994  *
9995  * @param o Evas object passed to the @c .add() function
9996  * @param priv_type The type of the data to allocate
9997  *
9998  * @ingroup Evas_Smart_Group
9999  */
10000 #define EVAS_SMART_DATA_ALLOC(o, priv_type)              \
10001   priv_type * priv;                                      \
10002   priv = evas_object_smart_data_get(o);                  \
10003   if (!priv) {                                           \
10004        priv = (priv_type *)calloc(1, sizeof(priv_type)); \
10005        if (!priv) return;                                \
10006        evas_object_smart_data_set(o, priv);              \
10007     }
10008
10009 /**
10010  * Free an #Evas_Smart struct
10011  *
10012  * @param s the #Evas_Smart struct to free
10013  *
10014  * @warning If this smart handle was created using
10015  * evas_smart_class_new(), the associated #Evas_Smart_Class will not
10016  * be freed.
10017  *
10018  * @note If you're using the #EVAS_SMART_SUBCLASS_NEW schema to create your
10019  * smart object, note that an #Evas_Smart handle will be shared amongst all
10020  * instances of the given smart class, through a static variable.
10021  * Evas will internally count references on #Evas_Smart handles and free them
10022  * when they are not referenced anymore. Thus, this function is of no use
10023  * for Evas users, most probably.
10024  */
10025 EAPI void                              evas_smart_free(Evas_Smart *s) EINA_ARG_NONNULL(1);
10026
10027 /**
10028  * Creates a new #Evas_Smart from a given #Evas_Smart_Class struct
10029  *
10030  * @param sc the smart class definition
10031  * @return a new #Evas_Smart pointer
10032  *
10033  * #Evas_Smart handles are necessary to create new @b instances of
10034  * smart objects belonging to the class described by @p sc. That
10035  * handle will contain, besides the smart class interface definition,
10036  * all its smart callbacks infrastructure set, too.
10037  *
10038  * @note If you are willing to subclass a given smart class to
10039  * construct yours, consider using the #EVAS_SMART_SUBCLASS_NEW macro,
10040  * which will make use of this function automatically for you.
10041  */
10042 EAPI Evas_Smart                       *evas_smart_class_new(const Evas_Smart_Class *sc) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
10043
10044 /**
10045  * Get the #Evas_Smart_Class handle of an #Evas_Smart struct
10046  *
10047  * @param s a valid #Evas_Smart pointer
10048  * @return the #Evas_Smart_Class in it
10049  */
10050 EAPI const Evas_Smart_Class           *evas_smart_class_get(const Evas_Smart *s) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
10051
10052 /**
10053  * @brief Get the data pointer set on an #Evas_Smart struct
10054  *
10055  * @param s a valid #Evas_Smart handle
10056  *
10057  * This data pointer is set as the data field in the #Evas_Smart_Class
10058  * passed in to evas_smart_class_new().
10059  */
10060 EAPI void                             *evas_smart_data_get(const Evas_Smart *s) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
10061
10062 /**
10063  * Get the smart callbacks known by this #Evas_Smart handle's smart
10064  * class hierarchy.
10065  *
10066  * @param s A valid #Evas_Smart handle.
10067  * @param[out] count Returns the number of elements in the returned
10068  * array.
10069  * @return The array with callback descriptions known by this smart
10070  *         class, with its size returned in @a count parameter. It
10071  *         should not be modified in any way. If no callbacks are
10072  *         known, @c NULL is returned. The array is sorted by event
10073  *         names and elements refer to the original values given to
10074  *         evas_smart_class_new()'s Evas_Smart_Class::callbacks
10075  *         (pointer to them).
10076  *
10077  * This is likely different from
10078  * evas_object_smart_callbacks_descriptions_get() as it will contain
10079  * the callbacks of @b all this class hierarchy sorted, while the
10080  * direct smart class member refers only to that specific class and
10081  * should not include parent's.
10082  *
10083  * If no callbacks are known, this function returns @c NULL.
10084  *
10085  * The array elements and thus their contents will be @b references to
10086  * original values given to evas_smart_class_new() as
10087  * Evas_Smart_Class::callbacks.
10088  *
10089  * The array is sorted by Evas_Smart_Cb_Description::name. The last
10090  * array element is a @c NULL pointer and is not accounted for in @a
10091  * count. Loop iterations can check any of these size indicators.
10092  *
10093  * @note objects may provide per-instance callbacks, use
10094  *       evas_object_smart_callbacks_descriptions_get() to get those
10095  *       as well.
10096  * @see evas_object_smart_callbacks_descriptions_get()
10097  */
10098 EAPI const Evas_Smart_Cb_Description **evas_smart_callbacks_descriptions_get(const Evas_Smart *s, unsigned int *count) EINA_ARG_NONNULL(1, 1);
10099
10100 /**
10101  * Find a callback description for the callback named @a name.
10102  *
10103  * @param s The #Evas_Smart where to search for class registered smart
10104  * event callbacks.
10105  * @param name Name of the desired callback, which must @b not be @c
10106  *        NULL. The search has a special case for @a name being the
10107  *        same pointer as registered with #Evas_Smart_Cb_Description.
10108  *        One can use it to avoid excessive use of strcmp().
10109  * @return A reference to the description if found, or @c NULL, otherwise
10110  *
10111  * @see evas_smart_callbacks_descriptions_get()
10112  */
10113 EAPI const Evas_Smart_Cb_Description  *evas_smart_callback_description_find(const Evas_Smart *s, const char *name) EINA_ARG_NONNULL(1, 2);
10114
10115 /**
10116  * Sets one class to inherit from the other.
10117  *
10118  * Copy all function pointers, set @c parent to @a parent_sc and copy
10119  * everything after sizeof(Evas_Smart_Class) present in @a parent_sc,
10120  * using @a parent_sc_size as reference.
10121  *
10122  * This is recommended instead of a single memcpy() since it will take
10123  * care to not modify @a sc name, version, callbacks and possible
10124  * other members.
10125  *
10126  * @param sc child class.
10127  * @param parent_sc parent class, will provide attributes.
10128  * @param parent_sc_size size of parent_sc structure, child should be at least
10129  *        this size. Everything after @c Evas_Smart_Class size is copied
10130  *        using regular memcpy().
10131  */
10132 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);
10133
10134 /**
10135  * Get the number of users of the smart instance
10136  *
10137  * @param s The Evas_Smart to get the usage count of
10138  * @return The number of uses of the smart instance
10139  *
10140  * This function tells you how many more uses of the smart instance are in
10141  * existence. This should be used before freeing/clearing any of the
10142  * Evas_Smart_Class that was used to create the smart instance. The smart
10143  * instance will refer to data in the Evas_Smart_Class used to create it and
10144  * thus you cannot remove the original data until all users of it are gone.
10145  * When the usage count goes to 0, you can evas_smart_free() the smart
10146  * instance @p s and remove from memory any of the Evas_Smart_Class that
10147  * was used to create the smart instance, if you desire. Removing it from
10148  * memory without doing this will cause problems (crashes, undefined
10149  * behavior etc. etc.), so either never remove the original
10150  * Evas_Smart_Class data from memory (have it be a constant structure and
10151  * data), or use this API call and be very careful.
10152  */
10153 EAPI int                               evas_smart_usage_get(const Evas_Smart *s);
10154
10155 /**
10156  * @def evas_smart_class_inherit
10157  * Easy to use version of evas_smart_class_inherit_full().
10158  *
10159  * This version will use sizeof(parent_sc), copying everything.
10160  *
10161  * @param sc child class, will have methods copied from @a parent_sc
10162  * @param parent_sc parent class, will provide contents to be copied.
10163  * @return 1 on success, 0 on failure.
10164  * @ingroup Evas_Smart_Group
10165  */
10166 #define evas_smart_class_inherit(sc, parent_sc) evas_smart_class_inherit_full(sc, (Evas_Smart_Class *)parent_sc, sizeof(*parent_sc))
10167
10168 /**
10169  * @}
10170  */
10171
10172 /**
10173  * @defgroup Evas_Smart_Object_Group Smart Object Functions
10174  *
10175  * Functions dealing with Evas smart objects (instances).
10176  *
10177  * Smart objects are groupings of primitive Evas objects that behave
10178  * as a cohesive group. For instance, a file manager icon may be a
10179  * smart object composed of an image object, a text label and two
10180  * rectangles that appear behind the image and text when the icon is
10181  * selected. As a smart object, the normal Evas object API could be
10182  * used on the icon object.
10183  *
10184  * Besides that, generally smart objects implement a <b>specific
10185  * API</b>, so that users interact with its own custom features. The
10186  * API takes form of explicit exported functions one may call and
10187  * <b>smart callbacks</b>.
10188  *
10189  * @section Evas_Smart_Object_Group_Callbacks Smart events and callbacks
10190  *
10191  * Smart objects can elect events (smart events, from now on) occurring
10192  * inside of them to be reported back to their users via callback
10193  * functions (smart callbacks). This way, you can extend Evas' own
10194  * object events. They are defined by an <b>event string</b>, which
10195  * identifies them uniquely. There's also a function prototype
10196  * definition for the callback functions: #Evas_Smart_Cb.
10197  *
10198  * When defining an #Evas_Smart_Class, smart object implementors are
10199  * strongly encouraged to properly set the Evas_Smart_Class::callbacks
10200  * callbacks description array, so that the users of the smart object
10201  * can have introspection on its events API <b>at run time</b>.
10202  *
10203  * See some @ref Example_Evas_Smart_Objects "examples" of this group
10204  * of functions.
10205  *
10206  * @see @ref Evas_Smart_Group for class definitions.
10207  */
10208
10209 /**
10210  * @addtogroup Evas_Smart_Object_Group
10211  * @{
10212  */
10213
10214 /**
10215  * Instantiates a new smart object described by @p s.
10216  *
10217  * @param e the canvas on which to add the object
10218  * @param s the #Evas_Smart describing the smart object
10219  * @return a new #Evas_Object handle
10220  *
10221  * This is the function one should use when defining the public
10222  * function @b adding an instance of the new smart object to a given
10223  * canvas. It will take care of setting all of its internals to work
10224  * as they should, if the user set things properly, as seem on the
10225  * #EVAS_SMART_SUBCLASS_NEW, for example.
10226  *
10227  * @ingroup Evas_Smart_Object_Group
10228  */
10229 EAPI Evas_Object *evas_object_smart_add(Evas *e, Evas_Smart *s) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2) EINA_MALLOC;
10230
10231 /**
10232  * Set an Evas object as a member of a given smart object.
10233  *
10234  * @param obj The member object
10235  * @param smart_obj The smart object
10236  *
10237  * Members will automatically be stacked and layered together with the
10238  * smart object. The various stacking functions will operate on
10239  * members relative to the other members instead of the entire canvas,
10240  * since they now live on an exclusive layer (see
10241  * evas_object_stack_above(), for more details).
10242  *
10243  * Any @p smart_obj object's specific implementation of the @c
10244  * member_add() smart function will take place too, naturally.
10245  *
10246  * @see evas_object_smart_member_del()
10247  * @see evas_object_smart_members_get()
10248  *
10249  * @ingroup Evas_Smart_Object_Group
10250  */
10251 EAPI void         evas_object_smart_member_add(Evas_Object *obj, Evas_Object *smart_obj) EINA_ARG_NONNULL(1, 2);
10252
10253 /**
10254  * Removes a member object from a given smart object.
10255  *
10256  * @param obj the member object
10257  * @ingroup Evas_Smart_Object_Group
10258  *
10259  * This removes a member object from a smart object, if it was added
10260  * to any. The object will still be on the canvas, but no longer
10261  * associated with whichever smart object it was associated with.
10262  *
10263  * @see evas_object_smart_member_add() for more details
10264  * @see evas_object_smart_members_get()
10265  */
10266 EAPI void         evas_object_smart_member_del(Evas_Object *obj) EINA_ARG_NONNULL(1);
10267
10268 /**
10269  * Retrieves the list of the member objects of a given Evas smart
10270  * object
10271  *
10272  * @param obj the smart object to get members from
10273  * @return Returns the list of the member objects of @p obj.
10274  *
10275  * The returned list should be freed with @c eina_list_free() when you
10276  * no longer need it.
10277  *
10278  * @since 1.7 This function will return @c NULL when a non-smart object is passed.
10279  *
10280  * @see evas_object_smart_member_add()
10281  * @see evas_object_smart_member_del()
10282  */
10283 EAPI Eina_List   *evas_object_smart_members_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
10284
10285 /**
10286  * Gets the parent smart object of a given Evas object, if it has one.
10287  *
10288  * @param obj the Evas object you want to get the parent smart object
10289  * from
10290  * @return Returns the parent smart object of @a obj or @c NULL, if @a
10291  * obj is not a smart member of any
10292  *
10293  * @ingroup Evas_Smart_Object_Group
10294  */
10295 EAPI Evas_Object *evas_object_smart_parent_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
10296
10297 /**
10298  * Checks whether a given smart object or any of its smart object
10299  * parents is of a given smart class.
10300  *
10301  * @param obj An Evas smart object to check the type of
10302  * @param type The @b name (type) of the smart class to check for
10303  * @return @c EINA_TRUE, if @a obj or any of its parents is of type @a
10304  * type, @c EINA_FALSE otherwise
10305  *
10306  * If @p obj is not a smart object, this call will fail
10307  * immediately. Otherwise, make sure evas_smart_class_inherit() or its
10308  * sibling functions were used correctly when creating the smart
10309  * object's class, so it has a valid @b parent smart class pointer
10310  * set.
10311  *
10312  * The checks use smart classes names and <b>string
10313  * comparison</b>. There is a version of this same check using
10314  * <b>pointer comparison</b>, since a smart class' name is a single
10315  * string in Evas.
10316  *
10317  * @see evas_object_smart_type_check_ptr()
10318  * @see #EVAS_SMART_SUBCLASS_NEW
10319  *
10320  * @ingroup Evas_Smart_Object_Group
10321  */
10322 EAPI Eina_Bool    evas_object_smart_type_check(const Evas_Object *obj, const char *type) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2);
10323
10324 /**
10325  * Checks whether a given smart object or any of its smart object
10326  * parents is of a given smart class, <b>using pointer comparison</b>.
10327  *
10328  * @param obj An Evas smart object to check the type of
10329  * @param type The type (name string) to check for. Must be the name
10330  * @return @c EINA_TRUE, if @a obj or any of its parents is of type @a
10331  * type, @c EINA_FALSE otherwise
10332  *
10333  * @see evas_object_smart_type_check() for more details
10334  *
10335  * @ingroup Evas_Smart_Object_Group
10336  */
10337 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);
10338
10339 /**
10340  * Get the #Evas_Smart from which @p obj smart object was created.
10341  *
10342  * @param obj a smart object
10343  * @return the #Evas_Smart handle or @c NULL, on errors
10344  *
10345  * @ingroup Evas_Smart_Object_Group
10346  */
10347 EAPI Evas_Smart  *evas_object_smart_smart_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
10348
10349 /**
10350  * Retrieve user data stored on a given smart object.
10351  *
10352  * @param obj The smart object's handle
10353  * @return A pointer to data stored using
10354  *         evas_object_smart_data_set(), or @c NULL, if none has been
10355  *         set.
10356  *
10357  * @see evas_object_smart_data_set()
10358  *
10359  * @ingroup Evas_Smart_Object_Group
10360  */
10361 EAPI void        *evas_object_smart_data_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
10362
10363 /**
10364  * Store a pointer to user data for a given smart object.
10365  *
10366  * @param obj The smart object's handle
10367  * @param data A pointer to user data
10368  *
10369  * This data is stored @b independently of the one set by
10370  * evas_object_data_set(), naturally.
10371  *
10372  * @see evas_object_smart_data_get()
10373  *
10374  * @ingroup Evas_Smart_Object_Group
10375  */
10376 EAPI void         evas_object_smart_data_set(Evas_Object *obj, void *data) EINA_ARG_NONNULL(1);
10377
10378 /**
10379  * Add (register) a callback function to the smart event specified by
10380  * @p event on the smart object @p obj.
10381  *
10382  * @param obj a smart object
10383  * @param event the event's name string
10384  * @param func the callback function
10385  * @param data user data to be passed to the callback function
10386  *
10387  * Smart callbacks look very similar to Evas callbacks, but are
10388  * implemented as smart object's custom ones.
10389  *
10390  * This function adds a function callback to an smart object when the
10391  * event named @p event occurs in it. The function is @p func.
10392  *
10393  * In the event of a memory allocation error during addition of the
10394  * callback to the object, evas_alloc_error() should be used to
10395  * determine the nature of the error, if any, and the program should
10396  * sensibly try and recover.
10397  *
10398  * A smart callback function must have the ::Evas_Smart_Cb prototype
10399  * definition. The first parameter (@p data) in this definition will
10400  * have the same value passed to evas_object_smart_callback_add() as
10401  * the @p data parameter, at runtime. The second parameter @p obj is a
10402  * handle to the object on which the event occurred. The third
10403  * parameter, @p event_info, is a pointer to data which is totally
10404  * dependent on the smart object's implementation and semantic for the
10405  * given event.
10406  *
10407  * There is an infrastructure for introspection on smart objects'
10408  * events (see evas_smart_callbacks_descriptions_get()), but no
10409  * internal smart objects on Evas implement them yet.
10410  *
10411  * @see @ref Evas_Smart_Object_Group_Callbacks for more details.
10412  *
10413  * @see evas_object_smart_callback_del()
10414  * @ingroup Evas_Smart_Object_Group
10415  */
10416 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);
10417
10418 /**
10419  * Add (register) a callback function to the smart event specified by
10420  * @p event on the smart object @p obj. Except for the priority field,
10421  * it's exactly the same as @ref evas_object_smart_callback_add
10422  *
10423  * @param obj a smart object
10424  * @param event the event's name string
10425  * @param priority The priority of the callback, lower values called first.
10426  * @param func the callback function
10427  * @param data user data to be passed to the callback function
10428  *
10429  * @see evas_object_smart_callback_add
10430  * @since 1.1
10431  * @ingroup Evas_Smart_Object_Group
10432  */
10433 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);
10434
10435 /**
10436  * Delete (unregister) a callback function from the smart event
10437  * specified by @p event on the smart object @p obj.
10438  *
10439  * @param obj a smart object
10440  * @param event the event's name string
10441  * @param func the callback function
10442  * @return the data pointer
10443  *
10444  * This function removes <b>the first</b> added smart callback on the
10445  * object @p obj matching the event name @p event and the registered
10446  * function pointer @p func. If the removal is successful it will also
10447  * return the data pointer that was passed to
10448  * evas_object_smart_callback_add() (that will be the same as the
10449  * parameter) when the callback(s) was(were) added to the canvas. If
10450  * not successful @c NULL will be returned.
10451  *
10452  * @see evas_object_smart_callback_add() for more details.
10453  *
10454  * @ingroup Evas_Smart_Object_Group
10455  */
10456 EAPI void        *evas_object_smart_callback_del(Evas_Object *obj, const char *event, Evas_Smart_Cb func) EINA_ARG_NONNULL(1, 2, 3);
10457
10458 /**
10459  * Delete (unregister) a callback function from the smart event
10460  * specified by @p event on the smart object @p obj.
10461  *
10462  * @param obj a smart object
10463  * @param event the event's name string
10464  * @param func the callback function
10465  * @param data the data pointer that was passed to the callback
10466  * @return the data pointer
10467  *
10468  * This function removes <b>the first</b> added smart callback on the
10469  * object @p obj matching the event name @p event, the registered
10470  * function pointer @p func and the callback data pointer @p data. If
10471  * the removal is successful it will also return the data pointer that
10472  * was passed to evas_object_smart_callback_add() (that will be the same
10473  * as the parameter) when the callback(s) was(were) added to the canvas.
10474  * If not successful @c NULL will be returned. A common use would be to
10475  * remove an exact match of a callback
10476  *
10477  * @see evas_object_smart_callback_add() for more details.
10478  * @since 1.2
10479  * @ingroup Evas_Smart_Object_Group
10480  *
10481  * @note To delete all smart event callbacks which match @p type and @p func,
10482  * use evas_object_smart_callback_del().
10483  */
10484 EAPI void        *evas_object_smart_callback_del_full(Evas_Object *obj, const char *event, Evas_Smart_Cb func, const void *data) EINA_ARG_NONNULL(1, 2, 3);
10485
10486 /**
10487  * Call a given smart callback on the smart object @p obj.
10488  *
10489  * @param obj the smart object
10490  * @param event the event's name string
10491  * @param event_info pointer to an event specific struct or information to
10492  * pass to the callback functions registered on this smart event
10493  *
10494  * This should be called @b internally, from the smart object's own
10495  * code, when some specific event has occurred and the implementor
10496  * wants is to pertain to the object's events API (see @ref
10497  * Evas_Smart_Object_Group_Callbacks). The documentation for the smart
10498  * object should include a list of possible events and what type of @p
10499  * event_info to expect for each of them. Also, when defining an
10500  * #Evas_Smart_Class, smart object implementors are strongly
10501  * encouraged to properly set the Evas_Smart_Class::callbacks
10502  * callbacks description array, so that the users of the smart object
10503  * can have introspection on its events API <b>at run time</b>.
10504  *
10505  * @ingroup Evas_Smart_Object_Group
10506  */
10507 EAPI void         evas_object_smart_callback_call(Evas_Object *obj, const char *event, void *event_info) EINA_ARG_NONNULL(1, 2);
10508
10509 /**
10510  * Set an smart object @b instance's smart callbacks descriptions.
10511  *
10512  * @param obj A smart object
10513  * @param descriptions @c NULL terminated array with
10514  * #Evas_Smart_Cb_Description descriptions. Array elements won't be
10515  * modified at run time, but references to them and their contents
10516  * will be made, so this array should be kept alive during the whole
10517  * object's lifetime.
10518  * @return @c EINA_TRUE on success, @c EINA_FALSE on failure.
10519  *
10520  * These descriptions are hints to be used by introspection and are
10521  * not enforced in any way.
10522  *
10523  * It will not be checked if instance callbacks descriptions have the
10524  * same name as respective possibly registered in the smart object
10525  * @b class. Both are kept in different arrays and users of
10526  * evas_object_smart_callbacks_descriptions_get() should handle this
10527  * case as they wish.
10528  *
10529  * @note Becase @p descriptions must be @c NULL terminated, and
10530  *        because a @c NULL name makes little sense, too,
10531  *        Evas_Smart_Cb_Description::name must @b not be @c NULL.
10532  *
10533  * @note While instance callbacks descriptions are possible, they are
10534  *       @b not recommended. Use @b class callbacks descriptions
10535  *       instead as they make you smart object user's life simpler and
10536  *       will use less memory, as descriptions and arrays will be
10537  *       shared among all instances.
10538  *
10539  * @ingroup Evas_Smart_Object_Group
10540  */
10541 EAPI Eina_Bool    evas_object_smart_callbacks_descriptions_set(Evas_Object *obj, const Evas_Smart_Cb_Description *descriptions) EINA_ARG_NONNULL(1);
10542
10543 /**
10544  * Retrieve an smart object's know smart callback descriptions (both
10545  * instance and class ones).
10546  *
10547  * @param obj The smart object to get callback descriptions from.
10548  * @param class_descriptions Where to store class callbacks
10549  *        descriptions array, if any is known. If no descriptions are
10550  *        known, @c NULL is returned
10551  * @param class_count Returns how many class callbacks descriptions
10552  *        are known.
10553  * @param instance_descriptions Where to store instance callbacks
10554  *        descriptions array, if any is known. If no descriptions are
10555  *        known, @c NULL is returned.
10556  * @param instance_count Returns how many instance callbacks
10557  *        descriptions are known.
10558  *
10559  * This call searches for registered callback descriptions for both
10560  * instance and class of the given smart object. These arrays will be
10561  * sorted by Evas_Smart_Cb_Description::name and also @c NULL
10562  * terminated, so both @a class_count and @a instance_count can be
10563  * ignored, if the caller wishes so. The terminator @c NULL is not
10564  * counted in these values.
10565  *
10566  * @note If just class descriptions are of interest, try
10567  *       evas_smart_callbacks_descriptions_get() instead.
10568  *
10569  * @note Use @c NULL pointers on the descriptions/counters you're not
10570  * interested in: they'll be ignored by the function.
10571  *
10572  * @see evas_smart_callbacks_descriptions_get()
10573  *
10574  * @ingroup Evas_Smart_Object_Group
10575  */
10576 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);
10577
10578 /**
10579  * Find callback description for callback called @a name.
10580  *
10581  * @param obj the smart object.
10582  * @param name name of desired callback, must @b not be @c NULL.  The
10583  *        search have a special case for @a name being the same
10584  *        pointer as registered with Evas_Smart_Cb_Description, one
10585  *        can use it to avoid excessive use of strcmp().
10586  * @param class_description pointer to return class description or
10587  *        @c NULL if not found. If parameter is @c NULL, no search will
10588  *        be done on class descriptions.
10589  * @param instance_description pointer to return instance description
10590  *        or @c NULL if not found. If parameter is @c NULL, no search
10591  *        will be done on instance descriptions.
10592  * @return reference to description if found, @c NULL if not found.
10593  */
10594 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);
10595
10596 /**
10597  * Retrieve an Evas smart object's interface, by name string pointer.
10598  *
10599  * @param obj An Evas smart object.
10600  * @param name Name string of the desired interface, which must be the
10601  *             same pointer used at the interface's declarion, when
10602  *             creating the smart object @a obj.
10603  *
10604  * @since 1.7
10605  *
10606  * @return The interface's handle pointer, if found, @c NULL
10607  * otherwise.
10608  */
10609 const void       *evas_object_smart_interface_get(const Evas_Object *obj, const char *name);
10610
10611 /**
10612  * Retrieve an Evas smart object interface's <b>private data</b>.
10613  *
10614  * @param obj An Evas smart object.
10615  * @param iface The given object's interface handle.
10616  *
10617  * @since 1.7
10618  *
10619  * @return The object interface's private data blob pointer, if found,
10620  * @c NULL otherwise.
10621  */
10622 void             *evas_object_smart_interface_data_get(const Evas_Object *obj, const Evas_Smart_Interface *iface);
10623
10624 /**
10625  * Mark smart object as changed, dirty.
10626  *
10627  * @param obj The given Evas smart object
10628  *
10629  * This will flag the given object as needing recalculation,
10630  * forcefully. As an effect, on the next rendering cycle it's @b
10631  * calculate() (see #Evas_Smart_Class) smart function will be called.
10632  *
10633  * @see evas_object_smart_need_recalculate_set().
10634  * @see evas_object_smart_calculate().
10635  *
10636  * @ingroup Evas_Smart_Object_Group
10637  */
10638 EAPI void         evas_object_smart_changed(Evas_Object *obj) EINA_ARG_NONNULL(1);
10639
10640 /**
10641  * Set or unset the flag signalling that a given smart object needs to
10642  * get recalculated.
10643  *
10644  * @param obj the smart object
10645  * @param value whether one wants to set (@c EINA_TRUE) or to unset
10646  * (@c EINA_FALSE) the flag.
10647  *
10648  * If this flag is set, then the @c calculate() smart function of @p
10649  * obj will be called, if one is provided, during rendering phase of
10650  * Evas (see evas_render()), after which this flag will be
10651  * automatically unset.
10652  *
10653  * If that smart function is not provided for the given object, this
10654  * flag will be left unchanged.
10655  *
10656  * @note just setting this flag will not make the canvas' whole scene
10657  *       dirty, by itself, and evas_render() will have no effect. To
10658  *       force that, use evas_object_smart_changed(), that will also
10659  *       automatically call this function automatically, with
10660  *       @c EINA_TRUE as parameter.
10661  *
10662  * @see evas_object_smart_need_recalculate_get()
10663  * @see evas_object_smart_calculate()
10664  * @see evas_smart_objects_calculate()
10665  *
10666  * @ingroup Evas_Smart_Object_Group
10667  */
10668 EAPI void         evas_object_smart_need_recalculate_set(Evas_Object *obj, Eina_Bool value) EINA_ARG_NONNULL(1);
10669
10670 /**
10671  * Get the value of the flag signalling that a given smart object needs to
10672  * get recalculated.
10673  *
10674  * @param obj the smart object
10675  * @return if flag is set or not.
10676  *
10677  * @note this flag will be unset during the rendering phase, when the
10678  *       @c calculate() smart function is called, if one is provided.
10679  *       If it's not provided, then the flag will be left unchanged
10680  *       after the rendering phase.
10681  *
10682  * @see evas_object_smart_need_recalculate_set(), for more details
10683  *
10684  * @ingroup Evas_Smart_Object_Group
10685  */
10686 EAPI Eina_Bool    evas_object_smart_need_recalculate_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
10687
10688 /**
10689  * Call the @b calculate() smart function immediately on a given smart
10690  * object.
10691  *
10692  * @param obj the smart object's handle
10693  *
10694  * This will force immediate calculations (see #Evas_Smart_Class)
10695  * needed for renderization of this object and, besides, unset the
10696  * flag on it telling it needs recalculation for the next rendering
10697  * phase.
10698  *
10699  * @see evas_object_smart_need_recalculate_set()
10700  *
10701  * @ingroup Evas_Smart_Object_Group
10702  */
10703 EAPI void         evas_object_smart_calculate(Evas_Object *obj) EINA_ARG_NONNULL(1);
10704
10705 /**
10706  * Call user-provided @c calculate() smart functions and unset the
10707  * flag signalling that the object needs to get recalculated to @b all
10708  * smart objects in the canvas.
10709  *
10710  * @param e The canvas to calculate all smart objects in
10711  *
10712  * @see evas_object_smart_need_recalculate_set()
10713  *
10714  * @ingroup Evas_Smart_Object_Group
10715  */
10716 EAPI void         evas_smart_objects_calculate(Evas *e);
10717
10718 /**
10719  * This gets the internal counter that counts the number of smart calculations
10720  *
10721  * @param e The canvas to get the calculate counter from
10722  *
10723  * Whenever evas performs smart object calculations on the whole canvas
10724  * it increments a counter by 1. This is the smart object calculate counter
10725  * that this function returns the value of. It starts at the value of 0 and
10726  * will increase (and eventually wrap around to negative values and so on) by
10727  * 1 every time objects are calculated. You can use this counter to ensure
10728  * you don't re-do calculations withint the same calculation generation/run
10729  * if the calculations maybe cause self-feeding effects.
10730  *
10731  * @ingroup Evas_Smart_Object_Group
10732  * @since 1.1
10733  */
10734 EAPI int          evas_smart_objects_calculate_count_get(const Evas *e);
10735
10736 /**
10737  * Moves all children objects of a given smart object relative to a
10738  * given offset.
10739  *
10740  * @param obj the smart object.
10741  * @param dx horizontal offset (delta).
10742  * @param dy vertical offset (delta).
10743  *
10744  * This will make each of @p obj object's children to move, from where
10745  * they before, with those delta values (offsets) on both directions.
10746  *
10747  * @note This is most useful on custom smart @c move() functions.
10748  *
10749  * @note Clipped smart objects already make use of this function on
10750  * their @c move() smart function definition.
10751  */
10752 EAPI void         evas_object_smart_move_children_relative(Evas_Object *obj, Evas_Coord dx, Evas_Coord dy) EINA_ARG_NONNULL(1);
10753
10754 /**
10755  * @}
10756  */
10757
10758 /**
10759  * @defgroup Evas_Smart_Object_Clipped Clipped Smart Object
10760  *
10761  * Clipped smart object is a base to construct other smart objects
10762  * based on the concept of having an internal clipper that is applied
10763  * to all children objects. This clipper will control the visibility,
10764  * clipping and color of sibling objects (remember that the clipping
10765  * is recursive, and clipper color modulates the color of its
10766  * clippees). By default, this base will also move children relatively
10767  * to the parent, and delete them when parent is deleted. In other
10768  * words, it is the base for simple object grouping.
10769  *
10770  * See some @ref Example_Evas_Smart_Objects "examples" of this group
10771  * of functions.
10772  *
10773  * @see evas_object_smart_clipped_smart_set()
10774  *
10775  * @ingroup Evas_Smart_Object_Group
10776  */
10777
10778 /**
10779  * @addtogroup Evas_Smart_Object_Clipped
10780  * @{
10781  */
10782
10783 /**
10784  * Every subclass should provide this at the beginning of their own
10785  * data set with evas_object_smart_data_set().
10786  */
10787 typedef struct _Evas_Object_Smart_Clipped_Data Evas_Object_Smart_Clipped_Data;
10788 struct _Evas_Object_Smart_Clipped_Data
10789 {
10790    Evas_Object *clipper;
10791    Evas        *evas;
10792 };
10793
10794 /**
10795  * Get the clipper object for the given clipped smart object.
10796  *
10797  * @param obj the clipped smart object to retrieve associated clipper
10798  * from.
10799  * @return the clipper object.
10800  *
10801  * Use this function if you want to change any of this clipper's
10802  * properties, like colors.
10803  *
10804  * @see evas_object_smart_clipped_smart_add()
10805  */
10806 EAPI Evas_Object            *evas_object_smart_clipped_clipper_get(Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
10807
10808 /**
10809  * Set a given smart class' callbacks so it implements the <b>clipped smart
10810  * object"</b>'s interface.
10811  *
10812  * @param sc The smart class handle to operate on
10813  *
10814  * This call will assign all the required methods of the @p sc
10815  * #Evas_Smart_Class instance to the implementations set for clipped
10816  * smart objects. If one wants to "subclass" it, call this function
10817  * and then override desired values. If one wants to call any original
10818  * method, save it somewhere. Example:
10819  *
10820  * @code
10821  * static Evas_Smart_Class parent_sc = EVAS_SMART_CLASS_INIT_NULL;
10822  *
10823  * static void my_class_smart_add(Evas_Object *o)
10824  * {
10825  *    parent_sc.add(o);
10826  *    evas_object_color_set(evas_object_smart_clipped_clipper_get(o),
10827  *                          255, 0, 0, 255);
10828  * }
10829  *
10830  * Evas_Smart_Class *my_class_new(void)
10831  * {
10832  *    static Evas_Smart_Class sc = EVAS_SMART_CLASS_INIT_NAME_VERSION("MyClass");
10833  *    if (!parent_sc.name)
10834  *      {
10835  *         evas_object_smart_clipped_smart_set(&sc);
10836  *         parent_sc = sc;
10837  *         sc.add = my_class_smart_add;
10838  *      }
10839  *    return &sc;
10840  * }
10841  * @endcode
10842  *
10843  * Default behavior for each of #Evas_Smart_Class functions on a
10844  * clipped smart object are:
10845  * - @c add: creates a hidden clipper with "infinite" size, to clip
10846  *    any incoming members;
10847  * - @c del: delete all children objects;
10848  * - @c move: move all objects relative relatively;
10849  * - @c resize: <b>not defined</b>;
10850  * - @c show: if there are children objects, show clipper;
10851  * - @c hide: hides clipper;
10852  * - @c color_set: set the color of clipper;
10853  * - @c clip_set: set clipper of clipper;
10854  * - @c clip_unset: unset the clipper of clipper;
10855  *
10856  * @note There are other means of assigning parent smart classes to
10857  * child ones, like the #EVAS_SMART_SUBCLASS_NEW macro or the
10858  * evas_smart_class_inherit_full() function.
10859  */
10860 EAPI void                    evas_object_smart_clipped_smart_set(Evas_Smart_Class *sc) EINA_ARG_NONNULL(1);
10861
10862 /**
10863  * Get a pointer to the <b>clipped smart object's</b> class, to use
10864  * for proper inheritance
10865  *
10866  * @see #Evas_Smart_Object_Clipped for more information on this smart
10867  * class
10868  */
10869 EAPI const Evas_Smart_Class *evas_object_smart_clipped_class_get(void) EINA_CONST;
10870
10871 /**
10872  * @}
10873  */
10874
10875 /**
10876  * @defgroup Evas_Object_Box Box Smart Object
10877  *
10878  * A box is a convenience smart object that packs children inside it
10879  * in @b sequence, using a layouting function specified by the
10880  * user. There are a couple of pre-made layouting functions <b>built-in
10881  * in Evas</b>, all of them using children size hints to define their
10882  * size and alignment inside their cell space.
10883  *
10884  * Examples on this smart object's usage:
10885  * - @ref Example_Evas_Box
10886  * - @ref Example_Evas_Size_Hints
10887  *
10888  * @see @ref Evas_Object_Group_Size_Hints
10889  *
10890  * @ingroup Evas_Smart_Object_Group
10891  */
10892
10893 /**
10894  * @addtogroup Evas_Object_Box
10895  * @{
10896  */
10897
10898 /**
10899  * @typedef Evas_Object_Box_Api
10900  *
10901  * Smart class extension, providing extra box object requirements.
10902  *
10903  * @ingroup Evas_Object_Box
10904  */
10905 typedef struct _Evas_Object_Box_Api Evas_Object_Box_Api;
10906
10907 /**
10908  * @typedef Evas_Object_Box_Data
10909  *
10910  * Smart object instance data, providing box object requirements.
10911  *
10912  * @ingroup Evas_Object_Box
10913  */
10914 typedef struct _Evas_Object_Box_Data Evas_Object_Box_Data;
10915
10916 /**
10917  * @typedef Evas_Object_Box_Option
10918  *
10919  * The base structure for a box option. Box options are a way of
10920  * extending box items properties, which will be taken into account
10921  * for layouting decisions. The box layouting functions provided by
10922  * Evas will only rely on objects' canonical size hints to layout
10923  * them, so the basic box option has @b no (custom) property set.
10924  *
10925  * Users creating their own layouts, but not depending on extra child
10926  * items' properties, would be fine just using
10927  * evas_object_box_layout_set(). But if one desires a layout depending
10928  * on extra child properties, he/she has to @b subclass the box smart
10929  * object. Thus, by using evas_object_box_smart_class_get() and
10930  * evas_object_box_smart_set(), the @c option_new() and @c
10931  * option_free() smart class functions should be properly
10932  * redefined/extended.
10933  *
10934  * Object properties are bound to an integer identifier and must have
10935  * a name string. Their values are open to any data. See the API on
10936  * option properties for more details.
10937  *
10938  * @ingroup Evas_Object_Box
10939  */
10940 typedef struct _Evas_Object_Box_Option Evas_Object_Box_Option;
10941
10942 /**
10943  * @typedef Evas_Object_Box_Layout
10944  *
10945  * Function signature for an Evas box object layouting routine. By
10946  * @a o it will be passed the box object in question, by @a priv it will
10947  * be passed the box's internal data and, by @a user_data, it will be
10948  * passed any custom data one could have set to a given box layouting
10949  * function, with evas_object_box_layout_set().
10950  *
10951  * @ingroup Evas_Object_Box
10952  */
10953 typedef void (*Evas_Object_Box_Layout)(Evas_Object *o, Evas_Object_Box_Data *priv, void *user_data);
10954
10955 /**
10956  * @def EVAS_OBJECT_BOX_API_VERSION
10957  *
10958  * Current version for Evas box object smart class, a value which goes
10959  * to _Evas_Object_Box_Api::version.
10960  *
10961  * @ingroup Evas_Object_Box
10962  */
10963 #define EVAS_OBJECT_BOX_API_VERSION 1
10964
10965 /**
10966  * @struct _Evas_Object_Box_Api
10967  *
10968  * This structure should be used by any smart class inheriting from
10969  * the box's one, to provide custom box behavior which could not be
10970  * achieved only by providing a layout function, with
10971  * evas_object_box_layout_set().
10972  *
10973  * @extends Evas_Smart_Class
10974  * @ingroup Evas_Object_Box
10975  */
10976 struct _Evas_Object_Box_Api
10977 {
10978    Evas_Smart_Class        base;      /**< Base smart class struct, need for all smart objects */
10979    int                     version;      /**< Version of this smart class definition */
10980    Evas_Object_Box_Option *(*append)(Evas_Object * o, Evas_Object_Box_Data * priv, Evas_Object * child);            /**< Smart function to append child elements in boxes */
10981    Evas_Object_Box_Option *(*prepend)(Evas_Object * o, Evas_Object_Box_Data * priv, Evas_Object * child);           /**< Smart function to prepend child elements in boxes */
10982    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 */
10983    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 */
10984    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 position on boxes */
10985    Evas_Object            *(*remove)(Evas_Object * o, Evas_Object_Box_Data * priv, Evas_Object * child);            /**< Smart function to remove a child element from boxes */
10986    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 */
10987    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 */
10988    Eina_Bool               (*property_get)(const Evas_Object *o, Evas_Object_Box_Option *opt, int property, va_list args);         /**< Smart function to retrieve a custom property from a box child */
10989    const char             *(*property_name_get)(const Evas_Object * o, int property);   /**< Smart function to get the name of a custom property of box children */
10990    int                     (*property_id_get)(const Evas_Object *o, const char *name);      /**< Smart function to get the numerical ID of a custom property of box children */
10991    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 */
10992    void                    (*option_free)(Evas_Object *o, Evas_Object_Box_Data *priv, Evas_Object_Box_Option *opt);          /**< Smart function to delete a box option struct */
10993 };
10994
10995 /**
10996  * @def EVAS_OBJECT_BOX_API_INIT
10997  *
10998  * Initializer for a whole #Evas_Object_Box_Api structure, with
10999  * @c NULL values on its specific fields.
11000  *
11001  * @param smart_class_init initializer to use for the "base" field
11002  * (#Evas_Smart_Class).
11003  *
11004  * @see EVAS_SMART_CLASS_INIT_NULL
11005  * @see EVAS_SMART_CLASS_INIT_VERSION
11006  * @see EVAS_SMART_CLASS_INIT_NAME_VERSION
11007  * @see EVAS_OBJECT_BOX_API_INIT_NULL
11008  * @see EVAS_OBJECT_BOX_API_INIT_VERSION
11009  * @see EVAS_OBJECT_BOX_API_INIT_NAME_VERSION
11010  * @ingroup Evas_Object_Box
11011  */
11012 #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}
11013
11014 /**
11015  * @def EVAS_OBJECT_BOX_API_INIT_NULL
11016  *
11017  * Initializer to zero out a whole #Evas_Object_Box_Api structure.
11018  *
11019  * @see EVAS_OBJECT_BOX_API_INIT_VERSION
11020  * @see EVAS_OBJECT_BOX_API_INIT_NAME_VERSION
11021  * @see EVAS_OBJECT_BOX_API_INIT
11022  * @ingroup Evas_Object_Box
11023  */
11024 #define EVAS_OBJECT_BOX_API_INIT_NULL    EVAS_OBJECT_BOX_API_INIT(EVAS_SMART_CLASS_INIT_NULL)
11025
11026 /**
11027  * @def EVAS_OBJECT_BOX_API_INIT_VERSION
11028  *
11029  * Initializer to zero out a whole #Evas_Object_Box_Api structure and
11030  * set a specific version on it.
11031  *
11032  * This is similar to #EVAS_OBJECT_BOX_API_INIT_NULL, but it will set
11033  * the version field of #Evas_Smart_Class (base field) to the latest
11034  * #EVAS_SMART_CLASS_VERSION.
11035  *
11036  * @see EVAS_OBJECT_BOX_API_INIT_NULL
11037  * @see EVAS_OBJECT_BOX_API_INIT_NAME_VERSION
11038  * @see EVAS_OBJECT_BOX_API_INIT
11039  * @ingroup Evas_Object_Box
11040  */
11041 #define EVAS_OBJECT_BOX_API_INIT_VERSION EVAS_OBJECT_BOX_API_INIT(EVAS_SMART_CLASS_INIT_VERSION)
11042
11043 /**
11044  * @def EVAS_OBJECT_BOX_API_INIT_NAME_VERSION
11045  *
11046  * Initializer to zero out a whole #Evas_Object_Box_Api structure and
11047  * set its name and version.
11048  *
11049  * This is similar to #EVAS_OBJECT_BOX_API_INIT_NULL, but it will also
11050  * set the version field of #Evas_Smart_Class (base field) to the
11051  * latest #EVAS_SMART_CLASS_VERSION and name it to the specific value.
11052  *
11053  * It will keep a reference to the name field as a <c>"const char *"</c>,
11054  * i.e., the name must be available while the structure is
11055  * used (hint: static or global variable!) and must not be modified.
11056  *
11057  * @see EVAS_OBJECT_BOX_API_INIT_NULL
11058  * @see EVAS_OBJECT_BOX_API_INIT_VERSION
11059  * @see EVAS_OBJECT_BOX_API_INIT
11060  * @ingroup Evas_Object_Box
11061  */
11062 #define EVAS_OBJECT_BOX_API_INIT_NAME_VERSION(name) EVAS_OBJECT_BOX_API_INIT(EVAS_SMART_CLASS_INIT_NAME_VERSION(name))
11063
11064 /**
11065  * @struct _Evas_Object_Box_Data
11066  *
11067  * This structure augments clipped smart object's instance data,
11068  * providing extra members required by generic box implementation. If
11069  * a subclass inherits from #Evas_Object_Box_Api, then it may augment
11070  * #Evas_Object_Box_Data to fit its own needs.
11071  *
11072  * @extends Evas_Object_Smart_Clipped_Data
11073  * @ingroup Evas_Object_Box
11074  */
11075 struct _Evas_Object_Box_Data
11076 {
11077    Evas_Object_Smart_Clipped_Data base;
11078    const Evas_Object_Box_Api     *api;
11079    struct
11080    {
11081       double h, v;
11082    } align;
11083    struct
11084    {
11085       Evas_Coord h, v;
11086    } pad;
11087    Eina_List                     *children;
11088    struct
11089    {
11090       Evas_Object_Box_Layout cb;
11091       void                  *data;
11092       void                   (*free_data)(void *data);
11093    } layout;
11094    Eina_Bool                      layouting : 1;
11095    Eina_Bool                      children_changed : 1;
11096 };
11097
11098 struct _Evas_Object_Box_Option
11099 {
11100    Evas_Object *obj;    /**< Pointer to the box child object, itself */
11101    Eina_Bool    max_reached : 1;
11102    Eina_Bool    min_reached : 1;
11103    Evas_Coord   alloc_size;
11104 };    /**< #Evas_Object_Box_Option struct fields */
11105
11106 /**
11107  * Set the default box @a api struct (Evas_Object_Box_Api)
11108  * with the default values. May be used to extend that API.
11109  *
11110  * @param api The box API struct to set back, most probably with
11111  * overridden fields (on class extensions scenarios)
11112  */
11113 EAPI void                       evas_object_box_smart_set(Evas_Object_Box_Api *api) EINA_ARG_NONNULL(1);
11114
11115 /**
11116  * Get the Evas box smart class, for inheritance purposes.
11117  *
11118  * @return the (canonical) Evas box smart class.
11119  *
11120  * The returned value is @b not to be modified, just use it as your
11121  * parent class.
11122  */
11123 EAPI const Evas_Object_Box_Api *evas_object_box_smart_class_get(void) EINA_CONST;
11124
11125 /**
11126  * Set a new layouting function to a given box object
11127  *
11128  * @param o The box object to operate on.
11129  * @param cb The new layout function to set on @p o.
11130  * @param data Data pointer to be passed to @p cb.
11131  * @param free_data Function to free @p data, if need be.
11132  *
11133  * A box layout function affects how a box object displays child
11134  * elements within its area. The list of pre-defined box layouts
11135  * available in Evas is:
11136  * - evas_object_box_layout_horizontal()
11137  * - evas_object_box_layout_vertical()
11138  * - evas_object_box_layout_homogeneous_horizontal()
11139  * - evas_object_box_layout_homogeneous_vertical()
11140  * - evas_object_box_layout_homogeneous_max_size_horizontal()
11141  * - evas_object_box_layout_homogeneous_max_size_vertical()
11142  * - evas_object_box_layout_flow_horizontal()
11143  * - evas_object_box_layout_flow_vertical()
11144  * - evas_object_box_layout_stack()
11145  *
11146  * Refer to each of their documentation texts for details on them.
11147  *
11148  * @note A box layouting function will be triggered by the @c
11149  * 'calculate' smart callback of the box's smart class.
11150  */
11151 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);
11152
11153 /**
11154  * Add a new box object on the provided canvas.
11155  *
11156  * @param evas The canvas to create the box object on.
11157  * @return @c NULL on error, a pointer to a new box object on
11158  * success.
11159  *
11160  * After instantiation, if a box object hasn't its layout function
11161  * set, via evas_object_box_layout_set(), it will have it by default
11162  * set to evas_object_box_layout_horizontal(). The remaining
11163  * properties of the box must be set/retrieved via
11164  * <c>evas_object_box_{h,v}_{align,padding}_{get,set)()</c>.
11165  */
11166 EAPI Evas_Object               *evas_object_box_add(Evas *evas) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
11167
11168 /**
11169  * Add a new box as a @b child of a given smart object.
11170  *
11171  * @param parent The parent smart object to put the new box in.
11172  * @return @c NULL on error, a pointer to a new box object on
11173  * success.
11174  *
11175  * This is a helper function that has the same effect of putting a new
11176  * box object into @p parent by use of evas_object_smart_member_add().
11177  *
11178  * @see evas_object_box_add()
11179  */
11180 EAPI Evas_Object               *evas_object_box_add_to(Evas_Object *parent) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
11181
11182 /**
11183  * Layout function which sets the box @a o to a (basic) horizontal box
11184  *
11185  * @param o The box object in question
11186  * @param priv The smart data of the @p o
11187  * @param data The data pointer passed on
11188  * evas_object_box_layout_set(), if any
11189  *
11190  * In this layout, the box object's overall behavior is controlled by
11191  * its padding/alignment properties, which are set by the
11192  * <c>evas_object_box_{h,v}_{align,padding}_set()</c> family of
11193  * functions. The size hints of the elements in the box -- set by the
11194  * <c>evas_object_size_hint_{align,padding,weight}_set()</c> functions
11195  * -- also control the way this function works.
11196  *
11197  * \par Box's properties:
11198  * @c align_h controls the horizontal alignment of the child objects
11199  * relative to the containing box. When set to @c 0.0, children are
11200  * aligned to the left. A value of @c 1.0 makes them aligned to the
11201  * right border. Values in between align them proportionally. Note
11202  * that if the size required by the children, which is given by their
11203  * widths and the @c padding_h property of the box, is bigger than the
11204  * their container's width, the children will be displayed out of the
11205  * box's bounds. A negative value of @c align_h makes the box to
11206  * @b justify its children. The padding between them, in this case, is
11207  * corrected so that the leftmost one touches the left border and the
11208  * rightmost one touches the right border (even if they must
11209  * overlap). The @c align_v and @c padding_v properties of the box
11210  * @b don't contribute to its behaviour when this layout is chosen.
11211  *
11212  * \par Child element's properties:
11213  * @c align_x does @b not influence the box's behavior. @c padding_l
11214  * and @c padding_r sum up to the container's horizontal padding
11215  * between elements. The child's @c padding_t, @c padding_b and
11216  * @c align_y properties apply for padding/alignment relative to the
11217  * overall height of the box. Finally, there is the @c weight_x
11218  * property, which, if set to a non-zero value, tells the container
11219  * that the child width is @b not pre-defined. If the container can't
11220  * accommodate all its children, it sets the widths of the ones
11221  * <b>with weights</b> to sizes as small as they can all fit into
11222  * it. If the size required by the children is less than the
11223  * available, the box increases its childrens' (which have weights)
11224  * widths as to fit the remaining space. The @c weight_x property,
11225  * besides telling the element is resizable, gives a @b weight for the
11226  * resizing process.  The parent box will try to distribute (or take
11227  * off) widths accordingly to the @b normalized list of weigths: most
11228  * weighted children remain/get larger in this process than the least
11229  * ones. @c weight_y does not influence the layout.
11230  *
11231  * If one desires that, besides having weights, child elements must be
11232  * resized bounded to a minimum or maximum size, those size hints must
11233  * be set, by the <c>evas_object_size_hint_{min,max}_set()</c>
11234  * functions.
11235  */
11236 EAPI void                       evas_object_box_layout_horizontal(Evas_Object *o, Evas_Object_Box_Data *priv, void *data) EINA_ARG_NONNULL(1, 2);
11237
11238 /**
11239  * Layout function which sets the box @a o to a (basic) vertical box
11240  *
11241  * This function behaves analogously to
11242  * evas_object_box_layout_horizontal(). The description of its
11243  * behaviour can be derived from that function's documentation.
11244  */
11245 EAPI void                       evas_object_box_layout_vertical(Evas_Object *o, Evas_Object_Box_Data *priv, void *data) EINA_ARG_NONNULL(1, 2);
11246
11247 /**
11248  * Layout function which sets the box @a o to a @b homogeneous
11249  * vertical box
11250  *
11251  * This function behaves analogously to
11252  * evas_object_box_layout_homogeneous_horizontal().  The description
11253  * of its behaviour can be derived from that function's documentation.
11254  */
11255 EAPI void                       evas_object_box_layout_homogeneous_vertical(Evas_Object *o, Evas_Object_Box_Data *priv, void *data) EINA_ARG_NONNULL(1, 2);
11256
11257 /**
11258  * Layout function which sets the box @a o to a @b homogeneous
11259  * horizontal box
11260  *
11261  * @param o The box object in question
11262  * @param priv The smart data of the @p o
11263  * @param data The data pointer passed on
11264  * evas_object_box_layout_set(), if any
11265  *
11266  * In a homogeneous horizontal box, its width is divided @b equally
11267  * between the contained objects. The box's overall behavior is
11268  * controlled by its padding/alignment properties, which are set by
11269  * the <c>evas_object_box_{h,v}_{align,padding}_set()</c> family of
11270  * functions.  The size hints the elements in the box -- set by the
11271  * <c>evas_object_size_hint_{align,padding,weight}_set()</c> functions
11272  * -- also control the way this function works.
11273  *
11274  * \par Box's properties:
11275  * @c align_h has no influence on the box for this layout.
11276  * @c padding_h tells the box to draw empty spaces of that size, in
11277  * pixels, between the (equal) child objects's cells. The @c align_v
11278  * and @c padding_v properties of the box don't contribute to its
11279  * behaviour when this layout is chosen.
11280  *
11281  * \par Child element's properties:
11282  * @c padding_l and @c padding_r sum up to the required width of the
11283  * child element. The @c align_x property tells the relative position
11284  * of this overall child width in its allocated cell (@c 0.0 to
11285  * extreme left, @c 1.0 to extreme right). A value of @c -1.0 to
11286  * @c align_x makes the box try to resize this child element to the exact
11287  * width of its cell (respecting the minimum and maximum size hints on
11288  * the child's width and accounting for its horizontal padding
11289  * hints). The child's @c padding_t, @c padding_b and @c align_y
11290  * properties apply for padding/alignment relative to the overall
11291  * height of the box. A value of @c -1.0 to @c align_y makes the box
11292  * try to resize this child element to the exact height of its parent
11293  * (respecting the maximum size hint on the child's height).
11294  */
11295 EAPI void                       evas_object_box_layout_homogeneous_horizontal(Evas_Object *o, Evas_Object_Box_Data *priv, void *data) EINA_ARG_NONNULL(1, 2);
11296
11297 /**
11298  * Layout function which sets the box @a o to a <b>maximum size,
11299  * homogeneous</b> horizontal box
11300  *
11301  * @param o The box object in question
11302  * @param priv The smart data of the @p o
11303  * @param data The data pointer passed on
11304  * evas_object_box_layout_set(), if any
11305  *
11306  * In a maximum size, homogeneous horizontal box, besides having cells
11307  * of <b>equal size</b> reserved for the child objects, this size will
11308  * be defined by the size of the @b largest child in the box (in
11309  * width). The box's overall behavior is controlled by its properties,
11310  * which are set by the
11311  * <c>evas_object_box_{h,v}_{align,padding}_set()</c> family of
11312  * functions.  The size hints of the elements in the box -- set by the
11313  * <c>evas_object_size_hint_{align,padding,weight}_set()</c> functions
11314  * -- also control the way this function works.
11315  *
11316  * \par Box's properties:
11317  * @c padding_h tells the box to draw empty spaces of that size, in
11318  * pixels, between the child objects's cells. @c align_h controls the
11319  * horizontal alignment of the child objects, relative to the
11320  * containing box. When set to @c 0.0, children are aligned to the
11321  * left. A value of @c 1.0 lets them aligned to the right
11322  * border. Values in between align them proportionally. A negative
11323  * value of @c align_h makes the box to @b justify its children
11324  * cells. The padding between them, in this case, is corrected so that
11325  * the leftmost one touches the left border and the rightmost one
11326  * touches the right border (even if they must overlap). The
11327  * @c align_v and @c padding_v properties of the box don't contribute to
11328  * its behaviour when this layout is chosen.
11329  *
11330  * \par Child element's properties:
11331  * @c padding_l and @c padding_r sum up to the required width of the
11332  * child element. The @c align_x property tells the relative position
11333  * of this overall child width in its allocated cell (@c 0.0 to
11334  * extreme left, @c 1.0 to extreme right). A value of @c -1.0 to
11335  * @c align_x makes the box try to resize this child element to the exact
11336  * width of its cell (respecting the minimum and maximum size hints on
11337  * the child's width and accounting for its horizontal padding
11338  * hints). The child's @c padding_t, @c padding_b and @c align_y
11339  * properties apply for padding/alignment relative to the overall
11340  * height of the box. A value of @c -1.0 to @c align_y makes the box
11341  * try to resize this child element to the exact height of its parent
11342  * (respecting the max hint on the child's height).
11343  */
11344 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);
11345
11346 /**
11347  * Layout function which sets the box @a o to a <b>maximum size,
11348  * homogeneous</b> vertical box
11349  *
11350  * This function behaves analogously to
11351  * evas_object_box_layout_homogeneous_max_size_horizontal(). The
11352  * description of its behaviour can be derived from that function's
11353  * documentation.
11354  */
11355 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);
11356
11357 /**
11358  * Layout function which sets the box @a o to a @b flow horizontal
11359  * box.
11360  *
11361  * @param o The box object in question
11362  * @param priv The smart data of the @p o
11363  * @param data The data pointer passed on
11364  * evas_object_box_layout_set(), if any
11365  *
11366  * In a flow horizontal box, the box's child elements are placed in
11367  * @b rows (think of text as an analogy). A row has as much elements as
11368  * can fit into the box's width. The box's overall behavior is
11369  * controlled by its properties, which are set by the
11370  * <c>evas_object_box_{h,v}_{align,padding}_set()</c> family of
11371  * functions.  The size hints of the elements in the box -- set by the
11372  * <c>evas_object_size_hint_{align,padding,weight}_set()</c> functions
11373  * -- also control the way this function works.
11374  *
11375  * \par Box's properties:
11376  * @c padding_h tells the box to draw empty spaces of that size, in
11377  * pixels, between the child objects's cells. @c align_h dictates the
11378  * horizontal alignment of the rows (@c 0.0 to left align them, @c 1.0
11379  * to right align). A value of @c -1.0 to @c align_h lets the rows
11380  * @b justified horizontally. @c align_v controls the vertical alignment
11381  * of the entire set of rows (@c 0.0 to top, @c 1.0 to bottom). A
11382  * value of @c -1.0 to @c align_v makes the box to @b justify the rows
11383  * vertically. The padding between them, in this case, is corrected so
11384  * that the first row touches the top border and the last one touches
11385  * the bottom border (even if they must overlap). @c padding_v has no
11386  * influence on the layout.
11387  *
11388  * \par Child element's properties:
11389  * @c padding_l and @c padding_r sum up to the required width of the
11390  * child element. The @c align_x property has no influence on the
11391  * layout. The child's @c padding_t and @c padding_b sum up to the
11392  * required height of the child element and is the only means (besides
11393  * row justifying) of setting space between rows. Note, however, that
11394  * @c align_y dictates positioning relative to the <b>largest
11395  * height</b> required by a child object in the actual row.
11396  */
11397 EAPI void                       evas_object_box_layout_flow_horizontal(Evas_Object *o, Evas_Object_Box_Data *priv, void *data) EINA_ARG_NONNULL(1, 2);
11398
11399 /**
11400  * Layout function which sets the box @a o to a @b flow vertical box.
11401  *
11402  * This function behaves analogously to
11403  * evas_object_box_layout_flow_horizontal(). The description of its
11404  * behaviour can be derived from that function's documentation.
11405  */
11406 EAPI void                       evas_object_box_layout_flow_vertical(Evas_Object *o, Evas_Object_Box_Data *priv, void *data) EINA_ARG_NONNULL(1, 2);
11407
11408 /**
11409  * Layout function which sets the box @a o to a @b stacking box
11410  *
11411  * @param o The box object in question
11412  * @param priv The smart data of the @p o
11413  * @param data The data pointer passed on
11414  * evas_object_box_layout_set(), if any
11415  *
11416  * In a stacking box, all children will be given the same size -- the
11417  * box's own size -- and they will be stacked one above the other, so
11418  * that the first object in @p o's internal list of child elements
11419  * will be the bottommost in the stack.
11420  *
11421  * \par Box's properties:
11422  * No box properties are used.
11423  *
11424  * \par Child element's properties:
11425  * @c padding_l and @c padding_r sum up to the required width of the
11426  * child element. The @c align_x property tells the relative position
11427  * of this overall child width in its allocated cell (@c 0.0 to
11428  * extreme left, @c 1.0 to extreme right). A value of @c -1.0 to @c
11429  * align_x makes the box try to resize this child element to the exact
11430  * width of its cell (respecting the min and max hints on the child's
11431  * width and accounting for its horizontal padding properties). The
11432  * same applies to the vertical axis.
11433  */
11434 EAPI void                       evas_object_box_layout_stack(Evas_Object *o, Evas_Object_Box_Data *priv, void *data) EINA_ARG_NONNULL(1, 2);
11435
11436 /**
11437  * Set the alignment of the whole bounding box of contents, for a
11438  * given box object.
11439  *
11440  * @param o The given box object to set alignment from
11441  * @param horizontal The horizontal alignment, in pixels
11442  * @param vertical the vertical alignment, in pixels
11443  *
11444  * This will influence how a box object is to align its bounding box
11445  * of contents within its own area. The values @b must be in the range
11446  * @c 0.0 - @c 1.0, or undefined behavior is expected. For horizontal
11447  * alignment, @c 0.0 means to the left, with @c 1.0 meaning to the
11448  * right. For vertical alignment, @c 0.0 means to the top, with @c 1.0
11449  * meaning to the bottom.
11450  *
11451  * @note The default values for both alignments is @c 0.5.
11452  *
11453  * @see evas_object_box_align_get()
11454  */
11455 EAPI void                       evas_object_box_align_set(Evas_Object *o, double horizontal, double vertical) EINA_ARG_NONNULL(1);
11456
11457 /**
11458  * Get the alignment of the whole bounding box of contents, for a
11459  * given box object.
11460  *
11461  * @param o The given box object to get alignment from
11462  * @param horizontal Pointer to a variable where to store the
11463  * horizontal alignment
11464  * @param vertical Pointer to a variable where to store the vertical
11465  * alignment
11466  *
11467  * @see evas_object_box_align_set() for more information
11468  */
11469 EAPI void                       evas_object_box_align_get(const Evas_Object *o, double *horizontal, double *vertical) EINA_ARG_NONNULL(1);
11470
11471 /**
11472  * Set the (space) padding between cells set for a given box object.
11473  *
11474  * @param o The given box object to set padding from
11475  * @param horizontal The horizontal padding, in pixels
11476  * @param vertical the vertical padding, in pixels
11477  *
11478  * @note The default values for both padding components is @c 0.
11479  *
11480  * @see evas_object_box_padding_get()
11481  */
11482 EAPI void                       evas_object_box_padding_set(Evas_Object *o, Evas_Coord horizontal, Evas_Coord vertical) EINA_ARG_NONNULL(1);
11483
11484 /**
11485  * Get the (space) padding between cells set for a given box object.
11486  *
11487  * @param o The given box object to get padding from
11488  * @param horizontal Pointer to a variable where to store the
11489  * horizontal padding
11490  * @param vertical Pointer to a variable where to store the vertical
11491  * padding
11492  *
11493  * @see evas_object_box_padding_set()
11494  */
11495 EAPI void                       evas_object_box_padding_get(const Evas_Object *o, Evas_Coord *horizontal, Evas_Coord *vertical) EINA_ARG_NONNULL(1);
11496
11497 /**
11498  * Append a new @a child object to the given box object @a o.
11499  *
11500  * @param o The given box object
11501  * @param child A child Evas object to be made a member of @p o
11502  * @return A box option bound to the recently added box item or @c
11503  * NULL, on errors
11504  *
11505  * On success, the @c "child,added" smart event will take place.
11506  *
11507  * @note The actual placing of the item relative to @p o's area will
11508  * depend on the layout set to it. For example, on horizontal layouts
11509  * an item in the end of the box's list of children will appear on its
11510  * right.
11511  *
11512  * @note This call will trigger the box's _Evas_Object_Box_Api::append
11513  * smart function.
11514  */
11515 EAPI Evas_Object_Box_Option    *evas_object_box_append(Evas_Object *o, Evas_Object *child) EINA_ARG_NONNULL(1, 2);
11516
11517 /**
11518  * Prepend a new @a child object to the given box object @a o.
11519  *
11520  * @param o The given box object
11521  * @param child A child Evas object to be made a member of @p o
11522  * @return A box option bound to the recently added box item or @c
11523  * NULL, on errors
11524  *
11525  * On success, the @c "child,added" smart event will take place.
11526  *
11527  * @note The actual placing of the item relative to @p o's area will
11528  * depend on the layout set to it. For example, on horizontal layouts
11529  * an item in the beginning of the box's list of children will appear
11530  * on its left.
11531  *
11532  * @note This call will trigger the box's
11533  * _Evas_Object_Box_Api::prepend smart function.
11534  */
11535 EAPI Evas_Object_Box_Option    *evas_object_box_prepend(Evas_Object *o, Evas_Object *child) EINA_ARG_NONNULL(1, 2);
11536
11537 /**
11538  * Insert a new @a child object <b>before another existing one</b>, in
11539  * a given box object @a o.
11540  *
11541  * @param o The given box object
11542  * @param child A child Evas object to be made a member of @p o
11543  * @param reference The child object to place this new one before
11544  * @return A box option bound to the recently added box item or @c
11545  * NULL, on errors
11546  *
11547  * On success, the @c "child,added" smart event will take place.
11548  *
11549  * @note This function will fail if @p reference is not a member of @p
11550  * o.
11551  *
11552  * @note The actual placing of the item relative to @p o's area will
11553  * depend on the layout set to it.
11554  *
11555  * @note This call will trigger the box's
11556  * _Evas_Object_Box_Api::insert_before smart function.
11557  */
11558 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);
11559
11560 /**
11561  * Insert a new @a child object <b>after another existing one</b>, in
11562  * a given box object @a o.
11563  *
11564  * @param o The given box object
11565  * @param child A child Evas object to be made a member of @p o
11566  * @param reference The child object to place this new one after
11567  * @return A box option bound to the recently added box item or @c
11568  * NULL, on errors
11569  *
11570  * On success, the @c "child,added" smart event will take place.
11571  *
11572  * @note This function will fail if @p reference is not a member of @p
11573  * o.
11574  *
11575  * @note The actual placing of the item relative to @p o's area will
11576  * depend on the layout set to it.
11577  *
11578  * @note This call will trigger the box's
11579  * _Evas_Object_Box_Api::insert_after smart function.
11580  */
11581 EAPI Evas_Object_Box_Option    *evas_object_box_insert_after(Evas_Object *o, Evas_Object *child, const Evas_Object *reference) EINA_ARG_NONNULL(1, 2, 3);
11582
11583 /**
11584  * Insert a new @a child object <b>at a given position</b>, in a given
11585  * box object @a o.
11586  *
11587  * @param o The given box object
11588  * @param child A child Evas object to be made a member of @p o
11589  * @param pos The numeric position (starting from @c 0) to place the
11590  * new child object at
11591  * @return A box option bound to the recently added box item or @c
11592  * NULL, on errors
11593  *
11594  * On success, the @c "child,added" smart event will take place.
11595  *
11596  * @note This function will fail if the given position is invalid,
11597  * given @p o's internal list of elements.
11598  *
11599  * @note The actual placing of the item relative to @p o's area will
11600  * depend on the layout set to it.
11601  *
11602  * @note This call will trigger the box's
11603  * _Evas_Object_Box_Api::insert_at smart function.
11604  */
11605 EAPI Evas_Object_Box_Option    *evas_object_box_insert_at(Evas_Object *o, Evas_Object *child, unsigned int pos) EINA_ARG_NONNULL(1, 2);
11606
11607 /**
11608  * Remove a given object from a box object, unparenting it again.
11609  *
11610  * @param o The box object to remove a child object from
11611  * @param child The handle to the child object to be removed
11612  * @return @c EINA_TRUE, on success, @c EINA_FALSE otherwise
11613  *
11614  * On removal, you'll get an unparented object again, just as it was
11615  * before you inserted it in the box. The
11616  * _Evas_Object_Box_Api::option_free box smart callback will be called
11617  * automatically for you and, also, the @c "child,removed" smart event
11618  * will take place.
11619  *
11620  * @note This call will trigger the box's _Evas_Object_Box_Api::remove
11621  * smart function.
11622  */
11623 EAPI Eina_Bool                  evas_object_box_remove(Evas_Object *o, Evas_Object *child) EINA_ARG_NONNULL(1, 2);
11624
11625 /**
11626  * Remove an object, <b>bound to a given position</b> in a box object,
11627  * unparenting it again.
11628  *
11629  * @param o The box object to remove a child object from
11630  * @param pos The numeric position (starting from @c 0) of the child
11631  * object to be removed
11632  * @return @c EINA_TRUE, on success, @c EINA_FALSE otherwise
11633  *
11634  * On removal, you'll get an unparented object again, just as it was
11635  * before you inserted it in the box. The @c option_free() box smart
11636  * callback will be called automatically for you and, also, the
11637  * @c "child,removed" smart event will take place.
11638  *
11639  * @note This function will fail if the given position is invalid,
11640  * given @p o's internal list of elements.
11641  *
11642  * @note This call will trigger the box's
11643  * _Evas_Object_Box_Api::remove_at smart function.
11644  */
11645 EAPI Eina_Bool                  evas_object_box_remove_at(Evas_Object *o, unsigned int pos) EINA_ARG_NONNULL(1);
11646
11647 /**
11648  * Remove @b all child objects from a box object, unparenting them
11649  * again.
11650  *
11651  * @param o The box object to remove a child object from
11652  * @param clear if true, it will delete just removed children.
11653  * @return @c EINA_TRUE, on success, @c EINA_FALSE otherwise
11654  *
11655  * This has the same effect of calling evas_object_box_remove() on
11656  * each of @p o's child objects, in sequence. If, and only if, all
11657  * those calls succeed, so does this one.
11658  */
11659 EAPI Eina_Bool                  evas_object_box_remove_all(Evas_Object *o, Eina_Bool clear) EINA_ARG_NONNULL(1);
11660
11661 /**
11662  * Get an iterator to walk the list of children of a given box object.
11663  *
11664  * @param o The box to retrieve an items iterator from
11665  * @return An iterator on @p o's child objects, on success, or @c NULL,
11666  * on errors
11667  *
11668  * @note Do @b not remove or delete objects while walking the list.
11669  */
11670 EAPI Eina_Iterator             *evas_object_box_iterator_new(const Evas_Object *o) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
11671
11672 /**
11673  * Get an accessor (a structure providing random items access) to the
11674  * list of children of a given box object.
11675  *
11676  * @param o The box to retrieve an items iterator from
11677  * @return An accessor on @p o's child objects, on success, or @c NULL,
11678  * on errors
11679  *
11680  * @note Do not remove or delete objects while walking the list.
11681  */
11682 EAPI Eina_Accessor             *evas_object_box_accessor_new(const Evas_Object *o) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
11683
11684 /**
11685  * Get the list of children objects in a given box object.
11686  *
11687  * @param o The box to retrieve an items list from
11688  * @return A list of @p o's child objects, on success, or @c NULL,
11689  * on errors (or if it has no child objects)
11690  *
11691  * The returned list should be freed with @c eina_list_free() when you
11692  * no longer need it.
11693  *
11694  * @note This is a duplicate of the list kept by the box internally.
11695  *       It's up to the user to destroy it when it no longer needs it.
11696  *       It's possible to remove objects from the box when walking
11697  *       this list, but these removals won't be reflected on it.
11698  */
11699 EAPI Eina_List                 *evas_object_box_children_get(const Evas_Object *o) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
11700
11701 /**
11702  * Get the name of the property of the child elements of the box @a o
11703  * which have @a id as identifier
11704  *
11705  * @param o The box to search child options from
11706  * @param property The numerical identifier of the option being searched,
11707  * for its name
11708  * @return The name of the given property or @c NULL, on errors.
11709  *
11710  * @note This call won't do anything for a canonical Evas box. Only
11711  * users which have @b subclassed it, setting custom box items options
11712  * (see #Evas_Object_Box_Option) on it, would benefit from this
11713  * function. They'd have to implement it and set it to be the
11714  * _Evas_Object_Box_Api::property_name_get smart class function of the
11715  * box, which is originally set to @c NULL.
11716  */
11717 EAPI const char                *evas_object_box_option_property_name_get(const Evas_Object *o, int property) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
11718
11719 /**
11720  * Get the numerical identifier of the property of the child elements
11721  * of the box @a o which have @a name as name string
11722  *
11723  * @param o The box to search child options from
11724  * @param name The name string of the option being searched, for
11725  * its ID
11726  * @return The numerical ID of the given property or @c -1, on
11727  * errors.
11728  *
11729  * @note This call won't do anything for a canonical Evas box. Only
11730  * users which have @b subclassed it, setting custom box items options
11731  * (see #Evas_Object_Box_Option) on it, would benefit from this
11732  * function. They'd have to implement it and set it to be the
11733  * _Evas_Object_Box_Api::property_id_get smart class function of the
11734  * box, which is originally set to @c NULL.
11735  */
11736 EAPI int                        evas_object_box_option_property_id_get(const Evas_Object *o, const char *name) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2);
11737
11738 /**
11739  * Set a property value (by its given numerical identifier), on a
11740  * given box child element
11741  *
11742  * @param o The box parenting the child element
11743  * @param opt The box option structure bound to the child box element
11744  * to set a property on
11745  * @param property The numerical ID of the given property
11746  * @param ... (List of) actual value(s) to be set for this
11747  * property. It (they) @b must be of the same type the user has
11748  * defined for it (them).
11749  * @return @c EINA_TRUE on success, @c EINA_FALSE on failure.
11750  *
11751  * @note This call won't do anything for a canonical Evas box. Only
11752  * users which have @b subclassed it, setting custom box items options
11753  * (see #Evas_Object_Box_Option) on it, would benefit from this
11754  * function. They'd have to implement it and set it to be the
11755  * _Evas_Object_Box_Api::property_set smart class function of the box,
11756  * which is originally set to @c NULL.
11757  *
11758  * @note This function will internally create a variable argument
11759  * list, with the values passed after @p property, and call
11760  * evas_object_box_option_property_vset() with this list and the same
11761  * previous arguments.
11762  */
11763 EAPI Eina_Bool                  evas_object_box_option_property_set(Evas_Object *o, Evas_Object_Box_Option *opt, int property, ...) EINA_ARG_NONNULL(1, 2);
11764
11765 /**
11766  * Set a property value (by its given numerical identifier), on a
11767  * given box child element -- by a variable argument list
11768  *
11769  * @param o The box parenting the child element
11770  * @param opt The box option structure bound to the child box element
11771  * to set a property on
11772  * @param property The numerical ID of the given property
11773  * @param args The variable argument list implementing the value to
11774  * be set for this property. It @b must be of the same type the user has
11775  * defined for it.
11776  * @return @c EINA_TRUE on success, @c EINA_FALSE on failure.
11777  *
11778  * This is a variable argument list variant of the
11779  * evas_object_box_option_property_set(). See its documentation for
11780  * more details.
11781  */
11782 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);
11783
11784 /**
11785  * Get a property's value (by its given numerical identifier), on a
11786  * given box child element
11787  *
11788  * @param o The box parenting the child element
11789  * @param opt The box option structure bound to the child box element
11790  * to get a property from
11791  * @param property The numerical ID of the given property
11792  * @param ... (List of) pointer(s) where to store the value(s) set for
11793  * this property. It (they) @b must point to variable(s) of the same
11794  * type the user has defined for it (them).
11795  * @return @c EINA_TRUE on success, @c EINA_FALSE on failure.
11796  *
11797  * @note This call won't do anything for a canonical Evas box. Only
11798  * users which have @b subclassed it, getting custom box items options
11799  * (see #Evas_Object_Box_Option) on it, would benefit from this
11800  * function. They'd have to implement it and get it to be the
11801  * _Evas_Object_Box_Api::property_get smart class function of the
11802  * box, which is originally get to @c NULL.
11803  *
11804  * @note This function will internally create a variable argument
11805  * list, with the values passed after @p property, and call
11806  * evas_object_box_option_property_vget() with this list and the same
11807  * previous arguments.
11808  */
11809 EAPI Eina_Bool                  evas_object_box_option_property_get(const Evas_Object *o, Evas_Object_Box_Option *opt, int property, ...) EINA_ARG_NONNULL(1, 2);
11810
11811 /**
11812  * Get a property's value (by its given numerical identifier), on a
11813  * given box child element -- by a variable argument list
11814  *
11815  * @param o The box parenting the child element
11816  * @param opt The box option structure bound to the child box element
11817  * to get a property from
11818  * @param property The numerical ID of the given property
11819  * @param args The variable argument list with pointers to where to
11820  * store the values of this property. They @b must point to variables
11821  * of the same type the user has defined for them.
11822  * @return @c EINA_TRUE on success, @c EINA_FALSE on failure.
11823  *
11824  * This is a variable argument list variant of the
11825  * evas_object_box_option_property_get(). See its documentation for
11826  * more details.
11827  */
11828 EAPI Eina_Bool                  evas_object_box_option_property_vget(const Evas_Object *o, Evas_Object_Box_Option *opt, int property, va_list args) EINA_ARG_NONNULL(1, 2);
11829
11830 /**
11831  * @}
11832  */
11833
11834 /**
11835  * @defgroup Evas_Object_Table Table Smart Object.
11836  *
11837  * Convenience smart object that packs children using a tabular
11838  * layout using children size hints to define their size and
11839  * alignment inside their cell space.
11840  *
11841  * @ref tutorial_table shows how to use this Evas_Object.
11842  *
11843  * @see @ref Evas_Object_Group_Size_Hints
11844  *
11845  * @ingroup Evas_Smart_Object_Group
11846  *
11847  * @{
11848  */
11849
11850 /**
11851  * @brief Create a new table.
11852  *
11853  * @param evas Canvas in which table will be added.
11854  */
11855 EAPI Evas_Object                       *evas_object_table_add(Evas *evas) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
11856
11857 /**
11858  * @brief Create a table that is child of a given element @a parent.
11859  *
11860  * @see evas_object_table_add()
11861  */
11862 EAPI Evas_Object                       *evas_object_table_add_to(Evas_Object *parent) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
11863
11864 /**
11865  * @brief Set how this table should layout children.
11866  *
11867  * @todo consider aspect hint and respect it.
11868  *
11869  * @par EVAS_OBJECT_TABLE_HOMOGENEOUS_NONE
11870  * If table does not use homogeneous mode then columns and rows will
11871  * be calculated based on hints of individual cells. This operation
11872  * mode is more flexible, but more complex and heavy to calculate as
11873  * well. @b Weight properties are handled as a boolean expand. Negative
11874  * alignment will be considered as 0.5. This is the default.
11875  *
11876  * @todo @c EVAS_OBJECT_TABLE_HOMOGENEOUS_NONE should balance weight.
11877  *
11878  * @par EVAS_OBJECT_TABLE_HOMOGENEOUS_TABLE
11879  * When homogeneous is relative to table the own table size is divided
11880  * equally among children, filling the whole table area. That is, if
11881  * table has @c WIDTH and @c COLUMNS, each cell will get <tt>WIDTH /
11882  * COLUMNS</tt> pixels. If children have minimum size that is larger
11883  * than this amount (including padding), then it will overflow and be
11884  * aligned respecting the alignment hint, possible overlapping sibling
11885  * cells. @b Weight hint is used as a boolean, if greater than zero it
11886  * will make the child expand in that axis, taking as much space as
11887  * possible (bounded to maximum size hint). Negative alignment will be
11888  * considered as 0.5.
11889  *
11890  * @par EVAS_OBJECT_TABLE_HOMOGENEOUS_ITEM
11891  * When homogeneous is relative to item it means the greatest minimum
11892  * cell size will be used. That is, if no element is set to expand,
11893  * the table will have its contents to a minimum size, the bounding
11894  * box of all these children will be aligned relatively to the table
11895  * object using evas_object_table_align_get(). If the table area is
11896  * too small to hold this minimum bounding box, then the objects will
11897  * keep their size and the bounding box will overflow the box area,
11898  * still respecting the alignment. @b Weight hint is used as a
11899  * boolean, if greater than zero it will make that cell expand in that
11900  * axis, toggling the <b>expand mode</b>, which makes the table behave
11901  * much like @b EVAS_OBJECT_TABLE_HOMOGENEOUS_TABLE, except that the
11902  * bounding box will overflow and items will not overlap siblings. If
11903  * no minimum size is provided at all then the table will fallback to
11904  * expand mode as well.
11905  */
11906 EAPI void                               evas_object_table_homogeneous_set(Evas_Object *o, Evas_Object_Table_Homogeneous_Mode homogeneous) EINA_ARG_NONNULL(1);
11907
11908 /**
11909  * Get the current layout homogeneous mode.
11910  *
11911  * @see evas_object_table_homogeneous_set()
11912  */
11913 EAPI Evas_Object_Table_Homogeneous_Mode evas_object_table_homogeneous_get(const Evas_Object *o) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
11914
11915 /**
11916  * Set padding between cells.
11917  */
11918 EAPI void                               evas_object_table_padding_set(Evas_Object *o, Evas_Coord horizontal, Evas_Coord vertical) EINA_ARG_NONNULL(1);
11919
11920 /**
11921  * Get padding between cells.
11922  */
11923 EAPI void                               evas_object_table_padding_get(const Evas_Object *o, Evas_Coord *horizontal, Evas_Coord *vertical) EINA_ARG_NONNULL(1);
11924
11925 /**
11926  * Set the alignment of the whole bounding box of contents.
11927  */
11928 EAPI void                               evas_object_table_align_set(Evas_Object *o, double horizontal, double vertical) EINA_ARG_NONNULL(1);
11929
11930 /**
11931  * Get alignment of the whole bounding box of contents.
11932  */
11933 EAPI void                               evas_object_table_align_get(const Evas_Object *o, double *horizontal, double *vertical) EINA_ARG_NONNULL(1);
11934
11935 /**
11936  * Sets the mirrored mode of the table. In mirrored mode the table items go
11937  * from right to left instead of left to right. That is, 1,1 is top right, not
11938  * top left.
11939  *
11940  * @param o The table object.
11941  * @param mirrored the mirrored mode to set
11942  * @since 1.1
11943  */
11944 EAPI void                               evas_object_table_mirrored_set(Evas_Object *o, Eina_Bool mirrored) EINA_ARG_NONNULL(1);
11945
11946 /**
11947  * Gets the mirrored mode of the table.
11948  *
11949  * @param o The table object.
11950  * @return @c EINA_TRUE if it's a mirrored table, @c EINA_FALSE otherwise.
11951  * @since 1.1
11952  * @see evas_object_table_mirrored_set()
11953  */
11954 EAPI Eina_Bool                          evas_object_table_mirrored_get(const Evas_Object *o) EINA_ARG_NONNULL(1);
11955
11956 /**
11957  * Get packing location of a child of table
11958  *
11959  * @param o The given table object.
11960  * @param child The child object to add.
11961  * @param col pointer to store relative-horizontal position to place child.
11962  * @param row pointer to store relative-vertical position to place child.
11963  * @param colspan pointer to store how many relative-horizontal position to use for this child.
11964  * @param rowspan pointer to store how many relative-vertical position to use for this child.
11965  *
11966  * @return 1 on success, 0 on failure.
11967  * @since 1.1
11968  */
11969 EAPI Eina_Bool                          evas_object_table_pack_get(const Evas_Object *o, Evas_Object *child, unsigned short *col, unsigned short *row, unsigned short *colspan, unsigned short *rowspan);
11970
11971 /**
11972  * Add a new child to a table object or set its current packing.
11973  *
11974  * @param o The given table object.
11975  * @param child The child object to add.
11976  * @param col relative-horizontal position to place child.
11977  * @param row relative-vertical position to place child.
11978  * @param colspan how many relative-horizontal position to use for this child.
11979  * @param rowspan how many relative-vertical position to use for this child.
11980  *
11981  * @return 1 on success, 0 on failure.
11982  */
11983 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);
11984
11985 /**
11986  * Remove child from table.
11987  *
11988  * @note removing a child will immediately call a walk over children in order
11989  *       to recalculate numbers of columns and rows. If you plan to remove
11990  *       all children, use evas_object_table_clear() instead.
11991  *
11992  * @return 1 on success, 0 on failure.
11993  */
11994 EAPI Eina_Bool                          evas_object_table_unpack(Evas_Object *o, Evas_Object *child) EINA_ARG_NONNULL(1, 2);
11995
11996 /**
11997  * Faster way to remove all child objects from a table object.
11998  *
11999  * @param o The given table object.
12000  * @param clear if true, it will delete just removed children.
12001  */
12002 EAPI void                               evas_object_table_clear(Evas_Object *o, Eina_Bool clear) EINA_ARG_NONNULL(1);
12003
12004 /**
12005  * Get the number of columns and rows this table takes.
12006  *
12007  * @note columns and rows are virtual entities, one can specify a table
12008  *       with a single object that takes 4 columns and 5 rows. The only
12009  *       difference for a single cell table is that paddings will be
12010  *       accounted proportionally.
12011  */
12012 EAPI void                               evas_object_table_col_row_size_get(const Evas_Object *o, int *cols, int *rows) EINA_ARG_NONNULL(1);
12013
12014 /**
12015  * Get an iterator to walk the list of children for the table.
12016  *
12017  * @note Do not remove or delete objects while walking the list.
12018  */
12019 EAPI Eina_Iterator                     *evas_object_table_iterator_new(const Evas_Object *o) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
12020
12021 /**
12022  * Get an accessor to get random access to the list of children for the table.
12023  *
12024  * @note Do not remove or delete objects while walking the list.
12025  */
12026 EAPI Eina_Accessor                     *evas_object_table_accessor_new(const Evas_Object *o) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
12027
12028 /**
12029  * Get the list of children for the table.
12030  *
12031  * @note This is a duplicate of the list kept by the table internally.
12032  *       It's up to the user to destroy it when it no longer needs it.
12033  *       It's possible to remove objects from the table when walking this
12034  *       list, but these removals won't be reflected on it.
12035  */
12036 EAPI Eina_List                         *evas_object_table_children_get(const Evas_Object *o) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
12037
12038 /**
12039  * Get the child of the table at the given coordinates
12040  *
12041  * @note This does not take into account col/row spanning
12042  */
12043 EAPI Evas_Object                       *evas_object_table_child_get(const Evas_Object *o, unsigned short col, unsigned short row) EINA_ARG_NONNULL(1);
12044 /**
12045  * @}
12046  */
12047
12048 /**
12049  * @defgroup Evas_Object_Grid Grid Smart Object.
12050  *
12051  * Convenience smart object that packs children under a regular grid
12052  * layout, using their virtual grid location and size to determine
12053  * children's positions inside the grid object's area.
12054  *
12055  * @ingroup Evas_Smart_Object_Group
12056  * @since 1.1
12057  */
12058
12059 /**
12060  * @addtogroup Evas_Object_Grid
12061  * @{
12062  */
12063
12064 /**
12065  * Create a new grid.
12066  *
12067  * It's set to a virtual size of 1x1 by default and add children with
12068  * evas_object_grid_pack().
12069  * @since 1.1
12070  */
12071 EAPI Evas_Object   *evas_object_grid_add(Evas *evas) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
12072
12073 /**
12074  * Create a grid that is child of a given element @a parent.
12075  *
12076  * @see evas_object_grid_add()
12077  * @since 1.1
12078  */
12079 EAPI Evas_Object   *evas_object_grid_add_to(Evas_Object *parent) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
12080
12081 /**
12082  * Set the virtual resolution for the grid
12083  *
12084  * @param o The grid object to modify
12085  * @param w The virtual horizontal size (resolution) in integer units
12086  * @param h The virtual vertical size (resolution) in integer units
12087  * @since 1.1
12088  */
12089 EAPI void           evas_object_grid_size_set(Evas_Object *o, int w, int h) EINA_ARG_NONNULL(1);
12090
12091 /**
12092  * Get the current virtual resolution
12093  *
12094  * @param o The grid object to query
12095  * @param w A pointer to an integer to store the virtual width
12096  * @param h A pointer to an integer to store the virtual height
12097  * @see evas_object_grid_size_set()
12098  * @since 1.1
12099  */
12100 EAPI void           evas_object_grid_size_get(const Evas_Object *o, int *w, int *h) EINA_ARG_NONNULL(1);
12101
12102 /**
12103  * Sets the mirrored mode of the grid. In mirrored mode the grid items go
12104  * from right to left instead of left to right. That is, 0,0 is top right, not
12105  * to left.
12106  *
12107  * @param o The grid object.
12108  * @param mirrored the mirrored mode to set
12109  * @since 1.1
12110  */
12111 EAPI void           evas_object_grid_mirrored_set(Evas_Object *o, Eina_Bool mirrored) EINA_ARG_NONNULL(1);
12112
12113 /**
12114  * Gets the mirrored mode of the grid.
12115  *
12116  * @param o The grid object.
12117  * @return @c EINA_TRUE if it's a mirrored grid, @c EINA_FALSE otherwise.
12118  * @see evas_object_grid_mirrored_set()
12119  * @since 1.1
12120  */
12121 EAPI Eina_Bool      evas_object_grid_mirrored_get(const Evas_Object *o) EINA_ARG_NONNULL(1);
12122
12123 /**
12124  * Add a new child to a grid object.
12125  *
12126  * @param o The given grid object.
12127  * @param child The child object to add.
12128  * @param x The virtual x coordinate of the child
12129  * @param y The virtual y coordinate of the child
12130  * @param w The virtual width of the child
12131  * @param h The virtual height of the child
12132  * @return 1 on success, 0 on failure.
12133  * @since 1.1
12134  */
12135 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);
12136
12137 /**
12138  * Remove child from grid.
12139  *
12140  * @note removing a child will immediately call a walk over children in order
12141  *       to recalculate numbers of columns and rows. If you plan to remove
12142  *       all children, use evas_object_grid_clear() instead.
12143  *
12144  * @return 1 on success, 0 on failure.
12145  * @since 1.1
12146  */
12147 EAPI Eina_Bool      evas_object_grid_unpack(Evas_Object *o, Evas_Object *child) EINA_ARG_NONNULL(1, 2);
12148
12149 /**
12150  * Faster way to remove all child objects from a grid object.
12151  *
12152  * @param o The given grid object.
12153  * @param clear if true, it will delete just removed children.
12154  * @since 1.1
12155  */
12156 EAPI void           evas_object_grid_clear(Evas_Object *o, Eina_Bool clear) EINA_ARG_NONNULL(1);
12157
12158 /**
12159  * Get the pack options for a grid child
12160  *
12161  * Get the pack x, y, width and height in virtual coordinates set by
12162  * evas_object_grid_pack()
12163  * @param o The grid object
12164  * @param child The grid child to query for coordinates
12165  * @param x The pointer to where the x coordinate will be returned
12166  * @param y The pointer to where the y coordinate will be returned
12167  * @param w The pointer to where the width will be returned
12168  * @param h The pointer to where the height will be returned
12169  * @return 1 on success, 0 on failure.
12170  * @since 1.1
12171  */
12172 EAPI Eina_Bool      evas_object_grid_pack_get(const Evas_Object *o, Evas_Object *child, int *x, int *y, int *w, int *h);
12173
12174 /**
12175  * Get an iterator to walk the list of children for the grid.
12176  *
12177  * @note Do not remove or delete objects while walking the list.
12178  * @since 1.1
12179  */
12180 EAPI Eina_Iterator *evas_object_grid_iterator_new(const Evas_Object *o) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
12181
12182 /**
12183  * Get an accessor to get random access to the list of children for the grid.
12184  *
12185  * @note Do not remove or delete objects while walking the list.
12186  * @since 1.1
12187  */
12188 EAPI Eina_Accessor *evas_object_grid_accessor_new(const Evas_Object *o) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
12189
12190 /**
12191  * Get the list of children for the grid.
12192  *
12193  * @note This is a duplicate of the list kept by the grid internally.
12194  *       It's up to the user to destroy it when it no longer needs it.
12195  *       It's possible to remove objects from the grid when walking this
12196  *       list, but these removals won't be reflected on it.
12197  * @since 1.1
12198  */
12199 EAPI Eina_List     *evas_object_grid_children_get(const Evas_Object *o) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
12200
12201 /**
12202  * @}
12203  */
12204
12205 /**
12206  * @defgroup Evas_Cserve Shared Image Cache Server
12207  *
12208  * Evas has an (optional) module which provides client-server
12209  * infrastructure to <b>share bitmaps across multiple processes</b>,
12210  * saving data and processing power.
12211  *
12212  * Be warned that it @b doesn't work when <b>threaded image
12213  * preloading</b> is enabled for Evas, though.
12214  */
12215 typedef struct _Evas_Cserve_Stats       Evas_Cserve_Stats;
12216 typedef struct _Evas_Cserve_Image_Cache Evas_Cserve_Image_Cache;
12217 typedef struct _Evas_Cserve_Image       Evas_Cserve_Image;
12218 typedef struct _Evas_Cserve_Config      Evas_Cserve_Config;
12219
12220 /**
12221  * Statistics about the server that shares cached bitmaps.
12222  * @ingroup Evas_Cserve
12223  */
12224 struct _Evas_Cserve_Stats
12225 {
12226    int    saved_memory;      /**< current amount of saved memory, in bytes */
12227    int    wasted_memory;      /**< current amount of wasted memory, in bytes */
12228    int    saved_memory_peak;      /**< peak amount of saved memory, in bytes */
12229    int    wasted_memory_peak;      /**< peak amount of wasted memory, in bytes */
12230    double saved_time_image_header_load;      /**< time, in seconds, saved in header loads by sharing cached loads instead */
12231    double saved_time_image_data_load;      /**< time, in seconds, saved in data loads by sharing cached loads instead */
12232 };
12233
12234 /**
12235  * A handle of a cache of images shared by a server.
12236  * @ingroup Evas_Cserve
12237  */
12238 struct _Evas_Cserve_Image_Cache
12239 {
12240    struct
12241    {
12242       int mem_total;
12243       int count;
12244    } active, cached;
12245    Eina_List *images;
12246 };
12247
12248 /**
12249  * A handle to an image shared by a server.
12250  * @ingroup Evas_Cserve
12251  */
12252 struct _Evas_Cserve_Image
12253 {
12254    const char *file, *key;
12255    int         w, h;
12256    time_t      file_mod_time;
12257    time_t      file_checked_time;
12258    time_t      cached_time;
12259    int         refcount;
12260    int         data_refcount;
12261    int         memory_footprint;
12262    double      head_load_time;
12263    double      data_load_time;
12264    Eina_Bool   alpha : 1;
12265    Eina_Bool   data_loaded : 1;
12266    Eina_Bool   active : 1;
12267    Eina_Bool   dead : 1;
12268    Eina_Bool   useless : 1;
12269 };
12270
12271 /**
12272  * Configuration that controls the server that shares cached bitmaps.
12273  * @ingroup Evas_Cserve
12274  */
12275 struct _Evas_Cserve_Config
12276 {
12277    int cache_max_usage;
12278    int cache_item_timeout;
12279    int cache_item_timeout_check;
12280 };
12281
12282 /**
12283  * Retrieves if the system wants to share bitmaps using the server.
12284  * @return @c EINA_TRUE if it wants, @c EINA_FALSE otherwise.
12285  * @ingroup Evas_Cserve
12286  */
12287 EAPI Eina_Bool   evas_cserve_want_get(void) EINA_WARN_UNUSED_RESULT;
12288
12289 /**
12290  * Retrieves if the system is connected to the server used to share
12291  * bitmaps.
12292  *
12293  * @return @c EINA_TRUE if it's connected, @c EINA_FALSE otherwise.
12294  * @ingroup Evas_Cserve
12295  */
12296 EAPI Eina_Bool   evas_cserve_connected_get(void) EINA_WARN_UNUSED_RESULT;
12297
12298 /**
12299  * Retrieves statistics from a running bitmap sharing server.
12300  * @param stats pointer to structure to fill with statistics about the
12301  *        bitmap cache server.
12302  *
12303  * @return @c EINA_TRUE if @p stats were filled with data,
12304  *         @c EINA_FALSE otherwise (when @p stats is untouched)
12305  * @ingroup Evas_Cserve
12306  */
12307 EAPI Eina_Bool   evas_cserve_stats_get(Evas_Cserve_Stats *stats) EINA_WARN_UNUSED_RESULT;
12308
12309 /**
12310  * Completely discard/clean a given images cache, thus re-setting it.
12311  *
12312  * @param cache A handle to the given images cache.
12313  */
12314 EAPI void        evas_cserve_image_cache_contents_clean(Evas_Cserve_Image_Cache *cache);
12315
12316 /**
12317  * Retrieves the current configuration of the Evas image caching
12318  * server.
12319  *
12320  * @param config where to store current image caching server's
12321  * configuration.
12322  *
12323  * @return @c EINA_TRUE if @p config was filled with data,
12324  *         @c EINA_FALSE otherwise (when @p config is untouched)
12325  *
12326  * The fields of @p config will be altered to reflect the current
12327  * configuration's values.
12328  *
12329  * @see evas_cserve_config_set()
12330  *
12331  * @ingroup Evas_Cserve
12332  */
12333 EAPI Eina_Bool   evas_cserve_config_get(Evas_Cserve_Config *config) EINA_WARN_UNUSED_RESULT;
12334
12335 /**
12336  * Changes the configurations of the Evas image caching server.
12337  *
12338  * @param config A bitmap cache configuration handle with fields set
12339  * to desired configuration values.
12340  * @return @c EINA_TRUE if @p config was successfully applied,
12341  *         @c EINA_FALSE otherwise.
12342  *
12343  * @see evas_cserve_config_get()
12344  *
12345  * @ingroup Evas_Cserve
12346  */
12347 EAPI Eina_Bool   evas_cserve_config_set(const Evas_Cserve_Config *config) EINA_WARN_UNUSED_RESULT;
12348
12349 /**
12350  * Force the system to disconnect from the bitmap caching server.
12351  *
12352  * @ingroup Evas_Cserve
12353  */
12354 EAPI void        evas_cserve_disconnect(void);
12355
12356 /**
12357  * @defgroup Evas_Utils General Utilities
12358  *
12359  * Some functions that are handy but are not specific of canvas or
12360  * objects.
12361  */
12362
12363 /**
12364  * Converts the given Evas image load error code into a string
12365  * describing it in english.
12366  *
12367  * @param error the error code, a value in ::Evas_Load_Error.
12368  * @return Always returns a valid string. If the given @p error is not
12369  *         supported, <code>"Unknown error"</code> is returned.
12370  *
12371  * Mostly evas_object_image_file_set() would be the function setting
12372  * that error value afterwards, but also evas_object_image_load(),
12373  * evas_object_image_save(), evas_object_image_data_get(),
12374  * evas_object_image_data_convert(), evas_object_image_pixels_import()
12375  * and evas_object_image_is_inside(). This function is meant to be
12376  * used in conjunction with evas_object_image_load_error_get(), as in:
12377  *
12378  * Example code:
12379  * @dontinclude evas-images.c
12380  * @skip img1 =
12381  * @until ecore_main_loop_begin(
12382  *
12383  * Here, being @c valid_path the path to a valid image and @c
12384  * bogus_path a path to a file which does not exist, the two outputs
12385  * of evas_load_error_str() would be (if no other errors occur):
12386  * <code>"No error on load"</code> and <code>"File (or file path) does
12387  * not exist"</code>, respectively. See the full @ref
12388  * Example_Evas_Images "example".
12389  *
12390  * @ingroup Evas_Utils
12391  */
12392 EAPI const char *evas_load_error_str(Evas_Load_Error error);
12393
12394 /* Evas utility routines for color space conversions */
12395 /* hsv color space has h in the range 0.0 to 360.0, and s,v in the range 0.0 to 1.0 */
12396 /* rgb color space has r,g,b in the range 0 to 255 */
12397
12398 /**
12399  * Convert a given color from HSV to RGB format.
12400  *
12401  * @param h The Hue component of the color.
12402  * @param s The Saturation component of the color.
12403  * @param v The Value component of the color.
12404  * @param r The Red component of the color.
12405  * @param g The Green component of the color.
12406  * @param b The Blue component of the color.
12407  *
12408  * This function converts a given color in HSV color format to RGB
12409  * color format.
12410  *
12411  * @ingroup Evas_Utils
12412  **/
12413 EAPI void evas_color_hsv_to_rgb(float h, float s, float v, int *r, int *g, int *b);
12414
12415 /**
12416  * Convert a given color from RGB to HSV format.
12417  *
12418  * @param r The Red component of the color.
12419  * @param g The Green component of the color.
12420  * @param b The Blue component of the color.
12421  * @param h The Hue component of the color.
12422  * @param s The Saturation component of the color.
12423  * @param v The Value component of the color.
12424  *
12425  * This function converts a given color in RGB color format to HSV
12426  * color format.
12427  *
12428  * @ingroup Evas_Utils
12429  **/
12430 EAPI void evas_color_rgb_to_hsv(int r, int g, int b, float *h, float *s, float *v);
12431
12432 /* argb color space has a,r,g,b in the range 0 to 255 */
12433
12434 /**
12435  * Pre-multiplies a rgb triplet by an alpha factor.
12436  *
12437  * @param a The alpha factor.
12438  * @param r The Red component of the color.
12439  * @param g The Green component of the color.
12440  * @param b The Blue component of the color.
12441  *
12442  * This function pre-multiplies a given rgb triplet by an alpha
12443  * factor. Alpha factor is used to define transparency.
12444  *
12445  * @ingroup Evas_Utils
12446  **/
12447 EAPI void evas_color_argb_premul(int a, int *r, int *g, int *b);
12448
12449 /**
12450  * Undo pre-multiplication of a rgb triplet by an alpha factor.
12451  *
12452  * @param a The alpha factor.
12453  * @param r The Red component of the color.
12454  * @param g The Green component of the color.
12455  * @param b The Blue component of the color.
12456  *
12457  * This function undoes pre-multiplication a given rbg triplet by an
12458  * alpha factor. Alpha factor is used to define transparency.
12459  *
12460  * @see evas_color_argb_premul().
12461  *
12462  * @ingroup Evas_Utils
12463  **/
12464 EAPI void evas_color_argb_unpremul(int a, int *r, int *g, int *b);
12465
12466 /**
12467  * Pre-multiplies data by an alpha factor.
12468  *
12469  * @param data The data value.
12470  * @param len  The length value.
12471  *
12472  * This function pre-multiplies a given data by an alpha
12473  * factor. Alpha factor is used to define transparency.
12474  *
12475  * @ingroup Evas_Utils
12476  **/
12477 EAPI void evas_data_argb_premul(unsigned int *data, unsigned int len);
12478
12479 /**
12480  * Undo pre-multiplication data by an alpha factor.
12481  *
12482  * @param data The data value.
12483  * @param len  The length value.
12484  *
12485  * This function undoes pre-multiplication of a given data by an alpha
12486  * factor. Alpha factor is used to define transparency.
12487  *
12488  * @ingroup Evas_Utils
12489  **/
12490 EAPI void evas_data_argb_unpremul(unsigned int *data, unsigned int len);
12491
12492 /* string and font handling */
12493
12494 /**
12495  * Gets the next character in the string
12496  *
12497  * Given the UTF-8 string in @p str, and starting byte position in @p pos,
12498  * this function will place in @p decoded the decoded code point at @p pos
12499  * and return the byte index for the next character in the string.
12500  *
12501  * The only boundary check done is that @p pos must be >= 0. Other than that,
12502  * no checks are performed, so passing an index value that's not within the
12503  * length of the string will result in undefined behavior.
12504  *
12505  * @param str The UTF-8 string
12506  * @param pos The byte index where to start
12507  * @param decoded Address where to store the decoded code point. Optional.
12508  *
12509  * @return The byte index of the next character
12510  *
12511  * @ingroup Evas_Utils
12512  */
12513 EAPI int  evas_string_char_next_get(const char *str, int pos, int *decoded) EINA_ARG_NONNULL(1);
12514
12515 /**
12516  * Gets the previous character in the string
12517  *
12518  * Given the UTF-8 string in @p str, and starting byte position in @p pos,
12519  * this function will place in @p decoded the decoded code point at @p pos
12520  * and return the byte index for the previous character in the string.
12521  *
12522  * The only boundary check done is that @p pos must be >= 1. Other than that,
12523  * no checks are performed, so passing an index value that's not within the
12524  * length of the string will result in undefined behavior.
12525  *
12526  * @param str The UTF-8 string
12527  * @param pos The byte index where to start
12528  * @param decoded Address where to store the decoded code point. Optional.
12529  *
12530  * @return The byte index of the previous character
12531  *
12532  * @ingroup Evas_Utils
12533  */
12534 EAPI int  evas_string_char_prev_get(const char *str, int pos, int *decoded) EINA_ARG_NONNULL(1);
12535
12536 /**
12537  * Get the length in characters of the string.
12538  * @param  str The string to get the length of.
12539  * @return The length in characters (not bytes)
12540  * @ingroup Evas_Utils
12541  */
12542 EAPI int  evas_string_char_len_get(const char *str) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
12543
12544 /**
12545  * @defgroup Evas_Keys Key Input Functions
12546  *
12547  * Functions which feed key events to the canvas.
12548  *
12549  * As explained in @ref intro_not_evas, Evas is @b not aware of input
12550  * systems at all. Then, the user, if using it crudely (evas_new()),
12551  * will have to feed it with input events, so that it can react
12552  * somehow. If, however, the user creates a canvas by means of the
12553  * Ecore_Evas wrapper, it will automatically bind the chosen display
12554  * engine's input events to the canvas, for you.
12555  *
12556  * This group presents the functions dealing with the feeding of key
12557  * events to the canvas. On most of them, one has to reference a given
12558  * key by a name (<code>keyname</code> argument). Those are
12559  * <b>platform dependent</b> symbolic names for the keys. Sometimes
12560  * you'll get the right <code>keyname</code> by simply using an ASCII
12561  * value of the key name, but it won't be like that always.
12562  *
12563  * Typical platforms are Linux frame buffer (Ecore_FB) and X server
12564  * (Ecore_X) when using Evas with Ecore and Ecore_Evas. Please refer
12565  * to your display engine's documentation when using evas through an
12566  * Ecore helper wrapper when you need the <code>keyname</code>s.
12567  *
12568  * Example:
12569  * @dontinclude evas-events.c
12570  * @skip mods = evas_key_modifier_get(evas);
12571  * @until {
12572  *
12573  * All the other @c evas_key functions behave on the same manner. See
12574  * the full @ref Example_Evas_Events "example".
12575  *
12576  * @ingroup Evas_Canvas
12577  */
12578
12579 /**
12580  * @addtogroup Evas_Keys
12581  * @{
12582  */
12583
12584 /**
12585  * Returns a handle to the list of modifier keys registered in the
12586  * canvas @p e. This is required to check for which modifiers are set
12587  * at a given time with the evas_key_modifier_is_set() function.
12588  *
12589  * @param e The pointer to the Evas canvas
12590  *
12591  * @see evas_key_modifier_add
12592  * @see evas_key_modifier_del
12593  * @see evas_key_modifier_on
12594  * @see evas_key_modifier_off
12595  * @see evas_key_modifier_is_set
12596  *
12597  * @return An ::Evas_Modifier handle to query Evas' keys subsystem
12598  *      with evas_key_modifier_is_set(), or @c NULL on error.
12599  */
12600 EAPI const Evas_Modifier *evas_key_modifier_get(const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
12601
12602 /**
12603  * Returns a handle to the list of lock keys registered in the canvas
12604  * @p e. This is required to check for which locks are set at a given
12605  * time with the evas_key_lock_is_set() function.
12606  *
12607  * @param e The pointer to the Evas canvas
12608  *
12609  * @see evas_key_lock_add
12610  * @see evas_key_lock_del
12611  * @see evas_key_lock_on
12612  * @see evas_key_lock_off
12613  * @see evas_key_lock_is_set
12614  *
12615  * @return An ::Evas_Lock handle to query Evas' keys subsystem with
12616  *      evas_key_lock_is_set(), or @c NULL on error.
12617  */
12618 EAPI const Evas_Lock     *evas_key_lock_get(const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
12619
12620 /**
12621  * Checks the state of a given modifier key, at the time of the
12622  * call. If the modifier is set, such as shift being pressed, this
12623  * function returns @c Eina_True.
12624  *
12625  * @param m The current modifiers set, as returned by
12626  *        evas_key_modifier_get().
12627  * @param keyname The name of the modifier key to check status for.
12628  *
12629  * @return @c Eina_True if the modifier key named @p keyname is on, @c
12630  *         Eina_False otherwise.
12631  *
12632  * @see evas_key_modifier_add
12633  * @see evas_key_modifier_del
12634  * @see evas_key_modifier_get
12635  * @see evas_key_modifier_on
12636  * @see evas_key_modifier_off
12637  */
12638 EAPI Eina_Bool            evas_key_modifier_is_set(const Evas_Modifier *m, const char *keyname) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2);
12639
12640 /**
12641  * Checks the state of a given lock key, at the time of the call. If
12642  * the lock is set, such as caps lock, this function returns @c
12643  * Eina_True.
12644  *
12645  * @param l The current locks set, as returned by evas_key_lock_get().
12646  * @param keyname The name of the lock key to check status for.
12647  *
12648  * @return @c Eina_True if the @p keyname lock key is set, @c
12649  *        Eina_False otherwise.
12650  *
12651  * @see evas_key_lock_get
12652  * @see evas_key_lock_add
12653  * @see evas_key_lock_del
12654  * @see evas_key_lock_on
12655  * @see evas_key_lock_off
12656  */
12657 EAPI Eina_Bool            evas_key_lock_is_set(const Evas_Lock *l, const char *keyname) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2);
12658
12659 /**
12660  * Adds the @p keyname key to the current list of modifier keys.
12661  *
12662  * @param e The pointer to the Evas canvas
12663  * @param keyname The name of the modifier key to add to the list of
12664  *        Evas modifiers.
12665  *
12666  * Modifiers are keys like shift, alt and ctrl, i.e., keys which are
12667  * meant to be pressed together with others, altering the behavior of
12668  * the secondly pressed keys somehow. Evas is so that these keys can
12669  * be user defined.
12670  *
12671  * This call allows custom modifiers to be added to the Evas system at
12672  * run time. It is then possible to set and unset modifier keys
12673  * programmatically for other parts of the program to check and act
12674  * on. Programmers using Evas would check for modifier keys on key
12675  * event callbacks using evas_key_modifier_is_set().
12676  *
12677  * @see evas_key_modifier_del
12678  * @see evas_key_modifier_get
12679  * @see evas_key_modifier_on
12680  * @see evas_key_modifier_off
12681  * @see evas_key_modifier_is_set
12682  *
12683  * @note If the programmer instantiates the canvas by means of the
12684  *       ecore_evas_new() family of helper functions, Ecore will take
12685  *       care of registering on it all standard modifiers: "Shift",
12686  *       "Control", "Alt", "Meta", "Hyper", "Super".
12687  */
12688 EAPI void                 evas_key_modifier_add(Evas *e, const char *keyname) EINA_ARG_NONNULL(1, 2);
12689
12690 /**
12691  * Removes the @p keyname key from the current list of modifier keys
12692  * on canvas @p e.
12693  *
12694  * @param e The pointer to the Evas canvas
12695  * @param keyname The name of the key to remove from the modifiers list.
12696  *
12697  * @see evas_key_modifier_add
12698  * @see evas_key_modifier_get
12699  * @see evas_key_modifier_on
12700  * @see evas_key_modifier_off
12701  * @see evas_key_modifier_is_set
12702  */
12703 EAPI void                 evas_key_modifier_del(Evas *e, const char *keyname) EINA_ARG_NONNULL(1, 2);
12704
12705 /**
12706  * Adds the @p keyname key to the current list of lock keys.
12707  *
12708  * @param e The pointer to the Evas canvas
12709  * @param keyname The name of the key to add to the locks list.
12710  *
12711  * Locks are keys like caps lock, num lock or scroll lock, i.e., keys
12712  * which are meant to be pressed once -- toggling a binary state which
12713  * is bound to it -- and thus altering the behavior of all
12714  * subsequently pressed keys somehow, depending on its state. Evas is
12715  * so that these keys can be defined by the user.
12716  *
12717  * This allows custom locks to be added to the evas system at run
12718  * time. It is then possible to set and unset lock keys
12719  * programmatically for other parts of the program to check and act
12720  * on. Programmers using Evas would check for lock keys on key event
12721  * callbacks using evas_key_lock_is_set().
12722  *
12723  * @see evas_key_lock_get
12724  * @see evas_key_lock_del
12725  * @see evas_key_lock_on
12726  * @see evas_key_lock_off
12727  * @see evas_key_lock_is_set
12728  *
12729  * @note If the programmer instantiates the canvas by means of the
12730  *       ecore_evas_new() family of helper functions, Ecore will take
12731  *       care of registering on it all standard lock keys: "Caps_Lock",
12732  *       "Num_Lock", "Scroll_Lock".
12733  */
12734 EAPI void                 evas_key_lock_add(Evas *e, const char *keyname) EINA_ARG_NONNULL(1, 2);
12735
12736 /**
12737  * Removes the @p keyname key from the current list of lock keys on
12738  * canvas @p e.
12739  *
12740  * @param e The pointer to the Evas canvas
12741  * @param keyname The name of the key to remove from the locks list.
12742  *
12743  * @see evas_key_lock_get
12744  * @see evas_key_lock_add
12745  * @see evas_key_lock_on
12746  * @see evas_key_lock_off
12747  */
12748 EAPI void                 evas_key_lock_del(Evas *e, const char *keyname) EINA_ARG_NONNULL(1, 2);
12749
12750 /**
12751  * Enables or turns on programmatically the modifier key with name @p
12752  * keyname.
12753  *
12754  * @param e The pointer to the Evas canvas
12755  * @param keyname The name of the modifier to enable.
12756  *
12757  * The effect will be as if the key was pressed for the whole time
12758  * between this call and a matching evas_key_modifier_off().
12759  *
12760  * @see evas_key_modifier_add
12761  * @see evas_key_modifier_get
12762  * @see evas_key_modifier_off
12763  * @see evas_key_modifier_is_set
12764  */
12765 EAPI void                 evas_key_modifier_on(Evas *e, const char *keyname) EINA_ARG_NONNULL(1, 2);
12766
12767 /**
12768  * Disables or turns off programmatically the modifier key with name
12769  * @p keyname.
12770  *
12771  * @param e The pointer to the Evas canvas
12772  * @param keyname The name of the modifier to disable.
12773  *
12774  * @see evas_key_modifier_add
12775  * @see evas_key_modifier_get
12776  * @see evas_key_modifier_on
12777  * @see evas_key_modifier_is_set
12778  */
12779 EAPI void                 evas_key_modifier_off(Evas *e, const char *keyname) EINA_ARG_NONNULL(1, 2);
12780
12781 /**
12782  * Enables or turns on programmatically the lock key with name @p
12783  * keyname.
12784  *
12785  * @param e The pointer to the Evas canvas
12786  * @param keyname The name of the lock to enable.
12787  *
12788  * The effect will be as if the key was put on its active state after
12789  * this call.
12790  *
12791  * @see evas_key_lock_get
12792  * @see evas_key_lock_add
12793  * @see evas_key_lock_del
12794  * @see evas_key_lock_off
12795  */
12796 EAPI void                 evas_key_lock_on(Evas *e, const char *keyname) EINA_ARG_NONNULL(1, 2);
12797
12798 /**
12799  * Disables or turns off programmatically the lock key with name @p
12800  * keyname.
12801  *
12802  * @param e The pointer to the Evas canvas
12803  * @param keyname The name of the lock to disable.
12804  *
12805  * The effect will be as if the key was put on its inactive state
12806  * after this call.
12807  *
12808  * @see evas_key_lock_get
12809  * @see evas_key_lock_add
12810  * @see evas_key_lock_del
12811  * @see evas_key_lock_on
12812  */
12813 EAPI void                 evas_key_lock_off(Evas *e, const char *keyname) EINA_ARG_NONNULL(1, 2);
12814
12815 /**
12816  * Creates a bit mask from the @p keyname @b modifier key. Values
12817  * returned from different calls to it may be ORed together,
12818  * naturally.
12819  *
12820  * @param e The canvas whom to query the bit mask from.
12821  * @param keyname The name of the modifier key to create the mask for.
12822  *
12823  * @returns the bit mask or 0 if the @p keyname key wasn't registered as a
12824  *          modifier for canvas @p e.
12825  *
12826  * This function is meant to be using in conjunction with
12827  * evas_object_key_grab()/evas_object_key_ungrab(). Go check their
12828  * documentation for more information.
12829  *
12830  * @see evas_key_modifier_add
12831  * @see evas_key_modifier_get
12832  * @see evas_key_modifier_on
12833  * @see evas_key_modifier_off
12834  * @see evas_key_modifier_is_set
12835  * @see evas_object_key_grab
12836  * @see evas_object_key_ungrab
12837  */
12838 EAPI Evas_Modifier_Mask   evas_key_modifier_mask_get(const Evas *e, const char *keyname) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2);
12839
12840 /**
12841  * Requests @p keyname key events be directed to @p obj.
12842  *
12843  * @param obj the object to direct @p keyname events to.
12844  * @param keyname the key to request events for.
12845  * @param modifiers a mask of modifiers that must be present to
12846  * trigger the event.
12847  * @param not_modifiers a mask of modifiers that must @b not be present
12848  * to trigger the event.
12849  * @param exclusive request that the @p obj is the only object
12850  * receiving the @p keyname events.
12851  * @return @c EINA_TRUE, if the call succeeded, @c EINA_FALSE otherwise.
12852  *
12853  * Key grabs allow one or more objects to receive key events for
12854  * specific key strokes even if other objects have focus. Whenever a
12855  * key is grabbed, only the objects grabbing it will get the events
12856  * for the given keys.
12857  *
12858  * @p keyname is a platform dependent symbolic name for the key
12859  * pressed (see @ref Evas_Keys for more information).
12860  *
12861  * @p modifiers and @p not_modifiers are bit masks of all the
12862  * modifiers that must and mustn't, respectively, be pressed along
12863  * with @p keyname key in order to trigger this new key
12864  * grab. Modifiers can be things such as Shift and Ctrl as well as
12865  * user defined types via evas_key_modifier_add(). Retrieve them with
12866  * evas_key_modifier_mask_get() or use @c 0 for empty masks.
12867  *
12868  * @p exclusive will make the given object the only one permitted to
12869  * grab the given key. If given @c EINA_TRUE, subsequent calls on this
12870  * function with different @p obj arguments will fail, unless the key
12871  * is ungrabbed again.
12872  *
12873  * Example code follows.
12874  * @dontinclude evas-events.c
12875  * @skip if (d.focus)
12876  * @until else
12877  *
12878  * See the full example @ref Example_Evas_Events "here".
12879  *
12880  * @warning Providing impossible modifier sets creates undefined behavior
12881  *
12882  * @see evas_object_key_ungrab
12883  * @see evas_object_focus_set
12884  * @see evas_object_focus_get
12885  * @see evas_focus_get
12886  * @see evas_key_modifier_add
12887  */
12888 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);
12889
12890 /**
12891  * Removes the grab on @p keyname key events by @p obj.
12892  *
12893  * @param obj the object that has an existing key grab.
12894  * @param keyname the key the grab is set for.
12895  * @param modifiers a mask of modifiers that must be present to
12896  * trigger the event.
12897  * @param not_modifiers a mask of modifiers that must not not be
12898  * present to trigger the event.
12899  *
12900  * Removes a key grab on @p obj if @p keyname, @p modifiers, and @p
12901  * not_modifiers match.
12902  *
12903  * Example code follows.
12904  * @dontinclude evas-events.c
12905  * @skip got here by key grabs
12906  * @until }
12907  *
12908  * See the full example @ref Example_Evas_Events "here".
12909  *
12910  * @see evas_object_key_grab
12911  * @see evas_object_focus_set
12912  * @see evas_object_focus_get
12913  * @see evas_focus_get
12914  */
12915 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);
12916
12917 /**
12918  * @}
12919  */
12920
12921 /**
12922  * @defgroup Evas_Touch_Point_List Touch Point List Functions
12923  *
12924  * Functions to get information of touched points in the Evas.
12925  *
12926  * Evas maintains list of touched points on the canvas. Each point has
12927  * its co-ordinates, id and state. You can get the number of touched
12928  * points and information of each point using evas_touch_point_list
12929  * functions.
12930  *
12931  * @ingroup Evas_Canvas
12932  */
12933
12934 /**
12935  * @addtogroup Evas_Touch_Point_List
12936  * @{
12937  */
12938
12939 /**
12940  * Get the number of touched point in the evas.
12941  *
12942  * @param e The pointer to the Evas canvas.
12943  * @return The number of touched point on the evas.
12944  *
12945  * New touched point is added to the list whenever touching the evas
12946  * and point is removed whenever removing touched point from the evas.
12947  *
12948  * Example:
12949  * @code
12950  * extern Evas *evas;
12951  * int count;
12952  *
12953  * count = evas_touch_point_list_count(evas);
12954  * printf("The count of touch points: %i\n", count);
12955  * @endcode
12956  *
12957  * @see evas_touch_point_list_nth_xy_get()
12958  * @see evas_touch_point_list_nth_id_get()
12959  * @see evas_touch_point_list_nth_state_get()
12960  */
12961 EAPI unsigned int           evas_touch_point_list_count(Evas *e) EINA_ARG_NONNULL(1);
12962
12963 /**
12964  * This function returns the nth touch point's co-ordinates.
12965  *
12966  * @param e The pointer to the Evas canvas.
12967  * @param n The number of the touched point (0 being the first).
12968  * @param x The pointer to a Evas_Coord to be filled in.
12969  * @param y The pointer to a Evas_Coord to be filled in.
12970  *
12971  * Touch point's co-ordinates is updated whenever moving that point
12972  * on the canvas.
12973  *
12974  * Example:
12975  * @code
12976  * extern Evas *evas;
12977  * Evas_Coord x, y;
12978  *
12979  * if (evas_touch_point_list_count(evas))
12980  *   {
12981  *      evas_touch_point_nth_xy_get(evas, 0, &x, &y);
12982  *      printf("The first touch point's co-ordinate: (%i, %i)\n", x, y);
12983  *   }
12984  * @endcode
12985  *
12986  * @see evas_touch_point_list_count()
12987  * @see evas_touch_point_list_nth_id_get()
12988  * @see evas_touch_point_list_nth_state_get()
12989  */
12990 EAPI void                   evas_touch_point_list_nth_xy_get(Evas *e, unsigned int n, Evas_Coord *x, Evas_Coord *y) EINA_ARG_NONNULL(1);
12991
12992 /**
12993  * This function returns the @p id of nth touch point.
12994  *
12995  * @param e The pointer to the Evas canvas.
12996  * @param n The number of the touched point (0 being the first).
12997  * @return id of nth touch point, if the call succeeded, -1 otherwise.
12998  *
12999  * The point which comes from Mouse Event has @p id 0 and The point
13000  * which comes from Multi Event has @p id that is same as Multi
13001  * Event's device id.
13002  *
13003  * Example:
13004  * @code
13005  * extern Evas *evas;
13006  * int id;
13007  *
13008  * if (evas_touch_point_list_count(evas))
13009  *   {
13010  *      id = evas_touch_point_nth_id_get(evas, 0);
13011  *      printf("The first touch point's id: %i\n", id);
13012  *   }
13013  * @endcode
13014  *
13015  * @see evas_touch_point_list_count()
13016  * @see evas_touch_point_list_nth_xy_get()
13017  * @see evas_touch_point_list_nth_state_get()
13018  */
13019 EAPI int                    evas_touch_point_list_nth_id_get(Evas *e, unsigned int n) EINA_ARG_NONNULL(1);
13020
13021 /**
13022  * This function returns the @p state of nth touch point.
13023  *
13024  * @param e The pointer to the Evas canvas.
13025  * @param n The number of the touched point (0 being the first).
13026  * @return @p state of nth touch point, if the call succeeded,
13027  *         EVAS_TOUCH_POINT_CANCEL otherwise.
13028  *
13029  * The point's @p state is EVAS_TOUCH_POINT_DOWN when pressed,
13030  * EVAS_TOUCH_POINT_STILL when the point is not moved after pressed,
13031  * EVAS_TOUCH_POINT_MOVE when moved at least once after pressed and
13032  * EVAS_TOUCH_POINT_UP when released.
13033  *
13034  * Example:
13035  * @code
13036  * extern Evas *evas;
13037  * Evas_Touch_Point_State state;
13038  *
13039  * if (evas_touch_point_list_count(evas))
13040  *   {
13041  *      state = evas_touch_point_nth_state_get(evas, 0);
13042  *      printf("The first touch point's state: %i\n", state);
13043  *   }
13044  * @endcode
13045  *
13046  * @see evas_touch_point_list_count()
13047  * @see evas_touch_point_list_nth_xy_get()
13048  * @see evas_touch_point_list_nth_id_get()
13049  */
13050 EAPI Evas_Touch_Point_State evas_touch_point_list_nth_state_get(Evas *e, unsigned int n) EINA_ARG_NONNULL(1);
13051
13052 /**
13053  * @}
13054  */
13055
13056 #ifdef __cplusplus
13057 }
13058 #endif
13059
13060 #endif