[evas] Documenting and exemplifying the following:
[framework/uifw/evas.git] / src / lib / Evas.h
1 /**
2 @mainpage Evas
3
4 @image html  e_big.png
5
6 @version 1.0.0
7 @author Carsten Haitzler <raster@@rasterman.com>
8 @author Till Adam <till@@adam-lilienthal.de>
9 @author Steve Ireland <sireland@@pobox.com>
10 @author Brett Nash <nash@@nash.id.au>
11 @author Tilman Sauerbeck <tilman@@code-monkey.de>
12 @author Corey Donohoe <atmos@@atmos.org>
13 @author Yuri Hudobin <glassy_ape@@users.sourceforge.net>
14 @author Nathan Ingersoll <ningerso@@d.umn.edu>
15 @author Willem Monsuwe <willem@@stack.nl>
16 @author Jose O Gonzalez <jose_ogp@@juno.com>
17 @author Bernhard Nemec <Bernhard.Nemec@@viasyshc.com>
18 @author Jorge Luis Zapata Muga <jorgeluis.zapata@@gmail.com>
19 @author Cedric Bail <cedric.bail@@free.fr>
20 @author Gustavo Sverzut Barbieri <barbieri@@profusion.mobi>
21 @author Vincent Torri <vtorri@@univ-evry.fr>
22 @author Tim Horton <hortont424@@gmail.com>
23 @author Tom Hacohen <tom@@stosb.com>
24 @author Mathieu Taillefumier <mathieu.taillefumier@@free.fr>
25 @author Iván Briano <ivan@@profusion.mobi>
26 @author Gustavo Lima Chaves <glima@@profusion.mobi>
27 @author Samsung Electronics <tbd>
28 @author Samsung SAIT <tbd>
29 @author Sung W. Park <sungwoo@@gmail.com>
30 @author Jiyoun Park <jy0703.park@@samsung.com>
31 @author Myoungwoon Roy Kim(roy_kim) <myoungwoon.kim@@samsung.com> <myoungwoon@@gmail.com>
32 @author Thierry el Borgi <thierry@@substantiel.fr>
33 @author ChunEon Park <hermet@@hermet.pe.kr>
34 @date 2000-2011
35
36 @section toc Table of Contents
37
38 @li @ref intro
39 @li @ref work
40 @li @ref compiling
41 @li @ref install
42 @li @ref next_steps
43 @li @ref intro_example
44
45
46 @section intro What is Evas?
47
48 Evas is a clean display canvas API for several target display systems that
49 can draw anti-aliased text, smooth super and sub-sampled scaled images,
50 alpha-blend objects much and more.
51
52 It abstracts any need to know much about what the characteristics of your
53 display system are or what graphics calls are used to draw them and how. It
54 deals on an object level where all you do is create and manipulate objects
55 in a canvas, set their properties, and the rest is done for you.
56
57 Evas optimises the rendering pipeline to minimise effort in redrawing changes
58 made to the canvas and so takes this work out of the programmers hand,
59 saving a lot of time and energy.
60
61 It's small and lean, designed to work on embedded systems all the way to
62 large and powerful multi-cpu workstations. It can be compiled to only have
63 the features you need for your target platform if you so wish, thus keeping
64 it small and lean. It has several display back-ends, letting it display on
65 several display systems, making it portable for cross-device and
66 cross-platform development.
67
68 @subsection intro_not_evas What Evas is not?
69
70 Evas is not a widget set or widget toolkit, however it is their
71 base. See Elementary (http://docs.enlightenment.org/auto/elementary/)
72 for a toolkit based on Evas, Edje, Ecore and other Enlightenment
73 technologies.
74
75 It is not dependent or aware of main loops, input or output
76 systems. Input should be polled from various sources and feed them to
77 Evas. Similarly, it will not create windows or report windows updates
78 to your system, rather just drawing the pixels and reporting to the
79 user the areas that were changed. Of course these operations are quite
80 common and thus they are ready to use in Ecore, particularly in
81 Ecore_Evas (http://docs.enlightenment.org/auto/ecore/).
82
83
84 @section work How does Evas work?
85
86 Evas is a canvas display library. This is markedly different from most
87 display and windowing systems as a Canvas is structural and is also a state
88 engine, whereas most display and windowing systems are immediate mode display
89 targets. Evas handles the logic between a structural display via its' state
90 engine, and controls the target windowing system in order to produce
91 rendered results of the current canvases state on the display.
92
93 Immediate mode display systems retain very little, or no state. A program
94 will execute a series of commands, as in the pseudo code:
95
96 @verbatim
97 draw line from position (0, 0) to position (100, 200);
98
99 draw rectangle from position (10, 30) to position (50, 500);
100
101 bitmap_handle = create_bitmap();
102 scale bitmap_handle to size 100 x 100;
103 draw image bitmap_handle at position (10, 30);
104 @endverbatim
105
106 The series of commands is executed by the windowing system and the results
107 are displayed on the screen (normally). Once the commands are executed the
108 display system has little or no idea of how to reproduce this image again,
109 and so has to be instructed by the application how to redraw sections of the
110 screen whenever needed. Each successive command will be executed as
111 instructed by the application and either emulated by software or sent to the
112 graphics hardware on the device to be performed.
113
114 The advantage of such a system is that it is simple, and gives a program
115 tight control over how something looks and is drawn. Given the increasing
116 complexity of displays and demands by users to have better looking
117 interfaces, more and more work is needing to be done at this level by the
118 internals of widget sets, custom display widgets and other programs. This
119 means more and more logic and display rendering code needs to be written
120 time and time again, each time the application needs to figure out how to
121 minimise redraws so that display is fast and interactive, and keep track of
122 redraw logic. The power comes at a high-price, lots of extra code and work.
123 Programmers not very familiar with graphics programming will often make
124 mistakes at this level and produce code that is sub optimal. Those familiar
125 with this kind of programming will simply get bored by writing the same code
126 again and again.
127
128 For example, if in the above scene, the windowing system requires the
129 application to redraw the area from 0, 0 to 50, 50 (also referred as
130 "expose event"), then the programmer must calculate manually the
131 updates and repaint it again:
132
133 @verbatim
134 Redraw from position (0, 0) to position (50, 50):
135
136 // what was in area (0, 0, 50, 50)?
137
138 // 1. intersection part of line (0, 0) to (100, 200)?
139       draw line from position (0, 0) to position (25, 50);
140
141 // 2. intersection part of rectangle (10, 30) to (50, 500)?
142       draw rectangle from position (10, 30) to position (50, 50)
143
144 // 3. intersection part of image at (10, 30), size 100 x 100?
145       bitmap_subimage = subregion from position (0, 0) to position (40, 20)
146       draw image bitmap_subimage at position (10, 30);
147 @endverbatim
148
149 The clever reader might have noticed that, if all elements in the
150 above scene are opaque, then the system is doing useless paints: part
151 of the line is behind the rectangle, and part of the rectangle is
152 behind the image. These useless paints tends to be very costly, as
153 pixels tend to be 4 bytes in size, thus an overlapping region of 100 x
154 100 pixels is around 40000 useless writes! The developer could write
155 code to calculate the overlapping areas and avoid painting then, but
156 then it should be mixed with the "expose event" handling mentioned
157 above and quickly one realizes the initially simpler method became
158 really complex.
159
160 Evas is a structural system in which the programmer creates and manages
161 display objects and their properties, and as a result of this higher level
162 state management, the canvas is able to redraw the set of objects when
163 needed to represent the current state of the canvas.
164
165 For example, the pseudo code:
166
167 @verbatim
168 line_handle = create_line();
169 set line_handle from position (0, 0) to position (100, 200);
170 show line_handle;
171
172 rectangle_handle = create_rectangle();
173 move rectangle_handle to position (10, 30);
174 resize rectangle_handle to size 40 x 470;
175 show rectangle_handle;
176
177 bitmap_handle = create_bitmap();
178 scale bitmap_handle to size 100 x 100;
179 move bitmap_handle to position (10, 30);
180 show bitmap_handle;
181
182 render scene;
183 @endverbatim
184
185 This may look longer, but when the display needs to be refreshed or updated,
186 the programmer only moves, resizes, shows, hides etc. the objects that they
187 need to change. The programmer simply thinks at the object logic level, and
188 the canvas software does the rest of the work for them, figuring out what
189 actually changed in the canvas since it was last drawn, how to most
190 efficiently redraw he canvas and its contents to reflect the current state,
191 and then it can go off and do the actual drawing of the canvas.
192
193 This lets the programmer think in a more natural way when dealing with a
194 display, and saves time and effort of working out how to load and display
195 images, render given the current display system etc. Since Evas also is
196 portable across different display systems, this also gives the programmer
197 the ability to have their code ported and display on different display
198 systems with very little work.
199
200 Evas can be seen as a display system that stands somewhere between a widget
201 set and an immediate mode display system. It retains basic display logic,
202 but does very little high-level logic such as scrollbars, sliders, push
203 buttons etc.
204
205
206 @section compiling How to compile using Evas ?
207
208 Evas is a library your application links to. The procedure for this is very
209 simple. You simply have to compile your application with the appropriate
210 compiler flags that the @p pkg-config script outputs. For example:
211
212 Compiling C or C++ files into object files:
213
214 @verbatim
215 gcc -c -o main.o main.c `pkg-config --cflags evas`
216 @endverbatim
217
218 Linking object files into a binary executable:
219
220 @verbatim
221 gcc -o my_application main.o `pkg-config --libs evas`
222 @endverbatim
223
224 You simply have to make sure that pkg-config is in your shell's PATH (see
225 the manual page for your appropriate shell) and evas.pc in /usr/lib/pkgconfig
226 or its path is in the PKG_CONFIG_PATH environment variable. It's that simple
227 to link and use Evas once you have written your code to use it.
228
229 Since the program is linked to Evas, it is now able to use any advertised
230 API calls to display graphics in a canvas managed by Evas, as well as use
231 the API calls provided to manage data as well.
232
233 You should make sure you add any extra compile and link flags to your
234 compile commands that your application may need as well. The above example
235 is only guaranteed to make Evas add it's own requirements.
236
237
238 @section install How is it installed?
239
240 Simple:
241
242 @verbatim
243 ./configure
244 make
245 su -
246 ...
247 make install
248 @endverbatim
249
250 @section next_steps Next Steps
251
252 After you understood what Evas is and installed it in your system you
253 should proceed understanding the programming interface for all
254 objects, then see the specific for the most used elements. We'd
255 recommend you to take a while to learn Ecore
256 (http://docs.enlightenment.org/auto/ecore/) and Edje
257 (http://docs.enlightenment.org/auto/edje/) as they will likely save
258 you tons of work compared to using just Evas directly.
259
260 Recommended reading:
261
262 @li @ref Evas_Object_Group
263 @li @ref Evas_Object_Rectangle
264 @li @ref Evas_Object_Image
265 @li @ref Evas_Object_Text
266 @li @ref Evas_Smart_Object_Group and @ref Evas_Smart_Group to define
267     an object that provides custom functions to handle clipping,
268     hiding, moving, resizing, setting the color and more. These could
269     be as simple as a group of objects that move together (see @ref
270     Evas_Smart_Object_Clipped). These smart objects can implement what
271     ends to be a widget, providing some intelligence (thus the name),
272     like a button or check box.
273
274 @section intro_example Introductory Example
275
276 @include evas-buffer-simple.c
277 */
278
279 #ifndef _EVAS_H
280 #define _EVAS_H
281
282 #include <time.h>
283
284 #include <Eina.h>
285
286 #ifdef EAPI
287 # undef EAPI
288 #endif
289
290 #ifdef _WIN32
291 # ifdef EFL_EVAS_BUILD
292 #  ifdef DLL_EXPORT
293 #   define EAPI __declspec(dllexport)
294 #  else
295 #   define EAPI
296 #  endif /* ! DLL_EXPORT */
297 # else
298 #  define EAPI __declspec(dllimport)
299 # endif /* ! EFL_EVAS_BUILD */
300 #else
301 # ifdef __GNUC__
302 #  if __GNUC__ >= 4
303 #   define EAPI __attribute__ ((visibility("default")))
304 #  else
305 #   define EAPI
306 #  endif
307 # else
308 #  define EAPI
309 # endif
310 #endif /* ! _WIN32 */
311
312 #ifdef __cplusplus
313 extern "C" {
314 #endif
315
316 #define EVAS_VERSION_MAJOR 1
317 #define EVAS_VERSION_MINOR 0
318
319 typedef struct _Evas_Version
320 {
321    int major;
322    int minor;
323    int micro;
324    int revision;
325 } Evas_Version;
326
327 EAPI extern Evas_Version *evas_version;
328
329 /**
330  * @file
331  * @brief These routines are used for Evas library interaction.
332  *
333  * @todo check boolean return values and convert to Eina_Bool
334  * @todo change all api to use EINA_SAFETY_*
335  * @todo finish api documentation
336  */
337
338 /* BiDi exposed stuff */
339    /*FIXME: document */
340 typedef enum _Evas_BiDi_Direction
341 {
342    EVAS_BIDI_DIRECTION_NATURAL,
343    EVAS_BIDI_DIRECTION_LTR,
344    EVAS_BIDI_DIRECTION_RTL
345 } Evas_BiDi_Direction;
346
347 /**
348  * Identifier of callbacks to be set for Evas canvases or Evas
349  * objects.
350  *
351  * @see evas_object_event_callback_add()
352  * @see evas_event_callback_add()
353  */
354 typedef enum _Evas_Callback_Type
355 {
356    /*
357     * The following events are only for use with Evas objects, with
358     * evas_object_event_callback_add():
359     */
360    EVAS_CALLBACK_MOUSE_IN, /**< Mouse In Event */
361    EVAS_CALLBACK_MOUSE_OUT, /**< Mouse Out Event */
362    EVAS_CALLBACK_MOUSE_DOWN, /**< Mouse Button Down Event */
363    EVAS_CALLBACK_MOUSE_UP, /**< Mouse Button Up Event */
364    EVAS_CALLBACK_MOUSE_MOVE, /**< Mouse Move Event */
365    EVAS_CALLBACK_MOUSE_WHEEL, /**< Mouse Wheel Event */
366    EVAS_CALLBACK_MULTI_DOWN, /**< Multi-touch Down Event */
367    EVAS_CALLBACK_MULTI_UP, /**< Multi-touch Up Event */
368    EVAS_CALLBACK_MULTI_MOVE, /**< Multi-touch Move Event */
369    EVAS_CALLBACK_FREE, /**< Object Being Freed (Called after Del) */
370    EVAS_CALLBACK_KEY_DOWN, /**< Key Press Event */
371    EVAS_CALLBACK_KEY_UP, /**< Key Release Event */
372    EVAS_CALLBACK_FOCUS_IN, /**< Focus In Event */
373    EVAS_CALLBACK_FOCUS_OUT, /**< Focus Out Event */
374    EVAS_CALLBACK_SHOW, /**< Show Event */
375    EVAS_CALLBACK_HIDE, /**< Hide Event */
376    EVAS_CALLBACK_MOVE, /**< Move Event */
377    EVAS_CALLBACK_RESIZE, /**< Resize Event */
378    EVAS_CALLBACK_RESTACK, /**< Restack Event */
379    EVAS_CALLBACK_DEL, /**< Object Being Deleted (called before Free) */
380    EVAS_CALLBACK_HOLD, /**< Events go on/off hold */
381    EVAS_CALLBACK_CHANGED_SIZE_HINTS, /**< Size hints changed event */
382    EVAS_CALLBACK_IMAGE_PRELOADED, /**< Image has been preloaded */
383
384    /*
385     * The following events are only for use with Evas canvases, with
386     * evas_event_callback_add():
387     */
388    EVAS_CALLBACK_CANVAS_FOCUS_IN, /**< Canvas got focus as a whole */
389    EVAS_CALLBACK_CANVAS_FOCUS_OUT, /**< Canvas lost focus as a whole */
390    EVAS_CALLBACK_RENDER_FLUSH_PRE, /**< Called just before rendering is updated on the canvas target */
391    EVAS_CALLBACK_RENDER_FLUSH_POST, /**< Called just after rendering is updated on the canvas target */
392    EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_IN, /**< Canvas object got focus */
393    EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_OUT, /**< Canvas object lost focus */
394
395    /*
396     * More Evas object event types - see evas_object_event_callback_add():
397     */
398    EVAS_CALLBACK_IMAGE_UNLOADED, /**< Image data has been unloaded (by some mechanims in Evas that throw out original image data) */
399
400    EVAS_CALLBACK_LAST /**< kept as last element/sentinel -- not really an event */
401 } Evas_Callback_Type; /**< The types of events triggering a callback */
402
403 /**
404  * Flags for Mouse Button events
405  */
406 typedef enum _Evas_Button_Flags
407 {
408    EVAS_BUTTON_NONE = 0, /**< No extra mouse button data */
409    EVAS_BUTTON_DOUBLE_CLICK = (1 << 0), /**< This mouse button press was the 2nd press of a double click */
410    EVAS_BUTTON_TRIPLE_CLICK = (1 << 1) /**< This mouse button press was the 3rd press of a triple click */
411 } Evas_Button_Flags; /**< Flags for Mouse Button events */
412
413 /**
414  * Flags for Events
415  */
416 typedef enum _Evas_Event_Flags
417 {
418    EVAS_EVENT_FLAG_NONE = 0, /**< No fancy flags set */
419    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 */
420    EVAS_EVENT_FLAG_ON_SCROLL = (1 << 1) /**< This event flag indicates the event occurs while scrolling; for exameple, DOWN event occurs during scrolling; the event should be used for informational purposes and maybe some indications visually, but not actually perform anything */
421 } Evas_Event_Flags; /**< Flags for Events */
422
423 /**
424  * Flags for Font Hinting
425  * @ingroup Evas_Font_Group
426  */
427 typedef enum _Evas_Font_Hinting_Flags
428 {
429    EVAS_FONT_HINTING_NONE, /**< No font hinting */
430    EVAS_FONT_HINTING_AUTO, /**< Automatic font hinting */
431    EVAS_FONT_HINTING_BYTECODE /**< Bytecode font hinting */
432 } Evas_Font_Hinting_Flags; /**< Flags for Font Hinting */
433
434 /**
435  * Colorspaces for pixel data supported by Evas
436  * @ingroup Evas_Object_Image
437  */
438 typedef enum _Evas_Colorspace
439 {
440    EVAS_COLORSPACE_ARGB8888, /**< ARGB 32 bits per pixel, high-byte is Alpha, accessed 1 32bit word at a time */
441      /* these are not currently supported - but planned for the future */
442    EVAS_COLORSPACE_YCBCR422P601_PL, /**< YCbCr 4:2:2 Planar, ITU.BT-601 specifications. The data poitned to is just an array of row pointer, pointing to the Y rows, then the Cb, then Cr rows */
443    EVAS_COLORSPACE_YCBCR422P709_PL,/**< YCbCr 4:2:2 Planar, ITU.BT-709 specifications. The data poitned to is just an array of row pointer, pointing to the Y rows, then the Cb, then Cr rows */
444    EVAS_COLORSPACE_RGB565_A5P, /**< 16bit rgb565 + Alpha plane at end - 5 bits of the 8 being used per alpha byte */
445    EVAS_COLORSPACE_GRY8 /**< 8bit grayscale */
446 } Evas_Colorspace; /**< Colorspaces for pixel data supported by Evas */
447
448 /**
449  * How to pack items into cells in a table.
450  * @ingroup Evas_Object_Table
451  */
452 typedef enum _Evas_Object_Table_Homogeneous_Mode
453 {
454   EVAS_OBJECT_TABLE_HOMOGENEOUS_NONE = 0,
455   EVAS_OBJECT_TABLE_HOMOGENEOUS_TABLE = 1,
456   EVAS_OBJECT_TABLE_HOMOGENEOUS_ITEM = 2
457 } Evas_Object_Table_Homogeneous_Mode; /**< Table cell pack mode. */
458
459 typedef struct _Evas_Coord_Rectangle  Evas_Coord_Rectangle; /**< A generic rectangle handle */
460 typedef struct _Evas_Point                   Evas_Point; /**< integer point */
461
462 typedef struct _Evas_Coord_Point             Evas_Coord_Point;  /**< Evas_Coord point */
463 typedef struct _Evas_Coord_Precision_Point   Evas_Coord_Precision_Point; /**< Evas_Coord point with sub-pixel precision */
464
465 typedef struct _Evas_Position                Evas_Position; /**< associates given point in Canvas and Output */
466 typedef struct _Evas_Precision_Position      Evas_Precision_Position; /**< associates given point in Canvas and Output, with sub-pixel precision */
467
468 /**
469  * @typedef Evas_Smart_Class
470  *
471  * A smart object's @b base class definition
472  *
473  * @ingroup Evas_Smart_Group
474  */
475 typedef struct _Evas_Smart_Class             Evas_Smart_Class;
476
477 /**
478  * @typedef Evas_Smart_Cb_Description
479  * A smart object callback description, used to provide introspection
480  * @ingroup Evas_Smart_Group
481  */
482 typedef struct _Evas_Smart_Cb_Description    Evas_Smart_Cb_Description;
483
484 /**
485  * @typedef Evas_Map
486  * An opaque handle to map points
487  * @see evas_map_new()
488  * @see evas_map_free()
489  * @see evas_map_dup()
490  * @ingroup Evas_Object_Group_Map
491  */
492 typedef struct _Evas_Map            Evas_Map;
493
494 /**
495  * @typedef Evas
496  * An opaque handle to an Evas canvas.
497  * @see evas_new()
498  * @see evas_free()
499  * @ingroup Evas_Canvas
500  */
501 typedef struct _Evas                Evas;
502
503 /**
504  * @typedef Evas_Object
505  * An Evas Object handle.
506  * @ingroup Evas_Object_Group
507  */
508 typedef struct _Evas_Object         Evas_Object;
509
510 typedef void                        Evas_Performance; /**< An Evas Performance handle */
511 typedef struct _Evas_Modifier       Evas_Modifier; /**< An opaque type containing information on which modifier keys are registered in an Evas canvas */
512 typedef struct _Evas_Lock           Evas_Lock; /**< An opaque type containing information on which lock keys are registered in an Evas canvas */
513 typedef struct _Evas_Smart          Evas_Smart; /**< An Evas Smart Object handle */
514 typedef struct _Evas_Native_Surface Evas_Native_Surface; /**< A generic datatype for engine specific native surface information */
515 typedef unsigned long long          Evas_Modifier_Mask; /**< An Evas modifier mask type */
516
517 typedef int                         Evas_Coord;
518 typedef int                         Evas_Font_Size;
519 typedef int                         Evas_Angle;
520
521 struct _Evas_Coord_Rectangle /**< A rectangle in Evas_Coord */
522 {
523    Evas_Coord x; /**< top-left x co-ordinate of rectangle */
524    Evas_Coord y; /**< top-left y co-ordinate of rectangle */
525    Evas_Coord w; /**< width of rectangle */
526    Evas_Coord h; /**< height of rectangle */
527 };
528
529 struct _Evas_Point
530 {
531    int x, y;
532 };
533
534 struct _Evas_Coord_Point
535 {
536    Evas_Coord x, y;
537 };
538
539 struct _Evas_Coord_Precision_Point
540 {
541    Evas_Coord x, y;
542    double xsub, ysub;
543 };
544
545 struct _Evas_Position
546 {
547     Evas_Point output;
548     Evas_Coord_Point canvas;
549 };
550
551 struct _Evas_Precision_Position
552 {
553     Evas_Point output;
554     Evas_Coord_Precision_Point canvas;
555 };
556
557 typedef enum _Evas_Aspect_Control
558 {
559    EVAS_ASPECT_CONTROL_NONE = 0, /**< Preference on scaling unset */
560    EVAS_ASPECT_CONTROL_NEITHER = 1, /**< Same effect as unset preference on scaling */
561    EVAS_ASPECT_CONTROL_HORIZONTAL = 2, /**< Use all horizontal container space to place an object, using the given aspect */
562    EVAS_ASPECT_CONTROL_VERTICAL = 3, /**< Use all vertical container space to place an object, using the given aspect */
563    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 */
564 } Evas_Aspect_Control; /**< Aspect types/policies for scaling size hints, used for evas_object_size_hint_aspect_set() */
565
566 typedef struct _Evas_Pixel_Import_Source Evas_Pixel_Import_Source; /**< A source description of pixels for importing pixels */
567 typedef struct _Evas_Engine_Info      Evas_Engine_Info; /**< A generic Evas Engine information structure */
568 typedef struct _Evas_Device           Evas_Device; /**< A source device handle - where the event came from */
569 typedef struct _Evas_Event_Mouse_Down Evas_Event_Mouse_Down; /**< Event structure for #EVAS_CALLBACK_MOUSE_DOWN event callbacks */
570 typedef struct _Evas_Event_Mouse_Up   Evas_Event_Mouse_Up; /**< Event structure for #EVAS_CALLBACK_MOUSE_UP event callbacks */
571 typedef struct _Evas_Event_Mouse_In   Evas_Event_Mouse_In; /**< Event structure for #EVAS_CALLBACK_MOUSE_IN event callbacks */
572 typedef struct _Evas_Event_Mouse_Out  Evas_Event_Mouse_Out; /**< Event structure for #EVAS_CALLBACK_MOUSE_OUT event callbacks */
573 typedef struct _Evas_Event_Mouse_Move Evas_Event_Mouse_Move; /**< Event structure for #EVAS_CALLBACK_MOUSE_MOVE event callbacks */
574 typedef struct _Evas_Event_Mouse_Wheel Evas_Event_Mouse_Wheel; /**< Event structure for #EVAS_CALLBACK_MOUSE_WHEEL event callbacks */
575 typedef struct _Evas_Event_Multi_Down Evas_Event_Multi_Down; /**< Event structure for #EVAS_CALLBACK_MULTI_DOWN event callbacks */
576 typedef struct _Evas_Event_Multi_Up   Evas_Event_Multi_Up; /**< Event structure for #EVAS_CALLBACK_MULTI_UP event callbacks */
577 typedef struct _Evas_Event_Multi_Move Evas_Event_Multi_Move; /**< Event structure for #EVAS_CALLBACK_MULTI_MOVE event callbacks */
578 typedef struct _Evas_Event_Key_Down   Evas_Event_Key_Down; /**< Event structure for #EVAS_CALLBACK_KEY_DOWN event callbacks */
579 typedef struct _Evas_Event_Key_Up     Evas_Event_Key_Up; /**< Event structure for #EVAS_CALLBACK_KEY_UP event callbacks */
580 typedef struct _Evas_Event_Hold       Evas_Event_Hold; /**< Event structure for #EVAS_CALLBACK_HOLD event callbacks */
581
582 typedef enum _Evas_Load_Error
583 {
584    EVAS_LOAD_ERROR_NONE = 0, /**< No error on load */
585    EVAS_LOAD_ERROR_GENERIC = 1, /**< A non-specific error occurred */
586    EVAS_LOAD_ERROR_DOES_NOT_EXIST = 2, /**< File (or file path) does not exist */
587    EVAS_LOAD_ERROR_PERMISSION_DENIED = 3, /**< Permission deinied to an existing file (or path) */
588    EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED = 4, /**< Allocation of resources failure prevented load */
589    EVAS_LOAD_ERROR_CORRUPT_FILE = 5, /**< File corrupt (but was detected as a known format) */
590    EVAS_LOAD_ERROR_UNKNOWN_FORMAT = 6 /**< File is not a known format */
591 } Evas_Load_Error; /**< Evas image load error codes one can get - see evas_load_error_str() too. */
592
593
594 typedef enum _Evas_Alloc_Error
595 {
596    EVAS_ALLOC_ERROR_NONE = 0, /**< No allocation error */
597    EVAS_ALLOC_ERROR_FATAL = 1, /**< Allocation failed despite attempts to free up memory */
598    EVAS_ALLOC_ERROR_RECOVERED = 2 /**< Allocation succeeded, but extra memory had to be found by freeing up speculative resources */
599 } Evas_Alloc_Error; /**< Possible allocation errors returned by evas_alloc_error() */
600
601 typedef enum _Evas_Fill_Spread
602 {
603    EVAS_TEXTURE_REFLECT = 0, /**< image fill tiling mode - tiling reflects */
604    EVAS_TEXTURE_REPEAT = 1, /**< tiling repeats */
605    EVAS_TEXTURE_RESTRICT = 2, /**< tiling clamps - range offset ignored */
606    EVAS_TEXTURE_RESTRICT_REFLECT = 3, /**< tiling clamps and any range offset reflects */
607    EVAS_TEXTURE_RESTRICT_REPEAT = 4, /**< tiling clamps and any range offset repeats */
608    EVAS_TEXTURE_PAD = 5 /**< tiling extends with end values */
609 } Evas_Fill_Spread; /**< Fill types used for evas_object_image_fill_spread_set() */
610
611 typedef enum _Evas_Pixel_Import_Pixel_Format
612 {
613    EVAS_PIXEL_FORMAT_NONE = 0, /**< No pixel format */
614    EVAS_PIXEL_FORMAT_ARGB32 = 1, /**< ARGB 32bit pixel format with A in the high byte per 32bit pixel word */
615    EVAS_PIXEL_FORMAT_YUV420P_601 = 2 /**< YUV 420 Planar format with CCIR 601 color encoding wuth contiguous planes in the order Y, U and V */
616 } Evas_Pixel_Import_Pixel_Format; /**< Pixel format for import call. See evas_object_image_pixels_import() */
617
618 struct _Evas_Pixel_Import_Source
619 {
620    Evas_Pixel_Import_Pixel_Format format; /**< pixel format type ie ARGB32, YUV420P_601 etc. */
621    int w, h; /**< width and height of source in pixels */
622    void **rows; /**< an array of pointers (size depends on format) pointing to left edge of each scanline */
623 };
624
625 /* magic version number to know what the native surf struct looks like */
626 #define EVAS_NATIVE_SURFACE_VERSION 2
627
628 typedef enum _Evas_Native_Surface_Type
629 {
630    EVAS_NATIVE_SURFACE_NONE,
631    EVAS_NATIVE_SURFACE_X11,
632    EVAS_NATIVE_SURFACE_OPENGL
633 } Evas_Native_Surface_Type;
634
635 struct _Evas_Native_Surface
636 {
637    int                         version;
638    Evas_Native_Surface_Type    type;
639    union {
640      struct {
641        void          *visual; /**< visual of the pixmap to use (Visual) */
642        unsigned long  pixmap; /**< pixmap id to use (Pixmap) */
643      } x11;
644      struct {
645        unsigned int   texture_id; /**< opengl texture id to use from glGenTextures() */
646        unsigned int   framebuffer_id; /**< 0 if not a FBO, FBO id otherwise from glGenFramebuffers() */
647        unsigned int   internal_format; /**< same as 'internalFormat' for glTexImage2D() */
648        unsigned int   format; /**< same as 'format' for glTexImage2D() */
649        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) */
650      } opengl;
651    } data;
652 };
653
654 #define EVAS_LAYER_MIN -32768 /**< bottom-most layer number */
655 #define EVAS_LAYER_MAX 32767  /**< top-most layer number */
656
657 #define EVAS_COLOR_SPACE_ARGB 0 /**< Not used for anything */
658 #define EVAS_COLOR_SPACE_AHSV 1 /**< Not used for anything */
659 #define EVAS_TEXT_INVALID -1 /**< Not used for anything */
660 #define EVAS_TEXT_SPECIAL -2 /**< Not used for anything */
661
662 #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() */
663 #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() */
664 #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) */
665 #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) */
666 #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 */
667 #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 */
668
669 /**
670  * How the object should be rendered to output.
671  * @ingroup Evas_Object_Group_Extras
672  */
673 typedef enum _Evas_Render_Op
674 {
675    EVAS_RENDER_BLEND = 0, /**< default op: d = d*(1-sa) + s */
676    EVAS_RENDER_BLEND_REL = 1, /**< d = d*(1 - sa) + s*da */
677    EVAS_RENDER_COPY = 2, /**< d = s */
678    EVAS_RENDER_COPY_REL = 3, /**< d = s*da */
679    EVAS_RENDER_ADD = 4, /**< d = d + s */
680    EVAS_RENDER_ADD_REL = 5, /**< d = d + s*da */
681    EVAS_RENDER_SUB = 6, /**< d = d - s */
682    EVAS_RENDER_SUB_REL = 7, /**< d = d - s*da */
683    EVAS_RENDER_TINT = 8, /**< d = d*s + d*(1 - sa) + s*(1 - da) */
684    EVAS_RENDER_TINT_REL = 9, /**< d = d*(1 - sa + s) */
685    EVAS_RENDER_MASK = 10, /**< d = d*sa */
686    EVAS_RENDER_MUL = 11 /**< d = d*s */
687 } Evas_Render_Op; /**< How the object should be rendered to output. */
688
689 typedef enum _Evas_Border_Fill_Mode
690 {
691    EVAS_BORDER_FILL_NONE = 0, /**< Image's center region is @b not to be rendered */
692    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 */
693    EVAS_BORDER_FILL_SOLID = 2 /**< Image's center region is to be made solid, even if it has transparency on it */
694 } Evas_Border_Fill_Mode; /**< How an image's center region (the complement to the border region) should be rendered by Evas */
695
696 typedef enum _Evas_Image_Scale_Hint
697 {
698    EVAS_IMAGE_SCALE_HINT_NONE = 0,
699    EVAS_IMAGE_SCALE_HINT_DYNAMIC = 1,
700    EVAS_IMAGE_SCALE_HINT_STATIC = 2
701 } Evas_Image_Scale_Hint;
702
703 typedef enum _Evas_Engine_Render_Mode
704 {
705    EVAS_RENDER_MODE_BLOCKING = 0,
706    EVAS_RENDER_MODE_NONBLOCKING = 1,
707 } Evas_Engine_Render_Mode;
708
709 typedef enum _Evas_Image_Content_Hint
710 {
711    EVAS_IMAGE_CONTENT_HINT_NONE = 0, /**< No hint at all */
712    EVAS_IMAGE_CONTENT_HINT_DYNAMIC = 1, /**< The contents will change over time */
713    EVAS_IMAGE_CONTENT_HINT_STATIC = 2 /**< The contents won't change over time */
714 } Evas_Image_Content_Hint; /**< How an image's data is to be treated by Evas, for optimization */
715
716 struct _Evas_Engine_Info /** Generic engine information. Generic info is useless */
717 {
718    int magic; /**< Magic number */
719 };
720
721 struct _Evas_Event_Mouse_Down /** Mouse button press event */
722 {
723    int button; /**< Mouse button number that went down (1 - 32) */
724
725    Evas_Point output;
726    Evas_Coord_Point canvas;
727
728    void          *data;
729    Evas_Modifier *modifiers;
730    Evas_Lock     *locks;
731
732    Evas_Button_Flags flags;
733    unsigned int      timestamp;
734    Evas_Event_Flags  event_flags;
735    Evas_Device      *dev;
736 };
737
738 struct _Evas_Event_Mouse_Up /** Mouse button release event */
739 {
740    int button; /**< Mouse button number that was raised (1 - 32) */
741
742    Evas_Point output;
743    Evas_Coord_Point canvas;
744
745    void          *data;
746    Evas_Modifier *modifiers;
747    Evas_Lock     *locks;
748
749    Evas_Button_Flags flags;
750    unsigned int      timestamp;
751    Evas_Event_Flags  event_flags;
752    Evas_Device      *dev;
753 };
754
755 struct _Evas_Event_Mouse_In /** Mouse enter event */
756 {
757    int buttons; /**< Button pressed mask, Bits set to 1 are buttons currently pressed (bit 0 = mouse button 1, bit 1 = mouse button 2 etc.) */
758
759    Evas_Point output;
760    Evas_Coord_Point canvas;
761
762    void          *data;
763    Evas_Modifier *modifiers;
764    Evas_Lock     *locks;
765    unsigned int   timestamp;
766    Evas_Event_Flags  event_flags;
767    Evas_Device      *dev;
768 };
769
770 struct _Evas_Event_Mouse_Out /** Mouse leave event */
771 {
772    int buttons; /**< Button pressed mask, Bits set to 1 are buttons currently pressed (bit 0 = mouse button 1, bit 1 = mouse button 2 etc.) */
773
774
775    Evas_Point output;
776    Evas_Coord_Point canvas;
777
778    void          *data;
779    Evas_Modifier *modifiers;
780    Evas_Lock     *locks;
781    unsigned int   timestamp;
782    Evas_Event_Flags  event_flags;
783    Evas_Device      *dev;
784 };
785
786 struct _Evas_Event_Mouse_Move /** Mouse button down event */
787 {
788    int buttons; /**< Button pressed mask, Bits set to 1 are buttons currently pressed (bit 0 = mouse button 1, bit 1 = mouse button 2 etc.) */
789
790    Evas_Position cur, prev;
791
792    void          *data;
793    Evas_Modifier *modifiers;
794    Evas_Lock     *locks;
795    unsigned int   timestamp;
796    Evas_Event_Flags  event_flags;
797    Evas_Device      *dev;
798 };
799
800 struct _Evas_Event_Mouse_Wheel /** Wheel event */
801 {
802    int direction; /* 0 = default up/down wheel FIXME: more wheel types */
803    int z; /* ...,-2,-1 = down, 1,2,... = up */
804
805    Evas_Point output;
806    Evas_Coord_Point canvas;
807
808    void          *data;
809    Evas_Modifier *modifiers;
810    Evas_Lock     *locks;
811    unsigned int   timestamp;
812    Evas_Event_Flags  event_flags;
813    Evas_Device      *dev;
814 };
815
816 struct _Evas_Event_Multi_Down /** Multi button press event */
817 {
818    int device; /**< Multi device number that went down (1 or more for extra touches) */
819    double radius, radius_x, radius_y;
820    double pressure, angle;
821
822    Evas_Point output;
823    Evas_Coord_Precision_Point canvas;
824
825    void          *data;
826    Evas_Modifier *modifiers;
827    Evas_Lock     *locks;
828
829    Evas_Button_Flags flags;
830    unsigned int      timestamp;
831    Evas_Event_Flags  event_flags;
832    Evas_Device      *dev;
833 };
834
835 struct _Evas_Event_Multi_Up /** Multi button release event */
836 {
837    int device; /**< Multi device number that went up (1 or more for extra touches) */
838    double radius, radius_x, radius_y;
839    double pressure, angle;
840
841    Evas_Point output;
842    Evas_Coord_Precision_Point canvas;
843
844    void          *data;
845    Evas_Modifier *modifiers;
846    Evas_Lock     *locks;
847
848    Evas_Button_Flags flags;
849    unsigned int      timestamp;
850    Evas_Event_Flags  event_flags;
851    Evas_Device      *dev;
852 };
853
854 struct _Evas_Event_Multi_Move /** Multi button down event */
855 {
856    int device; /**< Multi device number that moved (1 or more for extra touches) */
857    double radius, radius_x, radius_y;
858    double pressure, angle;
859
860    Evas_Precision_Position cur;
861
862    void          *data;
863    Evas_Modifier *modifiers;
864    Evas_Lock     *locks;
865    unsigned int   timestamp;
866    Evas_Event_Flags  event_flags;
867    Evas_Device      *dev;
868 };
869
870 struct _Evas_Event_Key_Down /** Key press event */
871 {
872    char          *keyname; /**< The string name of the key pressed */
873    void          *data;
874    Evas_Modifier *modifiers;
875    Evas_Lock     *locks;
876
877    const char    *key; /**< The logical key : (eg shift+1 == exclamation) */
878    const char    *string; /**< A UTF8 string if this keystroke has produced a visible string to be ADDED */
879    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 */
880    unsigned int   timestamp;
881    Evas_Event_Flags  event_flags;
882    Evas_Device      *dev;
883 };
884
885 struct _Evas_Event_Key_Up /** Key release event */
886 {
887    char          *keyname; /**< The string name of the key released */
888    void          *data;
889    Evas_Modifier *modifiers;
890    Evas_Lock     *locks;
891
892    const char    *key; /**< The logical key : (eg shift+1 == exclamation) */
893    const char    *string; /**< A UTF8 string if this keystroke has produced a visible string to be ADDED */
894    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 */
895    unsigned int   timestamp;
896    Evas_Event_Flags  event_flags;
897    Evas_Device      *dev;
898 };
899
900 struct _Evas_Event_Hold /** Hold change event */
901 {
902    int            hold; /**< The hold flag */
903    void          *data;
904
905    unsigned int   timestamp;
906    Evas_Event_Flags  event_flags;
907    Evas_Device      *dev;
908 };
909
910 /**
911  * How the mouse pointer should be handled by Evas.
912  *
913  * In the mode #EVAS_OBJECT_POINTER_MODE_AUTOGRAB, when a mouse button
914  * is pressed down over an object and held, with the mouse pointer
915  * being moved outside of it, the pointer still behaves as being bound
916  * to that object, albeit out of its drawing region. When the button
917  * is released, the event will be fed to the object, that may check if
918  * the final position is over it or not and do something about it.
919  *
920  * In the mode #EVAS_OBJECT_POINTER_MODE_NOGRAB, the pointer will
921  * always be bound to the object right below it.
922  *
923  * @ingroup Evas_Object_Group_Extras
924  */
925 typedef enum _Evas_Object_Pointer_Mode
926 {
927    EVAS_OBJECT_POINTER_MODE_AUTOGRAB, /**< default, X11-like */
928    EVAS_OBJECT_POINTER_MODE_NOGRAB /**< pointer always bound to the object right below it */
929 } Evas_Object_Pointer_Mode; /**< How the mouse pointer should be handled by Evas. */
930
931 typedef void      (*Evas_Smart_Cb) (void *data, Evas_Object *obj, void *event_info);
932 typedef void      (*Evas_Event_Cb) (void *data, Evas *e, void *event_info); /**< Evas event callback function signature */
933 typedef Eina_Bool (*Evas_Object_Event_Post_Cb) (void *data, Evas *e);
934 typedef void      (*Evas_Object_Event_Cb) (void *data, Evas *e, Evas_Object *obj, void *event_info); /**< Evas object event callback function signature */
935 typedef void      (*Evas_Async_Events_Put_Cb)(void *target, Evas_Callback_Type type, void *event_info);
936
937 /**
938  * @defgroup Evas_Group Top Level Functions
939  *
940  * Functions that affect Evas as a whole.
941  */
942
943 /**
944  * Initialize Evas
945  *
946  * @return The init counter value.
947  *
948  * This function initializes Evas and increments a counter of the
949  * number of calls to it. It returs the new counter's value.
950  *
951  * @see evas_shutdown().
952  *
953  * Most EFL users wouldn't be using this function directly, because
954  * they wouldn't access Evas directly by themselves. Instead, they
955  * would be using higher level helpers, like @c ecore_evas_init().
956  * See http://docs.enlightenment.org/auto/ecore/.
957  *
958  * You should be using this if your use is something like the
959  * following. The buffer engine is just one of the many ones Evas
960  * provides.
961  *
962  * @dontinclude evas-buffer-simple.c
963  * @skip int main
964  * @until return -1;
965  * And being the canvas creation something like:
966  * @skip static Evas *create_canvas
967  * @until    evas_output_viewport_set(canvas,
968  *
969  * Note that this is code creating an Evas canvas with no usage of
970  * Ecore helpers at all -- no linkage with Ecore on this scenario,
971  * thus. Again, this wouldn't be on Evas common usage for most
972  * developers. See the full @ref Example_Evas_Buffer_Simple "example".
973  *
974  * @ingroup Evas_Group
975  */
976 EAPI int               evas_init                         (void);
977
978 /**
979  * Shutdown Evas
980  *
981  * @return Evas' init counter value.
982  *
983  * This function finalizes Evas, decrementing the counter of the
984  * number of calls to the function evas_init(). This new value for the
985  * counter is returned.
986  *
987  * @see evas_init().
988  *
989  * If you were the sole user of Evas, by means of evas_init(), you can
990  * check if it's being properly shut down by expecting a return value
991  * of 0.
992  *
993  * Example code follows.
994  * @dontinclude evas-buffer-simple.c
995  * @skip // NOTE: use ecore_evas_buffer_new
996  * @until evas_shutdown
997  * Where that function would contain:
998  * @skip   evas_free(canvas)
999  * @until   evas_free(canvas)
1000  *
1001  * Most users would be using ecore_evas_shutdown() instead, like told
1002  * in evas_init(). See the full @ref Example_Evas_Buffer_Simple
1003  * "example".
1004  *
1005  * @ingroup Evas_Group
1006  */
1007 EAPI int               evas_shutdown                     (void);
1008
1009
1010 /**
1011  * Return if any allocation errors have occurred during the prior function
1012  * @return The allocation error flag
1013  *
1014  * This function will return if any memory allocation errors occurred during,
1015  * and what kind they were. The return value will be one of
1016  * EVAS_ALLOC_ERROR_NONE, EVAS_ALLOC_ERROR_FATAL or EVAS_ALLOC_ERROR_RECOVERED
1017  * with each meaning something different.
1018  *
1019  * EVAS_ALLOC_ERROR_NONE means that no errors occurred at all and the function
1020  * worked as expected.
1021  *
1022  * EVAS_ALLOC_ERROR_FATAL means the function was completely unable to perform
1023  * its job and will  have  exited as cleanly as possible. The programmer
1024  * should consider this as a sign of very low memory and should try and safely
1025  * recover from the prior functions failure (or try free up memory elsewhere
1026  * and try again after more memory is freed).
1027  *
1028  * EVAS_ALLOC_ERROR_RECOVERED means that an allocation error occurred, but was
1029  * recovered from by evas finding memory of its own it has allocated and
1030  * freeing what it sees as not really usefully allocated memory. What is freed
1031  * may vary. Evas may reduce the resolution of images, free cached images or
1032  * fonts, trhow out pre-rendered data, reduce the complexity of change lists
1033  * etc. Evas and the program will function as per normal after this, but this
1034  * is a sign of low memory, and it is suggested that the program try and
1035  * identify memory it doesn't need, and free it.
1036  *
1037  * Example:
1038  * @code
1039  * extern Evas_Object *object;
1040  * void callback (void *data, Evas *e, Evas_Object *obj, void *event_info);
1041  *
1042  * evas_object_event_callback_add(object, EVAS_CALLBACK_MOUSE_DOWN, callback, NULL);
1043  * if (evas_alloc_error() == EVAS_ALLOC_ERROR_FATAL)
1044  *   {
1045  *     fprintf(stderr, "ERROR: Completely unable to attach callback. Must\n");
1046  *     fprintf(stderr, "       destroy object now as it cannot be used.\n");
1047  *     evas_object_del(object);
1048  *     object = NULL;
1049  *     fprintf(stderr, "WARNING: Memory is really low. Cleaning out RAM.\n");
1050  *     my_memory_cleanup();
1051  *   }
1052  * if (evas_alloc_error() == EVAS_ALLOC_ERROR_RECOVERED)
1053  *   {
1054  *     fprintf(stderr, "WARNING: Memory is really low. Cleaning out RAM.\n");
1055  *     my_memory_cleanup();
1056  *   }
1057  * @endcode
1058  *
1059  * @ingroup Evas_Group
1060  */
1061 EAPI Evas_Alloc_Error  evas_alloc_error                  (void);
1062
1063
1064 /**
1065  * @brief Get evas' internal asynchronous events read file descriptor.
1066  *
1067  * @return The canvas' asynchronous events read file descriptor.
1068  *
1069  * Evas' asynchronous events are meant to be dealt with internally,
1070  * i. e., when building stuff to be glued together into the EFL
1071  * infrastructure -- a module, for example. The context which demands
1072  * its use is when calculations need to be done out of the main
1073  * thread, asynchronously, and some action must be performed after
1074  * that.
1075  *
1076  * An example of actual use of this API is for image asynchronous
1077  * preload inside evas. If the canvas was instantiated through
1078  * ecore-evas usage, ecore itself will take care of calling those
1079  * events' processing.
1080  *
1081  * This function returns the read file descriptor where to get the
1082  * asynchronous events of the canvas. Naturally, other mainloops,
1083  * apart from ecore, may make use of it.
1084  *
1085  * @ingroup Evas_Group
1086  */
1087 EAPI int               evas_async_events_fd_get          (void) EINA_WARN_UNUSED_RESULT EINA_PURE;
1088
1089 /**
1090  * @brief Trigger the processing of all events waiting on the file
1091  * descriptor returned by evas_async_events_fd_get().
1092  *
1093  * @return The number of events processed.
1094  *
1095  * All asynchronous events queued up by evas_async_events_put() are
1096  * processed here. More precisely, the callback functions, informed
1097  * together with other event parameters, when queued, get called (with
1098  * those parameters), in that order.
1099  *
1100  * @ingroup Evas_Group
1101  */
1102 EAPI int               evas_async_events_process         (void);
1103
1104 /**
1105 * Insert asynchronous events on the canvas.
1106  *
1107  * @param target The target to be affected by the events.
1108  * @param type The type of callback function.
1109  * @param event_info Information about the event.
1110  * @param func The callback function pointer.
1111  *
1112  * This is the way, for a routine running outside evas' main thread,
1113  * to report an asynchronous event. A callback function is informed,
1114  * whose call is to happen after evas_async_events_process() is
1115  * called.
1116  *
1117  * @ingroup Evas_Group
1118  */
1119 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);
1120
1121 /**
1122  * @defgroup Evas_Canvas Canvas Functions
1123  *
1124  * Low level Evas canvas functions. Sub groups will present more high
1125  * level ones, though.
1126  *
1127  * Most of these functions deal with low level Evas actions, like:
1128  * @li create/destroy raw canvases, not bound to any displaying engine
1129  * @li tell a canvas i got focused (in a windowing context, for example)
1130  * @li tell a canvas a region should not be calculated anymore in rendering
1131  * @li tell a canvas to render its contents, immediately
1132  *
1133  * Most users will be using Evas by means of the @c Ecore_Evas
1134  * wrapper, which deals with all the above mentioned issues
1135  * automatically for them. Thus, you'll be looking at this section
1136  * only if you're building low level stuff.
1137  *
1138  * The groups within present you functions that deal with the canvas
1139  * directly, too, and not yet with its @b objects. They are the
1140  * functions you need to use at a minimum to get a working canvas.
1141  *
1142  * Some of the funcions in this group are exemplified @ref
1143  * Example_Evas_Events "here".
1144  */
1145
1146 /**
1147  * Creates a new empty evas.
1148  *
1149  * Note that before you can use the evas, you will to at a minimum:
1150  * @li Set its render method with @ref evas_output_method_set .
1151  * @li Set its viewport size with @ref evas_output_viewport_set .
1152  * @li Set its size of the canvas with @ref evas_output_size_set .
1153  * @li Ensure that the render engine is given the correct settings
1154  *     with @ref evas_engine_info_set .
1155  *
1156  * This function should only fail if the memory allocation fails
1157  *
1158  * @note this function is very low level. Instead of using it
1159  *       directly, consider using the high level functions in
1160  *       Ecore_Evas such as @c ecore_evas_new(). See
1161  *       http://docs.enlightenment.org/auto/ecore/.
1162  *
1163  * @attention it is recommended that one calls evas_init() before
1164  *       creating new canvas.
1165  *
1166  * @return A new uninitialised Evas canvas on success.  Otherwise, @c
1167  * NULL.
1168  * @ingroup Evas_Canvas
1169  */
1170 EAPI Evas             *evas_new                          (void) EINA_WARN_UNUSED_RESULT EINA_MALLOC;
1171
1172 /**
1173  * Frees the given evas and any objects created on it.
1174  *
1175  * Any objects with 'free' callbacks will have those callbacks called
1176  * in this function.
1177  *
1178  * @param   e The given evas.
1179  *
1180  * @ingroup Evas_Canvas
1181  */
1182 EAPI void              evas_free                         (Evas *e)  EINA_ARG_NONNULL(1);
1183
1184
1185 /**
1186  * Inform to the evas that it got the focus.
1187  *
1188  * @param e The evas to change information.
1189  * @ingroup Evas_Canvas
1190  */
1191 EAPI void              evas_focus_in                     (Evas *e);
1192
1193 /**
1194  * Inform to the evas that it lost the focus.
1195  *
1196  * @param e The evas to change information.
1197  * @ingroup Evas_Canvas
1198  */
1199 EAPI void              evas_focus_out                    (Evas *e);
1200
1201 /**
1202  * Get the focus state known by the given evas
1203  *
1204  * @param e The evas to query information.
1205  * @ingroup Evas_Canvas
1206  */
1207 EAPI Eina_Bool         evas_focus_state_get              (const Evas *e) EINA_PURE;
1208
1209 /**
1210  * Push the nochange flag up 1
1211  *
1212  * This tells evas, that while the nochange flag is greater than 0, do not
1213  * mark objects as "changed" when making changes.
1214  *
1215  * @param e The evas to change information.
1216  * @ingroup Evas_Canvas
1217  */
1218 EAPI void              evas_nochange_push                (Evas *e);
1219
1220 /**
1221  * Pop the nochange flag down 1
1222  *
1223  * This tells evas, that while the nochange flag is greater than 0, do not
1224  * mark objects as "changed" when making changes.
1225  *
1226  * @param e The evas to change information.
1227  * @ingroup Evas_Canvas
1228  */
1229 EAPI void              evas_nochange_pop                 (Evas *e);
1230
1231
1232 /**
1233  * Attaches a specific pointer to the evas for fetching later
1234  *
1235  * @param e The canvas to attach the pointer to
1236  * @param data The pointer to attach
1237  * @ingroup Evas_Canvas
1238  */
1239 EAPI void              evas_data_attach_set              (Evas *e, void *data) EINA_ARG_NONNULL(1);
1240
1241 /**
1242  * Returns the pointer attached by evas_data_attach_set()
1243  *
1244  * @param e The canvas to attach the pointer to
1245  * @return The pointer attached
1246  * @ingroup Evas_Canvas
1247  */
1248 EAPI void             *evas_data_attach_get              (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
1249
1250
1251 /**
1252  * Add a damage rectangle.
1253  *
1254  * @param e The given canvas pointer.
1255  * @param x The rectangle's left position.
1256  * @param y The rectangle's top position.
1257  * @param w The rectangle's width.
1258  * @param h The rectangle's height.
1259  *
1260  * This is the function by which one tells evas that a part of the
1261  * canvas has to be repainted.
1262  *
1263  * @ingroup Evas_Canvas
1264  */
1265 EAPI void              evas_damage_rectangle_add         (Evas *e, int x, int y, int w, int h) EINA_ARG_NONNULL(1);
1266
1267 /**
1268  * Add an "obscured region" to an Evas canvas.
1269  *
1270  * @param e The given canvas pointer.
1271  * @param x The rectangle's top left corner's horizontal coordinate.
1272  * @param y The rectangle's top left corner's vertical coordinate
1273  * @param w The rectangle's width.
1274  * @param h The rectangle's height.
1275  *
1276  * This is the function by which one tells an Evas canvas that a part
1277  * of it <b>must not</b> be repainted. The region must be
1278  * rectangular and its coordinates inside the canvas viewport are
1279  * passed in the call. After this call, the region specified won't
1280  * participate in any form in Evas' calculations and actions during
1281  * its rendering updates, having its displaying content frozen as it
1282  * was just after this function took place.
1283  *
1284  * We call it "obscured region" because the most common use case for
1285  * this rendering (partial) freeze is something else (most problaby
1286  * other canvas) being on top of the specified rectangular region,
1287  * thus shading it completely from the user's final scene in a
1288  * display. To avoid unecessary processing, one should indicate to the
1289  * obscured canvas not to bother about the non-important area.
1290  *
1291  * The majority of users won't have to worry about this funcion, as
1292  * they'll be using just one canvas in their applications, with
1293  * nothing inset or on top of it in any form.
1294  *
1295  * To make this region one that @b has to be repainted again, call the
1296  * function evas_obscured_clear().
1297  *
1298  * @note This is a <b>very low level function</b>, which most of
1299  * Evas' users wouldn't care about.
1300  *
1301  * @note This function does @b not flag the canvas as having its state
1302  * changed. If you want to re-render it afterwards expecting new
1303  * contents, you have to add "damage" regions yourself (see
1304  * evas_damage_rectangle_add()).
1305  *
1306  * @see evas_obscured_clear()
1307  * @see evas_render_updates()
1308  *
1309  * Example code follows.
1310  * @dontinclude evas-events.c
1311  * @skip add an obscured
1312  * @until evas_obscured_clear(evas);
1313  *
1314  * In that example, pressing the "Ctrl" and "o" keys will impose or
1315  * remove an obscured region in the middle of the canvas. You'll get
1316  * the same contents at the time the key was pressed, if toggling it
1317  * on, until you toggle it off again (make sure the animation is
1318  * running on to get the idea better). See the full @ref
1319  * Example_Evas_Events "example".
1320  *
1321  * @ingroup Evas_Canvas
1322  */
1323 EAPI void              evas_obscured_rectangle_add       (Evas *e, int x, int y, int w, int h) EINA_ARG_NONNULL(1);
1324
1325 /**
1326  * Remove all "obscured regions" from an Evas canvas.
1327  *
1328  * @param e The given canvas pointer.
1329  *
1330  * This function removes all the rectangles from the obscured regions
1331  * list of the canvas @p e. It takes obscured areas added with
1332  * evas_obscured_rectangle_add() and make them again a regions that @b
1333  * have to be repainted on rendering updates.
1334  *
1335  * @note This is a <b>very low level function</b>, which most of
1336  * Evas' users wouldn't care about.
1337  *
1338  * @note This function does @b not flag the canvas as having its state
1339  * changed. If you want to re-render it afterwards expecting new
1340  * contents, you have to add "damage" regions yourself (see
1341  * evas_damage_rectangle_add()).
1342  *
1343  * @see evas_obscured_rectangle_add() for an example
1344  * @see evas_render_updates()
1345  *
1346  * @ingroup Evas_Canvas
1347  */
1348 EAPI void              evas_obscured_clear               (Evas *e) EINA_ARG_NONNULL(1);
1349
1350 /**
1351  * Force immediate renderization of the given Evas canvas.
1352  *
1353  * @param e The given canvas pointer.
1354  * @return A newly allocated list of updated rectangles of the canvas
1355  *        (@c Eina_Rectangle structs). Free this list with
1356  *        evas_render_updates_free().
1357  *
1358  * This function forces an immediate renderization update of the given
1359  * canvas @e.
1360  *
1361  * @note This is a <b>very low level function</b>, which most of
1362  * Evas' users wouldn't care about. One would use it, for example, to
1363  * grab an Evas' canvas update regions and paint them back, using the
1364  * canvas' pixmap, on a displaying system working below Evas.
1365  *
1366  * @note Evas is a stateful canvas. If no operations changing its
1367  * state took place since the last rendering action, you won't see no
1368  * changes and this call will be a no-op.
1369  *
1370  * Example code follows.
1371  * @dontinclude evas-events.c
1372  * @skip add an obscured
1373  * @until d.obscured = !d.obscured;
1374  *
1375  * See the full @ref Example_Evas_Events "example".
1376  *
1377  * @ingroup Evas_Canvas
1378  */
1379 EAPI Eina_List        *evas_render_updates               (Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
1380
1381 /**
1382  * Free the rectangles returned by evas_render_updates().
1383  *
1384  * @param updates The list of updated rectangles of the canvas.
1385  *
1386  * This function removes the region from the render updates list. It
1387  * makes the region doesn't be render updated anymore.
1388  *
1389  * @see evas_render_updates() for an example
1390  *
1391  * @ingroup Evas_Canvas
1392  */
1393 EAPI void              evas_render_updates_free          (Eina_List *updates);
1394
1395 /**
1396  * Force renderization of the given canvas.
1397  *
1398  * @param e The given canvas pointer.
1399  *
1400  * @ingroup Evas_Canvas
1401  */
1402 EAPI void              evas_render                       (Evas *e) EINA_ARG_NONNULL(1);
1403
1404 /**
1405  * Update the canvas internal objects but not triggering immediate
1406  * renderization.
1407  *
1408  * @param e The given canvas pointer.
1409  *
1410  * This function updates the canvas internal objects not triggering
1411  * renderization. To force renderization function evas_render() should
1412  * be used.
1413  *
1414  * @see evas_render.
1415  *
1416  * @ingroup Evas_Canvas
1417  */
1418 EAPI void              evas_norender                     (Evas *e) EINA_ARG_NONNULL(1);
1419
1420 /**
1421  * Make the canvas discard internally cached data used for rendering.
1422  *
1423  * @param e The given canvas pointer.
1424  *
1425  * This function flushes the arrays of delete, active and render objects.
1426  * Other things it may also discard are: shared memory segments,
1427  * temporary scratch buffers, cached data to avoid re-compute of that data etc.
1428  *
1429  * @ingroup Evas_Canvas
1430  */
1431 EAPI void              evas_render_idle_flush            (Evas *e) EINA_ARG_NONNULL(1);
1432
1433 /**
1434  * Make the canvas discard as much data as possible used by the engine at
1435  * runtime.
1436  *
1437  * @param e The given canvas pointer.
1438  *
1439  * This function will unload images, delete textures and much more, where
1440  * possible. You may also want to call evas_render_idle_flush() immediately
1441  * prior to this to perhaps discard a little more, though evas_render_dump()
1442  * should implicitly delete most of what evas_render_idle_flush() might
1443  * discard too.
1444  *
1445  * @ingroup Evas_Canvas
1446  */
1447 EAPI void              evas_render_dump                  (Evas *e) EINA_ARG_NONNULL(1);
1448
1449 /**
1450  * @defgroup Evas_Output_Method Render Engine Functions
1451  *
1452  * Functions that are used to set the render engine for a given
1453  * function, and then get that engine working.
1454  *
1455  * The following code snippet shows how they can be used to
1456  * initialise an evas that uses the X11 software engine:
1457  * @code
1458  * Evas *evas;
1459  * Evas_Engine_Info_Software_X11 *einfo;
1460  * extern Display *display;
1461  * extern Window win;
1462  *
1463  * evas_init();
1464  *
1465  * evas = evas_new();
1466  * evas_output_method_set(evas, evas_render_method_lookup("software_x11"));
1467  * evas_output_size_set(evas, 640, 480);
1468  * evas_output_viewport_set(evas, 0, 0, 640, 480);
1469  * einfo = (Evas_Engine_Info_Software_X11 *)evas_engine_info_get(evas);
1470  * einfo->info.display = display;
1471  * einfo->info.visual = DefaultVisual(display, DefaultScreen(display));
1472  * einfo->info.colormap = DefaultColormap(display, DefaultScreen(display));
1473  * einfo->info.drawable = win;
1474  * einfo->info.depth = DefaultDepth(display, DefaultScreen(display));
1475  * evas_engine_info_set(evas, (Evas_Engine_Info *)einfo);
1476  * @endcode
1477  *
1478  * @ingroup Evas_Canvas
1479  */
1480
1481 /**
1482  * Look up a numeric ID from a string name of a rendering engine.
1483  *
1484  * @param name The string name of an engine
1485  * @return A numeric (opaque) ID for the rendering engine
1486  * @ingroup Evas_Output_Method
1487  *
1488  * This function looks up a numeric return value for the named engine
1489  * in the string @p name. This is a normal C string, NUL byte
1490  * terminated. The name is case sensitive. If the rendering engine is
1491  * available, a numeric ID for that engine is returned that is not
1492  * 0. If the engine is not available, 0 is returned, indicating an
1493  * invalid engine.
1494  *
1495  * The programmer should NEVER rely on the numeric ID of an engine
1496  * unless it is returned by this function. Programs should NOT be
1497  * written accessing render method ID's directly, without first
1498  * obtaining it from this function.
1499  *
1500  * @attention it is mandatory that one calls evas_init() before
1501  *       looking up the render method.
1502  *
1503  * Example:
1504  * @code
1505  * int engine_id;
1506  * Evas *evas;
1507  *
1508  * evas_init();
1509  *
1510  * evas = evas_new();
1511  * if (!evas)
1512  *   {
1513  *     fprintf(stderr, "ERROR: Canvas creation failed. Fatal error.\n");
1514  *     exit(-1);
1515  *   }
1516  * engine_id = evas_render_method_lookup("software_x11");
1517  * if (!engine_id)
1518  *   {
1519  *     fprintf(stderr, "ERROR: Requested rendering engine is absent.\n");
1520  *     exit(-1);
1521  *   }
1522  * evas_output_method_set(evas, engine_id);
1523  * @endcode
1524  */
1525 EAPI int               evas_render_method_lookup         (const char *name) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
1526
1527 /**
1528  * List all the rendering engines compiled into the copy of the Evas library
1529  *
1530  * @return A linked list whose data members are C strings of engine names
1531  * @ingroup Evas_Output_Method
1532  *
1533  * Calling this will return a handle (pointer) to an Evas linked
1534  * list. Each node in the linked list will have the data pointer be a
1535  * (char *) pointer to the string name of the rendering engine
1536  * available. The strings should never be modified, neither should the
1537  * list be modified. This list should be cleaned up as soon as the
1538  * program no longer needs it using evas_render_method_list_free(). If
1539  * no engines are available from Evas, NULL will be returned.
1540  *
1541  * Example:
1542  * @code
1543  * Eina_List *engine_list, *l;
1544  * char *engine_name;
1545  *
1546  * engine_list = evas_render_method_list();
1547  * if (!engine_list)
1548  *   {
1549  *     fprintf(stderr, "ERROR: Evas supports no engines! Exit.\n");
1550  *     exit(-1);
1551  *   }
1552  * printf("Available Evas Engines:\n");
1553  * EINA_LIST_FOREACH(engine_list, l, engine_name)
1554  *     printf("%s\n", engine_name);
1555  * evas_render_method_list_free(engine_list);
1556  * @endcode
1557  */
1558 EAPI Eina_List        *evas_render_method_list           (void) EINA_WARN_UNUSED_RESULT;
1559
1560 /**
1561  * This function should be called to free a list of engine names
1562  *
1563  * @param list The Eina_List base pointer for the engine list to be freed
1564  * @ingroup Evas_Output_Method
1565  *
1566  * When this function is called it will free the engine list passed in
1567  * as @p list. The list should only be a list of engines generated by
1568  * calling evas_render_method_list(). If @p list is NULL, nothing will
1569  * happen.
1570  *
1571  * Example:
1572  * @code
1573  * Eina_List *engine_list, *l;
1574  * char *engine_name;
1575  *
1576  * engine_list = evas_render_method_list();
1577  * if (!engine_list)
1578  *   {
1579  *     fprintf(stderr, "ERROR: Evas supports no engines! Exit.\n");
1580  *     exit(-1);
1581  *   }
1582  * printf("Available Evas Engines:\n");
1583  * EINA_LIST_FOREACH(engine_list, l, engine_name)
1584  *     printf("%s\n", engine_name);
1585  * evas_render_method_list_free(engine_list);
1586  * @endcode
1587  */
1588 EAPI void              evas_render_method_list_free      (Eina_List *list);
1589
1590
1591 /**
1592  * Sets the output engine for the given evas.
1593  *
1594  * Once the output engine for an evas is set, any attempt to change it
1595  * will be ignored.  The value for @p render_method can be found using
1596  * @ref evas_render_method_lookup .
1597  *
1598  * @param   e             The given evas.
1599  * @param   render_method The numeric engine value to use.
1600  *
1601  * @attention it is mandatory that one calls evas_init() before
1602  *       setting the output method.
1603  *
1604  * @ingroup Evas_Output_Method
1605  */
1606 EAPI void              evas_output_method_set            (Evas *e, int render_method) EINA_ARG_NONNULL(1);
1607
1608 /**
1609  * Retrieves the number of the output engine used for the given evas.
1610  * @param   e The given evas.
1611  * @return  The ID number of the output engine being used.  @c 0 is
1612  *          returned if there is an error.
1613  * @ingroup Evas_Output_Method
1614  */
1615 EAPI int               evas_output_method_get            (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
1616
1617
1618 /**
1619  * Retrieves the current render engine info struct from the given evas.
1620  *
1621  * The returned structure is publicly modifiable.  The contents are
1622  * valid until either @ref evas_engine_info_set or @ref evas_render
1623  * are called.
1624  *
1625  * This structure does not need to be freed by the caller.
1626  *
1627  * @param   e The given evas.
1628  * @return  A pointer to the Engine Info structure.  @c NULL is returned if
1629  *          an engine has not yet been assigned.
1630  * @ingroup Evas_Output_Method
1631  */
1632 EAPI Evas_Engine_Info *evas_engine_info_get              (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
1633
1634 /**
1635  * Applies the engine settings for the given evas from the given @c
1636  * Evas_Engine_Info structure.
1637  *
1638  * To get the Evas_Engine_Info structure to use, call @ref
1639  * evas_engine_info_get .  Do not try to obtain a pointer to an
1640  * @c Evas_Engine_Info structure in any other way.
1641  *
1642  * You will need to call this function at least once before you can
1643  * create objects on an evas or render that evas.  Some engines allow
1644  * their settings to be changed more than once.
1645  *
1646  * Once called, the @p info pointer should be considered invalid.
1647  *
1648  * @param   e    The pointer to the Evas Canvas
1649  * @param   info The pointer to the Engine Info to use
1650  * @return  1 if no error occurred, 0 otherwise
1651  * @ingroup Evas_Output_Method
1652  */
1653 EAPI Eina_Bool         evas_engine_info_set              (Evas *e, Evas_Engine_Info *info) EINA_ARG_NONNULL(1);
1654
1655 /**
1656  * @defgroup Evas_Output_Size Output and Viewport Resizing Functions
1657  *
1658  * Functions that set and retrieve the output and viewport size of an
1659  * evas.
1660  *
1661  * @ingroup Evas_Canvas
1662  */
1663
1664 /**
1665  * Sets the output size of the render engine of the given evas.
1666  *
1667  * The evas will render to a rectangle of the given size once this
1668  * function is called.  The output size is independent of the viewport
1669  * size.  The viewport will be stretched to fill the given rectangle.
1670  *
1671  * The units used for @p w and @p h depend on the engine used by the
1672  * evas.
1673  *
1674  * @param   e The given evas.
1675  * @param   w The width in output units, usually pixels.
1676  * @param   h The height in output units, usually pixels.
1677  * @ingroup Evas_Output_Size
1678  */
1679 EAPI void              evas_output_size_set              (Evas *e, int w, int h) EINA_ARG_NONNULL(1);
1680
1681 /**
1682  * Retrieve the output size of the render engine of the given evas.
1683  *
1684  * The output size is given in whatever the output units are for the
1685  * engine.
1686  *
1687  * If either @p w or @p h is @c NULL, then it is ignored.  If @p e is
1688  * invalid, the returned results are undefined.
1689  *
1690  * @param   e The given evas.
1691  * @param   w The pointer to an integer to store the width in.
1692  * @param   h The pointer to an integer to store the height in.
1693  * @ingroup Evas_Output_Size
1694  */
1695 EAPI void              evas_output_size_get              (const Evas *e, int *w, int *h) EINA_ARG_NONNULL(1);
1696
1697 /**
1698  * Sets the output viewport of the given evas in evas units.
1699  *
1700  * The output viewport is the area of the evas that will be visible to
1701  * the viewer.  The viewport will be stretched to fit the output
1702  * target of the evas when rendering is performed.
1703  *
1704  * @note The coordinate values do not have to map 1-to-1 with the output
1705  *       target.  However, it is generally advised that it is done for ease
1706  *       of use.
1707  *
1708  * @param   e The given evas.
1709  * @param   x The top-left corner x value of the viewport.
1710  * @param   y The top-left corner y value of the viewport.
1711  * @param   w The width of the viewport.  Must be greater than 0.
1712  * @param   h The height of the viewport.  Must be greater than 0.
1713  * @ingroup Evas_Output_Size
1714  */
1715 EAPI void              evas_output_viewport_set          (Evas *e, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h) EINA_ARG_NONNULL(1);
1716
1717 /**
1718  * Get the render engine's output viewport co-ordinates in canvas units.
1719  * @param e The pointer to the Evas Canvas
1720  * @param x The pointer to a x variable to be filled in
1721  * @param y The pointer to a y variable to be filled in
1722  * @param w The pointer to a width variable to be filled in
1723  * @param h The pointer to a height variable to be filled in
1724  * @ingroup Evas_Output_Size
1725  *
1726  * Calling this function writes the current canvas output viewport
1727  * size and location values into the variables pointed to by @p x, @p
1728  * y, @p w and @p h.  On success the variables have the output
1729  * location and size values written to them in canvas units. Any of @p
1730  * x, @p y, @p w or @p h that are NULL will not be written to. If @p e
1731  * is invalid, the results are undefined.
1732  *
1733  * Example:
1734  * @code
1735  * extern Evas *evas;
1736  * Evas_Coord x, y, width, height;
1737  *
1738  * evas_output_viewport_get(evas, &x, &y, &w, &h);
1739  * @endcode
1740  */
1741 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);
1742
1743 /**
1744  * @defgroup Evas_Coord_Mapping_Group Coordinate Mapping Functions
1745  *
1746  * Functions that are used to map coordinates from the canvas to the
1747  * screen or the screen to the canvas.
1748  *
1749  * @ingroup Evas_Canvas
1750  */
1751
1752 /**
1753  * Convert/scale an ouput screen co-ordinate into canvas co-ordinates
1754  *
1755  * @param e The pointer to the Evas Canvas
1756  * @param x The screen/output x co-ordinate
1757  * @return The screen co-ordinate translated to canvas unit co-ordinates
1758  * @ingroup Evas_Coord_Mapping_Group
1759  *
1760  * This function takes in a horizontal co-ordinate as the @p x
1761  * parameter and converts it into canvas units, accounting for output
1762  * size, viewport size and location, returning it as the function
1763  * return value. If @p e is invalid, the results are undefined.
1764  *
1765  * Example:
1766  * @code
1767  * extern Evas *evas;
1768  * extern int screen_x;
1769  * Evas_Coord canvas_x;
1770  *
1771  * canvas_x = evas_coord_screen_x_to_world(evas, screen_x);
1772  * @endcode
1773  */
1774 EAPI Evas_Coord        evas_coord_screen_x_to_world      (const Evas *e, int x) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
1775
1776 /**
1777  * Convert/scale an ouput screen co-ordinate into canvas co-ordinates
1778  *
1779  * @param e The pointer to the Evas Canvas
1780  * @param y The screen/output y co-ordinate
1781  * @return The screen co-ordinate translated to canvas unit co-ordinates
1782  * @ingroup Evas_Coord_Mapping_Group
1783  *
1784  * This function takes in a vertical co-ordinate as the @p y parameter
1785  * and converts it into canvas units, accounting for output size,
1786  * viewport size and location, returning it as the function return
1787  * value. If @p e is invalid, the results are undefined.
1788  *
1789  * Example:
1790  * @code
1791  * extern Evas *evas;
1792  * extern int screen_y;
1793  * Evas_Coord canvas_y;
1794  *
1795  * canvas_y = evas_coord_screen_y_to_world(evas, screen_y);
1796  * @endcode
1797  */
1798 EAPI Evas_Coord        evas_coord_screen_y_to_world      (const Evas *e, int y) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
1799
1800 /**
1801  * Convert/scale a canvas co-ordinate into output screen co-ordinates
1802  *
1803  * @param e The pointer to the Evas Canvas
1804  * @param x The canvas x co-ordinate
1805  * @return The output/screen co-ordinate translated to output co-ordinates
1806  * @ingroup Evas_Coord_Mapping_Group
1807  *
1808  * This function takes in a horizontal co-ordinate as the @p x
1809  * parameter and converts it into output units, accounting for output
1810  * size, viewport size and location, returning it as the function
1811  * return value. If @p e is invalid, the results are undefined.
1812  *
1813  * Example:
1814  * @code
1815  * extern Evas *evas;
1816  * int screen_x;
1817  * extern Evas_Coord canvas_x;
1818  *
1819  * screen_x = evas_coord_world_x_to_screen(evas, canvas_x);
1820  * @endcode
1821  */
1822 EAPI int               evas_coord_world_x_to_screen      (const Evas *e, Evas_Coord x) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
1823
1824 /**
1825  * Convert/scale a canvas co-ordinate into output screen co-ordinates
1826  *
1827  * @param e The pointer to the Evas Canvas
1828  * @param y The canvas y co-ordinate
1829  * @return The output/screen co-ordinate translated to output co-ordinates
1830  * @ingroup Evas_Coord_Mapping_Group
1831  *
1832  * This function takes in a vertical co-ordinate as the @p x parameter
1833  * and converts it into output units, accounting for output size,
1834  * viewport size and location, returning it as the function return
1835  * value. If @p e is invalid, the results are undefined.
1836  *
1837  * Example:
1838  * @code
1839  * extern Evas *evas;
1840  * int screen_y;
1841  * extern Evas_Coord canvas_y;
1842  *
1843  * screen_y = evas_coord_world_y_to_screen(evas, canvas_y);
1844  * @endcode
1845  */
1846 EAPI int               evas_coord_world_y_to_screen      (const Evas *e, Evas_Coord y) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
1847
1848 /**
1849  * @defgroup Evas_Pointer_Group Pointer (Mouse) Functions
1850  *
1851  * Functions that deal with the status of the pointer (mouse cursor).
1852  *
1853  * @ingroup Evas_Canvas
1854  */
1855
1856 /**
1857  * This function returns the current known pointer co-ordinates
1858  *
1859  * @param e The pointer to the Evas Canvas
1860  * @param x The pointer to an integer to be filled in
1861  * @param y The pointer to an integer to be filled in
1862  * @ingroup Evas_Pointer_Group
1863  *
1864  * This function returns the current known screen/output co-ordinates
1865  * of the mouse pointer and sets the contents of the integers pointed
1866  * to by @p x and @p y to contain these co-ordinates. If @p e is not a
1867  * valid canvas the results of this function are undefined.
1868  *
1869  * Example:
1870  * @code
1871  * extern Evas *evas;
1872  * int mouse_x, mouse_y;
1873  *
1874  * evas_pointer_output_xy_get(evas, &mouse_x, &mouse_y);
1875  * printf("Mouse is at screen position %i, %i\n", mouse_x, mouse_y);
1876  * @endcode
1877  */
1878 EAPI void              evas_pointer_output_xy_get        (const Evas *e, int *x, int *y) EINA_ARG_NONNULL(1);
1879
1880 /**
1881  * This function returns the current known pointer co-ordinates
1882  *
1883  * @param e The pointer to the Evas Canvas
1884  * @param x The pointer to a Evas_Coord to be filled in
1885  * @param y The pointer to a Evas_Coord to be filled in
1886  * @ingroup Evas_Pointer_Group
1887  *
1888  * This function returns the current known canvas unit co-ordinates of
1889  * the mouse pointer and sets the contents of the Evas_Coords pointed
1890  * to by @p x and @p y to contain these co-ordinates. If @p e is not a
1891  * valid canvas the results of this function are undefined.
1892  *
1893  * Example:
1894  * @code
1895  * extern Evas *evas;
1896  * Evas_Coord mouse_x, mouse_y;
1897  *
1898  * evas_pointer_output_xy_get(evas, &mouse_x, &mouse_y);
1899  * printf("Mouse is at canvas position %f, %f\n", mouse_x, mouse_y);
1900  * @endcode
1901  */
1902 EAPI void              evas_pointer_canvas_xy_get        (const Evas *e, Evas_Coord *x, Evas_Coord *y) EINA_ARG_NONNULL(1);
1903
1904 /**
1905  * Returns a bitmask with the mouse buttons currently pressed, set to 1
1906  *
1907  * @param e The pointer to the Evas Canvas
1908  * @return A bitmask of the currently depressed buttons on the cavas
1909  * @ingroup Evas_Pointer_Group
1910  *
1911  * Calling this function will return a 32-bit integer with the
1912  * appropriate bits set to 1 that correspond to a mouse button being
1913  * depressed. This limits Evas to a mouse devices with a maximum of 32
1914  * buttons, but that is generally in excess of any host system's
1915  * pointing device abilities.
1916  *
1917  * A canvas by default begins with no mouse buttons being pressed and
1918  * only calls to evas_event_feed_mouse_down(),
1919  * evas_event_feed_mouse_down_data(), evas_event_feed_mouse_up() and
1920  * evas_event_feed_mouse_up_data() will alter that.
1921  *
1922  * The least significant bit corresponds to the first mouse button
1923  * (button 1) and the most significant bit corresponds to the last
1924  * mouse button (button 32).
1925  *
1926  * If @p e is not a valid canvas, the return value is undefined.
1927  *
1928  * Example:
1929  * @code
1930  * extern Evas *evas;
1931  * int button_mask, i;
1932  *
1933  * button_mask = evas_pointer_button_down_mask_get(evas);
1934  * printf("Buttons currently pressed:\n");
1935  * for (i = 0; i < 32; i++)
1936  *   {
1937  *     if ((button_mask & (1 << i)) != 0) printf("Button %i\n", i + 1);
1938  *   }
1939  * @endcode
1940  */
1941 EAPI int               evas_pointer_button_down_mask_get (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
1942
1943 /**
1944  * Returns whether the mouse pointer is logically inside the canvas
1945  *
1946  * @param e The pointer to the Evas Canvas
1947  * @return An integer that is 1 if the mouse is inside the canvas, 0 otherwise
1948  * @ingroup Evas_Pointer_Group
1949  *
1950  * When this function is called it will return a value of either 0 or
1951  * 1, depending on if evas_event_feed_mouse_in(),
1952  * evas_event_feed_mouse_in_data(), or evas_event_feed_mouse_out(),
1953  * evas_event_feed_mouse_out_data() have been called to feed in a
1954  * mouse enter event into the canvas.
1955  *
1956  * A return value of 1 indicates the mouse is logically inside the
1957  * canvas, and 0 implies it is logically outside the canvas.
1958  *
1959  * A canvas begins with the mouse being assumed outside (0).
1960  *
1961  * If @p e is not a valid canvas, the return value is undefined.
1962  *
1963  * Example:
1964  * @code
1965  * extern Evas *evas;
1966  *
1967  * if (evas_pointer_inside_get(evas)) printf("Mouse is in!\n");
1968  * else printf("Mouse is out!\n");
1969  * @endcode
1970  */
1971 EAPI Eina_Bool         evas_pointer_inside_get           (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
1972    EAPI void              evas_sync(Evas *e) EINA_ARG_NONNULL(1);
1973
1974 /**
1975  * @defgroup Evas_Canvas_Events Canvas Events
1976  *
1977  * Functions relating to canvas events, which are mainly reports on
1978  * its internal states changing (an object got focused, the rendering
1979  * is updated, etc).
1980  *
1981  * Some of the funcions in this group are exemplified @ref
1982  * Example_Evas_Events "here".
1983  *
1984  * @ingroup Evas_Canvas
1985  */
1986
1987 /**
1988  * @addtogroup Evas_Canvas_Events
1989  * @{
1990  */
1991
1992 /**
1993  * Add (register) a callback function to a given canvas event.
1994  *
1995  * @param e Canvas to attach a callback to
1996  * @param type The type of event that will trigger the callback
1997  * @param func The (callback) function to be called when the event is
1998  *        triggered
1999  * @param data The data pointer to be passed to @p func
2000  *
2001  * This function adds a function callback to the canvas @p e when the
2002  * event of type @p type occurs on it. The function pointer is @p
2003  * func.
2004  *
2005  * In the event of a memory allocation error during the addition of
2006  * the callback to the canvas, evas_alloc_error() should be used to
2007  * determine the nature of the error, if any, and the program should
2008  * sensibly try and recover.
2009  *
2010  * A callback function must have the ::Evas_Event_Cb prototype
2011  * definition. The first parameter (@p data) in this definition will
2012  * have the same value passed to evas_event_callback_add() as the @p
2013  * data parameter, at runtime. The second parameter @p e is the canvas
2014  * pointer on which the event occurred. The third parameter @p
2015  * event_info is a pointer to a data structure that may or may not be
2016  * passed to the callback, depending on the event type that triggered
2017  * the callback. This is so because some events don't carry extra
2018  * context with them, but others do.
2019  *
2020  * The event type @p type to trigger the function may be one of
2021  * #EVAS_CALLBACK_RENDER_FLUSH_PRE, #EVAS_CALLBACK_RENDER_FLUSH_POST,
2022  * #EVAS_CALLBACK_CANVAS_FOCUS_IN, #EVAS_CALLBACK_CANVAS_FOCUS_OUT,
2023  * #EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_IN and
2024  * #EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_OUT. This determines the kind of
2025  * event that will trigger the callback to be called. Only the last
2026  * two of the event types listed here provide useful event information
2027  * data -- a pointer to the recently focused Evas object. For the
2028  * others the @p event_info pointer is going to be @c NULL.
2029  *
2030  * Example:
2031  * @dontinclude evas-events.c
2032  * @skip evas_event_callback_add(d.canvas, EVAS_CALLBACK_RENDER_FLUSH_PRE
2033  * @until two canvas event callbacks
2034  *
2035  * Looking to the callbacks registered above,
2036  * @dontinclude evas-events.c
2037  * @skip called when our rectangle gets focus
2038  * @until let's have our events back
2039  *
2040  * we see that the canvas flushes its rendering pipeline
2041  * (#EVAS_CALLBACK_RENDER_FLUSH_PRE) whenever the @c _resize_cb
2042  * routine takes place: it has to redraw that image at a different
2043  * size. Also, the callback on an object being focused comes just
2044  * after we focus it explicitly, on code.
2045  *
2046  * See the full @ref Example_Evas_Events "example".
2047  *
2048  * @note Be careful not to add the same callback multiple times, if
2049  * that's not what you want, because Evas won't check if a callback
2050  * existed before exactly as the one being registered (and thus, call
2051  * it more than once on the event, in this case). This would make
2052  * sense if you passed different functions and/or callback data, only.
2053  */
2054 EAPI void              evas_event_callback_add              (Evas *e, Evas_Callback_Type type, Evas_Event_Cb func, const void *data) EINA_ARG_NONNULL(1, 3);
2055
2056 /**
2057  * Delete a callback function from the canvas.
2058  *
2059  * @param e Canvas to remove a callback from
2060  * @param type The type of event that was triggering the callback
2061  * @param func The function that was to be called when the event was triggered
2062  * @return The data pointer that was to be passed to the callback
2063  *
2064  * This function removes the most recently added callback from the
2065  * canvas @p e which was triggered by the event type @p type and was
2066  * calling the function @p func when triggered. If the removal is
2067  * successful it will also return the data pointer that was passed to
2068  * evas_event_callback_add() when the callback was added to the
2069  * canvas. If not successful NULL will be returned.
2070  *
2071  * Example:
2072  * @code
2073  * extern Evas *e;
2074  * void *my_data;
2075  * void focus_in_callback(void *data, Evas *e, void *event_info);
2076  *
2077  * my_data = evas_event_callback_del(ebject, EVAS_CALLBACK_CANVAS_FOCUS_IN, focus_in_callback);
2078  * @endcode
2079  */
2080 EAPI void             *evas_event_callback_del              (Evas *e, Evas_Callback_Type type, Evas_Event_Cb func) EINA_ARG_NONNULL(1, 3);
2081
2082 /**
2083  * Delete (unregister) a callback function registered to a given
2084  * canvas event.
2085  *
2086  * @param e Canvas to remove an event callback from
2087  * @param type The type of event that was triggering the callback
2088  * @param func The function that was to be called when the event was
2089  *        triggered
2090  * @param data The data pointer that was to be passed to the callback
2091  * @return The data pointer that was to be passed to the callback
2092  *
2093  * This function removes <b>the first</b> added callback from the
2094  * canvas @p e matching the event type @p type, the registered
2095  * function pointer @p func and the callback data pointer @p data. If
2096  * the removal is successful it will also return the data pointer that
2097  * was passed to evas_event_callback_add() (that will be the same as
2098  * the parameter) when the callback(s) was(were) added to the
2099  * canvas. If not successful @c NULL will be returned. A common use
2100  * would be to remove an exact match of a callback.
2101  *
2102  * Example:
2103  * @dontinclude evas-events.c
2104  * @skip evas_event_callback_del_full(evas, EVAS_CALLBACK_RENDER_FLUSH_PRE,
2105  * @until _object_focus_in_cb, NULL);
2106  *
2107  * See the full @ref Example_Evas_Events "example".
2108  *
2109  * @note For deletion of canvas events callbacks filtering by just
2110  * type and function pointer, user evas_event_callback_del().
2111  */
2112 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);
2113
2114 /**
2115  * Push a callback on the post-event callback stack
2116  *
2117  * @param e Canvas to push the callback on
2118  * @param func The function that to be called when the stack is unwound
2119  * @param data The data pointer to be passed to the callback
2120  *
2121  * Evas has a stack of callbacks that get called after all the callbacks for
2122  * an event have triggered (all the objects it triggers on and al the callbacks
2123  * in each object triggered). When all these have been called, the stack is
2124  * unwond from most recently to least recently pushed item and removed from the
2125  * stack calling the callback set for it.
2126  *
2127  * This is intended for doing reverse logic-like processing, example - when a
2128  * child object that happens to get the event later is meant to be able to
2129  * "steal" functions from a parent and thus on unwind of this stack hav its
2130  * function called first, thus being able to set flags, or return 0 from the
2131  * post-callback that stops all other post-callbacks in the current stack from
2132  * being called (thus basically allowing a child to take control, if the event
2133  * callback prepares information ready for taking action, but the post callback
2134  * actually does the action).
2135  *
2136  */
2137 EAPI void              evas_post_event_callback_push        (Evas *e, Evas_Object_Event_Post_Cb func, const void *data);
2138
2139 /**
2140  * Remove a callback from the post-event callback stack
2141  *
2142  * @param e Canvas to push the callback on
2143  * @param func The function that to be called when the stack is unwound
2144  *
2145  * This removes a callback from the stack added with
2146  * evas_post_event_callback_push(). The first instance of the function in
2147  * the callback stack is removed from being executed when the stack is
2148  * unwound. Further instances may still be run on unwind.
2149  */
2150 EAPI void              evas_post_event_callback_remove      (Evas *e, Evas_Object_Event_Post_Cb func);
2151
2152 /**
2153  * Remove a callback from the post-event callback stack
2154  *
2155  * @param e Canvas to push the callback on
2156  * @param func The function that to be called when the stack is unwound
2157  * @param data The data pointer to be passed to the callback
2158  *
2159  * This removes a callback from the stack added with
2160  * evas_post_event_callback_push(). The first instance of the function and data
2161  * in the callback stack is removed from being executed when the stack is
2162  * unwound. Further instances may still be run on unwind.
2163  */
2164 EAPI void              evas_post_event_callback_remove_full (Evas *e, Evas_Object_Event_Post_Cb func, const void *data);
2165
2166 /**
2167  * @defgroup Evas_Event_Freezing_Group Input Events Freezing Functions
2168  *
2169  * Functions that deal with the freezing of input event processing of
2170  * an Evas canvas.
2171  *
2172  * There might be scenarios during a graphical user interface
2173  * program's use when the developer whishes the users wouldn't be able
2174  * to deliver input events to this application. It may, for example,
2175  * be the time for it to populate a view or to change some
2176  * layout. Assuming proper behavior with user interaction during this
2177  * exact time would be hard, as things are in a changing state. The
2178  * programmer can then tell the canvas to ignore input events,
2179  * bringing it back to normal behavior when he/she wants.
2180  *
2181  * Some of the funcions in this group are exemplified @ref
2182  * Example_Evas_Events "here".
2183  *
2184  * @ingroup Evas_Canvas_Events
2185  */
2186
2187 /**
2188  * @addtogroup Evas_Event_Freezing_Group
2189  * @{
2190  */
2191
2192 /**
2193  * Freeze all input events processing.
2194  *
2195  * @param e The canvas to freeze input events processing on.
2196  *
2197  * This function will indicate to Evas that the canvas @p e is to have
2198  * all input event processing frozen until a matching
2199  * evas_event_thaw() function is called on the same canvas. All events
2200  * of this kind during the freeze will get @b discarded. Every freeze
2201  * call must be matched by a thaw call in order to completely thaw out
2202  * a canvas (i.e. these calls may be nested). The most common use is
2203  * when you don't want the user to interect with your user interface
2204  * when you're populating a view or changing the layout.
2205  *
2206  * Example:
2207  * @dontinclude evas-events.c
2208  * @skip freeze input for 3 seconds
2209  * @until }
2210  * @dontinclude evas-events.c
2211  * @skip let's have our events back
2212  * @until }
2213  *
2214  * See the full @ref Example_Evas_Events "example".
2215  *
2216  * If you run that example, you'll see the canvas ignoring all input
2217  * events for 3 seconds, when the "f" key is pressed. In a more
2218  * realistic code we would be freezing while a toolkit or Edje was
2219  * doing some UI changes, thawing it back afterwards.
2220  */
2221 EAPI void              evas_event_freeze                 (Evas *e) EINA_ARG_NONNULL(1);
2222
2223 /**
2224  * Thaw a canvas out after freezing (for input events).
2225  *
2226  * @param e The canvas to thaw out.
2227  *
2228  * This will thaw out a canvas after a matching evas_event_freeze()
2229  * call. If this call completely thaws out a canvas, i.e., there's no
2230  * other unbalanced call to evas_event_freeze(), events will start to
2231  * be processed again, but any "missed" events will @b not be
2232  * evaluated.
2233  *
2234  * See evas_event_freeze() for an example.
2235  */
2236 EAPI void              evas_event_thaw                   (Evas *e) EINA_ARG_NONNULL(1);
2237
2238 /**
2239  * Return the freeze count on input events of a given canvas.
2240  *
2241  * @param e The canvas to fetch the freeze count from.
2242  *
2243  * This returns the number of times the canvas has been told to freeze
2244  * input events. It is possible to call evas_event_freeze() multiple
2245  * times, and these must be matched by evas_event_thaw() calls. This
2246  * call allows the program to discover just how many times things have
2247  * been frozen in case it may want to break out of a deep freeze state
2248  * where the count is high.
2249  *
2250  * Example:
2251  * @code
2252  * extern Evas *evas;
2253  *
2254  * while (evas_event_freeze_get(evas) > 0) evas_event_thaw(evas);
2255  * @endcode
2256  *
2257  */
2258 EAPI int               evas_event_freeze_get             (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
2259
2260 /**
2261  * After thaw of a canvas, re-evaluate the state of objects and call callbacks
2262  *
2263  * @param e The canvas to evaluate after a thaw
2264  *
2265  * This is normally called after evas_event_thaw() to re-evaluate mouse
2266  * containment and other states and thus also call callbacks for mouse in and
2267  * out on new objects if the state change demands it.
2268  */
2269 EAPI void              evas_event_thaw_eval              (Evas *e) EINA_ARG_NONNULL(1);
2270
2271 /**
2272  * @}
2273  */
2274
2275 /**
2276  * @defgroup Evas_Event_Feeding_Group Input Events Feeding Functions
2277  *
2278  * Functions to tell Evas that input events happened and should be
2279  * processed.
2280  *
2281  * As explained in @ref intro_not_evas, Evas does not know how to poll
2282  * for input events, so the developer should do it and then feed such
2283  * events to the canvas to be processed. This is only required if
2284  * operating Evas directly. Modules such as Ecore_Evas do that for
2285  * you.
2286  *
2287  * Some of the funcions in this group are exemplified @ref
2288  * Example_Evas_Events "here".
2289  *
2290  * @ingroup Evas_Canvas_Events
2291  */
2292
2293 /**
2294  * @addtogroup Evas_Event_Feeding_Group
2295  * @{
2296  */
2297
2298 /**
2299  * Mouse down event feed.
2300  *
2301  * @param e The given canvas pointer.
2302  * @param b The button number.
2303  * @param flags The evas button flags.
2304  * @param timestamp The timestamp of the mouse down event.
2305  * @param data The data for canvas.
2306  *
2307  * This function will set some evas properties that is necessary when
2308  * the mouse button is pressed. It prepares information to be treated
2309  * by the callback function.
2310  *
2311  */
2312 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);
2313
2314 /**
2315  * Mouse up event feed.
2316  *
2317  * @param e The given canvas pointer.
2318  * @param b The button number.
2319  * @param flags evas button flags.
2320  * @param timestamp The timestamp of the mouse up event.
2321  * @param data The data for canvas.
2322  *
2323  * This function will set some evas properties that is necessary when
2324  * the mouse button is released. It prepares information to be treated
2325  * by the callback function.
2326  *
2327  */
2328 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);
2329
2330 /**
2331  * Mouse move event feed.
2332  *
2333  * @param e The given canvas pointer.
2334  * @param x The horizontal position of the mouse pointer.
2335  * @param y The vertical position of the mouse pointer.
2336  * @param timestamp The timestamp of the mouse up event.
2337  * @param data The data for canvas.
2338  *
2339  * This function will set some evas properties that is necessary when
2340  * the mouse is moved from its last position. It prepares information
2341  * to be treated by the callback function.
2342  *
2343  */
2344 EAPI void              evas_event_feed_mouse_move        (Evas *e, int x, int y, unsigned int timestamp, const void *data) EINA_ARG_NONNULL(1);
2345
2346 /**
2347  * Mouse in event feed.
2348  *
2349  * @param e The given canvas pointer.
2350  * @param timestamp The timestamp of the mouse up event.
2351  * @param data The data for canvas.
2352  *
2353  * This function will set some evas properties that is necessary when
2354  * the mouse in event happens. It prepares information to be treated
2355  * by the callback function.
2356  *
2357  */
2358 EAPI void              evas_event_feed_mouse_in          (Evas *e, unsigned int timestamp, const void *data) EINA_ARG_NONNULL(1);
2359
2360 /**
2361  * Mouse out event feed.
2362  *
2363  * @param e The given canvas pointer.
2364  * @param timestamp Timestamp of the mouse up event.
2365  * @param data The data for canvas.
2366  *
2367  * This function will set some evas properties that is necessary when
2368  * the mouse out event happens. It prepares information to be treated
2369  * by the callback function.
2370  *
2371  */
2372 EAPI void              evas_event_feed_mouse_out         (Evas *e, unsigned int timestamp, const void *data) EINA_ARG_NONNULL(1);
2373    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);
2374    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);
2375    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);
2376
2377 /**
2378  * Mouse cancel event feed.
2379  *
2380  * @param e The given canvas pointer.
2381  * @param timestamp The timestamp of the mouse up event.
2382  * @param data The data for canvas.
2383  *
2384  * This function will call evas_event_feed_mouse_up() when a
2385  * mouse cancel event happens.
2386  *
2387  */
2388 EAPI void              evas_event_feed_mouse_cancel      (Evas *e, unsigned int timestamp, const void *data) EINA_ARG_NONNULL(1);
2389
2390 /**
2391  * Mouse wheel event feed.
2392  *
2393  * @param e The given canvas pointer.
2394  * @param direction The wheel mouse direction.
2395  * @param z How much mouse wheel was scrolled up or down.
2396  * @param timestamp The timestamp of the mouse up event.
2397  * @param data The data for canvas.
2398  *
2399  * This function will set some evas properties that is necessary when
2400  * the mouse wheel is scrolled up or down. It prepares information to
2401  * be treated by the callback function.
2402  *
2403  */
2404 EAPI void              evas_event_feed_mouse_wheel       (Evas *e, int direction, int z, unsigned int timestamp, const void *data) EINA_ARG_NONNULL(1);
2405
2406 /**
2407  * Key down event feed
2408  *
2409  * @param e The canvas to thaw out
2410  * @param keyname  Name of the key
2411  * @param key The key pressed.
2412  * @param string A String
2413  * @param compose The compose string
2414  * @param timestamp Timestamp of the mouse up event
2415  * @param data Data for canvas.
2416  *
2417  * This function will set some evas properties that is necessary when
2418  * a key is pressed. It prepares information to be treated by the
2419  * callback function.
2420  *
2421  */
2422 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);
2423
2424 /**
2425  * Key up event feed
2426  *
2427  * @param e The canvas to thaw out
2428  * @param keyname  Name of the key
2429  * @param key The key released.
2430  * @param string string
2431  * @param compose compose
2432  * @param timestamp Timestamp of the mouse up event
2433  * @param data Data for canvas.
2434  *
2435  * This function will set some evas properties that is necessary when
2436  * a key is released. It prepares information to be treated by the
2437  * callback function.
2438  *
2439  */
2440 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);
2441
2442 /**
2443  * Hold event feed
2444  *
2445  * @param e The given canvas pointer.
2446  * @param hold The hold.
2447  * @param timestamp The timestamp of the mouse up event.
2448  * @param data The data for canvas.
2449  *
2450  * This function makes the object to stop sending events.
2451  *
2452  */
2453 EAPI void              evas_event_feed_hold              (Evas *e, int hold, unsigned int timestamp, const void *data) EINA_ARG_NONNULL(1);
2454
2455 /**
2456  * @}
2457  */
2458
2459 /**
2460  * @}
2461  */
2462
2463 /**
2464  * @defgroup Evas_Image_Group Image Functions
2465  *
2466  * Functions that deals with images at canvas level.
2467  *
2468  * @ingroup Evas_Canvas
2469  */
2470
2471 /**
2472  * Flush the image cache of the canvas.
2473  *
2474  * @param e The given evas pointer.
2475  *
2476  * This function flushes image cache of canvas.
2477  *
2478  */
2479 EAPI void              evas_image_cache_flush            (Evas *e) EINA_ARG_NONNULL(1);
2480
2481 /**
2482  * Reload the image cache
2483  *
2484  * @param e The given evas pointer.
2485  *
2486  * This function reloads the image cache of canvas.
2487  *
2488  */
2489 EAPI void              evas_image_cache_reload           (Evas *e) EINA_ARG_NONNULL(1);
2490
2491 /**
2492  * Set the image cache.
2493  *
2494  * @param e The given evas pointer.
2495  * @param size The cache size.
2496  *
2497  * This function sets the image cache of canvas.
2498  *
2499  */
2500 EAPI void              evas_image_cache_set              (Evas *e, int size) EINA_ARG_NONNULL(1);
2501
2502 /**
2503  * Set the image cache
2504  *
2505  * @param e The given evas pointer.
2506  *
2507  * This function returns the image cache of canvas.
2508  *
2509  */
2510 EAPI int               evas_image_cache_get              (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
2511
2512 /**
2513  * @defgroup Evas_Font_Group Font Functions
2514  *
2515  * Functions that deals with fonts.
2516  *
2517  * @ingroup Evas_Canvas
2518  */
2519
2520 /**
2521  * Changes the font hinting for the given evas.
2522  *
2523  * @param e The given evas.
2524  * @param hinting The hinting to use, one of #EVAS_FONT_HINTING_NONE,
2525  *        #EVAS_FONT_HINTING_AUTO, #EVAS_FONT_HINTING_BYTECODE.
2526  * @ingroup Evas_Font_Group
2527  */
2528 EAPI void                     evas_font_hinting_set        (Evas *e, Evas_Font_Hinting_Flags hinting) EINA_ARG_NONNULL(1);
2529
2530 /**
2531  * Retrieves the font hinting used by the given evas.
2532  *
2533  * @param e The given evas to query.
2534  * @return The hinting in use, one of #EVAS_FONT_HINTING_NONE,
2535  *         #EVAS_FONT_HINTING_AUTO, #EVAS_FONT_HINTING_BYTECODE.
2536  * @ingroup Evas_Font_Group
2537  */
2538 EAPI Evas_Font_Hinting_Flags  evas_font_hinting_get        (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
2539
2540 /**
2541  * Checks if the font hinting is supported by the given evas.
2542  *
2543  * @param e The given evas to query.
2544  * @param hinting The hinting to use, one of #EVAS_FONT_HINTING_NONE,
2545  *        #EVAS_FONT_HINTING_AUTO, #EVAS_FONT_HINTING_BYTECODE.
2546  * @return @c EINA_TRUE if it is supported, @c EINA_FALSE otherwise.
2547  * @ingroup Evas_Font_Group
2548  */
2549 EAPI Eina_Bool                evas_font_hinting_can_hint   (const Evas *e, Evas_Font_Hinting_Flags hinting) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
2550
2551
2552 /**
2553  * Force the given evas and associated engine to flush its font cache.
2554  *
2555  * @param e The given evas to flush font cache.
2556  * @ingroup Evas_Font_Group
2557  */
2558 EAPI void                     evas_font_cache_flush        (Evas *e) EINA_ARG_NONNULL(1);
2559
2560 /**
2561  * Changes the size of font cache of the given evas.
2562  *
2563  * @param e The given evas to flush font cache.
2564  * @param size The size, in bytes.
2565  *
2566  * @ingroup Evas_Font_Group
2567  */
2568 EAPI void                     evas_font_cache_set          (Evas *e, int size) EINA_ARG_NONNULL(1);
2569
2570 /**
2571  * Changes the size of font cache of the given evas.
2572  *
2573  * @param e The given evas to flush font cache.
2574  * @return The size, in bytes.
2575  *
2576  * @ingroup Evas_Font_Group
2577  */
2578 EAPI int                      evas_font_cache_get          (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
2579
2580
2581 /**
2582  * List of available font descriptions known or found by this evas.
2583  *
2584  * The list depends on Evas compile time configuration, such as
2585  * fontconfig support, and the paths provided at runtime as explained
2586  * in @ref Evas_Font_Path_Group.
2587  *
2588  * @param e The evas instance to query.
2589  * @return a newly allocated list of strings. Do not change the
2590  *         strings.  Be sure to call evas_font_available_list_free()
2591  *         after you're done.
2592  *
2593  * @ingroup Evas_Font_Group
2594  */
2595 EAPI Eina_List               *evas_font_available_list     (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
2596
2597 /**
2598  * Free list of font descriptions returned by evas_font_dir_available_list().
2599  *
2600  * @param e The evas instance that returned such list.
2601  * @param available the list returned by evas_font_dir_available_list().
2602  *
2603  * @ingroup Evas_Font_Group
2604  */
2605 EAPI void                     evas_font_available_list_free(Evas *e, Eina_List *available) EINA_ARG_NONNULL(1);
2606
2607 /**
2608  * @defgroup Evas_Font_Path_Group Font Path Functions
2609  *
2610  * Functions that edit the paths being used to load fonts.
2611  *
2612  * @ingroup Evas_Font_Group
2613  */
2614
2615 /**
2616  * Removes all font paths loaded into memory for the given evas.
2617  * @param   e The given evas.
2618  * @ingroup Evas_Font_Path_Group
2619  */
2620 EAPI void              evas_font_path_clear              (Evas *e) EINA_ARG_NONNULL(1);
2621
2622 /**
2623  * Appends a font path to the list of font paths used by the given evas.
2624  * @param   e    The given evas.
2625  * @param   path The new font path.
2626  * @ingroup Evas_Font_Path_Group
2627  */
2628 EAPI void              evas_font_path_append             (Evas *e, const char *path) EINA_ARG_NONNULL(1, 2);
2629
2630 /**
2631  * Prepends a font path to the list of font paths used by the given evas.
2632  * @param   e The given evas.
2633  * @param   path The new font path.
2634  * @ingroup Evas_Font_Path_Group
2635  */
2636 EAPI void              evas_font_path_prepend            (Evas *e, const char *path) EINA_ARG_NONNULL(1, 2);
2637
2638 /**
2639  * Retrieves the list of font paths used by the given evas.
2640  * @param   e The given evas.
2641  * @return  The list of font paths used.
2642  * @ingroup Evas_Font_Path_Group
2643  */
2644 EAPI const Eina_List  *evas_font_path_list               (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
2645
2646 /**
2647  * @defgroup Evas_Object_Group Generic Object Functions
2648  *
2649  * Functions that manipulate generic Evas objects.
2650  *
2651  * All Evas displaying units are Evas objects. One handles them all by
2652  * means of the handle ::Evas_Object. Besides Evas treats their
2653  * objects equally, they have @b types, which define their specific
2654  * behavior (and individual API).
2655  *
2656  * Evas comes with a set of built-in object types:
2657  *   - rectangle,
2658  *   - line,
2659  *   - polygon,
2660  *   - text,
2661  *   - textblock and
2662  *   - image.
2663  *
2664  * These functions apply to @b any Evas object, whichever type thay
2665  * may have.
2666  *
2667  * @note The built-in types which are most used are rectangles, text
2668  * and images. In fact, with these ones one can create 2D interfaces
2669  * of arbitrary complexity and EFL makes it easy.
2670  */
2671
2672 /**
2673  * @defgroup Evas_Object_Group_Basic Basic Object Manipulation
2674  *
2675  * Methods that are broadly used, like those that change the color,
2676  * clippers and geometry of an Evas object.
2677  *
2678  * An example on the most used functions in this group can be seen @ref
2679  * Example_Evas_Object_Manipulation "here".
2680  *
2681  * For function dealing with stacking, the examples are gathered  @ref
2682  * Example_Evas_Stacking "here".
2683  *
2684  * @ingroup Evas_Object_Group
2685  */
2686
2687 /**
2688  * @addtogroup Evas_Object_Group_Basic
2689  * @{
2690  */
2691
2692 /**
2693  * Clip one object to another.
2694  *
2695  * @param obj The object to be clipped
2696  * @param clip The object to clip @p obj by
2697  *
2698  * This function will clip the object @p obj to the area occupied by
2699  * the object @p clip. This means the object @p obj will only be
2700  * visible within the area occupied by the clipping object (@p clip).
2701  *
2702  * The color of the object being clipped will be multiplied by the
2703  * color of the clipping one, so the resulting color for the former
2704  * will be <code>RESULT = (OBJ * CLIP) / (255 * 255)</code>, per color
2705  * element (red, green, blue and alpha).
2706  *
2707  * Clipping is recursive, so clipping objects may be clipped by
2708  * others, and their color will in term be multiplied. You may @b not
2709  * set up circular clipping lists (i.e. object 1 clips object 2, which
2710  * clips object 1): the behavior of Evas is undefined in this case.
2711  *
2712  * Objects which do not clip others are visible in the canvas as
2713  * normal; <b>those that clip one or more objects become invisible
2714  * themselves</b>, only affecting what they clip. If an object ceases
2715  * to have other objects being clipped by it, it will become visible
2716  * again.
2717  *
2718  * The visibility of an object affects the objects that are clipped by
2719  * it, so if the object clipping others is not shown (as in
2720  * evas_object_show()), the objects clipped by it will not be shown
2721  * either.
2722  *
2723  * If @p obj was being clipped by another object when this function is
2724  * called, it gets implicitly removed from the old clipper's domain
2725  * and is made now to be clipped by its new clipper.
2726  *
2727  * @note At the moment the <b>only objects that can validly be used to
2728  * clip other objects are rectangle objects</b>. All other object
2729  * types are invalid and the result of using them is undefined. The
2730  * clip object @p clip must be a valid object, but can also be @c
2731  * NULL, in which case the effect of this function is the same as
2732  * calling evas_object_clip_unset() on the @p obj object.
2733  *
2734  * Example:
2735  * @dontinclude evas-object-manipulation.c
2736  * @skip solid white clipper (note that it's the default color for a
2737  * @until evas_object_show(d.clipper);
2738  *
2739  * See the full @ref Example_Evas_Object_Manipulation "example".
2740  */
2741 EAPI void              evas_object_clip_set              (Evas_Object *obj, Evas_Object *clip) EINA_ARG_NONNULL(1, 2);
2742
2743 /**
2744  * Get the object clipping @p obj (if any).
2745  *
2746  * @param obj The object to get the clipper from
2747  *
2748  * This function returns the object clipping @p obj. If @p obj is
2749  * not being clipped at all, @c NULL is returned. The object @p obj
2750  * must be a valid ::Evas_Object.
2751  *
2752  * See also evas_object_clip_set(), evas_object_clip_unset() and
2753  * evas_object_clipees_get().
2754  *
2755  * Example:
2756  * @dontinclude evas-object-manipulation.c
2757  * @skip if (evas_object_clip_get(d.img) == d.clipper)
2758  * @until return
2759  *
2760  * See the full @ref Example_Evas_Object_Manipulation "example".
2761  */
2762 EAPI Evas_Object      *evas_object_clip_get              (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
2763
2764 /**
2765  * Disable/cease clipping on a clipped @p obj object.
2766  *
2767  * @param obj The object to cease clipping on
2768  *
2769  * This function disables clipping for the object @p obj, if it was
2770  * already clipped, i.e., its visibility and color get detached from
2771  * the previous clipper. If it wasn't, this has no effect. The object
2772  * @p obj must be a valid ::Evas_Object.
2773  *
2774  * See also evas_object_clip_set() (for an example),
2775  * evas_object_clipees_get() and evas_object_clip_get().
2776  *
2777  */
2778 EAPI void              evas_object_clip_unset            (Evas_Object *obj);
2779
2780 /**
2781  * Return a list of objects currently clipped by @p obj.
2782  *
2783  * @param obj The object to get a list of clippees from
2784  * @return a list of objects being clipped by @p obj
2785  *
2786  * This returns the internal list handle that contains all objects
2787  * clipped by the object @p obj. If none are clipped by it, the call
2788  * returns @c NULL. This list is only valid until the clip list is
2789  * changed and should be fetched again with another call to
2790  * evas_object_clipees_get() if any objects being clipped by this
2791  * object are unclipped, clipped by a new object, deleted or get the
2792  * clipper deleted. These operations will invalidate the list
2793  * returned, so it should not be used anymore after that point. Any
2794  * use of the list after this may have undefined results, possibly
2795  * leading to crashes. The object @p obj must be a valid
2796  * ::Evas_Object.
2797  *
2798  * See also evas_object_clip_set(), evas_object_clip_unset() and
2799  * evas_object_clip_get().
2800  *
2801  * Example:
2802  * @code
2803  * extern Evas_Object *obj;
2804  * Evas_Object *clipper;
2805  *
2806  * clipper = evas_object_clip_get(obj);
2807  * if (clipper)
2808  *   {
2809  *     Eina_List *clippees, *l;
2810  *     Evas_Object *obj_tmp;
2811  *
2812  *     clippees = evas_object_clipees_get(clipper);
2813  *     printf("Clipper clips %i objects\n", eina_list_count(clippees));
2814  *     EINA_LIST_FOREACH(clippees, l, obj_tmp)
2815  *         evas_object_show(obj_tmp);
2816  *   }
2817  * @endcode
2818  */
2819 EAPI const Eina_List  *evas_object_clipees_get           (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
2820
2821
2822 /**
2823  * Sets or unsets a given object as the currently focused one on its
2824  * canvas.
2825  *
2826  * @param obj The object to be focused or unfocused.
2827  * @param focus @c EINA_TRUE, to set it as focused or @c EINA_FALSE,
2828  * to take away the focus from it.
2829  *
2830  * Changing focus only affects where (key) input events go. There can
2831  * be only one object focused at any time. If @p focus is @c
2832  * EINA_TRUE, @p obj will be set as the currently focused object and
2833  * it will receive all keyboard events that are not exclusive key
2834  * grabs on other objects.
2835  *
2836  * Example:
2837  * @dontinclude evas-events.c
2838  * @skip evas_object_focus_set
2839  * @until evas_object_focus_set
2840  *
2841  * See the full example @ref Example_Evas_Events "here".
2842  *
2843  * @see evas_object_focus_get
2844  * @see evas_focus_get
2845  * @see evas_object_key_grab
2846  * @see evas_object_key_ungrab
2847  */
2848 EAPI void              evas_object_focus_set             (Evas_Object *obj, Eina_Bool focus) EINA_ARG_NONNULL(1);
2849
2850 /**
2851  * Retrieve whether an object has the focus.
2852  *
2853  * @param obj The object to retrieve focus information from.
2854  * @return @c EINA_TRUE if the object has the focus, @c EINA_FALSE
2855  * otherwise.
2856  *
2857  * If the passed object is the currently focused one, @c EINA_TRUE is
2858  * returned. @c EINA_FALSE is returned, otherwise.
2859  *
2860  * Example:
2861  * @dontinclude evas-events.c
2862  * @skip And again
2863  * @until something is bad
2864  *
2865  * See the full example @ref Example_Evas_Events "here".
2866  *
2867  * @see evas_object_focus_set
2868  * @see evas_focus_get
2869  * @see evas_object_key_grab
2870  * @see evas_object_key_ungrab
2871  */
2872 EAPI Eina_Bool         evas_object_focus_get             (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
2873
2874
2875 /**
2876  * Sets the layer of the its canvas that the given object will be part
2877  * of.
2878  *
2879  * @param   obj The given Evas object.
2880  * @param   l   The number of the layer to place the object on.
2881  *          Must be between #EVAS_LAYER_MIN and #EVAS_LAYER_MAX.
2882  *
2883  * If you don't use this function, you'll be dealing with an @b unique
2884  * layer of objects, the default one. Additional layers are handy when
2885  * you don't want a set of objects to interfere with another set with
2886  * regard to @b stacking. Two layers are completely disjoint in that
2887  * matter.
2888  *
2889  * This is a low-level function, which you'd be using when something
2890  * should be always on top, for example.
2891  *
2892  * @warning Be careful, it doesn't make sense to change the layer of
2893  * smart objects' children. Smart objects have a layer of their own,
2894  * which should contain all their children objects.
2895  *
2896  * @see evas_object_layer_get()
2897  */
2898 EAPI void              evas_object_layer_set             (Evas_Object *obj, short l) EINA_ARG_NONNULL(1);
2899
2900 /**
2901  * Retrieves the layer of its canvas that the given object is part of.
2902  *
2903  * @param   obj The given Evas object to query layer from
2904  * @return  Number of the its layer
2905  *
2906  * @see evas_object_layer_set()
2907  */
2908 EAPI short             evas_object_layer_get             (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
2909
2910
2911 /**
2912  * Sets the name of the given Evas object to the given name.
2913  *
2914  * @param   obj  The given object.
2915  * @param   name The given name.
2916  *
2917  * There might be ocasions where one would like to name his/her
2918  * objects.
2919  *
2920  * Example:
2921  * @dontinclude evas-events.c
2922  * @skip d.bg = evas_object_rectangle_add(d.canvas);
2923  * @until evas_object_name_set(d.bg, "our dear rectangle");
2924  *
2925  * See the full @ref Example_Evas_Events "example".
2926  */
2927 EAPI void              evas_object_name_set              (Evas_Object *obj, const char *name) EINA_ARG_NONNULL(1);
2928
2929 /**
2930  * Retrieves the name of the given Evas object.
2931  *
2932  * @param   obj The given object.
2933  * @return  The name of the object or @c NULL, if no name has been given
2934  *          to it.
2935  *
2936  * Example:
2937  * @dontinclude evas-events.c
2938  * @skip fprintf(stdout, "An object got focused: %s\n",
2939  * @until evas_focus_get
2940  *
2941  * See the full @ref Example_Evas_Events "example".
2942  */
2943 EAPI const char       *evas_object_name_get              (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
2944
2945
2946 /**
2947  * Increments object reference count to defer its deletion.
2948  *
2949  * @param obj The given Evas object to reference
2950  *
2951  * This increments the reference count of an object, which if greater
2952  * than 0 will defer deletion by evas_object_del() until all
2953  * references are released back (counter back to 0). References cannot
2954  * go below 0 and unreferencing past that will result in the reference
2955  * count being limited to 0. References are limited to <c>2^32 - 1</c>
2956  * for an object. Referencing it more than this will result in it
2957  * being limited to this value.
2958  *
2959  * @see evas_object_unref()
2960  * @see evas_object_del()
2961  *
2962  * @note This is a <b>very simple<b> reference counting mechanism! For
2963  * instance, Evas is not ready to check for pending references on a
2964  * canvas deletion, or things like that. This is useful on scenarios
2965  * where, inside a code block, callbacks exist which would possibly
2966  * delete an object we are operating on afterwards. Then, one would
2967  * evas_object_ref() it on the beginning of the block and
2968  * evas_object_unref() it on the end. I would then be deleted at this
2969  * point, if it should be.
2970  *
2971  * Example:
2972  * @code
2973  *  evas_object_ref(obj);
2974  *
2975  *  // action here...
2976  *  evas_object_smart_callback_call(obj, SIG_SELECTED, NULL);
2977  *  // more action here...
2978  *  evas_object_unref(obj);
2979  * @endcode
2980  *
2981  * @ingroup Evas_Object_Group_Basic
2982  * @since 1.1.0
2983  */
2984 EAPI void              evas_object_ref                   (Evas_Object *obj);
2985
2986 /**
2987  * Decrements object reference count.
2988  *
2989  * @param obj The given Evas object to unreference
2990  *
2991  * This decrements the reference count of an object. If the object has
2992  * had evas_object_del() called on it while references were more than
2993  * 0, it will be deleted at the time this function is called and puts
2994  * the counter back to 0. See evas_object_ref() for more information.
2995  *
2996  * @see evas_object_ref() (for an example)
2997  * @see evas_object_del()
2998  *
2999  * @ingroup Evas_Object_Group_Basic
3000  * @since 1.1.0
3001  */
3002 EAPI void              evas_object_unref                 (Evas_Object *obj);
3003
3004
3005 /**
3006  * Marks the given Evas object for deletion (when Evas will free its
3007  * memory).
3008  *
3009  * @param obj The given Evas object.
3010  *
3011  * This call will mark @p obj for deletion, which will take place
3012  * whenever it has no more references to it (see evas_object_ref() and
3013  * evas_object_unref()).
3014  *
3015  * At actual deletion time, which may or may not be just after this
3016  * call, ::EVAS_CALLBACK_DEL and ::EVAS_CALLBACK_FREE callbacks will
3017  * be called. If the object currently had the focus, its
3018  * ::EVAS_CALLBACK_FOCUS_OUT callback will also be called.
3019  *
3020  * @see evas_object_ref()
3021  * @see evas_object_unref()
3022  *
3023  * @ingroup Evas_Object_Group_Basic
3024  */
3025 EAPI void              evas_object_del                   (Evas_Object *obj) EINA_ARG_NONNULL(1);
3026
3027 /**
3028  * Move the given Evas object to the given location inside its
3029  * canvas' viewport.
3030  *
3031  * @param obj The given Evas object.
3032  * @param x   X position to move the object to, in canvas units.
3033  * @param y   Y position to move the object to, in canvas units.
3034  *
3035  * Besides being moved, the object's ::EVAS_CALLBACK_MOVE callback
3036  * will be called.
3037  *
3038  * @note Naturally, newly created objects are placed at the canvas'
3039  * origin: <code>0, 0</code>.
3040  *
3041  * Example:
3042  * @dontinclude evas-object-manipulation.c
3043  * @skip evas_object_image_border_set(d.clipper_border, 3, 3, 3, 3);
3044  * @until evas_object_show
3045  *
3046  * See the full @ref Example_Evas_Object_Manipulation "example".
3047  *
3048  * @ingroup Evas_Object_Group_Basic
3049  */
3050 EAPI void              evas_object_move                  (Evas_Object *obj, Evas_Coord x, Evas_Coord y) EINA_ARG_NONNULL(1);
3051
3052 /**
3053  * Changes the size of the given Evas object.
3054  *
3055  * @param obj The given Evas object.
3056  * @param w   The new width of the Evas object.
3057  * @param h   The new height of the Evas object.
3058  *
3059  * Besides being resized, the object's ::EVAS_CALLBACK_RESIZE callback
3060  * will be called.
3061  *
3062  * @note Newly created objects have zeroed dimensions. Then, you most
3063  * probably want to use evas_object_resize() on them after they are
3064  * created.
3065  *
3066  * @note Be aware that resizing an object changes its drawing area,
3067  * but that does imply the object is rescaled! For instance, images
3068  * are filled inside their drawing area using the specifications of
3069  * evas_object_image_fill_set(). Thus to scale the image to match
3070  * exactly your drawing area, you need to change the
3071  * evas_object_image_fill_set() as well.
3072  *
3073  * @note This is more evident in images, but text, textblock, lines
3074  * and polygons will behave similarly. Check their specific APIs to
3075  * know how to achieve your desired behavior. Consider the following
3076  * example:
3077  *
3078  * @code
3079  * // rescale image to fill exactly its area without tiling:
3080  * evas_object_resize(img, w, h);
3081  * evas_object_image_fill_set(img, 0, 0, w, h);
3082  * @endcode
3083  *
3084  * @ingroup Evas_Object_Group_Basic
3085  */
3086 EAPI void              evas_object_resize                (Evas_Object *obj, Evas_Coord w, Evas_Coord h) EINA_ARG_NONNULL(1);
3087
3088 /**
3089  * Retrieves the position and (rectangular) size of the given Evas
3090  * object.
3091  *
3092  * @param obj The given Evas object.
3093  * @param x Pointer to an integer in which to store the X coordinate
3094  *          of the object.
3095  * @param y Pointer to an integer in which to store the Y coordinate
3096  *          of the object.
3097  * @param w Pointer to an integer in which to store the width of the
3098  *          object.
3099  * @param h Pointer to an integer in which to store the height of the
3100  *          object.
3101  *
3102  * The position, naturally, will be relative to the top left corner of
3103  * the canvas' viewport.
3104  *
3105  * @note Use @c NULL pointers on the geometry components you're not
3106  * interested in: they'll be ignored by the function.
3107  *
3108  * Example:
3109  * @dontinclude evas-events.c
3110  * @skip int w, h, cw, ch;
3111  * @until return
3112  *
3113  * See the full @ref Example_Evas_Events "example".
3114  *
3115  * @ingroup Evas_Object_Group_Basic
3116  */
3117 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);
3118
3119
3120 /**
3121  * Makes the given Evas object visible.
3122  *
3123  * @param obj The given Evas object.
3124  *
3125  * Besides becoming visible, the object's ::EVAS_CALLBACK_SHOW
3126  * callback will be called.
3127  *
3128  * @see evas_object_hide() for more on object visibility.
3129  * @see evas_object_visible_get()
3130  *
3131  * @ingroup Evas_Object_Group_Basic
3132  */
3133 EAPI void              evas_object_show                  (Evas_Object *obj) EINA_ARG_NONNULL(1);
3134
3135 /**
3136  * Makes the given Evas object invisible.
3137  *
3138  * @param obj The given Evas object.
3139  *
3140  * Hidden objects, besides not being shown at all in your canvas,
3141  * won't be checked for changes on the canvas rendering
3142  * process. Furthermore, they will not catch input events. Thus, they
3143  * are much ligher (in processing needs) than an object that is
3144  * invisible due to indirect causes, such as being clipped or out of
3145  * the canvas' viewport.
3146  *
3147  * Besides becoming hidden, @p obj object's ::EVAS_CALLBACK_SHOW
3148  * callback will be called.
3149  *
3150  * @note All objects are created in the hidden state! If you want them
3151  * shown, use evas_object_show() after their creation.
3152  *
3153  * @see evas_object_show()
3154  * @see evas_object_visible_get()
3155  *
3156  * Example:
3157  * @dontinclude evas-object-manipulation.c
3158  * @skip if (evas_object_visible_get(d.clipper))
3159  * @until return
3160  *
3161  * See the full @ref Example_Evas_Object_Manipulation "example".
3162  *
3163  * @ingroup Evas_Object_Group_Basic
3164  */
3165 EAPI void              evas_object_hide                  (Evas_Object *obj) EINA_ARG_NONNULL(1);
3166
3167 /**
3168  * Retrieves whether or not the given Evas object is visible.
3169  *
3170  * @param   obj The given Evas object.
3171  * @return @c EINA_TRUE if the object is visible, @c EINA_FALSE
3172  * otherwise.
3173  *
3174  * This retrieves an object's visibily as the one enforced by
3175  * evas_object_show() and evas_object_hide().
3176  *
3177  * @note The value returned isn't, by any means, influenced by
3178  * clippers covering @obj, it being out of its canvas' viewport or
3179  * stacked below other object.
3180  *
3181  * @see evas_object_show()
3182  * @see evas_object_hide() (for an example)
3183  *
3184  * @ingroup Evas_Object_Group_Basic
3185  */
3186 EAPI Eina_Bool         evas_object_visible_get           (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
3187
3188
3189 /**
3190  * Sets the general/main color of the given Evas object to the given
3191  * one.
3192  *
3193  * @param obj The given Evas object.
3194  * @param r   The red component of the given color.
3195  * @param g   The green component of the given color.
3196  * @param b   The blue component of the given color.
3197  * @param a   The alpha component of the given color.
3198  *
3199  * @see evas_object_color_get() (for an example)
3200  *
3201  * @ingroup Evas_Object_Group_Basic
3202  */
3203 EAPI void              evas_object_color_set             (Evas_Object *obj, int r, int g, int b, int a) EINA_ARG_NONNULL(1);
3204
3205 /**
3206  * Retrieves the general/main color of the given Evas object.
3207  *
3208  * @param obj The given Evas object to retrieve color from.
3209  * @param r Pointer to an integer in which to store the red component
3210  *          of the color.
3211  * @param g Pointer to an integer in which to store the green
3212  *          component of the color.
3213  * @param b Pointer to an integer in which to store the blue component
3214  *          of the color.
3215  * @param a Pointer to an integer in which to store the alpha
3216  *          component of the color.
3217  *
3218  * Retrieves the “main” color's RGB component (and alpha channel)
3219  * values, <b>which range from 0 to 255</b>. For the alpha channel,
3220  * which defines the object's transparency level, the former value
3221  * means totally trasparent, while the latter means opaque.
3222  *
3223  * Usually you’ll use this attribute for text and rectangle objects,
3224  * where the “main” color is their unique one. If set for objects
3225  * which themselves have colors, like the images one, those colors get
3226  * modulated by this one.
3227  *
3228  * @note All newly created Evas rectangles get the default color
3229  * values of <code>255 255 255 255</code> (opaque white).
3230  *
3231  * @note Use @c NULL pointers on the components you're not interested
3232  * in: they'll be ignored by the function.
3233  *
3234  * Example:
3235  * @dontinclude evas-object-manipulation.c
3236  * @skip int alpha, r, g, b;
3237  * @until return
3238  *
3239  * See the full @ref Example_Evas_Object_Manipulation "example".
3240  *
3241  * @ingroup Evas_Object_Group_Basic
3242  */
3243 EAPI void              evas_object_color_get             (const Evas_Object *obj, int *r, int *g, int *b, int *a) EINA_ARG_NONNULL(1);
3244
3245
3246 /**
3247  * Retrieves the Evas canvas that the given object lives on.
3248  *
3249  * @param   obj The given Evas object.
3250  * @return  A pointer to the canvas where the object is on.
3251  *
3252  * This function is most useful at code contexts where you need to
3253  * operate on the canvas but have only the object pointer.
3254  *
3255  * @ingroup Evas_Object_Group_Basic
3256  */
3257 EAPI Evas             *evas_object_evas_get              (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
3258
3259 /**
3260  * Retrieves the type of the given Evas object.
3261  *
3262  * @param obj The given object.
3263  * @return The type of the object.
3264  *
3265  * For Evas' builtin types, the return strings will be one of:
3266  *   - <c>"rectangle"</c>,
3267  *   - <c>"line"</c>,
3268  *   - <c>"polygon"</c>,
3269  *   - <c>"text"</c>,
3270  *   - <c>"textblock"</c> and
3271  *   - <c>"image"</c>.
3272  *
3273  * For Evas smart objects (see @ref Evas_Smart_Group), the name of the
3274  * smart class itself is returned on this call. For the built-in smart
3275  * objects, these names are:
3276  *   - <c>"EvasObjectSmartClipped"</c>, for the clipped smart object
3277  *   - <c>"Evas_Object_Box"</c>, for the box object and
3278  *   - <c>"Evas_Object_Table"</c>, for the table object.
3279  *
3280  * Example:
3281  * @dontinclude evas-object-manipulation.c
3282  * @skip d.img = evas_object_image_filled_add(d.canvas);
3283  * @until border on the
3284  *
3285  * See the full @ref Example_Evas_Object_Manipulation "example".
3286  */
3287 EAPI const char       *evas_object_type_get              (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
3288
3289 /**
3290  * Raise @p obj to the bottom of its layer.
3291  *
3292  * @param obj the object to raise
3293  *
3294  * @p obj will, then, be the highest one in the layer it belongs
3295  * to. Object on other layers won't get touched.
3296  *
3297  * @see evas_object_stack_above()
3298  * @see evas_object_stack_below()
3299  * @see evas_object_lower()
3300  */
3301 EAPI void              evas_object_raise                 (Evas_Object *obj) EINA_ARG_NONNULL(1);
3302
3303 /**
3304  * Lower @p obj to the bottom of its layer.
3305  *
3306  * @param obj the object to lower
3307  *
3308  * @p obj will, then, be the lowest one in the layer it belongs
3309  * to. Objects on other layers won't get touched.
3310  *
3311  * @see evas_object_stack_above()
3312  * @see evas_object_stack_below()
3313  * @see evas_object_raise()
3314  */
3315 EAPI void              evas_object_lower                 (Evas_Object *obj) EINA_ARG_NONNULL(1);
3316
3317 /**
3318  * Stack @p obj immediately above @p above
3319  *
3320  * @param obj the object to stack
3321  * @param above the object above which to stack
3322  *
3323  * Objects, in a given canvas, are stacked in the order they get added
3324  * to it.  This means that, if they overlap, the highest ones will
3325  * cover the lowest ones, in that order. This function is a way to
3326  * change the stacking order for the objects.
3327  *
3328  * This function is intended to be used with <b>objects belonging to
3329  * the same layer</b> in a given canvas, otherwise it will fail (and
3330  * accomplish nothing).
3331  *
3332  * If you have smart objects on your canvas and @p obj is a member of
3333  * one of them, then @p above must also be a member of the same
3334  * smart object.
3335  *
3336  * Similarly, if @p obj is not a member of a smart object, @p above
3337  * must not be either.
3338  *
3339  * @see evas_object_layer_get()
3340  * @see evas_object_layer_set()
3341  * @see evas_object_stack_below()
3342  */
3343 EAPI void              evas_object_stack_above           (Evas_Object *obj, Evas_Object *above) EINA_ARG_NONNULL(1, 2);
3344
3345 /**
3346  * Stack @p obj immediately below @p below
3347  *
3348  * @param obj the object to stack
3349  * @param below the object below which to stack
3350  *
3351  * Objects, in a given canvas, are stacked in the order they get added
3352  * to it.  This means that, if they overlap, the highest ones will
3353  * cover the lowest ones, in that order. This function is a way to
3354  * change the stacking order for the objects.
3355  *
3356  * This function is intended to be used with <b>objects belonging to
3357  * the same layer</b> in a given canvas, otherwise it will fail (and
3358  * accomplish nothing).
3359  *
3360  * If you have smart objects on your canvas and @p obj is a member of
3361  * one of them, then @p below must also be a member of the same
3362  * smart object.
3363  *
3364  * Similarly, if @p obj is not a member of a smart object, @p below
3365  * must not be either.
3366  *
3367  * @see evas_object_layer_get()
3368  * @see evas_object_layer_set()
3369  * @see evas_object_stack_below()
3370  */
3371 EAPI void              evas_object_stack_below           (Evas_Object *obj, Evas_Object *below) EINA_ARG_NONNULL(1, 2);
3372
3373 /**
3374  * Get the Evas object stacked right above @p obj
3375  *
3376  * @param obj an #Evas_Object
3377  * @return the #Evas_Object directly above @p obj, if any, or @c NULL,
3378  * if none
3379  *
3380  * This function will traverse layers in its search, if there are
3381  * objects on layers above the one @p obj is placed at.
3382  *
3383  * @see evas_object_layer_get()
3384  * @see evas_object_layer_set()
3385  * @see evas_object_below_get()
3386  *
3387  */
3388 EAPI Evas_Object      *evas_object_above_get             (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
3389
3390 /**
3391  * Get the Evas object stacked right below @p obj
3392  *
3393  * @param obj an #Evas_Object
3394  * @return the #Evas_Object directly below @p obj, if any, or @c NULL,
3395  * if none
3396  *
3397  * This function will traverse layers in its search, if there are
3398  * objects on layers below the one @p obj is placed at.
3399  *
3400  * @see evas_object_layer_get()
3401  * @see evas_object_layer_set()
3402  * @see evas_object_below_set()
3403  */
3404 EAPI Evas_Object      *evas_object_below_get             (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
3405
3406 /**
3407  * @}
3408  */
3409
3410 /**
3411  * @defgroup Evas_Object_Group_Events Object Events
3412  *
3413  * Objects generate events when they are moved, resized, when their
3414  * visibility change, when they are deleted and so on. These methods
3415  * allow one to be notified about and to handle such events.
3416  *
3417  * Objects also generate events on input (keyboard and mouse), if they
3418  * accept them (are visible, focused, etc).
3419  *
3420  * Examples on this group of functions can be found @ref
3421  * Example_Evas_Stacking "here" and @ref Example_Evas_Events "here".
3422  *
3423  * @ingroup Evas_Object_Group
3424  */
3425
3426 /**
3427  * @addtogroup Evas_Object_Group_Events
3428  * @{
3429  */
3430
3431 /**
3432  * Add (register) a callback function to a given Evas object event.
3433  *
3434  * @param obj Object to attach a callback to
3435  * @param type The type of event that will trigger the callback
3436  * @param func The function to be called when the event is triggered
3437  * @param data The data pointer to be passed to @p func
3438  *
3439  * This function adds a function callback to an object when the event
3440  * of type @p type occurs on object @p obj. The function is @p func.
3441  *
3442  * In the event of a memory allocation error during addition of the
3443  * callback to the object, evas_alloc_error() should be used to
3444  * determine the nature of the error, if any, and the program should
3445  * sensibly try and recover.
3446  *
3447  * A callback function must have the ::Evas_Object_Event_Cb prototype
3448  * definition. The first parameter (@p data) in this definition will
3449  * have the same value passed to evas_object_event_callback_add() as
3450  * the @p data parameter, at runtime. The second parameter @p e is the
3451  * canvas pointer on which the event occurred. The third parameter is
3452  * a pointer to the object on which event occurred. Finally, the
3453  * fourth parameter @p event_info is a pointer to a data structure
3454  * that may or may not be passed to the callback, depending on the
3455  * event type that triggered the callback. This is so because some
3456  * events don't carry extra context with them, but others do.
3457  *
3458  * The event type @p type to trigger the function may be one of
3459  * #EVAS_CALLBACK_MOUSE_IN, #EVAS_CALLBACK_MOUSE_OUT,
3460  * #EVAS_CALLBACK_MOUSE_DOWN, #EVAS_CALLBACK_MOUSE_UP,
3461  * #EVAS_CALLBACK_MOUSE_MOVE, #EVAS_CALLBACK_MOUSE_WHEEL,
3462  * #EVAS_CALLBACK_MULTI_DOWN, #EVAS_CALLBACK_MULTI_UP,
3463  * #EVAS_CALLBACK_MULTI_MOVE, #EVAS_CALLBACK_FREE,
3464  * #EVAS_CALLBACK_KEY_DOWN, #EVAS_CALLBACK_KEY_UP,
3465  * #EVAS_CALLBACK_FOCUS_IN, #EVAS_CALLBACK_FOCUS_OUT,
3466  * #EVAS_CALLBACK_SHOW, #EVAS_CALLBACK_HIDE, #EVAS_CALLBACK_MOVE,
3467  * #EVAS_CALLBACK_RESIZE, #EVAS_CALLBACK_RESTACK, #EVAS_CALLBACK_DEL,
3468  * #EVAS_CALLBACK_HOLD, #EVAS_CALLBACK_CHANGED_SIZE_HINTS,
3469  * #EVAS_CALLBACK_IMAGE_PRELOADED or #EVAS_CALLBACK_IMAGE_UNLOADED.
3470  *
3471  * This determines the kind of event that will trigger the callback.
3472  * What follows is a list explaining better the nature of each type of
3473  * event, along with their associated @p event_info pointers:
3474  *
3475  * - #EVAS_CALLBACK_MOUSE_IN: @p event_info is a pointer to an
3476  *   #Evas_Event_Mouse_In struct\n\n
3477  *   This event is triggered when the mouse pointer enters the area
3478  *   (not shaded by other objects) of the object @p obj. This may
3479  *   occur by the mouse pointer being moved by
3480  *   evas_event_feed_mouse_move() calls, or by the object being shown,
3481  *   raised, moved, resized, or other objects being moved out of the
3482  *   way, hidden or lowered, whatever may cause the mouse pointer to
3483  *   get on top of @p obj, having been on top of another object
3484  *   previously.
3485  *
3486  * - #EVAS_CALLBACK_MOUSE_OUT: @p event_info is a pointer to an
3487  *   #Evas_Event_Mouse_Out struct\n\n
3488  *   This event is triggered exactly like #EVAS_CALLBACK_MOUSE_IN is,
3489  *   but it occurs when the mouse pointer exits an object's area. Note
3490  *   that no mouse out events will be reported if the mouse pointer is
3491  *   implicitly grabbed to an object (mouse buttons are down, having
3492  *   been pressed while the pointer was over that object). In these
3493  *   cases, mouse out events will be reported once all buttons are
3494  *   released, if the mouse pointer has left the object's area. The
3495  *   indirect ways of taking off the mouse pointer from an object,
3496  *   like cited above, for #EVAS_CALLBACK_MOUSE_IN, also apply here,
3497  *   naturally.
3498  *
3499  * - #EVAS_CALLBACK_MOUSE_DOWN: @p event_info is a pointer to an
3500  *   #Evas_Event_Mouse_Down struct\n\n
3501  *   This event is triggered by a mouse button being pressed while the
3502  *   mouse pointer is over an object. If the pointer mode for Evas is
3503  *   #EVAS_OBJECT_POINTER_MODE_AUTOGRAB (default), this causes this
3504  *   object to <b>passively grab the mouse</b> until all mouse buttons
3505  *   have been released: all future mouse events will be reported to
3506  *   only this object until no buttons are down. That includes mouse
3507  *   move events, mouse in and mouse out events, and further button
3508  *   presses. When all buttons are released, event propagation will
3509  *   occur as normal (see #Evas_Object_Pointer_Mode).
3510  *
3511  * - #EVAS_CALLBACK_MOUSE_UP: @p event_info is a pointer to an
3512  *   #Evas_Event_Mouse_Up struct\n\n
3513  *   This event is triggered by a mouse button being released while
3514  *   the mouse pointer is over an object's area (or when passively
3515  *   grabbed to an object).
3516  *
3517  * - #EVAS_CALLBACK_MOUSE_MOVE: @p event_info is a pointer to an
3518  *   #Evas_Event_Mouse_Move struct\n\n
3519  *   This event is triggered by the mouse pointer being moved while
3520  *   over an object's area (or while passively grabbed to an object).
3521  *
3522  * - #EVAS_CALLBACK_MOUSE_WHEEL: @p event_info is a pointer to an
3523  *   #Evas_Event_Mouse_Wheel struct\n\n
3524  *   This event is triggered by the mouse wheel being rolled while the
3525  *   mouse pointer is over an object (or passively grabbed to an
3526  *   object).
3527  *
3528  * - #EVAS_CALLBACK_MULTI_DOWN: @p event_info is a pointer to an
3529  *   #Evas_Event_Multi_Down struct
3530  *
3531  * - #EVAS_CALLBACK_MULTI_UP: @p event_info is a pointer to an
3532  *   #Evas_Event_Multi_Up struct
3533  *
3534  * - #EVAS_CALLBACK_MULTI_MOVE: @p event_info is a pointer to an
3535  *   #Evas_Event_Multi_Move struct
3536  *
3537  * - #EVAS_CALLBACK_FREE: @p event_info is @c NULL \n\n
3538  *   This event is triggered just before Evas is about to free all
3539  *   memory used by an object and remove all references to it. This is
3540  *   useful for programs to use if they attached data to an object and
3541  *   want to free it when the object is deleted. The object is still
3542  *   valid when this callback is called, but after it returns, there
3543  *   is no guarantee on the object's validity.
3544  *
3545  * - #EVAS_CALLBACK_KEY_DOWN: @p event_info is a pointer to an
3546  *   #Evas_Event_Key_Down struct\n\n
3547  *   This callback is called when a key is pressed and the focus is on
3548  *   the object, or a key has been grabbed to a particular object
3549  *   which wants to intercept the key press regardless of what object
3550  *   has the focus.
3551  *
3552  * - #EVAS_CALLBACK_KEY_UP: @p event_info is a pointer to an
3553  *   #Evas_Event_Key_Up struct \n\n
3554  *   This callback is called when a key is released and the focus is
3555  *   on the object, or a key has been grabbed to a particular object
3556  *   which wants to intercept the key release regardless of what
3557  *   object has the focus.
3558  *
3559  * - #EVAS_CALLBACK_FOCUS_IN: @p event_info is @c NULL \n\n
3560  *   This event is called when an object gains the focus. When it is
3561  *   called the object has already gained the focus.
3562  *
3563  * - #EVAS_CALLBACK_FOCUS_OUT: @p event_info is @c NULL \n\n
3564  *   This event is triggered when an object loses the focus. When it
3565  *   is called the object has already lost the focus.
3566  *
3567  * - #EVAS_CALLBACK_SHOW: @p event_info is @c NULL \n\n
3568  *   This event is triggered by the object being shown by
3569  *   evas_object_show().
3570  *
3571  * - #EVAS_CALLBACK_HIDE: @p event_info is @c NULL \n\n
3572  *   This event is triggered by an object being hidden by
3573  *   evas_object_hide().
3574  *
3575  * - #EVAS_CALLBACK_MOVE: @p event_info is @c NULL \n\n
3576  *   This event is triggered by an object being
3577  *   moved. evas_object_move() can trigger this, as can any
3578  *   object-specific manipulations that would mean the object's origin
3579  *   could move.
3580  *
3581  * - #EVAS_CALLBACK_RESIZE: @p event_info is @c NULL \n\n
3582  *   This event is triggered by an object being resized. Resizes can
3583  *   be triggered by evas_object_resize() or by any object-specific
3584  *   calls that may cause the object to resize.
3585  *
3586  * - #EVAS_CALLBACK_RESTACK: @p event_info is @c NULL \n\n
3587  *   This event is triggered by an object being re-stacked. Stacking
3588  *   changes can be triggered by
3589  *   evas_object_stack_below()/evas_object_stack_above() and others.
3590  *
3591  * - #EVAS_CALLBACK_DEL: @p event_info is @c NULL.
3592  *
3593  * - #EVAS_CALLBACK_HOLD: @p event_info is a pointer to an
3594  *   #Evas_Event_Hold struct
3595  *
3596  * - #EVAS_CALLBACK_CHANGED_SIZE_HINTS: @p event_info is @c NULL.
3597  *
3598  * - #EVAS_CALLBACK_IMAGE_PRELOADED: @p event_info is @c NULL.
3599  *
3600  * - #EVAS_CALLBACK_IMAGE_UNLOADED: @p event_info is @c NULL.
3601  *
3602  * @note Be careful not to add the same callback multiple times, if
3603  * that's not what you want, because Evas won't check if a callback
3604  * existed before exactly as the one being registered (and thus, call
3605  * it more than once on the event, in this case). This would make
3606  * sense if you passed different functions and/or callback data, only.
3607  *
3608  * Example:
3609  * @dontinclude evas-events.c
3610  * @skip evas_object_event_callback_add(
3611  * @until }
3612  *
3613  * See the full example @ref Example_Evas_Events "here".
3614  *
3615  */
3616    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);
3617
3618 /**
3619  * Delete a callback function from an object
3620  *
3621  * @param obj Object to remove a callback from
3622  * @param type The type of event that was triggering the callback
3623  * @param func The function that was to be called when the event was triggered
3624  * @return The data pointer that was to be passed to the callback
3625  *
3626  * This function removes the most recently added callback from the
3627  * object @p obj which was triggered by the event type @p type and was
3628  * calling the function @p func when triggered. If the removal is
3629  * successful it will also return the data pointer that was passed to
3630  * evas_object_event_callback_add() when the callback was added to the
3631  * object. If not successful NULL will be returned.
3632  *
3633  * Example:
3634  * @code
3635  * extern Evas_Object *object;
3636  * void *my_data;
3637  * void up_callback(void *data, Evas *e, Evas_Object *obj, void *event_info);
3638  *
3639  * my_data = evas_object_event_callback_del(object, EVAS_CALLBACK_MOUSE_UP, up_callback);
3640  * @endcode
3641  */
3642 EAPI void             *evas_object_event_callback_del     (Evas_Object *obj, Evas_Callback_Type type, Evas_Object_Event_Cb func) EINA_ARG_NONNULL(1, 3);
3643
3644 /**
3645  * Delete (unregister) a callback function registered to a given
3646  * Evas object event.
3647  *
3648  * @param obj Object to remove a callback from
3649  * @param type The type of event that was triggering the callback
3650  * @param func The function that was to be called when the event was
3651  * triggered
3652  * @param data The data pointer that was to be passed to the callback
3653  * @return The data pointer that was to be passed to the callback
3654  *
3655  * This function removes the most recently added callback from the
3656  * object @p obj, which was triggered by the event type @p type and was
3657  * calling the function @p func with data @p data, when triggered. If
3658  * the removal is successful it will also return the data pointer that
3659  * was passed to evas_object_event_callback_add() (that will be the
3660  * same as the parameter) when the callback was added to the
3661  * object. In errors, @c NULL will be returned.
3662  *
3663  * @note For deletion of Evas object events callbacks filtering by
3664  * just type and function pointer, user
3665  * evas_object_event_callback_del().
3666  *
3667  * Example:
3668  * @code
3669  * extern Evas_Object *object;
3670  * void *my_data;
3671  * void up_callback(void *data, Evas *e, Evas_Object *obj, void *event_info);
3672  *
3673  * my_data = evas_object_event_callback_del_full(object, EVAS_CALLBACK_MOUSE_UP, up_callback, data);
3674  * @endcode
3675  */
3676 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);
3677
3678
3679 /**
3680  * Set whether an Evas object is to pass (ignore) events.
3681  *
3682  * @param obj the Evas object to operate on
3683  * @param pass whether @p obj is to pass events (@c EINA_TRUE) or not
3684  * (@c EINA_FALSE)
3685  *
3686  * If @p pass is @c EINA_TRUE, it will make events on @p obj to be @b
3687  * ignored. They will be triggered on the @b next lower object (that
3688  * is not set to pass events), instead (see evas_object_below_get()).
3689  *
3690  * If @p pass is @c EINA_FALSE, events will be processed on that
3691  * object as normal.
3692  *
3693  * @see evas_object_pass_events_get() for an example
3694  * @see evas_object_repeat_events_set()
3695  * @see evas_object_propagate_events_set()
3696  */
3697 EAPI void              evas_object_pass_events_set        (Evas_Object *obj, Eina_Bool pass) EINA_ARG_NONNULL(1);
3698
3699 /**
3700  * Determine whether an object is set to pass (ignore) events.
3701  *
3702  * @param obj the Evas object to get information from.
3703  * @return pass whether @p obj is set to pass events (@c EINA_TRUE) or not
3704  * (@c EINA_FALSE)
3705  *
3706  * Example:
3707  * @dontinclude evas-stacking.c
3708  * @skip if (strcmp(ev->keyname, "p") == 0)
3709  * @until }
3710  *
3711  * See the full @ref Example_Evas_Stacking "example".
3712  *
3713  * @see evas_object_pass_events_set()
3714  * @see evas_object_repeat_events_get()
3715  * @see evas_object_propagate_events_get()
3716  */
3717 EAPI Eina_Bool         evas_object_pass_events_get        (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
3718
3719 /**
3720  * Set whether an Evas object is to repeat events.
3721  *
3722  * @param obj the Evas object to operate on
3723  * @param repeat whether @p obj is to repeat events (@c EINA_TRUE) or not
3724  * (@c EINA_FALSE)
3725  *
3726  * If @p repeat is @c EINA_TRUE, it will make events on @p obj to also
3727  * be repeated for the @b next lower object in the objects' stack (see
3728  * see evas_object_below_get()).
3729  *
3730  * If @p repeat is @c EINA_FALSE, events occurring on @p obj will be
3731  * processed only on it.
3732  *
3733  * Example:
3734  * @dontinclude evas-stacking.c
3735  * @skip if (strcmp(ev->keyname, "r") == 0)
3736  * @until }
3737  *
3738  * See the full @ref Example_Evas_Stacking "example".
3739  *
3740  * @see evas_object_repeat_events_get()
3741  * @see evas_object_pass_events_get()
3742  * @see evas_object_propagate_events_get()
3743  */
3744 EAPI void              evas_object_repeat_events_set      (Evas_Object *obj, Eina_Bool repeat) EINA_ARG_NONNULL(1);
3745
3746 /**
3747  * Determine whether an object is set to repeat events.
3748  *
3749  * @param obj the given Evas object pointer
3750  * @retrieve whether @p obj is set to repeat events (@c EINA_TRUE)
3751  * or not (@c EINA_FALSE)
3752  *
3753  * @see evas_object_repeat_events_set() for an example
3754  * @see evas_object_pass_events_set()
3755  * @see evas_object_propagate_events_set()
3756  */
3757 EAPI Eina_Bool         evas_object_repeat_events_get      (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
3758
3759 /**
3760  * Set whether events on a smart object's member should get propagated
3761  * up to its parent.
3762  *
3763  * @param obj the smart object's child to operate on
3764  * @param prop whether to propagate events (@c EINA_TRUE) or not (@c
3765  * EINA_FALSE)
3766  *
3767  * This function has @b no effect if @p obj is not a member of a smart
3768  * object.
3769  *
3770  * If @p prop is @c EINA_TRUE, events occurring on this object will be
3771  * propagated on to the smart object of which @p obj is a member.  If
3772  * @p prop is @c EINA_FALSE, events occurring on this object will @b
3773  * not be propagated on to the smart object of which @p obj is a
3774  * member.  The default value is @c EINA_TRUE.
3775  *
3776  * @see evas_object_event_callback_add()
3777  * @see evas_object_propagate_events_get()
3778  * @see evas_object_repeat_events_get()
3779  * @see evas_object_pass_events_get()
3780  */
3781 EAPI void              evas_object_propagate_events_set   (Evas_Object *obj, Eina_Bool prop) EINA_ARG_NONNULL(1);
3782
3783 /**
3784  * Retrieve whether an Evas object is set to propagate events.
3785  *
3786  * @param obj the given Evas object pointer
3787  * @return whether @p obj is set to propagate events (@c EINA_TRUE)
3788  * or not (@c EINA_FALSE)
3789  *
3790  * @see evas_object_event_callback_add()
3791  * @see evas_object_propagate_events_set()
3792  * @see evas_object_repeat_events_set()
3793  * @see evas_object_pass_events_set()
3794  */
3795 EAPI Eina_Bool         evas_object_propagate_events_get   (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
3796
3797 /**
3798  * @}
3799  */
3800
3801 /**
3802  * @defgroup Evas_Object_Group_Map UV Mapping (Rotation, Perspecitve, 3D...)
3803  *
3804  * Evas allows different transformations to be applied to all kinds of
3805  * objects. These are applied by means of UV mapping.
3806  *
3807  * With UV mapping, one maps points in the source object to a 3D space
3808  * positioning at target. This allows rotation, perspective, scale and
3809  * lots of other effects, depending on the map that is used.
3810  *
3811  * Each map point may carry a multiplier color. If properly
3812  * calculated, these can do shading effects on the object, producing
3813  * 3D effects.
3814  *
3815  * As usual, Evas provides both the raw and easy to use methods. The
3816  * raw methods allow developer to create its maps somewhere else,
3817  * maybe load them from some file format. The easy to use methods,
3818  * calculate the points given some high-level parameters, such as
3819  * rotation angle, ambient light and so on.
3820  *
3821  * @note applying mapping will reduce performance, so use with
3822  *       care. The impact on performance depends on engine in
3823  *       use. Software is quite optimized, but not as fast as OpenGL.
3824  *
3825  * Examples:
3826  * @li @ref Example_Evas_Map_Overview
3827  *
3828  * @ingroup Evas_Object_Group
3829  *
3830  * @{
3831  */
3832
3833 /**
3834  * Enable or disable the map that is set.
3835  *
3836  * Enable or disable the use of map for the object @p obj.
3837  * On enable, the object geometry will be saved, and the new geometry will
3838  * change (position and size) to reflect the map geometry set.
3839  *
3840  * If the object doesn't have a map set (with evas_object_map_set()), the
3841  * initial geometry will be undefined. It is adviced to always set a map
3842  * to the object first, and then call this function to enable its use.
3843  *
3844  * @param obj object to enable the map on
3845  * @param enabled enabled state
3846  */
3847 EAPI void              evas_object_map_enable_set        (Evas_Object *obj, Eina_Bool enabled);
3848
3849 /**
3850  * Get the map enabled state
3851  *
3852  * This returns the currently enabled state of the map on the object indicated.
3853  * The default map enable state is off. You can enable and disable it with
3854  * evas_object_map_enable_set().
3855  *
3856  * @param obj object to get the map enabled state from
3857  * @return the map enabled state
3858  */
3859 EAPI Eina_Bool         evas_object_map_enable_get        (const Evas_Object *obj);
3860
3861 /**
3862  * Set the map source object
3863  *
3864  * This sets the object from which the map is taken - can be any object that
3865  * has map enabled on it.
3866  *
3867  * Currently not implemented. for future use.
3868  *
3869  * @param obj object to set the map source of
3870  * @param src the source object from which the map is taken
3871  */
3872 EAPI void              evas_object_map_source_set        (Evas_Object *obj, Evas_Object *src);
3873
3874 /**
3875  * Get the map source object
3876  *
3877  * @param obj object to set the map source of
3878  * @return the object set as the source
3879  *
3880  * @see evas_object_map_source_set()
3881  */
3882 EAPI Evas_Object      *evas_object_map_source_get        (const Evas_Object *obj);
3883
3884 /**
3885  * Set current object transformation map.
3886  *
3887  * This sets the map on a given object. It is copied from the @p map pointer,
3888  * so there is no need to keep the @p map object if you don't need it anymore.
3889  *
3890  * A map is a set of 4 points which have canvas x, y coordinates per point,
3891  * with an optional z point value as a hint for perspective correction, if it
3892  * is available. As well each point has u and v coordinates. These are like
3893  * "texture coordinates" in OpenGL in that they define a point in the source
3894  * image that is mapped to that map vertex/point. The u corresponds to the x
3895  * coordinate of this mapped point and v, the y coordinate. Note that these
3896  * coordinates describe a bounding region to sample. If you have a 200x100
3897  * source image and want to display it at 200x100 with proper pixel
3898  * precision, then do:
3899  *
3900  * @code
3901  * Evas_Map *m = evas_map_new(4);
3902  * evas_map_point_coord_set(m, 0,   0,   0, 0);
3903  * evas_map_point_coord_set(m, 1, 200,   0, 0);
3904  * evas_map_point_coord_set(m, 2, 200, 100, 0);
3905  * evas_map_point_coord_set(m, 3,   0, 100, 0);
3906  * evas_map_point_image_uv_set(m, 0,   0,   0);
3907  * evas_map_point_image_uv_set(m, 1, 200,   0);
3908  * evas_map_point_image_uv_set(m, 2, 200, 100);
3909  * evas_map_point_image_uv_set(m, 3,   0, 100);
3910  * evas_object_map_set(obj, m);
3911  * evas_map_free(m);
3912  * @endcode
3913  *
3914  * Note that the map points a uv coordinates match the image geometry. If
3915  * the @p map parameter is NULL, the stored map will be freed and geometry
3916  * prior to enabling/setting a map will be restored.
3917  *
3918  * @param obj object to change transformation map
3919  * @param map new map to use
3920  *
3921  * @see evas_map_new()
3922  */
3923 EAPI void              evas_object_map_set               (Evas_Object *obj, const Evas_Map *map);
3924
3925 /**
3926  * Get current object transformation map.
3927  *
3928  * This returns the current internal map set on the indicated object. It is
3929  * intended for read-only acces and is only valid as long as the object is
3930  * not deleted or the map on the object is not changed. If you wish to modify
3931  * the map and set it back do the following:
3932  *
3933  * @code
3934  * const Evas_Map *m = evas_object_map_get(obj);
3935  * Evas_Map *m2 = evas_map_dup(m);
3936  * evas_map_util_rotate(m2, 30.0, 0, 0);
3937  * evas_object_map_set(obj);
3938  * evas_map_free(m2);
3939  * @endcode
3940  *
3941  * @param obj object to query transformation map.
3942  * @return map reference to map in use. This is an internal data structure, so
3943  * do not modify it.
3944  *
3945  * @see evas_object_map_set()
3946  */
3947 EAPI const Evas_Map   *evas_object_map_get               (const Evas_Object *obj);
3948
3949
3950 /**
3951  * Populate source and destination map points to match exactly object.
3952  *
3953  * Usually one initialize map of an object to match it's original
3954  * position and size, then transform these with evas_map_util_*
3955  * functions, such as evas_map_util_rotate() or
3956  * evas_map_util_3d_rotate(). The original set is done by this
3957  * function, avoiding code duplication all around.
3958  *
3959  * @param m map to change all 4 points (must be of size 4).
3960  * @param obj object to use unmapped geometry to populate map coordinates.
3961  * @param z Point Z Coordinate hint (pre-perspective transform). This value
3962  *        will be used for all four points.
3963  *
3964  * @see evas_map_util_points_populate_from_object()
3965  * @see evas_map_point_coord_set()
3966  * @see evas_map_point_image_uv_set()
3967  */
3968 EAPI void              evas_map_util_points_populate_from_object_full(Evas_Map *m, const Evas_Object *obj, Evas_Coord z);
3969
3970 /**
3971  * Populate source and destination map points to match exactly object.
3972  *
3973  * Usually one initialize map of an object to match it's original
3974  * position and size, then transform these with evas_map_util_*
3975  * functions, such as evas_map_util_rotate() or
3976  * evas_map_util_3d_rotate(). The original set is done by this
3977  * function, avoiding code duplication all around.
3978  *
3979  * Z Point coordinate is assumed as 0 (zero).
3980  *
3981  * @param m map to change all 4 points (must be of size 4).
3982  * @param obj object to use unmapped geometry to populate map coordinates.
3983  *
3984  * @see evas_map_util_points_populate_from_object_full()
3985  * @see evas_map_util_points_populate_from_geometry()
3986  * @see evas_map_point_coord_set()
3987  * @see evas_map_point_image_uv_set()
3988  */
3989 EAPI void              evas_map_util_points_populate_from_object     (Evas_Map *m, const Evas_Object *obj);
3990
3991 /**
3992  * Populate source and destination map points to match given geometry.
3993  *
3994  * Similar to evas_map_util_points_populate_from_object_full(), this
3995  * call takes raw values instead of querying object's unmapped
3996  * geometry. The given width will be used to calculate destination
3997  * points (evas_map_point_coord_set()) and set the image uv
3998  * (evas_map_point_image_uv_set()).
3999  *
4000  * @param m map to change all 4 points (must be of size 4).
4001  * @param x Point X Coordinate
4002  * @param y Point Y Coordinate
4003  * @param w width to use to calculate second and third points.
4004  * @param h height to use to calculate third and fourth points.
4005  * @param z Point Z Coordinate hint (pre-perspective transform). This value
4006  *        will be used for all four points.
4007  *
4008  * @see evas_map_util_points_populate_from_object()
4009  * @see evas_map_point_coord_set()
4010  * @see evas_map_point_image_uv_set()
4011  */
4012 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);
4013
4014 /**
4015  * Set color of all points to given color.
4016  *
4017  * This call is useful to reuse maps after they had 3d lightning or
4018  * any other colorization applied before.
4019  *
4020  * @param m map to change the color of.
4021  * @param r red (0 - 255)
4022  * @param g green (0 - 255)
4023  * @param b blue (0 - 255)
4024  * @param a alpha (0 - 255)
4025  *
4026  * @see evas_map_point_color_set()
4027  */
4028 EAPI void              evas_map_util_points_color_set                (Evas_Map *m, int r, int g, int b, int a);
4029
4030 /**
4031  * Change the map to apply the given rotation.
4032  *
4033  * This rotates the indicated map's coordinates around the center coordinate
4034  * given by @p cx and @p cy as the rotation center. The points will have their
4035  * X and Y coordinates rotated clockwise by @p degrees degress (360.0 is a
4036  * full rotation). Negative values for degrees will rotate counter-clockwise
4037  * by that amount. All coordinates are canvas global coordinates.
4038  *
4039  * @param m map to change.
4040  * @param degrees amount of degrees from 0.0 to 360.0 to rotate.
4041  * @param cx rotation's center horizontal position.
4042  * @param cy rotation's center vertical position.
4043  *
4044  * @see evas_map_point_coord_set()
4045  * @see evas_map_util_zoom()
4046  */
4047 EAPI void              evas_map_util_rotate                          (Evas_Map *m, double degrees, Evas_Coord cx, Evas_Coord cy);
4048
4049 /**
4050  * Change the map to apply the given zooming.
4051  *
4052  * Like evas_map_util_rotate(), this zooms the points of the map from a center
4053  * point. That center is defined by @p cx and @p cy. The @p zoomx and @p zoomy
4054  * parameters specify how much to zoom in the X and Y direction respectively.
4055  * A value of 1.0 means "don't zoom". 2.0 means "dobule the size". 0.5 is
4056  * "half the size" etc. All coordinates are canvas global coordinates.
4057  *
4058  * @param m map to change.
4059  * @param zoomx horizontal zoom to use.
4060  * @param zoomy vertical zoom to use.
4061  * @param cx zooming center horizontal position.
4062  * @param cy zooming center vertical position.
4063  *
4064  * @see evas_map_point_coord_set()
4065  * @see evas_map_util_rotate()
4066  */
4067 EAPI void              evas_map_util_zoom                            (Evas_Map *m, double zoomx, double zoomy, Evas_Coord cx, Evas_Coord cy);
4068
4069 /**
4070  * Rotate the map around 3 axes in 3D
4071  *
4072  * This will rotate not just around the "Z" axis as in evas_map_util_rotate()
4073  * (which is a convenience call for those only wanting 2D). This will rotate
4074  * around the X, Y and Z axes. The Z axis points "into" the screen with low
4075  * values at the screen and higher values further away. The X axis runs from
4076  * left to right on the screen and the Y axis from top to bottom. Like with
4077  * evas_map_util_rotate() you provide a center point to rotate around (in 3D).
4078  *
4079  * @param m map to change.
4080  * @param dx amount of degrees from 0.0 to 360.0 to rotate arount X axis.
4081  * @param dy amount of degrees from 0.0 to 360.0 to rotate arount Y axis.
4082  * @param dz amount of degrees from 0.0 to 360.0 to rotate arount Z axis.
4083  * @param cx rotation's center horizontal position.
4084  * @param cy rotation's center vertical position.
4085  * @param cz rotation's center vertical position.
4086  */
4087 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);
4088
4089 /**
4090  * Perform lighting calculations on the given Map
4091  *
4092  * This is used to apply lighting calculations (from a single light source)
4093  * to a given map. The R, G and B values of each vertex will be modified to
4094  * reflect the lighting based on the lixth point coordinates, the light
4095  * color and the ambient color, and at what angle the map is facing the
4096  * light source. A surface should have its points be declared in a
4097  * clockwise fashion if the face is "facing" towards you (as opposed to
4098  * away from you) as faces have a "logical" side for lighting.
4099  *
4100  * @param m map to change.
4101  * @param lx X coordinate in space of light point
4102  * @param ly Y coordinate in space of light point
4103  * @param lz Z coordinate in space of light point
4104  * @param lr light red value (0 - 255)
4105  * @param lg light green value (0 - 255)
4106  * @param lb light blue value (0 - 255)
4107  * @param ar ambient color red value (0 - 255)
4108  * @param ag ambient color green value (0 - 255)
4109  * @param ab ambient color blue value (0 - 255)
4110  */
4111 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);
4112
4113 /**
4114  * Apply a perspective transform to the map
4115  *
4116  * This applies a given perspective (3D) to the map coordinates. X, Y and Z
4117  * values are used. The px and py points specify the "infinite distance" point
4118  * in the 3D conversion (where all lines converge to like when artists draw
4119  * 3D by hand). The @p z0 value specifis the z value at which there is a 1:1
4120  * mapping between spatial coorinates and screen coordinates. Any points
4121  * on this z value will not have their X and Y values modified in the transform.
4122  * Those further away (Z value higher) will shrink into the distance, and
4123  * those less than this value will expand and become bigger. The @p foc value
4124  * determines the "focal length" of the camera. This is in reality the distance
4125  * between the camera lens plane itself (at or closer than this rendering
4126  * results are undefined) and the "z0" z value. This allows for some "depth"
4127  * control and @p foc must be greater than 0.
4128  *
4129  * @param m map to change.
4130  * @param px The pespective distance X coordinate
4131  * @param py The pespective distance Y coordinate
4132  * @param z0 The "0" z plane value
4133  * @param foc The focal distance
4134  */
4135 EAPI void              evas_map_util_3d_perspective                  (Evas_Map *m, Evas_Coord px, Evas_Coord py, Evas_Coord z0, Evas_Coord foc);
4136
4137 /**
4138  * Get the clockwise state of a map
4139  *
4140  * This determines if the output points (X and Y. Z is not used) are
4141  * clockwise or anti-clockwise. This can be used for "back-face culling". This
4142  * is where you hide objects that "face away" from you. In this case objects
4143  * that are not clockwise.
4144  *
4145  * @param m map to query.
4146  * @return 1 if clockwise, 0 otherwise
4147  */
4148 EAPI Eina_Bool         evas_map_util_clockwise_get                   (Evas_Map *m);
4149
4150
4151 /**
4152  * Create map of transformation points to be later used with an Evas object.
4153  *
4154  * This creates a set of points (currently only 4 is supported. no other
4155  * number for @p count will work). That is empty and ready to be modified
4156  * with evas_map calls.
4157  *
4158  * @param count number of points in the map.
4159  * @return a newly allocated map or @c NULL on errors.
4160  *
4161  * @see evas_map_free()
4162  * @see evas_map_dup()
4163  * @see evas_map_point_coord_set()
4164  * @see evas_map_point_image_uv_set()
4165  * @see evas_map_util_points_populate_from_object_full()
4166  * @see evas_map_util_points_populate_from_object()
4167  *
4168  * @see evas_object_map_set()
4169  */
4170 EAPI Evas_Map         *evas_map_new                      (int count);
4171
4172 /**
4173  * Set the smoothing for map rendering
4174  *
4175  * This sets smoothing for map rendering. If the object is a type that has
4176  * its own smoothing settings, then both the smooth settings for this object
4177  * and the map must be turned off. By default smooth maps are enabled.
4178  *
4179  * @param m map to modify. Must not be NULL.
4180  * @param enabled enable or disable smooth map rendering
4181  */
4182 EAPI void              evas_map_smooth_set               (Evas_Map *m, Eina_Bool enabled);
4183
4184 /**
4185  * get the smoothing for map rendering
4186  *
4187  * This gets smoothing for map rendering.
4188  *
4189  * @param m map to get the smooth from. Must not be NULL.
4190  */
4191 EAPI Eina_Bool         evas_map_smooth_get               (const Evas_Map *m);
4192
4193 /**
4194  * Set the alpha flag for map rendering
4195  *
4196  * This sets alpha flag for map rendering. If the object is a type that has
4197  * its own alpha settings, then this will take precedence. Only image objects
4198  * have this currently.
4199  * Setting this off stops alpha blending of the map area, and is
4200  * useful if you know the object and/or all sub-objects is 100% solid.
4201  *
4202  * @param m map to modify. Must not be NULL.
4203  * @param enabled enable or disable alpha map rendering
4204  */
4205 EAPI void              evas_map_alpha_set                (Evas_Map *m, Eina_Bool enabled);
4206
4207 /**
4208  * get the alpha flag for map rendering
4209  *
4210  * This gets the alph flag for map rendering.
4211  *
4212  * @param m map to get the alpha from. Must not be NULL.
4213  */
4214 EAPI Eina_Bool         evas_map_alpha_get                (const Evas_Map *m);
4215
4216 /**
4217  * Copy a previously allocated map.
4218  *
4219  * This makes a duplicate of the @p m object and returns it.
4220  *
4221  * @param m map to copy. Must not be NULL.
4222  * @return newly allocated map with the same count and contents as @p m.
4223  */
4224 EAPI Evas_Map         *evas_map_dup                      (const Evas_Map *m);
4225
4226 /**
4227  * Free a previously allocated map.
4228  *
4229  * This frees a givem map @p m and all memory associated with it. You must NOT
4230  * free a map returned by evas_object_map_get() as this is internal.
4231  *
4232  * @param m map to free.
4233  */
4234 EAPI void              evas_map_free                     (Evas_Map *m);
4235
4236 /**
4237  * Get a maps size.
4238  *
4239  * Returns the number of points in a map.  Should be at least 4.
4240  *
4241  * @param m map to get size.
4242  * @return -1 on error, points otherwise.
4243  */
4244 EAPI int               evas_map_count_get               (const Evas_Map *m) EINA_CONST;
4245
4246 /**
4247  * Change the map point's coordinate.
4248  *
4249  * This sets the fixed point's coordinate in the map. Note that points
4250  * describe the outline of a quadrangle and are ordered either clockwise
4251  * or anit-clock-wise. It is suggested to keep your quadrangles concave and
4252  * non-complex, though these polygon modes may work, they may not render
4253  * a desired set of output. The quadrangle will use points 0 and 1 , 1 and 2,
4254  * 2 and 3, and 3 and 0 to describe the edges of the quandrangle.
4255  *
4256  * The X and Y and Z coordinates are in canvas units. Z is optional and may
4257  * or may not be honored in drawing. Z is a hint and does not affect the
4258  * X and Y rendered coordinates. It may be used for calculating fills with
4259  * perspective correct rendering.
4260  *
4261  * Remember all coordinates are canvas global ones like with move and reize
4262  * in evas.
4263  *
4264  * @param m map to change point. Must not be @c NULL.
4265  * @param idx index of point to change. Must be smaller than map size.
4266  * @param x Point X Coordinate
4267  * @param y Point Y Coordinate
4268  * @param z Point Z Coordinate hint (pre-perspective transform)
4269  *
4270  * @see evas_map_util_rotate()
4271  * @see evas_map_util_zoom()
4272  * @see evas_map_util_points_populate_from_object_full()
4273  * @see evas_map_util_points_populate_from_object()
4274  */
4275 EAPI void              evas_map_point_coord_set          (Evas_Map *m, int idx, Evas_Coord x, Evas_Coord y, Evas_Coord z);
4276
4277 /**
4278  * Get the map point's coordinate.
4279  *
4280  * This returns the coordinates of the given point in the map.
4281  *
4282  * @param m map to query point.
4283  * @param idx index of point to query. Must be smaller than map size.
4284  * @param x where to return the X coordinate.
4285  * @param y where to return the Y coordinate.
4286  * @param z where to return the Z coordinate.
4287  */
4288 EAPI void              evas_map_point_coord_get          (const Evas_Map *m, int idx, Evas_Coord *x, Evas_Coord *y, Evas_Coord *z);
4289
4290 /**
4291  * Change the map point's U and V texture source point
4292  *
4293  * This sets the U and V coordinates for the point. This determines which
4294  * coordinate in the source image is mapped to the given point, much like
4295  * OpenGL and textures. Notes that these points do select the pixel, but
4296  * are double floating point values to allow for accuracy and sub-pixel
4297  * selection.
4298  *
4299  * @param m map to change the point of.
4300  * @param idx index of point to change. Must be smaller than map size.
4301  * @param u the X coordinate within the image/texture source
4302  * @param v the Y coordinate within the image/texture source
4303  *
4304  * @see evas_map_point_coord_set()
4305  * @see evas_object_map_set()
4306  * @see evas_map_util_points_populate_from_object_full()
4307  * @see evas_map_util_points_populate_from_object()
4308  */
4309 EAPI void              evas_map_point_image_uv_set       (Evas_Map *m, int idx, double u, double v);
4310
4311 /**
4312  * Get the map point's U and V texture source points
4313  *
4314  * This returns the texture points set by evas_map_point_image_uv_set().
4315  *
4316  * @param m map to query point.
4317  * @param idx index of point to query. Must be smaller than map size.
4318  * @param u where to write the X coordinate within the image/texture source
4319  * @param v where to write the Y coordinate within the image/texture source
4320  */
4321 EAPI void              evas_map_point_image_uv_get       (const Evas_Map *m, int idx, double *u, double *v);
4322
4323 /**
4324  * Set the color of a vertex in the map
4325  *
4326  * This sets the color of the vertex in the map. Colors will be linearly
4327  * interpolated between vertex points through the map. Color will multiply
4328  * the "texture" pixels (like GL_MODULATE in OpenGL). The default color of
4329  * a vertex in a map is white solid (255, 255, 255, 255) which means it will
4330  * have no affect on modifying the texture pixels.
4331  *
4332  * @param m map to change the color of.
4333  * @param idx index of point to change. Must be smaller than map size.
4334  * @param r red (0 - 255)
4335  * @param g green (0 - 255)
4336  * @param b blue (0 - 255)
4337  * @param a alpha (0 - 255)
4338  *
4339  * @see evas_map_util_points_color_set()
4340  * @see evas_map_point_coord_set()
4341  * @see evas_object_map_set()
4342  */
4343 EAPI void              evas_map_point_color_set          (Evas_Map *m, int idx, int r, int g, int b, int a);
4344
4345 /**
4346  * Get the color set on a vertex in the map
4347  *
4348  * This gets the color set by evas_map_point_color_set() on the given vertex
4349  * of the map.
4350  *
4351  * @param m map to get the color of the vertex from.
4352  * @param idx index of point get. Must be smaller than map size.
4353  * @param r pointer to red return
4354  * @param g pointer to green return
4355  * @param b pointer to blue return
4356  * @param a pointer to alpha return (0 - 255)
4357  *
4358  * @see evas_map_point_coord_set()
4359  * @see evas_object_map_set()
4360  */
4361 EAPI void              evas_map_point_color_get          (const Evas_Map *m, int idx, int *r, int *g, int *b, int *a);
4362 /**
4363  * @}
4364  */
4365
4366 /**
4367  * @defgroup Evas_Object_Group_Size_Hints Size Hints
4368  *
4369  * Objects may carry hints, so that another object that acts as a
4370  * manager (see @ref Evas_Smart_Object_Group) may know how to properly
4371  * position and resize its subordinate objects. The Size Hints provide
4372  * a common interface that is recommended as the protocol for such
4373  * information.
4374  *
4375  * For example, box objects use alignment hints to align its
4376  * lines/columns inside its container, padding hints to set the
4377  * padding between each individual child, etc.
4378  *
4379  * Examples on their usage:
4380  * - @ref Example_Evas_Size_Hints "evas-hints.c"
4381  * - @ref Example_Evas_Aspect_Hints "evas-aspect-hints.c"
4382  *
4383  * @ingroup Evas_Object_Group
4384  */
4385
4386 /**
4387  * @addtogroup Evas_Object_Group_Size_Hints
4388  * @{
4389  */
4390
4391 /**
4392  * Retrieves the hints for an object's minimum size.
4393  *
4394  * @param obj The given Evas object to query hints from.
4395  * @param w Pointer to an integer in which to store the minimum width.
4396  * @param h Pointer to an integer in which to store the minimum height.
4397  *
4398  * These are hints on the minimim sizes @p obj should have. This is
4399  * not a size enforcement in any way, it's just a hint that should be
4400  * used whenever appropriate.
4401  *
4402  * @note Use @c NULL pointers on the hint components you're not
4403  * interested in: they'll be ignored by the function.
4404  *
4405  * @see evas_object_size_hint_min_set() for an example
4406  */
4407 EAPI void              evas_object_size_hint_min_get     (const Evas_Object *obj, Evas_Coord *w, Evas_Coord *h) EINA_ARG_NONNULL(1);
4408
4409 /**
4410  * Sets the hints for an object's minimum size.
4411  *
4412  * @param obj The given Evas object to query hints from.
4413  * @param w Integer to use as the minimum width hint.
4414  * @param h Integer to use as the minimum height hint.
4415  *
4416  * This is not a size enforcement in any way, it's just a hint that
4417  * should be used whenever appropriate.
4418  *
4419  * Values @c 0 will be treated as unset hint components, when queried
4420  * by managers.
4421  *
4422  * Example:
4423  * @dontinclude evas-hints.c
4424  * @skip evas_object_size_hint_min_set
4425  * @until return
4426  *
4427  * In this example the minimum size hints change de behavior of an
4428  * Evas box when layouting its children. See the full @ref
4429  * Example_Evas_Size_Hints "example".
4430  *
4431  * @see evas_object_size_hint_min_get()
4432  */
4433 EAPI void              evas_object_size_hint_min_set     (Evas_Object *obj, Evas_Coord w, Evas_Coord h) EINA_ARG_NONNULL(1);
4434
4435 /**
4436  * Retrieves the hints for an object's maximum size.
4437  *
4438  * @param obj The given Evas object to query hints from.
4439  * @param w Pointer to an integer in which to store the maximum width.
4440  * @param h Pointer to an integer in which to store the maximum height.
4441  *
4442  * These are hints on the maximum sizes @p obj should have. This is
4443  * not a size enforcement in any way, it's just a hint that should be
4444  * used whenever appropriate.
4445  *
4446  * @note Use @c NULL pointers on the hint components you're not
4447  * interested in: they'll be ignored by the function.
4448  *
4449  * @see evas_object_size_hint_max_set()
4450  */
4451 EAPI void              evas_object_size_hint_max_get     (const Evas_Object *obj, Evas_Coord *w, Evas_Coord *h) EINA_ARG_NONNULL(1);
4452
4453 /**
4454  * Sets the hints for an object's maximum size.
4455  *
4456  * @param obj The given Evas object to query hints from.
4457  * @param w Integer to use as the maximum width hint.
4458  * @param h Integer to use as the maximum height hint.
4459  *
4460  * This is not a size enforcement in any way, it's just a hint that
4461  * should be used whenever appropriate.
4462  *
4463  * Values @c -1 will be treated as unset hint components, when queried
4464  * by managers.
4465  *
4466  * Example:
4467  * @dontinclude evas-hints.c
4468  * @skip evas_object_size_hint_max_set
4469  * @until return
4470  *
4471  * In this example the maximum size hints change de behavior of an
4472  * Evas box when layouting its children. See the full @ref
4473  * Example_Evas_Size_Hints "example".
4474  *
4475  * @see evas_object_size_hint_max_get()
4476  */
4477 EAPI void              evas_object_size_hint_max_set     (Evas_Object *obj, Evas_Coord w, Evas_Coord h) EINA_ARG_NONNULL(1);
4478
4479 /**
4480  * Retrieves the hints for an object's optimum size.
4481  *
4482  * @param obj The given Evas object to query hints from.
4483  * @param w Pointer to an integer in which to store the requested width.
4484  * @param h Pointer to an integer in which to store the requested height.
4485  *
4486  * These are hints on the optimum sizes @p obj should have. This is
4487  * not a size enforcement in any way, it's just a hint that should be
4488  * used whenever appropriate.
4489  *
4490  * @note Use @c NULL pointers on the hint components you're not
4491  * interested in: they'll be ignored by the function.
4492  *
4493  * @see evas_object_size_hint_request_set()
4494  */
4495 EAPI void              evas_object_size_hint_request_get (const Evas_Object *obj, Evas_Coord *w, Evas_Coord *h) EINA_ARG_NONNULL(1);
4496
4497 /**
4498  * Sets the hints for an object's optimum size.
4499  *
4500  * @param obj The given Evas object to query hints from.
4501  * @param w Integer to use as the preferred width hint.
4502  * @param h Integer to use as the preferred height hint.
4503  *
4504  * This is not a size enforcement in any way, it's just a hint that
4505  * should be used whenever appropriate.
4506  *
4507  * Values @c 0 will be treated as unset hint components, when queried
4508  * by managers.
4509  *
4510  * @see evas_object_size_hint_request_get()
4511  */
4512 EAPI void              evas_object_size_hint_request_set (Evas_Object *obj, Evas_Coord w, Evas_Coord h) EINA_ARG_NONNULL(1);
4513
4514 /**
4515  * Retrieves the hints for an object's aspect ratio.
4516  *
4517  * @param obj The given Evas object to query hints from.
4518  * @param aspect Returns the policy/type of aspect ratio applied to @p obj.
4519  * @param w Pointer to an integer in which to store the aspect's width
4520  * ratio term.
4521  * @param h Pointer to an integer in which to store the aspect's
4522  * height ratio term.
4523  *
4524  * The different aspect ratio policies are documented in the
4525  * #Evas_Aspect_Control type. A container respecting these size hints
4526  * would @b scale its children accordingly to those policies.
4527  *
4528  * For any policy, if any of the given aspect ratio terms are @c 0,
4529  * the object's container should ignore the aspect and scale @p obj to
4530  * occupy the whole available area. If they are both positive
4531  * integers, that proportion will be respected, under each scaling
4532  * policy.
4533  *
4534  * These images illustrate some of the #Evas_Aspect_Control policies:
4535  *
4536  * @image html any-policy.png
4537  * @image rtf any-policy.png
4538  * @image latex any-policy.eps
4539  *
4540  * @image html aspect-control-none-neither.png
4541  * @image rtf aspect-control-none-neither.png
4542  * @image latex aspect-control-none-neither.eps
4543  *
4544  * @image html aspect-control-both.png
4545  * @image rtf aspect-control-both.png
4546  * @image latex aspect-control-both.eps
4547  *
4548  * @image html aspect-control-horizontal.png
4549  * @image rtf aspect-control-horizontal.png
4550  * @image latex aspect-control-horizontal.eps
4551  *
4552  * This is not a size enforcement in any way, it's just a hint that
4553  * should be used whenever appropriate.
4554  *
4555  * @note Use @c NULL pointers on the hint components you're not
4556  * interested in: they'll be ignored by the function.
4557  *
4558  * Example:
4559  * @dontinclude evas-aspect-hints.c
4560  * @skip if (strcmp(ev->keyname, "c") == 0)
4561  * @until }
4562  *
4563  * See the full @ref Example_Evas_Aspect_Hints "example".
4564  *
4565  * @see evas_object_size_hint_aspect_set()
4566  */
4567 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);
4568
4569 /**
4570  * Sets the hints for an object's aspect ratio.
4571  *
4572  * @param obj The given Evas object to query hints from.
4573  * @param aspect The policy/type of aspect ratio to apply to @p obj.
4574  * @param w Integer to use as aspect width ratio term.
4575  * @param h Integer to use as aspect height ratio term.
4576  *
4577  * This is not a size enforcement in any way, it's just a hint that should
4578  * be used whenever appropriate.
4579  *
4580  * If any of the given aspect ratio terms are @c 0,
4581  * the object's container will ignore the aspect and scale @p obj to
4582  * occupy the whole available area, for any given policy.
4583  *
4584  * @see evas_object_size_hint_aspect_get() for more information.
4585  */
4586 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);
4587
4588 /**
4589  * Retrieves the hints for on object's alignment.
4590  *
4591  * @param obj The given Evas object to query hints from.
4592  * @param x Pointer to a double in which to store the horizontal
4593  * alignment hint.
4594  * @param y Pointer to a double in which to store the vertical
4595  * alignment hint.
4596  *
4597  * This is not a size enforcement in any way, it's just a hint that
4598  * should be used whenever appropriate.
4599  *
4600  * @note Use @c NULL pointers on the hint components you're not
4601  * interested in: they'll be ignored by the function.
4602  *
4603  * @see evas_object_size_hint_align_set() for more information
4604  */
4605 EAPI void              evas_object_size_hint_align_get   (const Evas_Object *obj, double *x, double *y) EINA_ARG_NONNULL(1);
4606
4607 /**
4608  * Sets the hints for an object's alignment.
4609  *
4610  * @param obj The given Evas object to query hints from.
4611  * @param x Double, ranging from @c 0.0 to @c 1.0 or with the
4612  * special value #EVAS_HINT_FILL, to use as horizontal alignment hint.
4613  * @param y Double, ranging from @c 0.0 to @c 1.0 or with the
4614  * special value #EVAS_HINT_FILL, to use as vertical alignment hint.
4615  *
4616  * These are hints on how to align an object <b>inside the boundaries
4617  * of a container/manager</b>. Accepted values are in the @c 0.0 to @c
4618  * 1.0 range, with the special value #EVAS_HINT_FILL used to specify
4619  * "justify" or "fill" by some users. See documentation of possible
4620  * users: in Evas, they are the @ref Evas_Object_Box "box" and @ref
4621  * Evas_Object_Table "table" smart objects.
4622  *
4623  * For the horizontal component, @c 0.0 means to the left, @c 1.0
4624  * means to the right. Analogously, for the vertical component, @c 0.0
4625  * to the top, @c 1.0 means to the bottom.
4626  *
4627  * See the following figure:
4628  * @image html alignment-hints.png
4629  * @image rtf alignment-hints.png
4630  * @image latex alignment-hints.eps
4631  *
4632  * This is not a size enforcement in any way, it's just a hint that
4633  * should be used whenever appropriate.
4634  *
4635  * Example:
4636  * @dontinclude evas-hints.c
4637  * @skip evas_object_size_hint_align_set
4638  * @until return
4639  *
4640  * In this example the alignment hints change de behavior of an Evas
4641  * box when layouting its children. See the full @ref
4642  * Example_Evas_Size_Hints "example".
4643  *
4644  * @see evas_object_size_hint_align_get()
4645  */
4646 EAPI void              evas_object_size_hint_align_set   (Evas_Object *obj, double x, double y) EINA_ARG_NONNULL(1);
4647
4648 /**
4649  * Retrieves the hints for an object's weight.
4650  *
4651  * @param obj The given Evas object to query hints from.
4652  * @param x Pointer to a double in which to store the horizontal weight.
4653  * @param y Pointer to a double in which to store the vertical weight.
4654  *
4655  * Accepted values are zero or positive values. Some users might use
4656  * this hint as a boolean, but some might consider it as a @b
4657  * proportion, see documentation of possible users, which in Evas are
4658  * the @ref Evas_Object_Box "box" and @ref Evas_Object_Table "table"
4659  * smart objects.
4660  *
4661  * This is not a size enforcement in any way, it's just a hint that
4662  * should be used whenever appropriate.
4663  *
4664  * @note Use @c NULL pointers on the hint components you're not
4665  * interested in: they'll be ignored by the function.
4666  *
4667  * @see evas_object_size_hint_weight_set() for an example
4668  */
4669 EAPI void              evas_object_size_hint_weight_get  (const Evas_Object *obj, double *x, double *y) EINA_ARG_NONNULL(1);
4670
4671 /**
4672  * Sets the hints for an object's weight.
4673  *
4674  * @param obj The given Evas object to query hints from.
4675  * @param x Double (@c 0.0-1.0) to use as horizontal weight hint.
4676  * @param y Double (@c 0.0-1.0) to use as vertical weight hint.
4677  *
4678  * This is not a size enforcement in any way, it's just a hint that should
4679  * be used whenever appropriate.
4680  *
4681  * Example:
4682  * @dontinclude evas-hints.c
4683  * @skip evas_object_size_hint_weight_set
4684  * @until return
4685  *
4686  * In this example the weight hints change de behavior of an Evas box
4687  * when layouting its children. See the full @ref
4688  * Example_Evas_Size_Hints "example".
4689  *
4690  * @see evas_object_size_hint_weight_get() for more information
4691  */
4692 EAPI void              evas_object_size_hint_weight_set  (Evas_Object *obj, double x, double y) EINA_ARG_NONNULL(1);
4693
4694 /**
4695  * Retrieves the hints for an object's padding space.
4696  *
4697  * @param obj The given Evas object to query hints from.
4698  * @param l Pointer to an integer in which to store left padding.
4699  * @param r Pointer to an integer in which to store right padding.
4700  * @param t Pointer to an integer in which to store top padding.
4701  * @param b Pointer to an integer in which to store bottom padding.
4702  *
4703  * Padding is extra space an object takes on each of its delimiting
4704  * rectangle sides, in canvas units. This space will be rendered
4705  * transparent, naturally.
4706  *
4707  * This is not a size enforcement in any way, it's just a hint that
4708  * should be used whenever appropriate.
4709  *
4710  * @note Use @c NULL pointers on the hint components you're not
4711  * interested in: they'll be ignored by the function.
4712  *
4713  * Example:
4714  * @dontinclude evas-hints.c
4715  * @skip evas_object_size_hint_padding_set
4716  * @until return
4717  *
4718  * In this example the padding hints change de behavior of an Evas box
4719  * when layouting its children. See the full @ref
4720  * Example_Evas_Size_Hints "example".
4721  *
4722  * @see evas_object_size_hint_padding_set()
4723  */
4724 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);
4725
4726 /**
4727  * Sets the hints for an object's padding space.
4728  *
4729  * @param obj The given Evas object to query hints from.
4730  * @param l Integer to specify left padding.
4731  * @param r Integer to specify right padding.
4732  * @param t Integer to specify top padding.
4733  * @param b Integer to specify bottom padding.
4734  *
4735  * This is not a size enforcement in any way, it's just a hint that
4736  * should be used whenever appropriate.
4737  *
4738  * @see evas_object_size_hint_padding_get() for more information
4739  */
4740 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);
4741
4742 /**
4743  * @}
4744  */
4745
4746 /**
4747  * @defgroup Evas_Object_Group_Extras Extra Object Manipulation
4748  *
4749  * Miscellaneous functions that also apply to any object, but are less
4750  * used or not implemented by all objects.
4751  *
4752  * Examples on this group of functions can be found @ref
4753  * Example_Evas_Stacking "here" and @ref Example_Evas_Events "here".
4754  *
4755  * @ingroup Evas_Object_Group
4756  */
4757
4758 /**
4759  * @addtogroup Evas_Object_Group_Extras
4760  * @{
4761  */
4762
4763 /**
4764  * Set an attached data pointer to an object with a given string key.
4765  *
4766  * @param obj The object to attach the data pointer to
4767  * @param key The string key for the data to access it
4768  * @param data The ponter to the data to be attached
4769  *
4770  * This attaches the pointer @p data to the object @p obj, given the
4771  * access string @p key. This pointer will stay "hooked" to the object
4772  * until a new pointer with the same string key is attached with
4773  * evas_object_data_set() or it is deleted with
4774  * evas_object_data_del(). On deletion of the object @p obj, the
4775  * pointers will not be accessible from the object anymore.
4776  *
4777  * You can find the pointer attached under a string key using
4778  * evas_object_data_get(). It is the job of the calling application to
4779  * free any data pointed to by @p data when it is no longer required.
4780  *
4781  * If @p data is @c NULL, the old value stored at @p key will be
4782  * removed but no new value will be stored. This is synonymous with
4783  * calling evas_object_data_del() with @p obj and @p key.
4784  *
4785  * @note This function is very handy when you have data associated
4786  * specifically to an Evas object, being of use only when dealing with
4787  * it. Than you don't have the burden to a pointer to it elsewhere,
4788  * using this family of functions.
4789  *
4790  * Example:
4791  *
4792  * @code
4793  * int *my_data;
4794  * extern Evas_Object *obj;
4795  *
4796  * my_data = malloc(500);
4797  * evas_object_data_set(obj, "name_of_data", my_data);
4798  * printf("The data that was attached was %p\n", evas_object_data_get(obj, "name_of_data"));
4799  * @endcode
4800  */
4801 EAPI void                      evas_object_data_set             (Evas_Object *obj, const char *key, const void *data) EINA_ARG_NONNULL(1, 2);
4802
4803 /**
4804  * Return an attached data pointer on an Evas object by its given
4805  * string key.
4806  *
4807  * @param obj The object to which the data was attached
4808  * @param key The string key the data was stored under
4809  * @return The data pointer stored, or @c NULL if none was stored
4810  *
4811  * This function will return the data pointer attached to the object
4812  * @p obj, stored using the string key @p key. If the object is valid
4813  * and a data pointer was stored under the given key, that pointer
4814  * will be returned. If this is not the case, @c NULL will be
4815  * returned, signifying an invalid object or a non-existent key. It is
4816  * possible that a @c NULL pointer was stored given that key, but this
4817  * situation is non-sensical and thus can be considered an error as
4818  * well. @c NULL pointers are never stored as this is the return value
4819  * if an error occurs.
4820  *
4821  * Example:
4822  *
4823  * @code
4824  * int *my_data;
4825  * extern Evas_Object *obj;
4826  *
4827  * my_data = evas_object_data_get(obj, "name_of_my_data");
4828  * if (my_data) printf("Data stored was %p\n", my_data);
4829  * else printf("No data was stored on the object\n");
4830  * @endcode
4831  */
4832 EAPI void                     *evas_object_data_get             (const Evas_Object *obj, const char *key) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2) EINA_PURE;
4833
4834 /**
4835  * Delete an attached data pointer from an object.
4836  *
4837  * @param obj The object to delete the data pointer from
4838  * @param key The string key the data was stored under
4839  * @return The original data pointer stored at @p key on @p obj
4840  *
4841  * This will remove the stored data pointer from @p obj stored under
4842  * @p key and return this same pointer, if actually there was data
4843  * there, or @c NULL, if nothing was stored under that key.
4844  *
4845  * Example:
4846  *
4847  * @code
4848  * int *my_data;
4849  * extern Evas_Object *obj;
4850  *
4851  * my_data = evas_object_data_del(obj, "name_of_my_data");
4852  * @endcode
4853  */
4854 EAPI void                     *evas_object_data_del             (Evas_Object *obj, const char *key) EINA_ARG_NONNULL(1, 2);
4855
4856
4857 /**
4858  * Set pointer behavior.
4859  *
4860  * @param obj
4861  * @param setting desired behavior.
4862  *
4863  * This function has direct effect on event callbacks related to
4864  * mouse.
4865  *
4866  * If @p setting is EVAS_OBJECT_POINTER_MODE_AUTOGRAB, then when mouse
4867  * is down at this object, events will be restricted to it as source,
4868  * mouse moves, for example, will be emitted even if outside this
4869  * object area.
4870  *
4871  * If @p setting is EVAS_OBJECT_POINTER_MODE_NOGRAB, then events will
4872  * be emitted just when inside this object area.
4873  *
4874  * The default value is EVAS_OBJECT_POINTER_MODE_AUTOGRAB.
4875  *
4876  * @ingroup Evas_Object_Group_Extras
4877  */
4878 EAPI void                      evas_object_pointer_mode_set     (Evas_Object *obj, Evas_Object_Pointer_Mode setting) EINA_ARG_NONNULL(1);
4879
4880 /**
4881  * Determine how pointer will behave.
4882  * @param obj
4883  * @return pointer behavior.
4884  * @ingroup Evas_Object_Group_Extras
4885  */
4886 EAPI Evas_Object_Pointer_Mode  evas_object_pointer_mode_get     (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
4887
4888
4889 /**
4890  * Sets whether or not the given Evas object is to be drawn anti-aliased.
4891  *
4892  * @param   obj The given Evas object.
4893  * @param   anti_alias 1 if the object is to be anti_aliased, 0 otherwise.
4894  * @ingroup Evas_Object_Group_Extras
4895  */
4896 EAPI void                      evas_object_anti_alias_set       (Evas_Object *obj, Eina_Bool antialias) EINA_ARG_NONNULL(1);
4897
4898 /**
4899  * Retrieves whether or not the given Evas object is to be drawn anti_aliased.
4900  * @param   obj The given Evas object.
4901  * @return  @c 1 if the object is to be anti_aliased.  @c 0 otherwise.
4902  * @ingroup Evas_Object_Group_Extras
4903  */
4904 EAPI Eina_Bool                 evas_object_anti_alias_get       (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
4905
4906
4907 /**
4908  * Sets the scaling factor for an Evas object. Does not affect all
4909  * objects.
4910  *
4911  * @param obj The given Evas object.
4912  * @param scale The scaling factor. <c>1.0</c> means no scaling,
4913  *        default size.
4914  *
4915  * This will multiply the object's dimension by the given factor, thus
4916  * altering its geometry (width and height). Useful when you want
4917  * scalable UI elements, possibly at run time.
4918  *
4919  * @note Only text and textblock objects have scaling change
4920  * handlers. Other objects won't change visually on this call.
4921  *
4922  * @see evas_object_scale_get()
4923  *
4924  * @ingroup Evas_Object_Group_Extras
4925  */
4926 EAPI void                      evas_object_scale_set            (Evas_Object *obj, double scale) EINA_ARG_NONNULL(1);
4927
4928 /**
4929  * Retrieves the scaling factor for the given Evas object.
4930  *
4931  * @param   obj The given Evas object.
4932  * @return  The scaling factor.
4933  *
4934  * @ingroup Evas_Object_Group_Extras
4935  *
4936  * @see evas_object_scale_set()
4937  */
4938 EAPI double                    evas_object_scale_get            (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
4939
4940
4941 /**
4942  * Sets the render_op to be used for rendering the Evas object.
4943  * @param   obj The given Evas object.
4944  * @param   render_op one of the Evas_Render_Op values.
4945  * @ingroup Evas_Object_Group_Extras
4946  */
4947 EAPI void                      evas_object_render_op_set        (Evas_Object *obj, Evas_Render_Op op) EINA_ARG_NONNULL(1);
4948
4949 /**
4950  * Retrieves the current value of the operation used for rendering the Evas object.
4951  * @param   obj The given Evas object.
4952  * @return  one of the enumerated values in Evas_Render_Op.
4953  * @ingroup Evas_Object_Group_Extras
4954  */
4955 EAPI Evas_Render_Op            evas_object_render_op_get        (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
4956
4957 /**
4958  * Set whether to use precise (usually expensive) point collision
4959  * detection for a given Evas object.
4960  *
4961  * @param obj The given object.
4962  * @param precise whether to use precise point collision detection or
4963  * not The default value is false.
4964  *
4965  * Use this function to make Evas treat objects' transparent areas as
4966  * @b not belonging to it with regard to mouse pointer events. By
4967  * default, all of the object's boundary rectangle will be taken in
4968  * account for them.
4969  *
4970  * @warning By using precise point collision detection you'll be
4971  * making Evas more resource intensive.
4972  *
4973  * Example code follows.
4974  * @dontinclude evas-events.c
4975  * @skip if (strcmp(ev->keyname, "p") == 0)
4976  * @until }
4977  *
4978  * See the full example @ref Example_Evas_Events "here".
4979  *
4980  * @see evas_object_precise_is_inside_get()
4981  * @ingroup Evas_Object_Group_Extras
4982  */
4983    EAPI void                      evas_object_precise_is_inside_set(Evas_Object *obj, Eina_Bool precise) EINA_ARG_NONNULL(1);
4984
4985 /**
4986  * Determine whether an object is set to use precise point collision
4987  * detection.
4988  *
4989  * @param obj The given object.
4990  * @return whether @p obj is set to use precise point collision
4991  * detection or not The default value is false.
4992  *
4993  * @see evas_object_precise_is_inside_set() for an example
4994  *
4995  * @ingroup Evas_Object_Group_Extras
4996  */
4997    EAPI Eina_Bool                 evas_object_precise_is_inside_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
4998
4999    EAPI void                      evas_object_static_clip_set      (Evas_Object *obj, Eina_Bool is_static_clip) EINA_ARG_NONNULL(1);
5000    EAPI Eina_Bool                 evas_object_static_clip_get      (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
5001
5002 /**
5003  * @}
5004  */
5005
5006 /**
5007  * @defgroup Evas_Object_Group_Find Finding Objects
5008  *
5009  * Functions that allows finding objects by their position, name or
5010  * other properties.
5011  *
5012  * @ingroup Evas_Object_Group
5013  */
5014
5015 /**
5016  * @addtogroup Evas_Object_Group_Find
5017  * @{
5018  */
5019
5020 /**
5021  * Retrieve the object that currently has focus.
5022  *
5023  * @param e The Evas canvas to query for focused object on.
5024  * @return The object that has focus or @c NULL if there is not one.
5025  *
5026  * Evas can have (at most) one of its objects focused at a time.
5027  * Focused objects will be the ones having <b>key events</b> delivered
5028  * to, which the programmer can act upon by means of
5029  * evas_object_event_callback_add() usage.
5030  *
5031  * @note Most users wouldn't be dealing directly with Evas' focused
5032  * objects. Instead, they would be using a higher level library for
5033  * that (like a toolkit, as Elementary) to handle focus and who's
5034  * receiving input for them.
5035  *
5036  * This call returns the object that currently has focus on the canvas
5037  * @p e or @c NULL, if none.
5038  *
5039  * @see evas_object_focus_set
5040  * @see evas_object_focus_get
5041  * @see evas_object_key_grab
5042  * @see evas_object_key_ungrab
5043  *
5044  * Example:
5045  * @dontinclude evas-events.c
5046  * @skip evas_event_callback_add(d.canvas, EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_IN,
5047  * @until evas_object_focus_set(d.bg, EINA_TRUE);
5048  * @dontinclude evas-events.c
5049  * @skip called when our rectangle gets focus
5050  * @until }
5051  *
5052  * In this example the @c event_info is exactly a pointer to that
5053  * focused rectangle. See the full @ref Example_Evas_Events "example".
5054  *
5055  * @ingroup Evas_Object_Group_Find
5056  */
5057 EAPI Evas_Object      *evas_focus_get                    (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
5058
5059
5060 /**
5061  * Retrieves the object on the given evas with the given name.
5062  * @param   e    The given evas.
5063  * @param   name The given name.
5064  * @return  If successful, the Evas object with the given name.  Otherwise,
5065  *          @c NULL.
5066  * @ingroup Evas_Object_Group_Find
5067  */
5068 EAPI Evas_Object      *evas_object_name_find             (const Evas *e, const char *name) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
5069
5070
5071 /**
5072  * Retrieves the top object at the given position (x,y)
5073  * @param   e The given Evas object.
5074  * @param   x The horizontal coordinate
5075  * @param   y The vertical coordinate
5076  * @param   include_pass_events_objects Boolean Flag to include or not
5077  * pass events objects
5078  * @param   include_hidden_objects Boolean Flag to include or not hidden objects
5079  * @return  The Evas object that is over all others objects at the given position.
5080  */
5081 EAPI Evas_Object      *evas_object_top_at_xy_get         (const Evas *e, Evas_Coord x, Evas_Coord y, Eina_Bool include_pass_events_objects, Eina_Bool include_hidden_objects) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
5082
5083 /**
5084  * Retrieves the top object at mouse pointer position
5085  * @param   e The given Evas object.
5086  * @return The Evas object that is over all others objects at the
5087  * pointer position.
5088  */
5089 EAPI Evas_Object      *evas_object_top_at_pointer_get    (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
5090
5091 /**
5092  * Retrieves the top object in the given rectangle region
5093  * @param   e The given Evas object.
5094  * @param   x The horizontal coordinate.
5095  * @param   y The vertical coordinate.
5096  * @param   w The width size.
5097  * @param   h The height size.
5098  * @param   include_pass_events_objects Boolean Flag to include or not pass events objects
5099  * @param   include_hidden_objects Boolean Flag to include or not hidden objects
5100  * @return  The Evas object that is over all others objects at the pointer position.
5101  *
5102  */
5103 EAPI Evas_Object      *evas_object_top_in_rectangle_get  (const Evas *e, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h, Eina_Bool include_pass_events_objects, Eina_Bool include_hidden_objects) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
5104
5105
5106 /**
5107  * Retrieves the objects at the given position
5108  * @param   e The given Evas object.
5109  * @param   x The horizontal coordinate.
5110  * @param   y The vertical coordinate.
5111  * @param include_pass_events_objects Boolean Flag to include or not
5112  * pass events objects
5113  * @param   include_hidden_objects Boolean Flag to include or not hidden objects
5114  * @return  The list of Evas objects at the pointer position.
5115  *
5116  */
5117 EAPI Eina_List        *evas_objects_at_xy_get            (const Evas *e, Evas_Coord x, Evas_Coord y, Eina_Bool include_pass_events_objects, Eina_Bool include_hidden_objects) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
5118    EAPI Eina_List        *evas_objects_in_rectangle_get     (const Evas *e, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h, Eina_Bool include_pass_events_objects, Eina_Bool include_hidden_objects) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
5119
5120 /**
5121  * Get the lowest (stacked) Evas object on the canvas @p
5122  *
5123  * @param e a valid canvas pointer
5124  * @return a pointer to the lowest object on it, if any, or @c NULL,
5125  * otherwise
5126  *
5127  * This function will take all populated layers in the canvas into
5128  * account, getting the lowest object for the lowest layer, naturally.
5129  *
5130  * @see evas_object_layer_get()
5131  * @see evas_object_layer_set()
5132  * @see evas_object_below_set()
5133  * @see evas_object_above_set()
5134  */
5135 EAPI Evas_Object      *evas_object_bottom_get            (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
5136
5137 /**
5138  * Get the highest (stacked) Evas object on the canvas @p
5139  *
5140  * @param e a valid canvas pointer
5141  * @return a pointer to the highest object on it, if any, or @c NULL,
5142  * otherwise
5143  *
5144  * This function will take all populated layers in the canvas into
5145  * account, getting the highest object for the highest layer,
5146  * naturally.
5147  *
5148  * @see evas_object_layer_get()
5149  * @see evas_object_layer_set()
5150  * @see evas_object_below_set()
5151  * @see evas_object_above_set()
5152  */
5153 EAPI Evas_Object      *evas_object_top_get               (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
5154
5155 /**
5156  * @}
5157  */
5158
5159 /**
5160  * @defgroup Evas_Object_Group_Interceptors Object Method Interceptors
5161  *
5162  * Evas provides a way to intercept method calls. The interceptor
5163  * callback may opt to completely deny the call, or may check and
5164  * change the parameters before continuing. The continuation of an
5165  * intercepted call is done by calling the intercepted call again,
5166  * from inside the interceptor callback.
5167  *
5168  * @ingroup Evas_Object_Group
5169  */
5170 typedef void (*Evas_Object_Intercept_Show_Cb) (void *data, Evas_Object *obj);
5171 typedef void (*Evas_Object_Intercept_Hide_Cb) (void *data, Evas_Object *obj);
5172 typedef void (*Evas_Object_Intercept_Move_Cb) (void *data, Evas_Object *obj, Evas_Coord x, Evas_Coord y);
5173 typedef void (*Evas_Object_Intercept_Resize_Cb) (void *data, Evas_Object *obj, Evas_Coord w, Evas_Coord h);
5174 typedef void (*Evas_Object_Intercept_Raise_Cb) (void *data, Evas_Object *obj);
5175 typedef void (*Evas_Object_Intercept_Lower_Cb) (void *data, Evas_Object *obj);
5176 typedef void (*Evas_Object_Intercept_Stack_Above_Cb) (void *data, Evas_Object *obj, Evas_Object *above);
5177 typedef void (*Evas_Object_Intercept_Stack_Below_Cb) (void *data, Evas_Object *obj, Evas_Object *above);
5178 typedef void (*Evas_Object_Intercept_Layer_Set_Cb) (void *data, Evas_Object *obj, int l);
5179 typedef void (*Evas_Object_Intercept_Color_Set_Cb) (void *data, Evas_Object *obj, int r, int g, int b, int a);
5180 typedef void (*Evas_Object_Intercept_Clip_Set_Cb) (void *data, Evas_Object *obj, Evas_Object *clip);
5181 typedef void (*Evas_Object_Intercept_Clip_Unset_Cb) (void *data, Evas_Object *obj);
5182
5183
5184 /**
5185  * Set the callback function that intercepts a show event of a object.
5186  *
5187  * @param obj The given canvas object pointer.
5188  * @param func The given function to be the callback function.
5189  * @param data The data passed to the callback function.
5190  *
5191  * This function sets a callback function to intercepts a show event
5192  * of a canvas object.
5193  *
5194  * @see evas_object_intercept_show_callback_del().
5195  *
5196  */
5197 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);
5198
5199 /**
5200  * Unset the callback function that intercepts a show event of a
5201  * object.
5202  *
5203  * @param obj The given canvas object pointer.
5204  * @param func The given callback function.
5205  *
5206  * This function sets a callback function to intercepts a show event
5207  * of a canvas object.
5208  *
5209  * @see evas_object_intercept_show_callback_add().
5210  *
5211  */
5212 EAPI void             *evas_object_intercept_show_callback_del        (Evas_Object *obj, Evas_Object_Intercept_Show_Cb func) EINA_ARG_NONNULL(1, 2);
5213
5214 /**
5215  * Set the callback function that intercepts a hide event of a object.
5216  *
5217  * @param obj The given canvas object pointer.
5218  * @param func The given function to be the callback function.
5219  * @param data The data passed to the callback function.
5220  *
5221  * This function sets a callback function to intercepts a hide event
5222  * of a canvas object.
5223  *
5224  * @see evas_object_intercept_hide_callback_del().
5225  *
5226  */
5227 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);
5228
5229 /**
5230  * Unset the callback function that intercepts a hide event of a
5231  * object.
5232  *
5233  * @param obj The given canvas object pointer.
5234  * @param func The given callback function.
5235  *
5236  * This function sets a callback function to intercepts a hide event
5237  * of a canvas object.
5238  *
5239  * @see evas_object_intercept_hide_callback_add().
5240  *
5241  */
5242 EAPI void             *evas_object_intercept_hide_callback_del        (Evas_Object *obj, Evas_Object_Intercept_Hide_Cb func) EINA_ARG_NONNULL(1, 2);
5243
5244 /**
5245  * Set the callback function that intercepts a move event of a object.
5246  *
5247  * @param obj The given canvas object pointer.
5248  * @param func The given function to be the callback function.
5249  * @param data The data passed to the callback function.
5250  *
5251  * This function sets a callback function to intercepts a move event
5252  * of a canvas object.
5253  *
5254  * @see evas_object_intercept_move_callback_del().
5255  *
5256  */
5257 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);
5258
5259 /**
5260  * Unset the callback function that intercepts a move event of a
5261  * object.
5262  *
5263  * @param obj The given canvas object pointer.
5264  * @param func The given callback function.
5265  *
5266  * This function sets a callback function to intercepts a move event
5267  * of a canvas object.
5268  *
5269  * @see evas_object_intercept_move_callback_add().
5270  *
5271  */
5272 EAPI void             *evas_object_intercept_move_callback_del        (Evas_Object *obj, Evas_Object_Intercept_Move_Cb func) EINA_ARG_NONNULL(1, 2);
5273
5274    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);
5275    EAPI void             *evas_object_intercept_resize_callback_del      (Evas_Object *obj, Evas_Object_Intercept_Resize_Cb func) EINA_ARG_NONNULL(1, 2);
5276    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);
5277    EAPI void             *evas_object_intercept_raise_callback_del       (Evas_Object *obj, Evas_Object_Intercept_Raise_Cb func) EINA_ARG_NONNULL(1, 2);
5278    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);
5279    EAPI void             *evas_object_intercept_lower_callback_del       (Evas_Object *obj, Evas_Object_Intercept_Lower_Cb func) EINA_ARG_NONNULL(1, 2);
5280    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);
5281    EAPI void             *evas_object_intercept_stack_above_callback_del (Evas_Object *obj, Evas_Object_Intercept_Stack_Above_Cb func) EINA_ARG_NONNULL(1, 2);
5282    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);
5283    EAPI void             *evas_object_intercept_stack_below_callback_del (Evas_Object *obj, Evas_Object_Intercept_Stack_Below_Cb func) EINA_ARG_NONNULL(1, 2);
5284    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);
5285    EAPI void             *evas_object_intercept_layer_set_callback_del   (Evas_Object *obj, Evas_Object_Intercept_Layer_Set_Cb func) EINA_ARG_NONNULL(1, 2);
5286    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);
5287    EAPI void             *evas_object_intercept_color_set_callback_del   (Evas_Object *obj, Evas_Object_Intercept_Color_Set_Cb func) EINA_ARG_NONNULL(1, 2);
5288    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);
5289    EAPI void             *evas_object_intercept_clip_set_callback_del    (Evas_Object *obj, Evas_Object_Intercept_Clip_Set_Cb func) EINA_ARG_NONNULL(1, 2);
5290    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);
5291    EAPI void             *evas_object_intercept_clip_unset_callback_del  (Evas_Object *obj, Evas_Object_Intercept_Clip_Unset_Cb func) EINA_ARG_NONNULL(1, 2);
5292
5293 /**
5294  * @defgroup Evas_Object_Specific Specific Object Functions
5295  *
5296  * Functions that work on specific objects.
5297  *
5298  */
5299
5300 /**
5301  * @defgroup Evas_Object_Rectangle Rectangle Object Functions
5302  *
5303  * @brief Function to create evas rectangle objects.
5304  *
5305  * This function may seem useless given there are no functions to manipulate
5306  * the created rectangle, however the rectangle is actually very useful and can
5307  * be manipulate using the generic @ref Evas_Object_Group
5308  * "evas object functions".
5309  *
5310  * For an example of use of an evas_object_rectangle see @ref
5311  * Example_Evas_Object_Manipulation "here".
5312  *
5313  * @ingroup Evas_Object_Specific
5314  */
5315
5316 /**
5317  * Adds a rectangle to the given evas.
5318  * @param   e The given evas.
5319  * @return  The new rectangle object.
5320  *
5321  * @ingroup Evas_Object_Rectangle
5322  */
5323 EAPI Evas_Object      *evas_object_rectangle_add         (Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
5324
5325 /**
5326  * @defgroup Evas_Object_Image Image Object Functions
5327  *
5328  * Functions used to create and manipulate image objects.
5329  *
5330  * Note - Image objects may return or accept "image data" in multiple
5331  * formats. This is based on the colorspace of an object. Here is a
5332  * rundown on formats:
5333  *
5334  * - #EVAS_COLORSPACE_ARGB8888:
5335  *   .
5336  *   This pixel format is a linear block of pixels, starting at the
5337  *   top-left row by row until the bottom right of the image or pixel
5338  *   region. All pixels are 32-bit unsigned int's with the high-byte
5339  *   being alpha and the low byte being blue in the format ARGB. Alpha
5340  *   may or may not be used by evas depending on the alpha flag of the
5341  *   image, but if not used, should be set to 0xff anyway.
5342  *   \n\n
5343  *   This colorspace uses premultiplied alpha. That means that R, G
5344  *   and B cannot exceed A in value. The conversion from
5345  *   non-premultiplied colorspace is:
5346  *   \n\n
5347  *   R = (r * a) / 255; G = (g * a) / 255; B = (b * a) / 255;
5348  *   \n\n
5349  *   So 50% transparent blue will be: 0x80000080. This will not be
5350  *   "dark" - just 50% transparent. Values are 0 == black, 255 ==
5351  *   solid or full red, green or blue.
5352  *
5353  * - #EVAS_COLORSPACE_YCBCR422P601_PL:
5354  *   .
5355  *   This is a pointer-list indirected set of YUV (YCbCr) pixel
5356  *   data. This means that the data returned or set is not actual
5357  *   pixel data, but pointers TO lines of pixel data. The list of
5358  *   pointers will first be N rows of pointers to the Y plane -
5359  *   pointing to the first pixel at the start of each row in the Y
5360  *   plane. N is the height of the image data in pixels. Each pixel in
5361  *   the Y, U and V planes is 1 byte exactly, packed. The next N / 2
5362  *   pointers will point to rows in the U plane, and the next N / 2
5363  *   pointers will point to the V plane rows. U and V planes are half
5364  *   the horizontal and vertical resolution of the Y plane.
5365  *   \n\n
5366  *   Row order is top to bottom and row pixels are stored left to
5367  *   right.
5368  *   \n\n
5369  *   There is a limitation that these images MUST be a multiple of 2
5370  *   pixels in size horizontally or vertically. This is due to the U
5371  *   and V planes being half resolution. Also note that this assumes
5372  *   the itu601 YUV colorspace specification. This is defined for
5373  *   standard television and mpeg streams. HDTV may use the itu709
5374  *   specification.
5375  *   \n\n
5376  *   Values are 0 to 255, indicating full or no signal in that plane
5377  *   respectively.
5378  *
5379  * - #EVAS_COLORSPACE_YCBCR422P709_PL:
5380  *   .
5381  *   Not implemented yet.
5382  *
5383  * - #EVAS_COLORSPACE_RGB565_A5P:
5384  *   .
5385  *   In the process of being implemented in 1 engine only. This may
5386  *   change.
5387  *   \n\n
5388  *   This is a pointer to image data for 16-bit half-word pixel data
5389  *   in 16bpp RGB 565 format (5 bits red, 6 bits green, 5 bits blue),
5390  *   with the high-byte containing red and the low byte containing
5391  *   blue, per pixel. This data is packed row by row from the top-left
5392  *   to the bottom right.
5393  *   \n\n
5394  *   If the image has an alpha channel enabled there will be an extra
5395  *   alpha plane after the color pixel plane. If not, then this data
5396  *   will not exist and should not be accessed in any way. This plane
5397  *   is a set of pixels with 1 byte per pixel defining the alpha
5398  *   values of all pixels in the image from the top-left to the bottom
5399  *   right of the image, row by row. Even though the values of the
5400  *   alpha pixels can be 0 to 255, only values 0 through to 32 are
5401  *   used, 32 being solid and 0 being transparent.
5402  *   \n\n
5403  *   RGB values can be 0 to 31 for red and blue and 0 to 63 for green,
5404  *   with 0 being black and 31 or 63 being full red, green or blue
5405  *   respectively. This colorspace is also pre-multiplied like
5406  *   EVAS_COLORSPACE_ARGB8888 so:
5407  *   \n\n
5408  *   R = (r * a) / 32; G = (g * a) / 32; B = (b * a) / 32;
5409  *
5410  * - #EVAS_COLORSPACE_GRY8:
5411  *   .
5412  *   The image is just a alpha mask (8 bit's per pixel). This is used
5413  *   for alpha masking.
5414  *
5415  * Some examples on this group of functions can be found @ref
5416  * Example_Evas_Images "here".
5417  *
5418  * @ingroup Evas_Object_Specific
5419  */
5420
5421 /**
5422  * @addtogroup Evas_Object_Image
5423  * @{
5424  */
5425
5426 typedef void (*Evas_Object_Image_Pixels_Get_Cb) (void *data, Evas_Object *o);
5427
5428
5429 /**
5430  * Creates a new image object on the given Evas @p e canvas.
5431  *
5432  * @param e The given canvas.
5433  * @return The created image object handle.
5434  *
5435  * Image objects are available to whichever occasion one needs complex
5436  * imagery on a GUI, which cannot be achieved by the other Evas'
5437  * primitive object types, or to make image manipulations.
5438  *
5439  * Evas will support whichever image file types it was compiled with
5440  * support to (its image loaders) -- check your software packager for
5441  * that information.
5442  *
5443  * @note If you intend to @b display an image somehow in a GUI,
5444  * besides binding it to a real image file/source (with
5445  * evas_object_image_file_set(), for example), you'll have to tell
5446  * this image object how to fill its space with the pixels it can get
5447  * from the source. See evas_object_image_filled_add(), for a helper
5448  * on the common case of scaling up an image source to the whole area
5449  * of the image object.
5450  *
5451  * @see evas_object_image_fill_set()
5452  */
5453 EAPI Evas_Object             *evas_object_image_add                    (Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
5454
5455 /**
5456  * Creates a new image object that @b automatically scales its bound
5457  * image to the object's area, on both axis.
5458  *
5459  * @param e The given canvas.
5460  * @return The created image object handle.
5461  *
5462  * This is a helper function around evas_object_image_add() and
5463  * evas_object_image_filled_set(). It has the same effect of applying
5464  * those functions in sequence, which is a very common use case.
5465  *
5466  * @note Whenever this object gets resized, the bound image will be
5467  * rescaled, too.
5468  *
5469  * @see evas_object_image_add()
5470  * @see evas_object_image_filled_set()
5471  * @see evas_object_image_fill_set()
5472  */
5473 EAPI Evas_Object             *evas_object_image_filled_add             (Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
5474
5475
5476 /**
5477  * Sets the data for an image from memory to be loaded
5478  *
5479  * This is the same as evas_object_image_file_set() but the file to be loaded
5480  * may exist at an address in memory (the data for the file, not the filename
5481  * itself). The @p data at the address is copied and stored for future use, so
5482  * no @p data needs to be kept after this call is made. It will be managed and
5483  * freed for you when no longer needed. The @p size is limited to 2 gigabytes
5484  * in size, and must be greater than 0. A NULL @p data pointer is also invalid.
5485  * Set the filename to NULL to reset to empty state and have the image file
5486  * data freed from memory using evas_object_image_file_set().
5487  *
5488  * The @p format is optional (pass NULL if you don't need/use it). It is used
5489  * to help Evas guess better which loader to use for the data. It may simply
5490  * be the "extension" of the file as it would normally be on disk such as
5491  * "jpg" or "png" or "gif" etc.
5492  *
5493  * @param obj The given image object.
5494  * @param data The image file data address
5495  * @param size The size of the image file data in bytes
5496  * @param format The format of the file (optional), or @c NULL if not needed
5497  * @param key The image key in file, or @c NULL.
5498  */
5499 EAPI void                     evas_object_image_memfile_set            (Evas_Object *obj, void *data, int size, char *format, char *key) EINA_ARG_NONNULL(1, 2);
5500
5501 /**
5502  * Set the source file from where an image object must fetch the real
5503  * image data (it may be an Eet file, besides pure image ones).
5504  *
5505  * @param obj The given image object.
5506  * @param file The image file path.
5507  * @param key The image key in @p file (if its an Eet one), or @c
5508  * NULL, otherwise.
5509  *
5510  * If the file supports multiple data stored in it (as Eet files do),
5511  * you can specify the key to be used as the index of the image in
5512  * this file.
5513  */
5514 EAPI void                     evas_object_image_file_set               (Evas_Object *obj, const char *file, const char *key) EINA_ARG_NONNULL(1);
5515
5516 /**
5517  * Retrieve the source file from where an image object is to fetch the
5518  * real image data (it may be an Eet file, besides pure image ones).
5519  *
5520  * @param obj The given image object.
5521  * @param file Location to store the image file path.
5522  * @param key Location to store the image key (if @p file is an Eet
5523  * one).
5524  *
5525  * You must @b not modify the strings on the returned pointers.
5526  *
5527  * @note Use @c NULL pointers on the file components you're not
5528  * interested in: they'll be ignored by the function.
5529  */
5530 EAPI void                     evas_object_image_file_get               (const Evas_Object *obj, const char **file, const char **key) EINA_ARG_NONNULL(1, 2);
5531
5532 /**
5533  * Set the dimensions for an image object's border, a region which @b
5534  * won't ever be scaled together with its center.
5535  *
5536  * @param obj The given image object.
5537  * @param l The border's left width.
5538  * @param r The border's right width.
5539  * @param t The border's top width.
5540  * @param b The border's bottom width.
5541  *
5542  * When Evas is rendering, an image source may be scaled to fit the
5543  * size of its image object. This function sets an area from the
5544  * borders of the image inwards which is @b not to be scaled. This
5545  * function is useful for making frames and for widget theming, where,
5546  * for example, buttons may be of varying sizes, but their border size
5547  * must remain constant.
5548  *
5549  * The units used for @p l, @p r, @p t and @p b are canvas units.
5550  *
5551  * @note The border region itself @b may be scaled by the
5552  * evas_object_image_border_scale_set() function.
5553  *
5554  * @note By default, image objects have no borders set, i. e. @c l, @c
5555  * r, @c t and @c b start as @c 0.
5556  *
5557  * @see evas_object_image_border_get()
5558  * @see evas_object_image_border_center_fill_set()
5559  */
5560 EAPI void                     evas_object_image_border_set             (Evas_Object *obj, int l, int r, int t, int b) EINA_ARG_NONNULL(1);
5561
5562 /**
5563  * Retrieve the dimensions for an image object's border, a region
5564  * which @b won't ever be scaled together with its center.
5565  *
5566  * @param obj The given image object.
5567  * @param l Location to store the border's left width in.
5568  * @param r Location to store the border's right width in.
5569  * @param t Location to store the border's top width in.
5570  * @param b Location to store the border's bottom width in.
5571  *
5572  * @note Use @c NULL pointers on the border components you're not
5573  * interested in: they'll be ignored by the function.
5574  *
5575  * See @ref evas_object_image_border_set() for more details.
5576  */
5577 EAPI void                     evas_object_image_border_get             (const Evas_Object *obj, int *l, int *r, int *t, int *b) EINA_ARG_NONNULL(1);
5578
5579 /**
5580  * Sets @b how the center part of the given image object (not the
5581  * borders) should be drawn when Evas is rendering it.
5582  *
5583  * @param obj The given image object.
5584  * @param fill Fill mode of the center region of @p obj (a value in
5585  * #Evas_Border_Fill_Mode).
5586  *
5587  * This function sets how the center part of the image object's source
5588  * image is to be drawn, which must be one of the values in
5589  * #Evas_Border_Fill_Mode. By center we mean the complementary part of
5590  * that defined by evas_object_image_border_set(). This one is very
5591  * useful for making frames and decorations. You would most probably
5592  * also be using a filled image (as in evas_object_image_filled_set())
5593  * to use as a frame.
5594  *
5595  * @see evas_object_image_border_center_fill_get()
5596  */
5597 EAPI void                     evas_object_image_border_center_fill_set (Evas_Object *obj, Evas_Border_Fill_Mode fill) EINA_ARG_NONNULL(1);
5598
5599 /**
5600  * Retrieves @b how the center part of the given image object (not the
5601  * borders) is to be drawn when Evas is rendering it.
5602  *
5603  * @param obj The given image object.
5604  * @return fill Fill mode of the center region of @p obj (a value in
5605  * #Evas_Border_Fill_Mode).
5606  *
5607  * See @ref evas_object_image_fill_set() for more details.
5608  */
5609 EAPI Evas_Border_Fill_Mode    evas_object_image_border_center_fill_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
5610
5611 /**
5612  * Set whether the image object's fill property should track the
5613  * object's size.
5614  *
5615  * @param obj The given image object.
5616  * @param setting @c EINA_TRUE, to make the fill property follow
5617  *        object size or @c EINA_FALSE, otherwise
5618  *
5619  * If @p setting is @c EINA_TRUE, then every evas_object_resize() will
5620  * @b automatically trigger a call to evas_object_image_fill_set()
5621  * with the that new size (and @c 0, @c 0 as source image's origin),
5622  * so the bound image will fill the whole object's area.
5623  *
5624  * @see evas_object_image_filled_add()
5625  * @see evas_object_image_fill_get()
5626  */
5627 EAPI void                     evas_object_image_filled_set             (Evas_Object *obj, Eina_Bool setting) EINA_ARG_NONNULL(1);
5628
5629 /**
5630  * Retrieve whether the image object's fill property should track the
5631  * object's size.
5632  *
5633  * @param obj The given image object.
5634  * @return @c EINA_TRUE if it is tracking, @c EINA_FALSE, if not (and
5635  *         evas_object_fill_set() must be called manually).
5636  *
5637  * @see evas_object_image_filled_set() for more information
5638  */
5639 EAPI Eina_Bool                evas_object_image_filled_get             (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
5640
5641 /**
5642  * Sets the scaling factor (multiplier) for the borders of an image
5643  * object.
5644  *
5645  * @param obj The given image object.
5646  * @param scale The scale factor (default is @c 1.0 - i.e. no scaling)
5647  *
5648  * @see evas_object_image_border_set()
5649  * @see evas_object_image_border_scale_get()
5650  */
5651 EAPI void                     evas_object_image_border_scale_set       (Evas_Object *obj, double scale);
5652
5653 /**
5654  * Retrieves the scaling factor (multiplier) for the borders of an
5655  * image object.
5656  *
5657  * @param obj The given image object.
5658  * @return The scale factor set for its borders
5659  *
5660  * @see evas_object_image_border_set()
5661  * @see evas_object_image_border_scale_set()
5662  */
5663 EAPI double                   evas_object_image_border_scale_get       (const Evas_Object *obj);
5664
5665 /**
5666  * Set how to fill an image object's drawing rectangle given the
5667  * (real) image bound to it.
5668  *
5669  * @param obj The given image object to operate on.
5670  * @param x The x coordinate (from the top left corner of the bound
5671  *          image) to start drawing from.
5672  * @param y The y coordinate (from the top left corner of the bound
5673  *          image) to start drawing from.
5674  * @param w The width the bound image will be displayed at.
5675  * @param h The height the bound image will be displayed at.
5676  *
5677  * Note that if @p w or @h are smaller the same dimensions @p obj, the
5678  * displayed image will be @b tiled around the object's area. To have
5679  * only one copy of the bound image drawn, @p x and @p y must be 0 and
5680  * @p w and @p h need to be the exact width and height of the image
5681  * object itself, respectively.
5682  *
5683  * @warning The default values for the fill parameters are @p x = 0,
5684  * @p y = 0, @p w = 0 and @p h = 0. Thus, if you're not using the
5685  * evas_object_image_filled_add() helper and want your image
5686  * displayed, you'll have to set valid values with this fuction on
5687  * your object.
5688  *
5689  * @note evas_object_image_filled_set() is helper function which will
5690  * @b override the values set here automatically, for you, in a given
5691  * way.
5692  */
5693 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);
5694
5695 /**
5696  * Retrieve how an image object is to fill its drawing rectangle,
5697  * given the (real) image bound to it.
5698  *
5699  * @param obj The given image object.
5700  * @param x Location to store the x coordinate (from the top left
5701  *          corner of the bound image) to start drawing from.
5702  * @param y Location to store the y coordinate (from the top left
5703  *          corner of the bound image) to start drawing from.
5704  * @param w Location to store the width the bound image is to be
5705  *          displayed at.
5706  * @param h Location to store the height the bound image is to be
5707  *          displayed at.
5708  *
5709  * @note Use @c NULL pointers on the fill components you're not
5710  * interested in: they'll be ignored by the function.
5711  *
5712  * See @ref evas_object_image_fill_set() for more details.
5713  */
5714 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);
5715
5716 /**
5717  * Sets the tiling mode for the given evas image object's fill.
5718  * @param   obj   The given evas image object.
5719  * @param   spread One of EVAS_TEXTURE_REFLECT, EVAS_TEXTURE_REPEAT,
5720  * EVAS_TEXTURE_RESTRICT, or EVAS_TEXTURE_PAD.
5721  */
5722 EAPI void                     evas_object_image_fill_spread_set        (Evas_Object *obj, Evas_Fill_Spread spread) EINA_ARG_NONNULL(1);
5723
5724 /**
5725  * Retrieves the spread (tiling mode) for the given image object's
5726  * fill.
5727  *
5728  * @param   obj The given evas image object.
5729  * @return  The current spread mode of the image object.
5730  */
5731 EAPI Evas_Fill_Spread         evas_object_image_fill_spread_get        (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
5732
5733 /**
5734  * Sets the size of the given image object.
5735  *
5736  * @param obj The given image object.
5737  * @param w The new width of the image.
5738  * @param h The new height of the image.
5739  *
5740  * This function will scale down or crop the image so that it is
5741  * treated as if it were at the given size. If the size given is
5742  * smaller than the image, it will be cropped. If the size given is
5743  * larger, then the image will be treated as if it were in the upper
5744  * left hand corner of a larger image that is otherwise transparent.
5745  */
5746 EAPI void                     evas_object_image_size_set               (Evas_Object *obj, int w, int h) EINA_ARG_NONNULL(1);
5747
5748 /**
5749  * Retrieves the size of the given image object.
5750  *
5751  * @param obj The given image object.
5752  * @param w Location to store the width of the image in, or @c NULL.
5753  * @param h Location to store the height of the image in, or @c NULL.
5754  *
5755  * See @ref evas_object_image_size_set() for more details.
5756  */
5757 EAPI void                     evas_object_image_size_get               (const Evas_Object *obj, int *w, int *h) EINA_ARG_NONNULL(1);
5758
5759 /**
5760  * Retrieves the row stride of the given image object.
5761  *
5762  * @param obj The given image object.
5763  * @return The stride of the image (<b>in bytes</b>).
5764  *
5765  * The row stride is the number of bytes between the start of a row
5766  * and the start of the next row for image data.
5767  */
5768 EAPI int                      evas_object_image_stride_get             (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
5769
5770 /**
5771  * Retrieves a number representing any error that occurred during the
5772  * last loading of the given image object's source image.
5773  *
5774  * @param obj The given image object.
5775  * @return A value giving the last error that occurred. It should be
5776  *         one of the #Evas_Load_Error values. #EVAS_LOAD_ERROR_NONE
5777  *         is returned if there was no error.
5778  */
5779 EAPI Evas_Load_Error          evas_object_image_load_error_get         (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
5780
5781 /**
5782  * Sets the raw image data of the given image object.
5783  *
5784  * @param obj The given image object.
5785  * @param data The raw data, or @c NULL.
5786  *
5787  * Note that the raw data must be of the same size (see
5788  * evas_object_image_size_set(), which has to be called @b before this
5789  * one) and colorspace (see evas_object_image_colorspace_set()) of the
5790  * image. If data is @c NULL, the current image data will be
5791  * freed. Naturally, if one does not set an image object's data
5792  * manually, it will still have one, allocated by Evas.
5793  *
5794  * @see evas_object_image_data_get()
5795  */
5796 EAPI void                     evas_object_image_data_set               (Evas_Object *obj, void *data) EINA_ARG_NONNULL(1);
5797
5798 /**
5799  * Get a pointer to the raw image data of the given image object.
5800  *
5801  * @param obj The given image object.
5802  * @param for_writing Whether the data being retrieved will be
5803  *        modified (@c EINA_TRUE) or not (@c EINA_FALSE).
5804  * @return The raw image data.
5805  *
5806  * This function returns a pointer to an image object's internal pixel
5807  * buffer, for reading only or read/write. If you request it for
5808  * writing, the image will be marked dirty so that it gets redrawn at
5809  * the next update.
5810  *
5811  * Each time you call this function on an image object, its data
5812  * buffer will have an internal reference counter
5813  * incremented. Decrement it back by using
5814  * evas_object_image_data_set(). This is specially important for the
5815  * directfb Evas engine.
5816  *
5817  * This is best suited for when you want to modify an existing image,
5818  * without changing its dimensions.
5819  *
5820  * @note The contents' formart returned by it depend on the color
5821  * space of the given image object.
5822  *
5823  * @note You may want to use evas_object_image_data_update_add() to
5824  * inform data changes, if you did any.
5825  *
5826  * @see evas_object_image_data_set()
5827  */
5828 EAPI void                    *evas_object_image_data_get               (const Evas_Object *obj, Eina_Bool for_writing) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
5829
5830 /**
5831  * Converts the raw image data of the given image object to the
5832  * specified colorspace.
5833  *
5834  * Note that this function does not modify the raw image data.  If the
5835  * requested colorspace is the same as the image colorspace nothing is
5836  * done and NULL is returned. You should use
5837  * evas_object_image_colorspace_get() to check the current image
5838  * colorspace.
5839  *
5840  * See @ref evas_object_image_colorspace_get.
5841  *
5842  * @param obj The given image object.
5843  * @param to_cspace The colorspace to which the image raw data will be converted.
5844  * @return data A newly allocated data in the format specified by to_cspace.
5845  */
5846 EAPI void                    *evas_object_image_data_convert           (Evas_Object *obj, Evas_Colorspace to_cspace) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
5847
5848 /**
5849  * Replaces the raw image data of the given image object.
5850  *
5851  * @param obj The given image object.
5852  * @param data The raw data to replace.
5853  *
5854  * This function lets the application replace an image object's
5855  * internal pixel buffer with an user-allocated one. For best results,
5856  * you should generally first call evas_object_image_size_set() with
5857  * the width and height for the new buffer.
5858  *
5859  * This call is best suited for when you will be using image data with
5860  * different dimensions than the existing image data, if any. If you
5861  * only need to modify the existing image in some fashion, then using
5862  * evas_object_image_data_get() is probably what you are after.
5863  *
5864  * Note that the caller is responsible for freeing the buffer when
5865  * finished with it, as user-set image data will not be automatically
5866  * freed when the image object is deleted.
5867  *
5868  * See @ref evas_object_image_data_get() for more details.
5869  *
5870  */
5871 EAPI void                     evas_object_image_data_copy_set          (Evas_Object *obj, void *data) EINA_ARG_NONNULL(1);
5872
5873 /**
5874  * Mark a sub-region of the given image object to be redrawn.
5875  *
5876  * @param obj The given image object.
5877  * @param x X-offset of the region to be updated.
5878  * @param y Y-offset of the region to be updated.
5879  * @param w Width of the region to be updated.
5880  * @param h Height of the region to be updated.
5881  *
5882  * This function schedules a particular rectangular region of an image
5883  * object to be updated (redrawn) at the next rendering cycle.
5884  */
5885 EAPI void                     evas_object_image_data_update_add        (Evas_Object *obj, int x, int y, int w, int h) EINA_ARG_NONNULL(1);
5886
5887 /**
5888  * Enable or disable alpha channel usage on the given image object.
5889  *
5890  * @param obj The given image object.
5891  * @param has_alpha Whether to use alpha channel (@c EINA_TRUE) data
5892  * or not (@c EINA_FALSE).
5893  *
5894  * This function sets a flag on an image object indicating whether or
5895  * not to use alpha channel data. A value of @c EINA_TRUE makes it use
5896  * alpha channel data, and @c EINA_FALSE makes it ignore that
5897  * data. Note that this has nothing to do with an object's color as
5898  * manipulated by evas_object_color_set().
5899  *
5900  * @see evas_object_image_alpha_get()
5901  */
5902 EAPI void                     evas_object_image_alpha_set              (Evas_Object *obj, Eina_Bool has_alpha) EINA_ARG_NONNULL(1);
5903
5904 /**
5905  * Retrieve whether alpha channel data is being used on the given
5906  * image object.
5907  *
5908  * @param obj The given image object.
5909  * @return Whether the alpha channel data is being used (@c EINA_TRUE)
5910  * or not (@c EINA_FALSE).
5911  *
5912  * This function returns @c EINA_TRUE if the image object's alpha
5913  * channel is being used, or @c EINA_FALSE otherwise.
5914  *
5915  * See @ref evas_object_image_alpha_set() for more details.
5916  */
5917 EAPI Eina_Bool                evas_object_image_alpha_get              (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
5918
5919 /**
5920  * Sets whether to use high-quality image scaling algorithm on the
5921  * given image object.
5922  *
5923  * @param obj The given image object.
5924  * @param smooth_scale Whether to use smooth scale or not.
5925  *
5926  * When enabled, a higher quality image scaling algorithm is used when
5927  * scaling images to sizes other than the source image's original
5928  * one. This gives better results but is more computationally
5929  * expensive.
5930  *
5931  * @note Image objects get created originally with smooth scaling @b
5932  * on.
5933  *
5934  * @see evas_object_image_smooth_scale_get()
5935  */
5936 EAPI void                     evas_object_image_smooth_scale_set       (Evas_Object *obj, Eina_Bool smooth_scale) EINA_ARG_NONNULL(1);
5937
5938 /**
5939  * Retrieves whether the given image object is using high-quality
5940  * image scaling algorithm.
5941  *
5942  * @param obj The given image object.
5943  * @return Whether smooth scale is being used.
5944  *
5945  * See @ref evas_object_image_smooth_scale_set() for more details.
5946  */
5947 EAPI Eina_Bool                evas_object_image_smooth_scale_get       (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
5948
5949 /**
5950  * Preload an image object's image data in the background
5951  *
5952  * @param obj The given image object.
5953  * @param cancel @c EINA_FALSE will add it the preloading work queue,
5954  *               @c EINA_TRUE will remove it (if it was issued before).
5955  *
5956  * This function requests the preload of the data image in the
5957  * background. The work is queued before being processed (because
5958  * there might be other pending requests of this type).
5959  *
5960  * Whenever the image data gets loaded, Evas will call
5961  * #EVAS_CALLBACK_IMAGE_PRELOADED registered callbacks on @p obj (what
5962  * may be immediately, if the data was already preloaded before).
5963  *
5964  * Use @c EINA_TRUE for @p cancel on scenarios where you don't need
5965  * the image data preloaded anymore.
5966  */
5967 EAPI void                     evas_object_image_preload                (Evas_Object *obj, Eina_Bool cancel) EINA_ARG_NONNULL(1);
5968
5969 /**
5970  * Reload an image object's image data.
5971  *
5972  * @param obj The given image object pointer.
5973  *
5974  * This function reloads the image data bound to image object @p obj.
5975  */
5976 EAPI void                     evas_object_image_reload                 (Evas_Object *obj) EINA_ARG_NONNULL(1);
5977
5978 /**
5979  * Save the given image object's contents to an (image) file.
5980  *
5981  * @param obj The given image object.
5982  * @param file The filename to be used to save the image (extension
5983  *        obligatory).
5984  * @param key The image key in the file (if an Eet one), or @c NULL,
5985  *        otherwise.
5986  * @param flags String containing the flags to be used (@c NULL for
5987  *        none).
5988  *
5989  * The extension suffix on @p file will determine which <b>saver
5990  * module</b> Evas is to use when saving, thus the final file's
5991  * format. If the file supports multiple data stored in it (Eet ones),
5992  * you can specify the key to be used as the index of the image in it.
5993  *
5994  * You can specify some flags when saving the image.  Currently
5995  * acceptable flags are @c quality and @c compress. Eg.: @c
5996  * "quality=100 compress=9"
5997  */
5998 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);
5999
6000 /**
6001  * Import pixels from given source to a given canvas image object.
6002  *
6003  * @param obj The given canvas object.
6004  * @param pixels The pixel's source to be imported.
6005  *
6006  * This function imports pixels from a given source to a given canvas image.
6007  *
6008  */
6009 EAPI Eina_Bool                evas_object_image_pixels_import          (Evas_Object *obj, Evas_Pixel_Import_Source *pixels) EINA_ARG_NONNULL(1, 2);
6010
6011 /**
6012  * Set the callback function to get pixels from a canva's image.
6013  *
6014  * @param obj The given canvas pointer.
6015  * @param func The callback function.
6016  * @param data The data pointer to be passed to @a func.
6017  *
6018  * This functions sets a function to be the callback function that get
6019  * pixes from a image of the canvas.
6020  *
6021  */
6022 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);
6023
6024 /**
6025  * Mark whether the given image object is dirty (needs to be redrawn).
6026  *
6027  * @param obj The given image object.
6028  * @param dirty Whether the image is dirty.
6029  */
6030 EAPI void                     evas_object_image_pixels_dirty_set       (Evas_Object *obj, Eina_Bool dirty) EINA_ARG_NONNULL(1);
6031
6032 /**
6033  * Retrieves whether the given image object is dirty (needs to be redrawn).
6034  *
6035  * @param obj The given image object.
6036  * @return Whether the image is dirty.
6037  */
6038 EAPI Eina_Bool                evas_object_image_pixels_dirty_get       (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
6039
6040 /**
6041  * Set the DPI resolution of an image object's source image.
6042  *
6043  * @param obj The given canvas pointer.
6044  * @param dpi The new DPI resolution.
6045  *
6046  * This function sets the DPI resolution of a given loaded canvas
6047  * image. Most useful for the SVG image loader.
6048  *
6049  * @see evas_object_image_load_dpi_get()
6050  */
6051 EAPI void                     evas_object_image_load_dpi_set           (Evas_Object *obj, double dpi) EINA_ARG_NONNULL(1);
6052
6053 /**
6054  * Get the DPI resolution of a loaded image object in the canvas.
6055  *
6056  * @param obj The given canvas pointer.
6057  * @return The DPI resolution of the given canvas image.
6058  *
6059  * This function returns the DPI resolution of the given canvas image.
6060  *
6061  * @see evas_object_image_load_dpi_set() for more details
6062  */
6063 EAPI double                   evas_object_image_load_dpi_get           (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
6064
6065 /**
6066  * Set the size of a given image object's source image, when loading
6067  * it.
6068  *
6069  * @param obj The given canvas object.
6070  * @param w The new width of the image's load size.
6071  * @param h The new height of the image's load size.
6072  *
6073  * This function sets a new (loading) size for the given canvas
6074  * image.
6075  *
6076  * @see evas_object_image_load_size_get()
6077  */
6078 EAPI void                     evas_object_image_load_size_set          (Evas_Object *obj, int w, int h) EINA_ARG_NONNULL(1);
6079
6080 /**
6081  * Get the size of a given image object's source image, when loading
6082  * it.
6083  *
6084  * @param obj The given image object.
6085  * @param w Where to store the new width of the image's load size.
6086  * @param h Where to store the new height of the image's load size.
6087  *
6088  * @note Use @c NULL pointers on the size components you're not
6089  * interested in: they'll be ignored by the function.
6090  *
6091  * @see evas_object_image_load_size_set() for more details
6092  */
6093 EAPI void                     evas_object_image_load_size_get          (const Evas_Object *obj, int *w, int *h) EINA_ARG_NONNULL(1);
6094
6095 /**
6096  * Set the scale down factor of a given image object's source image,
6097  * when loading it.
6098  *
6099  * @param obj The given image object pointer.
6100  * @param scale_down The scale down factor.
6101  *
6102  * This function sets the scale down factor of a given canvas
6103  * image. Most useful for the SVG image loader.
6104  *
6105  * @see evas_object_image_load_scale_down_get()
6106  */
6107 EAPI void                     evas_object_image_load_scale_down_set    (Evas_Object *obj, int scale_down) EINA_ARG_NONNULL(1);
6108
6109 /**
6110  * get the scale down factor of a given image object's source image,
6111  * when loading it.
6112  *
6113  * @param obj The given image object pointer.
6114  *
6115  * @see evas_object_image_load_scale_down_set() for more details
6116  */
6117 EAPI int                      evas_object_image_load_scale_down_get    (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
6118
6119 /**
6120  * Inform a given image object to load a selective region of its
6121  * source image.
6122  *
6123  * @param obj The given image object pointer.
6124  * @param x X-offset of the region to be loaded.
6125  * @param y Y-offset of the region to be loaded.
6126  * @param w Width of the region to be loaded.
6127  * @param h Height of the region to be loaded.
6128  *
6129  * This function is useful when one is not showing all of an image's
6130  * area on its image object.
6131  *
6132  * @note The image loader for the image format in question has to
6133  * support selective region loading in order to this function to take
6134  * effect.
6135  *
6136  * @see evas_object_image_load_region_get()
6137  */
6138 EAPI void                     evas_object_image_load_region_set        (Evas_Object *obj, int x, int y, int w, int h) EINA_ARG_NONNULL(1);
6139
6140 /**
6141  * Retrieve the coordinates of a given image object's selective
6142  * (source image) load region.
6143  *
6144  * @param obj The given image object pointer.
6145  * @param x Where to store the X-offset of the region to be loaded.
6146  * @param y Where to store the Y-offset of the region to be loaded.
6147  * @param w Where to store the width of the region to be loaded.
6148  * @param h Where to store the height of the region to be loaded.
6149  *
6150  * @note Use @c NULL pointers on the coordinates you're not interested
6151  * in: they'll be ignored by the function.
6152  *
6153  * @see evas_object_image_load_region_get()
6154  */
6155 EAPI void                     evas_object_image_load_region_get        (const Evas_Object *obj, int *x, int *y, int *w, int *h) EINA_ARG_NONNULL(1);
6156
6157 /**
6158  * Define if the orientation information in the image file should be honored.
6159  *
6160  * @param obj The given image object pointer.
6161  * @param enable @p EINA_TRUE means that it should honor the orientation information
6162  * @since 1.1
6163  */
6164 EAPI void                     evas_object_image_load_orientation_set        (Evas_Object *obj, Eina_Bool enable) EINA_ARG_NONNULL(1);
6165
6166 /**
6167  * Get if the orientation information in the image file should be honored.
6168  *
6169  * @param obj The given image object pointer.
6170  * @since 1.1
6171  */
6172 EAPI Eina_Bool                evas_object_image_load_orientation_get        (const Evas_Object *obj) EINA_ARG_NONNULL(1);
6173
6174 /**
6175  * Set the colorspace of a given image of the canvas.
6176  *
6177  * @param obj The given image object pointer.
6178  * @param cspace The new color space.
6179  *
6180  * This function sets the colorspace of given canvas image.
6181  *
6182  */
6183 EAPI void                     evas_object_image_colorspace_set         (Evas_Object *obj, Evas_Colorspace cspace) EINA_ARG_NONNULL(1);
6184
6185 /**
6186  * Get the colorspace of a given image of the canvas.
6187  *
6188  * @param obj The given image object pointer.
6189  * @return The colorspace of the image.
6190  *
6191  * This function returns the colorspace of given canvas image.
6192  *
6193  */
6194 EAPI Evas_Colorspace          evas_object_image_colorspace_get         (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
6195
6196 /**
6197  * Set the native surface of a given image of the canvas
6198  *
6199  * @param obj The given canvas pointer.
6200  * @param surf The new native surface.
6201  *
6202  * This function sets a native surface of a given canvas image.
6203  *
6204  */
6205 EAPI void                     evas_object_image_native_surface_set     (Evas_Object *obj, Evas_Native_Surface *surf) EINA_ARG_NONNULL(1, 2);
6206
6207 /**
6208  * Get the native surface of a given image of the canvas
6209  *
6210  * @param obj The given canvas pointer.
6211  * @return The native surface of the given canvas image.
6212  *
6213  * This function returns the native surface of a given canvas image.
6214  *
6215  */
6216 EAPI Evas_Native_Surface     *evas_object_image_native_surface_get     (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
6217
6218 /**
6219  * Set the scale hint of a given image of the canvas.
6220  *
6221  * @param obj The given canvas pointer.
6222  * @param hint The scale hint value.
6223  *
6224  * This function sets the scale hint value of the given image of the
6225  * canvas, which will affect how Evas is to scale it.
6226  *
6227  * @see evas_object_image_scale_hint_get()
6228  */
6229 EAPI void                     evas_object_image_scale_hint_set         (Evas_Object *obj, Evas_Image_Scale_Hint hint) EINA_ARG_NONNULL(1);
6230
6231 /**
6232  * Get the scale hint of a given image of the canvas.
6233  *
6234  * @param obj The given canvas pointer.
6235  *
6236  * This function returns the scale hint value of the given image of
6237  * the canvas.
6238  *
6239  * @see evas_object_image_scale_hint_set()
6240  */
6241 EAPI Evas_Image_Scale_Hint    evas_object_image_scale_hint_get         (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
6242
6243 /**
6244  * Set the content hint setting of a given image object of the canvas.
6245  *
6246  * @param obj The given canvas pointer.
6247  * @param hint The content hint value, one of the
6248  * #Evas_Image_Content_Hint ones.
6249  *
6250  * This function sets the content hint value of the given image of the
6251  * canvas. For example, if you're on the GL engine and your driver
6252  * implementation supports it, setting this hint to
6253  * #EVAS_IMAGE_CONTENT_HINT_DYNAMIC will make it need @b zero copies
6254  * at texture upload time, which is an "expensive" operation.
6255  *
6256  * @see evas_object_image_content_hint_get()
6257  */
6258 EAPI void                     evas_object_image_content_hint_set       (Evas_Object *obj, Evas_Image_Content_Hint hint) EINA_ARG_NONNULL(1);
6259
6260 /**
6261  * Get the content hint setting of a given image object of the canvas.
6262  *
6263  * @param obj The given canvas pointer.
6264  * @return hint The content hint value set on it, one of the
6265  * #Evas_Image_Content_Hint ones (#EVAS_IMAGE_CONTENT_HINT_NONE means
6266  * an error).
6267  *
6268  * This function returns the content hint value of the given image of
6269  * the canvas.
6270  *
6271  * @see evas_object_image_content_hint_set()
6272  */
6273 EAPI Evas_Image_Content_Hint  evas_object_image_content_hint_get       (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
6274
6275
6276 /**
6277  * Enable an image to be used as an alpha mask.
6278  *
6279  * This will set any flags, and discard any excess image data not used as an
6280  * alpha mask.
6281  *
6282  * Note there is little point in using a image as alpha mask unless it has an
6283  * alpha channel.
6284  *
6285  * @param obj Object to use as an alpha mask.
6286  * @param ismask Use image as alphamask, must be true.
6287  */
6288 EAPI void                     evas_object_image_alpha_mask_set         (Evas_Object *obj, Eina_Bool ismask) EINA_ARG_NONNULL(1);
6289
6290 /**
6291  * Set the source object on an image object to used as a @b proxy.
6292  *
6293  * @param obj Proxy (image) object.
6294  * @param src Source object to use for the proxy.
6295  * @return @c EINA_TRUE on success, @c EINA_FALSE on error.
6296  *
6297  * If an image object is set to behave as a @b proxy, it will mirror
6298  * the rendering contents of a given @b source object in its drawing
6299  * region, without affecting that source in any way. The source must
6300  * be another valid Evas object. Other effects may be applied to the
6301  * proxy, such as a map (see evas_object_map_set()) to create a
6302  * reflection of the original object (for example).
6303  *
6304  * Any existing source object on @p obj will be removed after this
6305  * call. Setting @p src to @c NULL clears the proxy object (not in
6306  * "proxy state" anymore).
6307  *
6308  * @warning You cannot set a proxy as another proxy's source.
6309  *
6310  * @see evas_object_image_source_get()
6311  * @see evas_object_image_source_unset()
6312  */
6313 EAPI Eina_Bool                evas_object_image_source_set             (Evas_Object *obj, Evas_Object *src) EINA_ARG_NONNULL(1);
6314
6315 /**
6316  * Get the current source object of an image object.
6317  *
6318  * @param obj Image object
6319  * @return Source object (if any), or @c NULL, if not in "proxy mode"
6320  * (or on errors).
6321  *
6322  * @see evas_object_image_source_set() for more details
6323  */
6324 EAPI Evas_Object             *evas_object_image_source_get             (Evas_Object *obj) EINA_ARG_NONNULL(1);
6325
6326 /**
6327  * Clear the source object on a proxy image object.
6328  *
6329  * @param obj Image object to clear source of.
6330  * @return @c EINA_TRUE on success, @c EINA_FALSE on error.
6331  *
6332  * This is equivalent to calling evas_object_image_source_set() with a
6333  * @c NULL source.
6334  */
6335 EAPI Eina_Bool                evas_object_image_source_unset           (Evas_Object *obj) EINA_ARG_NONNULL(1);
6336
6337 /**
6338  * Check if a file extention may be supported by @ref Evas_Object_Image.
6339  *
6340  * @param file The file to check
6341  * @return EINA_TRUE if we may be able to opeen it, EINA_FALSE if it's unlikely.
6342  * @since 1.1.0
6343  *
6344  * If file is a Eina_Stringshare, use directly @ref evas_object_image_extension_can_load_fast_get.
6345  *
6346  * This functions is threadsafe.
6347  */
6348 EAPI Eina_Bool evas_object_image_extension_can_load_get(const char *file);
6349
6350 /**
6351  * Check if a file extention may be supported by @ref Evas_Object_Image.
6352  *
6353  * @param file The file to check, it should be an Eina_Stringshare.
6354  * @return EINA_TRUE if we may be able to opeen it, EINA_FALSE if it's unlikely.
6355  * @since 1.1.0
6356  *
6357  * This functions is threadsafe.
6358  */
6359 EAPI Eina_Bool evas_object_image_extension_can_load_fast_get(const char *file);
6360
6361 /**
6362  * @}
6363  */
6364
6365 /**
6366  * @defgroup Evas_Object_Text Text Object Functions
6367  *
6368  * Functions that operate on single line, single style text objects.
6369  *
6370  * For multiline and multiple style text, see @ref Evas_Object_Textblock.
6371  *
6372  * @ingroup Evas_Object_Specific
6373  */
6374
6375 /**
6376  * @addtogroup Evas_Object_Text
6377  * @{
6378  */
6379
6380 /* basic styles (4 bits allocated use 0->10 now, 5 left) */
6381 #define EVAS_TEXT_STYLE_MASK_BASIC 0xf
6382
6383 /**
6384  * Text style type creation macro. Use style types on the 's'
6385  * arguments, being 'x' your style variable.
6386  */
6387 #define EVAS_TEXT_STYLE_BASIC_SET(x, s) \
6388    do { x = ((x) & ~EVAS_TEXT_STYLE_MASK_BASIC) | (s); } while (0)
6389
6390 #define EVAS_TEXT_STYLE_MASK_SHADOW_DIRECTION (0x7 << 4)
6391
6392 /**
6393  * Text style type creation macro. This one will impose shadow
6394  * directions on the style type variable -- use the @c
6395  * EVAS_TEXT_STYLE_SHADOW_DIRECTION_* values on 's', incremmentally.
6396  */
6397 #define EVAS_TEXT_STYLE_SHADOW_DIRECTION_SET(x, s) \
6398    do { x = ((x) & ~EVAS_TEXT_STYLE_MASK_SHADOW_DIRECTION) | (s); } while (0)
6399
6400    typedef enum _Evas_Text_Style_Type
6401      {
6402         EVAS_TEXT_STYLE_PLAIN, /**< plain, standard text */
6403         EVAS_TEXT_STYLE_SHADOW, /**< text with shadow underneath */
6404         EVAS_TEXT_STYLE_OUTLINE, /**< text with an outline */
6405         EVAS_TEXT_STYLE_SOFT_OUTLINE, /**< text with a soft outline */
6406         EVAS_TEXT_STYLE_GLOW, /**< text with a glow effect */
6407         EVAS_TEXT_STYLE_OUTLINE_SHADOW, /**< text with both outline and shadow effects */
6408         EVAS_TEXT_STYLE_FAR_SHADOW, /**< text with (far) shadow underneath */
6409         EVAS_TEXT_STYLE_OUTLINE_SOFT_SHADOW, /**< text with outline and soft shadow effects combined */
6410         EVAS_TEXT_STYLE_SOFT_SHADOW, /**< text with (soft) shadow underneath */
6411         EVAS_TEXT_STYLE_FAR_SOFT_SHADOW, /**< text with (far soft) shadow underneath */
6412
6413         /* OR these to modify shadow direction (3 bits needed) */
6414         EVAS_TEXT_STYLE_SHADOW_DIRECTION_BOTTOM_RIGHT = (0x0 << 4), /**< shadow growing to bottom right */
6415         EVAS_TEXT_STYLE_SHADOW_DIRECTION_BOTTOM       = (0x1 << 4), /**< shadow growing to the bottom */
6416         EVAS_TEXT_STYLE_SHADOW_DIRECTION_BOTTOM_LEFT  = (0x2 << 4), /**< shadow growing to bottom left */
6417         EVAS_TEXT_STYLE_SHADOW_DIRECTION_LEFT         = (0x3 << 4), /**< shadow growing to the left */
6418         EVAS_TEXT_STYLE_SHADOW_DIRECTION_TOP_LEFT     = (0x4 << 4), /**< shadow growing to top left */
6419         EVAS_TEXT_STYLE_SHADOW_DIRECTION_TOP          = (0x5 << 4), /**< shadow growing to the top */
6420         EVAS_TEXT_STYLE_SHADOW_DIRECTION_TOP_RIGHT    = (0x6 << 4), /**< shadow growing to top right */
6421         EVAS_TEXT_STYLE_SHADOW_DIRECTION_RIGHT        = (0x7 << 4) /**< shadow growing to the right */
6422      } 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 */
6423
6424 /**
6425  * Creates a new text object on the provided canvas.
6426  *
6427  * @param e The canvas to create the text object on.
6428  * @return @c NULL on error, a pointer to a new text object on
6429  * success.
6430  *
6431  * Text objects are for simple, single line text elements. If you want
6432  * more elaborated text blocks, see @ref Evas_Object_Textblock.
6433  *
6434  * @see evas_object_text_font_source_set()
6435  * @see evas_object_text_font_set()
6436  * @see evas_object_text_text_set()
6437  */
6438 EAPI Evas_Object      *evas_object_text_add              (Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
6439
6440 /**
6441  * Set the font (source) file to be used on a given text object.
6442  *
6443  * @param obj The text object to set font for.
6444  * @param font The font file's path.
6445  *
6446  * This function allows the font file to be explicitly set for a given
6447  * text object, overriding system lookup, which will first occur in
6448  * the given file's contents.
6449  *
6450  * @see evas_object_text_font_get()
6451  */
6452 EAPI void              evas_object_text_font_source_set  (Evas_Object *obj, const char *font) EINA_ARG_NONNULL(1);
6453
6454 /**
6455  * Get the font file's path which is being used on a given text
6456  * object.
6457  *
6458  * @param obj The text object to set font for.
6459  * @param font The font file's path.
6460  *
6461  * @see evas_object_text_font_get() for more details
6462  */
6463 EAPI const char       *evas_object_text_font_source_get  (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
6464
6465 /**
6466  * Set the font family and size on a given text object.
6467  *
6468  * @param obj The text object to set font for.
6469  * @param font The font (family) name.
6470  * @param size The font size, in points.
6471  *
6472  * This function allows the font name and size of a text object to be
6473  * set. The @p font string has to follow fontconfig's convention on
6474  * naming fonts, as it's the underlying lybrary used to query system
6475  * fonts by Evas (see the @c fc-list command's output, on your system,
6476  * to get an idea).
6477  *
6478  * @see evas_object_text_font_get()
6479  * @see evas_object_text_font_source_set()
6480  */
6481    EAPI void              evas_object_text_font_set         (Evas_Object *obj, const char *font, Evas_Font_Size size) EINA_ARG_NONNULL(1);
6482
6483 /**
6484  * Retrieve the font family and size in use on a given text object.
6485  *
6486  * @param obj The evas text object to query for font information.
6487  * @param font A pointer to the location to store the font name in.
6488  * @param size A pointer to the location to store the font size in.
6489  *
6490  * This function allows the font name and size of a text object to be
6491  * queried. Be aware that the font name string is still owned by Evas
6492  * and should @b not have free() called on it by the caller of the
6493  * function.
6494  *
6495  * @see evas_object_text_font_set()
6496  */
6497 EAPI void              evas_object_text_font_get         (const Evas_Object *obj, const char **font, Evas_Font_Size *size) EINA_ARG_NONNULL(1, 2);
6498
6499 /**
6500  * Sets the text string to be displayed by the given text object.
6501  *
6502  * @param obj The text object to set text string on.
6503  * @param text Text string to display on it.
6504  *
6505  * @see evas_object_text_text_get()
6506  */
6507 EAPI void              evas_object_text_text_set         (Evas_Object *obj, const char *text) EINA_ARG_NONNULL(1);
6508
6509 /**
6510  * Retrieves the text string currently being displayed by the given
6511  * text object.
6512  *
6513  * @param  obj The given text object.
6514  * @return The text string currently being displayed on it.
6515  *
6516  * @note Do not free() the return value.
6517  *
6518  * @see evas_object_text_text_set()
6519  */
6520 EAPI const char       *evas_object_text_text_get         (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
6521
6522 /**
6523  * @brief Sets the BiDi delimiters used in the textblock.
6524  *
6525  * BiDi delimiters are use for in-paragraph separation of bidi segments. This
6526  * is useful for example in recipients fields of e-mail clients where bidi
6527  * oddities can occur when mixing rtl and ltr.
6528  *
6529  * @param obj The given text object.
6530  * @param delim A null terminated string of delimiters, e.g ",|".
6531  * @since 1.1.0
6532  */
6533 EAPI void              evas_object_text_bidi_delimiters_set(Evas_Object *obj, const char *delim);
6534
6535 /**
6536  * @brief Gets the BiDi delimiters used in the textblock.
6537  *
6538  * BiDi delimiters are use for in-paragraph separation of bidi segments. This
6539  * is useful for example in recipients fields of e-mail clients where bidi
6540  * oddities can occur when mixing rtl and ltr.
6541  *
6542  * @param obj The given text object.
6543  * @return A null terminated string of delimiters, e.g ",|". If empty, returns NULL.
6544  * @since 1.1.0
6545  */
6546 EAPI const char       *evas_object_text_bidi_delimiters_get(const Evas_Object *obj);
6547
6548    EAPI Evas_Coord        evas_object_text_ascent_get       (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
6549    EAPI Evas_Coord        evas_object_text_descent_get      (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
6550    EAPI Evas_Coord        evas_object_text_max_ascent_get   (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
6551    EAPI Evas_Coord        evas_object_text_max_descent_get  (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
6552    EAPI Evas_Coord        evas_object_text_horiz_advance_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
6553    EAPI Evas_Coord        evas_object_text_vert_advance_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
6554    EAPI Evas_Coord        evas_object_text_inset_get        (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
6555
6556 /**
6557  * Retrieve position and dimension information of a character within a text @c Evas_Object.
6558  *
6559  * This function is used to obtain the X, Y, width and height of a the character
6560  * located at @p pos within the @c Evas_Object @p obj. @p obj must be a text object
6561  * as created with evas_object_text_add(). Any of the @c Evas_Coord parameters (@p cx,
6562  * @p cy, @p cw, @p ch) may be NULL in which case no value will be assigned to that
6563  * parameter.
6564  *
6565  * @param obj   The text object to retrieve position information for.
6566  * @param pos   The character position to request co-ordinates for.
6567  * @param cx    A pointer to an @c Evas_Coord to store the X value in (can be NULL).
6568  * @param cy    A pointer to an @c Evas_Coord to store the Y value in (can be NULL).
6569  * @param cw    A pointer to an @c Evas_Coord to store the Width value in (can be NULL).
6570  * @param ch    A pointer to an @c Evas_Coord to store the Height value in (can be NULL).
6571  *
6572  * @returns EINA_FALSE on error, EINA_TRUE on success.
6573  */
6574 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);
6575    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);
6576
6577 /**
6578  * Returns the logical position of the last char in the text
6579  * up to the pos given. this is NOT the position of the last char
6580  * because of the possibility of RTL in the text.
6581  */
6582 EAPI int               evas_object_text_last_up_to_pos   (const Evas_Object *obj, Evas_Coord x, Evas_Coord y) EINA_ARG_NONNULL(1);
6583
6584 /**
6585  * Retrieves the style on use on the given text object.
6586  *
6587  * @param obj the given text object to set style on.
6588  * @return the style type in use.
6589  *
6590  * @see evas_object_text_style_set() for more details.
6591  */
6592 EAPI Evas_Text_Style_Type evas_object_text_style_get     (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
6593
6594 /**
6595  * Sets the style to apply on the given text object.
6596  *
6597  * @param obj the given text object to set style on.
6598  * @param type a style type.
6599  *
6600  * Text object styles are one of the values in
6601  * #Evas_Text_Style_Type. Some of those values are combinations of
6602  * more than one style, and some account for the direction of the
6603  * rendering of shadow effects.
6604  *
6605  * @note One may use the helper macros #EVAS_TEXT_STYLE_BASIC_SET and
6606  * #EVAS_TEXT_STYLE_SHADOW_DIRECTION_SET to assemble a style value.
6607  *
6608  * @see evas_object_text_style_get()
6609  * @see evas_object_text_shadow_color_set()
6610  * @see evas_object_text_outline_color_set()
6611  * @see evas_object_text_glow_color_set()
6612  * @see evas_object_text_glow2_color_set()
6613  */
6614 EAPI void              evas_object_text_style_set        (Evas_Object *obj, Evas_Text_Style_Type type) EINA_ARG_NONNULL(1);
6615
6616 /**
6617  * Sets the shadow color for the given text object.
6618  *
6619  * @param obj The given Evas text object.
6620  * @param r The red component of the given color.
6621  * @param g The green component of the given color.
6622  * @param b The blue component of the given color.
6623  * @param a The alpha component of the given color.
6624  *
6625  * Shadow effects, which are fading colors decorating the text
6626  * underneath it, will just be shown if the object is set to one of
6627  * the following styles:
6628  *
6629  * - #EVAS_TEXT_STYLE_SHADOW
6630  * - #EVAS_TEXT_STYLE_OUTLINE_SHADOW
6631  * - #EVAS_TEXT_STYLE_FAR_SHADOW
6632  * - #EVAS_TEXT_STYLE_OUTLINE_SOFT_SHADOW
6633  * - #EVAS_TEXT_STYLE_SOFT_SHADOW
6634  * - #EVAS_TEXT_STYLE_FAR_SOFT_SHADOW
6635  *
6636  * One can also change de direction the shadow grows to, with
6637  * evas_object_text_style_set().
6638  *
6639  * @see evas_object_text_shadow_color_get()
6640  */
6641 EAPI void              evas_object_text_shadow_color_set (Evas_Object *obj, int r, int g, int b, int a) EINA_ARG_NONNULL(1);
6642
6643 /**
6644  * Retrieves the shadow color for the given text object.
6645  *
6646  * @param obj The given Evas text object.
6647  * @param r Pointer to variable to hold the red component of the given
6648  * color.
6649  * @param g Pointer to variable to hold the green component of the
6650  * given color.
6651  * @param b Pointer to variable to hold the blue component of the
6652  * given color.
6653  * @param a Pointer to variable to hold the alpha component of the
6654  * given color.
6655  *
6656  * @note Use @c NULL pointers on the color components you're not
6657  * interested in: they'll be ignored by the function.
6658  *
6659  * @see evas_object_text_shadow_color_set() for more details.
6660  */
6661 EAPI void              evas_object_text_shadow_color_get (const Evas_Object *obj, int *r, int *g, int *b, int *a) EINA_ARG_NONNULL(1);
6662
6663 /**
6664  * Sets the glow color for the given text object.
6665  *
6666  * @param obj The given Evas text object.
6667  * @param r The red component of the given color.
6668  * @param g The green component of the given color.
6669  * @param b The blue component of the given color.
6670  * @param a The alpha component of the given color.
6671  *
6672  * Glow effects, which are glowing colors decorating the text's
6673  * surroundings, will just be shown if the object is set to the
6674  * #EVAS_TEXT_STYLE_GLOW style.
6675  *
6676  * @note Glow effects are placed from a short distance of the text
6677  * itself, but no touching it. For glowing effects right on the
6678  * borders of the glyphs, see 'glow 2' effects
6679  * (evas_object_text_glow2_color_set()).
6680  *
6681  * @see evas_object_text_glow_color_get()
6682  */
6683 EAPI void              evas_object_text_glow_color_set   (Evas_Object *obj, int r, int g, int b, int a) EINA_ARG_NONNULL(1);
6684
6685 /**
6686  * Retrieves the glow color for the given text object.
6687  *
6688  * @param obj The given Evas text object.
6689  * @param r Pointer to variable to hold the red component of the given
6690  * color.
6691  * @param g Pointer to variable to hold the green component of the
6692  * given color.
6693  * @param b Pointer to variable to hold the blue component of the
6694  * given color.
6695  * @param a Pointer to variable to hold the alpha component of the
6696  * given color.
6697  *
6698  * @note Use @c NULL pointers on the color components you're not
6699  * interested in: they'll be ignored by the function.
6700  *
6701  * @see evas_object_text_glow_color_set() for more details.
6702  */
6703 EAPI void              evas_object_text_glow_color_get   (const Evas_Object *obj, int *r, int *g, int *b, int *a) EINA_ARG_NONNULL(1);
6704
6705 /**
6706  * Sets the 'glow 2' color for the given text object.
6707  *
6708  * @param obj The given Evas text object.
6709  * @param r The red component of the given color.
6710  * @param g The green component of the given color.
6711  * @param b The blue component of the given color.
6712  * @param a The alpha component of the given color.
6713  *
6714  * 'Glow 2' effects, which are glowing colors decorating the text's
6715  * (immediate) surroundings, will just be shown if the object is set
6716  * to the #EVAS_TEXT_STYLE_GLOW style. See also
6717  * evas_object_text_glow_color_set().
6718  *
6719  * @see evas_object_text_glow2_color_get()
6720  */
6721 EAPI void              evas_object_text_glow2_color_set  (Evas_Object *obj, int r, int g, int b, int a) EINA_ARG_NONNULL(1);
6722
6723 /**
6724  * Retrieves the 'glow 2' color for the given text object.
6725  *
6726  * @param obj The given Evas text object.
6727  * @param r Pointer to variable to hold the red component of the given
6728  * color.
6729  * @param g Pointer to variable to hold the green component of the
6730  * given color.
6731  * @param b Pointer to variable to hold the blue component of the
6732  * given color.
6733  * @param a Pointer to variable to hold the alpha component of the
6734  * given color.
6735  *
6736  * @note Use @c NULL pointers on the color components you're not
6737  * interested in: they'll be ignored by the function.
6738  *
6739  * @see evas_object_text_glow2_color_set() for more details.
6740  */
6741 EAPI void              evas_object_text_glow2_color_get  (const Evas_Object *obj, int *r, int *g, int *b, int *a) EINA_ARG_NONNULL(1);
6742
6743 /**
6744  * Sets the outline color for the given text object.
6745  *
6746  * @param obj The given Evas text object.
6747  * @param r The red component of the given color.
6748  * @param g The green component of the given color.
6749  * @param b The blue component of the given color.
6750  * @param a The alpha component of the given color.
6751  *
6752  * Outline effects (colored lines around text glyphs) will just be
6753  * shown if the object is set to one of the following styles:
6754  * - #EVAS_TEXT_STYLE_OUTLINE
6755  * - #EVAS_TEXT_STYLE_SOFT_OUTLINE
6756  * - #EVAS_TEXT_STYLE_OUTLINE_SHADOW
6757  * - #EVAS_TEXT_STYLE_OUTLINE_SOFT_SHADOW
6758  *
6759  * @see evas_object_text_outline_color_get()
6760  */
6761 EAPI void              evas_object_text_outline_color_set(Evas_Object *obj, int r, int g, int b, int a) EINA_ARG_NONNULL(1);
6762
6763 /**
6764  * Retrieves the outline color for the given text object.
6765  *
6766  * @param obj The given Evas text object.
6767  * @param r Pointer to variable to hold the red component of the given
6768  * color.
6769  * @param g Pointer to variable to hold the green component of the
6770  * given color.
6771  * @param b Pointer to variable to hold the blue component of the
6772  * given color.
6773  * @param a Pointer to variable to hold the alpha component of the
6774  * given color.
6775  *
6776  * @note Use @c NULL pointers on the color components you're not
6777  * interested in: they'll be ignored by the function.
6778  *
6779  * @see evas_object_text_outline_color_set() for more details.
6780  */
6781 EAPI void              evas_object_text_outline_color_get(const Evas_Object *obj, int *r, int *g, int *b, int *a) EINA_ARG_NONNULL(1);
6782
6783 /**
6784  * Gets the text style pad of a text object.
6785  *
6786  * @param obj The given text object.
6787  * @param l The left pad (or @c NULL).
6788  * @param r The right pad (or @c NULL).
6789  * @param t The top pad (or @c NULL).
6790  * @param b The bottom pad (or @c NULL).
6791  *
6792  */
6793 EAPI void              evas_object_text_style_pad_get    (const Evas_Object *obj, int *l, int *r, int *t, int *b) EINA_ARG_NONNULL(1);
6794
6795 /**
6796  * Retrieves the direction of the text currently being displayed in the
6797  * text object.
6798  * @param  obj The given evas text object.
6799  * @return the direction of the text
6800  */
6801 EAPI Evas_BiDi_Direction evas_object_text_direction_get  (const Evas_Object *obj) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
6802
6803 /**
6804  * @}
6805  */
6806
6807 /**
6808  * @defgroup Evas_Object_Textblock Textblock Object Functions
6809  *
6810  * Functions used to create and manipulate textblock objects. Unlike
6811  * @ref Evas_Object_Text, these handle complex text, doing multiple
6812  * styles and multiline text based on HTML-like tags. Of these extra
6813  * features will be heavier on memory and processing cost.
6814  *
6815  * @todo put here some usage examples
6816  *
6817  * @ingroup Evas_Object_Specific
6818  */
6819
6820 /**
6821  * @section Evas_Object_Textblock_Tutorial Textblock Object Tutorial
6822  *
6823  * This part explains about the textblock object's API and proper usage.
6824  * If you want to develop textblock, you should also refer to @ref Evas_Object_Textblock_Internal.
6825  * The main user of the textblock object is the edje entry object in Edje, so
6826  * that's a good place to learn from, but I think this document is more than
6827  * enough, if it's not, please request for me info and I'll update it.
6828  *
6829  * @subsection textblock_intro Introduction
6830  * The textblock objects is, as implied, an object that can show big chunks of
6831  * text. Textblock supports many features including: Text formatting, automatic
6832  * and manual text alignment, embedding items (for example icons) and more.
6833  * Textblock has three important parts, the text paragraphs, the format nodes
6834  * and the cursors.
6835  *
6836  * @subsection textblock_cursors Textblock Object Cursors
6837  * A textblock Cursor @ref Evas_Textblock_Cursor is data type that represents
6838  * a position in a textblock. Each cursor contains information about the
6839  * paragraph it points to, the position in that paragraph and the object itself.
6840  * Cursors register to textblock objects upon creation, this means that once
6841  * you created a cursor, it belongs to a specific obj and you can't for example
6842  * copy a cursor "into" a cursor of a different object. Registered cursors
6843  * also have the added benefit of updating automatically upon textblock changes,
6844  * this means that if you have a cursor pointing to a specific character, it'll
6845  * still point to it even after you change the whole object completely (as long
6846  * as the char was not deleted), this is not possible without updating, because
6847  * as mentioned, each cursor holds a character position. There are many
6848  * functions that handle cursors, just check out the evas_textblock_cursor*
6849  * functions. For creation and deletion of cursors check out:
6850  * @see evas_object_textblock_cursor_new()
6851  * @see evas_textblock_cursor_free()
6852  * @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).
6853  *
6854  * @subsection textblock_paragraphs Textblock Object Paragraphs
6855  * The textblock object is made out of text splitted to paragraphs (delimited
6856  * by the paragraph separation character). Each paragraph has many (or none)
6857  * format nodes associated with it which are responsible for the formatting
6858  * of that paragraph.
6859  *
6860  * @subsection textblock_format_nodes Textblock Object Format Nodes
6861  * As explained in @ref textblock_paragraphs each one of the format nodes
6862  * is associated with a paragraph.
6863  * There are two types of format nodes, visible and invisible:
6864  * Visible: formats that a cursor can point to, i.e formats that
6865  * occupy space, for example: newlines, tabs, items and etc. Some visible items
6866  * are made of two parts, in this case, only the opening tag is visible.
6867  * A closing tag (i.e a </tag> tag) should NEVER be visible.
6868  * Invisible: formats that don't occupy space, for example: bold and underline.
6869  * Being able to access format nodes is very important for some uses. For
6870  * example, edje uses the "<a>" format to create links in the text (and pop
6871  * popups above them when clicked). For the textblock object a is just a
6872  * formatting instruction (how to color the text), but edje utilizes the access
6873  * to the format nodes to make it do more.
6874  * For more information, take a look at all the evas_textblock_node_format_*
6875  * functions.
6876  * The translation of "<tag>" tags to actual format is done according to the
6877  * tags defined in the style, see @ref evas_textblock_style_set
6878  *
6879  * @subsection textblock_special_formats Special Formats
6880  * This section is not yet written. If you want some info about styles/formats
6881  * and how to use them, expedite's textblock_basic test is a great start.
6882  * @todo Write @textblock_special_formats
6883  */
6884    typedef struct _Evas_Textblock_Style                 Evas_Textblock_Style;
6885    typedef struct _Evas_Textblock_Cursor                Evas_Textblock_Cursor;
6886    /**
6887     * @typedef Evas_Object_Textblock_Node_Format
6888     * A format node.
6889     */
6890    typedef struct _Evas_Object_Textblock_Node_Format    Evas_Object_Textblock_Node_Format;
6891    typedef struct _Evas_Textblock_Rectangle             Evas_Textblock_Rectangle;
6892
6893    struct _Evas_Textblock_Rectangle
6894      {
6895         Evas_Coord x, y, w, h;
6896      };
6897
6898    typedef enum _Evas_Textblock_Text_Type
6899      {
6900         EVAS_TEXTBLOCK_TEXT_RAW,
6901         EVAS_TEXTBLOCK_TEXT_PLAIN,
6902         EVAS_TEXTBLOCK_TEXT_MARKUP
6903      } Evas_Textblock_Text_Type;
6904
6905    typedef enum _Evas_Textblock_Cursor_Type
6906      {
6907         EVAS_TEXTBLOCK_CURSOR_UNDER,
6908         EVAS_TEXTBLOCK_CURSOR_BEFORE
6909      } Evas_Textblock_Cursor_Type;
6910
6911
6912 /**
6913  * Adds a textblock to the given evas.
6914  * @param   e The given evas.
6915  * @return  The new textblock object.
6916  */
6917 EAPI Evas_Object                 *evas_object_textblock_add(Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
6918
6919
6920 /**
6921  * Returns the unescaped version of escape.
6922  * @param escape the string to be escaped
6923  * @return the unescaped version of escape
6924  */
6925 EAPI const char                  *evas_textblock_escape_string_get(const char *escape) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
6926
6927 /**
6928  * Returns the escaped version of the string.
6929  * @param string to escape
6930  * @param len_ret the len of the new escape
6931  * @return the escaped string.
6932  */
6933 EAPI const char                  *evas_textblock_string_escape_get(const char *string, int *len_ret) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
6934
6935 /**
6936  * Return the unescaped version of the string between start and end.
6937  *
6938  * @param escape_start the start of the string.
6939  * @param escape_end the end of the string.
6940  * @return the unescaped version of the range
6941  */
6942 EAPI const char                  *evas_textblock_escape_string_range_get(const char *escape_start, const char *escape_end) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2) EINA_PURE;
6943
6944
6945 /**
6946  * Creates a new textblock style.
6947  * @return  The new textblock style.
6948  */
6949 EAPI Evas_Textblock_Style        *evas_textblock_style_new(void) EINA_WARN_UNUSED_RESULT EINA_MALLOC;
6950
6951 /**
6952  * Destroys a textblock style.
6953  * @param ts The textblock style to free.
6954  */
6955 EAPI void                         evas_textblock_style_free(Evas_Textblock_Style *ts) EINA_ARG_NONNULL(1);
6956
6957 /**
6958  * Sets the style ts to the style passed as text by text.
6959  * Expected a string consisting of many (or none) tag='format' pairs.
6960  *
6961  * @param ts  the style to set.
6962  * @param text the text to parse - NOT NULL.
6963  * @return Returns no value.
6964  */
6965 EAPI void                         evas_textblock_style_set(Evas_Textblock_Style *ts, const char *text) EINA_ARG_NONNULL(1);
6966
6967 /**
6968  * Return the text of the style ts.
6969  * @param ts  the style to get it's text.
6970  * @return the text of the style or null on error.
6971  */
6972 EAPI const char                  *evas_textblock_style_get(const Evas_Textblock_Style *ts) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
6973
6974
6975 /**
6976  * Set the objects style to ts.
6977  * @param obj the Evas object to set the style to.
6978  * @param ts  the style to set.
6979  * @return Returns no value.
6980  */
6981 EAPI void                         evas_object_textblock_style_set(Evas_Object *obj, Evas_Textblock_Style *ts) EINA_ARG_NONNULL(1);
6982
6983 /**
6984  * Return the style of an object.
6985  * @param obj  the object to get the style from.
6986  * @return the style of the object.
6987  */
6988 EAPI const Evas_Textblock_Style  *evas_object_textblock_style_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
6989
6990 /**
6991  * @brief Set the "replacement character" to use for the given textblock object.
6992  *
6993  * @param obj The given textblock object.
6994  * @param ch The charset name.
6995  */
6996 EAPI void                         evas_object_textblock_replace_char_set(Evas_Object *obj, const char *ch) EINA_ARG_NONNULL(1);
6997
6998 /**
6999  * @brief Get the "replacement character" for given textblock object. Returns
7000  * NULL if no replacement character is in use.
7001  *
7002  * @param obj The given textblock object
7003  * @return replacement character or @c NULL
7004  */
7005 EAPI const char                  *evas_object_textblock_replace_char_get(Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
7006
7007 /**
7008  * @brief Sets the vertical alignment of text within the textblock object
7009  * as a whole.
7010  *
7011  * Normally alignment is 0.0 (top of object). Values given should be
7012  * between 0.0 and 1.0 (1.0 bottom of object, 0.5 being vertically centered
7013  * etc.).
7014  *
7015  * @param obj The given textblock object.
7016  * @param align A value between 0.0 and 1.0
7017  * @since 1.1.0
7018  */
7019 EAPI void                         evas_object_textblock_valign_set(Evas_Object *obj, double align);
7020
7021 /**
7022  * @brief Gets the vertical alignment of a textblock
7023  *
7024  * @param obj The given textblock object.
7025  * @return The elignment set for the object
7026  * @since 1.1.0
7027  */
7028 EAPI double                       evas_object_textblock_valign_get(const Evas_Object *obj);
7029
7030 /**
7031  * @brief Sets the BiDi delimiters used in the textblock.
7032  *
7033  * BiDi delimiters are use for in-paragraph separation of bidi segments. This
7034  * is useful for example in recipients fields of e-mail clients where bidi
7035  * oddities can occur when mixing rtl and ltr.
7036  *
7037  * @param obj The given textblock object.
7038  * @param delim A null terminated string of delimiters, e.g ",|".
7039  * @since 1.1.0
7040  */
7041 EAPI void                         evas_object_textblock_bidi_delimiters_set(Evas_Object *obj, const char *delim);
7042
7043 /**
7044  * @brief Gets the BiDi delimiters used in the textblock.
7045  *
7046  * BiDi delimiters are use for in-paragraph separation of bidi segments. This
7047  * is useful for example in recipients fields of e-mail clients where bidi
7048  * oddities can occur when mixing rtl and ltr.
7049  *
7050  * @param obj The given textblock object.
7051  * @return A null terminated string of delimiters, e.g ",|". If empty, returns NULL.
7052  * @since 1.1.0
7053  */
7054 EAPI const char                  *evas_object_textblock_bidi_delimiters_get(const Evas_Object *obj);
7055
7056 /**
7057  * @brief Sets newline mode. When true, newline character will behave
7058  * as a paragraph separator.
7059  *
7060  * @param obj The given textblock object.
7061  * @param mode EINA_TRUE for PS mode, EINA_FALSE otherwise.
7062  * @since 1.1.0
7063  */
7064 EAPI void                         evas_object_textblock_newline_mode_set(Evas_Object *obj, Eina_Bool mode) EINA_ARG_NONNULL(1);
7065
7066 /**
7067  * @brief Gets newline mode. When true, newline character behaves
7068  * as a paragraph separator.
7069  *
7070  * @param obj The given textblock object.
7071  * @return EINA_TRUE if in PS mode, EINA_FALSE otherwise.
7072  * @since 1.1.0
7073  */
7074 EAPI Eina_Bool                    evas_object_textblock_newline_mode_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
7075
7076
7077 /**
7078  * Sets the tetxblock's text to the markup text.
7079  *
7080  * @note assumes text does not include the unicode object replacement char (0xFFFC)
7081  *
7082  * @param obj  the textblock object.
7083  * @param text the markup text to use.
7084  * @return Return no value.
7085  */
7086 EAPI void                         evas_object_textblock_text_markup_set(Evas_Object *obj, const char *text) EINA_ARG_NONNULL(1);
7087
7088 /**
7089  * Prepends markup to the cursor cur.
7090  *
7091  * @note assumes text does not include the unicode object replacement char (0xFFFC)
7092  *
7093  * @param cur  the cursor to prepend to.
7094  * @param text the markup text to prepend.
7095  * @return Return no value.
7096  */
7097 EAPI void                         evas_object_textblock_text_markup_prepend(Evas_Textblock_Cursor *cur, const char *text) EINA_ARG_NONNULL(1, 2);
7098
7099 /**
7100  * Return the markup of the object.
7101  *
7102  * @param obj the Evas object.
7103  * @return the markup text of the object.
7104  */
7105 EAPI const char                  *evas_object_textblock_text_markup_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
7106
7107
7108 /**
7109  * Return the object's main cursor.
7110  *
7111  * @param obj the object.
7112  * @return the obj's main cursor.
7113  */
7114 EAPI const Evas_Textblock_Cursor *evas_object_textblock_cursor_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
7115
7116 /**
7117  * Create a new cursor, associate it to the obj and init it to point
7118  * to the start of the textblock. Association to the object means the cursor
7119  * will be updated when the object will change.
7120  *
7121  * @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).
7122  *
7123  * @param obj the object to associate to.
7124  * @return the new cursor.
7125  */
7126 EAPI Evas_Textblock_Cursor       *evas_object_textblock_cursor_new(Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
7127
7128
7129 /**
7130  * Free the cursor and unassociate it from the object.
7131  * @note do not use it to free unassociated cursors.
7132  *
7133  * @param cur the cursor to free.
7134  * @return Returns no value.
7135  */
7136 EAPI void                         evas_textblock_cursor_free(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
7137
7138
7139 /**
7140  * Sets the cursor to the start of the first text node.
7141  *
7142  * @param cur the cursor to update.
7143  * @return Returns no value.
7144  */
7145 EAPI void                         evas_textblock_cursor_paragraph_first(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
7146
7147 /**
7148  * sets the cursor to the end of the last text node.
7149  *
7150  * @param cur the cursor to set.
7151  * @return Returns no value.
7152  */
7153 EAPI void                         evas_textblock_cursor_paragraph_last(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
7154
7155 /**
7156  * Advances to the start of the next text node
7157  *
7158  * @param cur the cursor to update
7159  * @return #EINA_TRUE if it managed to advance a paragraph, #EINA_FALSE otherwise.
7160  */
7161 EAPI Eina_Bool                    evas_textblock_cursor_paragraph_next(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
7162
7163 /**
7164  * Advances to the end of the previous text node
7165  *
7166  * @param cur the cursor to update
7167  * @return #EINA_TRUE if it managed to advance a paragraph, #EINA_FALSE otherwise.
7168  */
7169 EAPI Eina_Bool                    evas_textblock_cursor_paragraph_prev(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
7170
7171 /**
7172  * Returns the
7173  *
7174  * @param obj The evas, must not be NULL.
7175  * @param anchor the anchor name to get
7176  * @return Returns the list format node corresponding to the anchor, may be null if there are none.
7177  */
7178 EAPI const Eina_List             *evas_textblock_node_format_list_get(const Evas_Object *obj, const char *anchor) EINA_ARG_NONNULL(1, 2);
7179
7180 /**
7181  * Returns the first format node.
7182  *
7183  * @param obj The evas, must not be NULL.
7184  * @return Returns the first format node, may be null if there are none.
7185  */
7186 EAPI const Evas_Object_Textblock_Node_Format *evas_textblock_node_format_first_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
7187
7188 /**
7189  * Returns the last format node.
7190  *
7191  * @param obj The evas textblock, must not be NULL.
7192  * @return Returns the first format node, may be null if there are none.
7193  */
7194 EAPI const Evas_Object_Textblock_Node_Format *evas_textblock_node_format_last_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
7195
7196 /**
7197  * Returns the next format node (after n)
7198  *
7199  * @param n the current format node - not null.
7200  * @return Returns the next format node, may be null.
7201  */
7202 EAPI const Evas_Object_Textblock_Node_Format *evas_textblock_node_format_next_get(const Evas_Object_Textblock_Node_Format *n) EINA_ARG_NONNULL(1);
7203
7204 /**
7205  * Returns the prev format node (after n)
7206  *
7207  * @param n the current format node - not null.
7208  * @return Returns the prev format node, may be null.
7209  */
7210 EAPI const Evas_Object_Textblock_Node_Format *evas_textblock_node_format_prev_get(const Evas_Object_Textblock_Node_Format *n) EINA_ARG_NONNULL(1);
7211
7212 /**
7213  * Remove a format node and it's match. i.e, removes a <tag> </tag> pair.
7214  * Assumes the node is the first part of <tag> i.e, this won't work if
7215  * n is a closing tag.
7216  *
7217  * @param obj the Evas object of the textblock - not null.
7218  * @param n the current format node - not null.
7219  */
7220 EAPI void                         evas_textblock_node_format_remove_pair(Evas_Object *obj, Evas_Object_Textblock_Node_Format *n) EINA_ARG_NONNULL(1, 2);
7221
7222 /**
7223  * Sets the cursor to point to the place where format points to.
7224  *
7225  * @param cur the cursor to update.
7226  * @param n the format node to update according.
7227  */
7228 EAPI void                         evas_textblock_cursor_set_at_format(Evas_Textblock_Cursor *cur, const Evas_Object_Textblock_Node_Format *n) EINA_ARG_NONNULL(1, 2);
7229
7230 /**
7231  * Return the format node at the position pointed by cur.
7232  *
7233  * @param cur the position to look at.
7234  * @return the format node if found, NULL otherwise.
7235  * @see evas_textblock_cursor_format_is_visible_get()
7236  */
7237 EAPI const Evas_Object_Textblock_Node_Format *evas_textblock_cursor_format_get(const Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
7238
7239 /**
7240  * Get the text format representation of the format node.
7241  *
7242  * @param fmt the format node.
7243  * @return the textual format of the format node.
7244  */
7245 EAPI const char                  *evas_textblock_node_format_text_get(const Evas_Object_Textblock_Node_Format *cur) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
7246
7247 /**
7248  * Set the cursor to point to the position of fmt.
7249  *
7250  * @param cur the cursor to update
7251  * @param fmt the format to update according to.
7252  */
7253 EAPI void                         evas_textblock_cursor_at_format_set(Evas_Textblock_Cursor *cur, const Evas_Object_Textblock_Node_Format *fmt) EINA_ARG_NONNULL(1, 2);
7254
7255 /**
7256  * Check if the current cursor position is a visible format. This way is more
7257  * efficient than evas_textblock_cursor_format_get() to check for the existence
7258  * of a visible format.
7259  *
7260  * @param cur the cursor to look at.
7261  * @return #EINA_TRUE if the cursor points to a visible format, #EINA_FALSE otherwise.
7262  * @see evas_textblock_cursor_format_get()
7263  */
7264 EAPI Eina_Bool                    evas_textblock_cursor_format_is_visible_get(const Evas_Textblock_Cursor *cur) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
7265
7266 /**
7267  * Advances to the next format node
7268  *
7269  * @param cur the cursor to be updated.
7270  * @return #EINA_TRUE on success #EINA_FALSE otherwise.
7271  */
7272 EAPI Eina_Bool                    evas_textblock_cursor_format_next(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
7273
7274 /**
7275  * Advances to the previous format node.
7276  *
7277  * @param cur the cursor to update.
7278  * @return #EINA_TRUE on success #EINA_FALSE otherwise.
7279  */
7280 EAPI Eina_Bool                    evas_textblock_cursor_format_prev(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
7281
7282 /**
7283  * Returns true if the cursor points to a format.
7284  *
7285  * @param cur the cursor to check.
7286  * @return Returns #EINA_TRUE if a cursor points to a format #EINA_FALSE otherwise.
7287  */
7288 EAPI Eina_Bool                    evas_textblock_cursor_is_format(const Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
7289
7290 /**
7291  * Advances 1 char forward.
7292  *
7293  * @param cur the cursor to advance.
7294  * @return #EINA_TRUE on success #EINA_FALSE otherwise.
7295  */
7296 EAPI Eina_Bool                    evas_textblock_cursor_char_next(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
7297
7298 /**
7299  * Advances 1 char backward.
7300  *
7301  * @param cur the cursor to advance.
7302  * @return #EINA_TRUE on success #EINA_FALSE otherwise.
7303  */
7304 EAPI Eina_Bool                    evas_textblock_cursor_char_prev(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
7305
7306 /**
7307  * Go to the first char in the node the cursor is pointing on.
7308  *
7309  * @param cur the cursor to update.
7310  * @return Returns no value.
7311  */
7312 EAPI void                         evas_textblock_cursor_paragraph_char_first(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
7313
7314 /**
7315  * Go to the last char in a text node.
7316  *
7317  * @param cur the cursor to update.
7318  * @return Returns no value.
7319  */
7320 EAPI void                         evas_textblock_cursor_paragraph_char_last(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
7321
7322 /**
7323  * Go to the start of the current line
7324  *
7325  * @param cur the cursor to update.
7326  * @return Returns no value.
7327  */
7328 EAPI void                         evas_textblock_cursor_line_char_first(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
7329
7330 /**
7331  * Go to the end of the current line.
7332  *
7333  * @param cur the cursor to update.
7334  * @return Returns no value.
7335  */
7336 EAPI void                         evas_textblock_cursor_line_char_last(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
7337
7338 /**
7339  * Return the current cursor pos.
7340  *
7341  * @param cur the cursor to take the position from.
7342  * @return the position or -1 on error
7343  */
7344 EAPI int                          evas_textblock_cursor_pos_get(const Evas_Textblock_Cursor *cur) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
7345
7346 /**
7347  * Set the cursor pos.
7348  *
7349  * @param cur the cursor to be set.
7350  * @param pos the pos to set.
7351  */
7352 EAPI void                         evas_textblock_cursor_pos_set(Evas_Textblock_Cursor *cur, int pos) EINA_ARG_NONNULL(1);
7353
7354 /**
7355  * Go to the start of the line passed
7356  *
7357  * @param cur cursor to update.
7358  * @param line numer to set.
7359  * @return #EINA_TRUE on success, #EINA_FALSE on error.
7360  */
7361 EAPI Eina_Bool                    evas_textblock_cursor_line_set(Evas_Textblock_Cursor *cur, int line) EINA_ARG_NONNULL(1);
7362
7363 /**
7364  * Compare two cursors.
7365  *
7366  * @param cur1 the first cursor.
7367  * @param cur2 the second cursor.
7368  * @return -1 if cur1 < cur2, 0 if cur1 == cur2 and 1 otherwise.
7369  */
7370 EAPI int                          evas_textblock_cursor_compare(const Evas_Textblock_Cursor *cur1, const Evas_Textblock_Cursor *cur2) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2) EINA_PURE;
7371
7372 /**
7373  * Make cur_dest point to the same place as cur. Does not work if they don't
7374  * point to the same object.
7375  *
7376  * @param cur the source cursor.
7377  * @param cur_dest destination cursor.
7378  * @return Returns no value.
7379  */
7380 EAPI void                         evas_textblock_cursor_copy(const Evas_Textblock_Cursor *cur, Evas_Textblock_Cursor *cur_dest) EINA_ARG_NONNULL(1, 2);
7381
7382
7383 /**
7384  * Adds text to the current cursor position and set the cursor to *before*
7385  * the start of the text just added.
7386  *
7387  * @param cur the cursor to where to add text at.
7388  * @param _text the text to add.
7389  * @return Returns the len of the text added.
7390  * @see evas_textblock_cursor_text_prepend()
7391  */
7392 EAPI int                          evas_textblock_cursor_text_append(Evas_Textblock_Cursor *cur, const char *text) EINA_ARG_NONNULL(1, 2);
7393
7394 /**
7395  * Adds text to the current cursor position and set the cursor to *after*
7396  * the start of the text just added.
7397  *
7398  * @param cur the cursor to where to add text at.
7399  * @param _text the text to add.
7400  * @return Returns the len of the text added.
7401  * @see evas_textblock_cursor_text_append()
7402  */
7403 EAPI int                          evas_textblock_cursor_text_prepend(Evas_Textblock_Cursor *cur, const char *text) EINA_ARG_NONNULL(1, 2);
7404
7405
7406 /**
7407  * Adds format to the current cursor position. If the format being added is a
7408  * visible format, add it *before* the cursor position, otherwise, add it after.
7409  * This behavior is because visible formats are like characters and invisible
7410  * should be stacked in a way that the last one is added last.
7411  *
7412  * This function works with native formats, that means that style defined
7413  * tags like <br> won't work here. For those kind of things use markup prepend.
7414  *
7415  * @param cur the cursor to where to add format at.
7416  * @param format the format to add.
7417  * @return Returns true if a visible format was added, false otherwise.
7418  * @see evas_textblock_cursor_format_prepend()
7419  */
7420
7421 /**
7422  * Check if the current cursor position points to the terminating null of the
7423  * last paragraph. (shouldn't be allowed to point to the terminating null of
7424  * any previous paragraph anyway.
7425  *
7426  * @param cur the cursor to look at.
7427  * @return #EINA_TRUE if the cursor points to the terminating null, #EINA_FALSE otherwise.
7428  */
7429 EAPI Eina_Bool                    evas_textblock_cursor_format_append(Evas_Textblock_Cursor *cur, const char *format) EINA_ARG_NONNULL(1, 2);
7430
7431 /**
7432  * Adds format to the current cursor position. If the format being added is a
7433  * visible format, add it *before* the cursor position, otherwise, add it after.
7434  * This behavior is because visible formats are like characters and invisible
7435  * should be stacked in a way that the last one is added last.
7436  * If the format is visible the cursor is advanced after it.
7437  *
7438  * This function works with native formats, that means that style defined
7439  * tags like <br> won't work here. For those kind of things use markup prepend.
7440  *
7441  * @param cur the cursor to where to add format at.
7442  * @param format the format to add.
7443  * @return Returns true if a visible format was added, false otherwise.
7444  * @see evas_textblock_cursor_format_prepend()
7445  */
7446 EAPI Eina_Bool                    evas_textblock_cursor_format_prepend(Evas_Textblock_Cursor *cur, const char *format) EINA_ARG_NONNULL(1, 2);
7447
7448 /**
7449  * Delete the character at the location of the cursor. If there's a format
7450  * pointing to this position, delete it as well.
7451  *
7452  * @param cur the cursor pointing to the current location.
7453  * @return Returns no value.
7454  */
7455 EAPI void                         evas_textblock_cursor_char_delete(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
7456
7457 /**
7458  * Delete the range between cur1 and cur2.
7459  *
7460  * @param cur1 one side of the range.
7461  * @param cur2 the second side of the range
7462  * @return Returns no value.
7463  */
7464 EAPI void                         evas_textblock_cursor_range_delete(Evas_Textblock_Cursor *cur1, Evas_Textblock_Cursor *cur2) EINA_ARG_NONNULL(1, 2);
7465
7466
7467 /**
7468  * Return the text of the paragraph cur points to - returns the text in markup..
7469  *
7470  * @param cur the cursor pointing to the paragraph.
7471  * @return the text on success, NULL otherwise.
7472  */
7473 EAPI const char                  *evas_textblock_cursor_paragraph_text_get(const Evas_Textblock_Cursor *cur) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
7474
7475 /**
7476  * Return the length of the paragraph, cheaper the eina_unicode_strlen()
7477  *
7478  * @param cur the position of the paragraph.
7479  * @return the length of the paragraph on success, -1 otehrwise.
7480  */
7481 EAPI int                          evas_textblock_cursor_paragraph_text_length_get(const Evas_Textblock_Cursor *cur) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
7482
7483 /**
7484  * Return the text in the range between cur1 and cur2
7485  *
7486  * FIXME: format is currently unused, you always get markup back.
7487  *
7488  * @param cur1 one side of the range.
7489  * @param cur2 the other side of the range
7490  * @param format to be documented
7491  * @return the text in the range
7492  * @see elm_entry_markup_to_utf8()
7493  */
7494 EAPI char                        *evas_textblock_cursor_range_text_get(const Evas_Textblock_Cursor *cur1, const Evas_Textblock_Cursor *cur2, Evas_Textblock_Text_Type format) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2) EINA_PURE;
7495
7496 /**
7497  * Return the content of the cursor.
7498  *
7499  * @param cur the cursor
7500  * @return the text in the range
7501  */
7502 EAPI char                        *evas_textblock_cursor_content_get(const Evas_Textblock_Cursor *cur) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
7503
7504
7505 /**
7506  * Returns the geometry of the cursor. Depends on the type of cursor requested.
7507  * This should be used instead of char_geometry_get because there are weird
7508  * special cases with BiDi text.
7509  * in '_' cursor mode (i.e a line below the char) it's the same as char_geometry
7510  * get, except for the case of the last char of a line which depends on the
7511  * paragraph direction.
7512  *
7513  * in '|' cursor mode (i.e a line between two chars) it is very varyable.
7514  * For example consider the following visual string:
7515  * "abcCBA" (ABC are rtl chars), a cursor pointing on A should actually draw
7516  * a '|' between the c and the C.
7517  *
7518  * @param cur the cursor.
7519  * @param cx the x of the cursor
7520  * @param cy the y of the cursor
7521  * @param cw the width of the cursor
7522  * @param ch the height of the cursor
7523  * @param dir the direction of the cursor, can be NULL.
7524  * @param ctype the type of the cursor.
7525  * @return line number of the char on success, -1 on error.
7526  */
7527 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);
7528
7529 /**
7530  * Returns the geometry of the char at cur.
7531  *
7532  * @param cur the position of the char.
7533  * @param cx the x of the char.
7534  * @param cy the y of the char.
7535  * @param cw the w of the char.
7536  * @param ch the h of the char.
7537  * @return line number of the char on success, -1 on error.
7538  */
7539 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);
7540
7541 /**
7542  * Returns the geometry of the pen at cur.
7543  *
7544  * @param cur the position of the char.
7545  * @param cpen_x the pen_x of the char.
7546  * @param cy the y of the char.
7547  * @param cadv the adv of the char.
7548  * @param ch the h of the char.
7549  * @return line number of the char on success, -1 on error.
7550  */
7551 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);
7552
7553 /**
7554  * Returns the geometry of the line at cur.
7555  *
7556  * @param cur the position of the line.
7557  * @param cx the x of the line.
7558  * @param cy the y of the line.
7559  * @param cw the width of the line.
7560  * @param ch the height of the line.
7561  * @return line number of the line on success, -1 on error.
7562  */
7563 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);
7564
7565 /**
7566  * Set the position of the cursor according to the X and Y coordinates.
7567  *
7568  * @param cur the cursor to set.
7569  * @param x coord to set by.
7570  * @param y coord to set by.
7571  * @return #EINA_TRUE on success, #EINA_FALSE otherwise.
7572  */
7573 EAPI Eina_Bool                    evas_textblock_cursor_char_coord_set(Evas_Textblock_Cursor *cur, Evas_Coord x, Evas_Coord y) EINA_ARG_NONNULL(1);
7574
7575 /**
7576  * Set the cursor position according to the y coord.
7577  *
7578  * @param cur the cur to be set.
7579  * @param y the coord to set by.
7580  * @return the line number found, -1 on error.
7581  */
7582 EAPI int                          evas_textblock_cursor_line_coord_set(Evas_Textblock_Cursor *cur, Evas_Coord y) EINA_ARG_NONNULL(1);
7583
7584 /**
7585  * Get the geometry of a range.
7586  *
7587  * @param cur1 one side of the range.
7588  * @param cur2 other side of the range.
7589  * @return a list of Rectangles representing the geometry of the range.
7590  */
7591 EAPI Eina_List                   *evas_textblock_cursor_range_geometry_get(const Evas_Textblock_Cursor *cur1, const Evas_Textblock_Cursor *cur2) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2) EINA_PURE;
7592    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);
7593
7594
7595 /**
7596  * Checks if the cursor points to the end of the line.
7597  *
7598  * @param cur the cursor to check.
7599  * @return #EINA_TRUE if true, #EINA_FALSE otherwise.
7600  */
7601 EAPI Eina_Bool                    evas_textblock_cursor_eol_get(const Evas_Textblock_Cursor *cur) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
7602
7603
7604 /**
7605  * Get the geometry of a line number.
7606  *
7607  * @param obj the object.
7608  * @param line the line number.
7609  * @param cx x coord of the line.
7610  * @param cy y coord of the line.
7611  * @param cw w coord of the line.
7612  * @param ch h coord of the line.
7613  * @return #EINA_TRUE on success, #EINA_FALSE otherwise.
7614  */
7615 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);
7616
7617 /**
7618  * Clear the textblock object.
7619  * @note Does *NOT* free the Evas object itself.
7620  *
7621  * @param obj the object to clear.
7622  * @return nothing.
7623  */
7624 EAPI void                         evas_object_textblock_clear(Evas_Object *obj) EINA_ARG_NONNULL(1);
7625
7626 /**
7627  * Get the formatted width and height. This calculates the actual size after restricting
7628  * the textblock to the current size of the object.
7629  * The main difference between this and @ref evas_object_textblock_size_native_get
7630  * is that the "native" function does not wrapping into account
7631  * it just calculates the real width of the object if it was placed on an
7632  * infinite canvas, while this function gives the size after wrapping
7633  * according to the size restrictions of the object.
7634  *
7635  * For example for a textblock containing the text: "You shall not pass!"
7636  * with no margins or padding and assuming a monospace font and a size of
7637  * 7x10 char widths (for simplicity) has a native size of 19x1
7638  * and a formatted size of 5x4.
7639  *
7640  *
7641  * @param obj the Evas object.
7642  * @param w[out] the width of the object.
7643  * @param h[out] the height of the object
7644  * @return Returns no value.
7645  * @see evas_object_textblock_size_native_get
7646  */
7647 EAPI void                         evas_object_textblock_size_formatted_get(const Evas_Object *obj, Evas_Coord *w, Evas_Coord *h) EINA_ARG_NONNULL(1);
7648
7649 /**
7650  * Get the native width and height. This calculates the actual size without taking account
7651  * the current size of the object.
7652  * The main difference between this and @ref evas_object_textblock_size_formatted_get
7653  * is that the "native" function does not take wrapping into account
7654  * it just calculates the real width of the object if it was placed on an
7655  * infinite canvas, while the "formatted" function gives the size after
7656  * wrapping text according to the size restrictions of the object.
7657  *
7658  * For example for a textblock containing the text: "You shall not pass!"
7659  * with no margins or padding and assuming a monospace font and a size of
7660  * 7x10 char widths (for simplicity) has a native size of 19x1
7661  * and a formatted size of 5x4.
7662  *
7663  * @param obj the Evas object of the textblock
7664  * @param w[out] the width returned
7665  * @param h[out] the height returned
7666  * @return Returns no value.
7667  */
7668 EAPI void                         evas_object_textblock_size_native_get(const Evas_Object *obj, Evas_Coord *w, Evas_Coord *h) EINA_ARG_NONNULL(1);
7669    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);
7670
7671 /**
7672  * @defgroup Evas_Line_Group Line Object Functions
7673  *
7674  * Functions used to deal with evas line objects.
7675  *
7676  * @ingroup Evas_Object_Specific
7677  */
7678
7679 /**
7680  * Adds a new evas line object to the given evas.
7681  * @param   e The given evas.
7682  * @return  The new evas line object.
7683  */
7684 EAPI Evas_Object      *evas_object_line_add              (Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
7685
7686 /**
7687  * Sets the coordinates of the end points of the given evas line object.
7688  * @param   obj The given evas line object.
7689  * @param   x1  The X coordinate of the first point.
7690  * @param   y1  The Y coordinate of the first point.
7691  * @param   x2  The X coordinate of the second point.
7692  * @param   y2  The Y coordinate of the second point.
7693  */
7694 EAPI void              evas_object_line_xy_set           (Evas_Object *obj, Evas_Coord x1, Evas_Coord y1, Evas_Coord x2, Evas_Coord y2);
7695
7696 /**
7697  * Retrieves the coordinates of the end points of the given evas line object.
7698  * @param obj The given line object.
7699  * @param x1  Pointer to an integer in which to store the X coordinate of the
7700  *            first end point.
7701  * @param y1  Pointer to an integer in which to store the Y coordinate of the
7702  *            first end point.
7703  * @param x2  Pointer to an integer in which to store the X coordinate of the
7704  *            second end point.
7705  * @param y2  Pointer to an integer in which to store the Y coordinate of the
7706  *            second end point.
7707  */
7708 EAPI void              evas_object_line_xy_get           (const Evas_Object *obj, Evas_Coord *x1, Evas_Coord *y1, Evas_Coord *x2, Evas_Coord *y2);
7709
7710 /**
7711  * @defgroup Evas_Object_Polygon Polygon Object Functions
7712  *
7713  * Functions that operate on evas polygon objects.
7714  *
7715  * Hint: as evas does not provide ellipse, smooth paths or circle, one
7716  * can calculate points and convert these to a polygon.
7717  *
7718  * @ingroup Evas_Object_Specific
7719  */
7720
7721 /**
7722  * Adds a new evas polygon object to the given evas.
7723  * @param   e The given evas.
7724  * @return  A new evas polygon object.
7725  */
7726 EAPI Evas_Object      *evas_object_polygon_add           (Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
7727
7728 /**
7729  * Adds the given point to the given evas polygon object.
7730  * @param obj The given evas polygon object.
7731  * @param x   The X coordinate of the given point.
7732  * @param y   The Y coordinate of the given point.
7733  * @ingroup Evas_Polygon_Group
7734  */
7735 EAPI void              evas_object_polygon_point_add     (Evas_Object *obj, Evas_Coord x, Evas_Coord y) EINA_ARG_NONNULL(1);
7736
7737 /**
7738  * Removes all of the points from the given evas polygon object.
7739  * @param   obj The given polygon object.
7740  */
7741 EAPI void              evas_object_polygon_points_clear  (Evas_Object *obj) EINA_ARG_NONNULL(1);
7742
7743 /**
7744  * @defgroup Evas_Smart_Group Smart Functions
7745  *
7746  * Functions that deal with Evas_Smart's, creating definition
7747  * (classes) of objects that will have customized behavior for methods
7748  * like evas_object_move(), evas_object_resize(),
7749  * evas_object_clip_set() and others.
7750  *
7751  * These objects will accept the generic methods defined in @ref
7752  * Evas_Object_Group and the extensions defined in @ref
7753  * Evas_Smart_Object_Group. There are couple of existent smart objects
7754  * in Evas itself, see @ref Evas_Object_Box, @ref Evas_Object_Table
7755  * and @ref Evas_Smart_Object_Clipped.
7756  */
7757
7758 /**
7759  * @def EVAS_SMART_CLASS_VERSION
7760  *
7761  * The version you have to put into the version field in the
7762  * #Evas_Smart_Class struct. Used to safeguard from binaries with old
7763  * smart object intefaces running with newer ones.
7764  *
7765  * @ingroup Evas_Smart_Group
7766  */
7767 #define EVAS_SMART_CLASS_VERSION 4
7768 /**
7769  * @struct _Evas_Smart_Class
7770  *
7771  * A smart object's @b base class definition
7772  *
7773  * @ingroup Evas_Smart_Group
7774  */
7775 struct _Evas_Smart_Class
7776 {
7777    const char *name; /**< the name string of the class */
7778    int         version;
7779    void  (*add)         (Evas_Object *o); /**< code to be run when adding object to a canvas */
7780    void  (*del)         (Evas_Object *o); /**< code to be run when removing object to a canvas */
7781    void  (*move)        (Evas_Object *o, Evas_Coord x, Evas_Coord y); /**< code to be run when moving object on a canvas */
7782    void  (*resize)      (Evas_Object *o, Evas_Coord w, Evas_Coord h); /**< code to be run when resizing object on a canvas */
7783    void  (*show)        (Evas_Object *o); /**< code to be run when showing object on a canvas */
7784    void  (*hide)        (Evas_Object *o); /**< code to be run when hiding object on a canvas */
7785    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 */
7786    void  (*clip_set)    (Evas_Object *o, Evas_Object *clip); /**< code to be run when setting clipper of object on a canvas */
7787    void  (*clip_unset)  (Evas_Object *o); /**< code to be run when unsetting clipper of object on a canvas */
7788    void  (*calculate)   (Evas_Object *o); /**< code to be run when object has rendering updates on a canvas */
7789    void  (*member_add)  (Evas_Object *o, Evas_Object *child); /**< code to be run when child member is added to object */
7790    void  (*member_del)  (Evas_Object *o, Evas_Object *child); /**< code to be run when child member is removed from object */
7791
7792    const Evas_Smart_Class          *parent; /**< this class inherits from this parent */
7793    const Evas_Smart_Cb_Description *callbacks; /**< callbacks at this level, @c NULL terminated */
7794    void                            *interfaces; /**< to be used in a future near you */
7795    const void                      *data;
7796 };
7797
7798 /**
7799  * @struct _Evas_Smart_Cb_Description
7800  *
7801  * Describes a callback used by a smart class
7802  * evas_object_smart_callback_call(), particularly useful to explain
7803  * to user and its code (ie: introspection) what the parameter @c
7804  * event_info will contain.
7805  *
7806  * @ingroup Evas_Smart_Group
7807  */
7808 struct _Evas_Smart_Cb_Description
7809 {
7810    const char *name; /**< callback name, ie: "changed" */
7811
7812    /**
7813     * @brief Hint type of @c event_info parameter of Evas_Smart_Cb.
7814     *
7815     * The type string uses the pattern similar to
7816     *
7817     * http://dbus.freedesktop.org/doc/dbus-specification.html#message-protocol-signatures
7818     *
7819     * but extended to optionally include variable names within
7820     * brackets preceding types. Example:
7821     *
7822     * @li Structure with two integers:
7823     *     @c "(ii)"
7824     *
7825     * @li Structure called 'x' with two integers named 'a' and 'b':
7826     *     @c "[x]([a]i[b]i)"
7827     *
7828     * @li Array of integers:
7829     *     @c "ai"
7830     *
7831     * @li Array called 'x' of struct with two integers:
7832     *     @c "[x]a(ii)"
7833     *
7834     * @note This type string is used as a hint and is @b not validated
7835     *       or enforced anyhow. Implementors should make the best use
7836     *       of it to help bindings, documentation and other users of
7837     *       introspection features.
7838     */
7839    const char *type;
7840 };
7841
7842 /**
7843  * @def EVAS_SMART_CLASS_INIT_NULL
7844  * Initializer to zero a whole Evas_Smart_Class structure.
7845  *
7846  * @see EVAS_SMART_CLASS_INIT_VERSION
7847  * @see EVAS_SMART_CLASS_INIT_NAME_VERSION
7848  * @see EVAS_SMART_CLASS_INIT_NAME_VERSION_PARENT
7849  * @see EVAS_SMART_CLASS_INIT_NAME_VERSION_PARENT_CALLBACKS
7850  * @ingroup Evas_Smart_Group
7851  */
7852 #define EVAS_SMART_CLASS_INIT_NULL {NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL}
7853
7854 /**
7855  * @def EVAS_SMART_CLASS_INIT_VERSION
7856  * Initializer to zero a whole Evas_Smart_Class structure and set version.
7857  *
7858  * Similar to EVAS_SMART_CLASS_INIT_NULL, but will set version field to
7859  * latest EVAS_SMART_CLASS_VERSION.
7860  *
7861  * @see EVAS_SMART_CLASS_INIT_NULL
7862  * @see EVAS_SMART_CLASS_INIT_NAME_VERSION
7863  * @see EVAS_SMART_CLASS_INIT_NAME_VERSION_PARENT
7864  * @see EVAS_SMART_CLASS_INIT_NAME_VERSION_PARENT_CALLBACKS
7865  * @ingroup Evas_Smart_Group
7866  */
7867 #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}
7868
7869 /**
7870  * @def EVAS_SMART_CLASS_INIT_NAME_VERSION
7871  * Initializer to zero a whole Evas_Smart_Class structure and set name
7872  * and version.
7873  *
7874  * Similar to EVAS_SMART_CLASS_INIT_NULL, but will set version field to
7875  * latest EVAS_SMART_CLASS_VERSION and name to the specified value.
7876  *
7877  * It will keep a reference to name field as a "const char *", that is,
7878  * name must be available while the structure is used (hint: static or global!)
7879  * and will not be modified.
7880  *
7881  * @see EVAS_SMART_CLASS_INIT_NULL
7882  * @see EVAS_SMART_CLASS_INIT_VERSION
7883  * @see EVAS_SMART_CLASS_INIT_NAME_VERSION_PARENT
7884  * @see EVAS_SMART_CLASS_INIT_NAME_VERSION_PARENT_CALLBACKS
7885  * @ingroup Evas_Smart_Group
7886  */
7887 #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}
7888
7889 /**
7890  * @def EVAS_SMART_CLASS_INIT_NAME_VERSION_PARENT
7891  * Initializer to zero a whole Evas_Smart_Class structure and set name,
7892  * version and parent class.
7893  *
7894  * Similar to EVAS_SMART_CLASS_INIT_NULL, but will set version field to
7895  * latest EVAS_SMART_CLASS_VERSION, name to the specified value and
7896  * parent class.
7897  *
7898  * It will keep a reference to name field as a "const char *", that is,
7899  * name must be available while the structure is used (hint: static or global!)
7900  * and will not be modified. Similarly, parent reference will be kept.
7901  *
7902  * @see EVAS_SMART_CLASS_INIT_NULL
7903  * @see EVAS_SMART_CLASS_INIT_VERSION
7904  * @see EVAS_SMART_CLASS_INIT_NAME_VERSION
7905  * @see EVAS_SMART_CLASS_INIT_NAME_VERSION_PARENT_CALLBACKS
7906  * @ingroup Evas_Smart_Group
7907  */
7908 #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}
7909
7910 /**
7911  * @def EVAS_SMART_CLASS_INIT_NAME_VERSION_PARENT_CALLBACKS
7912  * Initializer to zero a whole Evas_Smart_Class structure and set name,
7913  * version, parent class and callbacks definition.
7914  *
7915  * Similar to EVAS_SMART_CLASS_INIT_NULL, but will set version field to
7916  * latest EVAS_SMART_CLASS_VERSION, name to the specified value, parent
7917  * class and callbacks at this level.
7918  *
7919  * It will keep a reference to name field as a "const char *", that is,
7920  * name must be available while the structure is used (hint: static or global!)
7921  * and will not be modified. Similarly, parent and callbacks reference
7922  * will be kept.
7923  *
7924  * @see EVAS_SMART_CLASS_INIT_NULL
7925  * @see EVAS_SMART_CLASS_INIT_VERSION
7926  * @see EVAS_SMART_CLASS_INIT_NAME_VERSION
7927  * @see EVAS_SMART_CLASS_INIT_NAME_VERSION_PARENT
7928  * @ingroup Evas_Smart_Group
7929  */
7930 #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}
7931
7932 /**
7933  * @def EVAS_SMART_SUBCLASS_NEW
7934  *
7935  * Convenience macro to subclass a given Evas smart class.
7936  *
7937  * @param smart_name The name used for the smart class. e.g:
7938  * @c "Evas_Object_Box".
7939  * @param prefix Prefix used for all variables and functions defined
7940  * and referenced by this macro.
7941  * @param api_type Type of the structure used as API for the smart
7942  * class. Either #Evas_Smart_Class or something derived from it.
7943  * @param parent_type Type of the parent class API.
7944  * @param parent_func Function that gets the parent class. e.g:
7945  * evas_object_box_smart_class_get().
7946  * @param cb_desc Array of callback descriptions for this smart class.
7947  *
7948  * This macro saves some typing when writing a smart class derived
7949  * from another one. In order to work, the user @b must provide some
7950  * functions adhering to the following guidelines:
7951  *  - @<prefix@>_smart_set_user(): the @b internal @c _smart_set
7952  *    function (defined by this macro) will call this one, provided by
7953  *    the user, after inheriting everything from the parent, which
7954  *    should <b>take care of setting the right member functions for
7955  *    the class</b>, both overrides and extensions, if any.
7956  *  - If this new class should be subclassable as well, a @b public @c
7957  *    _smart_set() function is desirable to fill in the class used as
7958  *    parent by the children. It's up to the user to provide this
7959  *    interface, which will most likely call @<prefix@>_smart_set() to
7960  *    get the job done.
7961  *
7962  * After the macro's usage, the following will be defined for use:
7963  *  - @<prefix@>_parent_sc: A pointer to the @b parent smart
7964  *    class. When calling parent functions from overloaded ones, use
7965  *    this global variable.
7966  *  - @<prefix@>_smart_class_new(): this function returns the
7967  *    #Evas_Smart needed to create smart objects with this class,
7968  *    which should be passed to evas_object_smart_add().
7969  *
7970  * @ingroup Evas_Smart_Group
7971  */
7972 #define EVAS_SMART_SUBCLASS_NEW(smart_name, prefix, api_type, parent_type, parent_func, cb_desc) \
7973   static const parent_type * prefix##_parent_sc = NULL;                 \
7974   static void prefix##_smart_set_user(api_type *api);                   \
7975   static void prefix##_smart_set(api_type *api)                         \
7976   {                                                                     \
7977      Evas_Smart_Class *sc;                                              \
7978      if (!(sc = (Evas_Smart_Class *)api))                               \
7979        return;                                                          \
7980      if (!prefix##_parent_sc)                                           \
7981        prefix##_parent_sc = parent_func();                              \
7982      evas_smart_class_inherit(sc, (const Evas_Smart_Class *)prefix##_parent_sc); \
7983      prefix##_smart_set_user(api);                                      \
7984   }                                                                     \
7985   static Evas_Smart * prefix##_smart_class_new(void)                    \
7986   {                                                                     \
7987      static Evas_Smart *smart = NULL;                                   \
7988      static api_type api;                                               \
7989      if (!smart)                                                        \
7990        {                                                                \
7991           Evas_Smart_Class *sc = (Evas_Smart_Class *)&api;              \
7992           memset(&api, 0, sizeof(api_type));                            \
7993           sc->version = EVAS_SMART_CLASS_VERSION;                       \
7994           sc->name = smart_name;                                        \
7995           sc->callbacks = cb_desc;                                      \
7996           prefix##_smart_set(&api);                                     \
7997           smart = evas_smart_class_new(sc);                             \
7998        }                                                                \
7999      return smart;                                                      \
8000   }
8001
8002 /**
8003  * @def EVAS_SMART_DATA_ALLOC
8004  *
8005  * Convenience macro to allocate smart data only if needed.
8006  *
8007  * When writing a subclassable smart object, the @c .add() function
8008  * will need to check if the smart private data was already allocated
8009  * by some child object or not. This macro makes it easier to do it.
8010  *
8011  * @note This is an idiom used when one calls the parent's @c. add()
8012  * after the specialized code. Naturally, the parent's base smart data
8013  * has to be contemplated as the specialized one's first member, for
8014  * things to work.
8015  *
8016  * @param o Evas object passed to the @c .add() function
8017  * @param priv_type The type of the data to allocate
8018  *
8019  * @ingroup Evas_Smart_Group
8020  */
8021 #define EVAS_SMART_DATA_ALLOC(o, priv_type) \
8022    priv_type *priv; \
8023    priv = evas_object_smart_data_get(o); \
8024    if (!priv) { \
8025       priv = (priv_type *)calloc(1, sizeof(priv_type)); \
8026       if (!priv) return; \
8027       evas_object_smart_data_set(o, priv); \
8028    }
8029
8030
8031 /**
8032  * Free an Evas_Smart
8033  *
8034  * If this smart was created using evas_smart_class_new(), the associated
8035  * Evas_Smart_Class will not be freed.
8036  *
8037  * @param s the Evas_Smart to free
8038  *
8039  */
8040 EAPI void                             evas_smart_free                     (Evas_Smart *s) EINA_ARG_NONNULL(1);
8041
8042 /**
8043  * Creates an Evas_Smart from an Evas_Smart_Class.
8044  *
8045  * @param sc the smart class definition
8046  * @return an Evas_Smart
8047  */
8048 EAPI Evas_Smart                      *evas_smart_class_new                (const Evas_Smart_Class *sc) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
8049
8050 /**
8051  * Get the Evas_Smart_Class of an Evas_Smart
8052  *
8053  * @param s the Evas_Smart
8054  * @return the Evas_Smart_Class
8055  */
8056 EAPI const Evas_Smart_Class          *evas_smart_class_get                (const Evas_Smart *s) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
8057
8058
8059 /**
8060  * @brief Get the data pointer set on an Evas_Smart.
8061  *
8062  * @param s Evas_Smart
8063  *
8064  * This data pointer is set either as the final parameter to
8065  * evas_smart_new or as the data field in the Evas_Smart_Class passed
8066  * in to evas_smart_class_new
8067  */
8068 EAPI void                            *evas_smart_data_get                 (const Evas_Smart *s) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
8069
8070 /**
8071  * Get the callbacks known by this Evas_Smart.
8072  *
8073  * This is likely different from Evas_Smart_Class::callbacks as it
8074  * will contain the callbacks of all class hierarchy sorted, while the
8075  * direct smart class member refers only to that specific class and
8076  * should not include parent's.
8077  *
8078  * If no callbacks are known, this function returns @c NULL.
8079  *
8080  * The array elements and thus their contents will be reference to
8081  * original values given to evas_smart_new() as
8082  * Evas_Smart_Class::callbacks.
8083  *
8084  * The array is sorted by name. The last array element is the @c NULL
8085  * pointer and is not counted in @a count. Loop iterations can check
8086  * any of these cases.
8087  *
8088  * @param s the Evas_Smart.
8089  * @param count returns the number of elements in returned array.
8090  * @return the array with callback descriptions known by this class,
8091  *         its size is returned in @a count parameter. It should not
8092  *         be modified anyhow. If no callbacks are known, @c NULL is
8093  *         returned. The array is sorted by name and elements refer to
8094  *         the original value given to evas_smart_new().
8095  *
8096  * @note objects may provide per-instance callbacks, use
8097  *       evas_object_smart_callbacks_descriptions_get() to get those
8098  *       as well.
8099  * @see evas_object_smart_callbacks_descriptions_get()
8100  */
8101 EAPI const Evas_Smart_Cb_Description **evas_smart_callbacks_descriptions_get(const Evas_Smart *s, unsigned int *count) EINA_ARG_NONNULL(1, 1);
8102
8103
8104 /**
8105  * Find callback description for callback called @a name.
8106  *
8107  * @param s the Evas_Smart.
8108  * @param name name of desired callback, must @b not be @c NULL.  The
8109  *        search have a special case for @a name being the same
8110  *        pointer as registered with Evas_Smart_Cb_Description, one
8111  *        can use it to avoid excessive use of strcmp().
8112  * @return reference to description if found, @c NULL if not found.
8113  */
8114 EAPI const Evas_Smart_Cb_Description *evas_smart_callback_description_find(const Evas_Smart *s, const char *name) EINA_ARG_NONNULL(1, 2) EINA_PURE;
8115
8116
8117 /**
8118  * Sets one class to inherit from the other.
8119  *
8120  * Copy all function pointers, set @c parent to @a parent_sc and copy
8121  * everything after sizeof(Evas_Smart_Class) present in @a parent_sc,
8122  * using @a parent_sc_size as reference.
8123  *
8124  * This is recommended instead of a single memcpy() since it will take
8125  * care to not modify @a sc name, version, callbacks and possible
8126  * other members.
8127  *
8128  * @param sc child class.
8129  * @param parent_sc parent class, will provide attributes.
8130  * @param parent_sc_size size of parent_sc structure, child should be at least
8131  *        this size. Everything after @c Evas_Smart_Class size is copied
8132  *        using regular memcpy().
8133  */
8134 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);
8135
8136 /**
8137  * Get the number of users of the smart instance
8138  * 
8139  * @param s The Evas_Smart to get the usage count of
8140  * @return The number of uses of the smart instance
8141  * 
8142  * This function tells you how many more uses of the smart instance are in
8143  * existence. This should be used before freeing/clearing any of the
8144  * Evas_Smart_Class that was used to create the smart instance. The smart
8145  * instance will refer to data in the Evas_Smart_Class used to create it and
8146  * thus you cannot remove the original data until all users of it are gone.
8147  * When the usage count goes to 0, you can evas_smart_free() the smart
8148  * instance @p s and remove from memory any of the Evas_Smart_Class that
8149  * was used to create the smart instance, if you desire. Removing it from
8150  * memory without doing this will cause problems (crashes, undefined
8151  * behavior etc. etc.), so either never remove the original 
8152  * Evas_Smart_Class data from memory (have it be a constant structure and
8153  * data), or use this API call and be very careful.
8154  */
8155 EAPI int                              evas_smart_usage_get(const Evas_Smart *s);
8156          
8157   /**
8158    * @def evas_smart_class_inherit
8159    * Easy to use version of evas_smart_class_inherit_full().
8160    *
8161    * This version will use sizeof(parent_sc), copying everything.
8162    *
8163    * @param sc child class, will have methods copied from @a parent_sc
8164    * @param parent_sc parent class, will provide contents to be copied.
8165    * @return 1 on success, 0 on failure.
8166    * @ingroup Evas_Smart_Group
8167    */
8168 #define evas_smart_class_inherit(sc, parent_sc) evas_smart_class_inherit_full(sc, parent_sc, sizeof(*parent_sc))
8169
8170 /**
8171  * @defgroup Evas_Smart_Object_Group Smart Object Functions
8172  *
8173  * Functions dealing with Evas smart objects (instances).
8174  *
8175  * Smart objects are groupings of primitive Evas objects that behave
8176  * as a cohesive group. For instance, a file manager icon may be a
8177  * smart object composed of an image object, a text label and two
8178  * rectangles that appear behind the image and text when the icon is
8179  * selected. As a smart object, the normal Evas object API could be
8180  * used on the icon object.
8181  *
8182  * See some @ref Example_Evas_Smart_Objects "examples" of this group
8183  * of functions.
8184  *
8185  * @see @ref Evas_Smart_Group for class definitions.
8186  */
8187
8188 /**
8189  * @addtogroup Evas_Smart_Object_Group
8190  * @{
8191  */
8192
8193 /**
8194  * Instantiates a new smart object described by @p s.
8195  *
8196  * @param e the canvas on which to add the object
8197  * @param s the #Evas_Smart describing the smart object
8198  * @return a new #Evas_Object handle
8199  *
8200  * This is the function one should use when defining the public
8201  * function @b adding an instance of the new smart object to a given
8202  * canvas. It will take care of setting all of its internals to work
8203  * as they should, if the user set things properly, as seem on the
8204  * #EVAS_SMART_SUBCLASS_NEW, for example.
8205  *
8206  * @ingroup Evas_Smart_Object_Group
8207  */
8208 EAPI Evas_Object      *evas_object_smart_add             (Evas *e, Evas_Smart *s) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2) EINA_MALLOC;
8209
8210 /**
8211  * Set an Evas object as a member of a smart object.
8212  *
8213  * @param obj The member object
8214  * @param smart_obj The smart object
8215  *
8216  * Members will automatically be stacked and layered with the smart object.
8217  * The various stacking function will operate on members relative to the
8218  * other members instead of the entire canvas.
8219  *
8220  * Non-member objects can not interleave a smart object's members.
8221  *
8222  * @ingroup Evas_Smart_Object_Group
8223  */
8224 EAPI void              evas_object_smart_member_add      (Evas_Object *obj, Evas_Object *smart_obj) EINA_ARG_NONNULL(1, 2);
8225
8226 /**
8227  * Removes a member object from a smart object.
8228  *
8229  * @param obj the member object
8230  * @ingroup Evas_Smart_Object_Group
8231  *
8232  * This removes a member object from a smart object. The object will still
8233  * be on the canvas, but no longer associated with whichever smart object
8234  * it was associated with.
8235  *
8236  */
8237 EAPI void              evas_object_smart_member_del      (Evas_Object *obj) EINA_ARG_NONNULL(1);
8238
8239 /**
8240  * Gets the smart parent of an Evas_Object
8241  * @param obj the Evas_Object you want to get the parent
8242  * @return Returns the smart parent of @a obj, or @c NULL if @a obj is not a smart member of another Evas_Object
8243  * @ingroup Evas_Smart_Object_Group
8244  */
8245 EAPI Evas_Object      *evas_object_smart_parent_get      (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
8246
8247 /**
8248  * Checks the Smart type of the object and its parents
8249  * @param obj the Evas_Object to check the type of
8250  * @param type the type to check for
8251  * @return EINA_TRUE if @a obj or any of its parents if of type @a type, EINA_FALSE otherwise
8252  * @ingroup Evas_Smart_Object_Group
8253  */
8254 EAPI Eina_Bool         evas_object_smart_type_check      (const Evas_Object *obj, const char *type) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2) EINA_PURE;
8255
8256 /**
8257  * Checks the Smart type of the object and its parents using pointer comparison
8258  * @param obj the Evas_Object to check the type of
8259  * @param type the type to check for. Must be the name pointer in the smart class used to create the object
8260  * @return EINA_TRUE if @a obj or any of its parents if of type @a type, EINA_FALSE otherwise
8261  * @ingroup Evas_Smart_Object_Group
8262  */
8263 EAPI Eina_Bool         evas_object_smart_type_check_ptr  (const Evas_Object *obj, const char *type) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2) EINA_PURE;
8264
8265 /**
8266  * Gets the list of the member objects of an Evas_Object
8267  * @param obj the Evas_Object you want to get the list of member objects
8268  * @return Returns the list of the member objects of @a obj.
8269  * The returned list should be freed with eina_list_free() when you no longer need it
8270  */
8271 EAPI Eina_List        *evas_object_smart_members_get     (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
8272
8273 /**
8274  * Get the Evas_Smart from which @p obj was created.
8275  *
8276  * @param obj a smart object
8277  * @return the Evas_Smart
8278  * @ingroup Evas_Smart_Object_Group
8279  */
8280 EAPI Evas_Smart       *evas_object_smart_smart_get       (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
8281
8282 /**
8283  * Retrieve user data stored on a given smart object.
8284  *
8285  * @param obj The smart object's handle
8286  * @return A pointer to data stored using
8287  *         evas_object_smart_data_set(), or @c NULL, if none has been
8288  *         set.
8289  *
8290  * @see evas_object_smart_data_set()
8291  *
8292  * @ingroup Evas_Smart_Object_Group
8293  */
8294 EAPI void             *evas_object_smart_data_get        (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
8295
8296 /**
8297  * Store a pointer to user data for a given smart object.
8298  *
8299  * @param obj The smart object's handle
8300  * @param data A pointer to user data
8301  *
8302  * This data is stored @b independently of the one set by
8303  * evas_object_data_set(), naturally.
8304  *
8305  * @see evas_object_smart_data_get()
8306  *
8307  * @ingroup Evas_Smart_Object_Group
8308  */
8309 EAPI void              evas_object_smart_data_set        (Evas_Object *obj, void *data) EINA_ARG_NONNULL(1);
8310
8311 /**
8312  * Add a callback for the smart event specified by @p event.
8313  *
8314  * @param obj a smart object
8315  * @param event the event name
8316  * @param func the callback function
8317  * @param data user data to be passed to the callback function
8318  * @ingroup Evas_Smart_Object_Group
8319  */
8320 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);
8321
8322 /**
8323  * Remove a smart callback
8324  *
8325  * Removes a callback that was added by evas_object_smart_callback_add()
8326  *
8327  * @param obj a smart object
8328  * @param event the event name
8329  * @param func the callback function
8330  * @return the data pointer
8331  * @ingroup Evas_Smart_Object_Group
8332  */
8333 EAPI void             *evas_object_smart_callback_del    (Evas_Object *obj, const char *event, Evas_Smart_Cb func) EINA_ARG_NONNULL(1, 2, 3);
8334
8335 /**
8336  * Call any smart callbacks on @p obj for @p event.
8337  *
8338  * @param obj the smart object
8339  * @param event the event name
8340  * @param event_info an event specific struct of info to pass to the callback
8341  *
8342  * This should be called internally in the smart object when some specific
8343  * event has occurred. The documentation for the smart object should include
8344  * a list of possible events and what type of @p event_info to expect.
8345  *
8346  * @ingroup Evas_Smart_Object_Group
8347  */
8348 EAPI void              evas_object_smart_callback_call   (Evas_Object *obj, const char *event, void *event_info) EINA_ARG_NONNULL(1, 2);
8349
8350
8351 /**
8352  * Set smart object instance callbacks descriptions.
8353  *
8354  * These descriptions are hints to be used by introspection and are
8355  * not enforced in any way.
8356  *
8357  * It will not be checked if instance callbacks descriptions have the
8358  * same name as another in class. Both are kept in different arrays
8359  * and users of evas_object_smart_callbacks_descriptions_get() should
8360  * handle this case as they wish.
8361  *
8362  * @param obj The smart object
8363  * @param descriptions NULL terminated (name != NULL) array with
8364  *        descriptions.  Array elements will not be modified, but
8365  *        reference to them and their contents will be made, so this
8366  *        array should be kept alive during object lifetime.
8367  * @return 1 on success, 0 on failure.
8368  * @ingroup Evas_Smart_Object_Group
8369  *
8370  * @note while instance callbacks descriptions are possible, they are
8371  *       not recommended. Use class callbacks descriptions instead as they
8372  *       make user's life simpler and will use less memory as descriptions
8373  *       and arrays will be shared among all instances.
8374  */
8375 EAPI Eina_Bool         evas_object_smart_callbacks_descriptions_set(Evas_Object *obj, const Evas_Smart_Cb_Description *descriptions) EINA_ARG_NONNULL(1);
8376
8377 /**
8378  * Get the callbacks descriptions known by this smart object.
8379  *
8380  * This call retrieves processed callbacks descriptions for both
8381  * instance and class. These arrays are sorted by description's name
8382  * and are @c NULL terminated, so both @a class_count and
8383  * @a instance_count can be ignored, the terminator @c NULL is not
8384  * counted in these values.
8385  *
8386  * @param obj the smart object.
8387  * @param class_descriptions where to store class callbacks
8388  *        descriptions array, if any is known. If no descriptions are
8389  *        known, @c NULL is returned. This parameter may be @c NULL if
8390  *        it is not of interest.
8391  * @param class_count returns how many class callbacks descriptions
8392  *        are known.
8393  * @param instance_descriptions where to store instance callbacks
8394  *        descriptions array, if any is known. If no descriptions are
8395  *        known, @c NULL is returned. This parameter may be @c NULL if
8396  *        it is not of interest.
8397  * @param instance_count returns how many instance callbacks
8398  *        descriptions are known.
8399  *
8400  * @note if just class descriptions are of interest, try
8401  *       evas_smart_callbacks_descriptions_get() instead.
8402  *
8403  * @see evas_smart_callbacks_descriptions_get()
8404  * @ingroup Evas_Smart_Object_Group
8405  */
8406 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);
8407
8408 /**
8409  * Find callback description for callback called @a name.
8410  *
8411  * @param obj the smart object.
8412  * @param name name of desired callback, must @b not be @c NULL.  The
8413  *        search have a special case for @a name being the same
8414  *        pointer as registered with Evas_Smart_Cb_Description, one
8415  *        can use it to avoid excessive use of strcmp().
8416  * @param class_description pointer to return class description or @c
8417  *        NULL if not found. If parameter is @c NULL, no search will
8418  *        be done on class descriptions.
8419  * @param instance_description pointer to return instance description
8420  *        or @c NULL if not found. If parameter is @c NULL, no search
8421  *        will be done on instance descriptions.
8422  * @return reference to description if found, @c NULL if not found.
8423  */
8424 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);
8425
8426
8427 /**
8428  * Mark smart object as changed, dirty.
8429  *
8430  * @param obj The given Evas smart object
8431  *
8432  * This will flag the given object as needing recalculation,
8433  * forcefully. As an effect, on the next rendering cycle it's @b
8434  * calculate() (see #Evas_Smart_Class) smart function will be called.
8435  *
8436  * @see evas_object_smart_need_recalculate_set().
8437  * @see evas_object_smart_calculate().
8438  *
8439  * @ingroup Evas_Smart_Object_Group
8440  */
8441 EAPI void              evas_object_smart_changed         (Evas_Object *obj) EINA_ARG_NONNULL(1);
8442
8443 /**
8444  * Set the need_recalculate flag of given smart object.
8445  *
8446  * If this flag is set then calculate() callback (method) of the given
8447  * smart object will be called, if one is provided, during render phase
8448  * usually evas_render(). After this step, this flag will be automatically
8449  * unset.
8450  *
8451  * If no calculate() is provided, this flag will be left unchanged.
8452  *
8453  * @note just setting this flag will not make scene dirty and evas_render()
8454  *       will have no effect. To do that, use evas_object_smart_changed(),
8455  *       that will automatically call this function with 1 as parameter.
8456  *
8457  * @param obj the smart object
8458  * @param value if one want to set or unset the need_recalculate flag.
8459  *
8460  * @ingroup Evas_Smart_Object_Group
8461  */
8462 EAPI void              evas_object_smart_need_recalculate_set(Evas_Object *obj, Eina_Bool value) EINA_ARG_NONNULL(1);
8463
8464 /**
8465  * Get the current value of need_recalculate flag.
8466  *
8467  * @note this flag will be unset during the render phase, after calculate()
8468  *       is called if one is provided.  If no calculate() is provided, then
8469  *       the flag will be left unchanged after render phase.
8470  *
8471  * @param obj the smart object
8472  * @return if flag is set or not.
8473  *
8474  * @ingroup Evas_Smart_Object_Group
8475  */
8476 EAPI Eina_Bool         evas_object_smart_need_recalculate_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
8477
8478 /**
8479  * Call the @b calculate() smart function immediataly on a given smart
8480  * object.
8481  *
8482  * @param obj the smart object's handle
8483  *
8484  * This will force immediate calculations (see #Evas_Smart_Class)
8485  * needed for renderization of this object and, besides, unset the
8486  * flag on it telling it needs recalculation for the next rendering
8487  * phase.
8488  *
8489  * @ingroup Evas_Smart_Object_Group
8490  */
8491 EAPI void              evas_object_smart_calculate       (Evas_Object *obj) EINA_ARG_NONNULL(1);
8492
8493 /**
8494  * Call user provided calculate() and unset need_calculate on all objects.
8495  *
8496  * @param e The canvas to calculate all objects in
8497  *
8498  * @ingroup Evas_Smart_Object_Group
8499  */
8500 EAPI void              evas_smart_objects_calculate      (Evas *e);
8501
8502
8503 /**
8504  * Moves all children objects relative to given offset.
8505  *
8506  * @param obj the smart Evas object to use.
8507  * @param dx horizontal offset.
8508  * @param dy vertical offset.
8509  */
8510 EAPI void                    evas_object_smart_move_children_relative(Evas_Object *obj, Evas_Coord dx, Evas_Coord dy) EINA_ARG_NONNULL(1);
8511
8512 /**
8513  * @}
8514  */
8515
8516 /**
8517  * @defgroup Evas_Smart_Object_Clipped Clipped Smart Object
8518  *
8519  * Clipped smart object is a base to construct other smart objects
8520  * based on the concept of having an internal clipper that is applied
8521  * to all children objects. This clipper will control the visibility,
8522  * clipping and color of sibling objects (remember that the clipping
8523  * is recursive, and clipper color modulates the color of its
8524  * clippees). By default, this base will also move children relatively
8525  * to the parent, and delete them when parent is deleted. In other
8526  * words, it is the base for simple object grouping.
8527  *
8528  * See some @ref Example_Evas_Smart_Objects "examples" of this group
8529  * of functions.
8530  *
8531  * @see evas_object_smart_clipped_smart_set()
8532  *
8533  * @ingroup Evas_Smart_Object_Group
8534  */
8535
8536 /**
8537  * @addtogroup Evas_Smart_Object_Clipped
8538  * @{
8539  */
8540
8541 /**
8542  * Every subclass should provide this at the beginning of their own
8543  * data set with evas_object_smart_data_set().
8544  */
8545   typedef struct _Evas_Object_Smart_Clipped_Data Evas_Object_Smart_Clipped_Data;
8546   struct _Evas_Object_Smart_Clipped_Data
8547   {
8548      Evas_Object *clipper;
8549      Evas        *evas;
8550   };
8551
8552
8553 /**
8554  * Get the clipper object for the given clipped smart object.
8555  *
8556  * @param obj the clipped smart object to retrieve associated clipper
8557  * from.
8558  * @return the clipper object.
8559  *
8560  * Use this function if you want to change any of this clipper's
8561  * properties, like colors.
8562  *
8563  * @see evas_object_smart_clipped_smart_add()
8564  */
8565 EAPI Evas_Object            *evas_object_smart_clipped_clipper_get   (Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
8566
8567 /**
8568  * Set a given smart class' callbacks so it implements the <b>clipped smart
8569  * object"</b>'s interface.
8570  *
8571  * @param sc The smart class handle to operate on
8572  *
8573  * This call will assign all the required methods of the @p sc
8574  * #Evas_Smart_Class instance to the implementations set for clipped
8575  * smart objects. If one wants to "subclass" it, call this function
8576  * and then override desired values. If one wants to call any original
8577  * method, save it somewhere. Example:
8578  *
8579  * @code
8580  * static Evas_Smart_Class parent_sc = EVAS_SMART_CLASS_INIT_NULL;
8581  *
8582  * static void my_class_smart_add(Evas_Object *o)
8583  * {
8584  *    parent_sc.add(o);
8585  *    evas_object_color_set(evas_object_smart_clipped_clipper_get(o),
8586  *                          255, 0, 0, 255);
8587  * }
8588  *
8589  * Evas_Smart_Class *my_class_new(void)
8590  * {
8591  *    static Evas_Smart_Class sc = EVAS_SMART_CLASS_INIT_NAME_VERSION("MyClass");
8592  *    if (!parent_sc.name)
8593  *      {
8594  *         evas_object_smart_clipped_smart_set(&sc);
8595  *         parent_sc = sc;
8596  *         sc.add = my_class_smart_add;
8597  *      }
8598  *    return &sc;
8599  * }
8600  * @endcode
8601  *
8602  * Default behavior for each of #Evas_Smart_Class functions on a
8603  * clipped smart object are:
8604  * - @c add: creates a hidden clipper with "infinite" size, to clip
8605  *    any incoming members;
8606  *  - @c del: delete all children objects;
8607  *  - @c move: move all objects relative relatively;
8608  *  - @c resize: <b>not defined</b>;
8609  *  - @c show: if there are children objects, show clipper;
8610  *  - @c hide: hides clipper;
8611  *  - @c color_set: set the color of clipper;
8612  *  - @c clip_set: set clipper of clipper;
8613  *  - @c clip_unset: unset the clipper of clipper;
8614  *
8615  * @note There are other means of assigning parent smart classes to
8616  * child ones, like the #EVAS_SMART_SUBCLASS_NEW macro or the
8617  * evas_smart_class_inherit_full() function.
8618  */
8619 EAPI void                    evas_object_smart_clipped_smart_set     (Evas_Smart_Class *sc) EINA_ARG_NONNULL(1);
8620
8621 /**
8622  * Get a pointer to the <b>clipped smart object's</b> class, to use
8623  * for proper inheritance
8624  *
8625  * @see #Evas_Smart_Object_Clipped for more information on this smart
8626  * class
8627  */
8628 EAPI const Evas_Smart_Class *evas_object_smart_clipped_class_get     (void) EINA_CONST;
8629
8630 /**
8631  * @}
8632  */
8633
8634 /**
8635  * @defgroup Evas_Object_Box Box (Sequence) Smart Object.
8636  *
8637  * Convenience smart object that packs children as a sequence using
8638  * a layout function specified by user. There are a couple of helper
8639  * layout functions, all of them using children size hints to define
8640  * their size and alignment inside their cell space.
8641  *
8642  * @see @ref Evas_Object_Group_Size_Hints
8643  *
8644  * @ingroup Evas_Smart_Object_Group
8645  */
8646 /**
8647  * @typedef Evas_Object_Box_Api
8648  * Smart Class extension providing extra box requirements.
8649  * @ingroup Evas_Object_Box
8650  */
8651    typedef struct _Evas_Object_Box_Api        Evas_Object_Box_Api;
8652 /**
8653  * @typedef Evas_Object_Box_Data
8654  * Smart instance data providing box requirements.
8655  * @ingroup Evas_Object_Box
8656  */
8657    typedef struct _Evas_Object_Box_Data       Evas_Object_Box_Data;
8658 /**
8659  * @typedef Evas_Object_Box_Option
8660  * The base structure for a box option.
8661  * @ingroup Evas_Object_Box
8662  */
8663    typedef struct _Evas_Object_Box_Option     Evas_Object_Box_Option;
8664    typedef void (*Evas_Object_Box_Layout) (Evas_Object *o, Evas_Object_Box_Data *priv, void *user_data);
8665
8666 /**
8667  * @def EVAS_OBJECT_BOX_API_VERSION
8668  * @ingroup Evas_Object_Box
8669  */
8670 #define EVAS_OBJECT_BOX_API_VERSION 1
8671 /**
8672  * @struct _Evas_Object_Box_Api
8673  *
8674  * This structure should be used by any class that wants to inherit
8675  * from box to provide custom behavior not allowed only by providing a
8676  * layout function with evas_object_box_layout_set().
8677  *
8678  * @extends Evas_Smart_Class
8679  * @ingroup Evas_Object_Box
8680  */
8681    struct _Evas_Object_Box_Api
8682    {
8683       Evas_Smart_Class          base;
8684       int                       version;
8685       Evas_Object_Box_Option *(*append)           (Evas_Object *o, Evas_Object_Box_Data *priv, Evas_Object *child);
8686       Evas_Object_Box_Option *(*prepend)          (Evas_Object *o, Evas_Object_Box_Data *priv, Evas_Object *child);
8687       Evas_Object_Box_Option *(*insert_before)    (Evas_Object *o, Evas_Object_Box_Data *priv, Evas_Object *child, const Evas_Object *reference);
8688       Evas_Object_Box_Option *(*insert_after)     (Evas_Object *o, Evas_Object_Box_Data *priv, Evas_Object *child, const Evas_Object *reference);
8689       Evas_Object_Box_Option *(*insert_at)        (Evas_Object *o, Evas_Object_Box_Data *priv, Evas_Object *child, unsigned int pos);
8690       Evas_Object            *(*remove)           (Evas_Object *o, Evas_Object_Box_Data *priv, Evas_Object *child);
8691       Evas_Object            *(*remove_at)        (Evas_Object *o, Evas_Object_Box_Data *priv, unsigned int pos);
8692       Eina_Bool               (*property_set)     (Evas_Object *o, Evas_Object_Box_Option *opt, int property, va_list args);
8693       Eina_Bool               (*property_get)     (Evas_Object *o, Evas_Object_Box_Option *opt, int property, va_list args);
8694       const char             *(*property_name_get)(Evas_Object *o, int property);
8695       int                     (*property_id_get)  (Evas_Object *o, const char *name);
8696       Evas_Object_Box_Option *(*option_new)       (Evas_Object *o, Evas_Object_Box_Data *priv, Evas_Object *child);
8697       void                    (*option_free)      (Evas_Object *o, Evas_Object_Box_Data *priv, Evas_Object_Box_Option *opt);
8698    };
8699
8700 /**
8701  * @def EVAS_OBJECT_BOX_API_INIT
8702  * Initializer for whole Evas_Object_Box_Api structure.
8703  *
8704  * @param smart_class_init initializer to use for the "base" field
8705  * (Evas_Smart_Class).
8706  *
8707  * @see EVAS_SMART_CLASS_INIT_NULL
8708  * @see EVAS_SMART_CLASS_INIT_VERSION
8709  * @see EVAS_SMART_CLASS_INIT_NAME_VERSION
8710  * @see EVAS_OBJECT_BOX_API_INIT_NULL
8711  * @see EVAS_OBJECT_BOX_API_INIT_VERSION
8712  * @see EVAS_OBJECT_BOX_API_INIT_NAME_VERSION
8713  * @ingroup Evas_Object_Box
8714  */
8715 #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}
8716
8717 /**
8718  * @def EVAS_OBJECT_BOX_API_INIT_NULL
8719  * Initializer to zero a whole Evas_Object_Box_Api structure.
8720  *
8721  * @see EVAS_OBJECT_BOX_API_INIT_VERSION
8722  * @see EVAS_OBJECT_BOX_API_INIT_NAME_VERSION
8723  * @see EVAS_OBJECT_BOX_API_INIT
8724  * @ingroup Evas_Object_Box
8725  */
8726 #define EVAS_OBJECT_BOX_API_INIT_NULL EVAS_OBJECT_BOX_API_INIT(EVAS_SMART_CLASS_INIT_NULL)
8727
8728 /**
8729  * @def EVAS_OBJECT_BOX_API_INIT_VERSION
8730  * Initializer to zero a whole Evas_Object_Box_Api structure and set version.
8731  *
8732  * Similar to EVAS_OBJECT_BOX_API_INIT_NULL, but will set version field of
8733  * Evas_Smart_Class (base field) to latest EVAS_SMART_CLASS_VERSION
8734  *
8735  * @see EVAS_OBJECT_BOX_API_INIT_NULL
8736  * @see EVAS_OBJECT_BOX_API_INIT_NAME_VERSION
8737  * @see EVAS_OBJECT_BOX_API_INIT
8738  * @ingroup Evas_Object_Box
8739  */
8740 #define EVAS_OBJECT_BOX_API_INIT_VERSION EVAS_OBJECT_BOX_API_INIT(EVAS_SMART_CLASS_INIT_VERSION)
8741
8742 /**
8743  * @def EVAS_OBJECT_BOX_API_INIT_NAME_VERSION
8744  * Initializer to zero a whole Evas_Object_Box_Api structure and set
8745  * name and version.
8746  *
8747  * Similar to EVAS_OBJECT_BOX_API_INIT_NULL, but will set version field of
8748  * Evas_Smart_Class (base field) to latest EVAS_SMART_CLASS_VERSION and name
8749  * to the specific value.
8750  *
8751  * It will keep a reference to name field as a "const char *", that is,
8752  * name must be available while the structure is used (hint: static or global!)
8753  * and will not be modified.
8754  *
8755  * @see EVAS_OBJECT_BOX_API_INIT_NULL
8756  * @see EVAS_OBJECT_BOX_API_INIT_VERSION
8757  * @see EVAS_OBJECT_BOX_API_INIT
8758  * @ingroup Evas_Object_Box
8759  */
8760 #define EVAS_OBJECT_BOX_API_INIT_NAME_VERSION(name) EVAS_OBJECT_BOX_API_INIT(EVAS_SMART_CLASS_INIT_NAME_VERSION(name))
8761
8762 /**
8763  * @struct _Evas_Object_Box_Data
8764  *
8765  * This structure augments clipped smart object's instance data,
8766  * providing extra members required by generic box implementation. If
8767  * a subclass inherits from #Evas_Object_Box_Api then it may augment
8768  * #Evas_Object_Box_Data to fit its own needs.
8769  *
8770  * @extends Evas_Object_Smart_Clipped_Data
8771  * @ingroup Evas_Object_Box
8772  */
8773    struct _Evas_Object_Box_Data
8774    {
8775       Evas_Object_Smart_Clipped_Data   base;
8776       const Evas_Object_Box_Api       *api;
8777       struct {
8778          double                        h, v;
8779       } align;
8780       struct {
8781          Evas_Coord                    h, v;
8782       } pad;
8783       Eina_List                       *children;
8784       struct {
8785          Evas_Object_Box_Layout        cb;
8786          void                         *data;
8787          void                        (*free_data)(void *data);
8788       } layout;
8789       Eina_Bool                        layouting : 1;
8790       Eina_Bool                        children_changed : 1;
8791    };
8792
8793    struct _Evas_Object_Box_Option
8794    {
8795       Evas_Object *obj;
8796       Eina_Bool    max_reached:1;
8797       Eina_Bool    min_reached:1;
8798       Evas_Coord   alloc_size;
8799    };
8800
8801
8802 /**
8803  * Set the default box @a api struct (Evas_Object_Box_Api)
8804  * with the default values. May be used to extend that API.
8805  */
8806 EAPI void                       evas_object_box_smart_set                             (Evas_Object_Box_Api *api) EINA_ARG_NONNULL(1);
8807
8808 /**
8809  * Get Box Smart Class for inheritance purposes
8810  */
8811 EAPI const Evas_Object_Box_Api *evas_object_box_smart_class_get                       (void) EINA_CONST;
8812
8813 /**
8814  * Set a 'calculate' callback (@a cb) to the @a o box's smart class,
8815  * which here defines its genre (horizontal, vertical, homogeneous,
8816  * etc.).
8817  */
8818 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);
8819
8820
8821 /**
8822  * Create a new box.
8823  *
8824  * Its layout function must be set via evas_object_box_layout_set()
8825  * (defaults to evas_object_box_layout_horizontal()).  The other
8826  * properties of the box must be set/retrieved via
8827  * evas_object_box_{h,v}_{align,padding}_{get,set)().
8828  */
8829 EAPI Evas_Object               *evas_object_box_add                                   (Evas *evas) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
8830
8831 /**
8832  * Create a box that is child of a given element @a parent.
8833  *
8834  * @see evas_object_box_add()
8835  */
8836 EAPI Evas_Object               *evas_object_box_add_to                                (Evas_Object *parent) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
8837
8838
8839 /**
8840  * Layout function which sets the box @a o to a (basic) horizontal
8841  * box.  @a priv must be the smart data of the box.
8842  *
8843  * The object's overall behavior is controlled by its properties,
8844  * which are set by the evas_object_box_{h,v}_{align,padding}_set()
8845  * family of functions.  The properties of the elements in the box --
8846  * set by evas_object_size_hint_{align,padding,weight}_set() functions
8847  * -- also control the way this function works.
8848  *
8849  * \par box's properties:
8850  * @c align_h controls the horizontal alignment of the child objects
8851  * relative to the containing box. When set to 0, children are aligned
8852  * to the left. A value of 1 lets them aligned to the right border.
8853  * Values in between align them proportionally.  Note that if the size
8854  * required by the children, which is given by their widths and the @c
8855  * padding_h property of the box, is bigger than the container width,
8856  * the children will be displayed out of its bounds.  A negative value
8857  * of @c align_h makes the box to *justify* its children. The padding
8858  * between them, in this case, is corrected so that the leftmost one
8859  * touches the left border and the rightmost one touches the right
8860  * border (even if they must overlap).  The @c align_v and @c
8861  * padding_v properties of the box don't contribute to its behaviour
8862  * when this layout is chosen.
8863  *
8864  * \par Child element's properties:
8865  * @c align_x does not influence the box's behavior.  @c padding_l and
8866  * @c padding_r sum up to the container's horizontal padding between
8867  * elements.  The child's @c padding_t, @c padding_b and @c align_y
8868  * properties apply for padding/positioning relative to the overall
8869  * height of the box. Finally, there is the @c weight_x property,
8870  * which, if set to a non-zero value, tells the container that the
8871  * child width is not pre-defined.  If the container can't accommodate
8872  * all its children, it sets the widths of the children *with weights*
8873  * to sizes as small as they can all fit into it.  If the size
8874  * required by the children is less than the available, the box
8875  * increases its children's (which have weights) widths as to fit the
8876  * remaining space.  The @c weight_x property, besides telling the
8877  * element is resizable, gives a *weight* for the resizing process.
8878  * The parent box will try to distribute (or take off) widths
8879  * accordingly to the *normalized* list of weigths: most weighted
8880  * children remain/get larger in this process than the least ones.
8881  * @c weight_y does not influence the layout.
8882  *
8883  * If one desires that, besides having weights, child elements must be
8884  * resized bounded to a minimum or maximum size, their size hint
8885  * properties must be set (by the
8886  * evas_object_size_hint_{min,max}_set() functions.
8887  */
8888 EAPI void                       evas_object_box_layout_horizontal                     (Evas_Object *o, Evas_Object_Box_Data *priv, void *data) EINA_ARG_NONNULL(1, 2);
8889
8890 /**
8891  * Layout function which sets the box @a o to a (basic) vertical box.
8892  * @a priv must be the smart data of the box.
8893  *
8894  * This function behaves analogously to
8895  * evas_object_box_layout_horizontal().  The description of its
8896  * behaviour can be derived from that function's documentation.
8897  */
8898 EAPI void                       evas_object_box_layout_vertical                       (Evas_Object *o, Evas_Object_Box_Data *priv, void *data) EINA_ARG_NONNULL(1, 2);
8899
8900 /**
8901  * Layout function which sets the box @a o to a *homogeneous* vertical
8902  * box.  @a priv must be the smart data of the box.
8903  *
8904  * This function behaves analogously to
8905  * evas_object_box_layout_homogeneous_horizontal().  The description
8906  * of its behaviour can be derived from that function's documentation.
8907  */
8908 EAPI void                       evas_object_box_layout_homogeneous_vertical           (Evas_Object *o, Evas_Object_Box_Data *priv, void *data) EINA_ARG_NONNULL(1, 2);
8909
8910 /**
8911  * Layout function which sets the box @a o to a *homogeneous*
8912  * horizontal box.  @a priv must be the smart data of the box.
8913  *
8914  * In a homogeneous horizontal box, its width is divided equally
8915  * between the contained objects.  The box's overall behavior is
8916  * controlled by its properties, which are set by the
8917  * evas_object_box_{h,v}_{align,padding}_set() family of functions.
8918  * The properties of the elements in the box -- set by
8919  * evas_object_size_hint_{align,padding,weight}_set() functions --
8920  * also control the way this function works.
8921  *
8922  * \par box's properties:
8923  * @c align_h has no influence on the box for this layout.  @c
8924  * padding_h tells the box to draw empty spaces of that size, in
8925  * pixels, between the (still equal) child objects's cells.  The @c
8926  * align_v and @c padding_v properties of the box don't contribute to
8927  * its behaviour when this layout is chosen.
8928  *
8929  * \par Child element's properties:
8930  * @c padding_l and @c padding_r sum up to the required width of the
8931  * child element.  The @c align_x property tells the relative position
8932  * of this overall child width in its allocated cell (0 to extreme
8933  * left, 1 to extreme right).  A value of -1.0 to @c align_x makes the
8934  * box try to resize this child element to the exact width of its cell
8935  * (respecting the min and max hints on the child's width *and*
8936  * accounting its horizontal padding properties).  The child's @c
8937  * padding_t, @c padding_b and @c align_y properties apply for
8938  * padding/positioning relative to the overall height of the box. A
8939  * value of -1.0 to @c align_y makes the box try to resize this child
8940  * element to the exact height of its parent (respecting the max hint
8941  * on the child's height).
8942  */
8943 EAPI void                       evas_object_box_layout_homogeneous_horizontal         (Evas_Object *o, Evas_Object_Box_Data *priv, void *data) EINA_ARG_NONNULL(1, 2);
8944
8945 /**
8946  * Layout function which sets the box @a o to a *max size-homogeneous*
8947  * horizontal box.  @a priv must be the smart data of the box.
8948  *
8949  * In a max size-homogeneous horizontal box, the equal sized cells
8950  * reserved for the child objects have the width of the space required
8951  * by the largest child (in width). The box's overall behavior is
8952  * controlled by its properties, which are set by the
8953  * evas_object_box_{h,v}_{align,padding}_set() family of functions.
8954  * The properties of the elements in the box -- set by
8955  * evas_object_size_hint_{align,padding,weight}_set() functions --
8956  * also control the way this function works.
8957  *
8958  * \par box's properties:
8959  * @c padding_h tells the box to draw empty spaces of that size, in
8960  * pixels, between the child objects's cells.  @c align_h controls the
8961  * horizontal alignment of the child objects relative to the
8962  * containing box. When set to 0, children are aligned to the left. A
8963  * value of 1 lets them aligned to the right border.  Values in
8964  * between align them proportionally. A negative value of @c align_h
8965  * makes the box to *justify* its children cells. The padding between
8966  * them, in this case, is corrected so that the leftmost one touches
8967  * the left border and the rightmost one touches the right border
8968  * (even if they must overlap).  The @c align_v and @c padding_v
8969  * properties of the box don't contribute to its behaviour when this
8970  * layout is chosen.
8971  *
8972  * \par Child element's properties:
8973  * @c padding_l and @c padding_r sum up to the required width of the
8974  * child element. The @c align_x property tells the relative position
8975  * of this overall child width in its allocated cell (0 to extreme
8976  * left, 1 to extreme right).  A value of -1.0 to @c align_x makes the
8977  * box try to resize this child element to the exact width of its cell
8978  * (respecting the min and max hints on the child's width *and*
8979  * accounting its horizontal padding properties).  The child's @c
8980  * padding_t, @c padding_b and @c align_y properties apply for
8981  * padding/positioning relative to the overall height of the box. A
8982  * value of -1.0 to @c align_y makes the box try to resize this child
8983  * element to the exact height of its parent (respecting the max hint
8984  * on the child's height).
8985  */
8986 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);
8987
8988 /**
8989  * Layout function which sets the box @a o to a *max size-homogeneous*
8990  * vertical box.  @a priv must be the smart data of the box.
8991  *
8992  * This function behaves analogously to
8993  * evas_object_box_layout_homogeneous_max_size_horizontal().  The
8994  * description of its behaviour can be derived from that function's
8995  * documentation.
8996  */
8997 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);
8998
8999 /**
9000  * Layout function which sets the box @a o to a *flow* horizontal box.
9001  * @a priv must be the smart data of the box.
9002  *
9003  * In a flow horizontal box, the box's child elements are placed in
9004  * rows (think of text as an analogy). A row has as much elements as
9005  * can fit into the box's width.  The box's overall behavior is
9006  * controlled by its properties, which are set by the
9007  * evas_object_box_{h,v}_{align,padding}_set() family of functions.
9008  * The properties of the elements in the box -- set by
9009  * evas_object_size_hint_{align,padding,weight}_set() functions --
9010  * also control the way this function works.
9011  *
9012  * \par box's properties:
9013  * @c padding_h tells the box to draw empty spaces of that size, in
9014  * pixels, between the child objects's cells.  @c align_h dictates the
9015  * horizontal alignment of the rows (0 to left align them, 1 to right
9016  * align).  A value of -1.0 to @c align_h lets the rows *justified*
9017  * horizontally.  @c align_v controls the vertical alignment of the
9018  * entire set of rows (0 to top, 1 to bottom).  A value of -1.0 to @c
9019  * align_v makes the box to *justify* the rows vertically. The padding
9020  * between them, in this case, is corrected so that the first row
9021  * touches the top border and the last one touches the bottom border
9022  * (even if they must overlap). @c padding_v has no influence on the
9023  * layout.
9024  *
9025  * \par Child element's properties:
9026  * @c padding_l and @c padding_r sum up to the required width of the
9027  * child element.  The @c align_x property has no influence on the
9028  * layout. The child's @c padding_t and @c padding_b sum up to the
9029  * required height of the child element and is the only means (besides
9030  * row justifying) of setting space between rows.  Note, however, that
9031  * @c align_y dictates positioning relative to the *largest height*
9032  * required by a child object in the actual row.
9033  */
9034 EAPI void                       evas_object_box_layout_flow_horizontal                (Evas_Object *o, Evas_Object_Box_Data *priv, void *data) EINA_ARG_NONNULL(1, 2);
9035
9036 /**
9037  * Layout function which sets the box @a o to a *flow* vertical box.
9038  * @a priv must be the smart data of the box.
9039  *
9040  * This function behaves analogously to
9041  * evas_object_box_layout_flow_horizontal().  The description of its
9042  * behaviour can be derived from that function's documentation.
9043  */
9044 EAPI void                       evas_object_box_layout_flow_vertical                  (Evas_Object *o, Evas_Object_Box_Data *priv, void *data) EINA_ARG_NONNULL(1, 2);
9045
9046 /**
9047  * Layout function which sets the box @a o to set all children to the
9048  * size of the object.  @a priv must be the smart data of the box.
9049  *
9050  * In a stack box, all children will be given the same size and they
9051  * will be stacked on above the other, so the first object will be the
9052  * bottom most.
9053  *
9054  * \par box's properties:
9055  * No box option is used.
9056  *
9057  * \par Child  element's   properties:
9058  * @c padding_l and @c padding_r sum up to the required width of the
9059  * child element.  The @c align_x property tells the relative position
9060  * of this overall child width in its allocated cell (0 to extreme
9061  * left, 1 to extreme right).  A value of -1.0 to @c align_x makes the
9062  * box try to resize this child element to the exact width of its cell
9063  * (respecting the min and max hints on the child's width *and*
9064  * accounting its horizontal padding properties).  Same applies to
9065  * vertical axis.
9066  */
9067 EAPI void                       evas_object_box_layout_stack                          (Evas_Object *o, Evas_Object_Box_Data *priv, void *data) EINA_ARG_NONNULL(1, 2);
9068
9069
9070 /**
9071  * Set the alignment of the whole bounding box of contents.
9072  */
9073 EAPI void                       evas_object_box_align_set                             (Evas_Object *o, double horizontal, double vertical) EINA_ARG_NONNULL(1);
9074
9075 /**
9076  * Get alignment of the whole bounding box of contents.
9077  */
9078 EAPI void                       evas_object_box_align_get                             (const Evas_Object *o, double *horizontal, double *vertical) EINA_ARG_NONNULL(1);
9079
9080 /**
9081  * Set the space (padding) between cells.
9082  */
9083 EAPI void                       evas_object_box_padding_set                           (Evas_Object *o, Evas_Coord horizontal, Evas_Coord vertical) EINA_ARG_NONNULL(1);
9084
9085 /**
9086  * Get the (space) padding between cells.
9087  */
9088 EAPI void                       evas_object_box_padding_get                           (const Evas_Object *o, Evas_Coord *horizontal, Evas_Coord *vertical) EINA_ARG_NONNULL(1);
9089
9090
9091 /**
9092  * Append a new object @a child to the box @a o. On error, @c NULL is
9093  * returned.
9094  */
9095 EAPI Evas_Object_Box_Option    *evas_object_box_append                                (Evas_Object *o, Evas_Object *child) EINA_ARG_NONNULL(1, 2);
9096
9097 /**
9098  * Prepend a new object @a child to the box @a o. On error, @c NULL is
9099  * returned.
9100  */
9101 EAPI Evas_Object_Box_Option    *evas_object_box_prepend                               (Evas_Object *o, Evas_Object *child) EINA_ARG_NONNULL(1, 2);
9102
9103 /**
9104  * Prepend a new object @a child to the box @c o relative to element @a
9105  * reference. If @a reference is not contained in the box or any other
9106  * error occurs, @c NULL is returned.
9107  */
9108 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);
9109
9110 /**
9111  * Append a new object @a child to the box @c o relative to element @a
9112  * reference. If @a reference is not contained in the box or any other
9113  * error occurs, @c NULL is returend.
9114  */
9115 EAPI Evas_Object_Box_Option    *evas_object_box_insert_after                          (Evas_Object *o, Evas_Object *child, const Evas_Object *referente) EINA_ARG_NONNULL(1, 2, 3);
9116
9117 /**
9118  * Insert a new object @a child to the box @a o at position @a pos. On
9119  * error, @c NULL is returned.
9120  */
9121 EAPI Evas_Object_Box_Option    *evas_object_box_insert_at                             (Evas_Object *o, Evas_Object *child, unsigned int pos) EINA_ARG_NONNULL(1, 2);
9122
9123 /**
9124  * Remove an object @a child from the box @a o. On error, @c 0 is
9125  * returned.
9126  */
9127 EAPI Eina_Bool                  evas_object_box_remove                                (Evas_Object *o, Evas_Object *child) EINA_ARG_NONNULL(1, 2);
9128
9129 /**
9130  * Remove an object from the box @a o which occupies position @a
9131  * pos. On error, @c 0 is returned.
9132  */
9133 EAPI Eina_Bool                  evas_object_box_remove_at                             (Evas_Object *o, unsigned int pos) EINA_ARG_NONNULL(1);
9134
9135 /**
9136  * Remove all child objects.
9137  * @return 0 on errors
9138  */
9139 EAPI Eina_Bool                  evas_object_box_remove_all                            (Evas_Object *o, Eina_Bool clear) EINA_ARG_NONNULL(1);
9140
9141 /**
9142  * Get an iterator to walk the list of children for the box.
9143  *
9144  * @note Do not remove or delete objects while walking the list.
9145  */
9146 EAPI Eina_Iterator             *evas_object_box_iterator_new                          (const Evas_Object *o) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
9147
9148 /**
9149  * Get an accessor to get random access to the list of children for the box.
9150  *
9151  * @note Do not remove or delete objects while walking the list.
9152  */
9153 EAPI Eina_Accessor             *evas_object_box_accessor_new                          (const Evas_Object *o) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
9154
9155 /**
9156  * Get the list of children for the box.
9157  *
9158  * @note This is a duplicate of the list kept by the box internally.
9159  *       It's up to the user to destroy it when it no longer needs it.
9160  *       It's possible to remove objects from the box when walking this
9161  *       list, but these removals won't be reflected on it.
9162  */
9163 EAPI Eina_List                 *evas_object_box_children_get                          (const Evas_Object *o) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
9164
9165
9166 /**
9167  * Get the name of the property of the child elements of the box @a o
9168  * whose id is @a property. On error, @c NULL is returned.
9169  */
9170 EAPI const char                *evas_object_box_option_property_name_get              (Evas_Object *o, int property) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
9171
9172 /**
9173  * Get the id of the property of the child elements of the box @a o
9174  * whose name is @a name. On error, @c -1 is returned.
9175  */
9176 EAPI int                        evas_object_box_option_property_id_get                (Evas_Object *o, const char *name) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2) EINA_PURE;
9177
9178 /**
9179  * Set the property (with id @a property) of the child element of the
9180  * box @a o whose property struct is @a opt. The property's values
9181  * must be the last arguments and their type *must* match that of the
9182  * property itself. On error, @c 0 is returned.
9183  */
9184 EAPI Eina_Bool                  evas_object_box_option_property_set                   (Evas_Object *o, Evas_Object_Box_Option *opt, int property, ...) EINA_ARG_NONNULL(1, 2);
9185
9186 /**
9187  * Set the property (with id @a property) of the child element of the
9188  * box @a o whose property struct is @a opt. The property's values
9189  * must be the args which the va_list @a args is initialized with and
9190  * their type *must* match that of the property itself. On error, @c 0
9191  * is returned.
9192  */
9193 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);
9194
9195 /**
9196  * Get the property (with id @a property) of the child element of the
9197  * box @a o whose property struct is @a opt. The last arguments must
9198  * be addresses of variables with the same type of that property. On
9199  * error, @c 0 is returned.
9200  */
9201 EAPI Eina_Bool                  evas_object_box_option_property_get                   (Evas_Object *o, Evas_Object_Box_Option *opt, int property, ...) EINA_ARG_NONNULL(1, 2);
9202
9203 /**
9204  * Get the property (with id @a property) of the child element of the
9205  * box @a o whose property struct is @a opt. The args which the
9206  * va_list @a args is initialized with must be addresses of variables
9207  * with the same type of that property. On error, @c 0 is returned.
9208  */
9209 EAPI Eina_Bool                  evas_object_box_option_property_vget                  (Evas_Object *o, Evas_Object_Box_Option *opt, int property, va_list args) EINA_ARG_NONNULL(1, 2);
9210
9211 /**
9212  * @defgroup Evas_Object_Table Table Smart Object.
9213  *
9214  * Convenience smart object that packs children using a tabular
9215  * layout using children size hints to define their size and
9216  * alignment inside their cell space.
9217  *
9218  * @see @ref Evas_Object_Group_Size_Hints
9219  *
9220  * @ingroup Evas_Smart_Object_Group
9221  */
9222
9223 /**
9224  * Create a new table.
9225  *
9226  * It's set to non-homogeneous by default, add children with
9227  * evas_object_table_pack().
9228  */
9229 EAPI Evas_Object                        *evas_object_table_add             (Evas *evas) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
9230
9231 /**
9232  * Create a table that is child of a given element @a parent.
9233  *
9234  * @see evas_object_table_add()
9235  */
9236 EAPI Evas_Object                        *evas_object_table_add_to          (Evas_Object *parent) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
9237
9238 /**
9239  * Set how this table should layout children.
9240  *
9241  * @todo consider aspect hint and respect it.
9242  *
9243  * @par EVAS_OBJECT_TABLE_HOMOGENEOUS_NONE
9244  * If table does not use homogeneous mode then columns and rows will
9245  * be calculated based on hints of individual cells. This operation
9246  * mode is more flexible, but more complex and heavy to calculate as
9247  * well. @b Weight properties are handled as a boolean
9248  * expand. Negative alignment will be considered as 0.5.
9249  *
9250  * @todo @c EVAS_OBJECT_TABLE_HOMOGENEOUS_NONE should balance weight.
9251  *
9252  * @par EVAS_OBJECT_TABLE_HOMOGENEOUS_TABLE
9253  * When homogeneous is relative to table the own table size is divided
9254  * equally among children, filling the whole table area. That is, if
9255  * table has @c WIDTH and @c COLUMNS, each cell will get <tt>WIDTH /
9256  * COLUMNS</tt> pixels. If children have minimum size that is larger
9257  * than this amount (including padding), then it will overflow and be
9258  * aligned respecting the alignment hint, possible overlapping sibling
9259  * cells. @b Weight hint is used as a boolean, if greater than zero it
9260  * will make the child expand in that axis, taking as much space as
9261  * possible (bounded to maximum size hint). Negative alignment will be
9262  * considered as 0.5.
9263  *
9264  * @par EVAS_OBJECT_TABLE_HOMOGENEOUS_ITEM
9265  * When homogeneous is relative to item it means the greatest minimum
9266  * cell size will be used. That is, if no element is set to expand,
9267  * the table will have its contents to a minimum size, the bounding
9268  * box of all these children will be aligned relatively to the table
9269  * object using evas_object_table_align_get(). If the table area is
9270  * too small to hold this minimum bounding box, then the objects will
9271  * keep their size and the bounding box will overflow the box area,
9272  * still respecting the alignment. @b Weight hint is used as a
9273  * boolean, if greater than zero it will make that cell expand in that
9274  * axis, toggling the <b>expand mode</b>, which makes the table behave
9275  * much like @b EVAS_OBJECT_TABLE_HOMOGENEOUS_TABLE, except that the
9276  * bounding box will overflow and items will not overlap siblings. If
9277  * no minimum size is provided at all then the table will fallback to
9278  * expand mode as well.
9279  */
9280 EAPI void                                evas_object_table_homogeneous_set (Evas_Object *o, Evas_Object_Table_Homogeneous_Mode homogeneous) EINA_ARG_NONNULL(1);
9281
9282 /**
9283  * Get the current layout homogeneous mode.
9284  *
9285  * @see evas_object_table_homogeneous_set()
9286  */
9287 EAPI Evas_Object_Table_Homogeneous_Mode  evas_object_table_homogeneous_get (const Evas_Object *o) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
9288
9289 /**
9290  * Set padding between cells.
9291  */
9292 EAPI void                                evas_object_table_padding_set     (Evas_Object *o, Evas_Coord horizontal, Evas_Coord vertical) EINA_ARG_NONNULL(1);
9293
9294 /**
9295  * Get padding between cells.
9296  */
9297 EAPI void                                evas_object_table_padding_get     (const Evas_Object *o, Evas_Coord *horizontal, Evas_Coord *vertical) EINA_ARG_NONNULL(1);
9298
9299 /**
9300  * Set the alignment of the whole bounding box of contents.
9301  */
9302 EAPI void                                evas_object_table_align_set       (Evas_Object *o, double horizontal, double vertical) EINA_ARG_NONNULL(1);
9303
9304 /**
9305  * Get alignment of the whole bounding box of contents.
9306  */
9307 EAPI void                                evas_object_table_align_get       (const Evas_Object *o, double *horizontal, double *vertical) EINA_ARG_NONNULL(1);
9308
9309 /**
9310  * Sets the mirrored mode of the table. In mirrored mode the table items go
9311  * from right to left instead of left to right. That is, 1,1 is top right, not
9312  * to left.
9313  *
9314  * @param obj The table object.
9315  * @param mirrored the mirrored mode to set
9316  * @since 1.1.0
9317  */
9318 EAPI void                                evas_object_table_mirrored_set    (Evas_Object *o, Eina_Bool mirrored) EINA_ARG_NONNULL(1);
9319
9320 /**
9321  * Gets the mirrored mode of the table. In mirrored mode the table items go
9322  * from right to left instead of left to right. That is, 1,1 is top right, not
9323  * to left.
9324  *
9325  * @param obj The table object.
9326  * @return EINA_TRUE if it's a mirrored table, EINA_FALSE otherwise.
9327  * @since 1.1.0
9328  */
9329
9330 /**
9331  * Get a child from the table using its coordinates
9332  *
9333  * @note This does not take into account col/row spanning
9334  */
9335 EAPI Eina_Bool                           evas_object_table_mirrored_get    (const Evas_Object *o) EINA_ARG_NONNULL(1);
9336
9337
9338 /**
9339  * Get packing location of a child of table
9340  *
9341  * @param o The given table object.
9342  * @param child The child object to add.
9343  * @param col pointer to store relative-horizontal position to place child.
9344  * @param row pointer to store relative-vertical position to place child.
9345  * @param colspan pointer to store how many relative-horizontal position to use for this child.
9346  * @param rowspan pointer to store how many relative-vertical position to use for this child.
9347  *
9348  * @return 1 on success, 0 on failure.
9349  * @since 1.1.0
9350  */
9351 EAPI Eina_Bool                           evas_object_table_pack_get(Evas_Object *o, Evas_Object *child, unsigned short *col, unsigned short *row, unsigned short *colspan, unsigned short *rowspan);
9352          
9353 /**
9354  * Add a new child to a table object or set its current packing.
9355  *
9356  * @param o The given table object.
9357  * @param child The child object to add.
9358  * @param col relative-horizontal position to place child.
9359  * @param row relative-vertical position to place child.
9360  * @param colspan how many relative-horizontal position to use for this child.
9361  * @param rowspan how many relative-vertical position to use for this child.
9362  *
9363  * @return 1 on success, 0 on failure.
9364  */
9365 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);
9366
9367 /**
9368  * Remove child from table.
9369  *
9370  * @note removing a child will immediately call a walk over children in order
9371  *       to recalculate numbers of columns and rows. If you plan to remove
9372  *       all children, use evas_object_table_clear() instead.
9373  *
9374  * @return 1 on success, 0 on failure.
9375  */
9376 EAPI Eina_Bool                           evas_object_table_unpack          (Evas_Object *o, Evas_Object *child) EINA_ARG_NONNULL(1, 2);
9377
9378 /**
9379  * Faster way to remove all child objects from a table object.
9380  *
9381  * @param o The given table object.
9382  * @param clear if true, it will delete just removed children.
9383  */
9384 EAPI void                                evas_object_table_clear           (Evas_Object *o, Eina_Bool clear) EINA_ARG_NONNULL(1);
9385
9386
9387 /**
9388  * Get the number of columns and rows this table takes.
9389  *
9390  * @note columns and rows are virtual entities, one can specify a table
9391  *       with a single object that takes 4 columns and 5 rows. The only
9392  *       difference for a single cell table is that paddings will be
9393  *       accounted proportionally.
9394  */
9395 EAPI void                                evas_object_table_col_row_size_get(const Evas_Object *o, int *cols, int *rows) EINA_ARG_NONNULL(1);
9396
9397 /**
9398  * Get an iterator to walk the list of children for the table.
9399  *
9400  * @note Do not remove or delete objects while walking the list.
9401  */
9402 EAPI Eina_Iterator                      *evas_object_table_iterator_new    (const Evas_Object *o) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
9403
9404 /**
9405  * Get an accessor to get random access to the list of children for the table.
9406  *
9407  * @note Do not remove or delete objects while walking the list.
9408  */
9409 EAPI Eina_Accessor                      *evas_object_table_accessor_new    (const Evas_Object *o) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
9410
9411 /**
9412  * Get the list of children for the table.
9413  *
9414  * @note This is a duplicate of the list kept by the table internally.
9415  *       It's up to the user to destroy it when it no longer needs it.
9416  *       It's possible to remove objects from the table when walking this
9417  *       list, but these removals won't be reflected on it.
9418  */
9419 EAPI Eina_List                          *evas_object_table_children_get    (const Evas_Object *o) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
9420    EAPI Evas_Object                        *evas_object_table_child_get       (const Evas_Object *o, unsigned short col, unsigned short row) EINA_ARG_NONNULL(1);
9421    
9422 /**
9423  * @defgroup Evas_Object_Grid Grid Smart Object.
9424  *
9425  * Convenience smart object that packs children using a regular grid
9426  * layout using Their virtual grid location and size to determine
9427  * position inside the grid object
9428  *
9429  * @ingroup Evas_Smart_Object_Group
9430  * @since 1.1.0
9431  */
9432
9433 /**
9434  * Create a new grid.
9435  *
9436  * It's set to a virtual size of 1x1 by default and add children with
9437  * evas_object_grid_pack().
9438  * @since 1.1.0
9439  */
9440 EAPI Evas_Object                        *evas_object_grid_add             (Evas *evas) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
9441
9442 /**
9443  * Create a grid that is child of a given element @a parent.
9444  *
9445  * @see evas_object_grid_add()
9446  * @since 1.1.0
9447  */
9448 EAPI Evas_Object                        *evas_object_grid_add_to          (Evas_Object *parent) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
9449
9450 /**
9451  * Set the virtual resolution for the grid
9452  *
9453  * @param o The grid object to modify
9454  * @param w The virtual horizontal size (resolution) in integer units
9455  * @param h The virtual vertical size (resolution) in integer units
9456  * @since 1.1.0
9457  */
9458 EAPI void                                evas_object_grid_size_set        (Evas_Object *o, int w, int h) EINA_ARG_NONNULL(1);
9459
9460 /**
9461  * Get the current virtual resolution
9462  *
9463  * @param o The grid object to query
9464  * @param w A pointer to an integer to store the virtual width
9465  * @param h A pointer to an integer to store the virtual height
9466  * @see evas_object_grid_size_set()
9467  * @since 1.1.0
9468  */
9469 EAPI void                                evas_object_grid_size_get        (const Evas_Object *o, int *w, int *h) EINA_ARG_NONNULL(1) EINA_PURE;
9470
9471 /**
9472  * Sets the mirrored mode of the grid. In mirrored mode the grid items go
9473  * from right to left instead of left to right. That is, 0,0 is top right, not
9474  * to left.
9475  *
9476  * @param obj The grid object.
9477  * @param mirrored the mirrored mode to set
9478  * @since 1.1.0
9479  */
9480 EAPI void                                evas_object_grid_mirrored_set    (Evas_Object *o, Eina_Bool mirrored) EINA_ARG_NONNULL(1);
9481
9482 /**
9483  * Gets the mirrored mode of the grid.
9484  *
9485  * @param obj The grid object.
9486  * @return EINA_TRUE if it's a mirrored grid, EINA_FALSE otherwise.
9487  * @see evas_object_grid_mirrored_set()
9488  * @since 1.1.0
9489  */
9490 EAPI Eina_Bool                           evas_object_grid_mirrored_get    (const Evas_Object *o) EINA_ARG_NONNULL(1);
9491
9492 /**
9493  * Add a new child to a grid object.
9494  *
9495  * @param o The given grid object.
9496  * @param child The child object to add.
9497  * @param x The virtual x coordinate of the child
9498  * @param y The virtual y coordinate of the child
9499  * @param w The virtual width of the child
9500  * @param h The virtual height of the child
9501  * @return 1 on success, 0 on failure.
9502  * @since 1.1.0
9503  */
9504 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);
9505
9506 /**
9507  * Remove child from grid.
9508  *
9509  * @note removing a child will immediately call a walk over children in order
9510  *       to recalculate numbers of columns and rows. If you plan to remove
9511  *       all children, use evas_object_grid_clear() instead.
9512  *
9513  * @return 1 on success, 0 on failure.
9514  * @since 1.1.0
9515  */
9516 EAPI Eina_Bool                           evas_object_grid_unpack          (Evas_Object *o, Evas_Object *child) EINA_ARG_NONNULL(1, 2);
9517
9518 /**
9519  * Faster way to remove all child objects from a grid object.
9520  *
9521  * @param o The given grid object.
9522  * @param clear if true, it will delete just removed children.
9523  * @since 1.1.0
9524  */
9525 EAPI void                                evas_object_grid_clear           (Evas_Object *o, Eina_Bool clear) EINA_ARG_NONNULL(1);
9526
9527 /**
9528  * Get the pack options for a grid child
9529  * 
9530  * Get the pack x, y, width and height in virtual coordinates set by
9531  * evas_object_grid_pack()
9532  * @param o The grid object
9533  * @param child The grid child to query for coordinates
9534  * @param x The pointer to where the x coordinate will be returned
9535  * @param y The pointer to where the y coordinate will be returned
9536  * @param w The pointer to where the width will be returned
9537  * @param h The pointer to where the height will be returned
9538  * @return 1 on success, 0 on failure.
9539  * @since 1.1.0
9540  */
9541 EAPI Eina_Bool                           evas_object_grid_pack_get        (Evas_Object *o, Evas_Object *child, int *x, int *y, int *w, int *h);
9542          
9543 /**
9544  * Get an iterator to walk the list of children for the grid.
9545  *
9546  * @note Do not remove or delete objects while walking the list.
9547  * @since 1.1.0
9548  */
9549 EAPI Eina_Iterator                      *evas_object_grid_iterator_new    (const Evas_Object *o) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
9550
9551 /**
9552  * Get an accessor to get random access to the list of children for the grid.
9553  *
9554  * @note Do not remove or delete objects while walking the list.
9555  * @since 1.1.0
9556  */
9557 EAPI Eina_Accessor                      *evas_object_grid_accessor_new    (const Evas_Object *o) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
9558
9559 /**
9560  * Get the list of children for the grid.
9561  *
9562  * @note This is a duplicate of the list kept by the grid internally.
9563  *       It's up to the user to destroy it when it no longer needs it.
9564  *       It's possible to remove objects from the grid when walking this
9565  *       list, but these removals won't be reflected on it.
9566  * @since 1.1.0
9567  */
9568 EAPI Eina_List                          *evas_object_grid_children_get    (const Evas_Object *o) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
9569          
9570 /**
9571  * @defgroup Evas_Cserve Shared Image Cache Server
9572  *
9573  * Provides client-server infrastructure to share bitmaps across
9574  * multiple processes, saving data and processing power.
9575  */
9576    typedef struct _Evas_Cserve_Stats       Evas_Cserve_Stats;
9577    typedef struct _Evas_Cserve_Image_Cache Evas_Cserve_Image_Cache;
9578    typedef struct _Evas_Cserve_Image       Evas_Cserve_Image;
9579    typedef struct _Evas_Cserve_Config      Evas_Cserve_Config;
9580
9581 /**
9582  * Statistics about server that shares cached bitmaps.
9583  * @ingroup Evas_Cserve
9584  */
9585    struct _Evas_Cserve_Stats
9586      {
9587         int    saved_memory; /**< current saved memory, in bytes */
9588         int    wasted_memory; /**< current wasted memory, in bytes */
9589         int    saved_memory_peak; /**< peak of saved memory, in bytes */
9590         int    wasted_memory_peak; /**< peak of wasted memory, in bytes */
9591         double saved_time_image_header_load; /**< time, in seconds, saved in header loads by sharing cached loads instead */
9592         double saved_time_image_data_load; /**< time, in seconds, saved in data loads by sharing cached loads instead */
9593      };
9594
9595 /**
9596  * Cache of images shared by server.
9597  * @ingroup Evas_Cserve
9598  */
9599    struct _Evas_Cserve_Image_Cache
9600      {
9601         struct {
9602            int     mem_total;
9603            int     count;
9604         } active, cached;
9605         Eina_List *images;
9606      };
9607
9608 /**
9609  * An image shared by the server.
9610  * @ingroup Evas_Cserve
9611  */
9612    struct _Evas_Cserve_Image
9613      {
9614         const char *file, *key;
9615         int         w, h;
9616         time_t      file_mod_time;
9617         time_t      file_checked_time;
9618         time_t      cached_time;
9619         int         refcount;
9620         int         data_refcount;
9621         int         memory_footprint;
9622         double      head_load_time;
9623         double      data_load_time;
9624         Eina_Bool   alpha : 1;
9625         Eina_Bool   data_loaded : 1;
9626         Eina_Bool   active : 1;
9627         Eina_Bool   dead : 1;
9628         Eina_Bool   useless : 1;
9629      };
9630
9631 /**
9632  * Configuration that controls the server that shares cached bitmaps.
9633  * @ingroup Evas_Cserve
9634  */
9635     struct _Evas_Cserve_Config
9636      {
9637         int cache_max_usage;
9638         int cache_item_timeout;
9639         int cache_item_timeout_check;
9640      };
9641
9642
9643 /**
9644  * Retrieves if the system wants to share bitmaps using the server.
9645  * @return @c EINA_TRUE if wants, @c EINA_FALSE otherwise.
9646  * @ingroup Evas_Cserve
9647  */
9648 EAPI Eina_Bool         evas_cserve_want_get                   (void) EINA_WARN_UNUSED_RESULT EINA_PURE;
9649
9650 /**
9651  * Retrieves if the system is connected to the server used to shae bitmaps.
9652  * @return @c EINA_TRUE if connected, @c EINA_FALSE otherwise.
9653  * @ingroup Evas_Cserve
9654  */
9655 EAPI Eina_Bool         evas_cserve_connected_get              (void) EINA_WARN_UNUSED_RESULT;
9656
9657 /**
9658  * Retrieves if the system wants to share bitmaps using the server.
9659  * @param stats pointer to structure to fill with statistics about
9660  *        cache server.
9661  * @return @c EINA_TRUE if @p stats were filled with data,
9662  *         @c EINA_FALSE otherwise and @p stats is untouched.
9663  * @ingroup Evas_Cserve
9664  */
9665 EAPI Eina_Bool         evas_cserve_stats_get                  (Evas_Cserve_Stats *stats) EINA_WARN_UNUSED_RESULT;
9666    EAPI void              evas_cserve_image_cache_contents_clean (Evas_Cserve_Image_Cache *cache) EINA_PURE;
9667
9668 /**
9669  * Retrieves the current configuration of the server.
9670  * @param config where to store current server configuration.
9671  * @return @c EINA_TRUE if @p config were filled with data,
9672  *         @c EINA_FALSE otherwise and @p config is untouched.
9673  * @ingroup Evas_Cserve
9674  */
9675 EAPI Eina_Bool         evas_cserve_config_get                 (Evas_Cserve_Config *config) EINA_WARN_UNUSED_RESULT EINA_PURE;
9676
9677 /**
9678  * Changes the configuration of the server.
9679  * @param config where to store current server configuration.
9680  * @return @c EINA_TRUE if @p config were successfully applied,
9681  *         @c EINA_FALSE otherwise.
9682  * @ingroup Evas_Cserve
9683  */
9684 EAPI Eina_Bool         evas_cserve_config_set                 (const Evas_Cserve_Config *config) EINA_WARN_UNUSED_RESULT EINA_PURE;
9685
9686 /**
9687  * Force system to disconnect from cache server.
9688  * @ingroup Evas_Cserve
9689  */
9690 EAPI void              evas_cserve_disconnect                 (void);
9691
9692 /**
9693  * @defgroup Evas_Utils General Utilities
9694  *
9695  * Some functions that are handy but are not specific of canvas or
9696  * objects.
9697  */
9698
9699 /**
9700  * Converts the given Evas image load error code into a string
9701  * describing it in english.
9702  *
9703  * @param error the error code, a value in ::Evas_Load_Error.
9704  * @return Always returns a valid string. If the given @p error is not
9705  *         supported, <code>"Unknown error"</code> is returned.
9706  *
9707  * Mostly evas_object_image_file_set() would be the function setting
9708  * that error value afterwards, but also evas_object_image_load(),
9709  * evas_object_image_save(), evas_object_image_data_get(),
9710  * evas_object_image_data_convert(), evas_object_image_pixels_import()
9711  * and evas_object_image_is_inside(). This function is meant to be
9712  * used in conjunction with evas_object_image_load_error_get(), as in:
9713  *
9714  * Example code:
9715  * @dontinclude evas-load-error-str.c
9716  * @skip img1 =
9717  * @until ecore_main_loop_begin(
9718  *
9719  * Here, being @c valid_path the path to a valid image and @c
9720  * bogus_path a path to a file which does not exist, the two outputs
9721  * of evas_load_error_str() would be (if no other errors occur):
9722  * <code>"No error on load"</code> and <code>"File (or file path) does
9723  * not exist"</code>, respectively. See the full @ref
9724  * Example_Evas_Images "example".
9725  *
9726  * @ingroup Evas_Utils
9727  */
9728 EAPI const char       *evas_load_error_str               (Evas_Load_Error error);
9729
9730 /* Evas utility routines for color space conversions */
9731 /* hsv color space has h in the range 0.0 to 360.0, and s,v in the range 0.0 to 1.0 */
9732 /* rgb color space has r,g,b in the range 0 to 255 */
9733
9734 /**
9735  * Convert a given color from HSV to RGB format.
9736  *
9737  * @param h The Hue component of the color.
9738  * @param s The Saturation component of the color.
9739  * @param v The Value component of the color.
9740  * @param r The Red component of the color.
9741  * @param g The Green component of the color.
9742  * @param b The Blue component of the color.
9743  *
9744  * This function converts a given color in HSV color format to RGB
9745  * color format.
9746  *
9747  * @ingroup Evas_Utils
9748  **/
9749 EAPI void              evas_color_hsv_to_rgb             (float h, float s, float v, int *r, int *g, int *b);
9750
9751 /**
9752  * Convert a given color from RGB to HSV format.
9753  *
9754  * @param r The Red component of the color.
9755  * @param g The Green component of the color.
9756  * @param b The Blue component of the color.
9757  * @param h The Hue component of the color.
9758  * @param s The Saturation component of the color.
9759  * @param v The Value component of the color.
9760  *
9761  * This function converts a given color in RGB color format to HSV
9762  * color format.
9763  *
9764  * @ingroup Evas_Utils
9765  **/
9766 EAPI void              evas_color_rgb_to_hsv             (int r, int g, int b, float *h, float *s, float *v);
9767
9768 /* argb color space has a,r,g,b in the range 0 to 255 */
9769
9770 /**
9771  * Pre-multiplies a rgb triplet by an alpha factor.
9772  *
9773  * @param a The alpha factor.
9774  * @param r The Red component of the color.
9775  * @param g The Green component of the color.
9776  * @param b The Blue component of the color.
9777  *
9778  * This function pre-multiplies a given rbg triplet by an alpha
9779  * factor. Alpha factor is used to define transparency.
9780  *
9781  * @ingroup Evas_Utils
9782  **/
9783 EAPI void              evas_color_argb_premul            (int a, int *r, int *g, int *b);
9784
9785 /**
9786  * Undo pre-multiplication of a rgb triplet by an alpha factor.
9787  *
9788  * @param a The alpha factor.
9789  * @param r The Red component of the color.
9790  * @param g The Green component of the color.
9791  * @param b The Blue component of the color.
9792  *
9793  * This function undoes pre-multiplication a given rbg triplet by an
9794  * alpha factor. Alpha factor is used to define transparency.
9795  *
9796  * @see evas_color_argb_premul().
9797  *
9798  * @ingroup Evas_Utils
9799  **/
9800 EAPI void              evas_color_argb_unpremul          (int a, int *r, int *g, int *b);
9801
9802
9803 /**
9804  * Pre-multiplies data by an alpha factor.
9805  *
9806  * @param data The data value.
9807  * @param len  The length value.
9808  *
9809  * This function pre-multiplies a given data by an alpha
9810  * factor. Alpha factor is used to define transparency.
9811  *
9812  * @ingroup Evas_Utils
9813  **/
9814 EAPI void              evas_data_argb_premul             (unsigned int *data, unsigned int len);
9815
9816 /**
9817  * Undo pre-multiplication data by an alpha factor.
9818  *
9819  * @param data The data value.
9820  * @param len  The length value.
9821  *
9822  * This function undoes pre-multiplication of a given data by an alpha
9823  * factor. Alpha factor is used to define transparency.
9824  *
9825  * @ingroup Evas_Utils
9826  **/
9827 EAPI void              evas_data_argb_unpremul           (unsigned int *data, unsigned int len);
9828
9829 /* string and font handling */
9830
9831 /**
9832  * Gets the next character in the string
9833  *
9834  * Given the UTF-8 string in @p str, and starting byte position in @p pos,
9835  * this function will place in @p decoded the decoded code point at @p pos
9836  * and return the byte index for the next character in the string.
9837  *
9838  * The only boundary check done is that @p pos must be >= 0. Other than that,
9839  * no checks are performed, so passing an index value that's not within the
9840  * length of the string will result in undefined behavior.
9841  *
9842  * @param str The UTF-8 string
9843  * @param pos The byte index where to start
9844  * @param decoded Address where to store the decoded code point. Optional.
9845  *
9846  * @return The byte index of the next character
9847  *
9848  * @ingroup Evas_Utils
9849  */
9850 EAPI int               evas_string_char_next_get         (const char *str, int pos, int *decoded) EINA_ARG_NONNULL(1);
9851
9852 /**
9853  * Gets the previous character in the string
9854  *
9855  * Given the UTF-8 string in @p str, and starting byte position in @p pos,
9856  * this function will place in @p decoded the decoded code point at @p pos
9857  * and return the byte index for the previous character in the string.
9858  *
9859  * The only boundary check done is that @p pos must be >= 1. Other than that,
9860  * no checks are performed, so passing an index value that's not within the
9861  * length of the string will result in undefined behavior.
9862  *
9863  * @param str The UTF-8 string
9864  * @param pos The byte index where to start
9865  * @param decoded Address where to store the decoded code point. Optional.
9866  *
9867  * @return The byte index of the previous character
9868  *
9869  * @ingroup Evas_Utils
9870  */
9871 EAPI int               evas_string_char_prev_get         (const char *str, int pos, int *decoded) EINA_ARG_NONNULL(1);
9872
9873 /**
9874  * Get the length in characters of the string.
9875  * @param  str The string to get the length of.
9876  * @return The length in characters (not bytes)
9877  * @ingroup Evas_Utils
9878  */
9879 EAPI int               evas_string_char_len_get          (const char *str) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
9880
9881 /**
9882  * @defgroup Evas_Keys Key Input Functions
9883  *
9884  * Functions which feed key events to the canvas.
9885  *
9886  * As explained in @ref intro_not_evas, Evas is @b not aware of input
9887  * systems at all. Then, the user, if using it crudely (evas_new()),
9888  * will have to feed it with input events, so that it can react
9889  * somehow. If, however, the user creates a canvas by means of the
9890  * Ecore_Evas wrapper, it will automatically bind the chosen display
9891  * engine's input events to the canvas, for you.
9892  *
9893  * This group presents the functions dealing with the feeding of key
9894  * events to the canvas. On most of them, one has to reference a given
9895  * key by a name (<code>keyname</code> argument). Those are
9896  * <b>platform dependent</b> symbolic names for the keys. Sometimes
9897  * you'll get the right <code>keyname</code> by simply using an ASCII
9898  * value of the key name, but it won't be like that always.
9899  *
9900  * Typical platforms are Linux frame buffer (Ecore_FB) and X server
9901  * (Ecore_X) when using Evas with Ecore and Ecore_Evas. Please refer
9902  * to your display engine's documentation when using evas through an
9903  * Ecore helper wrapper when you need the <code>keyname</code>s.
9904  *
9905  * Example:
9906  * @dontinclude evas-events.c
9907  * @skip mods = evas_key_modifier_get(evas);
9908  * @until {
9909  *
9910  * All the other @c evas_key functions behave on the same manner. See
9911  * the full @ref Example_Evas_Events "example".
9912  *
9913  * @ingroup Evas_Canvas
9914  */
9915
9916 /**
9917  * @addtogroup Evas_Keys
9918  * @{
9919  */
9920
9921 /**
9922  * Returns a handle to the list of modifier keys registered in the
9923  * canvas @p e. This is required to check for which modifiers are set
9924  * at a given time with the evas_key_modifier_is_set() function.
9925  *
9926  * @param e The pointer to the Evas canvas
9927  *
9928  * @see evas_key_modifier_add
9929  * @see evas_key_modifier_del
9930  * @see evas_key_modifier_on
9931  * @see evas_key_modifier_off
9932  * @see evas_key_modifier_is_set
9933  *
9934  * @return An ::Evas_Modifier handle to query Evas' keys subsystem
9935  *      with evas_key_modifier_is_set(), or @c NULL on error.
9936  */
9937 EAPI const Evas_Modifier *evas_key_modifier_get          (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
9938
9939 /**
9940  * Returns a handle to the list of lock keys registered in the canvas
9941  * @p e. This is required to check for which locks are set at a given
9942  * time with the evas_key_lock_is_set() function.
9943  *
9944  * @param e The pointer to the Evas canvas
9945  *
9946  * @see evas_key_lock_add
9947  * @see evas_key_lock_del
9948  * @see evas_key_lock_on
9949  * @see evas_key_lock_off
9950  * @see evas_key_lock_is_set
9951  *
9952  * @return An ::Evas_Lock handle to query Evas' keys subsystem with
9953  *      evas_key_lock_is_set(), or @c NULL on error.
9954  */
9955 EAPI const Evas_Lock     *evas_key_lock_get              (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
9956
9957
9958 /**
9959  * Checks the state of a given modifier key, at the time of the
9960  * call. If the modifier is set, such as shift being pressed, this
9961  * function returns @c Eina_True.
9962  *
9963  * @param m The current modifiers set, as returned by
9964  *        evas_key_modifier_get().
9965  * @param keyname The name of the modifier key to check status for.
9966  *
9967  * @return @c Eina_True if the modifier key named @p keyname is on, @c
9968  *         Eina_False otherwise.
9969  *
9970  * @see evas_key_modifier_add
9971  * @see evas_key_modifier_del
9972  * @see evas_key_modifier_get
9973  * @see evas_key_modifier_on
9974  * @see evas_key_modifier_off
9975  */
9976 EAPI Eina_Bool            evas_key_modifier_is_set       (const Evas_Modifier *m, const char *keyname) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2) EINA_PURE;
9977
9978
9979 /**
9980  * Checks the state of a given lock key, at the time of the call. If
9981  * the lock is set, such as caps lock, this function returns @c
9982  * Eina_True.
9983  *
9984  * @param l The current locks set, as returned by evas_key_lock_get().
9985  * @param keyname The name of the lock key to check status for.
9986  *
9987  * @return @c Eina_True if the @p keyname lock key is set, @c
9988  *        Eina_False otherwise.
9989  *
9990  * @see evas_key_lock_get
9991  * @see evas_key_lock_add
9992  * @see evas_key_lock_del
9993  * @see evas_key_lock_on
9994  * @see evas_key_lock_off
9995  */
9996 EAPI Eina_Bool            evas_key_lock_is_set           (const Evas_Lock *l, const char *keyname) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2) EINA_PURE;
9997
9998
9999 /**
10000  * Adds the @p keyname key to the current list of modifier keys.
10001  *
10002  * @param e The pointer to the Evas canvas
10003  * @param keyname The name of the modifier key to add to the list of
10004  *        Evas modifiers.
10005  *
10006  * Modifiers are keys like shift, alt and ctrl, i.e., keys which are
10007  * meant to be pressed together with others, altering the behavior of
10008  * the secondly pressed keys somehow. Evas is so that these keys can
10009  * be user defined.
10010  *
10011  * This call allows custom modifiers to be added to the Evas system at
10012  * run time. It is then possible to set and unset modifier keys
10013  * programmatically for other parts of the program to check and act
10014  * on. Programmers using Evas would check for modifier keys on key
10015  * event callbacks using evas_key_modifier_is_set().
10016  *
10017  * @see evas_key_modifier_del
10018  * @see evas_key_modifier_get
10019  * @see evas_key_modifier_on
10020  * @see evas_key_modifier_off
10021  * @see evas_key_modifier_is_set
10022  *
10023  * @note If the programmer instantiates the canvas by means of the
10024  *       ecore_evas_new() family of helper functions, Ecore will take
10025  *       care of registering on it all standard modifiers: "Shift",
10026  *       "Control", "Alt", "Meta", "Hyper", "Super".
10027  */
10028 EAPI void                 evas_key_modifier_add          (Evas *e, const char *keyname) EINA_ARG_NONNULL(1, 2);
10029
10030 /**
10031  * Removes the @p keyname key from the current list of modifier keys
10032  * on canvas @e.
10033  *
10034  * @param e The pointer to the Evas canvas
10035  * @param keyname The name of the key to remove from the modifiers list.
10036  *
10037  * @see evas_key_modifier_add
10038  * @see evas_key_modifier_get
10039  * @see evas_key_modifier_on
10040  * @see evas_key_modifier_off
10041  * @see evas_key_modifier_is_set
10042  */
10043 EAPI void                 evas_key_modifier_del          (Evas *e, const char *keyname) EINA_ARG_NONNULL(1, 2);
10044
10045 /**
10046  * Adds the @p keyname key to the current list of lock keys.
10047  *
10048  * @param e The pointer to the Evas canvas
10049  * @param keyname The name of the key to add to the locks list.
10050  *
10051  * Locks are keys like caps lock, num lock or scroll lock, i.e., keys
10052  * which are meant to be pressed once -- toggling a binary state which
10053  * is bound to it -- and thus altering the behavior of all
10054  * subsequently pressed keys somehow, depending on its state. Evas is
10055  * so that these keys can be defined by the user.
10056  *
10057  * This allows custom locks to be added to the evas system at run
10058  * time. It is then possible to set and unset lock keys
10059  * programmatically for other parts of the program to check and act
10060  * on. Programmers using Evas would check for lock keys on key event
10061  * callbacks using evas_key_lock_is_set().
10062  *
10063  * @see evas_key_lock_get
10064  * @see evas_key_lock_del
10065  * @see evas_key_lock_on
10066  * @see evas_key_lock_off
10067  * @see evas_key_lock_is_set
10068  *
10069  * @note If the programmer instantiates the canvas by means of the
10070  *       ecore_evas_new() family of helper functions, Ecore will take
10071  *       care of registering on it all standard lock keys: "Caps_Lock",
10072  *       "Num_Lock", "Scroll_Lock".
10073  */
10074 EAPI void                 evas_key_lock_add              (Evas *e, const char *keyname) EINA_ARG_NONNULL(1, 2);
10075
10076 /**
10077  * Removes the @p keyname key from the current list of lock keys on
10078  * canvas @e.
10079  *
10080  * @param e The pointer to the Evas canvas
10081  * @param keyname The name of the key to remove from the locks list.
10082  *
10083  * @see evas_key_lock_get
10084  * @see evas_key_lock_add
10085  * @see evas_key_lock_on
10086  * @see evas_key_lock_off
10087  */
10088 EAPI void                 evas_key_lock_del              (Evas *e, const char *keyname) EINA_ARG_NONNULL(1, 2);
10089
10090
10091 /**
10092  * Enables or turns on programmatically the modifier key with name @p
10093  * keyname.
10094  *
10095  * @param e The pointer to the Evas canvas
10096  * @param keyname The name of the modifier to enable.
10097  *
10098  * The effect will be as if the key was pressed for the whole time
10099  * between this call and a matching evas_key_modifier_off().
10100  *
10101  * @see evas_key_modifier_add
10102  * @see evas_key_modifier_get
10103  * @see evas_key_modifier_off
10104  * @see evas_key_modifier_is_set
10105  */
10106 EAPI void                 evas_key_modifier_on           (Evas *e, const char *keyname) EINA_ARG_NONNULL(1, 2);
10107
10108 /**
10109  * Disables or turns off programmatically the modifier key with name
10110  * @p keyname.
10111  *
10112  * @param e The pointer to the Evas canvas
10113  * @param keyname The name of the modifier to disable.
10114  *
10115  * @see evas_key_modifier_add
10116  * @see evas_key_modifier_get
10117  * @see evas_key_modifier_on
10118  * @see evas_key_modifier_is_set
10119  */
10120 EAPI void                 evas_key_modifier_off          (Evas *e, const char *keyname) EINA_ARG_NONNULL(1, 2);
10121
10122 /**
10123  * Enables or turns on programmatically the lock key with name @p
10124  * keyname.
10125  *
10126  * @param e The pointer to the Evas canvas
10127  * @param keyname The name of the lock to enable.
10128  *
10129  * The effect will be as if the key was put on its active state after
10130  * this call.
10131  *
10132  * @see evas_key_lock_get
10133  * @see evas_key_lock_add
10134  * @see evas_key_lock_del
10135  * @see evas_key_lock_off
10136  */
10137 EAPI void                 evas_key_lock_on               (Evas *e, const char *keyname) EINA_ARG_NONNULL(1, 2);
10138
10139 /**
10140  * Disables or turns off programmatically the lock key with name @p
10141  * keyname.
10142  *
10143  * @param e The pointer to the Evas canvas
10144  * @param keyname The name of the lock to disable.
10145  *
10146  * The effect will be as if the key was put on its inactive state
10147  * after this call.
10148  *
10149  * @see evas_key_lock_get
10150  * @see evas_key_lock_add
10151  * @see evas_key_lock_del
10152  * @see evas_key_lock_on
10153  */
10154 EAPI void                 evas_key_lock_off              (Evas *e, const char *keyname) EINA_ARG_NONNULL(1, 2);
10155
10156
10157 /**
10158  * Creates a bit mask from the @p keyname @b modifier key. Values
10159  * returned from different calls to it may be ORed together,
10160  * naturally.
10161  *
10162  * @param e The canvas whom to query the bit mask from.
10163  * @param keyname The name of the modifier key to create the mask for.
10164  *
10165  * @returns the bit mask or 0 if the @p keyname key wasn't registered as a
10166  *          modifier for canvas @p e.
10167  *
10168  * This function is meant to be using in conjunction with
10169  * evas_object_key_grab()/evas_object_key_ungrab(). Go check their
10170  * documentation for more information.
10171  *
10172  * @see evas_key_modifier_add
10173  * @see evas_key_modifier_get
10174  * @see evas_key_modifier_on
10175  * @see evas_key_modifier_off
10176  * @see evas_key_modifier_is_set
10177  * @see evas_object_key_grab
10178  * @see evas_object_key_ungrab
10179  */
10180 EAPI Evas_Modifier_Mask   evas_key_modifier_mask_get     (const Evas *e, const char *keyname) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2) EINA_PURE;
10181
10182
10183 /**
10184  * Requests @p keyname key events be directed to @p obj.
10185  *
10186  * @param obj the object to direct @p keyname events to.
10187  * @param keyname the key to request events for.
10188  * @param modifiers a mask of modifiers that must be present to
10189  * trigger the event.
10190  * @param not_modifiers a mask of modifiers that must @b not be present
10191  * to trigger the event.
10192  * @param exclusive request that the @p obj is the only object
10193  * receiving the @p keyname events.
10194  * @return @c EINA_TRUE, if the call succeeded, @c EINA_FALSE otherwise.
10195  *
10196  * Key grabs allow one or more objects to receive key events for
10197  * specific key strokes even if other objects have focus. Whenever a
10198  * key is grabbed, only the objects grabbing it will get the events
10199  * for the given keys.
10200  *
10201  * @p keyname is a platform dependent symbolic name for the key
10202  * pressed (see @ref Evas_Keys for more information).
10203  *
10204  * @p modifiers and @p not_modifiers are bit masks of all the
10205  * modifiers that must and mustn't, respectively, be pressed along
10206  * with @p keyname key in order to trigger this new key
10207  * grab. Modifiers can be things such as Shift and Ctrl as well as
10208  * user defigned types via evas_key_modifier_add(). Retrieve them with
10209  * evas_key_modifier_mask_get() or use @c 0 for empty masks.
10210  *
10211  * @p exclusive will make the given object the only one permitted to
10212  * grab the given key. If given @c EINA_TRUE, subsequent calls on this
10213  * function with different @p obj arguments will fail, unless the key
10214  * is ungrabbed again.
10215  *
10216  * Example code follows.
10217  * @dontinclude evas-events.c
10218  * @skip if (d.focus)
10219  * @until else
10220  *
10221  * See the full example @ref Example_Evas_Events "here".
10222  *
10223  * @see evas_object_key_ungrab
10224  * @see evas_object_focus_set
10225  * @see evas_object_focus_get
10226  * @see evas_focus_get
10227  * @see evas_key_modifier_add
10228  */
10229 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);
10230
10231 /**
10232  * Removes the grab on @p keyname key events by @p obj.
10233  *
10234  * @param obj the object that has an existing key grab.
10235  * @param keyname the key the grab is set for.
10236  * @param modifiers a mask of modifiers that must be present to
10237  * trigger the event.
10238  * @param not_modifiers a mask of modifiers that must not not be
10239  * present to trigger the event.
10240  *
10241  * Removes a key grab on @p obj if @p keyname, @p modifiers, and @p
10242  * not_modifiers match.
10243  *
10244  * Example code follows.
10245  * @dontinclude evas-events.c
10246  * @skip got here by key grabs
10247  * @until }
10248  *
10249  * See the full example @ref Example_Evas_Events "here".
10250  *
10251  * @see evas_object_key_grab
10252  * @see evas_object_focus_set
10253  * @see evas_object_focus_get
10254  * @see evas_focus_get
10255  */
10256 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);
10257
10258 /**
10259  * @}
10260  */
10261
10262 #ifdef __cplusplus
10263 }
10264 #endif
10265
10266 #endif