evas: don't clip the clipper.
[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 6
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 and needs to request its pixels.
7141  *
7142  * @param obj The given image object.
7143  * @param dirty Whether the image is dirty.
7144  *
7145  * This function will only properly work if a pixels get callback has been set.
7146  *
7147  * @warning use this function if you really know what you are doing.
7148  *
7149  * @see evas_object_image_pixels_get_callback_set()
7150  */
7151 EAPI void                          evas_object_image_pixels_dirty_set(Evas_Object *obj, Eina_Bool dirty) EINA_ARG_NONNULL(1);
7152
7153 /**
7154  * Retrieves whether the given image object is dirty (needs to be redrawn).
7155  *
7156  * @param obj The given image object.
7157  * @return Whether the image is dirty.
7158  */
7159 EAPI Eina_Bool                     evas_object_image_pixels_dirty_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
7160
7161 /**
7162  * Set the DPI resolution of an image object's source image.
7163  *
7164  * @param obj The given canvas pointer.
7165  * @param dpi The new DPI resolution.
7166  *
7167  * This function sets the DPI resolution of a given loaded canvas
7168  * image. Most useful for the SVG image loader.
7169  *
7170  * @see evas_object_image_load_dpi_get()
7171  */
7172 EAPI void                          evas_object_image_load_dpi_set(Evas_Object *obj, double dpi) EINA_ARG_NONNULL(1);
7173
7174 /**
7175  * Get the DPI resolution of a loaded image object in the canvas.
7176  *
7177  * @param obj The given canvas pointer.
7178  * @return The DPI resolution of the given canvas image.
7179  *
7180  * This function returns the DPI resolution of the given canvas image.
7181  *
7182  * @see evas_object_image_load_dpi_set() for more details
7183  */
7184 EAPI double                        evas_object_image_load_dpi_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
7185
7186 /**
7187  * Set the size of a given image object's source image, when loading
7188  * it.
7189  *
7190  * @param obj The given canvas object.
7191  * @param w The new width of the image's load size.
7192  * @param h The new height of the image's load size.
7193  *
7194  * This function sets a new (loading) size for the given canvas
7195  * image.
7196  *
7197  * @see evas_object_image_load_size_get()
7198  */
7199 EAPI void                          evas_object_image_load_size_set(Evas_Object *obj, int w, int h) EINA_ARG_NONNULL(1);
7200
7201 /**
7202  * Get the size of a given image object's source image, when loading
7203  * it.
7204  *
7205  * @param obj The given image object.
7206  * @param w Where to store the new width of the image's load size.
7207  * @param h Where to store the new height of the image's load size.
7208  *
7209  * @note Use @c NULL pointers on the size components you're not
7210  * interested in: they'll be ignored by the function.
7211  *
7212  * @see evas_object_image_load_size_set() for more details
7213  */
7214 EAPI void                          evas_object_image_load_size_get(const Evas_Object *obj, int *w, int *h) EINA_ARG_NONNULL(1);
7215
7216 /**
7217  * Set the scale down factor of a given image object's source image,
7218  * when loading it.
7219  *
7220  * @param obj The given image object pointer.
7221  * @param scale_down The scale down factor.
7222  *
7223  * This function sets the scale down factor of a given canvas
7224  * image. Most useful for the SVG image loader.
7225  *
7226  * @see evas_object_image_load_scale_down_get()
7227  */
7228 EAPI void                          evas_object_image_load_scale_down_set(Evas_Object *obj, int scale_down) EINA_ARG_NONNULL(1);
7229
7230 /**
7231  * get the scale down factor of a given image object's source image,
7232  * when loading it.
7233  *
7234  * @param obj The given image object pointer.
7235  *
7236  * @see evas_object_image_load_scale_down_set() for more details
7237  */
7238 EAPI int                           evas_object_image_load_scale_down_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
7239
7240 /**
7241  * Inform a given image object to load a selective region of its
7242  * source image.
7243  *
7244  * @param obj The given image object pointer.
7245  * @param x X-offset of the region to be loaded.
7246  * @param y Y-offset of the region to be loaded.
7247  * @param w Width of the region to be loaded.
7248  * @param h Height of the region to be loaded.
7249  *
7250  * This function is useful when one is not showing all of an image's
7251  * area on its image object.
7252  *
7253  * @note The image loader for the image format in question has to
7254  * support selective region loading in order to this function to take
7255  * effect.
7256  *
7257  * @see evas_object_image_load_region_get()
7258  */
7259 EAPI void                          evas_object_image_load_region_set(Evas_Object *obj, int x, int y, int w, int h) EINA_ARG_NONNULL(1);
7260
7261 /**
7262  * Retrieve the coordinates of a given image object's selective
7263  * (source image) load region.
7264  *
7265  * @param obj The given image object pointer.
7266  * @param x Where to store the X-offset of the region to be loaded.
7267  * @param y Where to store the Y-offset of the region to be loaded.
7268  * @param w Where to store the width of the region to be loaded.
7269  * @param h Where to store the height of the region to be loaded.
7270  *
7271  * @note Use @c NULL pointers on the coordinates you're not interested
7272  * in: they'll be ignored by the function.
7273  *
7274  * @see evas_object_image_load_region_get()
7275  */
7276 EAPI void                          evas_object_image_load_region_get(const Evas_Object *obj, int *x, int *y, int *w, int *h) EINA_ARG_NONNULL(1);
7277
7278 /**
7279  * Define if the orientation information in the image file should be honored.
7280  *
7281  * @param obj The given image object pointer.
7282  * @param enable @c EINA_TRUE means that it should honor the orientation information
7283  * @since 1.1
7284  */
7285 EAPI void                          evas_object_image_load_orientation_set(Evas_Object *obj, Eina_Bool enable) EINA_ARG_NONNULL(1);
7286
7287 /**
7288  * Get if the orientation information in the image file should be honored.
7289  *
7290  * @param obj The given image object pointer.
7291  * @since 1.1
7292  */
7293 EAPI Eina_Bool                     evas_object_image_load_orientation_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
7294
7295 /**
7296  * Set the colorspace of a given image of the canvas.
7297  *
7298  * @param obj The given image object pointer.
7299  * @param cspace The new color space.
7300  *
7301  * This function sets the colorspace of given canvas image.
7302  *
7303  */
7304 EAPI void                          evas_object_image_colorspace_set(Evas_Object *obj, Evas_Colorspace cspace) EINA_ARG_NONNULL(1);
7305
7306 /**
7307  * Get the colorspace of a given image of the canvas.
7308  *
7309  * @param obj The given image object pointer.
7310  * @return The colorspace of the image.
7311  *
7312  * This function returns the colorspace of given canvas image.
7313  *
7314  */
7315 EAPI Evas_Colorspace               evas_object_image_colorspace_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
7316
7317 /**
7318  * Get the support state of a given image
7319  *
7320  * @param obj The given image object pointer
7321  * @return The region support state
7322  * @since 1.2
7323  *
7324  * This function returns the state of the region support of given image
7325  */
7326 EAPI Eina_Bool                     evas_object_image_region_support_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
7327
7328 /**
7329  * Set the native surface of a given image of the canvas
7330  *
7331  * @param obj The given canvas pointer.
7332  * @param surf The new native surface.
7333  *
7334  * This function sets a native surface of a given canvas image.
7335  *
7336  */
7337 EAPI void                          evas_object_image_native_surface_set(Evas_Object *obj, Evas_Native_Surface *surf) EINA_ARG_NONNULL(1, 2);
7338
7339 /**
7340  * Get the native surface of a given image of the canvas
7341  *
7342  * @param obj The given canvas pointer.
7343  * @return The native surface of the given canvas image.
7344  *
7345  * This function returns the native surface of a given canvas image.
7346  *
7347  */
7348 EAPI Evas_Native_Surface          *evas_object_image_native_surface_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
7349
7350 /**
7351  * Set the video surface linked to a given image of the canvas
7352  *
7353  * @param obj The given canvas pointer.
7354  * @param surf The new video surface.
7355  * @since 1.1
7356  *
7357  * This function link a video surface to a given canvas image.
7358  *
7359  */
7360 EAPI void                          evas_object_image_video_surface_set(Evas_Object *obj, Evas_Video_Surface *surf) EINA_ARG_NONNULL(1);
7361
7362 /**
7363  * Get the video surface linekd to a given image of the canvas
7364  *
7365  * @param obj The given canvas pointer.
7366  * @return The video surface of the given canvas image.
7367  * @since 1.1
7368  *
7369  * This function returns the video surface linked to a given canvas image.
7370  *
7371  */
7372 EAPI const Evas_Video_Surface     *evas_object_image_video_surface_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
7373
7374 /**
7375  * Set the scale hint of a given image of the canvas.
7376  *
7377  * @param obj The given image object pointer.
7378  * @param hint The scale hint, a value in
7379  * #Evas_Image_Scale_Hint.
7380  *
7381  * This function sets the scale hint value of the given image object
7382  * in the canvas, which will affect how Evas is to cache scaled
7383  * versions of its original source image.
7384  *
7385  * @see evas_object_image_scale_hint_get()
7386  */
7387 EAPI void                          evas_object_image_scale_hint_set(Evas_Object *obj, Evas_Image_Scale_Hint hint) EINA_ARG_NONNULL(1);
7388
7389 /**
7390  * Get the scale hint of a given image of the canvas.
7391  *
7392  * @param obj The given image object pointer.
7393  * @return The scale hint value set on @p obj, a value in
7394  * #Evas_Image_Scale_Hint.
7395  *
7396  * This function returns the scale hint value of the given image
7397  * object of the canvas.
7398  *
7399  * @see evas_object_image_scale_hint_set() for more details.
7400  */
7401 EAPI Evas_Image_Scale_Hint         evas_object_image_scale_hint_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
7402
7403 /**
7404  * Set the content hint setting of a given image object of the canvas.
7405  *
7406  * @param obj The given canvas pointer.
7407  * @param hint The content hint value, one of the
7408  * #Evas_Image_Content_Hint ones.
7409  *
7410  * This function sets the content hint value of the given image of the
7411  * canvas. For example, if you're on the GL engine and your driver
7412  * implementation supports it, setting this hint to
7413  * #EVAS_IMAGE_CONTENT_HINT_DYNAMIC will make it need @b zero copies
7414  * at texture upload time, which is an "expensive" operation.
7415  *
7416  * @see evas_object_image_content_hint_get()
7417  */
7418 EAPI void                          evas_object_image_content_hint_set(Evas_Object *obj, Evas_Image_Content_Hint hint) EINA_ARG_NONNULL(1);
7419
7420 /**
7421  * Get the content hint setting of a given image object of the canvas.
7422  *
7423  * @param obj The given canvas pointer.
7424  * @return hint The content hint value set on it, one of the
7425  * #Evas_Image_Content_Hint ones (#EVAS_IMAGE_CONTENT_HINT_NONE means
7426  * an error).
7427  *
7428  * This function returns the content hint value of the given image of
7429  * the canvas.
7430  *
7431  * @see evas_object_image_content_hint_set()
7432  */
7433 EAPI Evas_Image_Content_Hint       evas_object_image_content_hint_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
7434
7435 /**
7436  * Enable an image to be used as an alpha mask.
7437  *
7438  * This will set any flags, and discard any excess image data not used as an
7439  * alpha mask.
7440  *
7441  * Note there is little point in using a image as alpha mask unless it has an
7442  * alpha channel.
7443  *
7444  * @param obj Object to use as an alpha mask.
7445  * @param ismask Use image as alphamask, must be true.
7446  */
7447 EAPI void                          evas_object_image_alpha_mask_set(Evas_Object *obj, Eina_Bool ismask) EINA_ARG_NONNULL(1);
7448
7449 /**
7450  * Set the source object on an image object to used as a @b proxy.
7451  *
7452  * @param obj Proxy (image) object.
7453  * @param src Source object to use for the proxy.
7454  * @return @c EINA_TRUE on success, @c EINA_FALSE on error.
7455  *
7456  * If an image object is set to behave as a @b proxy, it will mirror
7457  * the rendering contents of a given @b source object in its drawing
7458  * region, without affecting that source in any way. The source must
7459  * be another valid Evas object. Other effects may be applied to the
7460  * proxy, such as a map (see evas_object_map_set()) to create a
7461  * reflection of the original object (for example).
7462  *
7463  * Any existing source object on @p obj will be removed after this
7464  * call. Setting @p src to @c NULL clears the proxy object (not in
7465  * "proxy state" anymore).
7466  *
7467  * @warning You cannot set a proxy as another proxy's source.
7468  *
7469  * @see evas_object_image_source_get()
7470  * @see evas_object_image_source_unset()
7471  */
7472 EAPI Eina_Bool                     evas_object_image_source_set(Evas_Object *obj, Evas_Object *src) EINA_ARG_NONNULL(1);
7473
7474 /**
7475  * Get the current source object of an image object.
7476  *
7477  * @param obj Image object
7478  * @return Source object (if any), or @c NULL, if not in "proxy mode"
7479  * (or on errors).
7480  *
7481  * @see evas_object_image_source_set() for more details
7482  */
7483 EAPI Evas_Object                  *evas_object_image_source_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
7484
7485 /**
7486  * Clear the source object on a proxy image object.
7487  *
7488  * @param obj Image object to clear source of.
7489  * @return @c EINA_TRUE on success, @c EINA_FALSE on error.
7490  *
7491  * This is equivalent to calling evas_object_image_source_set() with a
7492  * @c NULL source.
7493  */
7494 EAPI Eina_Bool                     evas_object_image_source_unset(Evas_Object *obj) EINA_ARG_NONNULL(1);
7495
7496 /**
7497  * Check if a file extension may be supported by @ref Evas_Object_Image.
7498  *
7499  * @param file The file to check
7500  * @return @c EINA_TRUE if we may be able to open it, @c EINA_FALSE if it's
7501  * unlikely.
7502  * @since 1.1
7503  *
7504  * If file is a Eina_Stringshare, use directly @ref evas_object_image_extension_can_load_fast_get.
7505  *
7506  * This functions is threadsafe.
7507  */
7508 EAPI Eina_Bool                     evas_object_image_extension_can_load_get(const char *file);
7509
7510 /**
7511  * Check if a file extension may be supported by @ref Evas_Object_Image.
7512  *
7513  * @param file The file to check, it should be an Eina_Stringshare.
7514  * @return @c EINA_TRUE if we may be able to open it, @c EINA_FALSE if it's
7515  * unlikely.
7516  * @since 1.1
7517  *
7518  * This functions is threadsafe.
7519  */
7520 EAPI Eina_Bool                     evas_object_image_extension_can_load_fast_get(const char *file);
7521
7522 /**
7523  * Check if an image object can be animated (have multiple frames)
7524  *
7525  * @param obj Image object
7526  * @return whether obj support animation
7527  *
7528  * This returns if the image file of an image object is capable of animation
7529  * such as an animated gif file might. This is only useful to be called once
7530  * the image object file has been set.
7531  *
7532  * Example:
7533  * @code
7534  * extern Evas_Object *obj;
7535  *
7536  * if (evas_object_image_animated_get(obj))
7537  *   {
7538  *     int frame_count;
7539  *     int loop_count;
7540  *     Evas_Image_Animated_Loop_Hint loop_type;
7541  *     double duration;
7542  *
7543  *     frame_count = evas_object_image_animated_frame_count_get(obj);
7544  *     printf("This image has %d frames\n",frame_count);
7545  *
7546  *     duration = evas_object_image_animated_frame_duration_get(obj,1,0);
7547  *     printf("Frame 1's duration is %f. You had better set object's frame to 2 after this duration using timer\n");
7548  *
7549  *     loop_count = evas_object_image_animated_loop_count_get(obj);
7550  *     printf("loop count is %d. You had better run loop %d times\n",loop_count,loop_count);
7551  *
7552  *     loop_type = evas_object_image_animated_loop_type_get(obj);
7553  *     if (loop_type == EVAS_IMAGE_ANIMATED_HINT_LOOP)
7554  *       printf("You had better set frame like 1->2->3->1->2->3...\n");
7555  *     else if (loop_type == EVAS_IMAGE_ANIMATED_HINT_PINGPONG)
7556  *       printf("You had better set frame like 1->2->3->2->1->2...\n");
7557  *     else
7558  *       printf("Unknown loop type\n");
7559  *
7560  *     evas_object_image_animated_frame_set(obj,1);
7561  *     printf("You set image object's frame to 1. You can see frame 1\n");
7562  *   }
7563  * @endcode
7564  *
7565  * @see evas_object_image_animated_get()
7566  * @see evas_object_image_animated_frame_count_get()
7567  * @see evas_object_image_animated_loop_type_get()
7568  * @see evas_object_image_animated_loop_count_get()
7569  * @see evas_object_image_animated_frame_duration_get()
7570  * @see evas_object_image_animated_frame_set()
7571  * @since 1.1
7572  */
7573 EAPI Eina_Bool                     evas_object_image_animated_get(const Evas_Object *obj);
7574
7575 /**
7576  * Get the total number of frames of the image object.
7577  *
7578  * @param obj Image object
7579  * @return The number of frames
7580  *
7581  * This returns total number of frames the image object supports (if animated)
7582  *
7583  * @see evas_object_image_animated_get()
7584  * @see evas_object_image_animated_frame_count_get()
7585  * @see evas_object_image_animated_loop_type_get()
7586  * @see evas_object_image_animated_loop_count_get()
7587  * @see evas_object_image_animated_frame_duration_get()
7588  * @see evas_object_image_animated_frame_set()
7589  * @since 1.1
7590  */
7591 EAPI int                           evas_object_image_animated_frame_count_get(const Evas_Object *obj);
7592
7593 /**
7594  * Get the kind of looping the image object does.
7595  *
7596  * @param obj Image object
7597  * @return Loop type of the image object
7598  *
7599  * This returns the kind of looping the image object wants to do.
7600  *
7601  * If it returns EVAS_IMAGE_ANIMATED_HINT_LOOP, you should display frames in a sequence like:
7602  * 1->2->3->1->2->3->1...
7603  * If it returns EVAS_IMAGE_ANIMATED_HINT_PINGPONG, it is better to
7604  * display frames in a sequence like: 1->2->3->2->1->2->3->1...
7605  *
7606  * The default type is EVAS_IMAGE_ANIMATED_HINT_LOOP.
7607  *
7608  * @see evas_object_image_animated_get()
7609  * @see evas_object_image_animated_frame_count_get()
7610  * @see evas_object_image_animated_loop_type_get()
7611  * @see evas_object_image_animated_loop_count_get()
7612  * @see evas_object_image_animated_frame_duration_get()
7613  * @see evas_object_image_animated_frame_set()
7614  * @since 1.1
7615  */
7616 EAPI Evas_Image_Animated_Loop_Hint evas_object_image_animated_loop_type_get(const Evas_Object *obj);
7617
7618 /**
7619  * Get the number times the animation of the object loops.
7620  *
7621  * @param obj Image object
7622  * @return The number of loop of an animated image object
7623  *
7624  * This returns loop count of image. The loop count is the number of times
7625  * the animation will play fully from first to last frame until the animation
7626  * should stop (at the final frame).
7627  *
7628  * If 0 is returned, then looping should happen indefinitely (no limit to
7629  * the number of times it loops).
7630  *
7631  * @see evas_object_image_animated_get()
7632  * @see evas_object_image_animated_frame_count_get()
7633  * @see evas_object_image_animated_loop_type_get()
7634  * @see evas_object_image_animated_loop_count_get()
7635  * @see evas_object_image_animated_frame_duration_get()
7636  * @see evas_object_image_animated_frame_set()
7637  * @since 1.1
7638  */
7639 EAPI int                           evas_object_image_animated_loop_count_get(const Evas_Object *obj);
7640
7641 /**
7642  * Get the duration of a sequence of frames.
7643  *
7644  * @param obj Image object
7645  * @param start_frame The first frame
7646  * @param fram_num Number of frames in the sequence
7647  *
7648  * This returns total duration that the specified sequence of frames should
7649  * take in seconds.
7650  *
7651  * If you set start_frame to 1 and frame_num 0, you get frame 1's duration
7652  * If you set start_frame to 1 and frame_num 1, you get frame 1's duration +
7653  * frame2's duration
7654  *
7655  * @see evas_object_image_animated_get()
7656  * @see evas_object_image_animated_frame_count_get()
7657  * @see evas_object_image_animated_loop_type_get()
7658  * @see evas_object_image_animated_loop_count_get()
7659  * @see evas_object_image_animated_frame_duration_get()
7660  * @see evas_object_image_animated_frame_set()
7661  * @since 1.1
7662  */
7663 EAPI double                        evas_object_image_animated_frame_duration_get(const Evas_Object *obj, int start_frame, int fram_num);
7664
7665 /**
7666  * Set the frame to current frame of an image object
7667  *
7668  * @param obj The given image object.
7669  * @param frame_num The index of current frame
7670  *
7671  * This set image object's current frame to frame_num with 1 being the first
7672  * frame.
7673  *
7674  * @see evas_object_image_animated_get()
7675  * @see evas_object_image_animated_frame_count_get()
7676  * @see evas_object_image_animated_loop_type_get()
7677  * @see evas_object_image_animated_loop_count_get()
7678  * @see evas_object_image_animated_frame_duration_get()
7679  * @see evas_object_image_animated_frame_set()
7680  * @since 1.1
7681  */
7682 EAPI void                          evas_object_image_animated_frame_set(Evas_Object *obj, int frame_num);
7683 /**
7684  * @}
7685  */
7686
7687 /**
7688  * @defgroup Evas_Object_Text Text Object Functions
7689  *
7690  * Functions that operate on single line, single style text objects.
7691  *
7692  * For multiline and multiple style text, see @ref Evas_Object_Textblock.
7693  *
7694  * See some @ref Example_Evas_Text "examples" on this group of functions.
7695  *
7696  * @warning We don't guarantee any proper results if you create a Text object
7697  * without setting the evas engine.
7698  *
7699  * @ingroup Evas_Object_Specific
7700  */
7701
7702 /**
7703  * @addtogroup Evas_Object_Text
7704  * @{
7705  */
7706
7707 /* basic styles (4 bits allocated use 0->10 now, 5 left) */
7708 #define EVAS_TEXT_STYLE_MASK_BASIC 0xf
7709
7710 /**
7711  * Text style type creation macro. Use style types on the 's'
7712  * arguments, being 'x' your style variable.
7713  */
7714 #define EVAS_TEXT_STYLE_BASIC_SET(x, s) \
7715   do { x = ((x) & ~EVAS_TEXT_STYLE_MASK_BASIC) | (s); } while (0)
7716
7717 #define EVAS_TEXT_STYLE_MASK_SHADOW_DIRECTION (0x7 << 4)
7718
7719 /**
7720  * Text style type creation macro. This one will impose shadow
7721  * directions on the style type variable -- use the @c
7722  * EVAS_TEXT_STYLE_SHADOW_DIRECTION_* values on 's', incrementally.
7723  */
7724 #define EVAS_TEXT_STYLE_SHADOW_DIRECTION_SET(x, s) \
7725   do { x = ((x) & ~EVAS_TEXT_STYLE_MASK_SHADOW_DIRECTION) | (s); } while (0)
7726
7727 typedef enum _Evas_Text_Style_Type
7728 {
7729    EVAS_TEXT_STYLE_PLAIN,      /**< plain, standard text */
7730    EVAS_TEXT_STYLE_SHADOW,      /**< text with shadow underneath */
7731    EVAS_TEXT_STYLE_OUTLINE,      /**< text with an outline */
7732    EVAS_TEXT_STYLE_SOFT_OUTLINE,      /**< text with a soft outline */
7733    EVAS_TEXT_STYLE_GLOW,      /**< text with a glow effect */
7734    EVAS_TEXT_STYLE_OUTLINE_SHADOW,      /**< text with both outline and shadow effects */
7735    EVAS_TEXT_STYLE_FAR_SHADOW,      /**< text with (far) shadow underneath */
7736    EVAS_TEXT_STYLE_OUTLINE_SOFT_SHADOW,      /**< text with outline and soft shadow effects combined */
7737    EVAS_TEXT_STYLE_SOFT_SHADOW,      /**< text with (soft) shadow underneath */
7738    EVAS_TEXT_STYLE_FAR_SOFT_SHADOW,      /**< text with (far soft) shadow underneath */
7739
7740    /* OR these to modify shadow direction (3 bits needed) */
7741    EVAS_TEXT_STYLE_SHADOW_DIRECTION_BOTTOM_RIGHT = (0x0 << 4),      /**< shadow growing to bottom right */
7742    EVAS_TEXT_STYLE_SHADOW_DIRECTION_BOTTOM = (0x1 << 4),            /**< shadow growing to the bottom */
7743    EVAS_TEXT_STYLE_SHADOW_DIRECTION_BOTTOM_LEFT = (0x2 << 4),       /**< shadow growing to bottom left */
7744    EVAS_TEXT_STYLE_SHADOW_DIRECTION_LEFT = (0x3 << 4),              /**< shadow growing to the left */
7745    EVAS_TEXT_STYLE_SHADOW_DIRECTION_TOP_LEFT = (0x4 << 4),          /**< shadow growing to top left */
7746    EVAS_TEXT_STYLE_SHADOW_DIRECTION_TOP = (0x5 << 4),               /**< shadow growing to the top */
7747    EVAS_TEXT_STYLE_SHADOW_DIRECTION_TOP_RIGHT = (0x6 << 4),         /**< shadow growing to top right */
7748    EVAS_TEXT_STYLE_SHADOW_DIRECTION_RIGHT = (0x7 << 4)             /**< shadow growing to the right */
7749 } 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 */
7750
7751 /**
7752  * Creates a new text object on the provided canvas.
7753  *
7754  * @param e The canvas to create the text object on.
7755  * @return @c NULL on error, a pointer to a new text object on
7756  * success.
7757  *
7758  * Text objects are for simple, single line text elements. If you want
7759  * more elaborated text blocks, see @ref Evas_Object_Textblock.
7760  *
7761  * @see evas_object_text_font_source_set()
7762  * @see evas_object_text_font_set()
7763  * @see evas_object_text_text_set()
7764  */
7765 EAPI Evas_Object         *evas_object_text_add(Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
7766
7767 /**
7768  * Set the font (source) file to be used on a given text object.
7769  *
7770  * @param obj The text object to set font for.
7771  * @param font The font file's path.
7772  *
7773  * This function allows the font file to be explicitly set for a given
7774  * text object, overriding system lookup, which will first occur in
7775  * the given file's contents.
7776  *
7777  * @see evas_object_text_font_get()
7778  */
7779 EAPI void                 evas_object_text_font_source_set(Evas_Object *obj, const char *font) EINA_ARG_NONNULL(1);
7780
7781 /**
7782  * Get the font file's path which is being used on a given text
7783  * object.
7784  *
7785  * @param obj The text object to set font for.
7786  * @return The font file's path.
7787  *
7788  * @see evas_object_text_font_get() for more details
7789  */
7790 EAPI const char          *evas_object_text_font_source_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
7791
7792 /**
7793  * Set the font family and size on a given text object.
7794  *
7795  * @param obj The text object to set font for.
7796  * @param font The font (family) name.
7797  * @param size The font size, in points.
7798  *
7799  * This function allows the font name and size of a text object to be
7800  * set. The @p font string has to follow fontconfig's convention on
7801  * naming fonts, as it's the underlying library used to query system
7802  * fonts by Evas (see the @c fc-list command's output, on your system,
7803  * to get an idea).
7804  *
7805  * @see evas_object_text_font_get()
7806  * @see evas_object_text_font_source_set()
7807  */
7808 EAPI void                 evas_object_text_font_set(Evas_Object *obj, const char *font, Evas_Font_Size size) EINA_ARG_NONNULL(1);
7809
7810 /**
7811  * Retrieve the font family and size in use on a given text object.
7812  *
7813  * @param obj The evas text object to query for font information.
7814  * @param font A pointer to the location to store the font name in.
7815  * @param size A pointer to the location to store the font size in.
7816  *
7817  * This function allows the font name and size of a text object to be
7818  * queried. Be aware that the font name string is still owned by Evas
7819  * and should @b not have free() called on it by the caller of the
7820  * function.
7821  *
7822  * @see evas_object_text_font_set()
7823  */
7824 EAPI void                 evas_object_text_font_get(const Evas_Object *obj, const char **font, Evas_Font_Size *size) EINA_ARG_NONNULL(1);
7825
7826 /**
7827  * Sets the text string to be displayed by the given text object.
7828  *
7829  * @param obj The text object to set text string on.
7830  * @param text Text string to display on it.
7831  *
7832  * @see evas_object_text_text_get()
7833  */
7834 EAPI void                 evas_object_text_text_set(Evas_Object *obj, const char *text) EINA_ARG_NONNULL(1);
7835
7836 /**
7837  * Retrieves the text string currently being displayed by the given
7838  * text object.
7839  *
7840  * @param  obj The given text object.
7841  * @return The text string currently being displayed on it.
7842  *
7843  * @note Do not free() the return value.
7844  *
7845  * @see evas_object_text_text_set()
7846  */
7847 EAPI const char          *evas_object_text_text_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
7848
7849 /**
7850  * @brief Sets the BiDi delimiters used in the textblock.
7851  *
7852  * BiDi delimiters are use for in-paragraph separation of bidi segments. This
7853  * is useful for example in recipients fields of e-mail clients where bidi
7854  * oddities can occur when mixing RTL and LTR.
7855  *
7856  * @param obj The given text object.
7857  * @param delim A null terminated string of delimiters, e.g ",|".
7858  * @since 1.1
7859  */
7860 EAPI void                 evas_object_text_bidi_delimiters_set(Evas_Object *obj, const char *delim);
7861
7862 /**
7863  * @brief Gets the BiDi delimiters used in the textblock.
7864  *
7865  * BiDi delimiters are use for in-paragraph separation of bidi segments. This
7866  * is useful for example in recipients fields of e-mail clients where bidi
7867  * oddities can occur when mixing RTL and LTR.
7868  *
7869  * @param obj The given text object.
7870  * @return A null terminated string of delimiters, e.g ",|". If empty, returns NULL.
7871  * @since 1.1
7872  */
7873 EAPI const char          *evas_object_text_bidi_delimiters_get(const Evas_Object *obj);
7874
7875 EAPI Evas_Coord           evas_object_text_ascent_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
7876 EAPI Evas_Coord           evas_object_text_descent_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
7877 EAPI Evas_Coord           evas_object_text_max_ascent_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
7878 EAPI Evas_Coord           evas_object_text_max_descent_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
7879 EAPI Evas_Coord           evas_object_text_horiz_advance_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
7880 EAPI Evas_Coord           evas_object_text_vert_advance_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
7881 EAPI Evas_Coord           evas_object_text_inset_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
7882
7883 /**
7884  * Retrieve position and dimension information of a character within a text @c Evas_Object.
7885  *
7886  * This function is used to obtain the X, Y, width and height of a the character
7887  * located at @p pos within the @c Evas_Object @p obj. @p obj must be a text object
7888  * as created with evas_object_text_add(). Any of the @c Evas_Coord parameters (@p cx,
7889  * @p cy, @p cw, @p ch) may be @c NULL in which case no value will be assigned to that
7890  * parameter.
7891  *
7892  * @param obj   The text object to retrieve position information for.
7893  * @param pos   The character position to request co-ordinates for.
7894  * @param cx    A pointer to an @c Evas_Coord to store the X value in (can be NULL).
7895  * @param cy    A pointer to an @c Evas_Coord to store the Y value in (can be NULL).
7896  * @param cw    A pointer to an @c Evas_Coord to store the Width value in (can be NULL).
7897  * @param ch    A pointer to an @c Evas_Coord to store the Height value in (can be NULL).
7898  *
7899  * @return @c EINA_FALSE on success, @c EINA_TRUE on error.
7900  */
7901 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);
7902 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);
7903
7904 /**
7905  * Returns the logical position of the last char in the text
7906  * up to the pos given. this is NOT the position of the last char
7907  * because of the possibility of RTL in the text.
7908  */
7909 EAPI int                  evas_object_text_last_up_to_pos(const Evas_Object *obj, Evas_Coord x, Evas_Coord y) EINA_ARG_NONNULL(1);
7910
7911 /**
7912  * Retrieves the style on use on the given text object.
7913  *
7914  * @param obj the given text object to set style on.
7915  * @return the style type in use.
7916  *
7917  * @see evas_object_text_style_set() for more details.
7918  */
7919 EAPI Evas_Text_Style_Type evas_object_text_style_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
7920
7921 /**
7922  * Sets the style to apply on the given text object.
7923  *
7924  * @param obj the given text object to set style on.
7925  * @param type a style type.
7926  *
7927  * Text object styles are one of the values in
7928  * #Evas_Text_Style_Type. Some of those values are combinations of
7929  * more than one style, and some account for the direction of the
7930  * rendering of shadow effects.
7931  *
7932  * @note One may use the helper macros #EVAS_TEXT_STYLE_BASIC_SET and
7933  * #EVAS_TEXT_STYLE_SHADOW_DIRECTION_SET to assemble a style value.
7934  *
7935  * The following figure illustrates the text styles:
7936  *
7937  * @image html text-styles.png
7938  * @image rtf text-styles.png
7939  * @image latex text-styles.eps
7940  *
7941  * @see evas_object_text_style_get()
7942  * @see evas_object_text_shadow_color_set()
7943  * @see evas_object_text_outline_color_set()
7944  * @see evas_object_text_glow_color_set()
7945  * @see evas_object_text_glow2_color_set()
7946  */
7947 EAPI void                 evas_object_text_style_set(Evas_Object *obj, Evas_Text_Style_Type type) EINA_ARG_NONNULL(1);
7948
7949 /**
7950  * Sets the shadow color for the given text object.
7951  *
7952  * @param obj The given Evas text object.
7953  * @param r The red component of the given color.
7954  * @param g The green component of the given color.
7955  * @param b The blue component of the given color.
7956  * @param a The alpha component of the given color.
7957  *
7958  * Shadow effects, which are fading colors decorating the text
7959  * underneath it, will just be shown if the object is set to one of
7960  * the following styles:
7961  *
7962  * - #EVAS_TEXT_STYLE_SHADOW
7963  * - #EVAS_TEXT_STYLE_OUTLINE_SHADOW
7964  * - #EVAS_TEXT_STYLE_FAR_SHADOW
7965  * - #EVAS_TEXT_STYLE_OUTLINE_SOFT_SHADOW
7966  * - #EVAS_TEXT_STYLE_SOFT_SHADOW
7967  * - #EVAS_TEXT_STYLE_FAR_SOFT_SHADOW
7968  *
7969  * One can also change the direction where the shadow grows to, with
7970  * evas_object_text_style_set().
7971  *
7972  * @see evas_object_text_shadow_color_get()
7973  */
7974 EAPI void                 evas_object_text_shadow_color_set(Evas_Object *obj, int r, int g, int b, int a) EINA_ARG_NONNULL(1);
7975
7976 /**
7977  * Retrieves the shadow color for the given text object.
7978  *
7979  * @param obj The given Evas text object.
7980  * @param r Pointer to variable to hold the red component of the given
7981  * color.
7982  * @param g Pointer to variable to hold the green component of the
7983  * given color.
7984  * @param b Pointer to variable to hold the blue component of the
7985  * given color.
7986  * @param a Pointer to variable to hold the alpha component of the
7987  * given color.
7988  *
7989  * @note Use @c NULL pointers on the color components you're not
7990  * interested in: they'll be ignored by the function.
7991  *
7992  * @see evas_object_text_shadow_color_set() for more details.
7993  */
7994 EAPI void                 evas_object_text_shadow_color_get(const Evas_Object *obj, int *r, int *g, int *b, int *a) EINA_ARG_NONNULL(1);
7995
7996 /**
7997  * Sets the glow color for the given text object.
7998  *
7999  * @param obj The given Evas text object.
8000  * @param r The red component of the given color.
8001  * @param g The green component of the given color.
8002  * @param b The blue component of the given color.
8003  * @param a The alpha component of the given color.
8004  *
8005  * Glow effects, which are glowing colors decorating the text's
8006  * surroundings, will just be shown if the object is set to the
8007  * #EVAS_TEXT_STYLE_GLOW style.
8008  *
8009  * @note Glow effects are placed from a short distance of the text
8010  * itself, but no touching it. For glowing effects right on the
8011  * borders of the glyphs, see 'glow 2' effects
8012  * (evas_object_text_glow2_color_set()).
8013  *
8014  * @see evas_object_text_glow_color_get()
8015  */
8016 EAPI void                 evas_object_text_glow_color_set(Evas_Object *obj, int r, int g, int b, int a) EINA_ARG_NONNULL(1);
8017
8018 /**
8019  * Retrieves the glow color for the given text object.
8020  *
8021  * @param obj The given Evas text object.
8022  * @param r Pointer to variable to hold the red component of the given
8023  * color.
8024  * @param g Pointer to variable to hold the green component of the
8025  * given color.
8026  * @param b Pointer to variable to hold the blue component of the
8027  * given color.
8028  * @param a Pointer to variable to hold the alpha component of the
8029  * given color.
8030  *
8031  * @note Use @c NULL pointers on the color components you're not
8032  * interested in: they'll be ignored by the function.
8033  *
8034  * @see evas_object_text_glow_color_set() for more details.
8035  */
8036 EAPI void                 evas_object_text_glow_color_get(const Evas_Object *obj, int *r, int *g, int *b, int *a) EINA_ARG_NONNULL(1);
8037
8038 /**
8039  * Sets the 'glow 2' color for the given text object.
8040  *
8041  * @param obj The given Evas text object.
8042  * @param r The red component of the given color.
8043  * @param g The green component of the given color.
8044  * @param b The blue component of the given color.
8045  * @param a The alpha component of the given color.
8046  *
8047  * 'Glow 2' effects, which are glowing colors decorating the text's
8048  * (immediate) surroundings, will just be shown if the object is set
8049  * to the #EVAS_TEXT_STYLE_GLOW style. See also
8050  * evas_object_text_glow_color_set().
8051  *
8052  * @see evas_object_text_glow2_color_get()
8053  */
8054 EAPI void                 evas_object_text_glow2_color_set(Evas_Object *obj, int r, int g, int b, int a) EINA_ARG_NONNULL(1);
8055
8056 /**
8057  * Retrieves the 'glow 2' color for the given text object.
8058  *
8059  * @param obj The given Evas text object.
8060  * @param r Pointer to variable to hold the red component of the given
8061  * color.
8062  * @param g Pointer to variable to hold the green component of the
8063  * given color.
8064  * @param b Pointer to variable to hold the blue component of the
8065  * given color.
8066  * @param a Pointer to variable to hold the alpha component of the
8067  * given color.
8068  *
8069  * @note Use @c NULL pointers on the color components you're not
8070  * interested in: they'll be ignored by the function.
8071  *
8072  * @see evas_object_text_glow2_color_set() for more details.
8073  */
8074 EAPI void                 evas_object_text_glow2_color_get(const Evas_Object *obj, int *r, int *g, int *b, int *a) EINA_ARG_NONNULL(1);
8075
8076 /**
8077  * Sets the outline color for the given text object.
8078  *
8079  * @param obj The given Evas text object.
8080  * @param r The red component of the given color.
8081  * @param g The green component of the given color.
8082  * @param b The blue component of the given color.
8083  * @param a The alpha component of the given color.
8084  *
8085  * Outline effects (colored lines around text glyphs) will just be
8086  * shown if the object is set to one of the following styles:
8087  * - #EVAS_TEXT_STYLE_OUTLINE
8088  * - #EVAS_TEXT_STYLE_SOFT_OUTLINE
8089  * - #EVAS_TEXT_STYLE_OUTLINE_SHADOW
8090  * - #EVAS_TEXT_STYLE_OUTLINE_SOFT_SHADOW
8091  *
8092  * @see evas_object_text_outline_color_get()
8093  */
8094 EAPI void                 evas_object_text_outline_color_set(Evas_Object *obj, int r, int g, int b, int a) EINA_ARG_NONNULL(1);
8095
8096 /**
8097  * Retrieves the outline color for the given text object.
8098  *
8099  * @param obj The given Evas text object.
8100  * @param r Pointer to variable to hold the red component of the given
8101  * color.
8102  * @param g Pointer to variable to hold the green component of the
8103  * given color.
8104  * @param b Pointer to variable to hold the blue component of the
8105  * given color.
8106  * @param a Pointer to variable to hold the alpha component of the
8107  * given color.
8108  *
8109  * @note Use @c NULL pointers on the color components you're not
8110  * interested in: they'll be ignored by the function.
8111  *
8112  * @see evas_object_text_outline_color_set() for more details.
8113  */
8114 EAPI void                 evas_object_text_outline_color_get(const Evas_Object *obj, int *r, int *g, int *b, int *a) EINA_ARG_NONNULL(1);
8115
8116 /**
8117  * Gets the text style pad of a text object.
8118  *
8119  * @param obj The given text object.
8120  * @param l The left pad (or @c NULL).
8121  * @param r The right pad (or @c NULL).
8122  * @param t The top pad (or @c NULL).
8123  * @param b The bottom pad (or @c NULL).
8124  *
8125  */
8126 EAPI void                 evas_object_text_style_pad_get(const Evas_Object *obj, int *l, int *r, int *t, int *b) EINA_ARG_NONNULL(1);
8127
8128 /**
8129  * Retrieves the direction of the text currently being displayed in the
8130  * text object.
8131  * @param  obj The given evas text object.
8132  * @return the direction of the text
8133  */
8134 EAPI Evas_BiDi_Direction  evas_object_text_direction_get(const Evas_Object *obj) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
8135
8136 /**
8137  * @}
8138  */
8139
8140 /**
8141  * @defgroup Evas_Object_Textblock Textblock Object Functions
8142  *
8143  * Functions used to create and manipulate textblock objects. Unlike
8144  * @ref Evas_Object_Text, these handle complex text, doing multiple
8145  * styles and multiline text based on HTML-like tags. Of these extra
8146  * features will be heavier on memory and processing cost.
8147  *
8148  * @section Evas_Object_Textblock_Tutorial Textblock Object Tutorial
8149  *
8150  * This part explains about the textblock object's API and proper usage.
8151  * The main user of the textblock object is the edje entry object in Edje, so
8152  * that's a good place to learn from, but I think this document is more than
8153  * enough, if it's not, please contact me and I'll update it.
8154  *
8155  * @subsection textblock_intro Introduction
8156  * The textblock objects is, as implied, an object that can show big chunks of
8157  * text. Textblock supports many features including: Text formatting, automatic
8158  * and manual text alignment, embedding items (for example icons) and more.
8159  * Textblock has three important parts, the text paragraphs, the format nodes
8160  * and the cursors.
8161  *
8162  * You can use markup to format text, for example: "<font_size=50>Big!</font_size>".
8163  * You can also put more than one style directive in one tag:
8164  * "<font_size=50 color=#F00>Big and Red!</font_size>".
8165  * Please notice that we used "</font_size>" although the format also included
8166  * color, this is because the first format determines the matching closing tag's
8167  * name. You can also use anonymous tags, like: "<font_size=30>Big</>" which
8168  * just pop any type of format, but it's advised to use the named alternatives
8169  * instead.
8170  *
8171  * @subsection textblock_cursors Textblock Object Cursors
8172  * A textblock Cursor is data type that represents
8173  * a position in a textblock. Each cursor contains information about the
8174  * paragraph it points to, the position in that paragraph and the object itself.
8175  * Cursors register to textblock objects upon creation, this means that once
8176  * you created a cursor, it belongs to a specific obj and you can't for example
8177  * copy a cursor "into" a cursor of a different object. Registered cursors
8178  * also have the added benefit of updating automatically upon textblock changes,
8179  * this means that if you have a cursor pointing to a specific character, it'll
8180  * still point to it even after you change the whole object completely (as long
8181  * as the char was not deleted), this is not possible without updating, because
8182  * as mentioned, each cursor holds a character position. There are many
8183  * functions that handle cursors, just check out the evas_textblock_cursor*
8184  * functions. For creation and deletion of cursors check out:
8185  * @see evas_object_textblock_cursor_new()
8186  * @see evas_textblock_cursor_free()
8187  * @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).
8188  *
8189  * @subsection textblock_paragraphs Textblock Object Paragraphs
8190  * The textblock object is made out of text splitted to paragraphs (delimited
8191  * by the paragraph separation character). Each paragraph has many (or none)
8192  * format nodes associated with it which are responsible for the formatting
8193  * of that paragraph.
8194  *
8195  * @subsection textblock_format_nodes Textblock Object Format Nodes
8196  * As explained in @ref textblock_paragraphs each one of the format nodes
8197  * is associated with a paragraph.
8198  * There are two types of format nodes, visible and invisible:
8199  * Visible: formats that a cursor can point to, i.e formats that
8200  * occupy space, for example: newlines, tabs, items and etc. Some visible items
8201  * are made of two parts, in this case, only the opening tag is visible.
8202  * A closing tag (i.e a \</tag\> tag) should NEVER be visible.
8203  * Invisible: formats that don't occupy space, for example: bold and underline.
8204  * Being able to access format nodes is very important for some uses. For
8205  * example, edje uses the "<a>" format to create links in the text (and pop
8206  * popups above them when clicked). For the textblock object a is just a
8207  * formatting instruction (how to color the text), but edje utilizes the access
8208  * to the format nodes to make it do more.
8209  * For more information, take a look at all the evas_textblock_node_format_*
8210  * functions.
8211  * The translation of "<tag>" tags to actual format is done according to the
8212  * tags defined in the style, see @ref evas_textblock_style_set
8213  *
8214  * @subsection textblock_special_formats Special Formats
8215  * Textblock supports various format directives that can be used in markup. In
8216  * addition to the mentioned format directives, textblock allows creating
8217  * additional format directives using "tags" that can be set in the style see
8218  * @ref evas_textblock_style_set .
8219  *
8220  * Textblock supports the following formats:
8221  * @li font - Font description in fontconfig like format, e.g: "Sans:style=Italic:lang=hi". or "Serif:style=Bold".
8222  * @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".
8223  * @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".
8224  * @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".
8225  * @li lang - Overrides the language defined in "font". E.g: "lang=he" is the same as "font=:lang=he".
8226  * @li font_fallbacks - A comma delimited list of fonts to try if finding the main font fails.
8227  * @li font_size - The font size in points.
8228  * @li font_source - The source of the font, e.g an eet file.
8229  * @li color - Text color in one of the following formats: "#RRGGBB", "#RRGGBBAA", "#RGB", and "#RGBA".
8230  * @li underline_color - color in one of the following formats: "#RRGGBB", "#RRGGBBAA", "#RGB", and "#RGBA".
8231  * @li underline2_color - color in one of the following formats: "#RRGGBB", "#RRGGBBAA", "#RGB", and "#RGBA".
8232  * @li outline_color - color in one of the following formats: "#RRGGBB", "#RRGGBBAA", "#RGB", and "#RGBA".
8233  * @li shadow_color - color in one of the following formats: "#RRGGBB", "#RRGGBBAA", "#RGB", and "#RGBA".
8234  * @li glow_color - color in one of the following formats: "#RRGGBB", "#RRGGBBAA", "#RGB", and "#RGBA".
8235  * @li glow2_color - color in one of the following formats: "#RRGGBB", "#RRGGBBAA", "#RGB", and "#RGBA".
8236  * @li backing_color - color in one of the following formats: "#RRGGBB", "#RRGGBBAA", "#RGB", and "#RGBA".
8237  * @li strikethrough_color - color in one of the following formats: "#RRGGBB", "#RRGGBBAA", "#RGB", and "#RGBA".
8238  * @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%.
8239  * @li valign - Either "top", "bottom", "middle", "center", "baseline", "base", a value between 0.0 and 1.0, or a value between 0% to 100%.
8240  * @li wrap - "word", "char", "mixed", or "none".
8241  * @li left_margin - Either "reset", or a pixel value indicating the margin.
8242  * @li right_margin - Either "reset", or a pixel value indicating the margin.
8243  * @li underline - "on", "off", "single", or "double".
8244  * @li strikethrough - "on" or "off"
8245  * @li backing - "on" or "off"
8246  * @li style - Either "off", "none", "plain", "shadow", "outline", "soft_outline", "outline_shadow", "outline_soft_shadow", "glow", "far_shadow", "soft_shadow", or "far_soft_shadow".
8247  * @li tabstops - Pixel value for tab width.
8248  * @li linesize - Force a line size in pixels.
8249  * @li linerelsize - Either a floating point value or a percentage indicating the wanted size of the line relative to the calculated size.
8250  * @li linegap - Force a line gap in pixels.
8251  * @li linerelgap - Either a floating point value or a percentage indicating the wanted size of the line relative to the calculated size.
8252  * @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.
8253  * @li linefill - Either a float value or percentage indicating how much to fill the line.
8254  * @li ellipsis - Value between 0.0-1.0 to indicate the type of ellipsis, or -1.0 to indicate ellipsis isn't wanted.
8255  * @li password - "on" or "off". This is used to specifically turn replacing chars with the replacement char (i.e password mode) on and off.
8256  *
8257  * @warning We don't guarantee any proper results if you create a Textblock
8258  * object
8259  * without setting the evas engine.
8260  *
8261  * @todo put here some usage examples
8262  *
8263  * @ingroup Evas_Object_Specific
8264  *
8265  * @{
8266  */
8267
8268 typedef struct _Evas_Textblock_Style              Evas_Textblock_Style;
8269 typedef struct _Evas_Textblock_Cursor             Evas_Textblock_Cursor;
8270 /**
8271  * @typedef Evas_Object_Textblock_Node_Format
8272  * A format node.
8273  */
8274 typedef struct _Evas_Object_Textblock_Node_Format Evas_Object_Textblock_Node_Format;
8275 typedef struct _Evas_Textblock_Rectangle          Evas_Textblock_Rectangle;
8276
8277 struct _Evas_Textblock_Rectangle
8278 {
8279    Evas_Coord x, y, w, h;
8280 };
8281
8282 typedef enum _Evas_Textblock_Text_Type
8283 {
8284    EVAS_TEXTBLOCK_TEXT_RAW,
8285    EVAS_TEXTBLOCK_TEXT_PLAIN,
8286    EVAS_TEXTBLOCK_TEXT_MARKUP
8287 } Evas_Textblock_Text_Type;
8288
8289 typedef enum _Evas_Textblock_Cursor_Type
8290 {
8291    EVAS_TEXTBLOCK_CURSOR_UNDER,
8292    EVAS_TEXTBLOCK_CURSOR_BEFORE
8293 } Evas_Textblock_Cursor_Type;
8294
8295 /**
8296  * Adds a textblock to the given evas.
8297  * @param   e The given evas.
8298  * @return  The new textblock object.
8299  */
8300 EAPI Evas_Object                             *evas_object_textblock_add(Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
8301
8302 /**
8303  * Returns the unescaped version of escape.
8304  * @param escape the string to be escaped
8305  * @return the unescaped version of escape
8306  */
8307 EAPI const char                              *evas_textblock_escape_string_get(const char *escape) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
8308
8309 /**
8310  * Returns the escaped version of the string.
8311  * @param string to escape
8312  * @param len_ret the len of the part of the string that was used.
8313  * @return the escaped string.
8314  */
8315 EAPI const char                              *evas_textblock_string_escape_get(const char *string, int *len_ret) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
8316
8317 /**
8318  * Return the unescaped version of the string between start and end.
8319  *
8320  * @param escape_start the start of the string.
8321  * @param escape_end the end of the string.
8322  * @return the unescaped version of the range
8323  */
8324 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);
8325
8326 /**
8327  * Return the plain version of the markup.
8328  *
8329  * Works as if you set the markup to a textblock and then retrieve the plain
8330  * version of the text. i.e: <br> and <\n> will be replaced with \n, &...; with
8331  * the actual char and etc.
8332  *
8333  * @param obj The textblock object to work with. (if @c NULL, tries the
8334  * default).
8335  * @param text The markup text (if @c NULL, return @c NULL).
8336  * @return An allocated plain text version of the markup.
8337  * @since 1.2
8338  */
8339 EAPI char                                    *evas_textblock_text_markup_to_utf8(const Evas_Object *obj, const char *text) EINA_WARN_UNUSED_RESULT EINA_MALLOC;
8340
8341 /**
8342  * Return the markup version of the plain text.
8343  *
8344  * Replaces \\n -\> \<br/\> \\t -\> \<tab/\> and etc. Generally needed before you pass
8345  * plain text to be set in a textblock.
8346  *
8347  * @param obj the textblock object to work with (if @c NULL, it just does the
8348  * default behaviour, i.e with no extra object information).
8349  * @param text The markup text (if @c NULL, return @c NULL).
8350  * @return An allocated plain text version of the markup.
8351  * @since 1.2
8352  */
8353 EAPI char                                    *evas_textblock_text_utf8_to_markup(const Evas_Object *obj, const char *text) EINA_WARN_UNUSED_RESULT EINA_MALLOC;
8354
8355 /**
8356  * Creates a new textblock style.
8357  * @return  The new textblock style.
8358  */
8359 EAPI Evas_Textblock_Style                    *evas_textblock_style_new(void) EINA_WARN_UNUSED_RESULT EINA_MALLOC;
8360
8361 /**
8362  * Destroys a textblock style.
8363  * @param ts The textblock style to free.
8364  */
8365 EAPI void                                     evas_textblock_style_free(Evas_Textblock_Style *ts) EINA_ARG_NONNULL(1);
8366
8367 /**
8368  * Sets the style ts to the style passed as text by text.
8369  * Expected a string consisting of many (or none) tag='format' pairs.
8370  *
8371  * @param ts  the style to set.
8372  * @param text the text to parse - NOT NULL.
8373  * @return Returns no value.
8374  */
8375 EAPI void                                     evas_textblock_style_set(Evas_Textblock_Style *ts, const char *text) EINA_ARG_NONNULL(1);
8376
8377 /**
8378  * Return the text of the style ts.
8379  * @param ts  the style to get it's text.
8380  * @return the text of the style or null on error.
8381  */
8382 EAPI const char                              *evas_textblock_style_get(const Evas_Textblock_Style *ts) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
8383
8384 /**
8385  * Set the objects style to ts.
8386  * @param obj the Evas object to set the style to.
8387  * @param ts  the style to set.
8388  * @return Returns no value.
8389  */
8390 EAPI void                                     evas_object_textblock_style_set(Evas_Object *obj, Evas_Textblock_Style *ts) EINA_ARG_NONNULL(1);
8391
8392 /**
8393  * Return the style of an object.
8394  * @param obj  the object to get the style from.
8395  * @return the style of the object.
8396  */
8397 EAPI const Evas_Textblock_Style              *evas_object_textblock_style_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
8398
8399 /**
8400  * Push ts to the top of the user style stack.
8401  *
8402  * FIXME: API is solid but currently only supports 1 style in the stack.
8403  *
8404  * The user style overrides the corresponding elements of the regular style.
8405  * This is the proper way to do theme overrides in code.
8406  * @param obj the Evas object to set the style to.
8407  * @param ts  the style to set.
8408  * @return Returns no value.
8409  * @see evas_object_textblock_style_set
8410  * @since 1.2
8411  */
8412 EAPI void                                     evas_object_textblock_style_user_push(Evas_Object *obj, Evas_Textblock_Style *ts) EINA_ARG_NONNULL(1);
8413
8414 /**
8415  * Del the from the top of the user style stack.
8416  *
8417  * @param obj  the object to get the style from.
8418  * @see evas_object_textblock_style_get
8419  * @since 1.2
8420  */
8421 EAPI void                                     evas_object_textblock_style_user_pop(Evas_Object *obj) EINA_ARG_NONNULL(1);
8422
8423 /**
8424  * Get (don't remove) the style at the top of the user style stack.
8425  *
8426  * @param obj  the object to get the style from.
8427  * @return the style of the object.
8428  * @see evas_object_textblock_style_get
8429  * @since 1.2
8430  */
8431 EAPI const Evas_Textblock_Style              *evas_object_textblock_style_user_peek(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
8432
8433 /**
8434  * @brief Set the "replacement character" to use for the given textblock object.
8435  *
8436  * @param obj The given textblock object.
8437  * @param ch The charset name.
8438  */
8439 EAPI void                                     evas_object_textblock_replace_char_set(Evas_Object *obj, const char *ch) EINA_ARG_NONNULL(1);
8440
8441 /**
8442  * @brief Get the "replacement character" for given textblock object. Returns
8443  * @c NULL if no replacement character is in use.
8444  *
8445  * @param obj The given textblock object
8446  * @return Replacement character or @c NULL.
8447  */
8448 EAPI const char                              *evas_object_textblock_replace_char_get(Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
8449
8450 /**
8451  * @brief Sets the vertical alignment of text within the textblock object
8452  * as a whole.
8453  *
8454  * Normally alignment is 0.0 (top of object). Values given should be
8455  * between 0.0 and 1.0 (1.0 bottom of object, 0.5 being vertically centered
8456  * etc.).
8457  *
8458  * @param obj The given textblock object.
8459  * @param align A value between @c 0.0 and @c 1.0.
8460  * @since 1.1
8461  */
8462 EAPI void                                     evas_object_textblock_valign_set(Evas_Object *obj, double align);
8463
8464 /**
8465  * @brief Gets the vertical alignment of a textblock
8466  *
8467  * @param obj The given textblock object.
8468  * @return The alignment set for the object.
8469  * @since 1.1
8470  */
8471 EAPI double                                   evas_object_textblock_valign_get(const Evas_Object *obj);
8472
8473 /**
8474  * @brief Sets the BiDi delimiters used in the textblock.
8475  *
8476  * BiDi delimiters are use for in-paragraph separation of bidi segments. This
8477  * is useful for example in recipients fields of e-mail clients where bidi
8478  * oddities can occur when mixing RTL and LTR.
8479  *
8480  * @param obj The given textblock object.
8481  * @param delim A null terminated string of delimiters, e.g ",|".
8482  * @since 1.1
8483  */
8484 EAPI void                                     evas_object_textblock_bidi_delimiters_set(Evas_Object *obj, const char *delim);
8485
8486 /**
8487  * @brief Gets the BiDi delimiters used in the textblock.
8488  *
8489  * BiDi delimiters are use for in-paragraph separation of bidi segments. This
8490  * is useful for example in recipients fields of e-mail clients where bidi
8491  * oddities can occur when mixing RTL and LTR.
8492  *
8493  * @param obj The given textblock object.
8494  * @return A null terminated string of delimiters, e.g ",|". If empty, returns
8495  * @c NULL.
8496  * @since 1.1
8497  */
8498 EAPI const char                              *evas_object_textblock_bidi_delimiters_get(const Evas_Object *obj);
8499
8500 /**
8501  * @brief Sets newline mode. When true, newline character will behave
8502  * as a paragraph separator.
8503  *
8504  * @param obj The given textblock object.
8505  * @param mode @c EINA_TRUE for legacy mode, @c EINA_FALSE otherwise.
8506  * @since 1.1
8507  */
8508 EAPI void                                     evas_object_textblock_legacy_newline_set(Evas_Object *obj, Eina_Bool mode) EINA_ARG_NONNULL(1);
8509
8510 /**
8511  * @brief Gets newline mode. When true, newline character behaves
8512  * as a paragraph separator.
8513  *
8514  * @param obj The given textblock object.
8515  * @return @c EINA_TRUE if in legacy mode, @c EINA_FALSE otherwise.
8516  * @since 1.1
8517  */
8518 EAPI Eina_Bool                                evas_object_textblock_legacy_newline_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
8519
8520 /**
8521  * Sets the tetxblock's text to the markup text.
8522  *
8523  * @note assumes text does not include the unicode object replacement char (0xFFFC)
8524  *
8525  * @param obj  the textblock object.
8526  * @param text the markup text to use.
8527  * @return Return no value.
8528  */
8529 EAPI void                                     evas_object_textblock_text_markup_set(Evas_Object *obj, const char *text) EINA_ARG_NONNULL(1);
8530
8531 /**
8532  * Prepends markup to the cursor cur.
8533  *
8534  * @note assumes text does not include the unicode object replacement char (0xFFFC)
8535  *
8536  * @param cur  the cursor to prepend to.
8537  * @param text the markup text to prepend.
8538  * @return Return no value.
8539  */
8540 EAPI void                                     evas_object_textblock_text_markup_prepend(Evas_Textblock_Cursor *cur, const char *text) EINA_ARG_NONNULL(1, 2);
8541
8542 /**
8543  * Return the markup of the object.
8544  *
8545  * @param obj the Evas object.
8546  * @return the markup text of the object.
8547  */
8548 EAPI const char                              *evas_object_textblock_text_markup_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
8549
8550 /**
8551  * Return the object's main cursor.
8552  *
8553  * @param obj the object.
8554  * @return The @p obj's main cursor.
8555  */
8556 EAPI Evas_Textblock_Cursor                   *evas_object_textblock_cursor_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
8557
8558 /**
8559  * Create a new cursor, associate it to the obj and init it to point
8560  * to the start of the textblock. Association to the object means the cursor
8561  * will be updated when the object will change.
8562  *
8563  * @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).
8564  *
8565  * @param obj the object to associate to.
8566  * @return the new cursor.
8567  */
8568 EAPI Evas_Textblock_Cursor                   *evas_object_textblock_cursor_new(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
8569
8570 /**
8571  * Free the cursor and unassociate it from the object.
8572  * @note do not use it to free unassociated cursors.
8573  *
8574  * @param cur the cursor to free.
8575  * @return Returns no value.
8576  */
8577 EAPI void                                     evas_textblock_cursor_free(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8578
8579 /**
8580  * Sets the cursor to the start of the first text node.
8581  *
8582  * @param cur the cursor to update.
8583  * @return Returns no value.
8584  */
8585 EAPI void                                     evas_textblock_cursor_paragraph_first(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8586
8587 /**
8588  * sets the cursor to the end of the last text node.
8589  *
8590  * @param cur the cursor to set.
8591  * @return Returns no value.
8592  */
8593 EAPI void                                     evas_textblock_cursor_paragraph_last(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8594
8595 /**
8596  * Advances to the start of the next text node
8597  *
8598  * @param cur the cursor to update
8599  * @return @c EINA_TRUE if it managed to advance a paragraph, @c EINA_FALSE
8600  * otherwise.
8601  */
8602 EAPI Eina_Bool                                evas_textblock_cursor_paragraph_next(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8603
8604 /**
8605  * Advances to the end of the previous text node
8606  *
8607  * @param cur the cursor to update
8608  * @return @c EINA_TRUE if it managed to advance a paragraph, @c EINA_FALSE
8609  * otherwise.
8610  */
8611 EAPI Eina_Bool                                evas_textblock_cursor_paragraph_prev(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8612
8613 /**
8614  * Returns the
8615  *
8616  * @param obj The evas, must not be @c NULL.
8617  * @param anchor the anchor name to get
8618  * @return Returns the list format node corresponding to the anchor, may be null if there are none.
8619  */
8620 EAPI const Eina_List                         *evas_textblock_node_format_list_get(const Evas_Object *obj, const char *anchor) EINA_ARG_NONNULL(1, 2);
8621
8622 /**
8623  * Returns the first format node.
8624  *
8625  * @param obj The evas, must not be @c NULL.
8626  * @return Returns the first format node, may be null if there are none.
8627  */
8628 EAPI const Evas_Object_Textblock_Node_Format *evas_textblock_node_format_first_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
8629
8630 /**
8631  * Returns the last format node.
8632  *
8633  * @param obj The evas textblock, must not be NULL.
8634  * @return Returns the first format node, may be null if there are none.
8635  */
8636 EAPI const Evas_Object_Textblock_Node_Format *evas_textblock_node_format_last_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
8637
8638 /**
8639  * Returns the next format node (after n)
8640  *
8641  * @param n the current format node - not null.
8642  * @return Returns the next format node, may be null.
8643  */
8644 EAPI const Evas_Object_Textblock_Node_Format *evas_textblock_node_format_next_get(const Evas_Object_Textblock_Node_Format *n) EINA_ARG_NONNULL(1);
8645
8646 /**
8647  * Returns the prev format node (after n)
8648  *
8649  * @param n the current format node - not null.
8650  * @return Returns the prev format node, may be null.
8651  */
8652 EAPI const Evas_Object_Textblock_Node_Format *evas_textblock_node_format_prev_get(const Evas_Object_Textblock_Node_Format *n) EINA_ARG_NONNULL(1);
8653
8654 /**
8655  * Remove a format node and it's match. i.e, removes a \<tag\> \</tag\> pair.
8656  * Assumes the node is the first part of \<tag\> i.e, this won't work if
8657  * n is a closing tag.
8658  *
8659  * @param obj the Evas object of the textblock - not null.
8660  * @param n the current format node - not null.
8661  */
8662 EAPI void                                     evas_textblock_node_format_remove_pair(Evas_Object *obj, Evas_Object_Textblock_Node_Format *n) EINA_ARG_NONNULL(1, 2);
8663
8664 /**
8665  * Sets the cursor to point to the place where format points to.
8666  *
8667  * @param cur the cursor to update.
8668  * @param n the format node to update according.
8669  * @deprecated duplicate of evas_textblock_cursor_at_format_set
8670  */
8671 EAPI void                                     evas_textblock_cursor_set_at_format(Evas_Textblock_Cursor *cur, const Evas_Object_Textblock_Node_Format *n) EINA_ARG_NONNULL(1, 2);
8672
8673 /**
8674  * Return the format node at the position pointed by cur.
8675  *
8676  * @param cur the position to look at.
8677  * @return the format node if found, @c NULL otherwise.
8678  * @see evas_textblock_cursor_format_is_visible_get()
8679  */
8680 EAPI const Evas_Object_Textblock_Node_Format *evas_textblock_cursor_format_get(const Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8681
8682 /**
8683  * Get the text format representation of the format node.
8684  *
8685  * @param fnode the format node.
8686  * @return the textual format of the format node.
8687  */
8688 EAPI const char                              *evas_textblock_node_format_text_get(const Evas_Object_Textblock_Node_Format *fnode) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
8689
8690 /**
8691  * Set the cursor to point to the position of fmt.
8692  *
8693  * @param cur the cursor to update
8694  * @param fmt the format to update according to.
8695  */
8696 EAPI void                                     evas_textblock_cursor_at_format_set(Evas_Textblock_Cursor *cur, const Evas_Object_Textblock_Node_Format *fmt) EINA_ARG_NONNULL(1, 2);
8697
8698 /**
8699  * Check if the current cursor position is a visible format. This way is more
8700  * efficient than evas_textblock_cursor_format_get() to check for the existence
8701  * of a visible format.
8702  *
8703  * @param cur the cursor to look at.
8704  * @return @c EINA_TRUE if the cursor points to a visible format, @c EINA_FALSE
8705  * otherwise.
8706  * @see evas_textblock_cursor_format_get()
8707  */
8708 EAPI Eina_Bool                                evas_textblock_cursor_format_is_visible_get(const Evas_Textblock_Cursor *cur) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
8709
8710 /**
8711  * Advances to the next format node
8712  *
8713  * @param cur the cursor to be updated.
8714  * @return @c EINA_TRUE on success @c EINA_FALSE otherwise.
8715  */
8716 EAPI Eina_Bool                                evas_textblock_cursor_format_next(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8717
8718 /**
8719  * Advances to the previous format node.
8720  *
8721  * @param cur the cursor to update.
8722  * @return @c EINA_TRUE on success @c EINA_FALSE otherwise.
8723  */
8724 EAPI Eina_Bool                                evas_textblock_cursor_format_prev(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8725
8726 /**
8727  * Returns true if the cursor points to a format.
8728  *
8729  * @param cur the cursor to check.
8730  * @return  @c EINA_TRUE if a cursor points to a format @c EINA_FALSE
8731  * otherwise.
8732  */
8733 EAPI Eina_Bool                                evas_textblock_cursor_is_format(const Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8734
8735 /**
8736  * Advances 1 char forward.
8737  *
8738  * @param cur the cursor to advance.
8739  * @return @c EINA_TRUE on success @c EINA_FALSE otherwise.
8740  */
8741 EAPI Eina_Bool                                evas_textblock_cursor_char_next(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8742
8743 /**
8744  * Advances 1 char backward.
8745  *
8746  * @param cur the cursor to advance.
8747  * @return @c EINA_TRUE on success @c EINA_FALSE otherwise.
8748  */
8749 EAPI Eina_Bool                                evas_textblock_cursor_char_prev(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8750
8751 /**
8752  * Moves the cursor to the start of the word under the cursor.
8753  *
8754  * @param cur the cursor to move.
8755  * @return @c EINA_TRUE on success @c EINA_FALSE otherwise.
8756  * @since 1.2
8757  */
8758 EAPI Eina_Bool                                evas_textblock_cursor_word_start(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8759
8760 /**
8761  * Moves the cursor to the end of the word under the cursor.
8762  *
8763  * @param cur the cursor to move.
8764  * @return @c EINA_TRUE on success @c EINA_FALSE otherwise.
8765  * @since 1.2
8766  */
8767 EAPI Eina_Bool                                evas_textblock_cursor_word_end(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8768
8769 /**
8770  * Go to the first char in the node the cursor is pointing on.
8771  *
8772  * @param cur the cursor to update.
8773  * @return Returns no value.
8774  */
8775 EAPI void                                     evas_textblock_cursor_paragraph_char_first(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8776
8777 /**
8778  * Go to the last char in a text node.
8779  *
8780  * @param cur the cursor to update.
8781  * @return Returns no value.
8782  */
8783 EAPI void                                     evas_textblock_cursor_paragraph_char_last(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8784
8785 /**
8786  * Go to the start of the current line
8787  *
8788  * @param cur the cursor to update.
8789  * @return Returns no value.
8790  */
8791 EAPI void                                     evas_textblock_cursor_line_char_first(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8792
8793 /**
8794  * Go to the end of the current line.
8795  *
8796  * @param cur the cursor to update.
8797  * @return Returns no value.
8798  */
8799 EAPI void                                     evas_textblock_cursor_line_char_last(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8800
8801 /**
8802  * Return the current cursor pos.
8803  *
8804  * @param cur the cursor to take the position from.
8805  * @return the position or -1 on error
8806  */
8807 EAPI int                                      evas_textblock_cursor_pos_get(const Evas_Textblock_Cursor *cur) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
8808
8809 /**
8810  * Set the cursor pos.
8811  *
8812  * @param cur the cursor to be set.
8813  * @param pos the pos to set.
8814  */
8815 EAPI void                                     evas_textblock_cursor_pos_set(Evas_Textblock_Cursor *cur, int pos) EINA_ARG_NONNULL(1);
8816
8817 /**
8818  * Go to the start of the line passed
8819  *
8820  * @param cur cursor to update.
8821  * @param line numer to set.
8822  * @return @c EINA_TRUE on success, @c EINA_FALSE on error.
8823  */
8824 EAPI Eina_Bool                                evas_textblock_cursor_line_set(Evas_Textblock_Cursor *cur, int line) EINA_ARG_NONNULL(1);
8825
8826 /**
8827  * Compare two cursors.
8828  *
8829  * @param cur1 the first cursor.
8830  * @param cur2 the second cursor.
8831  * @return -1 if cur1 < cur2, 0 if cur1 == cur2 and 1 otherwise.
8832  */
8833 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);
8834
8835 /**
8836  * Make cur_dest point to the same place as cur. Does not work if they don't
8837  * point to the same object.
8838  *
8839  * @param cur the source cursor.
8840  * @param cur_dest destination cursor.
8841  * @return Returns no value.
8842  */
8843 EAPI void                                     evas_textblock_cursor_copy(const Evas_Textblock_Cursor *cur, Evas_Textblock_Cursor *cur_dest) EINA_ARG_NONNULL(1, 2);
8844
8845 /**
8846  * Adds text to the current cursor position and set the cursor to *before*
8847  * the start of the text just added.
8848  *
8849  * @param cur the cursor to where to add text at.
8850  * @param text the text to add.
8851  * @return Returns the len of the text added.
8852  * @see evas_textblock_cursor_text_prepend()
8853  */
8854 EAPI int                                      evas_textblock_cursor_text_append(Evas_Textblock_Cursor *cur, const char *text) EINA_ARG_NONNULL(1, 2);
8855
8856 /**
8857  * Adds text to the current cursor position and set the cursor to *after*
8858  * the start of the text just added.
8859  *
8860  * @param cur the cursor to where to add text at.
8861  * @param text the text to add.
8862  * @return Returns the len of the text added.
8863  * @see evas_textblock_cursor_text_append()
8864  */
8865 EAPI int                                      evas_textblock_cursor_text_prepend(Evas_Textblock_Cursor *cur, const char *text) EINA_ARG_NONNULL(1, 2);
8866
8867 /**
8868  * Adds format to the current cursor position. If the format being added is a
8869  * visible format, add it *before* the cursor position, otherwise, add it after.
8870  * This behavior is because visible formats are like characters and invisible
8871  * should be stacked in a way that the last one is added last.
8872  *
8873  * This function works with native formats, that means that style defined
8874  * tags like <br> won't work here. For those kind of things use markup prepend.
8875  *
8876  * @param cur the cursor to where to add format at.
8877  * @param format the format to add.
8878  * @return Returns true if a visible format was added, false otherwise.
8879  * @see evas_textblock_cursor_format_prepend()
8880  */
8881
8882 /**
8883  * Check if the current cursor position points to the terminating null of the
8884  * last paragraph. (shouldn't be allowed to point to the terminating null of
8885  * any previous paragraph anyway.
8886  *
8887  * @param cur the cursor to look at.
8888  * @return @c EINA_TRUE if the cursor points to the terminating null, @c EINA_FALSE otherwise.
8889  */
8890 EAPI Eina_Bool                                evas_textblock_cursor_format_append(Evas_Textblock_Cursor *cur, const char *format) EINA_ARG_NONNULL(1, 2);
8891
8892 /**
8893  * Adds format to the current cursor position. If the format being added is a
8894  * visible format, add it *before* the cursor position, otherwise, add it after.
8895  * This behavior is because visible formats are like characters and invisible
8896  * should be stacked in a way that the last one is added last.
8897  * If the format is visible the cursor is advanced after it.
8898  *
8899  * This function works with native formats, that means that style defined
8900  * tags like <br> won't work here. For those kind of things use markup prepend.
8901  *
8902  * @param cur the cursor to where to add format at.
8903  * @param format the format to add.
8904  * @return Returns true if a visible format was added, false otherwise.
8905  * @see evas_textblock_cursor_format_prepend()
8906  */
8907 EAPI Eina_Bool                                evas_textblock_cursor_format_prepend(Evas_Textblock_Cursor *cur, const char *format) EINA_ARG_NONNULL(1, 2);
8908
8909 /**
8910  * Delete the character at the location of the cursor. If there's a format
8911  * pointing to this position, delete it as well.
8912  *
8913  * @param cur the cursor pointing to the current location.
8914  * @return Returns no value.
8915  */
8916 EAPI void                                     evas_textblock_cursor_char_delete(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8917
8918 /**
8919  * Delete the range between cur1 and cur2.
8920  *
8921  * @param cur1 one side of the range.
8922  * @param cur2 the second side of the range
8923  * @return Returns no value.
8924  */
8925 EAPI void                                     evas_textblock_cursor_range_delete(Evas_Textblock_Cursor *cur1, Evas_Textblock_Cursor *cur2) EINA_ARG_NONNULL(1, 2);
8926
8927 /**
8928  * Return the text of the paragraph cur points to - returns the text in markup.
8929  *
8930  * @param cur the cursor pointing to the paragraph.
8931  * @return the text on success, @c NULL otherwise.
8932  */
8933 EAPI const char                              *evas_textblock_cursor_paragraph_text_get(const Evas_Textblock_Cursor *cur) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
8934
8935 /**
8936  * Return the length of the paragraph, cheaper the eina_unicode_strlen()
8937  *
8938  * @param cur the position of the paragraph.
8939  * @return the length of the paragraph on success, -1 otehrwise.
8940  */
8941 EAPI int                                      evas_textblock_cursor_paragraph_text_length_get(const Evas_Textblock_Cursor *cur) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
8942
8943 /**
8944  * Return the currently visible range.
8945  *
8946  * @param start the start of the range.
8947  * @param end the end of the range.
8948  * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
8949  * @since 1.1
8950  */
8951 EAPI Eina_Bool                                evas_textblock_cursor_visible_range_get(Evas_Textblock_Cursor *start, Evas_Textblock_Cursor *end) EINA_ARG_NONNULL(1, 2);
8952
8953 /**
8954  * Return the format nodes in the range between cur1 and cur2.
8955  *
8956  * @param cur1 one side of the range.
8957  * @param cur2 the other side of the range
8958  * @return the foramt nodes in the range. You have to free it.
8959  * @since 1.1
8960  */
8961 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);
8962
8963 /**
8964  * Return the text in the range between cur1 and cur2
8965  *
8966  * @param cur1 one side of the range.
8967  * @param cur2 the other side of the range
8968  * @param format The form on which to return the text. Markup - in textblock markup. Plain - UTF8.
8969  * @return the text in the range
8970  * @see elm_entry_markup_to_utf8()
8971  */
8972 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);
8973
8974 /**
8975  * Return the content of the cursor.
8976  *
8977  * Free the returned string pointer when done (if it is not NULL).
8978  *
8979  * @param cur the cursor
8980  * @return the text in the range, terminated by a nul byte (may be utf8).
8981  */
8982 EAPI char                                    *evas_textblock_cursor_content_get(const Evas_Textblock_Cursor *cur) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
8983
8984 /**
8985  * Returns the geometry of the cursor. Depends on the type of cursor requested.
8986  * This should be used instead of char_geometry_get because there are weird
8987  * special cases with BiDi text.
8988  * in '_' cursor mode (i.e a line below the char) it's the same as char_geometry
8989  * get, except for the case of the last char of a line which depends on the
8990  * paragraph direction.
8991  *
8992  * in '|' cursor mode (i.e a line between two chars) it is very variable.
8993  * For example consider the following visual string:
8994  * "abcCBA" (ABC are rtl chars), a cursor pointing on A should actually draw
8995  * a '|' between the c and the C.
8996  *
8997  * @param cur the cursor.
8998  * @param cx the x of the cursor
8999  * @param cy the y of the cursor
9000  * @param cw the width of the cursor
9001  * @param ch the height of the cursor
9002  * @param dir the direction of the cursor, can be NULL.
9003  * @param ctype the type of the cursor.
9004  * @return line number of the char on success, -1 on error.
9005  */
9006 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);
9007
9008 /**
9009  * Returns the geometry of the char at cur.
9010  *
9011  * @param cur the position of the char.
9012  * @param cx the x of the char.
9013  * @param cy the y of the char.
9014  * @param cw the w of the char.
9015  * @param ch the h of the char.
9016  * @return line number of the char on success, -1 on error.
9017  */
9018 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);
9019
9020 /**
9021  * Returns the geometry of the pen at cur.
9022  *
9023  * @param cur the position of the char.
9024  * @param cpen_x the pen_x of the char.
9025  * @param cy the y of the char.
9026  * @param cadv the adv of the char.
9027  * @param ch the h of the char.
9028  * @return line number of the char on success, -1 on error.
9029  */
9030 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);
9031
9032 /**
9033  * Returns the geometry of the line at cur.
9034  *
9035  * @param cur the position of the line.
9036  * @param cx the x of the line.
9037  * @param cy the y of the line.
9038  * @param cw the width of the line.
9039  * @param ch the height of the line.
9040  * @return line number of the line on success, -1 on error.
9041  */
9042 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);
9043
9044 /**
9045  * Set the position of the cursor according to the X and Y coordinates.
9046  *
9047  * @param cur the cursor to set.
9048  * @param x coord to set by.
9049  * @param y coord to set by.
9050  * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
9051  */
9052 EAPI Eina_Bool                                evas_textblock_cursor_char_coord_set(Evas_Textblock_Cursor *cur, Evas_Coord x, Evas_Coord y) EINA_ARG_NONNULL(1);
9053
9054 /**
9055  * Set the cursor position according to the y coord.
9056  *
9057  * @param cur the cur to be set.
9058  * @param y the coord to set by.
9059  * @return the line number found, -1 on error.
9060  */
9061 EAPI int                                      evas_textblock_cursor_line_coord_set(Evas_Textblock_Cursor *cur, Evas_Coord y) EINA_ARG_NONNULL(1);
9062
9063 /**
9064  * Get the geometry of a range.
9065  *
9066  * @param cur1 one side of the range.
9067  * @param cur2 other side of the range.
9068  * @return a list of Rectangles representing the geometry of the range.
9069  */
9070 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);
9071 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);
9072
9073 /**
9074  * Checks if the cursor points to the end of the line.
9075  *
9076  * @param cur the cursor to check.
9077  * @return @c EINA_TRUE if true, @c EINA_FALSE otherwise.
9078  */
9079 EAPI Eina_Bool                                evas_textblock_cursor_eol_get(const Evas_Textblock_Cursor *cur) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
9080
9081 /**
9082  * Get the geometry of a line number.
9083  *
9084  * @param obj the object.
9085  * @param line the line number.
9086  * @param cx x coord of the line.
9087  * @param cy y coord of the line.
9088  * @param cw w coord of the line.
9089  * @param ch h coord of the line.
9090  * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
9091  */
9092 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);
9093
9094 /**
9095  * Clear the textblock object.
9096  * @note Does *NOT* free the Evas object itself.
9097  *
9098  * @param obj the object to clear.
9099  * @return nothing.
9100  */
9101 EAPI void                                     evas_object_textblock_clear(Evas_Object *obj) EINA_ARG_NONNULL(1);
9102
9103 /**
9104  * Get the formatted width and height. This calculates the actual size after restricting
9105  * the textblock to the current size of the object.
9106  * The main difference between this and @ref evas_object_textblock_size_native_get
9107  * is that the "native" function does not wrapping into account
9108  * it just calculates the real width of the object if it was placed on an
9109  * infinite canvas, while this function gives the size after wrapping
9110  * according to the size restrictions of the object.
9111  *
9112  * For example for a textblock containing the text: "You shall not pass!"
9113  * with no margins or padding and assuming a monospace font and a size of
9114  * 7x10 char widths (for simplicity) has a native size of 19x1
9115  * and a formatted size of 5x4.
9116  *
9117  *
9118  * @param obj the Evas object.
9119  * @param w the width of the object.
9120  * @param h the height of the object
9121  * @return Returns no value.
9122  * @see evas_object_textblock_size_native_get
9123  */
9124 EAPI void                                     evas_object_textblock_size_formatted_get(const Evas_Object *obj, Evas_Coord *w, Evas_Coord *h) EINA_ARG_NONNULL(1);
9125
9126 /**
9127  * Get the native width and height. This calculates the actual size without taking account
9128  * the current size of the object.
9129  * The main difference between this and @ref evas_object_textblock_size_formatted_get
9130  * is that the "native" function does not take wrapping into account
9131  * it just calculates the real width of the object if it was placed on an
9132  * infinite canvas, while the "formatted" function gives the size after
9133  * wrapping text according to the size restrictions of the object.
9134  *
9135  * For example for a textblock containing the text: "You shall not pass!"
9136  * with no margins or padding and assuming a monospace font and a size of
9137  * 7x10 char widths (for simplicity) has a native size of 19x1
9138  * and a formatted size of 5x4.
9139  *
9140  * @param obj the Evas object of the textblock
9141  * @param w the width returned
9142  * @param h the height returned
9143  * @return Returns no value.
9144  */
9145 EAPI void                                     evas_object_textblock_size_native_get(const Evas_Object *obj, Evas_Coord *w, Evas_Coord *h) EINA_ARG_NONNULL(1);
9146 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);
9147
9148 /**
9149  * @}
9150  */
9151
9152
9153 /**
9154  * @defgroup Evas_Object_Textgrid Textgrid Object Functions
9155  *
9156  * @todo put here some usage examples
9157  *
9158  * @since 1.7
9159  *
9160  * @ingroup Evas_Object_Specific
9161  *
9162  * @{
9163  */
9164
9165 /**
9166  * @typedef Evas_Textgrid_Palette
9167  *
9168  * The palette to use for the forgraound and background colors.
9169  *
9170  * @since 1.7
9171  */
9172 typedef enum
9173 {
9174    EVAS_TEXTGRID_PALETTE_NONE,     /**< No palette is used */
9175    EVAS_TEXTGRID_PALETTE_STANDARD, /**< standard palette (around 16 colors) */
9176    EVAS_TEXTGRID_PALETTE_EXTENDED, /**< extended palette (at max 256 colors) */
9177    EVAS_TEXTGRID_PALETTE_LAST      /**< ignore it */
9178 } Evas_Textgrid_Palette;
9179
9180 /**
9181  * @typedef Evas_Textgrid_Font_Style
9182  *
9183  * The style to give to each character of the grid.
9184  *
9185  * @since 1.7
9186  */
9187 typedef enum
9188 {
9189    EVAS_TEXTGRID_FONT_STYLE_NORMAL = (1 << 0), /**< Normal style */
9190    EVAS_TEXTGRID_FONT_STYLE_BOLD   = (1 << 1), /**< Bold style */
9191    EVAS_TEXTGRID_FONT_STYLE_ITALIC = (1 << 2)  /**< Oblique style */
9192 } Evas_Textgrid_Font_Style;
9193
9194 /**
9195  * @typedef Evas_Textgrid_Cell
9196  *
9197  * The values that describes each cell.
9198  *
9199  * @since 1.7
9200  */
9201 typedef struct _Evas_Textgrid_Cell Evas_Textgrid_Cell;
9202
9203 /**
9204  * @struct _Evas_Textgrid_Cell
9205  *
9206  * The values that describes each cell.
9207  *
9208  * @since 1.7
9209  */
9210 struct _Evas_Textgrid_Cell
9211 {
9212    Eina_Unicode   codepoint;         /**< the UNICODE value of the character */
9213    unsigned char  fg;                /**< the index of the palette for the foreground color */
9214    unsigned char  bg;                /**< the index of the palette for the background color */
9215    unsigned short bold          : 1; /**< whether the character is bold */
9216    unsigned short italic        : 1; /**< whether the character is oblique */
9217    unsigned short underline     : 1; /**< whether the character is underlined */
9218    unsigned short strikethrough : 1; /**< whether the character is strikethrough'ed */
9219    unsigned short fg_extended   : 1; /**< whether the extended palette is used for the foreground color */
9220    unsigned short bg_extended   : 1; /**< whether the extended palette is used for the background color */
9221    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) */
9222 };
9223
9224 /**
9225  * @brief Add a textgrid to the given Evas.
9226  *
9227  * @param e The given evas.
9228  * @return The new textgrid object.
9229  *
9230  * This function adds a new textgrid object to the Evas @p e and returns the object.
9231  *
9232  * @since 1.7
9233  */
9234 EAPI Evas_Object *evas_object_textgrid_add(Evas *e);
9235
9236 /**
9237  * @brief Set the size of the textgrid object.
9238  *
9239  * @param obj The textgrid object.
9240  * @param w The number of columns (width in cells) of the grid.
9241  * @param h The number of rows (height in cells) of the grid.
9242  *
9243  * This function sets the number of lines @p h and the number
9244  * of columns @p w to the textgrid object @p obj. If
9245  * @p w or @p h are less or equal than 0, this
9246  * functiond does nothing.
9247  *
9248  * @since 1.7
9249  */
9250 EAPI void evas_object_textgrid_size_set(Evas_Object *obj, int w, int h);
9251
9252 /**
9253  * @brief Get the size of the textgrid object.
9254  *
9255  * @param obj The textgrid object.
9256  * @param w The number of columns of the grid.
9257  * @param h The number of rows of the grid.
9258  *
9259  * This function retrieves the number of lines in the buffer @p
9260  * h and the number of columns in the buffer @p w of
9261  * the textgrid object @p obj. @p w or @p h can be
9262  * @c NULL. On error, their value is 0.
9263  *
9264  * @since 1.7
9265  */
9266 EAPI void evas_object_textgrid_size_get(const Evas_Object *obj, int *w, int *h);
9267
9268 /**
9269  * @brief Set the font (source) file to be used on a given textgrid object.
9270  *
9271  * @param obj The textgrid object to set font for.
9272  * @param font_source The font file's path.
9273  *
9274  * This function allows the font file @p font_source to be explicitly
9275  * set for the textgrid object @p obj, overriding system lookup, which
9276  * will first occur in the given file's contents. If @font_source is
9277  * @c NULL or is an empty string, or the same font_source has already
9278  * been set, or on error, this function does nothing.
9279  *
9280  * @see evas_object_textgrid_font_get()
9281  * @see evas_object_textgrid_font_set()
9282  * @see evas_object_textgrid_font_source_get()
9283  *
9284  * @since 1.7
9285  */
9286 EAPI void evas_object_textgrid_font_source_set(Evas_Object *obj, const char *font_source);
9287
9288 /**
9289  * @brief Get the font file's path which is being used on a given textgrid object.
9290  *
9291  * @param obj The textgrid object to set font for.
9292  * @return The font file's path.
9293  *
9294  * This function returns the font source path of the textgrid object
9295  * @p obj. If the font source path has not been set, or on error,
9296  * @c NULL is returned.
9297  *
9298  * @see evas_object_textgrid_font_get()
9299  * @see evas_object_textgrid_font_set()
9300  * @see evas_object_textgrid_font_source_set()
9301  *
9302  * @since 1.7
9303  */
9304 EAPI const char *evas_object_textgrid_font_source_get(const Evas_Object *obj);
9305
9306 /**
9307  * @brief Set the font family and size on a given textgrid object.
9308  *
9309  * @param obj The textgrid object to set font for.
9310  * @param font_name The font (family) name.
9311  * @param font_size The font size, in points.
9312  *
9313  * This function allows the font name @p font_name and size
9314  * @p font_size of the textgrid object @p obj to be set. The @p font_name
9315  * string has to follow fontconfig's convention on naming fonts, as
9316  * it's the underlying library used to query system fonts by Evas (see
9317  * the @c fc-list command's output, on your system, to get an
9318  * idea). It also has to be a monospace font. If @p font_name is
9319  * @c NULL, or if it is an empty string, or if @p font_size is less or
9320  * equal than 0, or on error, this function does nothing.
9321  *
9322  * @see evas_object_textgrid_font_get()
9323  * @see evas_object_textgrid_font_source_set()
9324  * @see evas_object_textgrid_font_source_get()
9325  *
9326  * @since 1.7
9327  */
9328 EAPI void evas_object_textgrid_font_set(Evas_Object *obj, const char *font_name, Evas_Font_Size font_size);
9329
9330 /**
9331  * @brief Retrieve the font family and size in use on a given textgrid object.
9332  *
9333  * @param obj The textgrid object to query for font information.
9334  * @param font_name A pointer to the location to store the font name in.
9335  * @param font_size A pointer to the location to store the font size in.
9336  *
9337  * This function allows the font name and size of a textgrid object
9338  * @p obj to be queried and stored respectively in the buffers
9339  * @p font_name and @p font_size. Be aware that the font name string is
9340  * still owned by Evas and should @b not have free() called on it by
9341  * the caller of the function. On error, the font name is the empty
9342  * string and the font size is 0. @p font_name and @p font_source can
9343  * be @c NULL.
9344  *
9345  * @see evas_object_textgrid_font_set()
9346  * @see evas_object_textgrid_font_source_set()
9347  * @see evas_object_textgrid_font_source_get()
9348  *
9349  * @since 1.7
9350  */
9351 EAPI void evas_object_textgrid_font_get(const Evas_Object *obj, const char **font_name, Evas_Font_Size *font_size);
9352
9353 /**
9354  * @brief Retrieve the size of a cell of the given textgrid object in pixels.
9355  *
9356  * @param obj The textgrid object to query for font information.
9357  * @param width A pointer to the location to store the width in pixels of a cell.
9358  * @param height A pointer to the location to store the height in
9359  * pixels of a cell.
9360  *
9361  * This functions retrieves the width and height, in pixels, of a cell
9362  * of the textgrid object @p obj and store them respectively in the
9363  * buffers @p width and @p height. Their value depends on the
9364  * monospace font used for the textgrid object, as well as the
9365  * style. @p width and @p height can be @c NULL. On error, they are
9366  * set to 0.
9367  *
9368  * @see evas_object_textgrid_font_set()
9369  * @see evas_object_textgrid_supported_font_styles_set()
9370  *
9371  * @since 1.7
9372  */
9373 EAPI void evas_object_textgrid_cell_size_get(const Evas_Object *obj, Evas_Coord *w, Evas_Coord *h);
9374
9375 /**
9376  * @brief The set color to the given palette at the given index of the given textgrid object.
9377  *
9378  * @param obj The textgrid object to query for font information.
9379  * @param pal The type of the palette to set the color.
9380  * @param idx The index of the paletter to wich the color is stored.
9381  * @param r The red component of the color.
9382  * @param g The green component of the color.
9383  * @param b The blue component of the color.
9384  * @param a The alpha component of the color.
9385  *
9386  * This function sets the color for the palette of type @p pal at the
9387  * index @p idx of the textgrid object @p obj. The ARGB components are
9388  * given by @p r, @p g, @p b and @p a. This color can be used when
9389  * setting the #Evas_Textgrid_Cell structure. The components must set
9390  * a pre-multiplied color. If pal is #EVAS_TEXTGRID_PALETTE_NONE or
9391  * #EVAS_TEXTGRID_PALETTE_LAST, or if @p idx is not between 0 and 255,
9392  * or on error, this function does nothing. The color components are
9393  * clamped between 0 and 255. If @p idx is greater than the latest set
9394  * color, the colors between this last index and @p idx - 1 are set to
9395  * black (0, 0, 0, 0).
9396  *
9397  * @see evas_object_textgrid_palette_get()
9398  *
9399  * @since 1.7
9400  */
9401 EAPI void evas_object_textgrid_palette_set(Evas_Object *obj, Evas_Textgrid_Palette pal, int idx, int r, int g, int b, int a);
9402
9403 /**
9404  * @brief The retrieve color to the given palette at the given index of the given textgrid object.
9405  *
9406  * @param obj The textgrid object to query for font information.
9407  * @param pal The type of the palette to set the color.
9408  * @param idx The index of the paletter to wich the color is stored.
9409  * @param r A pointer to the red component of the color.
9410  * @param g A pointer to the green component of the color.
9411  * @param b A pointer to the blue component of the color.
9412  * @param a A pointer to the alpha component of the color.
9413  *
9414  * This function retrieves the color for the palette of type @p pal at the
9415  * index @p idx of the textgrid object @p obj. The ARGB components are
9416  * stored in the buffers @p r, @p g, @p b and @p a. If @p idx is not
9417  * between 0 and the index of the latest set color, or if @p pal is
9418  * #EVAS_TEXTGRID_PALETTE_NONE or #EVAS_TEXTGRID_PALETTE_LAST, the
9419  * values of the components are 0. @p r, @p g, @pb and @p a can be
9420  * @c NULL.
9421  *
9422  * @see evas_object_textgrid_palette_set()
9423  *
9424  * @since 1.7
9425  */
9426 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);
9427
9428 EAPI void evas_object_textgrid_supported_font_styles_set(Evas_Object *obj, Evas_Textgrid_Font_Style styles);
9429 EAPI Evas_Textgrid_Font_Style evas_object_textgrid_supported_font_styles_get(const Evas_Object *obj);
9430
9431 /**
9432  * @brief Set the string at the given row of the given textgrid object.
9433  *
9434  * @param obj The textgrid object to query for font information.
9435  * @param y The row index of the grid.
9436  * @param The string as a sequence of #Evas_Textgrid_Cell.
9437  *
9438  * This function returns cells to the textgrid taken by
9439  * evas_object_textgrid_cellrow_get(). The row pointer @p row should be the
9440  * same row pointer returned by evas_object_textgrid_cellrow_get() for the
9441  * same row @p y.
9442  *
9443  * @see evas_object_textgrid_cellrow_get()
9444  * @see evas_object_textgrid_size_set()
9445  * @see evas_object_textgrid_update_add()
9446  *
9447  * @since 1.7
9448  */
9449 EAPI void evas_object_textgrid_cellrow_set(Evas_Object *obj, int y, const Evas_Textgrid_Cell *row);
9450
9451 /**
9452  * @brief Get the string at the given row of the given textgrid object.
9453  *
9454  * @param obj The textgrid object to query for font information.
9455  * @param y The row index of the grid.
9456  * @return A pointer to the first cell of the given row.
9457  *
9458  * This function returns a pointer to the first cell of the line @p y
9459  * of the textgrid object @p obj. If @p y is not between 0 and the
9460  * number of lines of the grid - 1, or on error, this function return @c NULL.
9461  *
9462  * @see evas_object_textgrid_cellrow_set()
9463  * @see evas_object_textgrid_size_set()
9464  * @see evas_object_textgrid_update_add()
9465  *
9466  * @since 1.7
9467  */
9468 EAPI Evas_Textgrid_Cell *evas_object_textgrid_cellrow_get(const Evas_Object *obj, int y);
9469
9470 /**
9471  * @brief Indicate for evas that part of a textgrid region (cells) has been updated.
9472  *
9473  * @param obj The textgrid object.
9474  * @param x The rect region of cells top-left x (column)
9475  * @param y The rect region of cells top-left y (row)
9476  * @param w The rect region size in number of cells (columns)
9477  * @param h The rect region size in number of cells (rows)
9478  *
9479  * This function declares to evas that a region of cells was updated by
9480  * code and needs refreshing. An application should modify cells like this
9481  * as an example:
9482  * 
9483  * @code
9484  * Evas_Textgrid_Cell *cells;
9485  * int i;
9486  * 
9487  * cells = evas_object_textgrid_cellrow_get(obj, row);
9488  * for (i = 0; i < width; i++) cells[i].codepoint = 'E';
9489  * evas_object_textgrid_cellrow_set(obj, row, cells);
9490  * evas_object_textgrid_update_add(obj, 0, row, width, 1);
9491  * @endcode
9492  *
9493  * @see evas_object_textgrid_cellrow_set()
9494  * @see evas_object_textgrid_cellrow_get()
9495  * @see evas_object_textgrid_size_set()
9496  *
9497  * @since 1.7
9498  */
9499 EAPI void evas_object_textgrid_update_add(Evas_Object *obj, int x, int y, int w, int h);
9500
9501 /**
9502  * @}
9503  */
9504
9505 /**
9506  * @defgroup Evas_Line_Group Line Object Functions
9507  *
9508  * Functions used to deal with evas line objects.
9509  *
9510  * @warning We don't guarantee any proper results if you create a Line object
9511  * without setting the evas engine.
9512  *
9513  * @ingroup Evas_Object_Specific
9514  *
9515  * @{
9516  */
9517
9518 /**
9519  * Adds a new evas line object to the given evas.
9520  * @param   e The given evas.
9521  * @return  The new evas line object.
9522  */
9523 EAPI Evas_Object *evas_object_line_add(Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
9524
9525 /**
9526  * Sets the coordinates of the end points of the given evas line object.
9527  * @param   obj The given evas line object.
9528  * @param   x1  The X coordinate of the first point.
9529  * @param   y1  The Y coordinate of the first point.
9530  * @param   x2  The X coordinate of the second point.
9531  * @param   y2  The Y coordinate of the second point.
9532  */
9533 EAPI void         evas_object_line_xy_set(Evas_Object *obj, Evas_Coord x1, Evas_Coord y1, Evas_Coord x2, Evas_Coord y2);
9534
9535 /**
9536  * Retrieves the coordinates of the end points of the given evas line object.
9537  * @param obj The given line object.
9538  * @param x1  Pointer to an integer in which to store the X coordinate of the
9539  *            first end point.
9540  * @param y1  Pointer to an integer in which to store the Y coordinate of the
9541  *            first end point.
9542  * @param x2  Pointer to an integer in which to store the X coordinate of the
9543  *            second end point.
9544  * @param y2  Pointer to an integer in which to store the Y coordinate of the
9545  *            second end point.
9546  */
9547 EAPI void         evas_object_line_xy_get(const Evas_Object *obj, Evas_Coord *x1, Evas_Coord *y1, Evas_Coord *x2, Evas_Coord *y2);
9548 /**
9549  * @}
9550  */
9551
9552 /**
9553  * @defgroup Evas_Object_Polygon Polygon Object Functions
9554  *
9555  * Functions that operate on evas polygon objects.
9556  *
9557  * Hint: as evas does not provide ellipse, smooth paths or circle, one
9558  * can calculate points and convert these to a polygon.
9559  *
9560  * @warning We don't guarantee any proper results if you create a Polygon
9561  * object without setting the evas engine.
9562  *
9563  * @ingroup Evas_Object_Specific
9564  *
9565  * @{
9566  */
9567
9568 /**
9569  * Adds a new evas polygon object to the given evas.
9570  * @param   e The given evas.
9571  * @return  A new evas polygon object.
9572  */
9573 EAPI Evas_Object *evas_object_polygon_add(Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
9574
9575 /**
9576  * Adds the given point to the given evas polygon object.
9577  * @param obj The given evas polygon object.
9578  * @param x   The X coordinate of the given point.
9579  * @param y   The Y coordinate of the given point.
9580  * @ingroup Evas_Polygon_Group
9581  */
9582 EAPI void         evas_object_polygon_point_add(Evas_Object *obj, Evas_Coord x, Evas_Coord y) EINA_ARG_NONNULL(1);
9583
9584 /**
9585  * Removes all of the points from the given evas polygon object.
9586  * @param   obj The given polygon object.
9587  */
9588 EAPI void         evas_object_polygon_points_clear(Evas_Object *obj) EINA_ARG_NONNULL(1);
9589 /**
9590  * @}
9591  */
9592
9593 /* @since 1.2 */
9594 EAPI void         evas_object_is_frame_object_set(Evas_Object *obj, Eina_Bool is_frame);
9595
9596 /* @since 1.2 */
9597 EAPI Eina_Bool    evas_object_is_frame_object_get(Evas_Object *obj);
9598
9599 /**
9600  * @defgroup Evas_Smart_Group Smart Functions
9601  *
9602  * Functions that deal with #Evas_Smart structs, creating definition
9603  * (classes) of objects that will have customized behavior for methods
9604  * like evas_object_move(), evas_object_resize(),
9605  * evas_object_clip_set() and others.
9606  *
9607  * These objects will accept the generic methods defined in @ref
9608  * Evas_Object_Group and the extensions defined in @ref
9609  * Evas_Smart_Object_Group. There are a couple of existent smart
9610  * objects in Evas itself (see @ref Evas_Object_Box, @ref
9611  * Evas_Object_Table and @ref Evas_Smart_Object_Clipped).
9612  *
9613  * See also some @ref Example_Evas_Smart_Objects "examples" of this
9614  * group of functions.
9615  */
9616
9617 /**
9618  * @addtogroup Evas_Smart_Group
9619  * @{
9620  */
9621
9622 /**
9623  * @def EVAS_SMART_CLASS_VERSION
9624  *
9625  * The version you have to put into the version field in the
9626  * #Evas_Smart_Class struct. Used to safeguard from binaries with old
9627  * smart object intefaces running with newer ones.
9628  *
9629  * @ingroup Evas_Smart_Group
9630  */
9631 #define EVAS_SMART_CLASS_VERSION 4
9632 /**
9633  * @struct _Evas_Smart_Class
9634  *
9635  * A smart object's @b base class definition
9636  *
9637  * @ingroup Evas_Smart_Group
9638  */
9639 struct _Evas_Smart_Class
9640 {
9641    const char                      *name; /**< the name string of the class */
9642    int                              version;
9643    void                             (*add)(Evas_Object *o); /**< code to be run when adding object to a canvas */
9644    void                             (*del)(Evas_Object *o); /**< code to be run when removing object from a canvas */
9645    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. */
9646    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. */
9647    void                             (*show)(Evas_Object *o); /**< code to be run when showing object on a canvas */
9648    void                             (*hide)(Evas_Object *o); /**< code to be run when hiding object on a canvas */
9649    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. */
9650    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. */
9651    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. */
9652    void                             (*calculate)(Evas_Object *o); /**< code to be run when object has rendering updates on a canvas */
9653    void                             (*member_add)(Evas_Object *o, Evas_Object *child); /**< code to be run when a child member is added to object */
9654    void                             (*member_del)(Evas_Object *o, Evas_Object *child); /**< code to be run when a child member is removed from object */
9655
9656    const Evas_Smart_Class          *parent; /**< this class inherits from this parent */
9657    const Evas_Smart_Cb_Description *callbacks; /**< callbacks at this level, @c NULL terminated */
9658    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 */
9659    const void                      *data;
9660 };
9661
9662 /**
9663  * @struct _Evas_Smart_Interface
9664  *
9665  * A smart object's @b base interface definition
9666  *
9667  * Every Evas interface must have a name field, pointing to a global,
9668  * constant string variable. This string pointer will be the only way
9669  * of retrieving back a given interface from a smart object. Two
9670  * function pointers must be defined, too, which will be called at
9671  * object creation and deletion times.
9672  *
9673  * See also some @ref Example_Evas_Smart_Interfaces "examples" on
9674  * smart interfaces.
9675  *
9676  * @since 1.7
9677  *
9678  * @ingroup Evas_Smart_Group
9679  */
9680 struct _Evas_Smart_Interface
9681 {
9682    const char *name; /**< Name of the given interface */
9683    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(). */
9684    Eina_Bool   (*add)(Evas_Object *obj); /**< Function to be called at object creation time. This will take place @b before the object's smart @c add() function. */
9685    void        (*del)(Evas_Object *obj); /**< Function to be called at object deletion time. This will take place @b after the object's smart @c del() function. */
9686 };
9687
9688 /**
9689  * @struct _Evas_Smart_Cb_Description
9690  *
9691  * Describes a callback issued by a smart object
9692  * (evas_object_smart_callback_call()), as defined in its smart object
9693  * class. This is particularly useful to explain to end users and
9694  * their code (i.e., introspection) what the parameter @c event_info
9695  * will point to.
9696  *
9697  * @ingroup Evas_Smart_Group
9698  */
9699 struct _Evas_Smart_Cb_Description
9700 {
9701    const char *name; /**< callback name ("changed", for example) */
9702
9703    /**
9704     * @brief Hint on the type of @c event_info parameter's contents on
9705     * a #Evas_Smart_Cb callback.
9706     *
9707     * The type string uses the pattern similar to
9708     * http://dbus.freedesktop.org/doc/dbus-specification.html#message-protocol-signatures,
9709     * but extended to optionally include variable names within
9710     * brackets preceding types. Example:
9711     *
9712     * @li Structure with two integers:
9713     *     @c "(ii)"
9714     *
9715     * @li Structure called 'x' with two integers named 'a' and 'b':
9716     *     @c "[x]([a]i[b]i)"
9717     *
9718     * @li Array of integers:
9719     *     @c "ai"
9720     *
9721     * @li Array called 'x' of struct with two integers:
9722     *     @c "[x]a(ii)"
9723     *
9724     * @note This type string is used as a hint and is @b not validated
9725     *       or enforced in any way. Implementors should make the best
9726     *       use of it to help bindings, documentation and other users
9727     *       of introspection features.
9728     */
9729    const char *type;
9730 };
9731
9732 /**
9733  * @def EVAS_SMART_CLASS_INIT_NULL
9734  * Initializer to zero a whole Evas_Smart_Class structure.
9735  *
9736  * @see EVAS_SMART_CLASS_INIT_VERSION
9737  * @see EVAS_SMART_CLASS_INIT_NAME_VERSION
9738  * @see EVAS_SMART_CLASS_INIT_NAME_VERSION_PARENT
9739  * @see EVAS_SMART_CLASS_INIT_NAME_VERSION_PARENT_CALLBACKS
9740  * @ingroup Evas_Smart_Group
9741  */
9742 #define EVAS_SMART_CLASS_INIT_NULL    {NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL}
9743
9744 /**
9745  * @def EVAS_SMART_CLASS_INIT_VERSION
9746  * Initializer to zero a whole Evas_Smart_Class structure and set version.
9747  *
9748  * Similar to EVAS_SMART_CLASS_INIT_NULL, but will set version field to
9749  * latest EVAS_SMART_CLASS_VERSION.
9750  *
9751  * @see EVAS_SMART_CLASS_INIT_NULL
9752  * @see EVAS_SMART_CLASS_INIT_NAME_VERSION
9753  * @see EVAS_SMART_CLASS_INIT_NAME_VERSION_PARENT
9754  * @see EVAS_SMART_CLASS_INIT_NAME_VERSION_PARENT_CALLBACKS
9755  * @ingroup Evas_Smart_Group
9756  */
9757 #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}
9758
9759 /**
9760  * @def EVAS_SMART_CLASS_INIT_NAME_VERSION
9761  * Initializer to zero a whole Evas_Smart_Class structure and set name
9762  * and version.
9763  *
9764  * Similar to EVAS_SMART_CLASS_INIT_NULL, but will set version field to
9765  * latest EVAS_SMART_CLASS_VERSION and name to the specified value.
9766  *
9767  * It will keep a reference to name field as a "const char *", that is,
9768  * name must be available while the structure is used (hint: static or global!)
9769  * and will not be modified.
9770  *
9771  * @see EVAS_SMART_CLASS_INIT_NULL
9772  * @see EVAS_SMART_CLASS_INIT_VERSION
9773  * @see EVAS_SMART_CLASS_INIT_NAME_VERSION_PARENT
9774  * @see EVAS_SMART_CLASS_INIT_NAME_VERSION_PARENT_CALLBACKS
9775  * @ingroup Evas_Smart_Group
9776  */
9777 #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}
9778
9779 /**
9780  * @def EVAS_SMART_CLASS_INIT_NAME_VERSION_PARENT
9781  * Initializer to zero a whole Evas_Smart_Class structure and set name,
9782  * version and parent class.
9783  *
9784  * Similar to EVAS_SMART_CLASS_INIT_NULL, but will set version field to
9785  * latest EVAS_SMART_CLASS_VERSION, name to the specified value and
9786  * parent class.
9787  *
9788  * It will keep a reference to name field as a "const char *", that is,
9789  * name must be available while the structure is used (hint: static or global!)
9790  * and will not be modified. Similarly, parent reference will be kept.
9791  *
9792  * @see EVAS_SMART_CLASS_INIT_NULL
9793  * @see EVAS_SMART_CLASS_INIT_VERSION
9794  * @see EVAS_SMART_CLASS_INIT_NAME_VERSION
9795  * @see EVAS_SMART_CLASS_INIT_NAME_VERSION_PARENT_CALLBACKS
9796  * @ingroup Evas_Smart_Group
9797  */
9798 #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}
9799
9800 /**
9801  * @def EVAS_SMART_CLASS_INIT_NAME_VERSION_PARENT_CALLBACKS
9802  * Initializer to zero a whole Evas_Smart_Class structure and set name,
9803  * version, parent class and callbacks definition.
9804  *
9805  * Similar to EVAS_SMART_CLASS_INIT_NULL, but will set version field to
9806  * latest EVAS_SMART_CLASS_VERSION, name to the specified value, parent
9807  * class and callbacks at this level.
9808  *
9809  * It will keep a reference to name field as a "const char *", that is,
9810  * name must be available while the structure is used (hint: static or global!)
9811  * and will not be modified. Similarly, parent and callbacks reference
9812  * will be kept.
9813  *
9814  * @see EVAS_SMART_CLASS_INIT_NULL
9815  * @see EVAS_SMART_CLASS_INIT_VERSION
9816  * @see EVAS_SMART_CLASS_INIT_NAME_VERSION
9817  * @see EVAS_SMART_CLASS_INIT_NAME_VERSION_PARENT
9818  * @ingroup Evas_Smart_Group
9819  */
9820 #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}
9821
9822 /**
9823  * @def EVAS_SMART_SUBCLASS_NEW
9824  *
9825  * Convenience macro to subclass a given Evas smart class.
9826  *
9827  * @param smart_name The name used for the smart class. e.g:
9828  * @c "Evas_Object_Box".
9829  * @param prefix Prefix used for all variables and functions defined
9830  * and referenced by this macro.
9831  * @param api_type Type of the structure used as API for the smart
9832  * class. Either #Evas_Smart_Class or something derived from it.
9833  * @param parent_type Type of the parent class API.
9834  * @param parent_func Function that gets the parent class. e.g:
9835  * evas_object_box_smart_class_get().
9836  * @param cb_desc Array of callback descriptions for this smart class.
9837  *
9838  * This macro saves some typing when writing a smart class derived
9839  * from another one. In order to work, the user @b must provide some
9840  * functions adhering to the following guidelines:
9841  *  - @<prefix@>_smart_set_user(): the @b internal @c _smart_set
9842  *    function (defined by this macro) will call this one, provided by
9843  *    the user, after inheriting everything from the parent, which
9844  *    should <b>take care of setting the right member functions for
9845  *    the class</b>, both overrides and extensions, if any.
9846  *  - If this new class should be subclassable as well, a @b public
9847  *    @c _smart_set() function is desirable to fill in the class used as
9848  *    parent by the children. It's up to the user to provide this
9849  *    interface, which will most likely call @<prefix@>_smart_set() to
9850  *    get the job done.
9851  *
9852  * After the macro's usage, the following will be defined for use:
9853  *  - @<prefix@>_parent_sc: A pointer to the @b parent smart
9854  *    class. When calling parent functions from overloaded ones, use
9855  *    this global variable.
9856  *  - @<prefix@>_smart_class_new(): this function returns the
9857  *    #Evas_Smart needed to create smart objects with this class,
9858  *    which should be passed to evas_object_smart_add().
9859  *
9860  * @warning @p smart_name has to be a pointer to a globally available
9861  * string! The smart class created here will just have a pointer set
9862  * to that, and all object instances will depend on it for smart class
9863  * name lookup.
9864  *
9865  * @ingroup Evas_Smart_Group
9866  */
9867 #define EVAS_SMART_SUBCLASS_NEW(smart_name, prefix, api_type, parent_type, parent_func, cb_desc) \
9868   static const parent_type * prefix##_parent_sc = NULL;                                          \
9869   static void prefix##_smart_set_user(api_type * api);                                           \
9870   static void prefix##_smart_set(api_type * api)                                                 \
9871   {                                                                                              \
9872      Evas_Smart_Class *sc;                                                                       \
9873      if (!(sc = (Evas_Smart_Class *)api))                                                        \
9874        return;                                                                                   \
9875      if (!prefix##_parent_sc)                                                                    \
9876        prefix##_parent_sc = parent_func();                                                       \
9877      evas_smart_class_inherit(sc, prefix##_parent_sc);                                           \
9878      prefix##_smart_set_user(api);                                                               \
9879   }                                                                                              \
9880   static Evas_Smart *prefix##_smart_class_new(void)                                              \
9881   {                                                                                              \
9882      static Evas_Smart *smart = NULL;                                                            \
9883      static api_type api;                                                                        \
9884      if (!smart)                                                                                 \
9885        {                                                                                         \
9886           Evas_Smart_Class *sc = (Evas_Smart_Class *)&api;                                       \
9887           memset(&api, 0, sizeof(api_type));                                                     \
9888           sc->version = EVAS_SMART_CLASS_VERSION;                                                \
9889           sc->name = smart_name;                                                                 \
9890           sc->callbacks = cb_desc;                                                               \
9891           prefix##_smart_set(&api);                                                              \
9892           smart = evas_smart_class_new(sc);                                                      \
9893        }                                                                                         \
9894      return smart;                                                                               \
9895   }
9896
9897 /**
9898  * @def EVAS_SMART_SUBCLASS_IFACE_NEW
9899  *
9900  * @since 1.7
9901  *
9902  * Convenience macro to subclass a given Evas smart class. This is the
9903  * same as #EVAS_SMART_SUBCLASS_NEW, but now <b>declaring smart
9904  * interfaces</b> besides the smart callbacks.
9905  *
9906  * @param smart_name The name used for the smart class. e.g:
9907  *                   @c "Evas_Object_Box".
9908  * @param prefix Prefix used for all variables and functions defined
9909  *               and referenced by this macro.
9910  * @param api_type Type of the structure used as API for the smart
9911  *                 class. Either #Evas_Smart_Class or something
9912  *                 derived from it.
9913  * @param parent_type Type of the parent class API.
9914  * @param parent_func Function that gets the parent class. e.g:
9915  *                    evas_object_box_smart_class_get().
9916  * @param cb_desc Array of smart callback descriptions for this smart
9917  *                class.
9918  * @param ifaces Array of Evas smart interafaces for this smart
9919  *               class.
9920  *
9921  * This macro saves some typing when writing a smart class derived
9922  * from another one. In order to work, the user @b must provide some
9923  * functions adhering to the following guidelines:
9924  *  - @<prefix@>_smart_set_user(): the @b internal @c _smart_set
9925  *    function (defined by this macro) will call this one, provided by
9926  *    the user, after inheriting everything from the parent, which
9927  *    should <b>take care of setting the right member functions for
9928  *    the class</b>, both overrides and extensions, if any.
9929  *  - If this new class should be subclassable as well, a @b public
9930  *    @c _smart_set() function is desirable to fill in the class used as
9931  *    parent by the children. It's up to the user to provide this
9932  *    interface, which will most likely call @<prefix@>_smart_set() to
9933  *    get the job done.
9934  *
9935  * After the macro's usage, the following will be defined for use:
9936  *  - @<prefix@>_parent_sc: A pointer to the @b parent smart
9937  *    class. When calling parent functions from overloaded ones, use
9938  *    this global variable.
9939  *  - @<prefix@>_smart_class_new(): this function returns the
9940  *    #Evas_Smart needed to create smart objects with this class,
9941  *    which should be passed to evas_object_smart_add().
9942  *
9943  * @warning @p smart_name has to be a pointer to a globally available
9944  * string! The smart class created here will just have a pointer set
9945  * to that, and all object instances will depend on it for smart class
9946  * name lookup.
9947  *
9948  * @ingroup Evas_Smart_Group
9949  */
9950 #define EVAS_SMART_SUBCLASS_IFACE_NEW(smart_name,          \
9951                                       prefix,              \
9952                                       api_type,            \
9953                                       parent_type,         \
9954                                       parent_func,         \
9955                                       cb_desc,             \
9956                                       ifaces)              \
9957   static const parent_type * prefix##_parent_sc = NULL;    \
9958   static void prefix##_smart_set_user(api_type * api);     \
9959   static void prefix##_smart_set(api_type * api)           \
9960   {                                                        \
9961      Evas_Smart_Class *sc;                                 \
9962      if (!(sc = (Evas_Smart_Class *)api))                  \
9963        return;                                             \
9964      if (!prefix##_parent_sc)                              \
9965        prefix##_parent_sc = parent_func();                 \
9966      evas_smart_class_inherit(sc, prefix##_parent_sc);     \
9967      prefix##_smart_set_user(api);                         \
9968   }                                                        \
9969   static Evas_Smart *prefix##_smart_class_new(void)        \
9970   {                                                        \
9971      static Evas_Smart *smart = NULL;                      \
9972      static api_type api;                                  \
9973      if (!smart)                                           \
9974        {                                                   \
9975           Evas_Smart_Class *sc = (Evas_Smart_Class *)&api; \
9976           memset(&api, 0, sizeof(api_type));               \
9977           sc->version = EVAS_SMART_CLASS_VERSION;          \
9978           sc->name = smart_name;                           \
9979           sc->callbacks = cb_desc;                         \
9980           sc->interfaces = ifaces;                         \
9981           prefix##_smart_set(&api);                        \
9982           smart = evas_smart_class_new(sc);                \
9983        }                                                   \
9984      return smart;                                         \
9985   }
9986
9987 /**
9988  * @def EVAS_SMART_DATA_ALLOC
9989  *
9990  * Convenience macro to allocate smart data only if needed.
9991  *
9992  * When writing a subclassable smart object, the @c .add() function
9993  * will need to check if the smart private data was already allocated
9994  * by some child object or not. This macro makes it easier to do it.
9995  *
9996  * @note This is an idiom used when one calls the parent's @c .add()
9997  * after the specialized code. Naturally, the parent's base smart data
9998  * has to be contemplated as the specialized one's first member, for
9999  * things to work.
10000  *
10001  * @param o Evas object passed to the @c .add() function
10002  * @param priv_type The type of the data to allocate
10003  *
10004  * @ingroup Evas_Smart_Group
10005  */
10006 #define EVAS_SMART_DATA_ALLOC(o, priv_type)              \
10007   priv_type * priv;                                      \
10008   priv = evas_object_smart_data_get(o);                  \
10009   if (!priv) {                                           \
10010        priv = (priv_type *)calloc(1, sizeof(priv_type)); \
10011        if (!priv) return;                                \
10012        evas_object_smart_data_set(o, priv);              \
10013     }
10014
10015 /**
10016  * Free an #Evas_Smart struct
10017  *
10018  * @param s the #Evas_Smart struct to free
10019  *
10020  * @warning If this smart handle was created using
10021  * evas_smart_class_new(), the associated #Evas_Smart_Class will not
10022  * be freed.
10023  *
10024  * @note If you're using the #EVAS_SMART_SUBCLASS_NEW schema to create your
10025  * smart object, note that an #Evas_Smart handle will be shared amongst all
10026  * instances of the given smart class, through a static variable.
10027  * Evas will internally count references on #Evas_Smart handles and free them
10028  * when they are not referenced anymore. Thus, this function is of no use
10029  * for Evas users, most probably.
10030  */
10031 EAPI void                              evas_smart_free(Evas_Smart *s) EINA_ARG_NONNULL(1);
10032
10033 /**
10034  * Creates a new #Evas_Smart from a given #Evas_Smart_Class struct
10035  *
10036  * @param sc the smart class definition
10037  * @return a new #Evas_Smart pointer
10038  *
10039  * #Evas_Smart handles are necessary to create new @b instances of
10040  * smart objects belonging to the class described by @p sc. That
10041  * handle will contain, besides the smart class interface definition,
10042  * all its smart callbacks infrastructure set, too.
10043  *
10044  * @note If you are willing to subclass a given smart class to
10045  * construct yours, consider using the #EVAS_SMART_SUBCLASS_NEW macro,
10046  * which will make use of this function automatically for you.
10047  */
10048 EAPI Evas_Smart                       *evas_smart_class_new(const Evas_Smart_Class *sc) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
10049
10050 /**
10051  * Get the #Evas_Smart_Class handle of an #Evas_Smart struct
10052  *
10053  * @param s a valid #Evas_Smart pointer
10054  * @return the #Evas_Smart_Class in it
10055  */
10056 EAPI const Evas_Smart_Class           *evas_smart_class_get(const Evas_Smart *s) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
10057
10058 /**
10059  * @brief Get the data pointer set on an #Evas_Smart struct
10060  *
10061  * @param s a valid #Evas_Smart handle
10062  *
10063  * This data pointer is set as the data field in the #Evas_Smart_Class
10064  * passed in to evas_smart_class_new().
10065  */
10066 EAPI void                             *evas_smart_data_get(const Evas_Smart *s) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
10067
10068 /**
10069  * Get the smart callbacks known by this #Evas_Smart handle's smart
10070  * class hierarchy.
10071  *
10072  * @param s A valid #Evas_Smart handle.
10073  * @param[out] count Returns the number of elements in the returned
10074  * array.
10075  * @return The array with callback descriptions known by this smart
10076  *         class, with its size returned in @a count parameter. It
10077  *         should not be modified in any way. If no callbacks are
10078  *         known, @c NULL is returned. The array is sorted by event
10079  *         names and elements refer to the original values given to
10080  *         evas_smart_class_new()'s Evas_Smart_Class::callbacks
10081  *         (pointer to them).
10082  *
10083  * This is likely different from
10084  * evas_object_smart_callbacks_descriptions_get() as it will contain
10085  * the callbacks of @b all this class hierarchy sorted, while the
10086  * direct smart class member refers only to that specific class and
10087  * should not include parent's.
10088  *
10089  * If no callbacks are known, this function returns @c NULL.
10090  *
10091  * The array elements and thus their contents will be @b references to
10092  * original values given to evas_smart_class_new() as
10093  * Evas_Smart_Class::callbacks.
10094  *
10095  * The array is sorted by Evas_Smart_Cb_Description::name. The last
10096  * array element is a @c NULL pointer and is not accounted for in @a
10097  * count. Loop iterations can check any of these size indicators.
10098  *
10099  * @note objects may provide per-instance callbacks, use
10100  *       evas_object_smart_callbacks_descriptions_get() to get those
10101  *       as well.
10102  * @see evas_object_smart_callbacks_descriptions_get()
10103  */
10104 EAPI const Evas_Smart_Cb_Description **evas_smart_callbacks_descriptions_get(const Evas_Smart *s, unsigned int *count) EINA_ARG_NONNULL(1, 1);
10105
10106 /**
10107  * Find a callback description for the callback named @a name.
10108  *
10109  * @param s The #Evas_Smart where to search for class registered smart
10110  * event callbacks.
10111  * @param name Name of the desired callback, which must @b not be @c
10112  *        NULL. The search has a special case for @a name being the
10113  *        same pointer as registered with #Evas_Smart_Cb_Description.
10114  *        One can use it to avoid excessive use of strcmp().
10115  * @return A reference to the description if found, or @c NULL, otherwise
10116  *
10117  * @see evas_smart_callbacks_descriptions_get()
10118  */
10119 EAPI const Evas_Smart_Cb_Description  *evas_smart_callback_description_find(const Evas_Smart *s, const char *name) EINA_ARG_NONNULL(1, 2);
10120
10121 /**
10122  * Sets one class to inherit from the other.
10123  *
10124  * Copy all function pointers, set @c parent to @a parent_sc and copy
10125  * everything after sizeof(Evas_Smart_Class) present in @a parent_sc,
10126  * using @a parent_sc_size as reference.
10127  *
10128  * This is recommended instead of a single memcpy() since it will take
10129  * care to not modify @a sc name, version, callbacks and possible
10130  * other members.
10131  *
10132  * @param sc child class.
10133  * @param parent_sc parent class, will provide attributes.
10134  * @param parent_sc_size size of parent_sc structure, child should be at least
10135  *        this size. Everything after @c Evas_Smart_Class size is copied
10136  *        using regular memcpy().
10137  */
10138 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);
10139
10140 /**
10141  * Get the number of users of the smart instance
10142  *
10143  * @param s The Evas_Smart to get the usage count of
10144  * @return The number of uses of the smart instance
10145  *
10146  * This function tells you how many more uses of the smart instance are in
10147  * existence. This should be used before freeing/clearing any of the
10148  * Evas_Smart_Class that was used to create the smart instance. The smart
10149  * instance will refer to data in the Evas_Smart_Class used to create it and
10150  * thus you cannot remove the original data until all users of it are gone.
10151  * When the usage count goes to 0, you can evas_smart_free() the smart
10152  * instance @p s and remove from memory any of the Evas_Smart_Class that
10153  * was used to create the smart instance, if you desire. Removing it from
10154  * memory without doing this will cause problems (crashes, undefined
10155  * behavior etc. etc.), so either never remove the original
10156  * Evas_Smart_Class data from memory (have it be a constant structure and
10157  * data), or use this API call and be very careful.
10158  */
10159 EAPI int                               evas_smart_usage_get(const Evas_Smart *s);
10160
10161 /**
10162  * @def evas_smart_class_inherit
10163  * Easy to use version of evas_smart_class_inherit_full().
10164  *
10165  * This version will use sizeof(parent_sc), copying everything.
10166  *
10167  * @param sc child class, will have methods copied from @a parent_sc
10168  * @param parent_sc parent class, will provide contents to be copied.
10169  * @return 1 on success, 0 on failure.
10170  * @ingroup Evas_Smart_Group
10171  */
10172 #define evas_smart_class_inherit(sc, parent_sc) evas_smart_class_inherit_full(sc, (Evas_Smart_Class *)parent_sc, sizeof(*parent_sc))
10173
10174 /**
10175  * @}
10176  */
10177
10178 /**
10179  * @defgroup Evas_Smart_Object_Group Smart Object Functions
10180  *
10181  * Functions dealing with Evas smart objects (instances).
10182  *
10183  * Smart objects are groupings of primitive Evas objects that behave
10184  * as a cohesive group. For instance, a file manager icon may be a
10185  * smart object composed of an image object, a text label and two
10186  * rectangles that appear behind the image and text when the icon is
10187  * selected. As a smart object, the normal Evas object API could be
10188  * used on the icon object.
10189  *
10190  * Besides that, generally smart objects implement a <b>specific
10191  * API</b>, so that users interact with its own custom features. The
10192  * API takes form of explicit exported functions one may call and
10193  * <b>smart callbacks</b>.
10194  *
10195  * @section Evas_Smart_Object_Group_Callbacks Smart events and callbacks
10196  *
10197  * Smart objects can elect events (smart events, from now on) occurring
10198  * inside of them to be reported back to their users via callback
10199  * functions (smart callbacks). This way, you can extend Evas' own
10200  * object events. They are defined by an <b>event string</b>, which
10201  * identifies them uniquely. There's also a function prototype
10202  * definition for the callback functions: #Evas_Smart_Cb.
10203  *
10204  * When defining an #Evas_Smart_Class, smart object implementors are
10205  * strongly encouraged to properly set the Evas_Smart_Class::callbacks
10206  * callbacks description array, so that the users of the smart object
10207  * can have introspection on its events API <b>at run time</b>.
10208  *
10209  * See some @ref Example_Evas_Smart_Objects "examples" of this group
10210  * of functions.
10211  *
10212  * @see @ref Evas_Smart_Group for class definitions.
10213  */
10214
10215 /**
10216  * @addtogroup Evas_Smart_Object_Group
10217  * @{
10218  */
10219
10220 /**
10221  * Instantiates a new smart object described by @p s.
10222  *
10223  * @param e the canvas on which to add the object
10224  * @param s the #Evas_Smart describing the smart object
10225  * @return a new #Evas_Object handle
10226  *
10227  * This is the function one should use when defining the public
10228  * function @b adding an instance of the new smart object to a given
10229  * canvas. It will take care of setting all of its internals to work
10230  * as they should, if the user set things properly, as seem on the
10231  * #EVAS_SMART_SUBCLASS_NEW, for example.
10232  *
10233  * @ingroup Evas_Smart_Object_Group
10234  */
10235 EAPI Evas_Object *evas_object_smart_add(Evas *e, Evas_Smart *s) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2) EINA_MALLOC;
10236
10237 /**
10238  * Set an Evas object as a member of a given smart object.
10239  *
10240  * @param obj The member object
10241  * @param smart_obj The smart object
10242  *
10243  * Members will automatically be stacked and layered together with the
10244  * smart object. The various stacking functions will operate on
10245  * members relative to the other members instead of the entire canvas,
10246  * since they now live on an exclusive layer (see
10247  * evas_object_stack_above(), for more details).
10248  *
10249  * Any @p smart_obj object's specific implementation of the @c
10250  * member_add() smart function will take place too, naturally.
10251  *
10252  * @see evas_object_smart_member_del()
10253  * @see evas_object_smart_members_get()
10254  *
10255  * @ingroup Evas_Smart_Object_Group
10256  */
10257 EAPI void         evas_object_smart_member_add(Evas_Object *obj, Evas_Object *smart_obj) EINA_ARG_NONNULL(1, 2);
10258
10259 /**
10260  * Removes a member object from a given smart object.
10261  *
10262  * @param obj the member object
10263  * @ingroup Evas_Smart_Object_Group
10264  *
10265  * This removes a member object from a smart object, if it was added
10266  * to any. The object will still be on the canvas, but no longer
10267  * associated with whichever smart object it was associated with.
10268  *
10269  * @see evas_object_smart_member_add() for more details
10270  * @see evas_object_smart_members_get()
10271  */
10272 EAPI void         evas_object_smart_member_del(Evas_Object *obj) EINA_ARG_NONNULL(1);
10273
10274 /**
10275  * Retrieves the list of the member objects of a given Evas smart
10276  * object
10277  *
10278  * @param obj the smart object to get members from
10279  * @return Returns the list of the member objects of @p obj.
10280  *
10281  * The returned list should be freed with @c eina_list_free() when you
10282  * no longer need it.
10283  *
10284  * @since 1.7 This function will return @c NULL when a non-smart object is passed.
10285  *
10286  * @see evas_object_smart_member_add()
10287  * @see evas_object_smart_member_del()
10288  */
10289 EAPI Eina_List   *evas_object_smart_members_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
10290
10291 /**
10292  * Gets the parent smart object of a given Evas object, if it has one.
10293  *
10294  * @param obj the Evas object you want to get the parent smart object
10295  * from
10296  * @return Returns the parent smart object of @a obj or @c NULL, if @a
10297  * obj is not a smart member of any
10298  *
10299  * @ingroup Evas_Smart_Object_Group
10300  */
10301 EAPI Evas_Object *evas_object_smart_parent_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
10302
10303 /**
10304  * Checks whether a given smart object or any of its smart object
10305  * parents is of a given smart class.
10306  *
10307  * @param obj An Evas smart object to check the type of
10308  * @param type The @b name (type) of the smart class to check for
10309  * @return @c EINA_TRUE, if @a obj or any of its parents is of type @a
10310  * type, @c EINA_FALSE otherwise
10311  *
10312  * If @p obj is not a smart object, this call will fail
10313  * immediately. Otherwise, make sure evas_smart_class_inherit() or its
10314  * sibling functions were used correctly when creating the smart
10315  * object's class, so it has a valid @b parent smart class pointer
10316  * set.
10317  *
10318  * The checks use smart classes names and <b>string
10319  * comparison</b>. There is a version of this same check using
10320  * <b>pointer comparison</b>, since a smart class' name is a single
10321  * string in Evas.
10322  *
10323  * @see evas_object_smart_type_check_ptr()
10324  * @see #EVAS_SMART_SUBCLASS_NEW
10325  *
10326  * @ingroup Evas_Smart_Object_Group
10327  */
10328 EAPI Eina_Bool    evas_object_smart_type_check(const Evas_Object *obj, const char *type) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2);
10329
10330 /**
10331  * Checks whether a given smart object or any of its smart object
10332  * parents is of a given smart class, <b>using pointer comparison</b>.
10333  *
10334  * @param obj An Evas smart object to check the type of
10335  * @param type The type (name string) to check for. Must be the name
10336  * @return @c EINA_TRUE, if @a obj or any of its parents is of type @a
10337  * type, @c EINA_FALSE otherwise
10338  *
10339  * @see evas_object_smart_type_check() for more details
10340  *
10341  * @ingroup Evas_Smart_Object_Group
10342  */
10343 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);
10344
10345 /**
10346  * Get the #Evas_Smart from which @p obj smart object was created.
10347  *
10348  * @param obj a smart object
10349  * @return the #Evas_Smart handle or @c NULL, on errors
10350  *
10351  * @ingroup Evas_Smart_Object_Group
10352  */
10353 EAPI Evas_Smart  *evas_object_smart_smart_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
10354
10355 /**
10356  * Retrieve user data stored on a given smart object.
10357  *
10358  * @param obj The smart object's handle
10359  * @return A pointer to data stored using
10360  *         evas_object_smart_data_set(), or @c NULL, if none has been
10361  *         set.
10362  *
10363  * @see evas_object_smart_data_set()
10364  *
10365  * @ingroup Evas_Smart_Object_Group
10366  */
10367 EAPI void        *evas_object_smart_data_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
10368
10369 /**
10370  * Store a pointer to user data for a given smart object.
10371  *
10372  * @param obj The smart object's handle
10373  * @param data A pointer to user data
10374  *
10375  * This data is stored @b independently of the one set by
10376  * evas_object_data_set(), naturally.
10377  *
10378  * @see evas_object_smart_data_get()
10379  *
10380  * @ingroup Evas_Smart_Object_Group
10381  */
10382 EAPI void         evas_object_smart_data_set(Evas_Object *obj, void *data) EINA_ARG_NONNULL(1);
10383
10384 /**
10385  * Add (register) a callback function to the smart event specified by
10386  * @p event on the smart object @p obj.
10387  *
10388  * @param obj a smart object
10389  * @param event the event's name string
10390  * @param func the callback function
10391  * @param data user data to be passed to the callback function
10392  *
10393  * Smart callbacks look very similar to Evas callbacks, but are
10394  * implemented as smart object's custom ones.
10395  *
10396  * This function adds a function callback to an smart object when the
10397  * event named @p event occurs in it. The function is @p func.
10398  *
10399  * In the event of a memory allocation error during addition of the
10400  * callback to the object, evas_alloc_error() should be used to
10401  * determine the nature of the error, if any, and the program should
10402  * sensibly try and recover.
10403  *
10404  * A smart callback function must have the ::Evas_Smart_Cb prototype
10405  * definition. The first parameter (@p data) in this definition will
10406  * have the same value passed to evas_object_smart_callback_add() as
10407  * the @p data parameter, at runtime. The second parameter @p obj is a
10408  * handle to the object on which the event occurred. The third
10409  * parameter, @p event_info, is a pointer to data which is totally
10410  * dependent on the smart object's implementation and semantic for the
10411  * given event.
10412  *
10413  * There is an infrastructure for introspection on smart objects'
10414  * events (see evas_smart_callbacks_descriptions_get()), but no
10415  * internal smart objects on Evas implement them yet.
10416  *
10417  * @see @ref Evas_Smart_Object_Group_Callbacks for more details.
10418  *
10419  * @see evas_object_smart_callback_del()
10420  * @ingroup Evas_Smart_Object_Group
10421  */
10422 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);
10423
10424 /**
10425  * Add (register) a callback function to the smart event specified by
10426  * @p event on the smart object @p obj. Except for the priority field,
10427  * it's exactly the same as @ref evas_object_smart_callback_add
10428  *
10429  * @param obj a smart object
10430  * @param event the event's name string
10431  * @param priority The priority of the callback, lower values called first.
10432  * @param func the callback function
10433  * @param data user data to be passed to the callback function
10434  *
10435  * @see evas_object_smart_callback_add
10436  * @since 1.1
10437  * @ingroup Evas_Smart_Object_Group
10438  */
10439 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);
10440
10441 /**
10442  * Delete (unregister) a callback function from the smart event
10443  * specified by @p event on the smart object @p obj.
10444  *
10445  * @param obj a smart object
10446  * @param event the event's name string
10447  * @param func the callback function
10448  * @return the data pointer
10449  *
10450  * This function removes <b>the first</b> added smart callback on the
10451  * object @p obj matching the event name @p event and the registered
10452  * function pointer @p func. If the removal is successful it will also
10453  * return the data pointer that was passed to
10454  * evas_object_smart_callback_add() (that will be the same as the
10455  * parameter) when the callback(s) was(were) added to the canvas. If
10456  * not successful @c NULL will be returned.
10457  *
10458  * @see evas_object_smart_callback_add() for more details.
10459  *
10460  * @ingroup Evas_Smart_Object_Group
10461  */
10462 EAPI void        *evas_object_smart_callback_del(Evas_Object *obj, const char *event, Evas_Smart_Cb func) EINA_ARG_NONNULL(1, 2, 3);
10463
10464 /**
10465  * Delete (unregister) a callback function from the smart event
10466  * specified by @p event on the smart object @p obj.
10467  *
10468  * @param obj a smart object
10469  * @param event the event's name string
10470  * @param func the callback function
10471  * @param data the data pointer that was passed to the callback
10472  * @return the data pointer
10473  *
10474  * This function removes <b>the first</b> added smart callback on the
10475  * object @p obj matching the event name @p event, the registered
10476  * function pointer @p func and the callback data pointer @p data. If
10477  * the removal is successful it will also return the data pointer that
10478  * was passed to evas_object_smart_callback_add() (that will be the same
10479  * as the parameter) when the callback(s) was(were) added to the canvas.
10480  * If not successful @c NULL will be returned. A common use would be to
10481  * remove an exact match of a callback
10482  *
10483  * @see evas_object_smart_callback_add() for more details.
10484  * @since 1.2
10485  * @ingroup Evas_Smart_Object_Group
10486  *
10487  * @note To delete all smart event callbacks which match @p type and @p func,
10488  * use evas_object_smart_callback_del().
10489  */
10490 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);
10491
10492 /**
10493  * Call a given smart callback on the smart object @p obj.
10494  *
10495  * @param obj the smart object
10496  * @param event the event's name string
10497  * @param event_info pointer to an event specific struct or information to
10498  * pass to the callback functions registered on this smart event
10499  *
10500  * This should be called @b internally, from the smart object's own
10501  * code, when some specific event has occurred and the implementor
10502  * wants is to pertain to the object's events API (see @ref
10503  * Evas_Smart_Object_Group_Callbacks). The documentation for the smart
10504  * object should include a list of possible events and what type of @p
10505  * event_info to expect for each of them. Also, when defining an
10506  * #Evas_Smart_Class, smart object implementors are strongly
10507  * encouraged to properly set the Evas_Smart_Class::callbacks
10508  * callbacks description array, so that the users of the smart object
10509  * can have introspection on its events API <b>at run time</b>.
10510  *
10511  * @ingroup Evas_Smart_Object_Group
10512  */
10513 EAPI void         evas_object_smart_callback_call(Evas_Object *obj, const char *event, void *event_info) EINA_ARG_NONNULL(1, 2);
10514
10515 /**
10516  * Set an smart object @b instance's smart callbacks descriptions.
10517  *
10518  * @param obj A smart object
10519  * @param descriptions @c NULL terminated array with
10520  * #Evas_Smart_Cb_Description descriptions. Array elements won't be
10521  * modified at run time, but references to them and their contents
10522  * will be made, so this array should be kept alive during the whole
10523  * object's lifetime.
10524  * @return @c EINA_TRUE on success, @c EINA_FALSE on failure.
10525  *
10526  * These descriptions are hints to be used by introspection and are
10527  * not enforced in any way.
10528  *
10529  * It will not be checked if instance callbacks descriptions have the
10530  * same name as respective possibly registered in the smart object
10531  * @b class. Both are kept in different arrays and users of
10532  * evas_object_smart_callbacks_descriptions_get() should handle this
10533  * case as they wish.
10534  *
10535  * @note Becase @p descriptions must be @c NULL terminated, and
10536  *        because a @c NULL name makes little sense, too,
10537  *        Evas_Smart_Cb_Description::name must @b not be @c NULL.
10538  *
10539  * @note While instance callbacks descriptions are possible, they are
10540  *       @b not recommended. Use @b class callbacks descriptions
10541  *       instead as they make you smart object user's life simpler and
10542  *       will use less memory, as descriptions and arrays will be
10543  *       shared among all instances.
10544  *
10545  * @ingroup Evas_Smart_Object_Group
10546  */
10547 EAPI Eina_Bool    evas_object_smart_callbacks_descriptions_set(Evas_Object *obj, const Evas_Smart_Cb_Description *descriptions) EINA_ARG_NONNULL(1);
10548
10549 /**
10550  * Retrieve an smart object's know smart callback descriptions (both
10551  * instance and class ones).
10552  *
10553  * @param obj The smart object to get callback descriptions from.
10554  * @param class_descriptions Where to store class callbacks
10555  *        descriptions array, if any is known. If no descriptions are
10556  *        known, @c NULL is returned
10557  * @param class_count Returns how many class callbacks descriptions
10558  *        are known.
10559  * @param instance_descriptions Where to store instance callbacks
10560  *        descriptions array, if any is known. If no descriptions are
10561  *        known, @c NULL is returned.
10562  * @param instance_count Returns how many instance callbacks
10563  *        descriptions are known.
10564  *
10565  * This call searches for registered callback descriptions for both
10566  * instance and class of the given smart object. These arrays will be
10567  * sorted by Evas_Smart_Cb_Description::name and also @c NULL
10568  * terminated, so both @a class_count and @a instance_count can be
10569  * ignored, if the caller wishes so. The terminator @c NULL is not
10570  * counted in these values.
10571  *
10572  * @note If just class descriptions are of interest, try
10573  *       evas_smart_callbacks_descriptions_get() instead.
10574  *
10575  * @note Use @c NULL pointers on the descriptions/counters you're not
10576  * interested in: they'll be ignored by the function.
10577  *
10578  * @see evas_smart_callbacks_descriptions_get()
10579  *
10580  * @ingroup Evas_Smart_Object_Group
10581  */
10582 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);
10583
10584 /**
10585  * Find callback description for callback called @a name.
10586  *
10587  * @param obj the smart object.
10588  * @param name name of desired callback, must @b not be @c NULL.  The
10589  *        search have a special case for @a name being the same
10590  *        pointer as registered with Evas_Smart_Cb_Description, one
10591  *        can use it to avoid excessive use of strcmp().
10592  * @param class_description pointer to return class description or
10593  *        @c NULL if not found. If parameter is @c NULL, no search will
10594  *        be done on class descriptions.
10595  * @param instance_description pointer to return instance description
10596  *        or @c NULL if not found. If parameter is @c NULL, no search
10597  *        will be done on instance descriptions.
10598  * @return reference to description if found, @c NULL if not found.
10599  */
10600 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);
10601
10602 /**
10603  * Retrieve an Evas smart object's interface, by name string pointer.
10604  *
10605  * @param obj An Evas smart object.
10606  * @param name Name string of the desired interface, which must be the
10607  *             same pointer used at the interface's declarion, when
10608  *             creating the smart object @a obj.
10609  *
10610  * @since 1.7
10611  *
10612  * @return The interface's handle pointer, if found, @c NULL
10613  * otherwise.
10614  */
10615 const void       *evas_object_smart_interface_get(const Evas_Object *obj, const char *name);
10616
10617 /**
10618  * Retrieve an Evas smart object interface's <b>private data</b>.
10619  *
10620  * @param obj An Evas smart object.
10621  * @param iface The given object's interface handle.
10622  *
10623  * @since 1.7
10624  *
10625  * @return The object interface's private data blob pointer, if found,
10626  * @c NULL otherwise.
10627  */
10628 void             *evas_object_smart_interface_data_get(const Evas_Object *obj, const Evas_Smart_Interface *iface);
10629
10630 /**
10631  * Mark smart object as changed, dirty.
10632  *
10633  * @param obj The given Evas smart object
10634  *
10635  * This will flag the given object as needing recalculation,
10636  * forcefully. As an effect, on the next rendering cycle it's @b
10637  * calculate() (see #Evas_Smart_Class) smart function will be called.
10638  *
10639  * @see evas_object_smart_need_recalculate_set().
10640  * @see evas_object_smart_calculate().
10641  *
10642  * @ingroup Evas_Smart_Object_Group
10643  */
10644 EAPI void         evas_object_smart_changed(Evas_Object *obj) EINA_ARG_NONNULL(1);
10645
10646 /**
10647  * Set or unset the flag signalling that a given smart object needs to
10648  * get recalculated.
10649  *
10650  * @param obj the smart object
10651  * @param value whether one wants to set (@c EINA_TRUE) or to unset
10652  * (@c EINA_FALSE) the flag.
10653  *
10654  * If this flag is set, then the @c calculate() smart function of @p
10655  * obj will be called, if one is provided, during rendering phase of
10656  * Evas (see evas_render()), after which this flag will be
10657  * automatically unset.
10658  *
10659  * If that smart function is not provided for the given object, this
10660  * flag will be left unchanged.
10661  *
10662  * @note just setting this flag will not make the canvas' whole scene
10663  *       dirty, by itself, and evas_render() will have no effect. To
10664  *       force that, use evas_object_smart_changed(), that will also
10665  *       automatically call this function automatically, with
10666  *       @c EINA_TRUE as parameter.
10667  *
10668  * @see evas_object_smart_need_recalculate_get()
10669  * @see evas_object_smart_calculate()
10670  * @see evas_smart_objects_calculate()
10671  *
10672  * @ingroup Evas_Smart_Object_Group
10673  */
10674 EAPI void         evas_object_smart_need_recalculate_set(Evas_Object *obj, Eina_Bool value) EINA_ARG_NONNULL(1);
10675
10676 /**
10677  * Get the value of the flag signalling that a given smart object needs to
10678  * get recalculated.
10679  *
10680  * @param obj the smart object
10681  * @return if flag is set or not.
10682  *
10683  * @note this flag will be unset during the rendering phase, when the
10684  *       @c calculate() smart function is called, if one is provided.
10685  *       If it's not provided, then the flag will be left unchanged
10686  *       after the rendering phase.
10687  *
10688  * @see evas_object_smart_need_recalculate_set(), for more details
10689  *
10690  * @ingroup Evas_Smart_Object_Group
10691  */
10692 EAPI Eina_Bool    evas_object_smart_need_recalculate_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
10693
10694 /**
10695  * Call the @b calculate() smart function immediately on a given smart
10696  * object.
10697  *
10698  * @param obj the smart object's handle
10699  *
10700  * This will force immediate calculations (see #Evas_Smart_Class)
10701  * needed for renderization of this object and, besides, unset the
10702  * flag on it telling it needs recalculation for the next rendering
10703  * phase.
10704  *
10705  * @see evas_object_smart_need_recalculate_set()
10706  *
10707  * @ingroup Evas_Smart_Object_Group
10708  */
10709 EAPI void         evas_object_smart_calculate(Evas_Object *obj) EINA_ARG_NONNULL(1);
10710
10711 /**
10712  * Call user-provided @c calculate() smart functions and unset the
10713  * flag signalling that the object needs to get recalculated to @b all
10714  * smart objects in the canvas.
10715  *
10716  * @param e The canvas to calculate all smart objects in
10717  *
10718  * @see evas_object_smart_need_recalculate_set()
10719  *
10720  * @ingroup Evas_Smart_Object_Group
10721  */
10722 EAPI void         evas_smart_objects_calculate(Evas *e);
10723
10724 /**
10725  * This gets the internal counter that counts the number of smart calculations
10726  *
10727  * @param e The canvas to get the calculate counter from
10728  *
10729  * Whenever evas performs smart object calculations on the whole canvas
10730  * it increments a counter by 1. This is the smart object calculate counter
10731  * that this function returns the value of. It starts at the value of 0 and
10732  * will increase (and eventually wrap around to negative values and so on) by
10733  * 1 every time objects are calculated. You can use this counter to ensure
10734  * you don't re-do calculations withint the same calculation generation/run
10735  * if the calculations maybe cause self-feeding effects.
10736  *
10737  * @ingroup Evas_Smart_Object_Group
10738  * @since 1.1
10739  */
10740 EAPI int          evas_smart_objects_calculate_count_get(const Evas *e);
10741
10742 /**
10743  * Moves all children objects of a given smart object relative to a
10744  * given offset.
10745  *
10746  * @param obj the smart object.
10747  * @param dx horizontal offset (delta).
10748  * @param dy vertical offset (delta).
10749  *
10750  * This will make each of @p obj object's children to move, from where
10751  * they before, with those delta values (offsets) on both directions.
10752  *
10753  * @note This is most useful on custom smart @c move() functions.
10754  *
10755  * @note Clipped smart objects already make use of this function on
10756  * their @c move() smart function definition.
10757  */
10758 EAPI void         evas_object_smart_move_children_relative(Evas_Object *obj, Evas_Coord dx, Evas_Coord dy) EINA_ARG_NONNULL(1);
10759
10760 /**
10761  * @}
10762  */
10763
10764 /**
10765  * @defgroup Evas_Smart_Object_Clipped Clipped Smart Object
10766  *
10767  * Clipped smart object is a base to construct other smart objects
10768  * based on the concept of having an internal clipper that is applied
10769  * to all children objects. This clipper will control the visibility,
10770  * clipping and color of sibling objects (remember that the clipping
10771  * is recursive, and clipper color modulates the color of its
10772  * clippees). By default, this base will also move children relatively
10773  * to the parent, and delete them when parent is deleted. In other
10774  * words, it is the base for simple object grouping.
10775  *
10776  * See some @ref Example_Evas_Smart_Objects "examples" of this group
10777  * of functions.
10778  *
10779  * @see evas_object_smart_clipped_smart_set()
10780  *
10781  * @ingroup Evas_Smart_Object_Group
10782  */
10783
10784 /**
10785  * @addtogroup Evas_Smart_Object_Clipped
10786  * @{
10787  */
10788
10789 /**
10790  * Every subclass should provide this at the beginning of their own
10791  * data set with evas_object_smart_data_set().
10792  */
10793 typedef struct _Evas_Object_Smart_Clipped_Data Evas_Object_Smart_Clipped_Data;
10794 struct _Evas_Object_Smart_Clipped_Data
10795 {
10796    Evas_Object *clipper;
10797    Evas        *evas;
10798 };
10799
10800 /**
10801  * Get the clipper object for the given clipped smart object.
10802  *
10803  * @param obj the clipped smart object to retrieve associated clipper
10804  * from.
10805  * @return the clipper object.
10806  *
10807  * Use this function if you want to change any of this clipper's
10808  * properties, like colors.
10809  *
10810  * @see evas_object_smart_clipped_smart_add()
10811  */
10812 EAPI Evas_Object            *evas_object_smart_clipped_clipper_get(Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
10813
10814 /**
10815  * Set a given smart class' callbacks so it implements the <b>clipped smart
10816  * object"</b>'s interface.
10817  *
10818  * @param sc The smart class handle to operate on
10819  *
10820  * This call will assign all the required methods of the @p sc
10821  * #Evas_Smart_Class instance to the implementations set for clipped
10822  * smart objects. If one wants to "subclass" it, call this function
10823  * and then override desired values. If one wants to call any original
10824  * method, save it somewhere. Example:
10825  *
10826  * @code
10827  * static Evas_Smart_Class parent_sc = EVAS_SMART_CLASS_INIT_NULL;
10828  *
10829  * static void my_class_smart_add(Evas_Object *o)
10830  * {
10831  *    parent_sc.add(o);
10832  *    evas_object_color_set(evas_object_smart_clipped_clipper_get(o),
10833  *                          255, 0, 0, 255);
10834  * }
10835  *
10836  * Evas_Smart_Class *my_class_new(void)
10837  * {
10838  *    static Evas_Smart_Class sc = EVAS_SMART_CLASS_INIT_NAME_VERSION("MyClass");
10839  *    if (!parent_sc.name)
10840  *      {
10841  *         evas_object_smart_clipped_smart_set(&sc);
10842  *         parent_sc = sc;
10843  *         sc.add = my_class_smart_add;
10844  *      }
10845  *    return &sc;
10846  * }
10847  * @endcode
10848  *
10849  * Default behavior for each of #Evas_Smart_Class functions on a
10850  * clipped smart object are:
10851  * - @c add: creates a hidden clipper with "infinite" size, to clip
10852  *    any incoming members;
10853  * - @c del: delete all children objects;
10854  * - @c move: move all objects relative relatively;
10855  * - @c resize: <b>not defined</b>;
10856  * - @c show: if there are children objects, show clipper;
10857  * - @c hide: hides clipper;
10858  * - @c color_set: set the color of clipper;
10859  * - @c clip_set: set clipper of clipper;
10860  * - @c clip_unset: unset the clipper of clipper;
10861  *
10862  * @note There are other means of assigning parent smart classes to
10863  * child ones, like the #EVAS_SMART_SUBCLASS_NEW macro or the
10864  * evas_smart_class_inherit_full() function.
10865  */
10866 EAPI void                    evas_object_smart_clipped_smart_set(Evas_Smart_Class *sc) EINA_ARG_NONNULL(1);
10867
10868 /**
10869  * Get a pointer to the <b>clipped smart object's</b> class, to use
10870  * for proper inheritance
10871  *
10872  * @see #Evas_Smart_Object_Clipped for more information on this smart
10873  * class
10874  */
10875 EAPI const Evas_Smart_Class *evas_object_smart_clipped_class_get(void) EINA_CONST;
10876
10877 /**
10878  * @}
10879  */
10880
10881 /**
10882  * @defgroup Evas_Object_Box Box Smart Object
10883  *
10884  * A box is a convenience smart object that packs children inside it
10885  * in @b sequence, using a layouting function specified by the
10886  * user. There are a couple of pre-made layouting functions <b>built-in
10887  * in Evas</b>, all of them using children size hints to define their
10888  * size and alignment inside their cell space.
10889  *
10890  * Examples on this smart object's usage:
10891  * - @ref Example_Evas_Box
10892  * - @ref Example_Evas_Size_Hints
10893  *
10894  * @see @ref Evas_Object_Group_Size_Hints
10895  *
10896  * @ingroup Evas_Smart_Object_Group
10897  */
10898
10899 /**
10900  * @addtogroup Evas_Object_Box
10901  * @{
10902  */
10903
10904 /**
10905  * @typedef Evas_Object_Box_Api
10906  *
10907  * Smart class extension, providing extra box object requirements.
10908  *
10909  * @ingroup Evas_Object_Box
10910  */
10911 typedef struct _Evas_Object_Box_Api Evas_Object_Box_Api;
10912
10913 /**
10914  * @typedef Evas_Object_Box_Data
10915  *
10916  * Smart object instance data, providing box object requirements.
10917  *
10918  * @ingroup Evas_Object_Box
10919  */
10920 typedef struct _Evas_Object_Box_Data Evas_Object_Box_Data;
10921
10922 /**
10923  * @typedef Evas_Object_Box_Option
10924  *
10925  * The base structure for a box option. Box options are a way of
10926  * extending box items properties, which will be taken into account
10927  * for layouting decisions. The box layouting functions provided by
10928  * Evas will only rely on objects' canonical size hints to layout
10929  * them, so the basic box option has @b no (custom) property set.
10930  *
10931  * Users creating their own layouts, but not depending on extra child
10932  * items' properties, would be fine just using
10933  * evas_object_box_layout_set(). But if one desires a layout depending
10934  * on extra child properties, he/she has to @b subclass the box smart
10935  * object. Thus, by using evas_object_box_smart_class_get() and
10936  * evas_object_box_smart_set(), the @c option_new() and @c
10937  * option_free() smart class functions should be properly
10938  * redefined/extended.
10939  *
10940  * Object properties are bound to an integer identifier and must have
10941  * a name string. Their values are open to any data. See the API on
10942  * option properties for more details.
10943  *
10944  * @ingroup Evas_Object_Box
10945  */
10946 typedef struct _Evas_Object_Box_Option Evas_Object_Box_Option;
10947
10948 /**
10949  * @typedef Evas_Object_Box_Layout
10950  *
10951  * Function signature for an Evas box object layouting routine. By
10952  * @a o it will be passed the box object in question, by @a priv it will
10953  * be passed the box's internal data and, by @a user_data, it will be
10954  * passed any custom data one could have set to a given box layouting
10955  * function, with evas_object_box_layout_set().
10956  *
10957  * @ingroup Evas_Object_Box
10958  */
10959 typedef void (*Evas_Object_Box_Layout)(Evas_Object *o, Evas_Object_Box_Data *priv, void *user_data);
10960
10961 /**
10962  * @def EVAS_OBJECT_BOX_API_VERSION
10963  *
10964  * Current version for Evas box object smart class, a value which goes
10965  * to _Evas_Object_Box_Api::version.
10966  *
10967  * @ingroup Evas_Object_Box
10968  */
10969 #define EVAS_OBJECT_BOX_API_VERSION 1
10970
10971 /**
10972  * @struct _Evas_Object_Box_Api
10973  *
10974  * This structure should be used by any smart class inheriting from
10975  * the box's one, to provide custom box behavior which could not be
10976  * achieved only by providing a layout function, with
10977  * evas_object_box_layout_set().
10978  *
10979  * @extends Evas_Smart_Class
10980  * @ingroup Evas_Object_Box
10981  */
10982 struct _Evas_Object_Box_Api
10983 {
10984    Evas_Smart_Class        base;      /**< Base smart class struct, need for all smart objects */
10985    int                     version;      /**< Version of this smart class definition */
10986    Evas_Object_Box_Option *(*append)(Evas_Object * o, Evas_Object_Box_Data * priv, Evas_Object * child);            /**< Smart function to append child elements in boxes */
10987    Evas_Object_Box_Option *(*prepend)(Evas_Object * o, Evas_Object_Box_Data * priv, Evas_Object * child);           /**< Smart function to prepend child elements in boxes */
10988    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 */
10989    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 */
10990    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 */
10991    Evas_Object            *(*remove)(Evas_Object * o, Evas_Object_Box_Data * priv, Evas_Object * child);            /**< Smart function to remove a child element from boxes */
10992    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 */
10993    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 */
10994    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 */
10995    const char             *(*property_name_get)(const Evas_Object * o, int property);   /**< Smart function to get the name of a custom property of box children */
10996    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 */
10997    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 */
10998    void                    (*option_free)(Evas_Object *o, Evas_Object_Box_Data *priv, Evas_Object_Box_Option *opt);          /**< Smart function to delete a box option struct */
10999 };
11000
11001 /**
11002  * @def EVAS_OBJECT_BOX_API_INIT
11003  *
11004  * Initializer for a whole #Evas_Object_Box_Api structure, with
11005  * @c NULL values on its specific fields.
11006  *
11007  * @param smart_class_init initializer to use for the "base" field
11008  * (#Evas_Smart_Class).
11009  *
11010  * @see EVAS_SMART_CLASS_INIT_NULL
11011  * @see EVAS_SMART_CLASS_INIT_VERSION
11012  * @see EVAS_SMART_CLASS_INIT_NAME_VERSION
11013  * @see EVAS_OBJECT_BOX_API_INIT_NULL
11014  * @see EVAS_OBJECT_BOX_API_INIT_VERSION
11015  * @see EVAS_OBJECT_BOX_API_INIT_NAME_VERSION
11016  * @ingroup Evas_Object_Box
11017  */
11018 #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}
11019
11020 /**
11021  * @def EVAS_OBJECT_BOX_API_INIT_NULL
11022  *
11023  * Initializer to zero out a whole #Evas_Object_Box_Api structure.
11024  *
11025  * @see EVAS_OBJECT_BOX_API_INIT_VERSION
11026  * @see EVAS_OBJECT_BOX_API_INIT_NAME_VERSION
11027  * @see EVAS_OBJECT_BOX_API_INIT
11028  * @ingroup Evas_Object_Box
11029  */
11030 #define EVAS_OBJECT_BOX_API_INIT_NULL    EVAS_OBJECT_BOX_API_INIT(EVAS_SMART_CLASS_INIT_NULL)
11031
11032 /**
11033  * @def EVAS_OBJECT_BOX_API_INIT_VERSION
11034  *
11035  * Initializer to zero out a whole #Evas_Object_Box_Api structure and
11036  * set a specific version on it.
11037  *
11038  * This is similar to #EVAS_OBJECT_BOX_API_INIT_NULL, but it will set
11039  * the version field of #Evas_Smart_Class (base field) to the latest
11040  * #EVAS_SMART_CLASS_VERSION.
11041  *
11042  * @see EVAS_OBJECT_BOX_API_INIT_NULL
11043  * @see EVAS_OBJECT_BOX_API_INIT_NAME_VERSION
11044  * @see EVAS_OBJECT_BOX_API_INIT
11045  * @ingroup Evas_Object_Box
11046  */
11047 #define EVAS_OBJECT_BOX_API_INIT_VERSION EVAS_OBJECT_BOX_API_INIT(EVAS_SMART_CLASS_INIT_VERSION)
11048
11049 /**
11050  * @def EVAS_OBJECT_BOX_API_INIT_NAME_VERSION
11051  *
11052  * Initializer to zero out a whole #Evas_Object_Box_Api structure and
11053  * set its name and version.
11054  *
11055  * This is similar to #EVAS_OBJECT_BOX_API_INIT_NULL, but it will also
11056  * set the version field of #Evas_Smart_Class (base field) to the
11057  * latest #EVAS_SMART_CLASS_VERSION and name it to the specific value.
11058  *
11059  * It will keep a reference to the name field as a <c>"const char *"</c>,
11060  * i.e., the name must be available while the structure is
11061  * used (hint: static or global variable!) and must not be modified.
11062  *
11063  * @see EVAS_OBJECT_BOX_API_INIT_NULL
11064  * @see EVAS_OBJECT_BOX_API_INIT_VERSION
11065  * @see EVAS_OBJECT_BOX_API_INIT
11066  * @ingroup Evas_Object_Box
11067  */
11068 #define EVAS_OBJECT_BOX_API_INIT_NAME_VERSION(name) EVAS_OBJECT_BOX_API_INIT(EVAS_SMART_CLASS_INIT_NAME_VERSION(name))
11069
11070 /**
11071  * @struct _Evas_Object_Box_Data
11072  *
11073  * This structure augments clipped smart object's instance data,
11074  * providing extra members required by generic box implementation. If
11075  * a subclass inherits from #Evas_Object_Box_Api, then it may augment
11076  * #Evas_Object_Box_Data to fit its own needs.
11077  *
11078  * @extends Evas_Object_Smart_Clipped_Data
11079  * @ingroup Evas_Object_Box
11080  */
11081 struct _Evas_Object_Box_Data
11082 {
11083    Evas_Object_Smart_Clipped_Data base;
11084    const Evas_Object_Box_Api     *api;
11085    struct
11086    {
11087       double h, v;
11088    } align;
11089    struct
11090    {
11091       Evas_Coord h, v;
11092    } pad;
11093    Eina_List                     *children;
11094    struct
11095    {
11096       Evas_Object_Box_Layout cb;
11097       void                  *data;
11098       void                   (*free_data)(void *data);
11099    } layout;
11100    Eina_Bool                      layouting : 1;
11101    Eina_Bool                      children_changed : 1;
11102 };
11103
11104 struct _Evas_Object_Box_Option
11105 {
11106    Evas_Object *obj;    /**< Pointer to the box child object, itself */
11107    Eina_Bool    max_reached : 1;
11108    Eina_Bool    min_reached : 1;
11109    Evas_Coord   alloc_size;
11110 };    /**< #Evas_Object_Box_Option struct fields */
11111
11112 /**
11113  * Set the default box @a api struct (Evas_Object_Box_Api)
11114  * with the default values. May be used to extend that API.
11115  *
11116  * @param api The box API struct to set back, most probably with
11117  * overridden fields (on class extensions scenarios)
11118  */
11119 EAPI void                       evas_object_box_smart_set(Evas_Object_Box_Api *api) EINA_ARG_NONNULL(1);
11120
11121 /**
11122  * Get the Evas box smart class, for inheritance purposes.
11123  *
11124  * @return the (canonical) Evas box smart class.
11125  *
11126  * The returned value is @b not to be modified, just use it as your
11127  * parent class.
11128  */
11129 EAPI const Evas_Object_Box_Api *evas_object_box_smart_class_get(void) EINA_CONST;
11130
11131 /**
11132  * Set a new layouting function to a given box object
11133  *
11134  * @param o The box object to operate on.
11135  * @param cb The new layout function to set on @p o.
11136  * @param data Data pointer to be passed to @p cb.
11137  * @param free_data Function to free @p data, if need be.
11138  *
11139  * A box layout function affects how a box object displays child
11140  * elements within its area. The list of pre-defined box layouts
11141  * available in Evas is:
11142  * - evas_object_box_layout_horizontal()
11143  * - evas_object_box_layout_vertical()
11144  * - evas_object_box_layout_homogeneous_horizontal()
11145  * - evas_object_box_layout_homogeneous_vertical()
11146  * - evas_object_box_layout_homogeneous_max_size_horizontal()
11147  * - evas_object_box_layout_homogeneous_max_size_vertical()
11148  * - evas_object_box_layout_flow_horizontal()
11149  * - evas_object_box_layout_flow_vertical()
11150  * - evas_object_box_layout_stack()
11151  *
11152  * Refer to each of their documentation texts for details on them.
11153  *
11154  * @note A box layouting function will be triggered by the @c
11155  * 'calculate' smart callback of the box's smart class.
11156  */
11157 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);
11158
11159 /**
11160  * Add a new box object on the provided canvas.
11161  *
11162  * @param evas The canvas to create the box object on.
11163  * @return @c NULL on error, a pointer to a new box object on
11164  * success.
11165  *
11166  * After instantiation, if a box object hasn't its layout function
11167  * set, via evas_object_box_layout_set(), it will have it by default
11168  * set to evas_object_box_layout_horizontal(). The remaining
11169  * properties of the box must be set/retrieved via
11170  * <c>evas_object_box_{h,v}_{align,padding}_{get,set)()</c>.
11171  */
11172 EAPI Evas_Object               *evas_object_box_add(Evas *evas) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
11173
11174 /**
11175  * Add a new box as a @b child of a given smart object.
11176  *
11177  * @param parent The parent smart object to put the new box in.
11178  * @return @c NULL on error, a pointer to a new box object on
11179  * success.
11180  *
11181  * This is a helper function that has the same effect of putting a new
11182  * box object into @p parent by use of evas_object_smart_member_add().
11183  *
11184  * @see evas_object_box_add()
11185  */
11186 EAPI Evas_Object               *evas_object_box_add_to(Evas_Object *parent) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
11187
11188 /**
11189  * Layout function which sets the box @a o to a (basic) horizontal box
11190  *
11191  * @param o The box object in question
11192  * @param priv The smart data of the @p o
11193  * @param data The data pointer passed on
11194  * evas_object_box_layout_set(), if any
11195  *
11196  * In this layout, the box object's overall behavior is controlled by
11197  * its padding/alignment properties, which are set by the
11198  * <c>evas_object_box_{h,v}_{align,padding}_set()</c> family of
11199  * functions. The size hints of the elements in the box -- set by the
11200  * <c>evas_object_size_hint_{align,padding,weight}_set()</c> functions
11201  * -- also control the way this function works.
11202  *
11203  * \par Box's properties:
11204  * @c align_h controls the horizontal alignment of the child objects
11205  * relative to the containing box. When set to @c 0.0, children are
11206  * aligned to the left. A value of @c 1.0 makes them aligned to the
11207  * right border. Values in between align them proportionally. Note
11208  * that if the size required by the children, which is given by their
11209  * widths and the @c padding_h property of the box, is bigger than the
11210  * their container's width, the children will be displayed out of the
11211  * box's bounds. A negative value of @c align_h makes the box to
11212  * @b justify its children. The padding between them, in this case, is
11213  * corrected so that the leftmost one touches the left border and the
11214  * rightmost one touches the right border (even if they must
11215  * overlap). The @c align_v and @c padding_v properties of the box
11216  * @b don't contribute to its behaviour when this layout is chosen.
11217  *
11218  * \par Child element's properties:
11219  * @c align_x does @b not influence the box's behavior. @c padding_l
11220  * and @c padding_r sum up to the container's horizontal padding
11221  * between elements. The child's @c padding_t, @c padding_b and
11222  * @c align_y properties apply for padding/alignment relative to the
11223  * overall height of the box. Finally, there is the @c weight_x
11224  * property, which, if set to a non-zero value, tells the container
11225  * that the child width is @b not pre-defined. If the container can't
11226  * accommodate all its children, it sets the widths of the ones
11227  * <b>with weights</b> to sizes as small as they can all fit into
11228  * it. If the size required by the children is less than the
11229  * available, the box increases its childrens' (which have weights)
11230  * widths as to fit the remaining space. The @c weight_x property,
11231  * besides telling the element is resizable, gives a @b weight for the
11232  * resizing process.  The parent box will try to distribute (or take
11233  * off) widths accordingly to the @b normalized list of weigths: most
11234  * weighted children remain/get larger in this process than the least
11235  * ones. @c weight_y does not influence the layout.
11236  *
11237  * If one desires that, besides having weights, child elements must be
11238  * resized bounded to a minimum or maximum size, those size hints must
11239  * be set, by the <c>evas_object_size_hint_{min,max}_set()</c>
11240  * functions.
11241  */
11242 EAPI void                       evas_object_box_layout_horizontal(Evas_Object *o, Evas_Object_Box_Data *priv, void *data) EINA_ARG_NONNULL(1, 2);
11243
11244 /**
11245  * Layout function which sets the box @a o to a (basic) vertical box
11246  *
11247  * This function behaves analogously to
11248  * evas_object_box_layout_horizontal(). The description of its
11249  * behaviour can be derived from that function's documentation.
11250  */
11251 EAPI void                       evas_object_box_layout_vertical(Evas_Object *o, Evas_Object_Box_Data *priv, void *data) EINA_ARG_NONNULL(1, 2);
11252
11253 /**
11254  * Layout function which sets the box @a o to a @b homogeneous
11255  * vertical box
11256  *
11257  * This function behaves analogously to
11258  * evas_object_box_layout_homogeneous_horizontal().  The description
11259  * of its behaviour can be derived from that function's documentation.
11260  */
11261 EAPI void                       evas_object_box_layout_homogeneous_vertical(Evas_Object *o, Evas_Object_Box_Data *priv, void *data) EINA_ARG_NONNULL(1, 2);
11262
11263 /**
11264  * Layout function which sets the box @a o to a @b homogeneous
11265  * horizontal box
11266  *
11267  * @param o The box object in question
11268  * @param priv The smart data of the @p o
11269  * @param data The data pointer passed on
11270  * evas_object_box_layout_set(), if any
11271  *
11272  * In a homogeneous horizontal box, its width is divided @b equally
11273  * between the contained objects. The box's overall behavior is
11274  * controlled by its padding/alignment properties, which are set by
11275  * the <c>evas_object_box_{h,v}_{align,padding}_set()</c> family of
11276  * functions.  The size hints the elements in the box -- set by the
11277  * <c>evas_object_size_hint_{align,padding,weight}_set()</c> functions
11278  * -- also control the way this function works.
11279  *
11280  * \par Box's properties:
11281  * @c align_h has no influence on the box for this layout.
11282  * @c padding_h tells the box to draw empty spaces of that size, in
11283  * pixels, between the (equal) child objects's cells. The @c align_v
11284  * and @c padding_v properties of the box don't contribute to its
11285  * behaviour when this layout is chosen.
11286  *
11287  * \par Child element's properties:
11288  * @c padding_l and @c padding_r sum up to the required width of the
11289  * child element. The @c align_x property tells the relative position
11290  * of this overall child width in its allocated cell (@c 0.0 to
11291  * extreme left, @c 1.0 to extreme right). A value of @c -1.0 to
11292  * @c align_x makes the box try to resize this child element to the exact
11293  * width of its cell (respecting the minimum and maximum size hints on
11294  * the child's width and accounting for its horizontal padding
11295  * hints). The child's @c padding_t, @c padding_b and @c align_y
11296  * properties apply for padding/alignment relative to the overall
11297  * height of the box. A value of @c -1.0 to @c align_y makes the box
11298  * try to resize this child element to the exact height of its parent
11299  * (respecting the maximum size hint on the child's height).
11300  */
11301 EAPI void                       evas_object_box_layout_homogeneous_horizontal(Evas_Object *o, Evas_Object_Box_Data *priv, void *data) EINA_ARG_NONNULL(1, 2);
11302
11303 /**
11304  * Layout function which sets the box @a o to a <b>maximum size,
11305  * homogeneous</b> horizontal box
11306  *
11307  * @param o The box object in question
11308  * @param priv The smart data of the @p o
11309  * @param data The data pointer passed on
11310  * evas_object_box_layout_set(), if any
11311  *
11312  * In a maximum size, homogeneous horizontal box, besides having cells
11313  * of <b>equal size</b> reserved for the child objects, this size will
11314  * be defined by the size of the @b largest child in the box (in
11315  * width). The box's overall behavior is controlled by its properties,
11316  * which are set by the
11317  * <c>evas_object_box_{h,v}_{align,padding}_set()</c> family of
11318  * functions.  The size hints of the elements in the box -- set by the
11319  * <c>evas_object_size_hint_{align,padding,weight}_set()</c> functions
11320  * -- also control the way this function works.
11321  *
11322  * \par Box's properties:
11323  * @c padding_h tells the box to draw empty spaces of that size, in
11324  * pixels, between the child objects's cells. @c align_h controls the
11325  * horizontal alignment of the child objects, relative to the
11326  * containing box. When set to @c 0.0, children are aligned to the
11327  * left. A value of @c 1.0 lets them aligned to the right
11328  * border. Values in between align them proportionally. A negative
11329  * value of @c align_h makes the box to @b justify its children
11330  * cells. The padding between them, in this case, is corrected so that
11331  * the leftmost one touches the left border and the rightmost one
11332  * touches the right border (even if they must overlap). The
11333  * @c align_v and @c padding_v properties of the box don't contribute to
11334  * its behaviour when this layout is chosen.
11335  *
11336  * \par Child element's properties:
11337  * @c padding_l and @c padding_r sum up to the required width of the
11338  * child element. The @c align_x property tells the relative position
11339  * of this overall child width in its allocated cell (@c 0.0 to
11340  * extreme left, @c 1.0 to extreme right). A value of @c -1.0 to
11341  * @c align_x makes the box try to resize this child element to the exact
11342  * width of its cell (respecting the minimum and maximum size hints on
11343  * the child's width and accounting for its horizontal padding
11344  * hints). The child's @c padding_t, @c padding_b and @c align_y
11345  * properties apply for padding/alignment relative to the overall
11346  * height of the box. A value of @c -1.0 to @c align_y makes the box
11347  * try to resize this child element to the exact height of its parent
11348  * (respecting the max hint on the child's height).
11349  */
11350 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);
11351
11352 /**
11353  * Layout function which sets the box @a o to a <b>maximum size,
11354  * homogeneous</b> vertical box
11355  *
11356  * This function behaves analogously to
11357  * evas_object_box_layout_homogeneous_max_size_horizontal(). The
11358  * description of its behaviour can be derived from that function's
11359  * documentation.
11360  */
11361 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);
11362
11363 /**
11364  * Layout function which sets the box @a o to a @b flow horizontal
11365  * box.
11366  *
11367  * @param o The box object in question
11368  * @param priv The smart data of the @p o
11369  * @param data The data pointer passed on
11370  * evas_object_box_layout_set(), if any
11371  *
11372  * In a flow horizontal box, the box's child elements are placed in
11373  * @b rows (think of text as an analogy). A row has as much elements as
11374  * can fit into the box's width. The box's overall behavior is
11375  * controlled by its properties, which are set by the
11376  * <c>evas_object_box_{h,v}_{align,padding}_set()</c> family of
11377  * functions.  The size hints of the elements in the box -- set by the
11378  * <c>evas_object_size_hint_{align,padding,weight}_set()</c> functions
11379  * -- also control the way this function works.
11380  *
11381  * \par Box's properties:
11382  * @c padding_h tells the box to draw empty spaces of that size, in
11383  * pixels, between the child objects's cells. @c align_h dictates the
11384  * horizontal alignment of the rows (@c 0.0 to left align them, @c 1.0
11385  * to right align). A value of @c -1.0 to @c align_h lets the rows
11386  * @b justified horizontally. @c align_v controls the vertical alignment
11387  * of the entire set of rows (@c 0.0 to top, @c 1.0 to bottom). A
11388  * value of @c -1.0 to @c align_v makes the box to @b justify the rows
11389  * vertically. The padding between them, in this case, is corrected so
11390  * that the first row touches the top border and the last one touches
11391  * the bottom border (even if they must overlap). @c padding_v has no
11392  * influence on the layout.
11393  *
11394  * \par Child element's properties:
11395  * @c padding_l and @c padding_r sum up to the required width of the
11396  * child element. The @c align_x property has no influence on the
11397  * layout. The child's @c padding_t and @c padding_b sum up to the
11398  * required height of the child element and is the only means (besides
11399  * row justifying) of setting space between rows. Note, however, that
11400  * @c align_y dictates positioning relative to the <b>largest
11401  * height</b> required by a child object in the actual row.
11402  */
11403 EAPI void                       evas_object_box_layout_flow_horizontal(Evas_Object *o, Evas_Object_Box_Data *priv, void *data) EINA_ARG_NONNULL(1, 2);
11404
11405 /**
11406  * Layout function which sets the box @a o to a @b flow vertical box.
11407  *
11408  * This function behaves analogously to
11409  * evas_object_box_layout_flow_horizontal(). The description of its
11410  * behaviour can be derived from that function's documentation.
11411  */
11412 EAPI void                       evas_object_box_layout_flow_vertical(Evas_Object *o, Evas_Object_Box_Data *priv, void *data) EINA_ARG_NONNULL(1, 2);
11413
11414 /**
11415  * Layout function which sets the box @a o to a @b stacking box
11416  *
11417  * @param o The box object in question
11418  * @param priv The smart data of the @p o
11419  * @param data The data pointer passed on
11420  * evas_object_box_layout_set(), if any
11421  *
11422  * In a stacking box, all children will be given the same size -- the
11423  * box's own size -- and they will be stacked one above the other, so
11424  * that the first object in @p o's internal list of child elements
11425  * will be the bottommost in the stack.
11426  *
11427  * \par Box's properties:
11428  * No box properties are used.
11429  *
11430  * \par Child element's properties:
11431  * @c padding_l and @c padding_r sum up to the required width of the
11432  * child element. The @c align_x property tells the relative position
11433  * of this overall child width in its allocated cell (@c 0.0 to
11434  * extreme left, @c 1.0 to extreme right). A value of @c -1.0 to @c
11435  * align_x makes the box try to resize this child element to the exact
11436  * width of its cell (respecting the min and max hints on the child's
11437  * width and accounting for its horizontal padding properties). The
11438  * same applies to the vertical axis.
11439  */
11440 EAPI void                       evas_object_box_layout_stack(Evas_Object *o, Evas_Object_Box_Data *priv, void *data) EINA_ARG_NONNULL(1, 2);
11441
11442 /**
11443  * Set the alignment of the whole bounding box of contents, for a
11444  * given box object.
11445  *
11446  * @param o The given box object to set alignment from
11447  * @param horizontal The horizontal alignment, in pixels
11448  * @param vertical the vertical alignment, in pixels
11449  *
11450  * This will influence how a box object is to align its bounding box
11451  * of contents within its own area. The values @b must be in the range
11452  * @c 0.0 - @c 1.0, or undefined behavior is expected. For horizontal
11453  * alignment, @c 0.0 means to the left, with @c 1.0 meaning to the
11454  * right. For vertical alignment, @c 0.0 means to the top, with @c 1.0
11455  * meaning to the bottom.
11456  *
11457  * @note The default values for both alignments is @c 0.5.
11458  *
11459  * @see evas_object_box_align_get()
11460  */
11461 EAPI void                       evas_object_box_align_set(Evas_Object *o, double horizontal, double vertical) EINA_ARG_NONNULL(1);
11462
11463 /**
11464  * Get the alignment of the whole bounding box of contents, for a
11465  * given box object.
11466  *
11467  * @param o The given box object to get alignment from
11468  * @param horizontal Pointer to a variable where to store the
11469  * horizontal alignment
11470  * @param vertical Pointer to a variable where to store the vertical
11471  * alignment
11472  *
11473  * @see evas_object_box_align_set() for more information
11474  */
11475 EAPI void                       evas_object_box_align_get(const Evas_Object *o, double *horizontal, double *vertical) EINA_ARG_NONNULL(1);
11476
11477 /**
11478  * Set the (space) padding between cells set for a given box object.
11479  *
11480  * @param o The given box object to set padding from
11481  * @param horizontal The horizontal padding, in pixels
11482  * @param vertical the vertical padding, in pixels
11483  *
11484  * @note The default values for both padding components is @c 0.
11485  *
11486  * @see evas_object_box_padding_get()
11487  */
11488 EAPI void                       evas_object_box_padding_set(Evas_Object *o, Evas_Coord horizontal, Evas_Coord vertical) EINA_ARG_NONNULL(1);
11489
11490 /**
11491  * Get the (space) padding between cells set for a given box object.
11492  *
11493  * @param o The given box object to get padding from
11494  * @param horizontal Pointer to a variable where to store the
11495  * horizontal padding
11496  * @param vertical Pointer to a variable where to store the vertical
11497  * padding
11498  *
11499  * @see evas_object_box_padding_set()
11500  */
11501 EAPI void                       evas_object_box_padding_get(const Evas_Object *o, Evas_Coord *horizontal, Evas_Coord *vertical) EINA_ARG_NONNULL(1);
11502
11503 /**
11504  * Append a new @a child object to the given box object @a o.
11505  *
11506  * @param o The given box object
11507  * @param child A child Evas object to be made a member of @p o
11508  * @return A box option bound to the recently added box item or @c
11509  * NULL, on errors
11510  *
11511  * On success, the @c "child,added" smart event will take place.
11512  *
11513  * @note The actual placing of the item relative to @p o's area will
11514  * depend on the layout set to it. For example, on horizontal layouts
11515  * an item in the end of the box's list of children will appear on its
11516  * right.
11517  *
11518  * @note This call will trigger the box's _Evas_Object_Box_Api::append
11519  * smart function.
11520  */
11521 EAPI Evas_Object_Box_Option    *evas_object_box_append(Evas_Object *o, Evas_Object *child) EINA_ARG_NONNULL(1, 2);
11522
11523 /**
11524  * Prepend a new @a child object to the given box object @a o.
11525  *
11526  * @param o The given box object
11527  * @param child A child Evas object to be made a member of @p o
11528  * @return A box option bound to the recently added box item or @c
11529  * NULL, on errors
11530  *
11531  * On success, the @c "child,added" smart event will take place.
11532  *
11533  * @note The actual placing of the item relative to @p o's area will
11534  * depend on the layout set to it. For example, on horizontal layouts
11535  * an item in the beginning of the box's list of children will appear
11536  * on its left.
11537  *
11538  * @note This call will trigger the box's
11539  * _Evas_Object_Box_Api::prepend smart function.
11540  */
11541 EAPI Evas_Object_Box_Option    *evas_object_box_prepend(Evas_Object *o, Evas_Object *child) EINA_ARG_NONNULL(1, 2);
11542
11543 /**
11544  * Insert a new @a child object <b>before another existing one</b>, in
11545  * a given box object @a o.
11546  *
11547  * @param o The given box object
11548  * @param child A child Evas object to be made a member of @p o
11549  * @param reference The child object to place this new one before
11550  * @return A box option bound to the recently added box item or @c
11551  * NULL, on errors
11552  *
11553  * On success, the @c "child,added" smart event will take place.
11554  *
11555  * @note This function will fail if @p reference is not a member of @p
11556  * o.
11557  *
11558  * @note The actual placing of the item relative to @p o's area will
11559  * depend on the layout set to it.
11560  *
11561  * @note This call will trigger the box's
11562  * _Evas_Object_Box_Api::insert_before smart function.
11563  */
11564 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);
11565
11566 /**
11567  * Insert a new @a child object <b>after another existing one</b>, in
11568  * a given box object @a o.
11569  *
11570  * @param o The given box object
11571  * @param child A child Evas object to be made a member of @p o
11572  * @param reference The child object to place this new one after
11573  * @return A box option bound to the recently added box item or @c
11574  * NULL, on errors
11575  *
11576  * On success, the @c "child,added" smart event will take place.
11577  *
11578  * @note This function will fail if @p reference is not a member of @p
11579  * o.
11580  *
11581  * @note The actual placing of the item relative to @p o's area will
11582  * depend on the layout set to it.
11583  *
11584  * @note This call will trigger the box's
11585  * _Evas_Object_Box_Api::insert_after smart function.
11586  */
11587 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);
11588
11589 /**
11590  * Insert a new @a child object <b>at a given position</b>, in a given
11591  * box object @a o.
11592  *
11593  * @param o The given box object
11594  * @param child A child Evas object to be made a member of @p o
11595  * @param pos The numeric position (starting from @c 0) to place the
11596  * new child object at
11597  * @return A box option bound to the recently added box item or @c
11598  * NULL, on errors
11599  *
11600  * On success, the @c "child,added" smart event will take place.
11601  *
11602  * @note This function will fail if the given position is invalid,
11603  * given @p o's internal list of elements.
11604  *
11605  * @note The actual placing of the item relative to @p o's area will
11606  * depend on the layout set to it.
11607  *
11608  * @note This call will trigger the box's
11609  * _Evas_Object_Box_Api::insert_at smart function.
11610  */
11611 EAPI Evas_Object_Box_Option    *evas_object_box_insert_at(Evas_Object *o, Evas_Object *child, unsigned int pos) EINA_ARG_NONNULL(1, 2);
11612
11613 /**
11614  * Remove a given object from a box object, unparenting it again.
11615  *
11616  * @param o The box object to remove a child object from
11617  * @param child The handle to the child object to be removed
11618  * @return @c EINA_TRUE, on success, @c EINA_FALSE otherwise
11619  *
11620  * On removal, you'll get an unparented object again, just as it was
11621  * before you inserted it in the box. The
11622  * _Evas_Object_Box_Api::option_free box smart callback will be called
11623  * automatically for you and, also, the @c "child,removed" smart event
11624  * will take place.
11625  *
11626  * @note This call will trigger the box's _Evas_Object_Box_Api::remove
11627  * smart function.
11628  */
11629 EAPI Eina_Bool                  evas_object_box_remove(Evas_Object *o, Evas_Object *child) EINA_ARG_NONNULL(1, 2);
11630
11631 /**
11632  * Remove an object, <b>bound to a given position</b> in a box object,
11633  * unparenting it again.
11634  *
11635  * @param o The box object to remove a child object from
11636  * @param pos The numeric position (starting from @c 0) of the child
11637  * object to be removed
11638  * @return @c EINA_TRUE, on success, @c EINA_FALSE otherwise
11639  *
11640  * On removal, you'll get an unparented object again, just as it was
11641  * before you inserted it in the box. The @c option_free() box smart
11642  * callback will be called automatically for you and, also, the
11643  * @c "child,removed" smart event will take place.
11644  *
11645  * @note This function will fail if the given position is invalid,
11646  * given @p o's internal list of elements.
11647  *
11648  * @note This call will trigger the box's
11649  * _Evas_Object_Box_Api::remove_at smart function.
11650  */
11651 EAPI Eina_Bool                  evas_object_box_remove_at(Evas_Object *o, unsigned int pos) EINA_ARG_NONNULL(1);
11652
11653 /**
11654  * Remove @b all child objects from a box object, unparenting them
11655  * again.
11656  *
11657  * @param o The box object to remove a child object from
11658  * @param clear if true, it will delete just removed children.
11659  * @return @c EINA_TRUE, on success, @c EINA_FALSE otherwise
11660  *
11661  * This has the same effect of calling evas_object_box_remove() on
11662  * each of @p o's child objects, in sequence. If, and only if, all
11663  * those calls succeed, so does this one.
11664  */
11665 EAPI Eina_Bool                  evas_object_box_remove_all(Evas_Object *o, Eina_Bool clear) EINA_ARG_NONNULL(1);
11666
11667 /**
11668  * Get an iterator to walk the list of children of a given box object.
11669  *
11670  * @param o The box to retrieve an items iterator from
11671  * @return An iterator on @p o's child objects, on success, or @c NULL,
11672  * on errors
11673  *
11674  * @note Do @b not remove or delete objects while walking the list.
11675  */
11676 EAPI Eina_Iterator             *evas_object_box_iterator_new(const Evas_Object *o) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
11677
11678 /**
11679  * Get an accessor (a structure providing random items access) to the
11680  * list of children of a given box object.
11681  *
11682  * @param o The box to retrieve an items iterator from
11683  * @return An accessor on @p o's child objects, on success, or @c NULL,
11684  * on errors
11685  *
11686  * @note Do not remove or delete objects while walking the list.
11687  */
11688 EAPI Eina_Accessor             *evas_object_box_accessor_new(const Evas_Object *o) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
11689
11690 /**
11691  * Get the list of children objects in a given box object.
11692  *
11693  * @param o The box to retrieve an items list from
11694  * @return A list of @p o's child objects, on success, or @c NULL,
11695  * on errors (or if it has no child objects)
11696  *
11697  * The returned list should be freed with @c eina_list_free() when you
11698  * no longer need it.
11699  *
11700  * @note This is a duplicate of the list kept by the box internally.
11701  *       It's up to the user to destroy it when it no longer needs it.
11702  *       It's possible to remove objects from the box when walking
11703  *       this list, but these removals won't be reflected on it.
11704  */
11705 EAPI Eina_List                 *evas_object_box_children_get(const Evas_Object *o) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
11706
11707 /**
11708  * Get the name of the property of the child elements of the box @a o
11709  * which have @a id as identifier
11710  *
11711  * @param o The box to search child options from
11712  * @param property The numerical identifier of the option being searched,
11713  * for its name
11714  * @return The name of the given property or @c NULL, on errors.
11715  *
11716  * @note This call won't do anything for a canonical Evas box. Only
11717  * users which have @b subclassed it, setting custom box items options
11718  * (see #Evas_Object_Box_Option) on it, would benefit from this
11719  * function. They'd have to implement it and set it to be the
11720  * _Evas_Object_Box_Api::property_name_get smart class function of the
11721  * box, which is originally set to @c NULL.
11722  */
11723 EAPI const char                *evas_object_box_option_property_name_get(const Evas_Object *o, int property) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
11724
11725 /**
11726  * Get the numerical identifier of the property of the child elements
11727  * of the box @a o which have @a name as name string
11728  *
11729  * @param o The box to search child options from
11730  * @param name The name string of the option being searched, for
11731  * its ID
11732  * @return The numerical ID of the given property or @c -1, on
11733  * errors.
11734  *
11735  * @note This call won't do anything for a canonical Evas box. Only
11736  * users which have @b subclassed it, setting custom box items options
11737  * (see #Evas_Object_Box_Option) on it, would benefit from this
11738  * function. They'd have to implement it and set it to be the
11739  * _Evas_Object_Box_Api::property_id_get smart class function of the
11740  * box, which is originally set to @c NULL.
11741  */
11742 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);
11743
11744 /**
11745  * Set a property value (by its given numerical identifier), on a
11746  * given box child element
11747  *
11748  * @param o The box parenting the child element
11749  * @param opt The box option structure bound to the child box element
11750  * to set a property on
11751  * @param property The numerical ID of the given property
11752  * @param ... (List of) actual value(s) to be set for this
11753  * property. It (they) @b must be of the same type the user has
11754  * defined for it (them).
11755  * @return @c EINA_TRUE on success, @c EINA_FALSE on failure.
11756  *
11757  * @note This call won't do anything for a canonical Evas box. Only
11758  * users which have @b subclassed it, setting custom box items options
11759  * (see #Evas_Object_Box_Option) on it, would benefit from this
11760  * function. They'd have to implement it and set it to be the
11761  * _Evas_Object_Box_Api::property_set smart class function of the box,
11762  * which is originally set to @c NULL.
11763  *
11764  * @note This function will internally create a variable argument
11765  * list, with the values passed after @p property, and call
11766  * evas_object_box_option_property_vset() with this list and the same
11767  * previous arguments.
11768  */
11769 EAPI Eina_Bool                  evas_object_box_option_property_set(Evas_Object *o, Evas_Object_Box_Option *opt, int property, ...) EINA_ARG_NONNULL(1, 2);
11770
11771 /**
11772  * Set a property value (by its given numerical identifier), on a
11773  * given box child element -- by a variable argument list
11774  *
11775  * @param o The box parenting the child element
11776  * @param opt The box option structure bound to the child box element
11777  * to set a property on
11778  * @param property The numerical ID of the given property
11779  * @param args The variable argument list implementing the value to
11780  * be set for this property. It @b must be of the same type the user has
11781  * defined for it.
11782  * @return @c EINA_TRUE on success, @c EINA_FALSE on failure.
11783  *
11784  * This is a variable argument list variant of the
11785  * evas_object_box_option_property_set(). See its documentation for
11786  * more details.
11787  */
11788 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);
11789
11790 /**
11791  * Get a property's value (by its given numerical identifier), on a
11792  * given box child element
11793  *
11794  * @param o The box parenting the child element
11795  * @param opt The box option structure bound to the child box element
11796  * to get a property from
11797  * @param property The numerical ID of the given property
11798  * @param ... (List of) pointer(s) where to store the value(s) set for
11799  * this property. It (they) @b must point to variable(s) of the same
11800  * type the user has defined for it (them).
11801  * @return @c EINA_TRUE on success, @c EINA_FALSE on failure.
11802  *
11803  * @note This call won't do anything for a canonical Evas box. Only
11804  * users which have @b subclassed it, getting custom box items options
11805  * (see #Evas_Object_Box_Option) on it, would benefit from this
11806  * function. They'd have to implement it and get it to be the
11807  * _Evas_Object_Box_Api::property_get smart class function of the
11808  * box, which is originally get to @c NULL.
11809  *
11810  * @note This function will internally create a variable argument
11811  * list, with the values passed after @p property, and call
11812  * evas_object_box_option_property_vget() with this list and the same
11813  * previous arguments.
11814  */
11815 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);
11816
11817 /**
11818  * Get a property's value (by its given numerical identifier), on a
11819  * given box child element -- by a variable argument list
11820  *
11821  * @param o The box parenting the child element
11822  * @param opt The box option structure bound to the child box element
11823  * to get a property from
11824  * @param property The numerical ID of the given property
11825  * @param args The variable argument list with pointers to where to
11826  * store the values of this property. They @b must point to variables
11827  * of the same type the user has defined for them.
11828  * @return @c EINA_TRUE on success, @c EINA_FALSE on failure.
11829  *
11830  * This is a variable argument list variant of the
11831  * evas_object_box_option_property_get(). See its documentation for
11832  * more details.
11833  */
11834 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);
11835
11836 /**
11837  * @}
11838  */
11839
11840 /**
11841  * @defgroup Evas_Object_Table Table Smart Object.
11842  *
11843  * Convenience smart object that packs children using a tabular
11844  * layout using children size hints to define their size and
11845  * alignment inside their cell space.
11846  *
11847  * @ref tutorial_table shows how to use this Evas_Object.
11848  *
11849  * @see @ref Evas_Object_Group_Size_Hints
11850  *
11851  * @ingroup Evas_Smart_Object_Group
11852  *
11853  * @{
11854  */
11855
11856 /**
11857  * @brief Create a new table.
11858  *
11859  * @param evas Canvas in which table will be added.
11860  */
11861 EAPI Evas_Object                       *evas_object_table_add(Evas *evas) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
11862
11863 /**
11864  * @brief Create a table that is child of a given element @a parent.
11865  *
11866  * @see evas_object_table_add()
11867  */
11868 EAPI Evas_Object                       *evas_object_table_add_to(Evas_Object *parent) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
11869
11870 /**
11871  * @brief Set how this table should layout children.
11872  *
11873  * @todo consider aspect hint and respect it.
11874  *
11875  * @par EVAS_OBJECT_TABLE_HOMOGENEOUS_NONE
11876  * If table does not use homogeneous mode then columns and rows will
11877  * be calculated based on hints of individual cells. This operation
11878  * mode is more flexible, but more complex and heavy to calculate as
11879  * well. @b Weight properties are handled as a boolean expand. Negative
11880  * alignment will be considered as 0.5. This is the default.
11881  *
11882  * @todo @c EVAS_OBJECT_TABLE_HOMOGENEOUS_NONE should balance weight.
11883  *
11884  * @par EVAS_OBJECT_TABLE_HOMOGENEOUS_TABLE
11885  * When homogeneous is relative to table the own table size is divided
11886  * equally among children, filling the whole table area. That is, if
11887  * table has @c WIDTH and @c COLUMNS, each cell will get <tt>WIDTH /
11888  * COLUMNS</tt> pixels. If children have minimum size that is larger
11889  * than this amount (including padding), then it will overflow and be
11890  * aligned respecting the alignment hint, possible overlapping sibling
11891  * cells. @b Weight hint is used as a boolean, if greater than zero it
11892  * will make the child expand in that axis, taking as much space as
11893  * possible (bounded to maximum size hint). Negative alignment will be
11894  * considered as 0.5.
11895  *
11896  * @par EVAS_OBJECT_TABLE_HOMOGENEOUS_ITEM
11897  * When homogeneous is relative to item it means the greatest minimum
11898  * cell size will be used. That is, if no element is set to expand,
11899  * the table will have its contents to a minimum size, the bounding
11900  * box of all these children will be aligned relatively to the table
11901  * object using evas_object_table_align_get(). If the table area is
11902  * too small to hold this minimum bounding box, then the objects will
11903  * keep their size and the bounding box will overflow the box area,
11904  * still respecting the alignment. @b Weight hint is used as a
11905  * boolean, if greater than zero it will make that cell expand in that
11906  * axis, toggling the <b>expand mode</b>, which makes the table behave
11907  * much like @b EVAS_OBJECT_TABLE_HOMOGENEOUS_TABLE, except that the
11908  * bounding box will overflow and items will not overlap siblings. If
11909  * no minimum size is provided at all then the table will fallback to
11910  * expand mode as well.
11911  */
11912 EAPI void                               evas_object_table_homogeneous_set(Evas_Object *o, Evas_Object_Table_Homogeneous_Mode homogeneous) EINA_ARG_NONNULL(1);
11913
11914 /**
11915  * Get the current layout homogeneous mode.
11916  *
11917  * @see evas_object_table_homogeneous_set()
11918  */
11919 EAPI Evas_Object_Table_Homogeneous_Mode evas_object_table_homogeneous_get(const Evas_Object *o) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
11920
11921 /**
11922  * Set padding between cells.
11923  */
11924 EAPI void                               evas_object_table_padding_set(Evas_Object *o, Evas_Coord horizontal, Evas_Coord vertical) EINA_ARG_NONNULL(1);
11925
11926 /**
11927  * Get padding between cells.
11928  */
11929 EAPI void                               evas_object_table_padding_get(const Evas_Object *o, Evas_Coord *horizontal, Evas_Coord *vertical) EINA_ARG_NONNULL(1);
11930
11931 /**
11932  * Set the alignment of the whole bounding box of contents.
11933  */
11934 EAPI void                               evas_object_table_align_set(Evas_Object *o, double horizontal, double vertical) EINA_ARG_NONNULL(1);
11935
11936 /**
11937  * Get alignment of the whole bounding box of contents.
11938  */
11939 EAPI void                               evas_object_table_align_get(const Evas_Object *o, double *horizontal, double *vertical) EINA_ARG_NONNULL(1);
11940
11941 /**
11942  * Sets the mirrored mode of the table. In mirrored mode the table items go
11943  * from right to left instead of left to right. That is, 1,1 is top right, not
11944  * top left.
11945  *
11946  * @param o The table object.
11947  * @param mirrored the mirrored mode to set
11948  * @since 1.1
11949  */
11950 EAPI void                               evas_object_table_mirrored_set(Evas_Object *o, Eina_Bool mirrored) EINA_ARG_NONNULL(1);
11951
11952 /**
11953  * Gets the mirrored mode of the table.
11954  *
11955  * @param o The table object.
11956  * @return @c EINA_TRUE if it's a mirrored table, @c EINA_FALSE otherwise.
11957  * @since 1.1
11958  * @see evas_object_table_mirrored_set()
11959  */
11960 EAPI Eina_Bool                          evas_object_table_mirrored_get(const Evas_Object *o) EINA_ARG_NONNULL(1);
11961
11962 /**
11963  * Get packing location of a child of table
11964  *
11965  * @param o The given table object.
11966  * @param child The child object to add.
11967  * @param col pointer to store relative-horizontal position to place child.
11968  * @param row pointer to store relative-vertical position to place child.
11969  * @param colspan pointer to store how many relative-horizontal position to use for this child.
11970  * @param rowspan pointer to store how many relative-vertical position to use for this child.
11971  *
11972  * @return 1 on success, 0 on failure.
11973  * @since 1.1
11974  */
11975 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);
11976
11977 /**
11978  * Add a new child to a table object or set its current packing.
11979  *
11980  * @param o The given table object.
11981  * @param child The child object to add.
11982  * @param col relative-horizontal position to place child.
11983  * @param row relative-vertical position to place child.
11984  * @param colspan how many relative-horizontal position to use for this child.
11985  * @param rowspan how many relative-vertical position to use for this child.
11986  *
11987  * @return 1 on success, 0 on failure.
11988  */
11989 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);
11990
11991 /**
11992  * Remove child from table.
11993  *
11994  * @note removing a child will immediately call a walk over children in order
11995  *       to recalculate numbers of columns and rows. If you plan to remove
11996  *       all children, use evas_object_table_clear() instead.
11997  *
11998  * @return 1 on success, 0 on failure.
11999  */
12000 EAPI Eina_Bool                          evas_object_table_unpack(Evas_Object *o, Evas_Object *child) EINA_ARG_NONNULL(1, 2);
12001
12002 /**
12003  * Faster way to remove all child objects from a table object.
12004  *
12005  * @param o The given table object.
12006  * @param clear if true, it will delete just removed children.
12007  */
12008 EAPI void                               evas_object_table_clear(Evas_Object *o, Eina_Bool clear) EINA_ARG_NONNULL(1);
12009
12010 /**
12011  * Get the number of columns and rows this table takes.
12012  *
12013  * @note columns and rows are virtual entities, one can specify a table
12014  *       with a single object that takes 4 columns and 5 rows. The only
12015  *       difference for a single cell table is that paddings will be
12016  *       accounted proportionally.
12017  */
12018 EAPI void                               evas_object_table_col_row_size_get(const Evas_Object *o, int *cols, int *rows) EINA_ARG_NONNULL(1);
12019
12020 /**
12021  * Get an iterator to walk the list of children for the table.
12022  *
12023  * @note Do not remove or delete objects while walking the list.
12024  */
12025 EAPI Eina_Iterator                     *evas_object_table_iterator_new(const Evas_Object *o) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
12026
12027 /**
12028  * Get an accessor to get random access to the list of children for the table.
12029  *
12030  * @note Do not remove or delete objects while walking the list.
12031  */
12032 EAPI Eina_Accessor                     *evas_object_table_accessor_new(const Evas_Object *o) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
12033
12034 /**
12035  * Get the list of children for the table.
12036  *
12037  * @note This is a duplicate of the list kept by the table internally.
12038  *       It's up to the user to destroy it when it no longer needs it.
12039  *       It's possible to remove objects from the table when walking this
12040  *       list, but these removals won't be reflected on it.
12041  */
12042 EAPI Eina_List                         *evas_object_table_children_get(const Evas_Object *o) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
12043
12044 /**
12045  * Get the child of the table at the given coordinates
12046  *
12047  * @note This does not take into account col/row spanning
12048  */
12049 EAPI Evas_Object                       *evas_object_table_child_get(const Evas_Object *o, unsigned short col, unsigned short row) EINA_ARG_NONNULL(1);
12050 /**
12051  * @}
12052  */
12053
12054 /**
12055  * @defgroup Evas_Object_Grid Grid Smart Object.
12056  *
12057  * Convenience smart object that packs children under a regular grid
12058  * layout, using their virtual grid location and size to determine
12059  * children's positions inside the grid object's area.
12060  *
12061  * @ingroup Evas_Smart_Object_Group
12062  * @since 1.1
12063  */
12064
12065 /**
12066  * @addtogroup Evas_Object_Grid
12067  * @{
12068  */
12069
12070 /**
12071  * Create a new grid.
12072  *
12073  * It's set to a virtual size of 1x1 by default and add children with
12074  * evas_object_grid_pack().
12075  * @since 1.1
12076  */
12077 EAPI Evas_Object   *evas_object_grid_add(Evas *evas) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
12078
12079 /**
12080  * Create a grid that is child of a given element @a parent.
12081  *
12082  * @see evas_object_grid_add()
12083  * @since 1.1
12084  */
12085 EAPI Evas_Object   *evas_object_grid_add_to(Evas_Object *parent) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
12086
12087 /**
12088  * Set the virtual resolution for the grid
12089  *
12090  * @param o The grid object to modify
12091  * @param w The virtual horizontal size (resolution) in integer units
12092  * @param h The virtual vertical size (resolution) in integer units
12093  * @since 1.1
12094  */
12095 EAPI void           evas_object_grid_size_set(Evas_Object *o, int w, int h) EINA_ARG_NONNULL(1);
12096
12097 /**
12098  * Get the current virtual resolution
12099  *
12100  * @param o The grid object to query
12101  * @param w A pointer to an integer to store the virtual width
12102  * @param h A pointer to an integer to store the virtual height
12103  * @see evas_object_grid_size_set()
12104  * @since 1.1
12105  */
12106 EAPI void           evas_object_grid_size_get(const Evas_Object *o, int *w, int *h) EINA_ARG_NONNULL(1);
12107
12108 /**
12109  * Sets the mirrored mode of the grid. In mirrored mode the grid items go
12110  * from right to left instead of left to right. That is, 0,0 is top right, not
12111  * to left.
12112  *
12113  * @param o The grid object.
12114  * @param mirrored the mirrored mode to set
12115  * @since 1.1
12116  */
12117 EAPI void           evas_object_grid_mirrored_set(Evas_Object *o, Eina_Bool mirrored) EINA_ARG_NONNULL(1);
12118
12119 /**
12120  * Gets the mirrored mode of the grid.
12121  *
12122  * @param o The grid object.
12123  * @return @c EINA_TRUE if it's a mirrored grid, @c EINA_FALSE otherwise.
12124  * @see evas_object_grid_mirrored_set()
12125  * @since 1.1
12126  */
12127 EAPI Eina_Bool      evas_object_grid_mirrored_get(const Evas_Object *o) EINA_ARG_NONNULL(1);
12128
12129 /**
12130  * Add a new child to a grid object.
12131  *
12132  * @param o The given grid object.
12133  * @param child The child object to add.
12134  * @param x The virtual x coordinate of the child
12135  * @param y The virtual y coordinate of the child
12136  * @param w The virtual width of the child
12137  * @param h The virtual height of the child
12138  * @return 1 on success, 0 on failure.
12139  * @since 1.1
12140  */
12141 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);
12142
12143 /**
12144  * Remove child from grid.
12145  *
12146  * @note removing a child will immediately call a walk over children in order
12147  *       to recalculate numbers of columns and rows. If you plan to remove
12148  *       all children, use evas_object_grid_clear() instead.
12149  *
12150  * @return 1 on success, 0 on failure.
12151  * @since 1.1
12152  */
12153 EAPI Eina_Bool      evas_object_grid_unpack(Evas_Object *o, Evas_Object *child) EINA_ARG_NONNULL(1, 2);
12154
12155 /**
12156  * Faster way to remove all child objects from a grid object.
12157  *
12158  * @param o The given grid object.
12159  * @param clear if true, it will delete just removed children.
12160  * @since 1.1
12161  */
12162 EAPI void           evas_object_grid_clear(Evas_Object *o, Eina_Bool clear) EINA_ARG_NONNULL(1);
12163
12164 /**
12165  * Get the pack options for a grid child
12166  *
12167  * Get the pack x, y, width and height in virtual coordinates set by
12168  * evas_object_grid_pack()
12169  * @param o The grid object
12170  * @param child The grid child to query for coordinates
12171  * @param x The pointer to where the x coordinate will be returned
12172  * @param y The pointer to where the y coordinate will be returned
12173  * @param w The pointer to where the width will be returned
12174  * @param h The pointer to where the height will be returned
12175  * @return 1 on success, 0 on failure.
12176  * @since 1.1
12177  */
12178 EAPI Eina_Bool      evas_object_grid_pack_get(const Evas_Object *o, Evas_Object *child, int *x, int *y, int *w, int *h);
12179
12180 /**
12181  * Get an iterator to walk the list of children for the grid.
12182  *
12183  * @note Do not remove or delete objects while walking the list.
12184  * @since 1.1
12185  */
12186 EAPI Eina_Iterator *evas_object_grid_iterator_new(const Evas_Object *o) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
12187
12188 /**
12189  * Get an accessor to get random access to the list of children for the grid.
12190  *
12191  * @note Do not remove or delete objects while walking the list.
12192  * @since 1.1
12193  */
12194 EAPI Eina_Accessor *evas_object_grid_accessor_new(const Evas_Object *o) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
12195
12196 /**
12197  * Get the list of children for the grid.
12198  *
12199  * @note This is a duplicate of the list kept by the grid internally.
12200  *       It's up to the user to destroy it when it no longer needs it.
12201  *       It's possible to remove objects from the grid when walking this
12202  *       list, but these removals won't be reflected on it.
12203  * @since 1.1
12204  */
12205 EAPI Eina_List     *evas_object_grid_children_get(const Evas_Object *o) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
12206
12207 /**
12208  * @}
12209  */
12210
12211 /**
12212  * @defgroup Evas_Cserve Shared Image Cache Server
12213  *
12214  * Evas has an (optional) module which provides client-server
12215  * infrastructure to <b>share bitmaps across multiple processes</b>,
12216  * saving data and processing power.
12217  *
12218  * Be warned that it @b doesn't work when <b>threaded image
12219  * preloading</b> is enabled for Evas, though.
12220  */
12221 typedef struct _Evas_Cserve_Stats       Evas_Cserve_Stats;
12222 typedef struct _Evas_Cserve_Image_Cache Evas_Cserve_Image_Cache;
12223 typedef struct _Evas_Cserve_Image       Evas_Cserve_Image;
12224 typedef struct _Evas_Cserve_Config      Evas_Cserve_Config;
12225
12226 /**
12227  * Statistics about the server that shares cached bitmaps.
12228  * @ingroup Evas_Cserve
12229  */
12230 struct _Evas_Cserve_Stats
12231 {
12232    int    saved_memory;      /**< current amount of saved memory, in bytes */
12233    int    wasted_memory;      /**< current amount of wasted memory, in bytes */
12234    int    saved_memory_peak;      /**< peak amount of saved memory, in bytes */
12235    int    wasted_memory_peak;      /**< peak amount of wasted memory, in bytes */
12236    double saved_time_image_header_load;      /**< time, in seconds, saved in header loads by sharing cached loads instead */
12237    double saved_time_image_data_load;      /**< time, in seconds, saved in data loads by sharing cached loads instead */
12238 };
12239
12240 /**
12241  * A handle of a cache of images shared by a server.
12242  * @ingroup Evas_Cserve
12243  */
12244 struct _Evas_Cserve_Image_Cache
12245 {
12246    struct
12247    {
12248       int mem_total;
12249       int count;
12250    } active, cached;
12251    Eina_List *images;
12252 };
12253
12254 /**
12255  * A handle to an image shared by a server.
12256  * @ingroup Evas_Cserve
12257  */
12258 struct _Evas_Cserve_Image
12259 {
12260    const char *file, *key;
12261    int         w, h;
12262    time_t      file_mod_time;
12263    time_t      file_checked_time;
12264    time_t      cached_time;
12265    int         refcount;
12266    int         data_refcount;
12267    int         memory_footprint;
12268    double      head_load_time;
12269    double      data_load_time;
12270    Eina_Bool   alpha : 1;
12271    Eina_Bool   data_loaded : 1;
12272    Eina_Bool   active : 1;
12273    Eina_Bool   dead : 1;
12274    Eina_Bool   useless : 1;
12275 };
12276
12277 /**
12278  * Configuration that controls the server that shares cached bitmaps.
12279  * @ingroup Evas_Cserve
12280  */
12281 struct _Evas_Cserve_Config
12282 {
12283    int cache_max_usage;
12284    int cache_item_timeout;
12285    int cache_item_timeout_check;
12286 };
12287
12288 /**
12289  * Retrieves if the system wants to share bitmaps using the server.
12290  * @return @c EINA_TRUE if it wants, @c EINA_FALSE otherwise.
12291  * @ingroup Evas_Cserve
12292  */
12293 EAPI Eina_Bool   evas_cserve_want_get(void) EINA_WARN_UNUSED_RESULT;
12294
12295 /**
12296  * Retrieves if the system is connected to the server used to share
12297  * bitmaps.
12298  *
12299  * @return @c EINA_TRUE if it's connected, @c EINA_FALSE otherwise.
12300  * @ingroup Evas_Cserve
12301  */
12302 EAPI Eina_Bool   evas_cserve_connected_get(void) EINA_WARN_UNUSED_RESULT;
12303
12304 /**
12305  * Retrieves statistics from a running bitmap sharing server.
12306  * @param stats pointer to structure to fill with statistics about the
12307  *        bitmap cache server.
12308  *
12309  * @return @c EINA_TRUE if @p stats were filled with data,
12310  *         @c EINA_FALSE otherwise (when @p stats is untouched)
12311  * @ingroup Evas_Cserve
12312  */
12313 EAPI Eina_Bool   evas_cserve_stats_get(Evas_Cserve_Stats *stats) EINA_WARN_UNUSED_RESULT;
12314
12315 /**
12316  * Completely discard/clean a given images cache, thus re-setting it.
12317  *
12318  * @param cache A handle to the given images cache.
12319  */
12320 EAPI void        evas_cserve_image_cache_contents_clean(Evas_Cserve_Image_Cache *cache);
12321
12322 /**
12323  * Retrieves the current configuration of the Evas image caching
12324  * server.
12325  *
12326  * @param config where to store current image caching server's
12327  * configuration.
12328  *
12329  * @return @c EINA_TRUE if @p config was filled with data,
12330  *         @c EINA_FALSE otherwise (when @p config is untouched)
12331  *
12332  * The fields of @p config will be altered to reflect the current
12333  * configuration's values.
12334  *
12335  * @see evas_cserve_config_set()
12336  *
12337  * @ingroup Evas_Cserve
12338  */
12339 EAPI Eina_Bool   evas_cserve_config_get(Evas_Cserve_Config *config) EINA_WARN_UNUSED_RESULT;
12340
12341 /**
12342  * Changes the configurations of the Evas image caching server.
12343  *
12344  * @param config A bitmap cache configuration handle with fields set
12345  * to desired configuration values.
12346  * @return @c EINA_TRUE if @p config was successfully applied,
12347  *         @c EINA_FALSE otherwise.
12348  *
12349  * @see evas_cserve_config_get()
12350  *
12351  * @ingroup Evas_Cserve
12352  */
12353 EAPI Eina_Bool   evas_cserve_config_set(const Evas_Cserve_Config *config) EINA_WARN_UNUSED_RESULT;
12354
12355 /**
12356  * Force the system to disconnect from the bitmap caching server.
12357  *
12358  * @ingroup Evas_Cserve
12359  */
12360 EAPI void        evas_cserve_disconnect(void);
12361
12362 /**
12363  * @defgroup Evas_Utils General Utilities
12364  *
12365  * Some functions that are handy but are not specific of canvas or
12366  * objects.
12367  */
12368
12369 /**
12370  * Converts the given Evas image load error code into a string
12371  * describing it in english.
12372  *
12373  * @param error the error code, a value in ::Evas_Load_Error.
12374  * @return Always returns a valid string. If the given @p error is not
12375  *         supported, <code>"Unknown error"</code> is returned.
12376  *
12377  * Mostly evas_object_image_file_set() would be the function setting
12378  * that error value afterwards, but also evas_object_image_load(),
12379  * evas_object_image_save(), evas_object_image_data_get(),
12380  * evas_object_image_data_convert(), evas_object_image_pixels_import()
12381  * and evas_object_image_is_inside(). This function is meant to be
12382  * used in conjunction with evas_object_image_load_error_get(), as in:
12383  *
12384  * Example code:
12385  * @dontinclude evas-images.c
12386  * @skip img1 =
12387  * @until ecore_main_loop_begin(
12388  *
12389  * Here, being @c valid_path the path to a valid image and @c
12390  * bogus_path a path to a file which does not exist, the two outputs
12391  * of evas_load_error_str() would be (if no other errors occur):
12392  * <code>"No error on load"</code> and <code>"File (or file path) does
12393  * not exist"</code>, respectively. See the full @ref
12394  * Example_Evas_Images "example".
12395  *
12396  * @ingroup Evas_Utils
12397  */
12398 EAPI const char *evas_load_error_str(Evas_Load_Error error);
12399
12400 /* Evas utility routines for color space conversions */
12401 /* hsv color space has h in the range 0.0 to 360.0, and s,v in the range 0.0 to 1.0 */
12402 /* rgb color space has r,g,b in the range 0 to 255 */
12403
12404 /**
12405  * Convert a given color from HSV to RGB format.
12406  *
12407  * @param h The Hue component of the color.
12408  * @param s The Saturation component of the color.
12409  * @param v The Value component of the color.
12410  * @param r The Red component of the color.
12411  * @param g The Green component of the color.
12412  * @param b The Blue component of the color.
12413  *
12414  * This function converts a given color in HSV color format to RGB
12415  * color format.
12416  *
12417  * @ingroup Evas_Utils
12418  **/
12419 EAPI void evas_color_hsv_to_rgb(float h, float s, float v, int *r, int *g, int *b);
12420
12421 /**
12422  * Convert a given color from RGB to HSV format.
12423  *
12424  * @param r The Red component of the color.
12425  * @param g The Green component of the color.
12426  * @param b The Blue component of the color.
12427  * @param h The Hue component of the color.
12428  * @param s The Saturation component of the color.
12429  * @param v The Value component of the color.
12430  *
12431  * This function converts a given color in RGB color format to HSV
12432  * color format.
12433  *
12434  * @ingroup Evas_Utils
12435  **/
12436 EAPI void evas_color_rgb_to_hsv(int r, int g, int b, float *h, float *s, float *v);
12437
12438 /* argb color space has a,r,g,b in the range 0 to 255 */
12439
12440 /**
12441  * Pre-multiplies a rgb triplet by an alpha factor.
12442  *
12443  * @param a The alpha factor.
12444  * @param r The Red component of the color.
12445  * @param g The Green component of the color.
12446  * @param b The Blue component of the color.
12447  *
12448  * This function pre-multiplies a given rgb triplet by an alpha
12449  * factor. Alpha factor is used to define transparency.
12450  *
12451  * @ingroup Evas_Utils
12452  **/
12453 EAPI void evas_color_argb_premul(int a, int *r, int *g, int *b);
12454
12455 /**
12456  * Undo pre-multiplication of a rgb triplet by an alpha factor.
12457  *
12458  * @param a The alpha factor.
12459  * @param r The Red component of the color.
12460  * @param g The Green component of the color.
12461  * @param b The Blue component of the color.
12462  *
12463  * This function undoes pre-multiplication a given rbg triplet by an
12464  * alpha factor. Alpha factor is used to define transparency.
12465  *
12466  * @see evas_color_argb_premul().
12467  *
12468  * @ingroup Evas_Utils
12469  **/
12470 EAPI void evas_color_argb_unpremul(int a, int *r, int *g, int *b);
12471
12472 /**
12473  * Pre-multiplies data by an alpha factor.
12474  *
12475  * @param data The data value.
12476  * @param len  The length value.
12477  *
12478  * This function pre-multiplies a given data by an alpha
12479  * factor. Alpha factor is used to define transparency.
12480  *
12481  * @ingroup Evas_Utils
12482  **/
12483 EAPI void evas_data_argb_premul(unsigned int *data, unsigned int len);
12484
12485 /**
12486  * Undo pre-multiplication data by an alpha factor.
12487  *
12488  * @param data The data value.
12489  * @param len  The length value.
12490  *
12491  * This function undoes pre-multiplication of a given data by an alpha
12492  * factor. Alpha factor is used to define transparency.
12493  *
12494  * @ingroup Evas_Utils
12495  **/
12496 EAPI void evas_data_argb_unpremul(unsigned int *data, unsigned int len);
12497
12498 /* string and font handling */
12499
12500 /**
12501  * Gets the next character in the string
12502  *
12503  * Given the UTF-8 string in @p str, and starting byte position in @p pos,
12504  * this function will place in @p decoded the decoded code point at @p pos
12505  * and return the byte index for the next character in the string.
12506  *
12507  * The only boundary check done is that @p pos must be >= 0. Other than that,
12508  * no checks are performed, so passing an index value that's not within the
12509  * length of the string will result in undefined behavior.
12510  *
12511  * @param str The UTF-8 string
12512  * @param pos The byte index where to start
12513  * @param decoded Address where to store the decoded code point. Optional.
12514  *
12515  * @return The byte index of the next character
12516  *
12517  * @ingroup Evas_Utils
12518  */
12519 EAPI int  evas_string_char_next_get(const char *str, int pos, int *decoded) EINA_ARG_NONNULL(1);
12520
12521 /**
12522  * Gets the previous character in the string
12523  *
12524  * Given the UTF-8 string in @p str, and starting byte position in @p pos,
12525  * this function will place in @p decoded the decoded code point at @p pos
12526  * and return the byte index for the previous character in the string.
12527  *
12528  * The only boundary check done is that @p pos must be >= 1. Other than that,
12529  * no checks are performed, so passing an index value that's not within the
12530  * length of the string will result in undefined behavior.
12531  *
12532  * @param str The UTF-8 string
12533  * @param pos The byte index where to start
12534  * @param decoded Address where to store the decoded code point. Optional.
12535  *
12536  * @return The byte index of the previous character
12537  *
12538  * @ingroup Evas_Utils
12539  */
12540 EAPI int  evas_string_char_prev_get(const char *str, int pos, int *decoded) EINA_ARG_NONNULL(1);
12541
12542 /**
12543  * Get the length in characters of the string.
12544  * @param  str The string to get the length of.
12545  * @return The length in characters (not bytes)
12546  * @ingroup Evas_Utils
12547  */
12548 EAPI int  evas_string_char_len_get(const char *str) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
12549
12550 /**
12551  * @defgroup Evas_Keys Key Input Functions
12552  *
12553  * Functions which feed key events to the canvas.
12554  *
12555  * As explained in @ref intro_not_evas, Evas is @b not aware of input
12556  * systems at all. Then, the user, if using it crudely (evas_new()),
12557  * will have to feed it with input events, so that it can react
12558  * somehow. If, however, the user creates a canvas by means of the
12559  * Ecore_Evas wrapper, it will automatically bind the chosen display
12560  * engine's input events to the canvas, for you.
12561  *
12562  * This group presents the functions dealing with the feeding of key
12563  * events to the canvas. On most of them, one has to reference a given
12564  * key by a name (<code>keyname</code> argument). Those are
12565  * <b>platform dependent</b> symbolic names for the keys. Sometimes
12566  * you'll get the right <code>keyname</code> by simply using an ASCII
12567  * value of the key name, but it won't be like that always.
12568  *
12569  * Typical platforms are Linux frame buffer (Ecore_FB) and X server
12570  * (Ecore_X) when using Evas with Ecore and Ecore_Evas. Please refer
12571  * to your display engine's documentation when using evas through an
12572  * Ecore helper wrapper when you need the <code>keyname</code>s.
12573  *
12574  * Example:
12575  * @dontinclude evas-events.c
12576  * @skip mods = evas_key_modifier_get(evas);
12577  * @until {
12578  *
12579  * All the other @c evas_key functions behave on the same manner. See
12580  * the full @ref Example_Evas_Events "example".
12581  *
12582  * @ingroup Evas_Canvas
12583  */
12584
12585 /**
12586  * @addtogroup Evas_Keys
12587  * @{
12588  */
12589
12590 /**
12591  * Returns a handle to the list of modifier keys registered in the
12592  * canvas @p e. This is required to check for which modifiers are set
12593  * at a given time with the evas_key_modifier_is_set() function.
12594  *
12595  * @param e The pointer to the Evas canvas
12596  *
12597  * @see evas_key_modifier_add
12598  * @see evas_key_modifier_del
12599  * @see evas_key_modifier_on
12600  * @see evas_key_modifier_off
12601  * @see evas_key_modifier_is_set
12602  *
12603  * @return An ::Evas_Modifier handle to query Evas' keys subsystem
12604  *      with evas_key_modifier_is_set(), or @c NULL on error.
12605  */
12606 EAPI const Evas_Modifier *evas_key_modifier_get(const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
12607
12608 /**
12609  * Returns a handle to the list of lock keys registered in the canvas
12610  * @p e. This is required to check for which locks are set at a given
12611  * time with the evas_key_lock_is_set() function.
12612  *
12613  * @param e The pointer to the Evas canvas
12614  *
12615  * @see evas_key_lock_add
12616  * @see evas_key_lock_del
12617  * @see evas_key_lock_on
12618  * @see evas_key_lock_off
12619  * @see evas_key_lock_is_set
12620  *
12621  * @return An ::Evas_Lock handle to query Evas' keys subsystem with
12622  *      evas_key_lock_is_set(), or @c NULL on error.
12623  */
12624 EAPI const Evas_Lock     *evas_key_lock_get(const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
12625
12626 /**
12627  * Checks the state of a given modifier key, at the time of the
12628  * call. If the modifier is set, such as shift being pressed, this
12629  * function returns @c Eina_True.
12630  *
12631  * @param m The current modifiers set, as returned by
12632  *        evas_key_modifier_get().
12633  * @param keyname The name of the modifier key to check status for.
12634  *
12635  * @return @c Eina_True if the modifier key named @p keyname is on, @c
12636  *         Eina_False otherwise.
12637  *
12638  * @see evas_key_modifier_add
12639  * @see evas_key_modifier_del
12640  * @see evas_key_modifier_get
12641  * @see evas_key_modifier_on
12642  * @see evas_key_modifier_off
12643  */
12644 EAPI Eina_Bool            evas_key_modifier_is_set(const Evas_Modifier *m, const char *keyname) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2);
12645
12646 /**
12647  * Checks the state of a given lock key, at the time of the call. If
12648  * the lock is set, such as caps lock, this function returns @c
12649  * Eina_True.
12650  *
12651  * @param l The current locks set, as returned by evas_key_lock_get().
12652  * @param keyname The name of the lock key to check status for.
12653  *
12654  * @return @c Eina_True if the @p keyname lock key is set, @c
12655  *        Eina_False otherwise.
12656  *
12657  * @see evas_key_lock_get
12658  * @see evas_key_lock_add
12659  * @see evas_key_lock_del
12660  * @see evas_key_lock_on
12661  * @see evas_key_lock_off
12662  */
12663 EAPI Eina_Bool            evas_key_lock_is_set(const Evas_Lock *l, const char *keyname) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2);
12664
12665 /**
12666  * Adds the @p keyname key to the current list of modifier keys.
12667  *
12668  * @param e The pointer to the Evas canvas
12669  * @param keyname The name of the modifier key to add to the list of
12670  *        Evas modifiers.
12671  *
12672  * Modifiers are keys like shift, alt and ctrl, i.e., keys which are
12673  * meant to be pressed together with others, altering the behavior of
12674  * the secondly pressed keys somehow. Evas is so that these keys can
12675  * be user defined.
12676  *
12677  * This call allows custom modifiers to be added to the Evas system at
12678  * run time. It is then possible to set and unset modifier keys
12679  * programmatically for other parts of the program to check and act
12680  * on. Programmers using Evas would check for modifier keys on key
12681  * event callbacks using evas_key_modifier_is_set().
12682  *
12683  * @see evas_key_modifier_del
12684  * @see evas_key_modifier_get
12685  * @see evas_key_modifier_on
12686  * @see evas_key_modifier_off
12687  * @see evas_key_modifier_is_set
12688  *
12689  * @note If the programmer instantiates the canvas by means of the
12690  *       ecore_evas_new() family of helper functions, Ecore will take
12691  *       care of registering on it all standard modifiers: "Shift",
12692  *       "Control", "Alt", "Meta", "Hyper", "Super".
12693  */
12694 EAPI void                 evas_key_modifier_add(Evas *e, const char *keyname) EINA_ARG_NONNULL(1, 2);
12695
12696 /**
12697  * Removes the @p keyname key from the current list of modifier keys
12698  * on canvas @p e.
12699  *
12700  * @param e The pointer to the Evas canvas
12701  * @param keyname The name of the key to remove from the modifiers list.
12702  *
12703  * @see evas_key_modifier_add
12704  * @see evas_key_modifier_get
12705  * @see evas_key_modifier_on
12706  * @see evas_key_modifier_off
12707  * @see evas_key_modifier_is_set
12708  */
12709 EAPI void                 evas_key_modifier_del(Evas *e, const char *keyname) EINA_ARG_NONNULL(1, 2);
12710
12711 /**
12712  * Adds the @p keyname key to the current list of lock keys.
12713  *
12714  * @param e The pointer to the Evas canvas
12715  * @param keyname The name of the key to add to the locks list.
12716  *
12717  * Locks are keys like caps lock, num lock or scroll lock, i.e., keys
12718  * which are meant to be pressed once -- toggling a binary state which
12719  * is bound to it -- and thus altering the behavior of all
12720  * subsequently pressed keys somehow, depending on its state. Evas is
12721  * so that these keys can be defined by the user.
12722  *
12723  * This allows custom locks to be added to the evas system at run
12724  * time. It is then possible to set and unset lock keys
12725  * programmatically for other parts of the program to check and act
12726  * on. Programmers using Evas would check for lock keys on key event
12727  * callbacks using evas_key_lock_is_set().
12728  *
12729  * @see evas_key_lock_get
12730  * @see evas_key_lock_del
12731  * @see evas_key_lock_on
12732  * @see evas_key_lock_off
12733  * @see evas_key_lock_is_set
12734  *
12735  * @note If the programmer instantiates the canvas by means of the
12736  *       ecore_evas_new() family of helper functions, Ecore will take
12737  *       care of registering on it all standard lock keys: "Caps_Lock",
12738  *       "Num_Lock", "Scroll_Lock".
12739  */
12740 EAPI void                 evas_key_lock_add(Evas *e, const char *keyname) EINA_ARG_NONNULL(1, 2);
12741
12742 /**
12743  * Removes the @p keyname key from the current list of lock keys on
12744  * canvas @p e.
12745  *
12746  * @param e The pointer to the Evas canvas
12747  * @param keyname The name of the key to remove from the locks list.
12748  *
12749  * @see evas_key_lock_get
12750  * @see evas_key_lock_add
12751  * @see evas_key_lock_on
12752  * @see evas_key_lock_off
12753  */
12754 EAPI void                 evas_key_lock_del(Evas *e, const char *keyname) EINA_ARG_NONNULL(1, 2);
12755
12756 /**
12757  * Enables or turns on programmatically the modifier key with name @p
12758  * keyname.
12759  *
12760  * @param e The pointer to the Evas canvas
12761  * @param keyname The name of the modifier to enable.
12762  *
12763  * The effect will be as if the key was pressed for the whole time
12764  * between this call and a matching evas_key_modifier_off().
12765  *
12766  * @see evas_key_modifier_add
12767  * @see evas_key_modifier_get
12768  * @see evas_key_modifier_off
12769  * @see evas_key_modifier_is_set
12770  */
12771 EAPI void                 evas_key_modifier_on(Evas *e, const char *keyname) EINA_ARG_NONNULL(1, 2);
12772
12773 /**
12774  * Disables or turns off programmatically the modifier key with name
12775  * @p keyname.
12776  *
12777  * @param e The pointer to the Evas canvas
12778  * @param keyname The name of the modifier to disable.
12779  *
12780  * @see evas_key_modifier_add
12781  * @see evas_key_modifier_get
12782  * @see evas_key_modifier_on
12783  * @see evas_key_modifier_is_set
12784  */
12785 EAPI void                 evas_key_modifier_off(Evas *e, const char *keyname) EINA_ARG_NONNULL(1, 2);
12786
12787 /**
12788  * Enables or turns on programmatically the lock key with name @p
12789  * keyname.
12790  *
12791  * @param e The pointer to the Evas canvas
12792  * @param keyname The name of the lock to enable.
12793  *
12794  * The effect will be as if the key was put on its active state after
12795  * this call.
12796  *
12797  * @see evas_key_lock_get
12798  * @see evas_key_lock_add
12799  * @see evas_key_lock_del
12800  * @see evas_key_lock_off
12801  */
12802 EAPI void                 evas_key_lock_on(Evas *e, const char *keyname) EINA_ARG_NONNULL(1, 2);
12803
12804 /**
12805  * Disables or turns off programmatically the lock key with name @p
12806  * keyname.
12807  *
12808  * @param e The pointer to the Evas canvas
12809  * @param keyname The name of the lock to disable.
12810  *
12811  * The effect will be as if the key was put on its inactive state
12812  * after this call.
12813  *
12814  * @see evas_key_lock_get
12815  * @see evas_key_lock_add
12816  * @see evas_key_lock_del
12817  * @see evas_key_lock_on
12818  */
12819 EAPI void                 evas_key_lock_off(Evas *e, const char *keyname) EINA_ARG_NONNULL(1, 2);
12820
12821 /**
12822  * Creates a bit mask from the @p keyname @b modifier key. Values
12823  * returned from different calls to it may be ORed together,
12824  * naturally.
12825  *
12826  * @param e The canvas whom to query the bit mask from.
12827  * @param keyname The name of the modifier key to create the mask for.
12828  *
12829  * @returns the bit mask or 0 if the @p keyname key wasn't registered as a
12830  *          modifier for canvas @p e.
12831  *
12832  * This function is meant to be using in conjunction with
12833  * evas_object_key_grab()/evas_object_key_ungrab(). Go check their
12834  * documentation for more information.
12835  *
12836  * @see evas_key_modifier_add
12837  * @see evas_key_modifier_get
12838  * @see evas_key_modifier_on
12839  * @see evas_key_modifier_off
12840  * @see evas_key_modifier_is_set
12841  * @see evas_object_key_grab
12842  * @see evas_object_key_ungrab
12843  */
12844 EAPI Evas_Modifier_Mask   evas_key_modifier_mask_get(const Evas *e, const char *keyname) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2);
12845
12846 /**
12847  * Requests @p keyname key events be directed to @p obj.
12848  *
12849  * @param obj the object to direct @p keyname events to.
12850  * @param keyname the key to request events for.
12851  * @param modifiers a mask of modifiers that must be present to
12852  * trigger the event.
12853  * @param not_modifiers a mask of modifiers that must @b not be present
12854  * to trigger the event.
12855  * @param exclusive request that the @p obj is the only object
12856  * receiving the @p keyname events.
12857  * @return @c EINA_TRUE, if the call succeeded, @c EINA_FALSE otherwise.
12858  *
12859  * Key grabs allow one or more objects to receive key events for
12860  * specific key strokes even if other objects have focus. Whenever a
12861  * key is grabbed, only the objects grabbing it will get the events
12862  * for the given keys.
12863  *
12864  * @p keyname is a platform dependent symbolic name for the key
12865  * pressed (see @ref Evas_Keys for more information).
12866  *
12867  * @p modifiers and @p not_modifiers are bit masks of all the
12868  * modifiers that must and mustn't, respectively, be pressed along
12869  * with @p keyname key in order to trigger this new key
12870  * grab. Modifiers can be things such as Shift and Ctrl as well as
12871  * user defined types via evas_key_modifier_add(). Retrieve them with
12872  * evas_key_modifier_mask_get() or use @c 0 for empty masks.
12873  *
12874  * @p exclusive will make the given object the only one permitted to
12875  * grab the given key. If given @c EINA_TRUE, subsequent calls on this
12876  * function with different @p obj arguments will fail, unless the key
12877  * is ungrabbed again.
12878  *
12879  * Example code follows.
12880  * @dontinclude evas-events.c
12881  * @skip if (d.focus)
12882  * @until else
12883  *
12884  * See the full example @ref Example_Evas_Events "here".
12885  *
12886  * @warning Providing impossible modifier sets creates undefined behavior
12887  *
12888  * @see evas_object_key_ungrab
12889  * @see evas_object_focus_set
12890  * @see evas_object_focus_get
12891  * @see evas_focus_get
12892  * @see evas_key_modifier_add
12893  */
12894 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);
12895
12896 /**
12897  * Removes the grab on @p keyname key events by @p obj.
12898  *
12899  * @param obj the object that has an existing key grab.
12900  * @param keyname the key the grab is set for.
12901  * @param modifiers a mask of modifiers that must be present to
12902  * trigger the event.
12903  * @param not_modifiers a mask of modifiers that must not not be
12904  * present to trigger the event.
12905  *
12906  * Removes a key grab on @p obj if @p keyname, @p modifiers, and @p
12907  * not_modifiers match.
12908  *
12909  * Example code follows.
12910  * @dontinclude evas-events.c
12911  * @skip got here by key grabs
12912  * @until }
12913  *
12914  * See the full example @ref Example_Evas_Events "here".
12915  *
12916  * @see evas_object_key_grab
12917  * @see evas_object_focus_set
12918  * @see evas_object_focus_get
12919  * @see evas_focus_get
12920  */
12921 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);
12922
12923 /**
12924  * @}
12925  */
12926
12927 /**
12928  * @defgroup Evas_Touch_Point_List Touch Point List Functions
12929  *
12930  * Functions to get information of touched points in the Evas.
12931  *
12932  * Evas maintains list of touched points on the canvas. Each point has
12933  * its co-ordinates, id and state. You can get the number of touched
12934  * points and information of each point using evas_touch_point_list
12935  * functions.
12936  *
12937  * @ingroup Evas_Canvas
12938  */
12939
12940 /**
12941  * @addtogroup Evas_Touch_Point_List
12942  * @{
12943  */
12944
12945 /**
12946  * Get the number of touched point in the evas.
12947  *
12948  * @param e The pointer to the Evas canvas.
12949  * @return The number of touched point on the evas.
12950  *
12951  * New touched point is added to the list whenever touching the evas
12952  * and point is removed whenever removing touched point from the evas.
12953  *
12954  * Example:
12955  * @code
12956  * extern Evas *evas;
12957  * int count;
12958  *
12959  * count = evas_touch_point_list_count(evas);
12960  * printf("The count of touch points: %i\n", count);
12961  * @endcode
12962  *
12963  * @see evas_touch_point_list_nth_xy_get()
12964  * @see evas_touch_point_list_nth_id_get()
12965  * @see evas_touch_point_list_nth_state_get()
12966  */
12967 EAPI unsigned int           evas_touch_point_list_count(Evas *e) EINA_ARG_NONNULL(1);
12968
12969 /**
12970  * This function returns the nth touch point's co-ordinates.
12971  *
12972  * @param e The pointer to the Evas canvas.
12973  * @param n The number of the touched point (0 being the first).
12974  * @param x The pointer to a Evas_Coord to be filled in.
12975  * @param y The pointer to a Evas_Coord to be filled in.
12976  *
12977  * Touch point's co-ordinates is updated whenever moving that point
12978  * on the canvas.
12979  *
12980  * Example:
12981  * @code
12982  * extern Evas *evas;
12983  * Evas_Coord x, y;
12984  *
12985  * if (evas_touch_point_list_count(evas))
12986  *   {
12987  *      evas_touch_point_nth_xy_get(evas, 0, &x, &y);
12988  *      printf("The first touch point's co-ordinate: (%i, %i)\n", x, y);
12989  *   }
12990  * @endcode
12991  *
12992  * @see evas_touch_point_list_count()
12993  * @see evas_touch_point_list_nth_id_get()
12994  * @see evas_touch_point_list_nth_state_get()
12995  */
12996 EAPI void                   evas_touch_point_list_nth_xy_get(Evas *e, unsigned int n, Evas_Coord *x, Evas_Coord *y) EINA_ARG_NONNULL(1);
12997
12998 /**
12999  * This function returns the @p id of nth touch point.
13000  *
13001  * @param e The pointer to the Evas canvas.
13002  * @param n The number of the touched point (0 being the first).
13003  * @return id of nth touch point, if the call succeeded, -1 otherwise.
13004  *
13005  * The point which comes from Mouse Event has @p id 0 and The point
13006  * which comes from Multi Event has @p id that is same as Multi
13007  * Event's device id.
13008  *
13009  * Example:
13010  * @code
13011  * extern Evas *evas;
13012  * int id;
13013  *
13014  * if (evas_touch_point_list_count(evas))
13015  *   {
13016  *      id = evas_touch_point_nth_id_get(evas, 0);
13017  *      printf("The first touch point's id: %i\n", id);
13018  *   }
13019  * @endcode
13020  *
13021  * @see evas_touch_point_list_count()
13022  * @see evas_touch_point_list_nth_xy_get()
13023  * @see evas_touch_point_list_nth_state_get()
13024  */
13025 EAPI int                    evas_touch_point_list_nth_id_get(Evas *e, unsigned int n) EINA_ARG_NONNULL(1);
13026
13027 /**
13028  * This function returns the @p state of nth touch point.
13029  *
13030  * @param e The pointer to the Evas canvas.
13031  * @param n The number of the touched point (0 being the first).
13032  * @return @p state of nth touch point, if the call succeeded,
13033  *         EVAS_TOUCH_POINT_CANCEL otherwise.
13034  *
13035  * The point's @p state is EVAS_TOUCH_POINT_DOWN when pressed,
13036  * EVAS_TOUCH_POINT_STILL when the point is not moved after pressed,
13037  * EVAS_TOUCH_POINT_MOVE when moved at least once after pressed and
13038  * EVAS_TOUCH_POINT_UP when released.
13039  *
13040  * Example:
13041  * @code
13042  * extern Evas *evas;
13043  * Evas_Touch_Point_State state;
13044  *
13045  * if (evas_touch_point_list_count(evas))
13046  *   {
13047  *      state = evas_touch_point_nth_state_get(evas, 0);
13048  *      printf("The first touch point's state: %i\n", state);
13049  *   }
13050  * @endcode
13051  *
13052  * @see evas_touch_point_list_count()
13053  * @see evas_touch_point_list_nth_xy_get()
13054  * @see evas_touch_point_list_nth_id_get()
13055  */
13056 EAPI Evas_Touch_Point_State evas_touch_point_list_nth_state_get(Evas *e, unsigned int n) EINA_ARG_NONNULL(1);
13057
13058 /**
13059  * @}
13060  */
13061
13062 #ifdef __cplusplus
13063 }
13064 #endif
13065
13066 #endif