Evas grid/table: Add const to objects where needed.
[profile/ivi/evas.git] / src / lib / Evas.h
1 /**
2 @mainpage Evas
3
4 @version 1.1
5 @date 2000-2012
6
7 Please see the @ref authors page for contact details.
8 @link Evas.h Evas API @endlink
9
10 @link Evas.h Evas API @endlink
11
12 @section toc Table of Contents
13
14 @li @ref intro
15 @li @ref work
16 @li @ref compiling
17 @li @ref install
18 @li @ref next_steps
19 @li @ref intro_example
20
21
22 @section intro What is Evas?
23
24 Evas is a clean display canvas API for several target display systems
25 that can draw anti-aliased text, smooth super and sub-sampled scaled
26 images, alpha-blend objects and much more.
27
28 It abstracts any need to know much about what the characteristics of
29 your display system are or what graphics calls are used to draw them
30 and how. It deals on an object level where all you do is create and
31 manipulate objects in a canvas, set their properties, and the rest is
32 done for you.
33
34 Evas optimises the rendering pipeline to minimise effort in redrawing
35 changes made to the canvas and so takes this work out of the
36 programmers hand, saving a lot of time and energy.
37
38 It's small and lean, designed to work on embedded systems all the way
39 to large and powerful multi-cpu workstations. It can be compiled to
40 only have the features you need for your target platform if you so
41 wish, thus keeping it small and lean. It has several display
42 back-ends, letting it display on several display systems, making it
43 portable for cross-device and cross-platform development.
44
45 @subsection intro_not_evas What Evas is not?
46
47 Evas is not a widget set or widget toolkit, however it is their
48 base. See Elementary (http://docs.enlightenment.org/auto/elementary/)
49 for a toolkit based on Evas, Edje, Ecore and other Enlightenment
50 technologies.
51
52 It is not dependent or aware of main loops, input or output
53 systems. Input should be polled from various sources and fed to
54 Evas. Similarly, it will not create windows or report windows updates
55 to your system, rather just drawing the pixels and reporting to the
56 user the areas that were changed. Of course these operations are quite
57 common and thus they are ready to use in Ecore, particularly in
58 Ecore_Evas (http://docs.enlightenment.org/auto/ecore/).
59
60
61 @section work How does Evas work?
62
63 Evas is a canvas display library. This is markedly different from most
64 display and windowing systems as a canvas is structural and is also a
65 state engine, whereas most display and windowing systems are immediate
66 mode display targets. Evas handles the logic between a structural
67 display via its state engine, and controls the target windowing system
68 in order to produce rendered results of the current canvas' state on
69 the display.
70
71 Immediate mode display systems retain very little, or no state. A
72 program will execute a series of commands, as in the pseudo code:
73
74 @verbatim
75 draw line from position (0, 0) to position (100, 200);
76
77 draw rectangle from position (10, 30) to position (50, 500);
78
79 bitmap_handle = create_bitmap();
80 scale bitmap_handle to size 100 x 100;
81 draw image bitmap_handle at position (10, 30);
82 @endverbatim
83
84 The series of commands is executed by the windowing system and the
85 results are displayed on the screen (normally). Once the commands are
86 executed the display system has little or no idea of how to reproduce
87 this image again, and so has to be instructed by the application how
88 to redraw sections of the screen whenever needed. Each successive
89 command will be executed as instructed by the application and either
90 emulated by software or sent to the graphics hardware on the device to
91 be performed.
92
93 The advantage of such a system is that it is simple, and gives a
94 program tight control over how something looks and is drawn. Given the
95 increasing complexity of displays and demands by users to have better
96 looking interfaces, more and more work is needing to be done at this
97 level by the internals of widget sets, custom display widgets and
98 other programs. This means more and more logic and display rendering
99 code needs to be written time and time again, each time the
100 application needs to figure out how to minimise redraws so that
101 display is fast and interactive, and keep track of redraw logic. The
102 power comes at a high-price, lots of extra code and work.  Programmers
103 not very familiar with graphics programming will often make mistakes
104 at this level and produce code that is sub optimal. Those familiar
105 with this kind of programming will simply get bored by writing the
106 same code again and again.
107
108 For example, if in the above scene, the windowing system requires the
109 application to redraw the area from 0, 0 to 50, 50 (also referred as
110 "expose event"), then the programmer must calculate manually the
111 updates and repaint it again:
112
113 @verbatim
114 Redraw from position (0, 0) to position (50, 50):
115
116 // what was in area (0, 0, 50, 50)?
117
118 // 1. intersection part of line (0, 0) to (100, 200)?
119       draw line from position (0, 0) to position (25, 50);
120
121 // 2. intersection part of rectangle (10, 30) to (50, 500)?
122       draw rectangle from position (10, 30) to position (50, 50)
123
124 // 3. intersection part of image at (10, 30), size 100 x 100?
125       bitmap_subimage = subregion from position (0, 0) to position (40, 20)
126       draw image bitmap_subimage at position (10, 30);
127 @endverbatim
128
129 The clever reader might have noticed that, if all elements in the
130 above scene are opaque, then the system is doing useless paints: part
131 of the line is behind the rectangle, and part of the rectangle is
132 behind the image. These useless paints tend to be very costly, as
133 pixels tend to be 4 bytes in size, thus an overlapping region of 100 x
134 100 pixels is around 40000 useless writes! The developer could write
135 code to calculate the overlapping areas and avoid painting then, but
136 then it should be mixed with the "expose event" handling mentioned
137 above and quickly one realizes the initially simpler method became
138 really complex.
139
140 Evas is a structural system in which the programmer creates and
141 manages display objects and their properties, and as a result of this
142 higher level state management, the canvas is able to redraw the set of
143 objects when needed to represent the current state of the canvas.
144
145 For example, the pseudo code:
146
147 @verbatim
148 line_handle = create_line();
149 set line_handle from position (0, 0) to position (100, 200);
150 show line_handle;
151
152 rectangle_handle = create_rectangle();
153 move rectangle_handle to position (10, 30);
154 resize rectangle_handle to size 40 x 470;
155 show rectangle_handle;
156
157 bitmap_handle = create_bitmap();
158 scale bitmap_handle to size 100 x 100;
159 move bitmap_handle to position (10, 30);
160 show bitmap_handle;
161
162 render scene;
163 @endverbatim
164
165 This may look longer, but when the display needs to be refreshed or
166 updated, the programmer only moves, resizes, shows, hides etc. the
167 objects that need to change. The programmer simply thinks at the
168 object logic level, and the canvas software does the rest of the work
169 for them, figuring out what actually changed in the canvas since it
170 was last drawn, how to most efficiently redraw the canvas and its
171 contents to reflect the current state, and then it can go off and do
172 the actual drawing of the canvas.
173
174 This lets the programmer think in a more natural way when dealing with
175 a display, and saves time and effort of working out how to load and
176 display images, render given the current display system etc. Since
177 Evas also is portable across different display systems, this also
178 gives the programmer the ability to have their code ported and
179 displayed on different display systems with very little work.
180
181 Evas can be seen as a display system that stands somewhere between a
182 widget set and an immediate mode display system. It retains basic
183 display logic, but does very little high-level logic such as
184 scrollbars, sliders, push buttons etc.
185
186
187 @section compiling How to compile using Evas ?
188
189 Evas is a library your application links to. The procedure for this is
190 very simple. You simply have to compile your application with the
191 appropriate compiler flags that the @c pkg-config script outputs. For
192 example:
193
194 Compiling C or C++ files into object files:
195
196 @verbatim
197 gcc -c -o main.o main.c `pkg-config --cflags evas`
198 @endverbatim
199
200 Linking object files into a binary executable:
201
202 @verbatim
203 gcc -o my_application main.o `pkg-config --libs evas`
204 @endverbatim
205
206 You simply have to make sure that @c pkg-config is in your shell's @c
207 PATH (see the manual page for your appropriate shell) and @c evas.pc
208 in @c /usr/lib/pkgconfig or its path in the @c PKG_CONFIG_PATH
209 environment variable. It's that simple to link and use Evas once you
210 have written your code to use it.
211
212 Since the program is linked to Evas, it is now able to use any
213 advertised API calls to display graphics in a canvas managed by it, as
214 well as use the API calls provided to manage data.
215
216 You should make sure you add any extra compile and link flags to your
217 compile commands that your application may need as well. The above
218 example is only guaranteed to make Evas add it's own requirements.
219
220
221 @section install How is it installed?
222
223 Simple:
224
225 @verbatim
226 ./configure
227 make
228 su -
229 ...
230 make install
231 @endverbatim
232
233 @section next_steps Next Steps
234
235 After you understood what Evas is and installed it in your system you
236 should proceed understanding the programming interface for all
237 objects, then see the specific for the most used elements. We'd
238 recommend you to take a while to learn Ecore
239 (http://docs.enlightenment.org/auto/ecore/) and Edje
240 (http://docs.enlightenment.org/auto/edje/) as they will likely save
241 you tons of work compared to using just Evas directly.
242
243 Recommended reading:
244
245 @li @ref Evas_Object_Group, where you'll get how to basically
246     manipulate generic objects lying on an Evas canvas, handle canvas
247     and object events, etc.
248 @li @ref Evas_Object_Rectangle, to learn about the most basic object
249     type on Evas -- the rectangle.
250 @li @ref Evas_Object_Polygon, to learn how to create polygon elements
251     on the canvas.
252 @li @ref Evas_Line_Group, to learn how to create line elements on the
253     canvas.
254 @li @ref Evas_Object_Image, to learn about image objects, over which
255     Evas can do a plethora of operations.
256 @li @ref Evas_Object_Text, to learn how to create textual elements on
257     the canvas.
258 @li @ref Evas_Object_Textblock, to learn how to create multiline
259     textual elements on the canvas.
260 @li @ref Evas_Smart_Object_Group and @ref Evas_Smart_Group, to define
261     new objects that provide @b custom functions to handle clipping,
262     hiding, moving, resizing, color setting and more. These could
263     be as simple as a group of objects that move together (see @ref
264     Evas_Smart_Object_Clipped) up to implementations of what
265     ends to be a widget, providing some intelligence (thus the name)
266     to Evas objects -- like a button or check box, for example.
267
268 @section intro_example Introductory Example
269
270 @include evas-buffer-simple.c
271 */
272
273 /**
274 @page authors Authors
275 @author Carsten Haitzler <raster@@rasterman.com>
276 @author Till Adam <till@@adam-lilienthal.de>
277 @author Steve Ireland <sireland@@pobox.com>
278 @author Brett Nash <nash@@nash.id.au>
279 @author Tilman Sauerbeck <tilman@@code-monkey.de>
280 @author Corey Donohoe <atmos@@atmos.org>
281 @author Yuri Hudobin <glassy_ape@@users.sourceforge.net>
282 @author Nathan Ingersoll <ningerso@@d.umn.edu>
283 @author Willem Monsuwe <willem@@stack.nl>
284 @author Jose O Gonzalez <jose_ogp@@juno.com>
285 @author Bernhard Nemec <Bernhard.Nemec@@viasyshc.com>
286 @author Jorge Luis Zapata Muga <jorgeluis.zapata@@gmail.com>
287 @author Cedric Bail <cedric.bail@@free.fr>
288 @author Gustavo Sverzut Barbieri <barbieri@@profusion.mobi>
289 @author Vincent Torri <vtorri@@univ-evry.fr>
290 @author Tim Horton <hortont424@@gmail.com>
291 @author Tom Hacohen <tom@@stosb.com>
292 @author Mathieu Taillefumier <mathieu.taillefumier@@free.fr>
293 @author Iván Briano <ivan@@profusion.mobi>
294 @author Gustavo Lima Chaves <glima@@profusion.mobi>
295 @author Samsung Electronics
296 @author Samsung SAIT
297 @author Sung W. Park <sungwoo@@gmail.com>
298 @author Jiyoun Park <jy0703.park@@samsung.com>
299 @author Myoungwoon Roy Kim(roy_kim) <myoungwoon.kim@@samsung.com> <myoungwoon@@gmail.com>
300 @author Thierry el Borgi <thierry@@substantiel.fr>
301 @author Shilpa Singh <shilpa.singh@@samsung.com> <shilpasingh.o@@gmail.com>
302 @author ChunEon Park <hermet@@hermet.pe.kr>
303 @author Christopher 'devilhorns' Michael <cpmichael1@@comcast.net>
304 @author Seungsoo Woo <om101.woo@@samsung.com>
305 @author Youness Alaoui <kakaroto@@kakaroto.homelinux.net>
306 @author Jim Kukunas <james.t.kukunas@@linux.intel.com>
307 @author Nicolas Aguirre <aguirre.nicolas@@gmail.com>
308 @author Rafal Krypa <r.krypa@@samsung.com>
309 @author Hyoyoung Chang <hyoyoung@@gmail.com>
310 @author Jérôme Pinot <ngc891@@gmail.com>
311
312 Please contact <enlightenment-devel@lists.sourceforge.net> to get in
313 contact with the developers and maintainers.
314 */
315
316 #ifndef _EVAS_H
317 #define _EVAS_H
318
319 #include <time.h>
320
321 #include <Eina.h>
322
323 #ifdef EAPI
324 # undef EAPI
325 #endif
326
327 #ifdef _WIN32
328 # ifdef EFL_EVAS_BUILD
329 #  ifdef DLL_EXPORT
330 #   define EAPI __declspec(dllexport)
331 #  else
332 #   define EAPI
333 #  endif /* ! DLL_EXPORT */
334 # else
335 #  define EAPI __declspec(dllimport)
336 # endif /* ! EFL_EVAS_BUILD */
337 #else
338 # ifdef __GNUC__
339 #  if __GNUC__ >= 4
340 #   define EAPI __attribute__ ((visibility("default")))
341 #  else
342 #   define EAPI
343 #  endif
344 # else
345 #  define EAPI
346 # endif
347 #endif /* ! _WIN32 */
348
349 #ifdef __cplusplus
350 extern "C" {
351 #endif
352
353 #define EVAS_VERSION_MAJOR 1
354 #define EVAS_VERSION_MINOR 2
355
356 typedef struct _Evas_Version
357 {
358    int major;
359    int minor;
360    int micro;
361    int revision;
362 } Evas_Version;
363
364 EAPI extern Evas_Version *evas_version;
365
366 /**
367  * @file
368  * @brief These routines are used for Evas library interaction.
369  *
370  * @todo check boolean return values and convert to Eina_Bool
371  * @todo change all api to use EINA_SAFETY_*
372  * @todo finish api documentation
373  */
374
375 /* BiDi exposed stuff */
376    /*FIXME: document */
377 typedef enum _Evas_BiDi_Direction
378 {
379    EVAS_BIDI_DIRECTION_NATURAL,
380    EVAS_BIDI_DIRECTION_NEUTRAL = EVAS_BIDI_DIRECTION_NATURAL,
381    EVAS_BIDI_DIRECTION_LTR,
382    EVAS_BIDI_DIRECTION_RTL
383 } Evas_BiDi_Direction;
384
385 /**
386  * Identifier of callbacks to be set for Evas canvases or Evas
387  * objects.
388  *
389  * The following figure illustrates some Evas callbacks:
390  *
391  * @image html evas-callbacks.png
392  * @image rtf evas-callbacks.png
393  * @image latex evas-callbacks.eps
394  *
395  * @see evas_object_event_callback_add()
396  * @see evas_event_callback_add()
397  */
398 typedef enum _Evas_Callback_Type
399 {
400    /*
401     * The following events are only for use with Evas objects, with
402     * evas_object_event_callback_add():
403     */
404    EVAS_CALLBACK_MOUSE_IN, /**< Mouse In Event */
405    EVAS_CALLBACK_MOUSE_OUT, /**< Mouse Out Event */
406    EVAS_CALLBACK_MOUSE_DOWN, /**< Mouse Button Down Event */
407    EVAS_CALLBACK_MOUSE_UP, /**< Mouse Button Up Event */
408    EVAS_CALLBACK_MOUSE_MOVE, /**< Mouse Move Event */
409    EVAS_CALLBACK_MOUSE_WHEEL, /**< Mouse Wheel Event */
410    EVAS_CALLBACK_MULTI_DOWN, /**< Multi-touch Down Event */
411    EVAS_CALLBACK_MULTI_UP, /**< Multi-touch Up Event */
412    EVAS_CALLBACK_MULTI_MOVE, /**< Multi-touch Move Event */
413    EVAS_CALLBACK_FREE, /**< Object Being Freed (Called after Del) */
414    EVAS_CALLBACK_KEY_DOWN, /**< Key Press Event */
415    EVAS_CALLBACK_KEY_UP, /**< Key Release Event */
416    EVAS_CALLBACK_FOCUS_IN, /**< Focus In Event */
417    EVAS_CALLBACK_FOCUS_OUT, /**< Focus Out Event */
418    EVAS_CALLBACK_SHOW, /**< Show Event */
419    EVAS_CALLBACK_HIDE, /**< Hide Event */
420    EVAS_CALLBACK_MOVE, /**< Move Event */
421    EVAS_CALLBACK_RESIZE, /**< Resize Event */
422    EVAS_CALLBACK_RESTACK, /**< Restack Event */
423    EVAS_CALLBACK_DEL, /**< Object Being Deleted (called before Free) */
424    EVAS_CALLBACK_HOLD, /**< Events go on/off hold */
425    EVAS_CALLBACK_CHANGED_SIZE_HINTS, /**< Size hints changed event */
426    EVAS_CALLBACK_IMAGE_PRELOADED, /**< Image has been preloaded */
427
428    /*
429     * The following events are only for use with Evas canvases, with
430     * evas_event_callback_add():
431     */
432    EVAS_CALLBACK_CANVAS_FOCUS_IN, /**< Canvas got focus as a whole */
433    EVAS_CALLBACK_CANVAS_FOCUS_OUT, /**< Canvas lost focus as a whole */
434    EVAS_CALLBACK_RENDER_FLUSH_PRE, /**< Called just before rendering is updated on the canvas target */
435    EVAS_CALLBACK_RENDER_FLUSH_POST, /**< Called just after rendering is updated on the canvas target */
436    EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_IN, /**< Canvas object got focus */
437    EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_OUT, /**< Canvas object lost focus */
438
439    /*
440     * More Evas object event types - see evas_object_event_callback_add():
441     */
442    EVAS_CALLBACK_IMAGE_UNLOADED, /**< Image data has been unloaded (by some mechanism in Evas that throw out original image data) */
443
444    EVAS_CALLBACK_RENDER_PRE, /**< Called just before rendering starts on the canvas target @since 1.2 */
445    EVAS_CALLBACK_RENDER_POST, /**< Called just after rendering stops on the canvas target @since 1.2 */
446      
447    EVAS_CALLBACK_LAST /**< kept as last element/sentinel -- not really an event */
448 } Evas_Callback_Type; /**< The types of events triggering a callback */
449
450 /**
451  * @def EVAS_CALLBACK_PRIORITY_BEFORE
452  * Slightly more prioritized than default.
453  * @since 1.1.0
454  */
455 #define EVAS_CALLBACK_PRIORITY_BEFORE -100
456 /**
457  * @def EVAS_CALLBACK_PRIORITY_DEFAULT
458  * Default callback priority level
459  * @since 1.1.0
460  */
461 #define EVAS_CALLBACK_PRIORITY_DEFAULT 0
462 /**
463  * @def EVAS_CALLBACK_PRIORITY_AFTER
464  * Slightly less prioritized than default.
465  * @since 1.1.0
466  */
467 #define EVAS_CALLBACK_PRIORITY_AFTER 100
468
469 /**
470  * @typedef Evas_Callback_Priority
471  *
472  * Callback priority value. Range is -32k - 32k. The lower the number, the
473  * bigger the priority.
474  *
475  * @see EVAS_CALLBACK_PRIORITY_AFTER
476  * @see EVAS_CALLBACK_PRIORITY_BEFORE
477  * @see EVAS_CALLBACK_PRIORITY_DEFAULT
478  *
479  * @since 1.1.0
480  */
481 typedef short Evas_Callback_Priority;
482
483 /**
484  * Flags for Mouse Button events
485  */
486 typedef enum _Evas_Button_Flags
487 {
488    EVAS_BUTTON_NONE = 0, /**< No extra mouse button data */
489    EVAS_BUTTON_DOUBLE_CLICK = (1 << 0), /**< This mouse button press was the 2nd press of a double click */
490    EVAS_BUTTON_TRIPLE_CLICK = (1 << 1) /**< This mouse button press was the 3rd press of a triple click */
491 } Evas_Button_Flags; /**< Flags for Mouse Button events */
492
493 /**
494  * Flags for Events
495  */
496 typedef enum _Evas_Event_Flags
497 {
498    EVAS_EVENT_FLAG_NONE = 0, /**< No fancy flags set */
499    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 */
500    EVAS_EVENT_FLAG_ON_SCROLL = (1 << 1) /**< This event flag indicates the event occurs while scrolling; for example, DOWN event occurs during scrolling; the event should be used for informational purposes and maybe some indications visually, but not actually perform anything */
501 } Evas_Event_Flags; /**< Flags for Events */
502
503 /**
504  * State of Evas_Coord_Touch_Point
505  */
506 typedef enum _Evas_Touch_Point_State
507 {
508    EVAS_TOUCH_POINT_DOWN, /**< Touch point is pressed down */
509    EVAS_TOUCH_POINT_UP, /**< Touch point is released */
510    EVAS_TOUCH_POINT_MOVE, /**< Touch point is moved */
511    EVAS_TOUCH_POINT_STILL, /**< Touch point is not moved after pressed */
512    EVAS_TOUCH_POINT_CANCEL /**< Touch point is cancelled */
513 } Evas_Touch_Point_State;
514
515 /**
516  * Flags for Font Hinting
517  * @ingroup Evas_Font_Group
518  */
519 typedef enum _Evas_Font_Hinting_Flags
520 {
521    EVAS_FONT_HINTING_NONE, /**< No font hinting */
522    EVAS_FONT_HINTING_AUTO, /**< Automatic font hinting */
523    EVAS_FONT_HINTING_BYTECODE /**< Bytecode font hinting */
524 } Evas_Font_Hinting_Flags; /**< Flags for Font Hinting */
525
526 /**
527  * Colorspaces for pixel data supported by Evas
528  * @ingroup Evas_Object_Image
529  */
530 typedef enum _Evas_Colorspace
531 {
532    EVAS_COLORSPACE_ARGB8888, /**< ARGB 32 bits per pixel, high-byte is Alpha, accessed 1 32bit word at a time */
533      /* these are not currently supported - but planned for the future */
534    EVAS_COLORSPACE_YCBCR422P601_PL, /**< YCbCr 4:2:2 Planar, ITU.BT-601 specifications. The data pointed to is just an array of row pointer, pointing to the Y rows, then the Cb, then Cr rows */
535    EVAS_COLORSPACE_YCBCR422P709_PL,/**< YCbCr 4:2:2 Planar, ITU.BT-709 specifications. The data pointed to is just an array of row pointer, pointing to the Y rows, then the Cb, then Cr rows */
536    EVAS_COLORSPACE_RGB565_A5P, /**< 16bit rgb565 + Alpha plane at end - 5 bits of the 8 being used per alpha byte */
537    EVAS_COLORSPACE_GRY8, /**< 8bit grayscale */
538    EVAS_COLORSPACE_YCBCR422601_PL, /**<  YCbCr 4:2:2, ITU.BT-601 specifications. The data pointed to is just an array of row pointer, pointing to line of Y,Cb,Y,Cr bytes */
539    EVAS_COLORSPACE_YCBCR420NV12601_PL, /**< YCbCr 4:2:0, ITU.BT-601 specification. The data pointed to is just an array of row pointer, pointing to the Y rows, then the Cb,Cr rows. */
540    EVAS_COLORSPACE_YCBCR420TM12601_PL, /**< YCbCr 4:2:0, ITU.BT-601 specification. The data pointed to is just an array of tiled row pointer, pointing to the Y rows, then the Cb,Cr rows. */
541 } Evas_Colorspace; /**< Colorspaces for pixel data supported by Evas */
542
543 /**
544  * How to pack items into cells in a table.
545  * @ingroup Evas_Object_Table
546  *
547  * @see evas_object_table_homogeneous_set() for an explanation of the function of
548  * each one.
549  */
550 typedef enum _Evas_Object_Table_Homogeneous_Mode
551 {
552   EVAS_OBJECT_TABLE_HOMOGENEOUS_NONE = 0,
553   EVAS_OBJECT_TABLE_HOMOGENEOUS_TABLE = 1,
554   EVAS_OBJECT_TABLE_HOMOGENEOUS_ITEM = 2
555 } Evas_Object_Table_Homogeneous_Mode; /**< Table cell pack mode. */
556
557 typedef struct _Evas_Coord_Rectangle  Evas_Coord_Rectangle; /**< A generic rectangle handle */
558 typedef struct _Evas_Point                   Evas_Point; /**< integer point */
559
560 typedef struct _Evas_Coord_Point             Evas_Coord_Point;  /**< Evas_Coord point */
561 typedef struct _Evas_Coord_Precision_Point   Evas_Coord_Precision_Point; /**< Evas_Coord point with sub-pixel precision */
562
563 typedef struct _Evas_Position                Evas_Position; /**< associates given point in Canvas and Output */
564 typedef struct _Evas_Precision_Position      Evas_Precision_Position; /**< associates given point in Canvas and Output, with sub-pixel precision */
565
566 /**
567  * @typedef Evas_Smart_Class
568  *
569  * A smart object's @b base class definition
570  *
571  * @ingroup Evas_Smart_Group
572  */
573 typedef struct _Evas_Smart_Class             Evas_Smart_Class;
574
575 /**
576  * @typedef Evas_Smart_Cb_Description
577  *
578  * A smart object callback description, used to provide introspection
579  *
580  * @ingroup Evas_Smart_Group
581  */
582 typedef struct _Evas_Smart_Cb_Description    Evas_Smart_Cb_Description;
583
584 /**
585  * @typedef Evas_Map
586  *
587  * An opaque handle to map points
588  *
589  * @see evas_map_new()
590  * @see evas_map_free()
591  * @see evas_map_dup()
592  *
593  * @ingroup Evas_Object_Group_Map
594  */
595 typedef struct _Evas_Map            Evas_Map;
596
597 /**
598  * @typedef Evas
599  *
600  * An opaque handle to an Evas canvas.
601  *
602  * @see evas_new()
603  * @see evas_free()
604  *
605  * @ingroup Evas_Canvas
606  */
607 typedef struct _Evas                Evas;
608
609 /**
610  * @typedef Evas_Object
611  * An Evas Object handle.
612  * @ingroup Evas_Object_Group
613  */
614 typedef struct _Evas_Object         Evas_Object;
615
616 typedef void                        Evas_Performance; /**< An Evas Performance handle */
617 typedef struct _Evas_Modifier       Evas_Modifier; /**< An opaque type containing information on which modifier keys are registered in an Evas canvas */
618 typedef struct _Evas_Lock           Evas_Lock; /**< An opaque type containing information on which lock keys are registered in an Evas canvas */
619 typedef struct _Evas_Smart          Evas_Smart; /**< An Evas Smart Object handle */
620 typedef struct _Evas_Native_Surface Evas_Native_Surface; /**< A generic datatype for engine specific native surface information */
621
622  /**
623   * @typedef Evas_Video_Surface
624   *
625   * A generic datatype for video specific surface information
626   * @see evas_object_image_video_surface_set
627   * @see evas_object_image_video_surface_get
628   * @since 1.1.0
629   */
630 typedef struct _Evas_Video_Surface  Evas_Video_Surface;
631
632 typedef unsigned long long          Evas_Modifier_Mask; /**< An Evas modifier mask type */
633
634 typedef int                         Evas_Coord;
635 typedef int                         Evas_Font_Size;
636 typedef int                         Evas_Angle;
637
638 struct _Evas_Coord_Rectangle /**< A rectangle in Evas_Coord */
639 {
640    Evas_Coord x; /**< top-left x co-ordinate of rectangle */
641    Evas_Coord y; /**< top-left y co-ordinate of rectangle */
642    Evas_Coord w; /**< width of rectangle */
643    Evas_Coord h; /**< height of rectangle */
644 };
645
646 struct _Evas_Point
647 {
648    int x, y;
649 };
650
651 struct _Evas_Coord_Point
652 {
653    Evas_Coord x, y;
654 };
655
656 struct _Evas_Coord_Precision_Point
657 {
658    Evas_Coord x, y;
659    double xsub, ysub;
660 };
661
662 struct _Evas_Position
663 {
664     Evas_Point output;
665     Evas_Coord_Point canvas;
666 };
667
668 struct _Evas_Precision_Position
669 {
670     Evas_Point output;
671     Evas_Coord_Precision_Point canvas;
672 };
673
674 typedef enum _Evas_Aspect_Control
675 {
676    EVAS_ASPECT_CONTROL_NONE = 0, /**< Preference on scaling unset */
677    EVAS_ASPECT_CONTROL_NEITHER = 1, /**< Same effect as unset preference on scaling */
678    EVAS_ASPECT_CONTROL_HORIZONTAL = 2, /**< Use all horizontal container space to place an object, using the given aspect */
679    EVAS_ASPECT_CONTROL_VERTICAL = 3, /**< Use all vertical container space to place an object, using the given aspect */
680    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 */
681 } Evas_Aspect_Control; /**< Aspect types/policies for scaling size hints, used for evas_object_size_hint_aspect_set() */
682
683 typedef struct _Evas_Pixel_Import_Source Evas_Pixel_Import_Source; /**< A source description of pixels for importing pixels */
684 typedef struct _Evas_Engine_Info      Evas_Engine_Info; /**< A generic Evas Engine information structure */
685 typedef struct _Evas_Device           Evas_Device; /**< A source device handle - where the event came from */
686 typedef struct _Evas_Event_Mouse_Down Evas_Event_Mouse_Down; /**< Event structure for #EVAS_CALLBACK_MOUSE_DOWN event callbacks */
687 typedef struct _Evas_Event_Mouse_Up   Evas_Event_Mouse_Up; /**< Event structure for #EVAS_CALLBACK_MOUSE_UP event callbacks */
688 typedef struct _Evas_Event_Mouse_In   Evas_Event_Mouse_In; /**< Event structure for #EVAS_CALLBACK_MOUSE_IN event callbacks */
689 typedef struct _Evas_Event_Mouse_Out  Evas_Event_Mouse_Out; /**< Event structure for #EVAS_CALLBACK_MOUSE_OUT event callbacks */
690 typedef struct _Evas_Event_Mouse_Move Evas_Event_Mouse_Move; /**< Event structure for #EVAS_CALLBACK_MOUSE_MOVE event callbacks */
691 typedef struct _Evas_Event_Mouse_Wheel Evas_Event_Mouse_Wheel; /**< Event structure for #EVAS_CALLBACK_MOUSE_WHEEL event callbacks */
692 typedef struct _Evas_Event_Multi_Down Evas_Event_Multi_Down; /**< Event structure for #EVAS_CALLBACK_MULTI_DOWN event callbacks */
693 typedef struct _Evas_Event_Multi_Up   Evas_Event_Multi_Up; /**< Event structure for #EVAS_CALLBACK_MULTI_UP event callbacks */
694 typedef struct _Evas_Event_Multi_Move Evas_Event_Multi_Move; /**< Event structure for #EVAS_CALLBACK_MULTI_MOVE event callbacks */
695 typedef struct _Evas_Event_Key_Down   Evas_Event_Key_Down; /**< Event structure for #EVAS_CALLBACK_KEY_DOWN event callbacks */
696 typedef struct _Evas_Event_Key_Up     Evas_Event_Key_Up; /**< Event structure for #EVAS_CALLBACK_KEY_UP event callbacks */
697 typedef struct _Evas_Event_Hold       Evas_Event_Hold; /**< Event structure for #EVAS_CALLBACK_HOLD event callbacks */
698
699 typedef enum _Evas_Load_Error
700 {
701    EVAS_LOAD_ERROR_NONE = 0, /**< No error on load */
702    EVAS_LOAD_ERROR_GENERIC = 1, /**< A non-specific error occurred */
703    EVAS_LOAD_ERROR_DOES_NOT_EXIST = 2, /**< File (or file path) does not exist */
704    EVAS_LOAD_ERROR_PERMISSION_DENIED = 3, /**< Permission denied to an existing file (or path) */
705    EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED = 4, /**< Allocation of resources failure prevented load */
706    EVAS_LOAD_ERROR_CORRUPT_FILE = 5, /**< File corrupt (but was detected as a known format) */
707    EVAS_LOAD_ERROR_UNKNOWN_FORMAT = 6 /**< File is not a known format */
708 } Evas_Load_Error; /**< Evas image load error codes one can get - see evas_load_error_str() too. */
709
710
711 typedef enum _Evas_Alloc_Error
712 {
713    EVAS_ALLOC_ERROR_NONE = 0, /**< No allocation error */
714    EVAS_ALLOC_ERROR_FATAL = 1, /**< Allocation failed despite attempts to free up memory */
715    EVAS_ALLOC_ERROR_RECOVERED = 2 /**< Allocation succeeded, but extra memory had to be found by freeing up speculative resources */
716 } Evas_Alloc_Error; /**< Possible allocation errors returned by evas_alloc_error() */
717
718 typedef enum _Evas_Fill_Spread
719 {
720    EVAS_TEXTURE_REFLECT = 0, /**< image fill tiling mode - tiling reflects */
721    EVAS_TEXTURE_REPEAT = 1, /**< tiling repeats */
722    EVAS_TEXTURE_RESTRICT = 2, /**< tiling clamps - range offset ignored */
723    EVAS_TEXTURE_RESTRICT_REFLECT = 3, /**< tiling clamps and any range offset reflects */
724    EVAS_TEXTURE_RESTRICT_REPEAT = 4, /**< tiling clamps and any range offset repeats */
725    EVAS_TEXTURE_PAD = 5 /**< tiling extends with end values */
726 } Evas_Fill_Spread; /**< Fill types used for evas_object_image_fill_spread_set() */
727
728 typedef enum _Evas_Pixel_Import_Pixel_Format
729 {
730    EVAS_PIXEL_FORMAT_NONE = 0, /**< No pixel format */
731    EVAS_PIXEL_FORMAT_ARGB32 = 1, /**< ARGB 32bit pixel format with A in the high byte per 32bit pixel word */
732    EVAS_PIXEL_FORMAT_YUV420P_601 = 2 /**< YUV 420 Planar format with CCIR 601 color encoding with contiguous planes in the order Y, U and V */
733 } Evas_Pixel_Import_Pixel_Format; /**< Pixel format for import call. See evas_object_image_pixels_import() */
734
735 struct _Evas_Pixel_Import_Source
736 {
737    Evas_Pixel_Import_Pixel_Format format; /**< pixel format type ie ARGB32, YUV420P_601 etc. */
738    int w, h; /**< width and height of source in pixels */
739    void **rows; /**< an array of pointers (size depends on format) pointing to left edge of each scanline */
740 };
741
742 /* magic version number to know what the native surf struct looks like */
743 #define EVAS_NATIVE_SURFACE_VERSION 2
744
745 typedef enum _Evas_Native_Surface_Type
746 {
747    EVAS_NATIVE_SURFACE_NONE,
748    EVAS_NATIVE_SURFACE_X11,
749    EVAS_NATIVE_SURFACE_OPENGL
750 } Evas_Native_Surface_Type;
751
752 struct _Evas_Native_Surface
753 {
754    int                         version;
755    Evas_Native_Surface_Type    type;
756    union {
757      struct {
758        void          *visual; /**< visual of the pixmap to use (Visual) */
759        unsigned long  pixmap; /**< pixmap id to use (Pixmap) */
760      } x11;
761      struct {
762        unsigned int   texture_id; /**< opengl texture id to use from glGenTextures() */
763        unsigned int   framebuffer_id; /**< 0 if not a FBO, FBO id otherwise from glGenFramebuffers() */
764        unsigned int   internal_format; /**< same as 'internalFormat' for glTexImage2D() */
765        unsigned int   format; /**< same as 'format' for glTexImage2D() */
766        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) */
767      } opengl;
768    } data;
769 };
770
771 /**
772  * @def EVAS_VIDEO_SURFACE_VERSION
773  * Magic version number to know what the video surf struct looks like
774  * @since 1.1.0
775  */
776 #define EVAS_VIDEO_SURFACE_VERSION 1
777
778 typedef void (*Evas_Video_Cb)(void *data, Evas_Object *obj, const Evas_Video_Surface *surface);
779 typedef void (*Evas_Video_Coord_Cb)(void *data, Evas_Object *obj, const Evas_Video_Surface *surface, Evas_Coord a, Evas_Coord b);
780
781 struct _Evas_Video_Surface
782 {
783    int version;
784
785    Evas_Video_Coord_Cb move; /**< Move the video surface to this position */
786    Evas_Video_Coord_Cb resize; /**< Resize the video surface to that size */
787    Evas_Video_Cb show; /**< Show the video overlay surface */
788    Evas_Video_Cb hide; /**< Hide the video overlay surface */
789    Evas_Video_Cb update_pixels; /**< Please update the Evas_Object_Image pixels when called */
790
791    Evas_Object   *parent;
792    void          *data;
793 };
794
795 #define EVAS_LAYER_MIN -32768 /**< bottom-most layer number */
796 #define EVAS_LAYER_MAX 32767  /**< top-most layer number */
797
798 #define EVAS_COLOR_SPACE_ARGB 0 /**< Not used for anything */
799 #define EVAS_COLOR_SPACE_AHSV 1 /**< Not used for anything */
800 #define EVAS_TEXT_INVALID -1 /**< Not used for anything */
801 #define EVAS_TEXT_SPECIAL -2 /**< Not used for anything */
802
803 #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() */
804 #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() */
805 #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) */
806 #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) */
807 #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 */
808 #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 */
809
810 /**
811  * How the object should be rendered to output.
812  * @ingroup Evas_Object_Group_Extras
813  */
814 typedef enum _Evas_Render_Op
815 {
816    EVAS_RENDER_BLEND = 0, /**< default op: d = d*(1-sa) + s */
817    EVAS_RENDER_BLEND_REL = 1, /**< d = d*(1 - sa) + s*da */
818    EVAS_RENDER_COPY = 2, /**< d = s */
819    EVAS_RENDER_COPY_REL = 3, /**< d = s*da */
820    EVAS_RENDER_ADD = 4, /* d = d + s */
821    EVAS_RENDER_ADD_REL = 5, /**< d = d + s*da */
822    EVAS_RENDER_SUB = 6, /**< d = d - s */
823    EVAS_RENDER_SUB_REL = 7, /* d = d - s*da */
824    EVAS_RENDER_TINT = 8, /**< d = d*s + d*(1 - sa) + s*(1 - da) */
825    EVAS_RENDER_TINT_REL = 9, /**< d = d*(1 - sa + s) */
826    EVAS_RENDER_MASK = 10, /**< d = d*sa */
827    EVAS_RENDER_MUL = 11 /**< d = d*s */
828 } Evas_Render_Op; /**< How the object should be rendered to output. */
829
830 typedef enum _Evas_Border_Fill_Mode
831 {
832    EVAS_BORDER_FILL_NONE = 0, /**< Image's center region is @b not to be rendered */
833    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 */
834    EVAS_BORDER_FILL_SOLID = 2 /**< Image's center region is to be made solid, even if it has transparency on it */
835 } Evas_Border_Fill_Mode; /**< How an image's center region (the complement to the border region) should be rendered by Evas */
836
837 typedef enum _Evas_Image_Scale_Hint
838 {
839    EVAS_IMAGE_SCALE_HINT_NONE = 0, /**< No scale hint at all */
840    EVAS_IMAGE_SCALE_HINT_DYNAMIC = 1, /**< Image is being re-scaled over time, thus turning scaling cache @b off for its data */
841    EVAS_IMAGE_SCALE_HINT_STATIC = 2 /**< Image is not being re-scaled over time, thus turning scaling cache @b on for its data */
842 } Evas_Image_Scale_Hint; /**< How an image's data is to be treated by Evas, with regard to scaling cache */
843
844 typedef enum _Evas_Image_Animated_Loop_Hint
845 {
846    EVAS_IMAGE_ANIMATED_HINT_NONE = 0,
847    EVAS_IMAGE_ANIMATED_HINT_LOOP = 1, /**< Image's animation mode is loop like 1->2->3->1->2->3 */
848    EVAS_IMAGE_ANIMATED_HINT_PINGPONG = 2 /**< Image's animation mode is pingpong like 1->2->3->2->1-> ... */
849 } Evas_Image_Animated_Loop_Hint;
850
851 typedef enum _Evas_Engine_Render_Mode
852 {
853    EVAS_RENDER_MODE_BLOCKING = 0,
854    EVAS_RENDER_MODE_NONBLOCKING = 1,
855 } Evas_Engine_Render_Mode;
856
857 typedef enum _Evas_Image_Content_Hint
858 {
859    EVAS_IMAGE_CONTENT_HINT_NONE = 0, /**< No hint at all */
860    EVAS_IMAGE_CONTENT_HINT_DYNAMIC = 1, /**< The contents will change over time */
861    EVAS_IMAGE_CONTENT_HINT_STATIC = 2 /**< The contents won't change over time */
862 } Evas_Image_Content_Hint; /**< How an image's data is to be treated by Evas, for optimization */
863
864 struct _Evas_Engine_Info /** Generic engine information. Generic info is useless */
865 {
866    int magic; /**< Magic number */
867 };
868
869 struct _Evas_Event_Mouse_Down /** Mouse button press event */
870 {
871    int button; /**< Mouse button number that went down (1 - 32) */
872
873    Evas_Point output; /**< The X/Y location of the cursor */
874    Evas_Coord_Point canvas; /**< The X/Y location of the cursor */
875
876    void          *data;
877    Evas_Modifier *modifiers; /**< modifier keys pressed during the event */
878    Evas_Lock     *locks;
879
880    Evas_Button_Flags flags; /**< button flags set during the event */
881    unsigned int      timestamp;
882    Evas_Event_Flags  event_flags;
883    Evas_Device      *dev;
884 };
885
886 struct _Evas_Event_Mouse_Up /** Mouse button release event */
887 {
888    int button; /**< Mouse button number that was raised (1 - 32) */
889
890    Evas_Point output;
891    Evas_Coord_Point canvas;
892
893    void          *data;
894    Evas_Modifier *modifiers;
895    Evas_Lock     *locks;
896
897    Evas_Button_Flags flags;
898    unsigned int      timestamp;
899    Evas_Event_Flags  event_flags;
900    Evas_Device      *dev;
901 };
902
903 struct _Evas_Event_Mouse_In /** Mouse enter event */
904 {
905    int buttons; /**< Button pressed mask, Bits set to 1 are buttons currently pressed (bit 0 = mouse button 1, bit 1 = mouse button 2 etc.) */
906
907    Evas_Point output;
908    Evas_Coord_Point canvas;
909
910    void          *data;
911    Evas_Modifier *modifiers;
912    Evas_Lock     *locks;
913    unsigned int   timestamp;
914    Evas_Event_Flags  event_flags;
915    Evas_Device      *dev;
916 };
917
918 struct _Evas_Event_Mouse_Out /** Mouse leave event */
919 {
920    int buttons; /**< Button pressed mask, Bits set to 1 are buttons currently pressed (bit 0 = mouse button 1, bit 1 = mouse button 2 etc.) */
921
922
923    Evas_Point output;
924    Evas_Coord_Point canvas;
925
926    void          *data;
927    Evas_Modifier *modifiers;
928    Evas_Lock     *locks;
929    unsigned int   timestamp;
930    Evas_Event_Flags  event_flags;
931    Evas_Device      *dev;
932 };
933
934 struct _Evas_Event_Mouse_Move /** Mouse button down event */
935 {
936    int buttons; /**< Button pressed mask, Bits set to 1 are buttons currently pressed (bit 0 = mouse button 1, bit 1 = mouse button 2 etc.) */
937
938    Evas_Position cur, prev;
939
940    void          *data;
941    Evas_Modifier *modifiers;
942    Evas_Lock     *locks;
943    unsigned int   timestamp;
944    Evas_Event_Flags  event_flags;
945    Evas_Device      *dev;
946 };
947
948 struct _Evas_Event_Mouse_Wheel /** Wheel event */
949 {
950    int direction; /* 0 = default up/down wheel FIXME: more wheel types */
951    int z; /* ...,-2,-1 = down, 1,2,... = up */
952
953    Evas_Point output;
954    Evas_Coord_Point canvas;
955
956    void          *data;
957    Evas_Modifier *modifiers;
958    Evas_Lock     *locks;
959    unsigned int   timestamp;
960    Evas_Event_Flags  event_flags;
961    Evas_Device      *dev;
962 };
963
964 struct _Evas_Event_Multi_Down /** Multi button press event */
965 {
966    int device; /**< Multi device number that went down (1 or more for extra touches) */
967    double radius, radius_x, radius_y;
968    double pressure, angle;
969
970    Evas_Point output;
971    Evas_Coord_Precision_Point canvas;
972
973    void          *data;
974    Evas_Modifier *modifiers;
975    Evas_Lock     *locks;
976
977    Evas_Button_Flags flags;
978    unsigned int      timestamp;
979    Evas_Event_Flags  event_flags;
980    Evas_Device      *dev;
981 };
982
983 struct _Evas_Event_Multi_Up /** Multi button release event */
984 {
985    int device; /**< Multi device number that went up (1 or more for extra touches) */
986    double radius, radius_x, radius_y;
987    double pressure, angle;
988
989    Evas_Point output;
990    Evas_Coord_Precision_Point canvas;
991
992    void          *data;
993    Evas_Modifier *modifiers;
994    Evas_Lock     *locks;
995
996    Evas_Button_Flags flags;
997    unsigned int      timestamp;
998    Evas_Event_Flags  event_flags;
999    Evas_Device      *dev;
1000 };
1001
1002 struct _Evas_Event_Multi_Move /** Multi button down event */
1003 {
1004    int device; /**< Multi device number that moved (1 or more for extra touches) */
1005    double radius, radius_x, radius_y;
1006    double pressure, angle;
1007
1008    Evas_Precision_Position cur;
1009
1010    void          *data;
1011    Evas_Modifier *modifiers;
1012    Evas_Lock     *locks;
1013    unsigned int   timestamp;
1014    Evas_Event_Flags  event_flags;
1015    Evas_Device      *dev;
1016 };
1017
1018 struct _Evas_Event_Key_Down /** Key press event */
1019 {
1020    char          *keyname; /**< the name string of the key pressed */
1021    void          *data;
1022    Evas_Modifier *modifiers;
1023    Evas_Lock     *locks;
1024
1025    const char    *key; /**< The logical key : (eg shift+1 == exclamation) */
1026    const char    *string; /**< A UTF8 string if this keystroke has produced a visible string to be ADDED */
1027    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 */
1028    unsigned int   timestamp;
1029    Evas_Event_Flags  event_flags;
1030    Evas_Device      *dev;
1031 };
1032
1033 struct _Evas_Event_Key_Up /** Key release event */
1034 {
1035    char          *keyname; /**< the name string of the key released */
1036    void          *data;
1037    Evas_Modifier *modifiers;
1038    Evas_Lock     *locks;
1039
1040    const char    *key; /**< The logical key : (eg shift+1 == exclamation) */
1041    const char    *string; /**< A UTF8 string if this keystroke has produced a visible string to be ADDED */
1042    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 */
1043    unsigned int   timestamp;
1044    Evas_Event_Flags  event_flags;
1045    Evas_Device      *dev;
1046 };
1047
1048 struct _Evas_Event_Hold /** Hold change event */
1049 {
1050    int            hold; /**< The hold flag */
1051    void          *data;
1052
1053    unsigned int   timestamp;
1054    Evas_Event_Flags  event_flags;
1055    Evas_Device      *dev;
1056 };
1057
1058 /**
1059  * How the mouse pointer should be handled by Evas.
1060  *
1061  * In the mode #EVAS_OBJECT_POINTER_MODE_AUTOGRAB, when a mouse button
1062  * is pressed down over an object and held, with the mouse pointer
1063  * being moved outside of it, the pointer still behaves as being bound
1064  * to that object, albeit out of its drawing region. When the button
1065  * is released, the event will be fed to the object, that may check if
1066  * the final position is over it or not and do something about it.
1067  *
1068  * In the mode #EVAS_OBJECT_POINTER_MODE_NOGRAB, the pointer will
1069  * always be bound to the object right below it.
1070  *
1071  * @ingroup Evas_Object_Group_Extras
1072  */
1073 typedef enum _Evas_Object_Pointer_Mode
1074 {
1075    EVAS_OBJECT_POINTER_MODE_AUTOGRAB, /**< default, X11-like */
1076    EVAS_OBJECT_POINTER_MODE_NOGRAB, /**< pointer always bound to the object right below it */
1077    EVAS_OBJECT_POINTER_MODE_NOGRAB_NO_REPEAT_UPDOWN /**< useful on object with "repeat events" enabled, where mouse/touch up and down events WONT be repeated to objects and these objects wont be auto-grabbed. @since 1.2 */
1078 } Evas_Object_Pointer_Mode; /**< How the mouse pointer should be handled by Evas. */
1079
1080 typedef void      (*Evas_Smart_Cb) (void *data, Evas_Object *obj, void *event_info); /**< Evas smart objects' "smart callback" function signature */
1081 typedef void      (*Evas_Event_Cb) (void *data, Evas *e, void *event_info); /**< Evas event callback function signature */
1082 typedef Eina_Bool (*Evas_Object_Event_Post_Cb) (void *data, Evas *e);
1083 typedef void      (*Evas_Object_Event_Cb) (void *data, Evas *e, Evas_Object *obj, void *event_info); /**< Evas object event callback function signature */
1084 typedef void      (*Evas_Async_Events_Put_Cb)(void *target, Evas_Callback_Type type, void *event_info);
1085
1086 /**
1087  * @defgroup Evas_Group Top Level Functions
1088  *
1089  * Functions that affect Evas as a whole.
1090  */
1091
1092 /**
1093  * Initialize Evas
1094  *
1095  * @return The init counter value.
1096  *
1097  * This function initializes Evas and increments a counter of the
1098  * number of calls to it. It returns the new counter's value.
1099  *
1100  * @see evas_shutdown().
1101  *
1102  * Most EFL users wouldn't be using this function directly, because
1103  * they wouldn't access Evas directly by themselves. Instead, they
1104  * would be using higher level helpers, like @c ecore_evas_init().
1105  * See http://docs.enlightenment.org/auto/ecore/.
1106  *
1107  * You should be using this if your use is something like the
1108  * following. The buffer engine is just one of the many ones Evas
1109  * provides.
1110  *
1111  * @dontinclude evas-buffer-simple.c
1112  * @skip int main
1113  * @until return -1;
1114  * And being the canvas creation something like:
1115  * @skip static Evas *create_canvas
1116  * @until    evas_output_viewport_set(canvas,
1117  *
1118  * Note that this is code creating an Evas canvas with no usage of
1119  * Ecore helpers at all -- no linkage with Ecore on this scenario,
1120  * thus. Again, this wouldn't be on Evas common usage for most
1121  * developers. See the full @ref Example_Evas_Buffer_Simple "example".
1122  *
1123  * @ingroup Evas_Group
1124  */
1125 EAPI int               evas_init                         (void);
1126
1127 /**
1128  * Shutdown Evas
1129  *
1130  * @return Evas' init counter value.
1131  *
1132  * This function finalizes Evas, decrementing the counter of the
1133  * number of calls to the function evas_init(). This new value for the
1134  * counter is returned.
1135  *
1136  * @see evas_init().
1137  *
1138  * If you were the sole user of Evas, by means of evas_init(), you can
1139  * check if it's being properly shut down by expecting a return value
1140  * of 0.
1141  *
1142  * Example code follows.
1143  * @dontinclude evas-buffer-simple.c
1144  * @skip // NOTE: use ecore_evas_buffer_new
1145  * @until evas_shutdown
1146  * Where that function would contain:
1147  * @skip   evas_free(canvas)
1148  * @until   evas_free(canvas)
1149  *
1150  * Most users would be using ecore_evas_shutdown() instead, like told
1151  * in evas_init(). See the full @ref Example_Evas_Buffer_Simple
1152  * "example".
1153  *
1154  * @ingroup Evas_Group
1155  */
1156 EAPI int               evas_shutdown                     (void);
1157
1158
1159 /**
1160  * Return if any allocation errors have occurred during the prior function
1161  * @return The allocation error flag
1162  *
1163  * This function will return if any memory allocation errors occurred during,
1164  * and what kind they were. The return value will be one of
1165  * EVAS_ALLOC_ERROR_NONE, EVAS_ALLOC_ERROR_FATAL or EVAS_ALLOC_ERROR_RECOVERED
1166  * with each meaning something different.
1167  *
1168  * EVAS_ALLOC_ERROR_NONE means that no errors occurred at all and the function
1169  * worked as expected.
1170  *
1171  * EVAS_ALLOC_ERROR_FATAL means the function was completely unable to perform
1172  * its job and will  have  exited as cleanly as possible. The programmer
1173  * should consider this as a sign of very low memory and should try and safely
1174  * recover from the prior functions failure (or try free up memory elsewhere
1175  * and try again after more memory is freed).
1176  *
1177  * EVAS_ALLOC_ERROR_RECOVERED means that an allocation error occurred, but was
1178  * recovered from by evas finding memory of its own it has allocated and
1179  * freeing what it sees as not really usefully allocated memory. What is freed
1180  * may vary. Evas may reduce the resolution of images, free cached images or
1181  * fonts, trhow out pre-rendered data, reduce the complexity of change lists
1182  * etc. Evas and the program will function as per normal after this, but this
1183  * is a sign of low memory, and it is suggested that the program try and
1184  * identify memory it doesn't need, and free it.
1185  *
1186  * Example:
1187  * @code
1188  * extern Evas_Object *object;
1189  * void callback (void *data, Evas *e, Evas_Object *obj, void *event_info);
1190  *
1191  * evas_object_event_callback_add(object, EVAS_CALLBACK_MOUSE_DOWN, callback, NULL);
1192  * if (evas_alloc_error() == EVAS_ALLOC_ERROR_FATAL)
1193  *   {
1194  *     fprintf(stderr, "ERROR: Completely unable to attach callback. Must\n");
1195  *     fprintf(stderr, "       destroy object now as it cannot be used.\n");
1196  *     evas_object_del(object);
1197  *     object = NULL;
1198  *     fprintf(stderr, "WARNING: Memory is really low. Cleaning out RAM.\n");
1199  *     my_memory_cleanup();
1200  *   }
1201  * if (evas_alloc_error() == EVAS_ALLOC_ERROR_RECOVERED)
1202  *   {
1203  *     fprintf(stderr, "WARNING: Memory is really low. Cleaning out RAM.\n");
1204  *     my_memory_cleanup();
1205  *   }
1206  * @endcode
1207  *
1208  * @ingroup Evas_Group
1209  */
1210 EAPI Evas_Alloc_Error  evas_alloc_error                  (void);
1211
1212
1213 /**
1214  * @brief Get evas' internal asynchronous events read file descriptor.
1215  *
1216  * @return The canvas' asynchronous events read file descriptor.
1217  *
1218  * Evas' asynchronous events are meant to be dealt with internally,
1219  * i. e., when building stuff to be glued together into the EFL
1220  * infrastructure -- a module, for example. The context which demands
1221  * its use is when calculations need to be done out of the main
1222  * thread, asynchronously, and some action must be performed after
1223  * that.
1224  *
1225  * An example of actual use of this API is for image asynchronous
1226  * preload inside evas. If the canvas was instantiated through
1227  * ecore-evas usage, ecore itself will take care of calling those
1228  * events' processing.
1229  *
1230  * This function returns the read file descriptor where to get the
1231  * asynchronous events of the canvas. Naturally, other mainloops,
1232  * apart from ecore, may make use of it.
1233  *
1234  * @ingroup Evas_Group
1235  */
1236 EAPI int               evas_async_events_fd_get          (void) EINA_WARN_UNUSED_RESULT;
1237
1238 /**
1239  * @brief Trigger the processing of all events waiting on the file
1240  * descriptor returned by evas_async_events_fd_get().
1241  *
1242  * @return The number of events processed.
1243  *
1244  * All asynchronous events queued up by evas_async_events_put() are
1245  * processed here. More precisely, the callback functions, informed
1246  * together with other event parameters, when queued, get called (with
1247  * those parameters), in that order.
1248  *
1249  * @ingroup Evas_Group
1250  */
1251 EAPI int               evas_async_events_process         (void);
1252
1253 /**
1254 * Insert asynchronous events on the canvas.
1255  *
1256  * @param target The target to be affected by the events.
1257  * @param type The type of callback function.
1258  * @param event_info Information about the event.
1259  * @param func The callback function pointer.
1260  *
1261  * This is the way, for a routine running outside evas' main thread,
1262  * to report an asynchronous event. A callback function is informed,
1263  * whose call is to happen after evas_async_events_process() is
1264  * called.
1265  *
1266  * @ingroup Evas_Group
1267  */
1268 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);
1269
1270 /**
1271  * @defgroup Evas_Canvas Canvas Functions
1272  *
1273  * Low level Evas canvas functions. Sub groups will present more high
1274  * level ones, though.
1275  *
1276  * Most of these functions deal with low level Evas actions, like:
1277  * @li create/destroy raw canvases, not bound to any displaying engine
1278  * @li tell a canvas i got focused (in a windowing context, for example)
1279  * @li tell a canvas a region should not be calculated anymore in rendering
1280  * @li tell a canvas to render its contents, immediately
1281  *
1282  * Most users will be using Evas by means of the @c Ecore_Evas
1283  * wrapper, which deals with all the above mentioned issues
1284  * automatically for them. Thus, you'll be looking at this section
1285  * only if you're building low level stuff.
1286  *
1287  * The groups within present you functions that deal with the canvas
1288  * directly, too, and not yet with its @b objects. They are the
1289  * functions you need to use at a minimum to get a working canvas.
1290  *
1291  * Some of the functions in this group are exemplified @ref
1292  * Example_Evas_Events "here".
1293  */
1294
1295 /**
1296  * Creates a new empty evas.
1297  *
1298  * Note that before you can use the evas, you will to at a minimum:
1299  * @li Set its render method with @ref evas_output_method_set .
1300  * @li Set its viewport size with @ref evas_output_viewport_set .
1301  * @li Set its size of the canvas with @ref evas_output_size_set .
1302  * @li Ensure that the render engine is given the correct settings
1303  *     with @ref evas_engine_info_set .
1304  *
1305  * This function should only fail if the memory allocation fails
1306  *
1307  * @note this function is very low level. Instead of using it
1308  *       directly, consider using the high level functions in
1309  *       Ecore_Evas such as @c ecore_evas_new(). See
1310  *       http://docs.enlightenment.org/auto/ecore/.
1311  *
1312  * @attention it is recommended that one calls evas_init() before
1313  *       creating new canvas.
1314  *
1315  * @return A new uninitialised Evas canvas on success. Otherwise, @c NULL.
1316  * @ingroup Evas_Canvas
1317  */
1318 EAPI Evas             *evas_new                          (void) EINA_WARN_UNUSED_RESULT EINA_MALLOC;
1319
1320 /**
1321  * Frees the given evas and any objects created on it.
1322  *
1323  * Any objects with 'free' callbacks will have those callbacks called
1324  * in this function.
1325  *
1326  * @param   e The given evas.
1327  *
1328  * @ingroup Evas_Canvas
1329  */
1330 EAPI void              evas_free                         (Evas *e)  EINA_ARG_NONNULL(1);
1331
1332 /**
1333  * Inform to the evas that it got the focus.
1334  *
1335  * @param e The evas to change information.
1336  * @ingroup Evas_Canvas
1337  */
1338 EAPI void              evas_focus_in                     (Evas *e);
1339
1340 /**
1341  * Inform to the evas that it lost the focus.
1342  *
1343  * @param e The evas to change information.
1344  * @ingroup Evas_Canvas
1345  */
1346 EAPI void              evas_focus_out                    (Evas *e);
1347
1348 /**
1349  * Get the focus state known by the given evas
1350  *
1351  * @param e The evas to query information.
1352  * @ingroup Evas_Canvas
1353  */
1354 EAPI Eina_Bool         evas_focus_state_get              (const Evas *e);
1355
1356 /**
1357  * Push the nochange flag up 1
1358  *
1359  * This tells evas, that while the nochange flag is greater than 0, do not
1360  * mark objects as "changed" when making changes.
1361  *
1362  * @param e The evas to change information.
1363  * @ingroup Evas_Canvas
1364  */
1365 EAPI void              evas_nochange_push                (Evas *e);
1366
1367 /**
1368  * Pop the nochange flag down 1
1369  *
1370  * This tells evas, that while the nochange flag is greater than 0, do not
1371  * mark objects as "changed" when making changes.
1372  *
1373  * @param e The evas to change information.
1374  * @ingroup Evas_Canvas
1375  */
1376 EAPI void              evas_nochange_pop                 (Evas *e);
1377
1378
1379 /**
1380  * Attaches a specific pointer to the evas for fetching later
1381  *
1382  * @param e The canvas to attach the pointer to
1383  * @param data The pointer to attach
1384  * @ingroup Evas_Canvas
1385  */
1386 EAPI void              evas_data_attach_set              (Evas *e, void *data) EINA_ARG_NONNULL(1);
1387
1388 /**
1389  * Returns the pointer attached by evas_data_attach_set()
1390  *
1391  * @param e The canvas to attach the pointer to
1392  * @return The pointer attached
1393  * @ingroup Evas_Canvas
1394  */
1395 EAPI void             *evas_data_attach_get              (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
1396
1397
1398 /**
1399  * Add a damage rectangle.
1400  *
1401  * @param e The given canvas pointer.
1402  * @param x The rectangle's left position.
1403  * @param y The rectangle's top position.
1404  * @param w The rectangle's width.
1405  * @param h The rectangle's height.
1406  *
1407  * This is the function by which one tells evas that a part of the
1408  * canvas has to be repainted.
1409  *
1410  * @note All newly created Evas rectangles get the default color values of 255 255 255 255 (opaque white).
1411  *
1412  * @ingroup Evas_Canvas
1413  */
1414 EAPI void              evas_damage_rectangle_add         (Evas *e, int x, int y, int w, int h) EINA_ARG_NONNULL(1);
1415
1416 /**
1417  * Add an "obscured region" to an Evas canvas.
1418  *
1419  * @param e The given canvas pointer.
1420  * @param x The rectangle's top left corner's horizontal coordinate.
1421  * @param y The rectangle's top left corner's vertical coordinate
1422  * @param w The rectangle's width.
1423  * @param h The rectangle's height.
1424  *
1425  * This is the function by which one tells an Evas canvas that a part
1426  * of it <b>must not</b> be repainted. The region must be
1427  * rectangular and its coordinates inside the canvas viewport are
1428  * passed in the call. After this call, the region specified won't
1429  * participate in any form in Evas' calculations and actions during
1430  * its rendering updates, having its displaying content frozen as it
1431  * was just after this function took place.
1432  *
1433  * We call it "obscured region" because the most common use case for
1434  * this rendering (partial) freeze is something else (most probably
1435  * other canvas) being on top of the specified rectangular region,
1436  * thus shading it completely from the user's final scene in a
1437  * display. To avoid unnecessary processing, one should indicate to the
1438  * obscured canvas not to bother about the non-important area.
1439  *
1440  * The majority of users won't have to worry about this function, as
1441  * they'll be using just one canvas in their applications, with
1442  * nothing inset or on top of it in any form.
1443  *
1444  * To make this region one that @b has to be repainted again, call the
1445  * function evas_obscured_clear().
1446  *
1447  * @note This is a <b>very low level function</b>, which most of
1448  * Evas' users wouldn't care about.
1449  *
1450  * @note This function does @b not flag the canvas as having its state
1451  * changed. If you want to re-render it afterwards expecting new
1452  * contents, you have to add "damage" regions yourself (see
1453  * evas_damage_rectangle_add()).
1454  *
1455  * @see evas_obscured_clear()
1456  * @see evas_render_updates()
1457  *
1458  * Example code follows.
1459  * @dontinclude evas-events.c
1460  * @skip add an obscured
1461  * @until evas_obscured_clear(evas);
1462  *
1463  * In that example, pressing the "Ctrl" and "o" keys will impose or
1464  * remove an obscured region in the middle of the canvas. You'll get
1465  * the same contents at the time the key was pressed, if toggling it
1466  * on, until you toggle it off again (make sure the animation is
1467  * running on to get the idea better). See the full @ref
1468  * Example_Evas_Events "example".
1469  *
1470  * @ingroup Evas_Canvas
1471  */
1472 EAPI void              evas_obscured_rectangle_add       (Evas *e, int x, int y, int w, int h) EINA_ARG_NONNULL(1);
1473
1474 /**
1475  * Remove all "obscured regions" from an Evas canvas.
1476  *
1477  * @param e The given canvas pointer.
1478  *
1479  * This function removes all the rectangles from the obscured regions
1480  * list of the canvas @p e. It takes obscured areas added with
1481  * evas_obscured_rectangle_add() and make them again a regions that @b
1482  * have to be repainted on rendering updates.
1483  *
1484  * @note This is a <b>very low level function</b>, which most of
1485  * Evas' users wouldn't care about.
1486  *
1487  * @note This function does @b not flag the canvas as having its state
1488  * changed. If you want to re-render it afterwards expecting new
1489  * contents, you have to add "damage" regions yourself (see
1490  * evas_damage_rectangle_add()).
1491  *
1492  * @see evas_obscured_rectangle_add() for an example
1493  * @see evas_render_updates()
1494  *
1495  * @ingroup Evas_Canvas
1496  */
1497 EAPI void              evas_obscured_clear               (Evas *e) EINA_ARG_NONNULL(1);
1498
1499 /**
1500  * Force immediate renderization of the given Evas canvas.
1501  *
1502  * @param e The given canvas pointer.
1503  * @return A newly allocated list of updated rectangles of the canvas
1504  *        (@c Eina_Rectangle structs). Free this list with
1505  *        evas_render_updates_free().
1506  *
1507  * This function forces an immediate renderization update of the given
1508  * canvas @p e.
1509  *
1510  * @note This is a <b>very low level function</b>, which most of
1511  * Evas' users wouldn't care about. One would use it, for example, to
1512  * grab an Evas' canvas update regions and paint them back, using the
1513  * canvas' pixmap, on a displaying system working below Evas.
1514  *
1515  * @note Evas is a stateful canvas. If no operations changing its
1516  * state took place since the last rendering action, you won't see no
1517  * changes and this call will be a no-op.
1518  *
1519  * Example code follows.
1520  * @dontinclude evas-events.c
1521  * @skip add an obscured
1522  * @until d.obscured = !d.obscured;
1523  *
1524  * See the full @ref Example_Evas_Events "example".
1525  *
1526  * @ingroup Evas_Canvas
1527  */
1528 EAPI Eina_List        *evas_render_updates               (Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
1529
1530 /**
1531  * Free the rectangles returned by evas_render_updates().
1532  *
1533  * @param updates The list of updated rectangles of the canvas.
1534  *
1535  * This function removes the region from the render updates list. It
1536  * makes the region doesn't be render updated anymore.
1537  *
1538  * @see evas_render_updates() for an example
1539  *
1540  * @ingroup Evas_Canvas
1541  */
1542 EAPI void              evas_render_updates_free          (Eina_List *updates);
1543
1544 /**
1545  * Force renderization of the given canvas.
1546  *
1547  * @param e The given canvas pointer.
1548  *
1549  * @ingroup Evas_Canvas
1550  */
1551 EAPI void              evas_render                       (Evas *e) EINA_ARG_NONNULL(1);
1552
1553 /**
1554  * Update the canvas internal objects but not triggering immediate
1555  * renderization.
1556  *
1557  * @param e The given canvas pointer.
1558  *
1559  * This function updates the canvas internal objects not triggering
1560  * renderization. To force renderization function evas_render() should
1561  * be used.
1562  *
1563  * @see evas_render.
1564  *
1565  * @ingroup Evas_Canvas
1566  */
1567 EAPI void              evas_norender                     (Evas *e) EINA_ARG_NONNULL(1);
1568
1569 /**
1570  * Make the canvas discard internally cached data used for rendering.
1571  *
1572  * @param e The given canvas pointer.
1573  *
1574  * This function flushes the arrays of delete, active and render objects.
1575  * Other things it may also discard are: shared memory segments,
1576  * temporary scratch buffers, cached data to avoid re-compute of that data etc.
1577  *
1578  * @ingroup Evas_Canvas
1579  */
1580 EAPI void              evas_render_idle_flush            (Evas *e) EINA_ARG_NONNULL(1);
1581
1582 /**
1583  * Make the canvas discard as much data as possible used by the engine at
1584  * runtime.
1585  *
1586  * @param e The given canvas pointer.
1587  *
1588  * This function will unload images, delete textures and much more, where
1589  * possible. You may also want to call evas_render_idle_flush() immediately
1590  * prior to this to perhaps discard a little more, though evas_render_dump()
1591  * should implicitly delete most of what evas_render_idle_flush() might
1592  * discard too.
1593  *
1594  * @ingroup Evas_Canvas
1595  */
1596 EAPI void              evas_render_dump                  (Evas *e) EINA_ARG_NONNULL(1);
1597
1598 /**
1599  * @defgroup Evas_Output_Method Render Engine Functions
1600  *
1601  * Functions that are used to set the render engine for a given
1602  * function, and then get that engine working.
1603  *
1604  * The following code snippet shows how they can be used to
1605  * initialise an evas that uses the X11 software engine:
1606  * @code
1607  * Evas *evas;
1608  * Evas_Engine_Info_Software_X11 *einfo;
1609  * extern Display *display;
1610  * extern Window win;
1611  *
1612  * evas_init();
1613  *
1614  * evas = evas_new();
1615  * evas_output_method_set(evas, evas_render_method_lookup("software_x11"));
1616  * evas_output_size_set(evas, 640, 480);
1617  * evas_output_viewport_set(evas, 0, 0, 640, 480);
1618  * einfo = (Evas_Engine_Info_Software_X11 *)evas_engine_info_get(evas);
1619  * einfo->info.display = display;
1620  * einfo->info.visual = DefaultVisual(display, DefaultScreen(display));
1621  * einfo->info.colormap = DefaultColormap(display, DefaultScreen(display));
1622  * einfo->info.drawable = win;
1623  * einfo->info.depth = DefaultDepth(display, DefaultScreen(display));
1624  * evas_engine_info_set(evas, (Evas_Engine_Info *)einfo);
1625  * @endcode
1626  *
1627  * @ingroup Evas_Canvas
1628  */
1629
1630 /**
1631  * Look up a numeric ID from a string name of a rendering engine.
1632  *
1633  * @param name the name string of an engine
1634  * @return A numeric (opaque) ID for the rendering engine
1635  * @ingroup Evas_Output_Method
1636  *
1637  * This function looks up a numeric return value for the named engine
1638  * in the string @p name. This is a normal C string, NUL byte
1639  * terminated. The name is case sensitive. If the rendering engine is
1640  * available, a numeric ID for that engine is returned that is not
1641  * 0. If the engine is not available, 0 is returned, indicating an
1642  * invalid engine.
1643  *
1644  * The programmer should NEVER rely on the numeric ID of an engine
1645  * unless it is returned by this function. Programs should NOT be
1646  * written accessing render method ID's directly, without first
1647  * obtaining it from this function.
1648  *
1649  * @attention it is mandatory that one calls evas_init() before
1650  *       looking up the render method.
1651  *
1652  * Example:
1653  * @code
1654  * int engine_id;
1655  * Evas *evas;
1656  *
1657  * evas_init();
1658  *
1659  * evas = evas_new();
1660  * if (!evas)
1661  *   {
1662  *     fprintf(stderr, "ERROR: Canvas creation failed. Fatal error.\n");
1663  *     exit(-1);
1664  *   }
1665  * engine_id = evas_render_method_lookup("software_x11");
1666  * if (!engine_id)
1667  *   {
1668  *     fprintf(stderr, "ERROR: Requested rendering engine is absent.\n");
1669  *     exit(-1);
1670  *   }
1671  * evas_output_method_set(evas, engine_id);
1672  * @endcode
1673  */
1674 EAPI int               evas_render_method_lookup         (const char *name) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
1675
1676 /**
1677  * List all the rendering engines compiled into the copy of the Evas library
1678  *
1679  * @return A linked list whose data members are C strings of engine names
1680  * @ingroup Evas_Output_Method
1681  *
1682  * Calling this will return a handle (pointer) to an Evas linked
1683  * list. Each node in the linked list will have the data pointer be a
1684  * (char *) pointer to the name string of the rendering engine
1685  * available. The strings should never be modified, neither should the
1686  * list be modified. This list should be cleaned up as soon as the
1687  * program no longer needs it using evas_render_method_list_free(). If
1688  * no engines are available from Evas, @c NULL will be returned.
1689  *
1690  * Example:
1691  * @code
1692  * Eina_List *engine_list, *l;
1693  * char *engine_name;
1694  *
1695  * engine_list = evas_render_method_list();
1696  * if (!engine_list)
1697  *   {
1698  *     fprintf(stderr, "ERROR: Evas supports no engines! Exit.\n");
1699  *     exit(-1);
1700  *   }
1701  * printf("Available Evas Engines:\n");
1702  * EINA_LIST_FOREACH(engine_list, l, engine_name)
1703  *     printf("%s\n", engine_name);
1704  * evas_render_method_list_free(engine_list);
1705  * @endcode
1706  */
1707 EAPI Eina_List        *evas_render_method_list           (void) EINA_WARN_UNUSED_RESULT;
1708
1709 /**
1710  * This function should be called to free a list of engine names
1711  *
1712  * @param list The Eina_List base pointer for the engine list to be freed
1713  * @ingroup Evas_Output_Method
1714  *
1715  * When this function is called it will free the engine list passed in
1716  * as @p list. The list should only be a list of engines generated by
1717  * calling evas_render_method_list(). If @p list is NULL, nothing will
1718  * happen.
1719  *
1720  * Example:
1721  * @code
1722  * Eina_List *engine_list, *l;
1723  * char *engine_name;
1724  *
1725  * engine_list = evas_render_method_list();
1726  * if (!engine_list)
1727  *   {
1728  *     fprintf(stderr, "ERROR: Evas supports no engines! Exit.\n");
1729  *     exit(-1);
1730  *   }
1731  * printf("Available Evas Engines:\n");
1732  * EINA_LIST_FOREACH(engine_list, l, engine_name)
1733  *     printf("%s\n", engine_name);
1734  * evas_render_method_list_free(engine_list);
1735  * @endcode
1736  */
1737 EAPI void              evas_render_method_list_free      (Eina_List *list);
1738
1739
1740 /**
1741  * Sets the output engine for the given evas.
1742  *
1743  * Once the output engine for an evas is set, any attempt to change it
1744  * will be ignored.  The value for @p render_method can be found using
1745  * @ref evas_render_method_lookup .
1746  *
1747  * @param   e             The given evas.
1748  * @param   render_method The numeric engine value to use.
1749  *
1750  * @attention it is mandatory that one calls evas_init() before
1751  *       setting the output method.
1752  *
1753  * @ingroup Evas_Output_Method
1754  */
1755 EAPI void              evas_output_method_set            (Evas *e, int render_method) EINA_ARG_NONNULL(1);
1756
1757 /**
1758  * Retrieves the number of the output engine used for the given evas.
1759  * @param   e The given evas.
1760  * @return  The ID number of the output engine being used.  @c 0 is
1761  *          returned if there is an error.
1762  * @ingroup Evas_Output_Method
1763  */
1764 EAPI int               evas_output_method_get            (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
1765
1766
1767 /**
1768  * Retrieves the current render engine info struct from the given evas.
1769  *
1770  * The returned structure is publicly modifiable.  The contents are
1771  * valid until either @ref evas_engine_info_set or @ref evas_render
1772  * are called.
1773  *
1774  * This structure does not need to be freed by the caller.
1775  *
1776  * @param   e The given evas.
1777  * @return  A pointer to the Engine Info structure.  @c NULL is returned if
1778  *          an engine has not yet been assigned.
1779  * @ingroup Evas_Output_Method
1780  */
1781 EAPI Evas_Engine_Info *evas_engine_info_get              (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
1782
1783 /**
1784  * Applies the engine settings for the given evas from the given @c
1785  * Evas_Engine_Info structure.
1786  *
1787  * To get the Evas_Engine_Info structure to use, call @ref
1788  * evas_engine_info_get .  Do not try to obtain a pointer to an
1789  * @c Evas_Engine_Info structure in any other way.
1790  *
1791  * You will need to call this function at least once before you can
1792  * create objects on an evas or render that evas.  Some engines allow
1793  * their settings to be changed more than once.
1794  *
1795  * Once called, the @p info pointer should be considered invalid.
1796  *
1797  * @param   e    The pointer to the Evas Canvas
1798  * @param   info The pointer to the Engine Info to use
1799  * @return  @c EINA_TRUE if no error occurred, @c EINA_FALSE otherwise.
1800  * @ingroup Evas_Output_Method
1801  */
1802 EAPI Eina_Bool         evas_engine_info_set              (Evas *e, Evas_Engine_Info *info) EINA_ARG_NONNULL(1);
1803
1804 /**
1805  * @defgroup Evas_Output_Size Output and Viewport Resizing Functions
1806  *
1807  * Functions that set and retrieve the output and viewport size of an
1808  * evas.
1809  *
1810  * @ingroup Evas_Canvas
1811  */
1812
1813 /**
1814  * Sets the output size of the render engine of the given evas.
1815  *
1816  * The evas will render to a rectangle of the given size once this
1817  * function is called.  The output size is independent of the viewport
1818  * size.  The viewport will be stretched to fill the given rectangle.
1819  *
1820  * The units used for @p w and @p h depend on the engine used by the
1821  * evas.
1822  *
1823  * @param   e The given evas.
1824  * @param   w The width in output units, usually pixels.
1825  * @param   h The height in output units, usually pixels.
1826  * @ingroup Evas_Output_Size
1827  */
1828 EAPI void              evas_output_size_set              (Evas *e, int w, int h) EINA_ARG_NONNULL(1);
1829
1830 /**
1831  * Retrieve the output size of the render engine of the given evas.
1832  *
1833  * The output size is given in whatever the output units are for the
1834  * engine.
1835  *
1836  * If either @p w or @p h is @c NULL, then it is ignored.  If @p e is
1837  * invalid, the returned results are undefined.
1838  *
1839  * @param   e The given evas.
1840  * @param   w The pointer to an integer to store the width in.
1841  * @param   h The pointer to an integer to store the height in.
1842  * @ingroup Evas_Output_Size
1843  */
1844 EAPI void              evas_output_size_get              (const Evas *e, int *w, int *h) EINA_ARG_NONNULL(1);
1845
1846 /**
1847  * Sets the output viewport of the given evas in evas units.
1848  *
1849  * The output viewport is the area of the evas that will be visible to
1850  * the viewer.  The viewport will be stretched to fit the output
1851  * target of the evas when rendering is performed.
1852  *
1853  * @note The coordinate values do not have to map 1-to-1 with the output
1854  *       target.  However, it is generally advised that it is done for ease
1855  *       of use.
1856  *
1857  * @param   e The given evas.
1858  * @param   x The top-left corner x value of the viewport.
1859  * @param   y The top-left corner y value of the viewport.
1860  * @param   w The width of the viewport.  Must be greater than 0.
1861  * @param   h The height of the viewport.  Must be greater than 0.
1862  * @ingroup Evas_Output_Size
1863  */
1864 EAPI void              evas_output_viewport_set          (Evas *e, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h) EINA_ARG_NONNULL(1);
1865
1866 /**
1867  * Get the render engine's output viewport co-ordinates in canvas units.
1868  * @param e The pointer to the Evas Canvas
1869  * @param x The pointer to a x variable to be filled in
1870  * @param y The pointer to a y variable to be filled in
1871  * @param w The pointer to a width variable to be filled in
1872  * @param h The pointer to a height variable to be filled in
1873  * @ingroup Evas_Output_Size
1874  *
1875  * Calling this function writes the current canvas output viewport
1876  * size and location values into the variables pointed to by @p x, @p
1877  * y, @p w and @p h.  On success the variables have the output
1878  * location and size values written to them in canvas units. Any of @p
1879  * x, @p y, @p w or @p h that are @c NULL will not be written to. If @p e
1880  * is invalid, the results are undefined.
1881  *
1882  * Example:
1883  * @code
1884  * extern Evas *evas;
1885  * Evas_Coord x, y, width, height;
1886  *
1887  * evas_output_viewport_get(evas, &x, &y, &w, &h);
1888  * @endcode
1889  */
1890 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);
1891
1892 /**
1893  * Sets the output framespace size of the render engine of the given evas.
1894  *
1895  * The framespace size is used in the Wayland engines to denote space where 
1896  * the output is not drawn. This is mainly used in ecore_evas to draw borders
1897  *
1898  * The units used for @p w and @p h depend on the engine used by the
1899  * evas.
1900  *
1901  * @param   e The given evas.
1902  * @param   x The left coordinate in output units, usually pixels.
1903  * @param   y The top coordinate in output units, usually pixels.
1904  * @param   w The width in output units, usually pixels.
1905  * @param   h The height in output units, usually pixels.
1906  * @ingroup Evas_Output_Size
1907  * @since 1.1.0
1908  */
1909 EAPI void              evas_output_framespace_set        (Evas *e, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h);
1910
1911 /**
1912  * Get the render engine's output framespace co-ordinates in canvas units.
1913  * 
1914  * @param e The pointer to the Evas Canvas
1915  * @param x The pointer to a x variable to be filled in
1916  * @param y The pointer to a y variable to be filled in
1917  * @param w The pointer to a width variable to be filled in
1918  * @param h The pointer to a height variable to be filled in
1919  * @ingroup Evas_Output_Size
1920  * @since 1.1.0
1921  */
1922 EAPI void              evas_output_framespace_get        (const Evas *e, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h);
1923
1924 /**
1925  * @defgroup Evas_Coord_Mapping_Group Coordinate Mapping Functions
1926  *
1927  * Functions that are used to map coordinates from the canvas to the
1928  * screen or the screen to the canvas.
1929  *
1930  * @ingroup Evas_Canvas
1931  */
1932
1933 /**
1934  * Convert/scale an ouput screen co-ordinate into canvas co-ordinates
1935  *
1936  * @param e The pointer to the Evas Canvas
1937  * @param x The screen/output x co-ordinate
1938  * @return The screen co-ordinate translated to canvas unit co-ordinates
1939  * @ingroup Evas_Coord_Mapping_Group
1940  *
1941  * This function takes in a horizontal co-ordinate as the @p x
1942  * parameter and converts it into canvas units, accounting for output
1943  * size, viewport size and location, returning it as the function
1944  * return value. If @p e is invalid, the results are undefined.
1945  *
1946  * Example:
1947  * @code
1948  * extern Evas *evas;
1949  * extern int screen_x;
1950  * Evas_Coord canvas_x;
1951  *
1952  * canvas_x = evas_coord_screen_x_to_world(evas, screen_x);
1953  * @endcode
1954  */
1955 EAPI Evas_Coord        evas_coord_screen_x_to_world      (const Evas *e, int x) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
1956
1957 /**
1958  * Convert/scale an ouput screen co-ordinate into canvas co-ordinates
1959  *
1960  * @param e The pointer to the Evas Canvas
1961  * @param y The screen/output y co-ordinate
1962  * @return The screen co-ordinate translated to canvas unit co-ordinates
1963  * @ingroup Evas_Coord_Mapping_Group
1964  *
1965  * This function takes in a vertical co-ordinate as the @p y parameter
1966  * and converts it into canvas units, accounting for output size,
1967  * viewport size and location, returning it as the function return
1968  * value. If @p e is invalid, the results are undefined.
1969  *
1970  * Example:
1971  * @code
1972  * extern Evas *evas;
1973  * extern int screen_y;
1974  * Evas_Coord canvas_y;
1975  *
1976  * canvas_y = evas_coord_screen_y_to_world(evas, screen_y);
1977  * @endcode
1978  */
1979 EAPI Evas_Coord        evas_coord_screen_y_to_world      (const Evas *e, int y) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
1980
1981 /**
1982  * Convert/scale a canvas co-ordinate into output screen co-ordinates
1983  *
1984  * @param e The pointer to the Evas Canvas
1985  * @param x The canvas x co-ordinate
1986  * @return The output/screen co-ordinate translated to output co-ordinates
1987  * @ingroup Evas_Coord_Mapping_Group
1988  *
1989  * This function takes in a horizontal co-ordinate as the @p x
1990  * parameter and converts it into output units, accounting for output
1991  * size, viewport size and location, returning it as the function
1992  * return value. If @p e is invalid, the results are undefined.
1993  *
1994  * Example:
1995  * @code
1996  * extern Evas *evas;
1997  * int screen_x;
1998  * extern Evas_Coord canvas_x;
1999  *
2000  * screen_x = evas_coord_world_x_to_screen(evas, canvas_x);
2001  * @endcode
2002  */
2003 EAPI int               evas_coord_world_x_to_screen      (const Evas *e, Evas_Coord x) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
2004
2005 /**
2006  * Convert/scale a canvas co-ordinate into output screen co-ordinates
2007  *
2008  * @param e The pointer to the Evas Canvas
2009  * @param y The canvas y co-ordinate
2010  * @return The output/screen co-ordinate translated to output co-ordinates
2011  * @ingroup Evas_Coord_Mapping_Group
2012  *
2013  * This function takes in a vertical co-ordinate as the @p x parameter
2014  * and converts it into output units, accounting for output size,
2015  * viewport size and location, returning it as the function return
2016  * value. If @p e is invalid, the results are undefined.
2017  *
2018  * Example:
2019  * @code
2020  * extern Evas *evas;
2021  * int screen_y;
2022  * extern Evas_Coord canvas_y;
2023  *
2024  * screen_y = evas_coord_world_y_to_screen(evas, canvas_y);
2025  * @endcode
2026  */
2027 EAPI int               evas_coord_world_y_to_screen      (const Evas *e, Evas_Coord y) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
2028
2029 /**
2030  * @defgroup Evas_Pointer_Group Pointer (Mouse) Functions
2031  *
2032  * Functions that deal with the status of the pointer (mouse cursor).
2033  *
2034  * @ingroup Evas_Canvas
2035  */
2036
2037 /**
2038  * This function returns the current known pointer co-ordinates
2039  *
2040  * @param e The pointer to the Evas Canvas
2041  * @param x The pointer to an integer to be filled in
2042  * @param y The pointer to an integer to be filled in
2043  * @ingroup Evas_Pointer_Group
2044  *
2045  * This function returns the current known screen/output co-ordinates
2046  * of the mouse pointer and sets the contents of the integers pointed
2047  * to by @p x and @p y to contain these co-ordinates. If @p e is not a
2048  * valid canvas the results of this function are undefined.
2049  *
2050  * Example:
2051  * @code
2052  * extern Evas *evas;
2053  * int mouse_x, mouse_y;
2054  *
2055  * evas_pointer_output_xy_get(evas, &mouse_x, &mouse_y);
2056  * printf("Mouse is at screen position %i, %i\n", mouse_x, mouse_y);
2057  * @endcode
2058  */
2059 EAPI void              evas_pointer_output_xy_get        (const Evas *e, int *x, int *y) EINA_ARG_NONNULL(1);
2060
2061 /**
2062  * This function returns the current known pointer co-ordinates
2063  *
2064  * @param e The pointer to the Evas Canvas
2065  * @param x The pointer to a Evas_Coord to be filled in
2066  * @param y The pointer to a Evas_Coord to be filled in
2067  * @ingroup Evas_Pointer_Group
2068  *
2069  * This function returns the current known canvas unit co-ordinates of
2070  * the mouse pointer and sets the contents of the Evas_Coords pointed
2071  * to by @p x and @p y to contain these co-ordinates. If @p e is not a
2072  * valid canvas the results of this function are undefined.
2073  *
2074  * Example:
2075  * @code
2076  * extern Evas *evas;
2077  * Evas_Coord mouse_x, mouse_y;
2078  *
2079  * evas_pointer_output_xy_get(evas, &mouse_x, &mouse_y);
2080  * printf("Mouse is at canvas position %f, %f\n", mouse_x, mouse_y);
2081  * @endcode
2082  */
2083 EAPI void              evas_pointer_canvas_xy_get        (const Evas *e, Evas_Coord *x, Evas_Coord *y) EINA_ARG_NONNULL(1);
2084
2085 /**
2086  * Returns a bitmask with the mouse buttons currently pressed, set to 1
2087  *
2088  * @param e The pointer to the Evas Canvas
2089  * @return A bitmask of the currently depressed buttons on the canvas
2090  * @ingroup Evas_Pointer_Group
2091  *
2092  * Calling this function will return a 32-bit integer with the
2093  * appropriate bits set to 1 that correspond to a mouse button being
2094  * depressed. This limits Evas to a mouse devices with a maximum of 32
2095  * buttons, but that is generally in excess of any host system's
2096  * pointing device abilities.
2097  *
2098  * A canvas by default begins with no mouse buttons being pressed and
2099  * only calls to evas_event_feed_mouse_down(),
2100  * evas_event_feed_mouse_down_data(), evas_event_feed_mouse_up() and
2101  * evas_event_feed_mouse_up_data() will alter that.
2102  *
2103  * The least significant bit corresponds to the first mouse button
2104  * (button 1) and the most significant bit corresponds to the last
2105  * mouse button (button 32).
2106  *
2107  * If @p e is not a valid canvas, the return value is undefined.
2108  *
2109  * Example:
2110  * @code
2111  * extern Evas *evas;
2112  * int button_mask, i;
2113  *
2114  * button_mask = evas_pointer_button_down_mask_get(evas);
2115  * printf("Buttons currently pressed:\n");
2116  * for (i = 0; i < 32; i++)
2117  *   {
2118  *     if ((button_mask & (1 << i)) != 0) printf("Button %i\n", i + 1);
2119  *   }
2120  * @endcode
2121  */
2122 EAPI int               evas_pointer_button_down_mask_get (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
2123
2124 /**
2125  * Returns whether the mouse pointer is logically inside the canvas
2126  *
2127  * @param e The pointer to the Evas Canvas
2128  * @return An integer that is 1 if the mouse is inside the canvas, 0 otherwise
2129  * @ingroup Evas_Pointer_Group
2130  *
2131  * When this function is called it will return a value of either 0 or
2132  * 1, depending on if evas_event_feed_mouse_in(),
2133  * evas_event_feed_mouse_in_data(), or evas_event_feed_mouse_out(),
2134  * evas_event_feed_mouse_out_data() have been called to feed in a
2135  * mouse enter event into the canvas.
2136  *
2137  * A return value of 1 indicates the mouse is logically inside the
2138  * canvas, and 0 implies it is logically outside the canvas.
2139  *
2140  * A canvas begins with the mouse being assumed outside (0).
2141  *
2142  * If @p e is not a valid canvas, the return value is undefined.
2143  *
2144  * Example:
2145  * @code
2146  * extern Evas *evas;
2147  *
2148  * if (evas_pointer_inside_get(evas)) printf("Mouse is in!\n");
2149  * else printf("Mouse is out!\n");
2150  * @endcode
2151  */
2152 EAPI Eina_Bool         evas_pointer_inside_get           (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
2153    EAPI void              evas_sync(Evas *e) EINA_ARG_NONNULL(1);
2154
2155 /**
2156  * @defgroup Evas_Canvas_Events Canvas Events
2157  *
2158  * Functions relating to canvas events, which are mainly reports on
2159  * its internal states changing (an object got focused, the rendering
2160  * is updated, etc).
2161  *
2162  * Some of the functions in this group are exemplified @ref
2163  * Example_Evas_Events "here".
2164  *
2165  * @ingroup Evas_Canvas
2166  */
2167
2168 /**
2169  * @addtogroup Evas_Canvas_Events
2170  * @{
2171  */
2172
2173 /**
2174  * Add (register) a callback function to a given canvas event.
2175  *
2176  * @param e Canvas to attach a callback to
2177  * @param type The type of event that will trigger the callback
2178  * @param func The (callback) function to be called when the event is
2179  *        triggered
2180  * @param data The data pointer to be passed to @p func
2181  *
2182  * This function adds a function callback to the canvas @p e when the
2183  * event of type @p type occurs on it. The function pointer is @p
2184  * func.
2185  *
2186  * In the event of a memory allocation error during the addition of
2187  * the callback to the canvas, evas_alloc_error() should be used to
2188  * determine the nature of the error, if any, and the program should
2189  * sensibly try and recover.
2190  *
2191  * A callback function must have the ::Evas_Event_Cb prototype
2192  * definition. The first parameter (@p data) in this definition will
2193  * have the same value passed to evas_event_callback_add() as the @p
2194  * data parameter, at runtime. The second parameter @p e is the canvas
2195  * pointer on which the event occurred. The third parameter @p
2196  * event_info is a pointer to a data structure that may or may not be
2197  * passed to the callback, depending on the event type that triggered
2198  * the callback. This is so because some events don't carry extra
2199  * context with them, but others do.
2200  *
2201  * The event type @p type to trigger the function may be one of
2202  * #EVAS_CALLBACK_RENDER_FLUSH_PRE, #EVAS_CALLBACK_RENDER_FLUSH_POST,
2203  * #EVAS_CALLBACK_CANVAS_FOCUS_IN, #EVAS_CALLBACK_CANVAS_FOCUS_OUT,
2204  * #EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_IN and
2205  * #EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_OUT. This determines the kind of
2206  * event that will trigger the callback to be called. Only the last
2207  * two of the event types listed here provide useful event information
2208  * data -- a pointer to the recently focused Evas object. For the
2209  * others the @p event_info pointer is going to be @c NULL.
2210  *
2211  * Example:
2212  * @dontinclude evas-events.c
2213  * @skip evas_event_callback_add(d.canvas, EVAS_CALLBACK_RENDER_FLUSH_PRE
2214  * @until two canvas event callbacks
2215  *
2216  * Looking to the callbacks registered above,
2217  * @dontinclude evas-events.c
2218  * @skip called when our rectangle gets focus
2219  * @until let's have our events back
2220  *
2221  * we see that the canvas flushes its rendering pipeline
2222  * (#EVAS_CALLBACK_RENDER_FLUSH_PRE) whenever the @c _resize_cb
2223  * routine takes place: it has to redraw that image at a different
2224  * size. Also, the callback on an object being focused comes just
2225  * after we focus it explicitly, on code.
2226  *
2227  * See the full @ref Example_Evas_Events "example".
2228  *
2229  * @note Be careful not to add the same callback multiple times, if
2230  * that's not what you want, because Evas won't check if a callback
2231  * existed before exactly as the one being registered (and thus, call
2232  * it more than once on the event, in this case). This would make
2233  * sense if you passed different functions and/or callback data, only.
2234  */
2235 EAPI void              evas_event_callback_add              (Evas *e, Evas_Callback_Type type, Evas_Event_Cb func, const void *data) EINA_ARG_NONNULL(1, 3);
2236
2237 /**
2238  * Add (register) a callback function to a given canvas event with a
2239  * non-default priority set. Except for the priority field, it's exactly the
2240  * same as @ref evas_event_callback_add
2241  *
2242  * @param e Canvas to attach a callback to
2243  * @param type The type of event that will trigger the callback
2244  * @param priority The priority of the callback, lower values called first.
2245  * @param func The (callback) function to be called when the event is
2246  *        triggered
2247  * @param data The data pointer to be passed to @p func
2248  *
2249  * @see evas_event_callback_add
2250  * @since 1.1.0
2251  */
2252 EAPI void              evas_event_callback_priority_add(Evas *e, Evas_Callback_Type type, Evas_Callback_Priority priority, Evas_Event_Cb func, const void *data) EINA_ARG_NONNULL(1, 4);
2253
2254 /**
2255  * Delete a callback function from the canvas.
2256  *
2257  * @param e Canvas to remove a callback from
2258  * @param type The type of event that was triggering the callback
2259  * @param func The function that was to be called when the event was triggered
2260  * @return The data pointer that was to be passed to the callback
2261  *
2262  * This function removes the most recently added callback from the
2263  * canvas @p e which was triggered by the event type @p type and was
2264  * calling the function @p func when triggered. If the removal is
2265  * successful it will also return the data pointer that was passed to
2266  * evas_event_callback_add() when the callback was added to the
2267  * canvas. If not successful @c NULL will be returned.
2268  *
2269  * Example:
2270  * @code
2271  * extern Evas *e;
2272  * void *my_data;
2273  * void focus_in_callback(void *data, Evas *e, void *event_info);
2274  *
2275  * my_data = evas_event_callback_del(ebject, EVAS_CALLBACK_CANVAS_FOCUS_IN, focus_in_callback);
2276  * @endcode
2277  */
2278 EAPI void             *evas_event_callback_del              (Evas *e, Evas_Callback_Type type, Evas_Event_Cb func) EINA_ARG_NONNULL(1, 3);
2279
2280 /**
2281  * Delete (unregister) a callback function registered to a given
2282  * canvas event.
2283  *
2284  * @param e Canvas to remove an event callback from
2285  * @param type The type of event that was triggering the callback
2286  * @param func The function that was to be called when the event was
2287  *        triggered
2288  * @param data The data pointer that was to be passed to the callback
2289  * @return The data pointer that was to be passed to the callback
2290  *
2291  * This function removes <b>the first</b> added callback from the
2292  * canvas @p e matching the event type @p type, the registered
2293  * function pointer @p func and the callback data pointer @p data. If
2294  * the removal is successful it will also return the data pointer that
2295  * was passed to evas_event_callback_add() (that will be the same as
2296  * the parameter) when the callback(s) was(were) added to the
2297  * canvas. If not successful @c NULL will be returned. A common use
2298  * would be to remove an exact match of a callback.
2299  *
2300  * Example:
2301  * @dontinclude evas-events.c
2302  * @skip evas_event_callback_del_full(evas, EVAS_CALLBACK_RENDER_FLUSH_PRE,
2303  * @until _object_focus_in_cb, NULL);
2304  *
2305  * See the full @ref Example_Evas_Events "example".
2306  *
2307  * @note For deletion of canvas events callbacks filtering by just
2308  * type and function pointer, user evas_event_callback_del().
2309  */
2310 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);
2311
2312 /**
2313  * Push a callback on the post-event callback stack
2314  *
2315  * @param e Canvas to push the callback on
2316  * @param func The function that to be called when the stack is unwound
2317  * @param data The data pointer to be passed to the callback
2318  *
2319  * Evas has a stack of callbacks that get called after all the callbacks for
2320  * an event have triggered (all the objects it triggers on and all the callbacks
2321  * in each object triggered). When all these have been called, the stack is
2322  * unwond from most recently to least recently pushed item and removed from the
2323  * stack calling the callback set for it.
2324  *
2325  * This is intended for doing reverse logic-like processing, example - when a
2326  * child object that happens to get the event later is meant to be able to
2327  * "steal" functions from a parent and thus on unwind of this stack have its
2328  * function called first, thus being able to set flags, or return 0 from the
2329  * post-callback that stops all other post-callbacks in the current stack from
2330  * being called (thus basically allowing a child to take control, if the event
2331  * callback prepares information ready for taking action, but the post callback
2332  * actually does the action).
2333  *
2334  */
2335 EAPI void              evas_post_event_callback_push        (Evas *e, Evas_Object_Event_Post_Cb func, const void *data);
2336
2337 /**
2338  * Remove a callback from the post-event callback stack
2339  *
2340  * @param e Canvas to push the callback on
2341  * @param func The function that to be called when the stack is unwound
2342  *
2343  * This removes a callback from the stack added with
2344  * evas_post_event_callback_push(). The first instance of the function in
2345  * the callback stack is removed from being executed when the stack is
2346  * unwound. Further instances may still be run on unwind.
2347  */
2348 EAPI void              evas_post_event_callback_remove      (Evas *e, Evas_Object_Event_Post_Cb func);
2349
2350 /**
2351  * Remove a callback from the post-event callback stack
2352  *
2353  * @param e Canvas to push the callback on
2354  * @param func The function that to be called when the stack is unwound
2355  * @param data The data pointer to be passed to the callback
2356  *
2357  * This removes a callback from the stack added with
2358  * evas_post_event_callback_push(). The first instance of the function and data
2359  * in the callback stack is removed from being executed when the stack is
2360  * unwound. Further instances may still be run on unwind.
2361  */
2362 EAPI void              evas_post_event_callback_remove_full (Evas *e, Evas_Object_Event_Post_Cb func, const void *data);
2363
2364 /**
2365  * @defgroup Evas_Event_Freezing_Group Input Events Freezing Functions
2366  *
2367  * Functions that deal with the freezing of input event processing of
2368  * an Evas canvas.
2369  *
2370  * There might be scenarios during a graphical user interface
2371  * program's use when the developer wishes the users wouldn't be able
2372  * to deliver input events to this application. It may, for example,
2373  * be the time for it to populate a view or to change some
2374  * layout. Assuming proper behavior with user interaction during this
2375  * exact time would be hard, as things are in a changing state. The
2376  * programmer can then tell the canvas to ignore input events,
2377  * bringing it back to normal behavior when he/she wants.
2378  *
2379  * Most of the time use of freezing events is done like this:
2380  * @code
2381  * evas_event_freeze(my_evas_canvas);
2382  * function_that_does_work_which_cant_be_interrupted_by_events();
2383  * evas_event_thaw(my_evas_canvas);
2384  * @endcode
2385  *
2386  * Some of the functions in this group are exemplified @ref
2387  * Example_Evas_Events "here".
2388  *
2389  * @ingroup Evas_Canvas_Events
2390  */
2391
2392 /**
2393  * @addtogroup Evas_Event_Freezing_Group
2394  * @{
2395  */
2396
2397 /**
2398  * Set the default set of flags an event begins with
2399  * 
2400  * @param e The canvas to set the default event flags of
2401  * @param flags The default flags to use
2402  * 
2403  * Events in evas can have an event_flags member. This starts out with
2404  * and initial value (no flags). this lets you set the default flags that
2405  * an event begins with to be @p flags
2406  * 
2407  * @since 1.2
2408  */
2409 EAPI void              evas_event_default_flags_set      (Evas *e, Evas_Event_Flags flags) EINA_ARG_NONNULL(1);
2410
2411 /**
2412  * Get the defaulty set of flags an event begins with
2413  * 
2414  * @param e The canvas to get the default event flags from
2415  * @return The default event flags for that canvas
2416  * 
2417  * This gets the default event flags events are produced with when fed in.
2418  * 
2419  * @see evas_event_default_flags_set()
2420  * @since 1.2
2421  */
2422 EAPI Evas_Event_Flags  evas_event_default_flags_get      (const Evas *e) EINA_ARG_NONNULL(1);
2423
2424 /**
2425  * Freeze all input events processing.
2426  *
2427  * @param e The canvas to freeze input events processing on.
2428  *
2429  * This function will indicate to Evas that the canvas @p e is to have
2430  * all input event processing frozen until a matching
2431  * evas_event_thaw() function is called on the same canvas. All events
2432  * of this kind during the freeze will get @b discarded. Every freeze
2433  * call must be matched by a thaw call in order to completely thaw out
2434  * a canvas (i.e. these calls may be nested). The most common use is
2435  * when you don't want the user to interact with your user interface
2436  * when you're populating a view or changing the layout.
2437  *
2438  * Example:
2439  * @dontinclude evas-events.c
2440  * @skip freeze input for 3 seconds
2441  * @until }
2442  * @dontinclude evas-events.c
2443  * @skip let's have our events back
2444  * @until }
2445  *
2446  * See the full @ref Example_Evas_Events "example".
2447  *
2448  * If you run that example, you'll see the canvas ignoring all input
2449  * events for 3 seconds, when the "f" key is pressed. In a more
2450  * realistic code we would be freezing while a toolkit or Edje was
2451  * doing some UI changes, thawing it back afterwards.
2452  */
2453 EAPI void              evas_event_freeze                 (Evas *e) EINA_ARG_NONNULL(1);
2454
2455 /**
2456  * Thaw a canvas out after freezing (for input events).
2457  *
2458  * @param e The canvas to thaw out.
2459  *
2460  * This will thaw out a canvas after a matching evas_event_freeze()
2461  * call. If this call completely thaws out a canvas, i.e., there's no
2462  * other unbalanced call to evas_event_freeze(), events will start to
2463  * be processed again, but any "missed" events will @b not be
2464  * evaluated.
2465  *
2466  * See evas_event_freeze() for an example.
2467  */
2468 EAPI void              evas_event_thaw                   (Evas *e) EINA_ARG_NONNULL(1);
2469
2470 /**
2471  * Return the freeze count on input events of a given canvas.
2472  *
2473  * @param e The canvas to fetch the freeze count from.
2474  *
2475  * This returns the number of times the canvas has been told to freeze
2476  * input events. It is possible to call evas_event_freeze() multiple
2477  * times, and these must be matched by evas_event_thaw() calls. This
2478  * call allows the program to discover just how many times things have
2479  * been frozen in case it may want to break out of a deep freeze state
2480  * where the count is high.
2481  *
2482  * Example:
2483  * @code
2484  * extern Evas *evas;
2485  *
2486  * while (evas_event_freeze_get(evas) > 0) evas_event_thaw(evas);
2487  * @endcode
2488  *
2489  */
2490 EAPI int               evas_event_freeze_get             (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
2491
2492 /**
2493  * After thaw of a canvas, re-evaluate the state of objects and call callbacks
2494  *
2495  * @param e The canvas to evaluate after a thaw
2496  *
2497  * This is normally called after evas_event_thaw() to re-evaluate mouse
2498  * containment and other states and thus also call callbacks for mouse in and
2499  * out on new objects if the state change demands it.
2500  */
2501 EAPI void              evas_event_thaw_eval              (Evas *e) EINA_ARG_NONNULL(1);
2502
2503 /**
2504  * @}
2505  */
2506
2507 /**
2508  * @defgroup Evas_Event_Feeding_Group Input Events Feeding Functions
2509  *
2510  * Functions to tell Evas that input events happened and should be
2511  * processed.
2512  *
2513  * @warning Most of the time these functions are @b not what you're looking for.
2514  * These functions should only be used if you're not working with ecore evas(or
2515  * another input handling system). If you're not using ecore evas please
2516  * consider using it, in most situation it will make life a lot easier.
2517  *
2518  * As explained in @ref intro_not_evas, Evas does not know how to poll
2519  * for input events, so the developer should do it and then feed such
2520  * events to the canvas to be processed. This is only required if
2521  * operating Evas directly. Modules such as Ecore_Evas do that for
2522  * you.
2523  *
2524  * Some of the functions in this group are exemplified @ref
2525  * Example_Evas_Events "here".
2526  *
2527  * @ingroup Evas_Canvas_Events
2528  */
2529
2530 /**
2531  * @addtogroup Evas_Event_Feeding_Group
2532  * @{
2533  */
2534
2535 /**
2536  * Get the number of mouse or multi presses currently active
2537  *
2538  * @p e The given canvas pointer.
2539  * @return The numer of presses (0 if none active).
2540  *
2541  * @since 1.2
2542  */
2543 EAPI int               evas_event_down_count_get         (const Evas *e) EINA_ARG_NONNULL(1);
2544
2545 /**
2546  * Mouse down event feed.
2547  *
2548  * @param e The given canvas pointer.
2549  * @param b The button number.
2550  * @param flags The evas button flags.
2551  * @param timestamp The timestamp of the mouse down event.
2552  * @param data The data for canvas.
2553  *
2554  * This function will set some evas properties that is necessary when
2555  * the mouse button is pressed. It prepares information to be treated
2556  * by the callback function.
2557  *
2558  */
2559 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);
2560
2561 /**
2562  * Mouse up event feed.
2563  *
2564  * @param e The given canvas pointer.
2565  * @param b The button number.
2566  * @param flags evas button flags.
2567  * @param timestamp The timestamp of the mouse up event.
2568  * @param data The data for canvas.
2569  *
2570  * This function will set some evas properties that is necessary when
2571  * the mouse button is released. It prepares information to be treated
2572  * by the callback function.
2573  *
2574  */
2575 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);
2576
2577 /**
2578  * Mouse move event feed.
2579  *
2580  * @param e The given canvas pointer.
2581  * @param x The horizontal position of the mouse pointer.
2582  * @param y The vertical position of the mouse pointer.
2583  * @param timestamp The timestamp of the mouse up event.
2584  * @param data The data for canvas.
2585  *
2586  * This function will set some evas properties that is necessary when
2587  * the mouse is moved from its last position. It prepares information
2588  * to be treated by the callback function.
2589  *
2590  */
2591 EAPI void              evas_event_feed_mouse_move        (Evas *e, int x, int y, unsigned int timestamp, const void *data) EINA_ARG_NONNULL(1);
2592
2593 /**
2594  * Mouse in event feed.
2595  *
2596  * @param e The given canvas pointer.
2597  * @param timestamp The timestamp of the mouse up event.
2598  * @param data The data for canvas.
2599  *
2600  * This function will set some evas properties that is necessary when
2601  * the mouse in event happens. It prepares information to be treated
2602  * by the callback function.
2603  *
2604  */
2605 EAPI void              evas_event_feed_mouse_in          (Evas *e, unsigned int timestamp, const void *data) EINA_ARG_NONNULL(1);
2606
2607 /**
2608  * Mouse out event feed.
2609  *
2610  * @param e The given canvas pointer.
2611  * @param timestamp Timestamp of the mouse up event.
2612  * @param data The data for canvas.
2613  *
2614  * This function will set some evas properties that is necessary when
2615  * the mouse out event happens. It prepares information to be treated
2616  * by the callback function.
2617  *
2618  */
2619 EAPI void              evas_event_feed_mouse_out         (Evas *e, unsigned int timestamp, const void *data) EINA_ARG_NONNULL(1);
2620    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);
2621    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);
2622    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);
2623
2624 /**
2625  * Mouse cancel event feed.
2626  *
2627  * @param e The given canvas pointer.
2628  * @param timestamp The timestamp of the mouse up event.
2629  * @param data The data for canvas.
2630  *
2631  * This function will call evas_event_feed_mouse_up() when a
2632  * mouse cancel event happens.
2633  *
2634  */
2635 EAPI void              evas_event_feed_mouse_cancel      (Evas *e, unsigned int timestamp, const void *data) EINA_ARG_NONNULL(1);
2636
2637 /**
2638  * Mouse wheel event feed.
2639  *
2640  * @param e The given canvas pointer.
2641  * @param direction The wheel mouse direction.
2642  * @param z How much mouse wheel was scrolled up or down.
2643  * @param timestamp The timestamp of the mouse up event.
2644  * @param data The data for canvas.
2645  *
2646  * This function will set some evas properties that is necessary when
2647  * the mouse wheel is scrolled up or down. It prepares information to
2648  * be treated by the callback function.
2649  *
2650  */
2651 EAPI void              evas_event_feed_mouse_wheel       (Evas *e, int direction, int z, unsigned int timestamp, const void *data) EINA_ARG_NONNULL(1);
2652
2653 /**
2654  * Key down event feed
2655  *
2656  * @param e The canvas to thaw out
2657  * @param keyname  Name of the key
2658  * @param key The key pressed.
2659  * @param string A String
2660  * @param compose The compose string
2661  * @param timestamp Timestamp of the mouse up event
2662  * @param data Data for canvas.
2663  *
2664  * This function will set some evas properties that is necessary when
2665  * a key is pressed. It prepares information to be treated by the
2666  * callback function.
2667  *
2668  */
2669 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);
2670
2671 /**
2672  * Key up event feed
2673  *
2674  * @param e The canvas to thaw out
2675  * @param keyname  Name of the key
2676  * @param key The key released.
2677  * @param string string
2678  * @param compose compose
2679  * @param timestamp Timestamp of the mouse up event
2680  * @param data Data for canvas.
2681  *
2682  * This function will set some evas properties that is necessary when
2683  * a key is released. It prepares information to be treated by the
2684  * callback function.
2685  *
2686  */
2687 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);
2688
2689 /**
2690  * Hold event feed
2691  *
2692  * @param e The given canvas pointer.
2693  * @param hold The hold.
2694  * @param timestamp The timestamp of the mouse up event.
2695  * @param data The data for canvas.
2696  *
2697  * This function makes the object to stop sending events.
2698  *
2699  */
2700 EAPI void              evas_event_feed_hold              (Evas *e, int hold, unsigned int timestamp, const void *data) EINA_ARG_NONNULL(1);
2701
2702 /**
2703  * Re feed event.
2704  *
2705  * @param e The given canvas pointer.
2706  * @param event_copy the event to refeed
2707  * @param event_type Event type
2708  *
2709  * This function re-feeds the event pointed by event_copy
2710  *
2711  * This function call evas_event_feed_* functions, so it can
2712  * cause havoc if not used wisely. Please use it responsibly.
2713  */
2714 EAPI void              evas_event_refeed_event           (Evas *e, void *event_copy, Evas_Callback_Type event_type) EINA_ARG_NONNULL(1);
2715
2716
2717 /**
2718  * @}
2719  */
2720
2721 /**
2722  * @}
2723  */
2724
2725 /**
2726  * @defgroup Evas_Image_Group Image Functions
2727  *
2728  * Functions that deals with images at canvas level.
2729  *
2730  * @ingroup Evas_Canvas
2731  */
2732
2733 /**
2734  * @addtogroup Evas_Image_Group
2735  * @{
2736  */
2737
2738 /**
2739  * Flush the image cache of the canvas.
2740  *
2741  * @param e The given evas pointer.
2742  *
2743  * This function flushes image cache of canvas.
2744  *
2745  */
2746 EAPI void              evas_image_cache_flush            (Evas *e) EINA_ARG_NONNULL(1);
2747
2748 /**
2749  * Reload the image cache
2750  *
2751  * @param e The given evas pointer.
2752  *
2753  * This function reloads the image cache of canvas.
2754  *
2755  */
2756 EAPI void              evas_image_cache_reload           (Evas *e) EINA_ARG_NONNULL(1);
2757
2758 /**
2759  * Set the image cache.
2760  *
2761  * @param e The given evas pointer.
2762  * @param size The cache size.
2763  *
2764  * This function sets the image cache of canvas in bytes.
2765  *
2766  */
2767 EAPI void              evas_image_cache_set              (Evas *e, int size) EINA_ARG_NONNULL(1);
2768
2769 /**
2770  * Get the image cache
2771  *
2772  * @param e The given evas pointer.
2773  *
2774  * This function returns the image cache size of canvas in bytes.
2775  *
2776  */
2777 EAPI int               evas_image_cache_get              (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
2778
2779 /**
2780  * Get the maximum image size evas can possibly handle
2781  *
2782  * @param e The given evas pointer.
2783  * @param maxw Pointer to hold the return value in pixels of the maxumum width
2784  * @param maxh Pointer to hold the return value in pixels of the maximum height
2785  *
2786  * This function returns the larges image or surface size that evas can handle
2787  * in pixels, and if there is one, returns @c EINA_TRUE. It returns 
2788  * @c EINA_FALSE if no extra constraint on maximum image size exists. You still
2789  * should check the return values of @p maxw and @p maxh as there may still be
2790  * a limit, just a much higher one.
2791  *
2792  * @since 1.1
2793  */
2794 EAPI Eina_Bool         evas_image_max_size_get           (const Evas *e, int *maxw, int *maxh) EINA_ARG_NONNULL(1);
2795
2796 /**
2797  * @}
2798  */
2799
2800 /**
2801  * @defgroup Evas_Font_Group Font Functions
2802  *
2803  * Functions that deals with fonts.
2804  *
2805  * @ingroup Evas_Canvas
2806  */
2807
2808 /**
2809  * Changes the font hinting for the given evas.
2810  *
2811  * @param e The given evas.
2812  * @param hinting The hinting to use, one of #EVAS_FONT_HINTING_NONE,
2813  *        #EVAS_FONT_HINTING_AUTO, #EVAS_FONT_HINTING_BYTECODE.
2814  * @ingroup Evas_Font_Group
2815  */
2816 EAPI void                     evas_font_hinting_set        (Evas *e, Evas_Font_Hinting_Flags hinting) EINA_ARG_NONNULL(1);
2817
2818 /**
2819  * Retrieves the font hinting used by the given evas.
2820  *
2821  * @param e The given evas to query.
2822  * @return The hinting in use, one of #EVAS_FONT_HINTING_NONE,
2823  *         #EVAS_FONT_HINTING_AUTO, #EVAS_FONT_HINTING_BYTECODE.
2824  * @ingroup Evas_Font_Group
2825  */
2826 EAPI Evas_Font_Hinting_Flags  evas_font_hinting_get        (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
2827
2828 /**
2829  * Checks if the font hinting is supported by the given evas.
2830  *
2831  * @param e The given evas to query.
2832  * @param hinting The hinting to use, one of #EVAS_FONT_HINTING_NONE,
2833  *        #EVAS_FONT_HINTING_AUTO, #EVAS_FONT_HINTING_BYTECODE.
2834  * @return @c EINA_TRUE if it is supported, @c EINA_FALSE otherwise.
2835  * @ingroup Evas_Font_Group
2836  */
2837 EAPI Eina_Bool                evas_font_hinting_can_hint   (const Evas *e, Evas_Font_Hinting_Flags hinting) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
2838
2839
2840 /**
2841  * Force the given evas and associated engine to flush its font cache.
2842  *
2843  * @param e The given evas to flush font cache.
2844  * @ingroup Evas_Font_Group
2845  */
2846 EAPI void                     evas_font_cache_flush        (Evas *e) EINA_ARG_NONNULL(1);
2847
2848 /**
2849  * Changes the size of font cache of the given evas.
2850  *
2851  * @param e The given evas to flush font cache.
2852  * @param size The size, in bytes.
2853  *
2854  * @ingroup Evas_Font_Group
2855  */
2856 EAPI void                     evas_font_cache_set          (Evas *e, int size) EINA_ARG_NONNULL(1);
2857
2858 /**
2859  * Changes the size of font cache of the given evas.
2860  *
2861  * @param e The given evas to flush font cache.
2862  * @return The size, in bytes.
2863  *
2864  * @ingroup Evas_Font_Group
2865  */
2866 EAPI int                      evas_font_cache_get          (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
2867
2868
2869 /**
2870  * List of available font descriptions known or found by this evas.
2871  *
2872  * The list depends on Evas compile time configuration, such as
2873  * fontconfig support, and the paths provided at runtime as explained
2874  * in @ref Evas_Font_Path_Group.
2875  *
2876  * @param e The evas instance to query.
2877  * @return a newly allocated list of strings. Do not change the
2878  *         strings.  Be sure to call evas_font_available_list_free()
2879  *         after you're done.
2880  *
2881  * @ingroup Evas_Font_Group
2882  */
2883 EAPI Eina_List               *evas_font_available_list     (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
2884
2885 /**
2886  * Free list of font descriptions returned by evas_font_dir_available_list().
2887  *
2888  * @param e The evas instance that returned such list.
2889  * @param available the list returned by evas_font_dir_available_list().
2890  *
2891  * @ingroup Evas_Font_Group
2892  */
2893 EAPI void                     evas_font_available_list_free(Evas *e, Eina_List *available) EINA_ARG_NONNULL(1);
2894
2895 /**
2896  * @defgroup Evas_Font_Path_Group Font Path Functions
2897  *
2898  * Functions that edit the paths being used to load fonts.
2899  *
2900  * @ingroup Evas_Font_Group
2901  */
2902
2903 /**
2904  * Removes all font paths loaded into memory for the given evas.
2905  * @param   e The given evas.
2906  * @ingroup Evas_Font_Path_Group
2907  */
2908 EAPI void              evas_font_path_clear              (Evas *e) EINA_ARG_NONNULL(1);
2909
2910 /**
2911  * Appends a font path to the list of font paths used by the given evas.
2912  * @param   e    The given evas.
2913  * @param   path The new font path.
2914  * @ingroup Evas_Font_Path_Group
2915  */
2916 EAPI void              evas_font_path_append             (Evas *e, const char *path) EINA_ARG_NONNULL(1, 2);
2917
2918 /**
2919  * Prepends a font path to the list of font paths used by the given evas.
2920  * @param   e The given evas.
2921  * @param   path The new font path.
2922  * @ingroup Evas_Font_Path_Group
2923  */
2924 EAPI void              evas_font_path_prepend            (Evas *e, const char *path) EINA_ARG_NONNULL(1, 2);
2925
2926 /**
2927  * Retrieves the list of font paths used by the given evas.
2928  * @param   e The given evas.
2929  * @return  The list of font paths used.
2930  * @ingroup Evas_Font_Path_Group
2931  */
2932 EAPI const Eina_List  *evas_font_path_list               (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
2933
2934 /**
2935  * @defgroup Evas_Object_Group Generic Object Functions
2936  *
2937  * Functions that manipulate generic Evas objects.
2938  *
2939  * All Evas displaying units are Evas objects. One handles them all by
2940  * means of the handle ::Evas_Object. Besides Evas treats their
2941  * objects equally, they have @b types, which define their specific
2942  * behavior (and individual API).
2943  *
2944  * Evas comes with a set of built-in object types:
2945  *   - rectangle,
2946  *   - line,
2947  *   - polygon,
2948  *   - text,
2949  *   - textblock and
2950  *   - image.
2951  *
2952  * These functions apply to @b any Evas object, whichever type that
2953  * may have.
2954  *
2955  * @note The built-in types which are most used are rectangles, text
2956  * and images. In fact, with these ones one can create 2D interfaces
2957  * of arbitrary complexity and EFL makes it easy.
2958  */
2959
2960 /**
2961  * @defgroup Evas_Object_Group_Basic Basic Object Manipulation
2962  *
2963  * Almost every evas object created will have some generic function used to
2964  * manipulate it. That's because there are a number of basic actions to be done
2965  * to objects that are irrespective of the object's type, things like:
2966  * @li Showing/Hiding
2967  * @li Setting(and getting) geometry
2968  * @li Bring up or down a layer
2969  * @li Color management
2970  * @li Handling focus
2971  * @li Clipping
2972  * @li Reference counting
2973  *
2974  * All of this issues are handled through the functions here grouped. Examples
2975  * of these function can be seen in @ref Example_Evas_Object_Manipulation(which
2976  * deals with the most common ones) and in @ref Example_Evas_Stacking(which
2977  * deals with stacking functions).
2978  *
2979  * @ingroup Evas_Object_Group
2980  */
2981
2982 /**
2983  * @addtogroup Evas_Object_Group_Basic
2984  * @{
2985  */
2986
2987 /**
2988  * Clip one object to another.
2989  *
2990  * @param obj The object to be clipped
2991  * @param clip The object to clip @p obj by
2992  *
2993  * This function will clip the object @p obj to the area occupied by
2994  * the object @p clip. This means the object @p obj will only be
2995  * visible within the area occupied by the clipping object (@p clip).
2996  *
2997  * The color of the object being clipped will be multiplied by the
2998  * color of the clipping one, so the resulting color for the former
2999  * will be <code>RESULT = (OBJ * CLIP) / (255 * 255)</code>, per color
3000  * element (red, green, blue and alpha).
3001  *
3002  * Clipping is recursive, so clipping objects may be clipped by
3003  * others, and their color will in term be multiplied. You may @b not
3004  * set up circular clipping lists (i.e. object 1 clips object 2, which
3005  * clips object 1): the behavior of Evas is undefined in this case.
3006  *
3007  * Objects which do not clip others are visible in the canvas as
3008  * normal; <b>those that clip one or more objects become invisible
3009  * themselves</b>, only affecting what they clip. If an object ceases
3010  * to have other objects being clipped by it, it will become visible
3011  * again.
3012  *
3013  * The visibility of an object affects the objects that are clipped by
3014  * it, so if the object clipping others is not shown (as in
3015  * evas_object_show()), the objects clipped by it will not be shown
3016  * either.
3017  *
3018  * If @p obj was being clipped by another object when this function is
3019  * called, it gets implicitly removed from the old clipper's domain
3020  * and is made now to be clipped by its new clipper.
3021  *
3022  * The following figure illustrates some clipping in Evas:
3023  *
3024  * @image html clipping.png
3025  * @image rtf clipping.png
3026  * @image latex clipping.eps
3027  *
3028  * @note At the moment the <b>only objects that can validly be used to
3029  * clip other objects are rectangle objects</b>. All other object
3030  * types are invalid and the result of using them is undefined. The
3031  * clip object @p clip must be a valid object, but can also be @c
3032  * NULL, in which case the effect of this function is the same as
3033  * calling evas_object_clip_unset() on the @p obj object.
3034  *
3035  * Example:
3036  * @dontinclude evas-object-manipulation.c
3037  * @skip solid white clipper (note that it's the default color for a
3038  * @until evas_object_show(d.clipper);
3039  *
3040  * See the full @ref Example_Evas_Object_Manipulation "example".
3041  */
3042 EAPI void              evas_object_clip_set              (Evas_Object *obj, Evas_Object *clip) EINA_ARG_NONNULL(1, 2);
3043
3044 /**
3045  * Get the object clipping @p obj (if any).
3046  *
3047  * @param obj The object to get the clipper from
3048  *
3049  * This function returns the object clipping @p obj. If @p obj is
3050  * not being clipped at all, @c NULL is returned. The object @p obj
3051  * must be a valid ::Evas_Object.
3052  *
3053  * See also evas_object_clip_set(), evas_object_clip_unset() and
3054  * evas_object_clipees_get().
3055  *
3056  * Example:
3057  * @dontinclude evas-object-manipulation.c
3058  * @skip if (evas_object_clip_get(d.img) == d.clipper)
3059  * @until return
3060  *
3061  * See the full @ref Example_Evas_Object_Manipulation "example".
3062  */
3063 EAPI Evas_Object      *evas_object_clip_get              (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
3064
3065 /**
3066  * Disable/cease clipping on a clipped @p obj object.
3067  *
3068  * @param obj The object to cease clipping on
3069  *
3070  * This function disables clipping for the object @p obj, if it was
3071  * already clipped, i.e., its visibility and color get detached from
3072  * the previous clipper. If it wasn't, this has no effect. The object
3073  * @p obj must be a valid ::Evas_Object.
3074  *
3075  * See also evas_object_clip_set() (for an example),
3076  * evas_object_clipees_get() and evas_object_clip_get().
3077  *
3078  */
3079 EAPI void              evas_object_clip_unset            (Evas_Object *obj);
3080
3081 /**
3082  * Return a list of objects currently clipped by @p obj.
3083  *
3084  * @param obj The object to get a list of clippees from
3085  * @return a list of objects being clipped by @p obj
3086  *
3087  * This returns the internal list handle that contains all objects
3088  * clipped by the object @p obj. If none are clipped by it, the call
3089  * returns @c NULL. This list is only valid until the clip list is
3090  * changed and should be fetched again with another call to
3091  * evas_object_clipees_get() if any objects being clipped by this
3092  * object are unclipped, clipped by a new object, deleted or get the
3093  * clipper deleted. These operations will invalidate the list
3094  * returned, so it should not be used anymore after that point. Any
3095  * use of the list after this may have undefined results, possibly
3096  * leading to crashes. The object @p obj must be a valid
3097  * ::Evas_Object.
3098  *
3099  * See also evas_object_clip_set(), evas_object_clip_unset() and
3100  * evas_object_clip_get().
3101  *
3102  * Example:
3103  * @code
3104  * extern Evas_Object *obj;
3105  * Evas_Object *clipper;
3106  *
3107  * clipper = evas_object_clip_get(obj);
3108  * if (clipper)
3109  *   {
3110  *     Eina_List *clippees, *l;
3111  *     Evas_Object *obj_tmp;
3112  *
3113  *     clippees = evas_object_clipees_get(clipper);
3114  *     printf("Clipper clips %i objects\n", eina_list_count(clippees));
3115  *     EINA_LIST_FOREACH(clippees, l, obj_tmp)
3116  *         evas_object_show(obj_tmp);
3117  *   }
3118  * @endcode
3119  */
3120 EAPI const Eina_List  *evas_object_clipees_get           (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
3121
3122
3123 /**
3124  * Sets or unsets a given object as the currently focused one on its
3125  * canvas.
3126  *
3127  * @param obj The object to be focused or unfocused.
3128  * @param focus @c EINA_TRUE, to set it as focused or @c EINA_FALSE,
3129  * to take away the focus from it.
3130  *
3131  * Changing focus only affects where (key) input events go. There can
3132  * be only one object focused at any time. If @p focus is @c EINA_TRUE,
3133  * @p obj will be set as the currently focused object and it will 
3134  * receive all keyboard events that are not exclusive key grabs on 
3135  * other objects.
3136  *
3137  * Example:
3138  * @dontinclude evas-events.c
3139  * @skip evas_object_focus_set
3140  * @until evas_object_focus_set
3141  *
3142  * See the full example @ref Example_Evas_Events "here".
3143  *
3144  * @see evas_object_focus_get
3145  * @see evas_focus_get
3146  * @see evas_object_key_grab
3147  * @see evas_object_key_ungrab
3148  */
3149 EAPI void              evas_object_focus_set             (Evas_Object *obj, Eina_Bool focus) EINA_ARG_NONNULL(1);
3150
3151 /**
3152  * Retrieve whether an object has the focus.
3153  *
3154  * @param obj The object to retrieve focus information from.
3155  * @return @c EINA_TRUE if the object has the focus, @c EINA_FALSE otherwise.
3156  *
3157  * If the passed object is the currently focused one, @c EINA_TRUE is
3158  * returned. @c EINA_FALSE is returned, otherwise.
3159  *
3160  * Example:
3161  * @dontinclude evas-events.c
3162  * @skip And again
3163  * @until something is bad
3164  *
3165  * See the full example @ref Example_Evas_Events "here".
3166  *
3167  * @see evas_object_focus_set
3168  * @see evas_focus_get
3169  * @see evas_object_key_grab
3170  * @see evas_object_key_ungrab
3171  */
3172 EAPI Eina_Bool         evas_object_focus_get             (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
3173
3174
3175 /**
3176  * Sets the layer of the its canvas that the given object will be part
3177  * of.
3178  *
3179  * @param   obj The given Evas object.
3180  * @param   l   The number of the layer to place the object on.
3181  *          Must be between #EVAS_LAYER_MIN and #EVAS_LAYER_MAX.
3182  *
3183  * If you don't use this function, you'll be dealing with an @b unique
3184  * layer of objects, the default one. Additional layers are handy when
3185  * you don't want a set of objects to interfere with another set with
3186  * regard to @b stacking. Two layers are completely disjoint in that
3187  * matter.
3188  *
3189  * This is a low-level function, which you'd be using when something
3190  * should be always on top, for example.
3191  *
3192  * @warning Be careful, it doesn't make sense to change the layer of
3193  * smart objects' children. Smart objects have a layer of their own,
3194  * which should contain all their children objects.
3195  *
3196  * @see evas_object_layer_get()
3197  */
3198 EAPI void              evas_object_layer_set             (Evas_Object *obj, short l) EINA_ARG_NONNULL(1);
3199
3200 /**
3201  * Retrieves the layer of its canvas that the given object is part of.
3202  *
3203  * @param   obj The given Evas object to query layer from
3204  * @return  Number of the its layer
3205  *
3206  * @see evas_object_layer_set()
3207  */
3208 EAPI short             evas_object_layer_get             (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
3209
3210
3211 /**
3212  * Sets the name of the given Evas object to the given name.
3213  *
3214  * @param   obj  The given object.
3215  * @param   name The given name.
3216  *
3217  * There might be occasions where one would like to name his/her
3218  * objects.
3219  *
3220  * Example:
3221  * @dontinclude evas-events.c
3222  * @skip d.bg = evas_object_rectangle_add(d.canvas);
3223  * @until evas_object_name_set(d.bg, "our dear rectangle");
3224  *
3225  * See the full @ref Example_Evas_Events "example".
3226  */
3227 EAPI void              evas_object_name_set              (Evas_Object *obj, const char *name) EINA_ARG_NONNULL(1);
3228
3229 /**
3230  * Retrieves the name of the given Evas object.
3231  *
3232  * @param   obj The given object.
3233  * @return  The name of the object or @c NULL, if no name has been given
3234  *          to it.
3235  *
3236  * Example:
3237  * @dontinclude evas-events.c
3238  * @skip fprintf(stdout, "An object got focused: %s\n",
3239  * @until evas_focus_get
3240  *
3241  * See the full @ref Example_Evas_Events "example".
3242  */
3243 EAPI const char       *evas_object_name_get              (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
3244
3245
3246 /**
3247  * Increments object reference count to defer its deletion.
3248  *
3249  * @param obj The given Evas object to reference
3250  *
3251  * This increments the reference count of an object, which if greater
3252  * than 0 will defer deletion by evas_object_del() until all
3253  * references are released back (counter back to 0). References cannot
3254  * go below 0 and unreferencing past that will result in the reference
3255  * count being limited to 0. References are limited to <c>2^32 - 1</c>
3256  * for an object. Referencing it more than this will result in it
3257  * being limited to this value.
3258  *
3259  * @see evas_object_unref()
3260  * @see evas_object_del()
3261  *
3262  * @note This is a <b>very simple</b> reference counting mechanism! For
3263  * instance, Evas is not ready to check for pending references on a
3264  * canvas deletion, or things like that. This is useful on scenarios
3265  * where, inside a code block, callbacks exist which would possibly
3266  * delete an object we are operating on afterwards. Then, one would
3267  * evas_object_ref() it on the beginning of the block and
3268  * evas_object_unref() it on the end. It would then be deleted at this
3269  * point, if it should be.
3270  *
3271  * Example:
3272  * @code
3273  *  evas_object_ref(obj);
3274  *
3275  *  // action here...
3276  *  evas_object_smart_callback_call(obj, SIG_SELECTED, NULL);
3277  *  // more action here...
3278  *  evas_object_unref(obj);
3279  * @endcode
3280  *
3281  * @ingroup Evas_Object_Group_Basic
3282  * @since 1.1.0
3283  */
3284 EAPI void              evas_object_ref                   (Evas_Object *obj);
3285
3286 /**
3287  * Decrements object reference count.
3288  *
3289  * @param obj The given Evas object to unreference
3290  *
3291  * This decrements the reference count of an object. If the object has
3292  * had evas_object_del() called on it while references were more than
3293  * 0, it will be deleted at the time this function is called and puts
3294  * the counter back to 0. See evas_object_ref() for more information.
3295  *
3296  * @see evas_object_ref() (for an example)
3297  * @see evas_object_del()
3298  *
3299  * @ingroup Evas_Object_Group_Basic
3300  * @since 1.1.0
3301  */
3302 EAPI void              evas_object_unref                 (Evas_Object *obj);
3303
3304 /**
3305  * Get the object reference count.
3306  *
3307  * @param obj The given Evas object to query
3308  *
3309  * This gets the reference count for an object (normally 0 until it is
3310  * referenced). Values of 1 or greater mean that someone is holding a
3311  * reference to this object that needs to be unreffed before it can be
3312  * deleted.
3313  *
3314  * @see evas_object_ref()
3315  * @see evas_object_unref()
3316  * @see evas_object_del()
3317  *
3318  * @ingroup Evas_Object_Group_Basic
3319  * @since 1.2.0
3320  */
3321 EAPI int               evas_object_ref_get               (const Evas_Object *obj);
3322
3323
3324 /**
3325  * Marks the given Evas object for deletion (when Evas will free its
3326  * memory).
3327  *
3328  * @param obj The given Evas object.
3329  *
3330  * This call will mark @p obj for deletion, which will take place
3331  * whenever it has no more references to it (see evas_object_ref() and
3332  * evas_object_unref()).
3333  *
3334  * At actual deletion time, which may or may not be just after this
3335  * call, ::EVAS_CALLBACK_DEL and ::EVAS_CALLBACK_FREE callbacks will
3336  * be called. If the object currently had the focus, its
3337  * ::EVAS_CALLBACK_FOCUS_OUT callback will also be called.
3338  *
3339  * @see evas_object_ref()
3340  * @see evas_object_unref()
3341  *
3342  * @ingroup Evas_Object_Group_Basic
3343  */
3344 EAPI void              evas_object_del                   (Evas_Object *obj) EINA_ARG_NONNULL(1);
3345
3346 /**
3347  * Move the given Evas object to the given location inside its
3348  * canvas' viewport.
3349  *
3350  * @param obj The given Evas object.
3351  * @param x   X position to move the object to, in canvas units.
3352  * @param y   Y position to move the object to, in canvas units.
3353  *
3354  * Besides being moved, the object's ::EVAS_CALLBACK_MOVE callback
3355  * will be called.
3356  *
3357  * @note Naturally, newly created objects are placed at the canvas'
3358  * origin: <code>0, 0</code>.
3359  *
3360  * Example:
3361  * @dontinclude evas-object-manipulation.c
3362  * @skip evas_object_image_border_set(d.clipper_border, 3, 3, 3, 3);
3363  * @until evas_object_show
3364  *
3365  * See the full @ref Example_Evas_Object_Manipulation "example".
3366  *
3367  * @ingroup Evas_Object_Group_Basic
3368  */
3369 EAPI void              evas_object_move                  (Evas_Object *obj, Evas_Coord x, Evas_Coord y) EINA_ARG_NONNULL(1);
3370
3371 /**
3372  * Changes the size of the given Evas object.
3373  *
3374  * @param obj The given Evas object.
3375  * @param w   The new width of the Evas object.
3376  * @param h   The new height of the Evas object.
3377  *
3378  * Besides being resized, the object's ::EVAS_CALLBACK_RESIZE callback
3379  * will be called.
3380  *
3381  * @note Newly created objects have zeroed dimensions. Then, you most
3382  * probably want to use evas_object_resize() on them after they are
3383  * created.
3384  *
3385  * @note Be aware that resizing an object changes its drawing area,
3386  * but that does imply the object is rescaled! For instance, images
3387  * are filled inside their drawing area using the specifications of
3388  * evas_object_image_fill_set(). Thus to scale the image to match
3389  * exactly your drawing area, you need to change the
3390  * evas_object_image_fill_set() as well.
3391  *
3392  * @note This is more evident in images, but text, textblock, lines
3393  * and polygons will behave similarly. Check their specific APIs to
3394  * know how to achieve your desired behavior. Consider the following
3395  * example:
3396  *
3397  * @code
3398  * // rescale image to fill exactly its area without tiling:
3399  * evas_object_resize(img, w, h);
3400  * evas_object_image_fill_set(img, 0, 0, w, h);
3401  * @endcode
3402  *
3403  * @ingroup Evas_Object_Group_Basic
3404  */
3405 EAPI void              evas_object_resize                (Evas_Object *obj, Evas_Coord w, Evas_Coord h) EINA_ARG_NONNULL(1);
3406
3407 /**
3408  * Retrieves the position and (rectangular) size of the given Evas
3409  * object.
3410  *
3411  * @param obj The given Evas object.
3412  * @param x Pointer to an integer in which to store the X coordinate
3413  *          of the object.
3414  * @param y Pointer to an integer in which to store the Y coordinate
3415  *          of the object.
3416  * @param w Pointer to an integer in which to store the width of the
3417  *          object.
3418  * @param h Pointer to an integer in which to store the height of the
3419  *          object.
3420  *
3421  * The position, naturally, will be relative to the top left corner of
3422  * the canvas' viewport.
3423  *
3424  * @note Use @c NULL pointers on the geometry components you're not
3425  * interested in: they'll be ignored by the function.
3426  *
3427  * Example:
3428  * @dontinclude evas-events.c
3429  * @skip int w, h, cw, ch;
3430  * @until return
3431  *
3432  * See the full @ref Example_Evas_Events "example".
3433  *
3434  * @ingroup Evas_Object_Group_Basic
3435  */
3436 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);
3437
3438
3439 /**
3440  * Makes the given Evas object visible.
3441  *
3442  * @param obj The given Evas object.
3443  *
3444  * Besides becoming visible, the object's ::EVAS_CALLBACK_SHOW
3445  * callback will be called.
3446  *
3447  * @see evas_object_hide() for more on object visibility.
3448  * @see evas_object_visible_get()
3449  *
3450  * @ingroup Evas_Object_Group_Basic
3451  */
3452 EAPI void              evas_object_show                  (Evas_Object *obj) EINA_ARG_NONNULL(1);
3453
3454 /**
3455  * Makes the given Evas object invisible.
3456  *
3457  * @param obj The given Evas object.
3458  *
3459  * Hidden objects, besides not being shown at all in your canvas,
3460  * won't be checked for changes on the canvas rendering
3461  * process. Furthermore, they will not catch input events. Thus, they
3462  * are much ligher (in processing needs) than an object that is
3463  * invisible due to indirect causes, such as being clipped or out of
3464  * the canvas' viewport.
3465  *
3466  * Besides becoming hidden, @p obj object's ::EVAS_CALLBACK_SHOW
3467  * callback will be called.
3468  *
3469  * @note All objects are created in the hidden state! If you want them
3470  * shown, use evas_object_show() after their creation.
3471  *
3472  * @see evas_object_show()
3473  * @see evas_object_visible_get()
3474  *
3475  * Example:
3476  * @dontinclude evas-object-manipulation.c
3477  * @skip if (evas_object_visible_get(d.clipper))
3478  * @until return
3479  *
3480  * See the full @ref Example_Evas_Object_Manipulation "example".
3481  *
3482  * @ingroup Evas_Object_Group_Basic
3483  */
3484 EAPI void              evas_object_hide                  (Evas_Object *obj) EINA_ARG_NONNULL(1);
3485
3486 /**
3487  * Retrieves whether or not the given Evas object is visible.
3488  *
3489  * @param   obj The given Evas object.
3490  * @return @c EINA_TRUE if the object is visible, @c EINA_FALSE
3491  * otherwise.
3492  *
3493  * This retrieves an object's visibility as the one enforced by
3494  * evas_object_show() and evas_object_hide().
3495  *
3496  * @note The value returned isn't, by any means, influenced by
3497  * clippers covering @p obj, it being out of its canvas' viewport or
3498  * stacked below other object.
3499  *
3500  * @see evas_object_show()
3501  * @see evas_object_hide() (for an example)
3502  *
3503  * @ingroup Evas_Object_Group_Basic
3504  */
3505 EAPI Eina_Bool         evas_object_visible_get           (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
3506
3507
3508 /**
3509  * Sets the general/main color of the given Evas object to the given
3510  * one.
3511  *
3512  * @param obj The given Evas object.
3513  * @param r   The red component of the given color.
3514  * @param g   The green component of the given color.
3515  * @param b   The blue component of the given color.
3516  * @param a   The alpha component of the given color.
3517  *
3518  * @see evas_object_color_get() (for an example)
3519  * @note These color values are expected to be premultiplied by @p a.
3520  *
3521  * @ingroup Evas_Object_Group_Basic
3522  */
3523 EAPI void              evas_object_color_set             (Evas_Object *obj, int r, int g, int b, int a) EINA_ARG_NONNULL(1);
3524
3525 /**
3526  * Retrieves the general/main color of the given Evas object.
3527  *
3528  * @param obj The given Evas object to retrieve color from.
3529  * @param r Pointer to an integer in which to store the red component
3530  *          of the color.
3531  * @param g Pointer to an integer in which to store the green
3532  *          component of the color.
3533  * @param b Pointer to an integer in which to store the blue component
3534  *          of the color.
3535  * @param a Pointer to an integer in which to store the alpha
3536  *          component of the color.
3537  *
3538  * Retrieves the “main” color's RGB component (and alpha channel)
3539  * values, <b>which range from 0 to 255</b>. For the alpha channel,
3540  * which defines the object's transparency level, 0 means totally
3541  * transparent, while 255 means opaque. These color values are
3542  * premultiplied by the alpha value.
3543  *
3544  * Usually you’ll use this attribute for text and rectangle objects,
3545  * where the “main” color is their unique one. If set for objects
3546  * which themselves have colors, like the images one, those colors get
3547  * modulated by this one.
3548  *
3549  * @note All newly created Evas rectangles get the default color
3550  * values of <code>255 255 255 255</code> (opaque white).
3551  *
3552  * @note Use @c NULL pointers on the components you're not interested
3553  * in: they'll be ignored by the function.
3554  *
3555  * Example:
3556  * @dontinclude evas-object-manipulation.c
3557  * @skip int alpha, r, g, b;
3558  * @until return
3559  *
3560  * See the full @ref Example_Evas_Object_Manipulation "example".
3561  *
3562  * @ingroup Evas_Object_Group_Basic
3563  */
3564 EAPI void              evas_object_color_get             (const Evas_Object *obj, int *r, int *g, int *b, int *a) EINA_ARG_NONNULL(1);
3565
3566
3567 /**
3568  * Retrieves the Evas canvas that the given object lives on.
3569  *
3570  * @param   obj The given Evas object.
3571  * @return  A pointer to the canvas where the object is on.
3572  *
3573  * This function is most useful at code contexts where you need to
3574  * operate on the canvas but have only the object pointer.
3575  *
3576  * @ingroup Evas_Object_Group_Basic
3577  */
3578 EAPI Evas             *evas_object_evas_get              (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
3579
3580 /**
3581  * Retrieves the type of the given Evas object.
3582  *
3583  * @param obj The given object.
3584  * @return The type of the object.
3585  *
3586  * For Evas' builtin types, the return strings will be one of:
3587  *   - <c>"rectangle"</c>,
3588  *   - <c>"line"</c>,
3589  *   - <c>"polygon"</c>,
3590  *   - <c>"text"</c>,
3591  *   - <c>"textblock"</c> and
3592  *   - <c>"image"</c>.
3593  *
3594  * For Evas smart objects (see @ref Evas_Smart_Group), the name of the
3595  * smart class itself is returned on this call. For the built-in smart
3596  * objects, these names are:
3597  *   - <c>"EvasObjectSmartClipped"</c>, for the clipped smart object
3598  *   - <c>"Evas_Object_Box"</c>, for the box object and
3599  *   - <c>"Evas_Object_Table"</c>, for the table object.
3600  *
3601  * Example:
3602  * @dontinclude evas-object-manipulation.c
3603  * @skip d.img = evas_object_image_filled_add(d.canvas);
3604  * @until border on the
3605  *
3606  * See the full @ref Example_Evas_Object_Manipulation "example".
3607  */
3608 EAPI const char       *evas_object_type_get              (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
3609
3610 /**
3611  * Raise @p obj to the top of its layer.
3612  *
3613  * @param obj the object to raise
3614  *
3615  * @p obj will, then, be the highest one in the layer it belongs
3616  * to. Object on other layers won't get touched.
3617  *
3618  * @see evas_object_stack_above()
3619  * @see evas_object_stack_below()
3620  * @see evas_object_lower()
3621  */
3622 EAPI void              evas_object_raise                 (Evas_Object *obj) EINA_ARG_NONNULL(1);
3623
3624 /**
3625  * Lower @p obj to the bottom of its layer.
3626  *
3627  * @param obj the object to lower
3628  *
3629  * @p obj will, then, be the lowest one in the layer it belongs
3630  * to. Objects on other layers won't get touched.
3631  *
3632  * @see evas_object_stack_above()
3633  * @see evas_object_stack_below()
3634  * @see evas_object_raise()
3635  */
3636 EAPI void              evas_object_lower                 (Evas_Object *obj) EINA_ARG_NONNULL(1);
3637
3638 /**
3639  * Stack @p obj immediately above @p above
3640  *
3641  * @param obj the object to stack
3642  * @param above the object above which to stack
3643  *
3644  * Objects, in a given canvas, are stacked in the order they get added
3645  * to it.  This means that, if they overlap, the highest ones will
3646  * cover the lowest ones, in that order. This function is a way to
3647  * change the stacking order for the objects.
3648  *
3649  * This function is intended to be used with <b>objects belonging to
3650  * the same layer</b> in a given canvas, otherwise it will fail (and
3651  * accomplish nothing).
3652  *
3653  * If you have smart objects on your canvas and @p obj is a member of
3654  * one of them, then @p above must also be a member of the same
3655  * smart object.
3656  *
3657  * Similarly, if @p obj is not a member of a smart object, @p above
3658  * must not be either.
3659  *
3660  * @see evas_object_layer_get()
3661  * @see evas_object_layer_set()
3662  * @see evas_object_stack_below()
3663  */
3664 EAPI void              evas_object_stack_above           (Evas_Object *obj, Evas_Object *above) EINA_ARG_NONNULL(1, 2);
3665
3666 /**
3667  * Stack @p obj immediately below @p below
3668  *
3669  * @param obj the object to stack
3670  * @param below the object below which to stack
3671  *
3672  * Objects, in a given canvas, are stacked in the order they get added
3673  * to it.  This means that, if they overlap, the highest ones will
3674  * cover the lowest ones, in that order. This function is a way to
3675  * change the stacking order for the objects.
3676  *
3677  * This function is intended to be used with <b>objects belonging to
3678  * the same layer</b> in a given canvas, otherwise it will fail (and
3679  * accomplish nothing).
3680  *
3681  * If you have smart objects on your canvas and @p obj is a member of
3682  * one of them, then @p below must also be a member of the same
3683  * smart object.
3684  *
3685  * Similarly, if @p obj is not a member of a smart object, @p below
3686  * must not be either.
3687  *
3688  * @see evas_object_layer_get()
3689  * @see evas_object_layer_set()
3690  * @see evas_object_stack_below()
3691  */
3692 EAPI void              evas_object_stack_below           (Evas_Object *obj, Evas_Object *below) EINA_ARG_NONNULL(1, 2);
3693
3694 /**
3695  * Get the Evas object stacked right above @p obj
3696  *
3697  * @param obj an #Evas_Object
3698  * @return the #Evas_Object directly above @p obj, if any, or @c NULL,
3699  * if none
3700  *
3701  * This function will traverse layers in its search, if there are
3702  * objects on layers above the one @p obj is placed at.
3703  *
3704  * @see evas_object_layer_get()
3705  * @see evas_object_layer_set()
3706  * @see evas_object_below_get()
3707  *
3708  */
3709 EAPI Evas_Object      *evas_object_above_get             (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
3710
3711 /**
3712  * Get the Evas object stacked right below @p obj
3713  *
3714  * @param obj an #Evas_Object
3715  * @return the #Evas_Object directly below @p obj, if any, or @c NULL,
3716  * if none
3717  *
3718  * This function will traverse layers in its search, if there are
3719  * objects on layers below the one @p obj is placed at.
3720  *
3721  * @see evas_object_layer_get()
3722  * @see evas_object_layer_set()
3723  * @see evas_object_below_get()
3724  */
3725 EAPI Evas_Object      *evas_object_below_get             (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
3726
3727 /**
3728  * @}
3729  */
3730
3731 /**
3732  * @defgroup Evas_Object_Group_Events Object Events
3733  *
3734  * Objects generate events when they are moved, resized, when their
3735  * visibility change, when they are deleted and so on. These methods
3736  * allow one to be notified about and to handle such events.
3737  *
3738  * Objects also generate events on input (keyboard and mouse), if they
3739  * accept them (are visible, focused, etc).
3740  *
3741  * For each of those events, Evas provides a way for one to register
3742  * callback functions to be issued just after they happen.
3743  *
3744  * The following figure illustrates some Evas (event) callbacks:
3745  *
3746  * @image html evas-callbacks.png
3747  * @image rtf evas-callbacks.png
3748  * @image latex evas-callbacks.eps
3749  *
3750  * These events have their values in the #Evas_Callback_Type
3751  * enumeration, which has also ones happening on the canvas level (see
3752  * @ref Evas_Canvas_Events ).
3753  *
3754  * Examples on this group of functions can be found @ref
3755  * Example_Evas_Stacking "here" and @ref Example_Evas_Events "here".
3756  *
3757  * @ingroup Evas_Object_Group
3758  */
3759
3760 /**
3761  * @addtogroup Evas_Object_Group_Events
3762  * @{
3763  */
3764
3765 /**
3766  * Add (register) a callback function to a given Evas object event.
3767  *
3768  * @param obj Object to attach a callback to
3769  * @param type The type of event that will trigger the callback
3770  * @param func The function to be called when the event is triggered
3771  * @param data The data pointer to be passed to @p func
3772  *
3773  * This function adds a function callback to an object when the event
3774  * of type @p type occurs on object @p obj. The function is @p func.
3775  *
3776  * In the event of a memory allocation error during addition of the
3777  * callback to the object, evas_alloc_error() should be used to
3778  * determine the nature of the error, if any, and the program should
3779  * sensibly try and recover.
3780  *
3781  * A callback function must have the ::Evas_Object_Event_Cb prototype
3782  * definition. The first parameter (@p data) in this definition will
3783  * have the same value passed to evas_object_event_callback_add() as
3784  * the @p data parameter, at runtime. The second parameter @p e is the
3785  * canvas pointer on which the event occurred. The third parameter is
3786  * a pointer to the object on which event occurred. Finally, the
3787  * fourth parameter @p event_info is a pointer to a data structure
3788  * that may or may not be passed to the callback, depending on the
3789  * event type that triggered the callback. This is so because some
3790  * events don't carry extra context with them, but others do.
3791  *
3792  * The event type @p type to trigger the function may be one of
3793  * #EVAS_CALLBACK_MOUSE_IN, #EVAS_CALLBACK_MOUSE_OUT,
3794  * #EVAS_CALLBACK_MOUSE_DOWN, #EVAS_CALLBACK_MOUSE_UP,
3795  * #EVAS_CALLBACK_MOUSE_MOVE, #EVAS_CALLBACK_MOUSE_WHEEL,
3796  * #EVAS_CALLBACK_MULTI_DOWN, #EVAS_CALLBACK_MULTI_UP,
3797  * #EVAS_CALLBACK_MULTI_MOVE, #EVAS_CALLBACK_FREE,
3798  * #EVAS_CALLBACK_KEY_DOWN, #EVAS_CALLBACK_KEY_UP,
3799  * #EVAS_CALLBACK_FOCUS_IN, #EVAS_CALLBACK_FOCUS_OUT,
3800  * #EVAS_CALLBACK_SHOW, #EVAS_CALLBACK_HIDE, #EVAS_CALLBACK_MOVE,
3801  * #EVAS_CALLBACK_RESIZE, #EVAS_CALLBACK_RESTACK, #EVAS_CALLBACK_DEL,
3802  * #EVAS_CALLBACK_HOLD, #EVAS_CALLBACK_CHANGED_SIZE_HINTS,
3803  * #EVAS_CALLBACK_IMAGE_PRELOADED or #EVAS_CALLBACK_IMAGE_UNLOADED.
3804  *
3805  * This determines the kind of event that will trigger the callback.
3806  * What follows is a list explaining better the nature of each type of
3807  * event, along with their associated @p event_info pointers:
3808  *
3809  * - #EVAS_CALLBACK_MOUSE_IN: @p event_info is a pointer to an
3810  *   #Evas_Event_Mouse_In struct\n\n
3811  *   This event is triggered when the mouse pointer enters the area
3812  *   (not shaded by other objects) of the object @p obj. This may
3813  *   occur by the mouse pointer being moved by
3814  *   evas_event_feed_mouse_move() calls, or by the object being shown,
3815  *   raised, moved, resized, or other objects being moved out of the
3816  *   way, hidden or lowered, whatever may cause the mouse pointer to
3817  *   get on top of @p obj, having been on top of another object
3818  *   previously.
3819  *
3820  * - #EVAS_CALLBACK_MOUSE_OUT: @p event_info is a pointer to an
3821  *   #Evas_Event_Mouse_Out struct\n\n
3822  *   This event is triggered exactly like #EVAS_CALLBACK_MOUSE_IN is,
3823  *   but it occurs when the mouse pointer exits an object's area. Note
3824  *   that no mouse out events will be reported if the mouse pointer is
3825  *   implicitly grabbed to an object (mouse buttons are down, having
3826  *   been pressed while the pointer was over that object). In these
3827  *   cases, mouse out events will be reported once all buttons are
3828  *   released, if the mouse pointer has left the object's area. The
3829  *   indirect ways of taking off the mouse pointer from an object,
3830  *   like cited above, for #EVAS_CALLBACK_MOUSE_IN, also apply here,
3831  *   naturally.
3832  *
3833  * - #EVAS_CALLBACK_MOUSE_DOWN: @p event_info is a pointer to an
3834  *   #Evas_Event_Mouse_Down struct\n\n
3835  *   This event is triggered by a mouse button being pressed while the
3836  *   mouse pointer is over an object. If the pointer mode for Evas is
3837  *   #EVAS_OBJECT_POINTER_MODE_AUTOGRAB (default), this causes this
3838  *   object to <b>passively grab the mouse</b> until all mouse buttons
3839  *   have been released: all future mouse events will be reported to
3840  *   only this object until no buttons are down. That includes mouse
3841  *   move events, mouse in and mouse out events, and further button
3842  *   presses. When all buttons are released, event propagation will
3843  *   occur as normal (see #Evas_Object_Pointer_Mode).
3844  *
3845  * - #EVAS_CALLBACK_MOUSE_UP: @p event_info is a pointer to an
3846  *   #Evas_Event_Mouse_Up struct\n\n
3847  *   This event is triggered by a mouse button being released while
3848  *   the mouse pointer is over an object's area (or when passively
3849  *   grabbed to an object).
3850  *
3851  * - #EVAS_CALLBACK_MOUSE_MOVE: @p event_info is a pointer to an
3852  *   #Evas_Event_Mouse_Move struct\n\n
3853  *   This event is triggered by the mouse pointer being moved while
3854  *   over an object's area (or while passively grabbed to an object).
3855  *
3856  * - #EVAS_CALLBACK_MOUSE_WHEEL: @p event_info is a pointer to an
3857  *   #Evas_Event_Mouse_Wheel struct\n\n
3858  *   This event is triggered by the mouse wheel being rolled while the
3859  *   mouse pointer is over an object (or passively grabbed to an
3860  *   object).
3861  *
3862  * - #EVAS_CALLBACK_MULTI_DOWN: @p event_info is a pointer to an
3863  *   #Evas_Event_Multi_Down struct
3864  *
3865  * - #EVAS_CALLBACK_MULTI_UP: @p event_info is a pointer to an
3866  *   #Evas_Event_Multi_Up struct
3867  *
3868  * - #EVAS_CALLBACK_MULTI_MOVE: @p event_info is a pointer to an
3869  *   #Evas_Event_Multi_Move struct
3870  *
3871  * - #EVAS_CALLBACK_FREE: @p event_info is @c NULL \n\n
3872  *   This event is triggered just before Evas is about to free all
3873  *   memory used by an object and remove all references to it. This is
3874  *   useful for programs to use if they attached data to an object and
3875  *   want to free it when the object is deleted. The object is still
3876  *   valid when this callback is called, but after it returns, there
3877  *   is no guarantee on the object's validity.
3878  *
3879  * - #EVAS_CALLBACK_KEY_DOWN: @p event_info is a pointer to an
3880  *   #Evas_Event_Key_Down struct\n\n
3881  *   This callback is called when a key is pressed and the focus is on
3882  *   the object, or a key has been grabbed to a particular object
3883  *   which wants to intercept the key press regardless of what object
3884  *   has the focus.
3885  *
3886  * - #EVAS_CALLBACK_KEY_UP: @p event_info is a pointer to an
3887  *   #Evas_Event_Key_Up struct \n\n
3888  *   This callback is called when a key is released and the focus is
3889  *   on the object, or a key has been grabbed to a particular object
3890  *   which wants to intercept the key release regardless of what
3891  *   object has the focus.
3892  *
3893  * - #EVAS_CALLBACK_FOCUS_IN: @p event_info is @c NULL \n\n
3894  *   This event is called when an object gains the focus. When it is
3895  *   called the object has already gained the focus.
3896  *
3897  * - #EVAS_CALLBACK_FOCUS_OUT: @p event_info is @c NULL \n\n
3898  *   This event is triggered when an object loses the focus. When it
3899  *   is called the object has already lost the focus.
3900  *
3901  * - #EVAS_CALLBACK_SHOW: @p event_info is @c NULL \n\n
3902  *   This event is triggered by the object being shown by
3903  *   evas_object_show().
3904  *
3905  * - #EVAS_CALLBACK_HIDE: @p event_info is @c NULL \n\n
3906  *   This event is triggered by an object being hidden by
3907  *   evas_object_hide().
3908  *
3909  * - #EVAS_CALLBACK_MOVE: @p event_info is @c NULL \n\n
3910  *   This event is triggered by an object being
3911  *   moved. evas_object_move() can trigger this, as can any
3912  *   object-specific manipulations that would mean the object's origin
3913  *   could move.
3914  *
3915  * - #EVAS_CALLBACK_RESIZE: @p event_info is @c NULL \n\n
3916  *   This event is triggered by an object being resized. Resizes can
3917  *   be triggered by evas_object_resize() or by any object-specific
3918  *   calls that may cause the object to resize.
3919  *
3920  * - #EVAS_CALLBACK_RESTACK: @p event_info is @c NULL \n\n
3921  *   This event is triggered by an object being re-stacked. Stacking
3922  *   changes can be triggered by
3923  *   evas_object_stack_below()/evas_object_stack_above() and others.
3924  *
3925  * - #EVAS_CALLBACK_DEL: @p event_info is @c NULL.
3926  *
3927  * - #EVAS_CALLBACK_HOLD: @p event_info is a pointer to an
3928  *   #Evas_Event_Hold struct
3929  *
3930  * - #EVAS_CALLBACK_CHANGED_SIZE_HINTS: @p event_info is @c NULL.
3931  *
3932  * - #EVAS_CALLBACK_IMAGE_PRELOADED: @p event_info is @c NULL.
3933  *
3934  * - #EVAS_CALLBACK_IMAGE_UNLOADED: @p event_info is @c NULL.
3935  *
3936  * @note Be careful not to add the same callback multiple times, if
3937  * that's not what you want, because Evas won't check if a callback
3938  * existed before exactly as the one being registered (and thus, call
3939  * it more than once on the event, in this case). This would make
3940  * sense if you passed different functions and/or callback data, only.
3941  *
3942  * Example:
3943  * @dontinclude evas-events.c
3944  * @skip evas_object_event_callback_add(
3945  * @until }
3946  *
3947  * See the full example @ref Example_Evas_Events "here".
3948  *
3949  */
3950    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);
3951
3952 /**
3953  * Add (register) a callback function to a given Evas object event with a
3954  * non-default priority set. Except for the priority field, it's exactly the
3955  * same as @ref evas_object_event_callback_add
3956  *
3957  * @param obj Object to attach a callback to
3958  * @param type The type of event that will trigger the callback
3959  * @param priority The priority of the callback, lower values called first.
3960  * @param func The function to be called when the event is triggered
3961  * @param data The data pointer to be passed to @p func
3962  *
3963  * @see evas_object_event_callback_add
3964  * @since 1.1.0
3965  */
3966 EAPI void                 evas_object_event_callback_priority_add(Evas_Object *obj, Evas_Callback_Type type, Evas_Callback_Priority priority, Evas_Object_Event_Cb func, const void *data) EINA_ARG_NONNULL(1, 4);
3967
3968 /**
3969  * Delete a callback function from an object
3970  *
3971  * @param obj Object to remove a callback from
3972  * @param type The type of event that was triggering the callback
3973  * @param func The function that was to be called when the event was triggered
3974  * @return The data pointer that was to be passed to the callback
3975  *
3976  * This function removes the most recently added callback from the
3977  * object @p obj which was triggered by the event type @p type and was
3978  * calling the function @p func when triggered. If the removal is
3979  * successful it will also return the data pointer that was passed to
3980  * evas_object_event_callback_add() when the callback was added to the
3981  * object. If not successful @c NULL will be returned.
3982  *
3983  * Example:
3984  * @code
3985  * extern Evas_Object *object;
3986  * void *my_data;
3987  * void up_callback(void *data, Evas *e, Evas_Object *obj, void *event_info);
3988  *
3989  * my_data = evas_object_event_callback_del(object, EVAS_CALLBACK_MOUSE_UP, up_callback);
3990  * @endcode
3991  */
3992 EAPI void             *evas_object_event_callback_del     (Evas_Object *obj, Evas_Callback_Type type, Evas_Object_Event_Cb func) EINA_ARG_NONNULL(1, 3);
3993
3994 /**
3995  * Delete (unregister) a callback function registered to a given
3996  * Evas object event.
3997  *
3998  * @param obj Object to remove a callback from
3999  * @param type The type of event that was triggering the callback
4000  * @param func The function that was to be called when the event was
4001  * triggered
4002  * @param data The data pointer that was to be passed to the callback
4003  * @return The data pointer that was to be passed to the callback
4004  *
4005  * This function removes the most recently added callback from the
4006  * object @p obj, which was triggered by the event type @p type and was
4007  * calling the function @p func with data @p data, when triggered. If
4008  * the removal is successful it will also return the data pointer that
4009  * was passed to evas_object_event_callback_add() (that will be the
4010  * same as the parameter) when the callback was added to the
4011  * object. In errors, @c NULL will be returned.
4012  *
4013  * @note For deletion of Evas object events callbacks filtering by
4014  * just type and function pointer, user
4015  * evas_object_event_callback_del().
4016  *
4017  * Example:
4018  * @code
4019  * extern Evas_Object *object;
4020  * void *my_data;
4021  * void up_callback(void *data, Evas *e, Evas_Object *obj, void *event_info);
4022  *
4023  * my_data = evas_object_event_callback_del_full(object, EVAS_CALLBACK_MOUSE_UP, up_callback, data);
4024  * @endcode
4025  */
4026 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);
4027
4028
4029 /**
4030  * Set whether an Evas object is to pass (ignore) events.
4031  *
4032  * @param obj the Evas object to operate on
4033  * @param pass whether @p obj is to pass events (@c EINA_TRUE) or not
4034  * (@c EINA_FALSE)
4035  *
4036  * If @p pass is @c EINA_TRUE, it will make events on @p obj to be @b
4037  * ignored. They will be triggered on the @b next lower object (that
4038  * is not set to pass events), instead (see evas_object_below_get()).
4039  *
4040  * If @p pass is @c EINA_FALSE, events will be processed on that
4041  * object as normal.
4042  *
4043  * @see evas_object_pass_events_get() for an example
4044  * @see evas_object_repeat_events_set()
4045  * @see evas_object_propagate_events_set()
4046  * @see evas_object_freeze_events_set()
4047  */
4048 EAPI void              evas_object_pass_events_set        (Evas_Object *obj, Eina_Bool pass) EINA_ARG_NONNULL(1);
4049
4050 /**
4051  * Determine whether an object is set to pass (ignore) events.
4052  *
4053  * @param obj the Evas object to get information from.
4054  * @return pass whether @p obj is set to pass events (@c EINA_TRUE) or not
4055  * (@c EINA_FALSE)
4056  *
4057  * Example:
4058  * @dontinclude evas-stacking.c
4059  * @skip if (strcmp(ev->keyname, "p") == 0)
4060  * @until }
4061  *
4062  * See the full @ref Example_Evas_Stacking "example".
4063  *
4064  * @see evas_object_pass_events_set()
4065  * @see evas_object_repeat_events_get()
4066  * @see evas_object_propagate_events_get()
4067  * @see evas_object_freeze_events_get()
4068  */
4069 EAPI Eina_Bool         evas_object_pass_events_get        (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
4070
4071 /**
4072  * Set whether an Evas object is to repeat events.
4073  *
4074  * @param obj the Evas object to operate on
4075  * @param repeat whether @p obj is to repeat events (@c EINA_TRUE) or not
4076  * (@c EINA_FALSE)
4077  *
4078  * If @p repeat is @c EINA_TRUE, it will make events on @p obj to also
4079  * be repeated for the @b next lower object in the objects' stack (see
4080  * see evas_object_below_get()).
4081  *
4082  * If @p repeat is @c EINA_FALSE, events occurring on @p obj will be
4083  * processed only on it.
4084  *
4085  * Example:
4086  * @dontinclude evas-stacking.c
4087  * @skip if (strcmp(ev->keyname, "r") == 0)
4088  * @until }
4089  *
4090  * See the full @ref Example_Evas_Stacking "example".
4091  *
4092  * @see evas_object_repeat_events_get()
4093  * @see evas_object_pass_events_set()
4094  * @see evas_object_propagate_events_set()
4095  * @see evas_object_freeze_events_set()
4096  */
4097 EAPI void              evas_object_repeat_events_set      (Evas_Object *obj, Eina_Bool repeat) EINA_ARG_NONNULL(1);
4098
4099 /**
4100  * Determine whether an object is set to repeat events.
4101  *
4102  * @param obj the given Evas object pointer
4103  * @return whether @p obj is set to repeat events (@c EINA_TRUE)
4104  * or not (@c EINA_FALSE)
4105  *
4106  * @see evas_object_repeat_events_set() for an example
4107  * @see evas_object_pass_events_get()
4108  * @see evas_object_propagate_events_get()
4109  * @see evas_object_freeze_events_get()
4110  */
4111 EAPI Eina_Bool         evas_object_repeat_events_get      (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
4112
4113 /**
4114  * Set whether events on a smart object's member should get propagated
4115  * up to its parent.
4116  *
4117  * @param obj the smart object's child to operate on
4118  * @param prop whether to propagate events (@c EINA_TRUE) or not
4119  * (@c EINA_FALSE)
4120  *
4121  * This function has @b no effect if @p obj is not a member of a smart
4122  * object.
4123  *
4124  * If @p prop is @c EINA_TRUE, events occurring on this object will be
4125  * propagated on to the smart object of which @p obj is a member.  If
4126  * @p prop is @c EINA_FALSE, events occurring on this object will @b
4127  * not be propagated on to the smart object of which @p obj is a
4128  * member.  The default value is @c EINA_TRUE.
4129  *
4130  * @see evas_object_propagate_events_get()
4131  * @see evas_object_repeat_events_set()
4132  * @see evas_object_pass_events_set()
4133  * @see evas_object_freeze_events_set()
4134  */
4135 EAPI void              evas_object_propagate_events_set   (Evas_Object *obj, Eina_Bool prop) EINA_ARG_NONNULL(1);
4136
4137 /**
4138  * Retrieve whether an Evas object is set to propagate events.
4139  *
4140  * @param obj the given Evas object pointer
4141  * @return whether @p obj is set to propagate events (@c EINA_TRUE)
4142  * or not (@c EINA_FALSE)
4143  *
4144  * @see evas_object_propagate_events_set()
4145  * @see evas_object_repeat_events_get()
4146  * @see evas_object_pass_events_get()
4147  * @see evas_object_freeze_events_get()
4148  */
4149 EAPI Eina_Bool         evas_object_propagate_events_get   (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
4150
4151 /**
4152  * Set whether an Evas object is to freeze (discard) events.
4153  *
4154  * @param obj the Evas object to operate on
4155  * @param freeze pass whether @p obj is to freeze events (@c EINA_TRUE) or not
4156  * (@c EINA_FALSE)
4157  *
4158  * If @p freeze is @c EINA_TRUE, it will make events on @p obj to be @b
4159  * discarded. Unlike evas_object_pass_events_set(), events will not be
4160  * passed to @b next lower object. This API can be used for blocking 
4161  * events while @p obj is on transiting. 
4162  *
4163  * If @p freeze is @c EINA_FALSE, events will be processed on that
4164  * object as normal.
4165  *
4166  * @see evas_object_freeze_events_get()
4167  * @see evas_object_pass_events_set()
4168  * @see evas_object_repeat_events_set()
4169  * @see evas_object_propagate_events_set()
4170  * @since 1.1.0
4171  */
4172 EAPI void              evas_object_freeze_events_set(Evas_Object *obj, Eina_Bool freeze) EINA_ARG_NONNULL(1);
4173
4174 /**
4175  * Determine whether an object is set to freeze (discard) events.
4176  *
4177  * @param obj the Evas object to get information from.
4178  * @return freeze whether @p obj is set to freeze events (@c EINA_TRUE) or
4179  * not (@c EINA_FALSE)
4180  *
4181  * @see evas_object_freeze_events_set()
4182  * @see evas_object_pass_events_get()
4183  * @see evas_object_repeat_events_get()
4184  * @see evas_object_propagate_events_get()
4185  * @since 1.1.0
4186  */
4187 EAPI Eina_Bool         evas_object_freeze_events_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
4188
4189 /**
4190  * @}
4191  */
4192
4193 /**
4194  * @defgroup Evas_Object_Group_Map UV Mapping (Rotation, Perspective, 3D...)
4195  *
4196  * Evas allows different transformations to be applied to all kinds of
4197  * objects. These are applied by means of UV mapping.
4198  *
4199  * With UV mapping, one maps points in the source object to a 3D space
4200  * positioning at target. This allows rotation, perspective, scale and
4201  * lots of other effects, depending on the map that is used.
4202  *
4203  * Each map point may carry a multiplier color. If properly
4204  * calculated, these can do shading effects on the object, producing
4205  * 3D effects.
4206  *
4207  * As usual, Evas provides both the raw and easy to use methods. The
4208  * raw methods allow developers to create their maps somewhere else,
4209  * possibly loading them from some file format. The easy to use methods
4210  * calculate the points given some high-level parameters such as
4211  * rotation angle, ambient light, and so on.
4212  *
4213  * @note applying mapping will reduce performance, so use with
4214  *       care. The impact on performance depends on engine in
4215  *       use. Software is quite optimized, but not as fast as OpenGL.
4216  *
4217  * @section sec-map-points Map points
4218  * @subsection subsec-rotation Rotation
4219  *
4220  * A map consists of a set of points, currently only four are supported. Each
4221  * of these points contains a set of canvas coordinates @c x and @c y that
4222  * can be used to alter the geometry of the mapped object, and a @c z
4223  * coordinate that indicates the depth of that point. This last coordinate
4224  * does not normally affect the map, but it's used by several of the utility
4225  * functions to calculate the right position of the point given other
4226  * parameters.
4227  *
4228  * The coordinates for each point are set with evas_map_point_coord_set().
4229  * The following image shows a map set to match the geometry of an existing
4230  * object.
4231  *
4232  * @image html map-set-map-points-1.png
4233  * @image rtf map-set-map-points-1.png
4234  * @image latex map-set-map-points-1.eps
4235  *
4236  * This is a common practice, so there are a few functions that help make it
4237  * easier.
4238  *
4239  * evas_map_util_points_populate_from_geometry() sets the coordinates of each
4240  * point in the given map to match the rectangle defined by the function
4241  * parameters.
4242  *
4243  * evas_map_util_points_populate_from_object() and
4244  * evas_map_util_points_populate_from_object_full() both take an object and
4245  * set the map points to match its geometry. The difference between the two
4246  * is that the first function sets the @c z value of all points to 0, while
4247  * the latter receives the value to set in said coordinate as a parameter.
4248  *
4249  * The following lines of code all produce the same result as in the image
4250  * above.
4251  * @code
4252  * evas_map_util_points_populate_from_geometry(m, 100, 100, 200, 200, 0);
4253  * // Assuming o is our original object
4254  * evas_object_move(o, 100, 100);
4255  * evas_object_resize(o, 200, 200);
4256  * evas_map_util_points_populate_from_object(m, o);
4257  * evas_map_util_points_populate_from_object_full(m, o, 0);
4258  * @endcode
4259  *
4260  * Several effects can be applied to an object by simply setting each point
4261  * of the map to the right coordinates. For example, a simulated perspective
4262  * could be achieve as follows.
4263  *
4264  * @image html map-set-map-points-2.png
4265  * @image rtf map-set-map-points-2.png
4266  * @image latex map-set-map-points-2.eps
4267  *
4268  * As said before, the @c z coordinate is unused here so when setting points
4269  * by hand, its value is of no importance.
4270  *
4271  * @image html map-set-map-points-3.png
4272  * @image rtf map-set-map-points-3.png
4273  * @image latex map-set-map-points-3.eps
4274  *
4275  * In all three cases above, setting the map to be used by the object is the
4276  * same.
4277  * @code
4278  * evas_object_map_set(o, m);
4279  * evas_object_map_enable_set(o, EINA_TRUE);
4280  * @endcode
4281  *
4282  * Doing things this way, however, is a lot of work that can be avoided by
4283  * using the provided utility functions, as described in the next section.
4284  *
4285  * @section map-utils Utility functions
4286  *
4287  * Utility functions take an already set up map and alter it to produce a
4288  * specific effect. For example, to rotate an object around its own center
4289  * you would need to take the rotation angle, the coordinates of each corner
4290  * of the object and do all the math to get the new set of coordinates that
4291  * need to tbe set in the map.
4292  *
4293  * Or you can use this code:
4294  * @code
4295  * evas_object_geometry_get(o, &x, &y, &w, &h);
4296  * m = evas_map_new(4);
4297  * evas_map_util_points_populate_from_object(m, o);
4298  * evas_map_util_rotate(m, 45, x + (w / 2), y + (h / 2));
4299  * evas_object_map_set(o, m);
4300  * evas_object_map_enable_set(o, EINA_TRUE);
4301  * evas_map_free(m);
4302  * @endcode
4303  *
4304  * Which will rotate the object around its center point in a 45 degree angle
4305  * in the clockwise direction, taking it from this
4306  *
4307  * @image html map-rotation-2d-1.png
4308  * @image rtf map-rotation-2d-1.png
4309  * @image latex map-rotation-2d-1.eps
4310  *
4311  * to this
4312  *
4313  * @image html map-rotation-2d-2.png
4314  * @image rtf map-rotation-2d-2.png
4315  * @image latex map-rotation-2d-2.eps
4316  *
4317  * Objects may be rotated around any other point just by setting the last two
4318  * paramaters of the evas_map_util_rotate() function to the right values. A
4319  * circle of roughly the diameter of the object overlaid on each image shows
4320  * where the center of rotation is set for each example.
4321  *
4322  * For example, this code
4323  * @code
4324  * evas_object_geometry_get(o, &x, &y, &w, &h);
4325  * m = evas_map_new(4);
4326  * evas_map_util_points_populate_from_object(m, o);
4327  * evas_map_util_rotate(m, 45, x + w - 20, y + h - 20);
4328  * evas_object_map_set(o, m);
4329  * evas_object_map_enable_set(o, EINA_TRUE);
4330  * evas_map_free(m);
4331  * @endcode
4332  *
4333  * produces something like
4334  *
4335  * @image html map-rotation-2d-3.png
4336  * @image rtf map-rotation-2d-3.png
4337  * @image latex map-rotation-2d-3.eps
4338  *
4339  * And the following
4340  * @code
4341  * evas_output_size_get(evas, &w, &h);
4342  * m = evas_map_new(4);
4343  * evas_map_util_points_populate_from_object(m, o);
4344  * evas_map_util_rotate(m, 45, w, h);
4345  * evas_object_map_set(o, m);
4346  * evas_object_map_enable_set(o, EINA_TRUE);
4347  * evas_map_free(m);
4348  * @endcode
4349  *
4350  * rotates the object around the center of the window
4351  *
4352  * @image html map-rotation-2d-4.png
4353  * @image rtf map-rotation-2d-4.png
4354  * @image latex map-rotation-2d-4.eps
4355  *
4356  * @subsection subsec-3d 3D Maps
4357  *
4358  * Maps can also be used to achieve the effect of 3-dimensionality. When doing
4359  * this, the @c z coordinate of each point counts, with higher values meaning
4360  * the point is further into the screen, and smaller values (negative, usually)
4361  * meaning the point is closwer towards the user.
4362  *
4363  * Thinking in 3D also introduces the concept of back-face of an object. An
4364  * object is said to be facing the user when all its points are placed in a
4365  * clockwise fashion. The next image shows this, with each point showing the
4366  * with which is identified within the map.
4367  *
4368  * @image html map-point-order-face.png
4369  * @image rtf map-point-order-face.png
4370  * @image latex map-point-order-face.eps
4371  *
4372  * Rotating this map around the @c Y axis would leave the order of the points
4373  * in a counter-clockwise fashion, as seen in the following image.
4374  *
4375  * @image html map-point-order-back.png
4376  * @image rtf map-point-order-back.png
4377  * @image latex map-point-order-back.eps
4378  *
4379  * This way we can say that we are looking at the back face of the object.
4380  * This will have stronger implications later when we talk about lighting.
4381  *
4382  * To know if a map is facing towards the user or not it's enough to use
4383  * the evas_map_util_clockwise_get() function, but this is normally done
4384  * after all the other operations are applied on the map.
4385  *
4386  * @subsection subsec-3d-rot 3D rotation and perspective
4387  *
4388  * Much like evas_map_util_rotate(), there's the function
4389  * evas_map_util_3d_rotate() that transforms the map to apply a 3D rotation
4390  * to an object. As in its 2D counterpart, the rotation can be applied around
4391  * any point in the canvas, this time with a @c z coordinate too. The rotation
4392  * can also be around any of the 3 axis.
4393  *
4394  * Starting from this simple setup
4395  *
4396  * @image html map-3d-basic-1.png
4397  * @image rtf map-3d-basic-1.png
4398  * @image latex map-3d-basic-1.eps
4399  *
4400  * and setting maps so that the blue square to rotate on all axis around a
4401  * sphere that uses the object as its center, and the red square to rotate
4402  * around the @c Y axis, we get the following. A simple overlay over the image
4403  * shows the original geometry of each object and the axis around which they
4404  * are being rotated, with the @c Z one not appearing due to being orthogonal
4405  * to the screen.
4406  *
4407  * @image html map-3d-basic-2.png
4408  * @image rtf map-3d-basic-2.png
4409  * @image latex map-3d-basic-2.eps
4410  *
4411  * which doesn't look very real. This can be helped by adding perspective
4412  * to the transformation, which can be simply done by calling
4413  * evas_map_util_3d_perspective() on the map after its position has been set.
4414  * The result in this case, making the vanishing point the center of each
4415  * object:
4416  *
4417  * @image html map-3d-basic-3.png
4418  * @image rtf map-3d-basic-3.png
4419  * @image latex map-3d-basic-3.eps
4420  *
4421  * @section sec-color Color and lighting
4422  *
4423  * Each point in a map can be set to a color, which will be multiplied with
4424  * the objects own color and linearly interpolated in between adjacent points.
4425  * This is done with evas_map_point_color_set() for each point of the map,
4426  * or evas_map_util_points_color_set() to set every point to the same color.
4427  *
4428  * When using 3D effects, colors can be used to improve the looks of them by
4429  * simulating a light source. The evas_map_util_3d_lighting() function makes
4430  * this task easier by taking the coordinates of the light source and its
4431  * color, along with the color of the ambient light. Evas then sets the color
4432  * of each point based on the distance to the light source, the angle with
4433  * which the object is facing the light and the ambient light. Here, the
4434  * orientation of each point as explained before, becomes more important.
4435  * If the map is defined counter-clockwise, the object will be facing away
4436  * from the user and thus become obscured, since no light would be reflecting
4437  * from it.
4438  *
4439  * @image html map-light.png
4440  * @image rtf map-light.png
4441  * @image latex map-light.eps
4442  * @note Object facing the light source
4443  *
4444  * @image html map-light2.png
4445  * @image rtf map-light2.png
4446  * @image latex map-light2.eps
4447  * @note Same object facing away from the user
4448  *
4449  * @section Image mapping
4450  *
4451  * @image html map-uv-mapping-1.png
4452  * @image rtf map-uv-mapping-1.png
4453  * @image latex map-uv-mapping-1.eps
4454  *
4455  * Images need some special handling when mapped. Evas can easily take care
4456  * of objects and do almost anything with them, but it's completely oblivious
4457  * to the content of images, so each point in the map needs to be told to what
4458  * pixel in the source image it belongs. Failing to do may sometimes result
4459  * in the expected behavior, or it may look like a partial work.
4460  *
4461  * The next image illustrates one possibility of a map being set to an image
4462  * object, without setting the right UV mapping for each point. The objects
4463  * themselves are mapped properly to their new geometry, but the image content
4464  * may not be displayed correctly within the mapped object.
4465  *
4466  * @image html map-uv-mapping-2.png
4467  * @image rtf map-uv-mapping-2.png
4468  * @image latex map-uv-mapping-2.eps
4469  *
4470  * Once Evas knows how to handle the source image within the map, it will
4471  * transform it as needed. This is done with evas_map_point_image_uv_set(),
4472  * which tells the map to which pixel in image it maps.
4473  *
4474  * To match our example images to the maps above all we need is the size of
4475  * each image, which can always be found with evas_object_image_size_get().
4476  *
4477  * @code
4478  * evas_map_point_image_uv_set(m, 0, 0, 0);
4479  * evas_map_point_image_uv_set(m, 1, 150, 0);
4480  * evas_map_point_image_uv_set(m, 2, 150, 200);
4481  * evas_map_point_image_uv_set(m, 3, 0, 200);
4482  * evas_object_map_set(o, m);
4483  * evas_object_map_enable_set(o, EINA_TRUE);
4484  *
4485  * evas_map_point_image_uv_set(m, 0, 0, 0);
4486  * evas_map_point_image_uv_set(m, 1, 120, 0);
4487  * evas_map_point_image_uv_set(m, 2, 120, 160);
4488  * evas_map_point_image_uv_set(m, 3, 0, 160);
4489  * evas_object_map_set(o2, m);
4490  * evas_object_map_enable_set(o2, EINA_TRUE);
4491  * @endcode
4492  *
4493  * To get
4494  *
4495  * @image html map-uv-mapping-3.png
4496  * @image rtf map-uv-mapping-3.png
4497  * @image latex map-uv-mapping-3.eps
4498  *
4499  * Maps can also be set to use part of an image only, or even map them inverted,
4500  * and combined with evas_object_image_source_set() it can be used to achieve
4501  * more interesting results.
4502  *
4503  * @code
4504  * evas_object_image_size_get(evas_object_image_source_get(o), &w, &h);
4505  * evas_map_point_image_uv_set(m, 0, 0, h);
4506  * evas_map_point_image_uv_set(m, 1, w, h);
4507  * evas_map_point_image_uv_set(m, 2, w, h / 3);
4508  * evas_map_point_image_uv_set(m, 3, 0, h / 3);
4509  * evas_object_map_set(o, m);
4510  * evas_object_map_enable_set(o, EINA_TRUE);
4511  * @endcode
4512  *
4513  * @image html map-uv-mapping-4.png
4514  * @image rtf map-uv-mapping-4.png
4515  * @image latex map-uv-mapping-4.eps
4516  *
4517  * Examples:
4518  * @li @ref Example_Evas_Map_Overview
4519  *
4520  * @ingroup Evas_Object_Group
4521  *
4522  * @{
4523  */
4524
4525 /**
4526  * Enable or disable the map that is set.
4527  *
4528  * Enable or disable the use of map for the object @p obj.
4529  * On enable, the object geometry will be saved, and the new geometry will
4530  * change (position and size) to reflect the map geometry set.
4531  *
4532  * If the object doesn't have a map set (with evas_object_map_set()), the
4533  * initial geometry will be undefined. It is advised to always set a map
4534  * to the object first, and then call this function to enable its use.
4535  *
4536  * @param obj object to enable the map on
4537  * @param enabled enabled state
4538  */
4539 EAPI void              evas_object_map_enable_set        (Evas_Object *obj, Eina_Bool enabled);
4540
4541 /**
4542  * Get the map enabled state
4543  *
4544  * This returns the currently enabled state of the map on the object indicated.
4545  * The default map enable state is off. You can enable and disable it with
4546  * evas_object_map_enable_set().
4547  *
4548  * @param obj object to get the map enabled state from
4549  * @return the map enabled state
4550  */
4551 EAPI Eina_Bool         evas_object_map_enable_get        (const Evas_Object *obj);
4552
4553 /**
4554  * Set the map source object
4555  *
4556  * This sets the object from which the map is taken - can be any object that
4557  * has map enabled on it.
4558  *
4559  * Currently not implemented. for future use.
4560  *
4561  * @param obj object to set the map source of
4562  * @param src the source object from which the map is taken
4563  */
4564 EAPI void              evas_object_map_source_set        (Evas_Object *obj, Evas_Object *src);
4565
4566 /**
4567  * Get the map source object
4568  *
4569  * @param obj object to set the map source of
4570  * @return the object set as the source
4571  *
4572  * @see evas_object_map_source_set()
4573  */
4574 EAPI Evas_Object      *evas_object_map_source_get        (const Evas_Object *obj);
4575
4576 /**
4577  * Set current object transformation map.
4578  *
4579  * This sets the map on a given object. It is copied from the @p map pointer,
4580  * so there is no need to keep the @p map object if you don't need it anymore.
4581  *
4582  * A map is a set of 4 points which have canvas x, y coordinates per point,
4583  * with an optional z point value as a hint for perspective correction, if it
4584  * is available. As well each point has u and v coordinates. These are like
4585  * "texture coordinates" in OpenGL in that they define a point in the source
4586  * image that is mapped to that map vertex/point. The u corresponds to the x
4587  * coordinate of this mapped point and v, the y coordinate. Note that these
4588  * coordinates describe a bounding region to sample. If you have a 200x100
4589  * source image and want to display it at 200x100 with proper pixel
4590  * precision, then do:
4591  *
4592  * @code
4593  * Evas_Map *m = evas_map_new(4);
4594  * evas_map_point_coord_set(m, 0,   0,   0, 0);
4595  * evas_map_point_coord_set(m, 1, 200,   0, 0);
4596  * evas_map_point_coord_set(m, 2, 200, 100, 0);
4597  * evas_map_point_coord_set(m, 3,   0, 100, 0);
4598  * evas_map_point_image_uv_set(m, 0,   0,   0);
4599  * evas_map_point_image_uv_set(m, 1, 200,   0);
4600  * evas_map_point_image_uv_set(m, 2, 200, 100);
4601  * evas_map_point_image_uv_set(m, 3,   0, 100);
4602  * evas_object_map_set(obj, m);
4603  * evas_map_free(m);
4604  * @endcode
4605  *
4606  * Note that the map points a uv coordinates match the image geometry. If
4607  * the @p map parameter is NULL, the stored map will be freed and geometry
4608  * prior to enabling/setting a map will be restored.
4609  *
4610  * @param obj object to change transformation map
4611  * @param map new map to use
4612  *
4613  * @see evas_map_new()
4614  */
4615 EAPI void              evas_object_map_set               (Evas_Object *obj, const Evas_Map *map);
4616
4617 /**
4618  * Get current object transformation map.
4619  *
4620  * This returns the current internal map set on the indicated object. It is
4621  * intended for read-only access and is only valid as long as the object is
4622  * not deleted or the map on the object is not changed. If you wish to modify
4623  * the map and set it back do the following:
4624  *
4625  * @code
4626  * const Evas_Map *m = evas_object_map_get(obj);
4627  * Evas_Map *m2 = evas_map_dup(m);
4628  * evas_map_util_rotate(m2, 30.0, 0, 0);
4629  * evas_object_map_set(obj);
4630  * evas_map_free(m2);
4631  * @endcode
4632  *
4633  * @param obj object to query transformation map.
4634  * @return map reference to map in use. This is an internal data structure, so
4635  * do not modify it.
4636  *
4637  * @see evas_object_map_set()
4638  */
4639 EAPI const Evas_Map   *evas_object_map_get               (const Evas_Object *obj);
4640
4641
4642 /**
4643  * Populate source and destination map points to match exactly object.
4644  *
4645  * Usually one initialize map of an object to match it's original
4646  * position and size, then transform these with evas_map_util_*
4647  * functions, such as evas_map_util_rotate() or
4648  * evas_map_util_3d_rotate(). The original set is done by this
4649  * function, avoiding code duplication all around.
4650  *
4651  * @param m map to change all 4 points (must be of size 4).
4652  * @param obj object to use unmapped geometry to populate map coordinates.
4653  * @param z Point Z Coordinate hint (pre-perspective transform). This value
4654  *        will be used for all four points.
4655  *
4656  * @see evas_map_util_points_populate_from_object()
4657  * @see evas_map_point_coord_set()
4658  * @see evas_map_point_image_uv_set()
4659  */
4660 EAPI void              evas_map_util_points_populate_from_object_full(Evas_Map *m, const Evas_Object *obj, Evas_Coord z);
4661
4662 /**
4663  * Populate source and destination map points to match exactly object.
4664  *
4665  * Usually one initialize map of an object to match it's original
4666  * position and size, then transform these with evas_map_util_*
4667  * functions, such as evas_map_util_rotate() or
4668  * evas_map_util_3d_rotate(). The original set is done by this
4669  * function, avoiding code duplication all around.
4670  *
4671  * Z Point coordinate is assumed as 0 (zero).
4672  *
4673  * @param m map to change all 4 points (must be of size 4).
4674  * @param obj object to use unmapped geometry to populate map coordinates.
4675  *
4676  * @see evas_map_util_points_populate_from_object_full()
4677  * @see evas_map_util_points_populate_from_geometry()
4678  * @see evas_map_point_coord_set()
4679  * @see evas_map_point_image_uv_set()
4680  */
4681 EAPI void              evas_map_util_points_populate_from_object     (Evas_Map *m, const Evas_Object *obj);
4682
4683 /**
4684  * Populate source and destination map points to match given geometry.
4685  *
4686  * Similar to evas_map_util_points_populate_from_object_full(), this
4687  * call takes raw values instead of querying object's unmapped
4688  * geometry. The given width will be used to calculate destination
4689  * points (evas_map_point_coord_set()) and set the image uv
4690  * (evas_map_point_image_uv_set()).
4691  *
4692  * @param m map to change all 4 points (must be of size 4).
4693  * @param x Point X Coordinate
4694  * @param y Point Y Coordinate
4695  * @param w width to use to calculate second and third points.
4696  * @param h height to use to calculate third and fourth points.
4697  * @param z Point Z Coordinate hint (pre-perspective transform). This value
4698  *        will be used for all four points.
4699  *
4700  * @see evas_map_util_points_populate_from_object()
4701  * @see evas_map_point_coord_set()
4702  * @see evas_map_point_image_uv_set()
4703  */
4704 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);
4705
4706 /**
4707  * Set color of all points to given color.
4708  *
4709  * This call is useful to reuse maps after they had 3d lightning or
4710  * any other colorization applied before.
4711  *
4712  * @param m map to change the color of.
4713  * @param r red (0 - 255)
4714  * @param g green (0 - 255)
4715  * @param b blue (0 - 255)
4716  * @param a alpha (0 - 255)
4717  *
4718  * @see evas_map_point_color_set()
4719  */
4720 EAPI void              evas_map_util_points_color_set                (Evas_Map *m, int r, int g, int b, int a);
4721
4722 /**
4723  * Change the map to apply the given rotation.
4724  *
4725  * This rotates the indicated map's coordinates around the center coordinate
4726  * given by @p cx and @p cy as the rotation center. The points will have their
4727  * X and Y coordinates rotated clockwise by @p degrees degrees (360.0 is a
4728  * full rotation). Negative values for degrees will rotate counter-clockwise
4729  * by that amount. All coordinates are canvas global coordinates.
4730  *
4731  * @param m map to change.
4732  * @param degrees amount of degrees from 0.0 to 360.0 to rotate.
4733  * @param cx rotation's center horizontal position.
4734  * @param cy rotation's center vertical position.
4735  *
4736  * @see evas_map_point_coord_set()
4737  * @see evas_map_util_zoom()
4738  */
4739 EAPI void              evas_map_util_rotate                          (Evas_Map *m, double degrees, Evas_Coord cx, Evas_Coord cy);
4740
4741 /**
4742  * Change the map to apply the given zooming.
4743  *
4744  * Like evas_map_util_rotate(), this zooms the points of the map from a center
4745  * point. That center is defined by @p cx and @p cy. The @p zoomx and @p zoomy
4746  * parameters specify how much to zoom in the X and Y direction respectively.
4747  * A value of 1.0 means "don't zoom". 2.0 means "double the size". 0.5 is
4748  * "half the size" etc. All coordinates are canvas global coordinates.
4749  *
4750  * @param m map to change.
4751  * @param zoomx horizontal zoom to use.
4752  * @param zoomy vertical zoom to use.
4753  * @param cx zooming center horizontal position.
4754  * @param cy zooming center vertical position.
4755  *
4756  * @see evas_map_point_coord_set()
4757  * @see evas_map_util_rotate()
4758  */
4759 EAPI void              evas_map_util_zoom                            (Evas_Map *m, double zoomx, double zoomy, Evas_Coord cx, Evas_Coord cy);
4760
4761 /**
4762  * Rotate the map around 3 axes in 3D
4763  *
4764  * This will rotate not just around the "Z" axis as in evas_map_util_rotate()
4765  * (which is a convenience call for those only wanting 2D). This will rotate
4766  * around the X, Y and Z axes. The Z axis points "into" the screen with low
4767  * values at the screen and higher values further away. The X axis runs from
4768  * left to right on the screen and the Y axis from top to bottom. Like with
4769  * evas_map_util_rotate() you provide a center point to rotate around (in 3D).
4770  *
4771  * @param m map to change.
4772  * @param dx amount of degrees from 0.0 to 360.0 to rotate around X axis.
4773  * @param dy amount of degrees from 0.0 to 360.0 to rotate around Y axis.
4774  * @param dz amount of degrees from 0.0 to 360.0 to rotate around Z axis.
4775  * @param cx rotation's center horizontal position.
4776  * @param cy rotation's center vertical position.
4777  * @param cz rotation's center vertical position.
4778  */
4779 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);
4780
4781 /**
4782  * Perform lighting calculations on the given Map
4783  *
4784  * This is used to apply lighting calculations (from a single light source)
4785  * to a given map. The R, G and B values of each vertex will be modified to
4786  * reflect the lighting based on the lixth point coordinates, the light
4787  * color and the ambient color, and at what angle the map is facing the
4788  * light source. A surface should have its points be declared in a
4789  * clockwise fashion if the face is "facing" towards you (as opposed to
4790  * away from you) as faces have a "logical" side for lighting.
4791  *
4792  * @image html map-light3.png
4793  * @image rtf map-light3.png
4794  * @image latex map-light3.eps
4795  * @note Grey object, no lighting used
4796  *
4797  * @image html map-light4.png
4798  * @image rtf map-light4.png
4799  * @image latex map-light4.eps
4800  * @note Lights out! Every color set to 0
4801  *
4802  * @image html map-light5.png
4803  * @image rtf map-light5.png
4804  * @image latex map-light5.eps
4805  * @note Ambient light to full black, red light coming from close at the
4806  * bottom-left vertex
4807  *
4808  * @image html map-light6.png
4809  * @image rtf map-light6.png
4810  * @image latex map-light6.eps
4811  * @note Same light as before, but not the light is set to 0 and ambient light
4812  * is cyan
4813  *
4814  * @image html map-light7.png
4815  * @image rtf map-light7.png
4816  * @image latex map-light7.eps
4817  * @note Both lights are on
4818  *
4819  * @image html map-light8.png
4820  * @image rtf map-light8.png
4821  * @image latex map-light8.eps
4822  * @note Both lights again, but this time both are the same color.
4823  *
4824  * @param m map to change.
4825  * @param lx X coordinate in space of light point
4826  * @param ly Y coordinate in space of light point
4827  * @param lz Z coordinate in space of light point
4828  * @param lr light red value (0 - 255)
4829  * @param lg light green value (0 - 255)
4830  * @param lb light blue value (0 - 255)
4831  * @param ar ambient color red value (0 - 255)
4832  * @param ag ambient color green value (0 - 255)
4833  * @param ab ambient color blue value (0 - 255)
4834  */
4835 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);
4836
4837 /**
4838  * Apply a perspective transform to the map
4839  *
4840  * This applies a given perspective (3D) to the map coordinates. X, Y and Z
4841  * values are used. The px and py points specify the "infinite distance" point
4842  * in the 3D conversion (where all lines converge to like when artists draw
4843  * 3D by hand). The @p z0 value specifies the z value at which there is a 1:1
4844  * mapping between spatial coordinates and screen coordinates. Any points
4845  * on this z value will not have their X and Y values modified in the transform.
4846  * Those further away (Z value higher) will shrink into the distance, and
4847  * those less than this value will expand and become bigger. The @p foc value
4848  * determines the "focal length" of the camera. This is in reality the distance
4849  * between the camera lens plane itself (at or closer than this rendering
4850  * results are undefined) and the "z0" z value. This allows for some "depth"
4851  * control and @p foc must be greater than 0.
4852  *
4853  * @param m map to change.
4854  * @param px The perspective distance X coordinate
4855  * @param py The perspective distance Y coordinate
4856  * @param z0 The "0" z plane value
4857  * @param foc The focal distance
4858  */
4859 EAPI void              evas_map_util_3d_perspective                  (Evas_Map *m, Evas_Coord px, Evas_Coord py, Evas_Coord z0, Evas_Coord foc);
4860
4861 /**
4862  * Get the clockwise state of a map
4863  *
4864  * This determines if the output points (X and Y. Z is not used) are
4865  * clockwise or anti-clockwise. This can be used for "back-face culling". This
4866  * is where you hide objects that "face away" from you. In this case objects
4867  * that are not clockwise.
4868  *
4869  * @param m map to query.
4870  * @return 1 if clockwise, 0 otherwise
4871  */
4872 EAPI Eina_Bool         evas_map_util_clockwise_get                   (Evas_Map *m);
4873
4874
4875 /**
4876  * Create map of transformation points to be later used with an Evas object.
4877  *
4878  * This creates a set of points (currently only 4 is supported. no other
4879  * number for @p count will work). That is empty and ready to be modified
4880  * with evas_map calls.
4881  *
4882  * @param count number of points in the map.
4883  * @return a newly allocated map or @c NULL on errors.
4884  *
4885  * @see evas_map_free()
4886  * @see evas_map_dup()
4887  * @see evas_map_point_coord_set()
4888  * @see evas_map_point_image_uv_set()
4889  * @see evas_map_util_points_populate_from_object_full()
4890  * @see evas_map_util_points_populate_from_object()
4891  *
4892  * @see evas_object_map_set()
4893  */
4894 EAPI Evas_Map         *evas_map_new                      (int count);
4895
4896 /**
4897  * Set the smoothing for map rendering
4898  *
4899  * This sets smoothing for map rendering. If the object is a type that has
4900  * its own smoothing settings, then both the smooth settings for this object
4901  * and the map must be turned off. By default smooth maps are enabled.
4902  *
4903  * @param m map to modify. Must not be NULL.
4904  * @param enabled enable or disable smooth map rendering
4905  */
4906 EAPI void              evas_map_smooth_set               (Evas_Map *m, Eina_Bool enabled);
4907
4908 /**
4909  * get the smoothing for map rendering
4910  *
4911  * This gets smoothing for map rendering.
4912  *
4913  * @param m map to get the smooth from. Must not be NULL.
4914  */
4915 EAPI Eina_Bool         evas_map_smooth_get               (const Evas_Map *m);
4916
4917 /**
4918  * Set the alpha flag for map rendering
4919  *
4920  * This sets alpha flag for map rendering. If the object is a type that has
4921  * its own alpha settings, then this will take precedence. Only image objects
4922  * have this currently.
4923  * Setting this off stops alpha blending of the map area, and is
4924  * useful if you know the object and/or all sub-objects is 100% solid.
4925  *
4926  * @param m map to modify. Must not be NULL.
4927  * @param enabled enable or disable alpha map rendering
4928  */
4929 EAPI void              evas_map_alpha_set                (Evas_Map *m, Eina_Bool enabled);
4930
4931 /**
4932  * get the alpha flag for map rendering
4933  *
4934  * This gets the alpha flag for map rendering.
4935  *
4936  * @param m map to get the alpha from. Must not be NULL.
4937  */
4938 EAPI Eina_Bool         evas_map_alpha_get                (const Evas_Map *m);
4939
4940 /**
4941  * Copy a previously allocated map.
4942  *
4943  * This makes a duplicate of the @p m object and returns it.
4944  *
4945  * @param m map to copy. Must not be NULL.
4946  * @return newly allocated map with the same count and contents as @p m.
4947  */
4948 EAPI Evas_Map         *evas_map_dup                      (const Evas_Map *m);
4949
4950 /**
4951  * Free a previously allocated map.
4952  *
4953  * This frees a givem map @p m and all memory associated with it. You must NOT
4954  * free a map returned by evas_object_map_get() as this is internal.
4955  *
4956  * @param m map to free.
4957  */
4958 EAPI void              evas_map_free                     (Evas_Map *m);
4959
4960 /**
4961  * Get a maps size.
4962  *
4963  * Returns the number of points in a map.  Should be at least 4.
4964  *
4965  * @param m map to get size.
4966  * @return -1 on error, points otherwise.
4967  */
4968 EAPI int               evas_map_count_get               (const Evas_Map *m) EINA_CONST;
4969
4970 /**
4971  * Change the map point's coordinate.
4972  *
4973  * This sets the fixed point's coordinate in the map. Note that points
4974  * describe the outline of a quadrangle and are ordered either clockwise
4975  * or anti-clock-wise. It is suggested to keep your quadrangles concave and
4976  * non-complex, though these polygon modes may work, they may not render
4977  * a desired set of output. The quadrangle will use points 0 and 1 , 1 and 2,
4978  * 2 and 3, and 3 and 0 to describe the edges of the quadrangle.
4979  *
4980  * The X and Y and Z coordinates are in canvas units. Z is optional and may
4981  * or may not be honored in drawing. Z is a hint and does not affect the
4982  * X and Y rendered coordinates. It may be used for calculating fills with
4983  * perspective correct rendering.
4984  *
4985  * Remember all coordinates are canvas global ones like with move and resize
4986  * in evas.
4987  *
4988  * @param m map to change point. Must not be @c NULL.
4989  * @param idx index of point to change. Must be smaller than map size.
4990  * @param x Point X Coordinate
4991  * @param y Point Y Coordinate
4992  * @param z Point Z Coordinate hint (pre-perspective transform)
4993  *
4994  * @see evas_map_util_rotate()
4995  * @see evas_map_util_zoom()
4996  * @see evas_map_util_points_populate_from_object_full()
4997  * @see evas_map_util_points_populate_from_object()
4998  */
4999 EAPI void              evas_map_point_coord_set          (Evas_Map *m, int idx, Evas_Coord x, Evas_Coord y, Evas_Coord z);
5000
5001 /**
5002  * Get the map point's coordinate.
5003  *
5004  * This returns the coordinates of the given point in the map.
5005  *
5006  * @param m map to query point.
5007  * @param idx index of point to query. Must be smaller than map size.
5008  * @param x where to return the X coordinate.
5009  * @param y where to return the Y coordinate.
5010  * @param z where to return the Z coordinate.
5011  */
5012 EAPI void              evas_map_point_coord_get          (const Evas_Map *m, int idx, Evas_Coord *x, Evas_Coord *y, Evas_Coord *z);
5013
5014 /**
5015  * Change the map point's U and V texture source point
5016  *
5017  * This sets the U and V coordinates for the point. This determines which
5018  * coordinate in the source image is mapped to the given point, much like
5019  * OpenGL and textures. Notes that these points do select the pixel, but
5020  * are double floating point values to allow for accuracy and sub-pixel
5021  * selection.
5022  *
5023  * @param m map to change the point of.
5024  * @param idx index of point to change. Must be smaller than map size.
5025  * @param u the X coordinate within the image/texture source
5026  * @param v the Y coordinate within the image/texture source
5027  *
5028  * @see evas_map_point_coord_set()
5029  * @see evas_object_map_set()
5030  * @see evas_map_util_points_populate_from_object_full()
5031  * @see evas_map_util_points_populate_from_object()
5032  */
5033 EAPI void              evas_map_point_image_uv_set       (Evas_Map *m, int idx, double u, double v);
5034
5035 /**
5036  * Get the map point's U and V texture source points
5037  *
5038  * This returns the texture points set by evas_map_point_image_uv_set().
5039  *
5040  * @param m map to query point.
5041  * @param idx index of point to query. Must be smaller than map size.
5042  * @param u where to write the X coordinate within the image/texture source
5043  * @param v where to write the Y coordinate within the image/texture source
5044  */
5045 EAPI void              evas_map_point_image_uv_get       (const Evas_Map *m, int idx, double *u, double *v);
5046
5047 /**
5048  * Set the color of a vertex in the map
5049  *
5050  * This sets the color of the vertex in the map. Colors will be linearly
5051  * interpolated between vertex points through the map. Color will multiply
5052  * the "texture" pixels (like GL_MODULATE in OpenGL). The default color of
5053  * a vertex in a map is white solid (255, 255, 255, 255) which means it will
5054  * have no affect on modifying the texture pixels.
5055  *
5056  * @param m map to change the color of.
5057  * @param idx index of point to change. Must be smaller than map size.
5058  * @param r red (0 - 255)
5059  * @param g green (0 - 255)
5060  * @param b blue (0 - 255)
5061  * @param a alpha (0 - 255)
5062  *
5063  * @see evas_map_util_points_color_set()
5064  * @see evas_map_point_coord_set()
5065  * @see evas_object_map_set()
5066  */
5067 EAPI void              evas_map_point_color_set          (Evas_Map *m, int idx, int r, int g, int b, int a);
5068
5069 /**
5070  * Get the color set on a vertex in the map
5071  *
5072  * This gets the color set by evas_map_point_color_set() on the given vertex
5073  * of the map.
5074  *
5075  * @param m map to get the color of the vertex from.
5076  * @param idx index of point get. Must be smaller than map size.
5077  * @param r pointer to red return
5078  * @param g pointer to green return
5079  * @param b pointer to blue return
5080  * @param a pointer to alpha return (0 - 255)
5081  *
5082  * @see evas_map_point_coord_set()
5083  * @see evas_object_map_set()
5084  */
5085 EAPI void              evas_map_point_color_get          (const Evas_Map *m, int idx, int *r, int *g, int *b, int *a);
5086 /**
5087  * @}
5088  */
5089
5090 /**
5091  * @defgroup Evas_Object_Group_Size_Hints Size Hints
5092  *
5093  * Objects may carry hints, so that another object that acts as a
5094  * manager (see @ref Evas_Smart_Object_Group) may know how to properly
5095  * position and resize its subordinate objects. The Size Hints provide
5096  * a common interface that is recommended as the protocol for such
5097  * information.
5098  *
5099  * For example, box objects use alignment hints to align its
5100  * lines/columns inside its container, padding hints to set the
5101  * padding between each individual child, etc.
5102  *
5103  * Examples on their usage:
5104  * - @ref Example_Evas_Size_Hints "evas-hints.c"
5105  * - @ref Example_Evas_Aspect_Hints "evas-aspect-hints.c"
5106  *
5107  * @ingroup Evas_Object_Group
5108  */
5109
5110 /**
5111  * @addtogroup Evas_Object_Group_Size_Hints
5112  * @{
5113  */
5114
5115 /**
5116  * Retrieves the hints for an object's minimum size.
5117  *
5118  * @param obj The given Evas object to query hints from.
5119  * @param w Pointer to an integer in which to store the minimum width.
5120  * @param h Pointer to an integer in which to store the minimum height.
5121  *
5122  * These are hints on the minimim sizes @p obj should have. This is
5123  * not a size enforcement in any way, it's just a hint that should be
5124  * used whenever appropriate.
5125  *
5126  * @note Use @c NULL pointers on the hint components you're not
5127  * interested in: they'll be ignored by the function.
5128  *
5129  * @see evas_object_size_hint_min_set() for an example
5130  */
5131 EAPI void              evas_object_size_hint_min_get     (const Evas_Object *obj, Evas_Coord *w, Evas_Coord *h) EINA_ARG_NONNULL(1);
5132
5133 /**
5134  * Sets the hints for an object's minimum size.
5135  *
5136  * @param obj The given Evas object to query hints from.
5137  * @param w Integer to use as the minimum width hint.
5138  * @param h Integer to use as the minimum height hint.
5139  *
5140  * This is not a size enforcement in any way, it's just a hint that
5141  * should be used whenever appropriate.
5142  *
5143  * Values @c 0 will be treated as unset hint components, when queried
5144  * by managers.
5145  *
5146  * Example:
5147  * @dontinclude evas-hints.c
5148  * @skip evas_object_size_hint_min_set
5149  * @until return
5150  *
5151  * In this example the minimum size hints change the behavior of an
5152  * Evas box when layouting its children. See the full @ref
5153  * Example_Evas_Size_Hints "example".
5154  *
5155  * @see evas_object_size_hint_min_get()
5156  */
5157 EAPI void              evas_object_size_hint_min_set     (Evas_Object *obj, Evas_Coord w, Evas_Coord h) EINA_ARG_NONNULL(1);
5158
5159 /**
5160  * Retrieves the hints for an object's maximum size.
5161  *
5162  * @param obj The given Evas object to query hints from.
5163  * @param w Pointer to an integer in which to store the maximum width.
5164  * @param h Pointer to an integer in which to store the maximum height.
5165  *
5166  * These are hints on the maximum sizes @p obj should have. This is
5167  * not a size enforcement in any way, it's just a hint that should be
5168  * used whenever appropriate.
5169  *
5170  * @note Use @c NULL pointers on the hint components you're not
5171  * interested in: they'll be ignored by the function.
5172  *
5173  * @see evas_object_size_hint_max_set()
5174  */
5175 EAPI void              evas_object_size_hint_max_get     (const Evas_Object *obj, Evas_Coord *w, Evas_Coord *h) EINA_ARG_NONNULL(1);
5176
5177 /**
5178  * Sets the hints for an object's maximum size.
5179  *
5180  * @param obj The given Evas object to query hints from.
5181  * @param w Integer to use as the maximum width hint.
5182  * @param h Integer to use as the maximum height hint.
5183  *
5184  * This is not a size enforcement in any way, it's just a hint that
5185  * should be used whenever appropriate.
5186  *
5187  * Values @c -1 will be treated as unset hint components, when queried
5188  * by managers.
5189  *
5190  * Example:
5191  * @dontinclude evas-hints.c
5192  * @skip evas_object_size_hint_max_set
5193  * @until return
5194  *
5195  * In this example the maximum size hints change the behavior of an
5196  * Evas box when layouting its children. See the full @ref
5197  * Example_Evas_Size_Hints "example".
5198  *
5199  * @see evas_object_size_hint_max_get()
5200  */
5201 EAPI void              evas_object_size_hint_max_set     (Evas_Object *obj, Evas_Coord w, Evas_Coord h) EINA_ARG_NONNULL(1);
5202
5203 /**
5204  * Retrieves the hints for an object's optimum size.
5205  *
5206  * @param obj The given Evas object to query hints from.
5207  * @param w Pointer to an integer in which to store the requested width.
5208  * @param h Pointer to an integer in which to store the requested height.
5209  *
5210  * These are hints on the optimum sizes @p obj should have. This is
5211  * not a size enforcement in any way, it's just a hint that should be
5212  * used whenever appropriate.
5213  *
5214  * @note Use @c NULL pointers on the hint components you're not
5215  * interested in: they'll be ignored by the function.
5216  *
5217  * @see evas_object_size_hint_request_set()
5218  */
5219 EAPI void              evas_object_size_hint_request_get (const Evas_Object *obj, Evas_Coord *w, Evas_Coord *h) EINA_ARG_NONNULL(1);
5220
5221 /**
5222  * Sets the hints for an object's optimum size.
5223  *
5224  * @param obj The given Evas object to query hints from.
5225  * @param w Integer to use as the preferred width hint.
5226  * @param h Integer to use as the preferred height hint.
5227  *
5228  * This is not a size enforcement in any way, it's just a hint that
5229  * should be used whenever appropriate.
5230  *
5231  * Values @c 0 will be treated as unset hint components, when queried
5232  * by managers.
5233  *
5234  * @see evas_object_size_hint_request_get()
5235  */
5236 EAPI void              evas_object_size_hint_request_set (Evas_Object *obj, Evas_Coord w, Evas_Coord h) EINA_ARG_NONNULL(1);
5237
5238 /**
5239  * Retrieves the hints for an object's aspect ratio.
5240  *
5241  * @param obj The given Evas object to query hints from.
5242  * @param aspect Returns the policy/type of aspect ratio applied to @p obj.
5243  * @param w Pointer to an integer in which to store the aspect's width
5244  * ratio term.
5245  * @param h Pointer to an integer in which to store the aspect's
5246  * height ratio term.
5247  *
5248  * The different aspect ratio policies are documented in the
5249  * #Evas_Aspect_Control type. A container respecting these size hints
5250  * would @b resize its children accordingly to those policies.
5251  *
5252  * For any policy, if any of the given aspect ratio terms are @c 0,
5253  * the object's container should ignore the aspect and scale @p obj to
5254  * occupy the whole available area. If they are both positive
5255  * integers, that proportion will be respected, under each scaling
5256  * policy.
5257  *
5258  * These images illustrate some of the #Evas_Aspect_Control policies:
5259  *
5260  * @image html any-policy.png
5261  * @image rtf any-policy.png
5262  * @image latex any-policy.eps
5263  *
5264  * @image html aspect-control-none-neither.png
5265  * @image rtf aspect-control-none-neither.png
5266  * @image latex aspect-control-none-neither.eps
5267  *
5268  * @image html aspect-control-both.png
5269  * @image rtf aspect-control-both.png
5270  * @image latex aspect-control-both.eps
5271  *
5272  * @image html aspect-control-horizontal.png
5273  * @image rtf aspect-control-horizontal.png
5274  * @image latex aspect-control-horizontal.eps
5275  *
5276  * This is not a size enforcement in any way, it's just a hint that
5277  * should be used whenever appropriate.
5278  *
5279  * @note Use @c NULL pointers on the hint components you're not
5280  * interested in: they'll be ignored by the function.
5281  *
5282  * Example:
5283  * @dontinclude evas-aspect-hints.c
5284  * @skip if (strcmp(ev->keyname, "c") == 0)
5285  * @until }
5286  *
5287  * See the full @ref Example_Evas_Aspect_Hints "example".
5288  *
5289  * @see evas_object_size_hint_aspect_set()
5290  */
5291 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);
5292
5293 /**
5294  * Sets the hints for an object's aspect ratio.
5295  *
5296  * @param obj The given Evas object to query hints from.
5297  * @param aspect The policy/type of aspect ratio to apply to @p obj.
5298  * @param w Integer to use as aspect width ratio term.
5299  * @param h Integer to use as aspect height ratio term.
5300  *
5301  * This is not a size enforcement in any way, it's just a hint that should
5302  * be used whenever appropriate.
5303  *
5304  * If any of the given aspect ratio terms are @c 0,
5305  * the object's container will ignore the aspect and scale @p obj to
5306  * occupy the whole available area, for any given policy.
5307  *
5308  * @see evas_object_size_hint_aspect_get() for more information.
5309  */
5310 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);
5311
5312 /**
5313  * Retrieves the hints for on object's alignment.
5314  *
5315  * @param obj The given Evas object to query hints from.
5316  * @param x Pointer to a double in which to store the horizontal
5317  * alignment hint.
5318  * @param y Pointer to a double in which to store the vertical
5319  * alignment hint.
5320  *
5321  * This is not a size enforcement in any way, it's just a hint that
5322  * should be used whenever appropriate.
5323  *
5324  * @note Use @c NULL pointers on the hint components you're not
5325  * interested in: they'll be ignored by the function.
5326  * @note If @c obj is invalid, then the hint components will be set with 0.5
5327  *
5328  * @see evas_object_size_hint_align_set() for more information
5329  */
5330 EAPI void              evas_object_size_hint_align_get   (const Evas_Object *obj, double *x, double *y) EINA_ARG_NONNULL(1);
5331
5332 /**
5333  * Sets the hints for an object's alignment.
5334  *
5335  * @param obj The given Evas object to query hints from.
5336  * @param x Double, ranging from @c 0.0 to @c 1.0 or with the
5337  * special value #EVAS_HINT_FILL, to use as horizontal alignment hint.
5338  * @param y Double, ranging from @c 0.0 to @c 1.0 or with the
5339  * special value #EVAS_HINT_FILL, to use as vertical alignment hint.
5340  *
5341  * These are hints on how to align an object <b>inside the boundaries
5342  * of a container/manager</b>. Accepted values are in the @c 0.0 to @c
5343  * 1.0 range, with the special value #EVAS_HINT_FILL used to specify
5344  * "justify" or "fill" by some users. In this case, maximum size hints
5345  * should be enforced with higher priority, if they are set. Also, any
5346  * padding hint set on objects should add up to the alignment space on
5347  * the final scene composition.
5348  *
5349  * See documentation of possible users: in Evas, they are the @ref
5350  * Evas_Object_Box "box" and @ref Evas_Object_Table "table" smart
5351  * objects.
5352  *
5353  * For the horizontal component, @c 0.0 means to the left, @c 1.0
5354  * means to the right. Analogously, for the vertical component, @c 0.0
5355  * to the top, @c 1.0 means to the bottom.
5356  *
5357  * See the following figure:
5358  *
5359  * @image html alignment-hints.png
5360  * @image rtf alignment-hints.png
5361  * @image latex alignment-hints.eps
5362  *
5363  * This is not a size enforcement in any way, it's just a hint that
5364  * should be used whenever appropriate.
5365  *
5366  * Example:
5367  * @dontinclude evas-hints.c
5368  * @skip evas_object_size_hint_align_set
5369  * @until return
5370  *
5371  * In this example the alignment hints change the behavior of an Evas
5372  * box when layouting its children. See the full @ref
5373  * Example_Evas_Size_Hints "example".
5374  *
5375  * @see evas_object_size_hint_align_get()
5376  * @see evas_object_size_hint_max_set()
5377  * @see evas_object_size_hint_padding_set()
5378  */
5379 EAPI void              evas_object_size_hint_align_set   (Evas_Object *obj, double x, double y) EINA_ARG_NONNULL(1);
5380
5381 /**
5382  * Retrieves the hints for an object's weight.
5383  *
5384  * @param obj The given Evas object to query hints from.
5385  * @param x Pointer to a double in which to store the horizontal weight.
5386  * @param y Pointer to a double in which to store the vertical weight.
5387  *
5388  * Accepted values are zero or positive values. Some users might use
5389  * this hint as a boolean, but some might consider it as a @b
5390  * proportion, see documentation of possible users, which in Evas are
5391  * the @ref Evas_Object_Box "box" and @ref Evas_Object_Table "table"
5392  * smart objects.
5393  *
5394  * This is not a size enforcement in any way, it's just a hint that
5395  * should be used whenever appropriate.
5396  *
5397  * @note Use @c NULL pointers on the hint components you're not
5398  * interested in: they'll be ignored by the function.
5399  * @note If @c obj is invalid, then the hint components will be set with 0.0
5400  *
5401  * @see evas_object_size_hint_weight_set() for an example
5402  */
5403 EAPI void              evas_object_size_hint_weight_get  (const Evas_Object *obj, double *x, double *y) EINA_ARG_NONNULL(1);
5404
5405 /**
5406  * Sets the hints for an object's weight.
5407  *
5408  * @param obj The given Evas object to query hints from.
5409  * @param x Nonnegative double value to use as horizontal weight hint.
5410  * @param y Nonnegative double value to use as vertical weight hint.
5411  *
5412  * This is not a size enforcement in any way, it's just a hint that
5413  * should be used whenever appropriate.
5414  *
5415  * This is a hint on how a container object should @b resize a given
5416  * child within its area. Containers may adhere to the simpler logic
5417  * of just expanding the child object's dimensions to fit its own (see
5418  * the #EVAS_HINT_EXPAND helper weight macro) or the complete one of
5419  * taking each child's weight hint as real @b weights to how much of
5420  * its size to allocate for them in each axis. A container is supposed
5421  * to, after @b normalizing the weights of its children (with weight
5422  * hints), distribute the space it has to layout them by those factors
5423  * -- most weighted children get larger in this process than the least
5424  * ones.
5425  *
5426  * Example:
5427  * @dontinclude evas-hints.c
5428  * @skip evas_object_size_hint_weight_set
5429  * @until return
5430  *
5431  * In this example the weight hints change the behavior of an Evas box
5432  * when layouting its children. See the full @ref
5433  * Example_Evas_Size_Hints "example".
5434  *
5435  * @see evas_object_size_hint_weight_get() for more information
5436  */
5437 EAPI void              evas_object_size_hint_weight_set  (Evas_Object *obj, double x, double y) EINA_ARG_NONNULL(1);
5438
5439 /**
5440  * Retrieves the hints for an object's padding space.
5441  *
5442  * @param obj The given Evas object to query hints from.
5443  * @param l Pointer to an integer in which to store left padding.
5444  * @param r Pointer to an integer in which to store right padding.
5445  * @param t Pointer to an integer in which to store top padding.
5446  * @param b Pointer to an integer in which to store bottom padding.
5447  *
5448  * Padding is extra space an object takes on each of its delimiting
5449  * rectangle sides, in canvas units. This space will be rendered
5450  * transparent, naturally, as in the following figure:
5451  *
5452  * @image html padding-hints.png
5453  * @image rtf padding-hints.png
5454  * @image latex padding-hints.eps
5455  *
5456  * This is not a size enforcement in any way, it's just a hint that
5457  * should be used whenever appropriate.
5458  *
5459  * @note Use @c NULL pointers on the hint components you're not
5460  * interested in: they'll be ignored by the function.
5461  *
5462  * Example:
5463  * @dontinclude evas-hints.c
5464  * @skip evas_object_size_hint_padding_set
5465  * @until return
5466  *
5467  * In this example the padding hints change the behavior of an Evas box
5468  * when layouting its children. See the full @ref
5469  * Example_Evas_Size_Hints "example".
5470  *
5471  * @see evas_object_size_hint_padding_set()
5472  */
5473 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);
5474
5475 /**
5476  * Sets the hints for an object's padding space.
5477  *
5478  * @param obj The given Evas object to query hints from.
5479  * @param l Integer to specify left padding.
5480  * @param r Integer to specify right padding.
5481  * @param t Integer to specify top padding.
5482  * @param b Integer to specify bottom padding.
5483  *
5484  * This is not a size enforcement in any way, it's just a hint that
5485  * should be used whenever appropriate.
5486  *
5487  * @see evas_object_size_hint_padding_get() for more information
5488  */
5489 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);
5490
5491 /**
5492  * @}
5493  */
5494
5495 /**
5496  * @defgroup Evas_Object_Group_Extras Extra Object Manipulation
5497  *
5498  * Miscellaneous functions that also apply to any object, but are less
5499  * used or not implemented by all objects.
5500  *
5501  * Examples on this group of functions can be found @ref
5502  * Example_Evas_Stacking "here" and @ref Example_Evas_Events "here".
5503  *
5504  * @ingroup Evas_Object_Group
5505  */
5506
5507 /**
5508  * @addtogroup Evas_Object_Group_Extras
5509  * @{
5510  */
5511
5512 /**
5513  * Set an attached data pointer to an object with a given string key.
5514  *
5515  * @param obj The object to attach the data pointer to
5516  * @param key The string key for the data to access it
5517  * @param data The pointer to the data to be attached
5518  *
5519  * This attaches the pointer @p data to the object @p obj, given the
5520  * access string @p key. This pointer will stay "hooked" to the object
5521  * until a new pointer with the same string key is attached with
5522  * evas_object_data_set() or it is deleted with
5523  * evas_object_data_del(). On deletion of the object @p obj, the
5524  * pointers will not be accessible from the object anymore.
5525  *
5526  * You can find the pointer attached under a string key using
5527  * evas_object_data_get(). It is the job of the calling application to
5528  * free any data pointed to by @p data when it is no longer required.
5529  *
5530  * If @p data is @c NULL, the old value stored at @p key will be
5531  * removed but no new value will be stored. This is synonymous with
5532  * calling evas_object_data_del() with @p obj and @p key.
5533  *
5534  * @note This function is very handy when you have data associated
5535  * specifically to an Evas object, being of use only when dealing with
5536  * it. Than you don't have the burden to a pointer to it elsewhere,
5537  * using this family of functions.
5538  *
5539  * Example:
5540  *
5541  * @code
5542  * int *my_data;
5543  * extern Evas_Object *obj;
5544  *
5545  * my_data = malloc(500);
5546  * evas_object_data_set(obj, "name_of_data", my_data);
5547  * printf("The data that was attached was %p\n", evas_object_data_get(obj, "name_of_data"));
5548  * @endcode
5549  */
5550 EAPI void                      evas_object_data_set             (Evas_Object *obj, const char *key, const void *data) EINA_ARG_NONNULL(1, 2);
5551
5552 /**
5553  * Return an attached data pointer on an Evas object by its given
5554  * string key.
5555  *
5556  * @param obj The object to which the data was attached
5557  * @param key The string key the data was stored under
5558  * @return The data pointer stored, or @c NULL if none was stored
5559  *
5560  * This function will return the data pointer attached to the object
5561  * @p obj, stored using the string key @p key. If the object is valid
5562  * and a data pointer was stored under the given key, that pointer
5563  * will be returned. If this is not the case, @c NULL will be
5564  * returned, signifying an invalid object or a non-existent key. It is
5565  * possible that a @c NULL pointer was stored given that key, but this
5566  * situation is non-sensical and thus can be considered an error as
5567  * well. @c NULL pointers are never stored as this is the return value
5568  * if an error occurs.
5569  *
5570  * Example:
5571  *
5572  * @code
5573  * int *my_data;
5574  * extern Evas_Object *obj;
5575  *
5576  * my_data = evas_object_data_get(obj, "name_of_my_data");
5577  * if (my_data) printf("Data stored was %p\n", my_data);
5578  * else printf("No data was stored on the object\n");
5579  * @endcode
5580  */
5581 EAPI void                     *evas_object_data_get             (const Evas_Object *obj, const char *key) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2);
5582
5583 /**
5584  * Delete an attached data pointer from an object.
5585  *
5586  * @param obj The object to delete the data pointer from
5587  * @param key The string key the data was stored under
5588  * @return The original data pointer stored at @p key on @p obj
5589  *
5590  * This will remove the stored data pointer from @p obj stored under
5591  * @p key and return this same pointer, if actually there was data
5592  * there, or @c NULL, if nothing was stored under that key.
5593  *
5594  * Example:
5595  *
5596  * @code
5597  * int *my_data;
5598  * extern Evas_Object *obj;
5599  *
5600  * my_data = evas_object_data_del(obj, "name_of_my_data");
5601  * @endcode
5602  */
5603 EAPI void                     *evas_object_data_del             (Evas_Object *obj, const char *key) EINA_ARG_NONNULL(1, 2);
5604
5605
5606 /**
5607  * Set pointer behavior.
5608  *
5609  * @param obj
5610  * @param setting desired behavior.
5611  *
5612  * This function has direct effect on event callbacks related to
5613  * mouse.
5614  *
5615  * If @p setting is EVAS_OBJECT_POINTER_MODE_AUTOGRAB, then when mouse
5616  * is down at this object, events will be restricted to it as source,
5617  * mouse moves, for example, will be emitted even if outside this
5618  * object area.
5619  *
5620  * If @p setting is EVAS_OBJECT_POINTER_MODE_NOGRAB, then events will
5621  * be emitted just when inside this object area.
5622  *
5623  * The default value is EVAS_OBJECT_POINTER_MODE_AUTOGRAB.
5624  *
5625  * @ingroup Evas_Object_Group_Extras
5626  */
5627 EAPI void                      evas_object_pointer_mode_set     (Evas_Object *obj, Evas_Object_Pointer_Mode setting) EINA_ARG_NONNULL(1);
5628
5629 /**
5630  * Determine how pointer will behave.
5631  * @param obj
5632  * @return pointer behavior.
5633  * @ingroup Evas_Object_Group_Extras
5634  */
5635 EAPI Evas_Object_Pointer_Mode  evas_object_pointer_mode_get     (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
5636
5637
5638 /**
5639  * Sets whether or not the given Evas object is to be drawn anti-aliased.
5640  *
5641  * @param   obj The given Evas object.
5642  * @param   antialias 1 if the object is to be anti_aliased, 0 otherwise.
5643  * @ingroup Evas_Object_Group_Extras
5644  */
5645 EAPI void                      evas_object_anti_alias_set       (Evas_Object *obj, Eina_Bool antialias) EINA_ARG_NONNULL(1);
5646
5647 /**
5648  * Retrieves whether or not the given Evas object is to be drawn anti_aliased.
5649  * @param   obj The given Evas object.
5650  * @return  @c 1 if the object is to be anti_aliased.  @c 0 otherwise.
5651  * @ingroup Evas_Object_Group_Extras
5652  */
5653 EAPI Eina_Bool                 evas_object_anti_alias_get       (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
5654
5655
5656 /**
5657  * Sets the scaling factor for an Evas object. Does not affect all
5658  * objects.
5659  *
5660  * @param obj The given Evas object.
5661  * @param scale The scaling factor. <c>1.0</c> means no scaling,
5662  *        default size.
5663  *
5664  * This will multiply the object's dimension by the given factor, thus
5665  * altering its geometry (width and height). Useful when you want
5666  * scalable UI elements, possibly at run time.
5667  *
5668  * @note Only text and textblock objects have scaling change
5669  * handlers. Other objects won't change visually on this call.
5670  *
5671  * @see evas_object_scale_get()
5672  *
5673  * @ingroup Evas_Object_Group_Extras
5674  */
5675 EAPI void                      evas_object_scale_set            (Evas_Object *obj, double scale) EINA_ARG_NONNULL(1);
5676
5677 /**
5678  * Retrieves the scaling factor for the given Evas object.
5679  *
5680  * @param   obj The given Evas object.
5681  * @return  The scaling factor.
5682  *
5683  * @ingroup Evas_Object_Group_Extras
5684  *
5685  * @see evas_object_scale_set()
5686  */
5687 EAPI double                    evas_object_scale_get            (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
5688
5689
5690 /**
5691  * Sets the render_op to be used for rendering the Evas object.
5692  * @param   obj The given Evas object.
5693  * @param   op one of the Evas_Render_Op values.
5694  * @ingroup Evas_Object_Group_Extras
5695  */
5696 EAPI void                      evas_object_render_op_set        (Evas_Object *obj, Evas_Render_Op op) EINA_ARG_NONNULL(1);
5697
5698 /**
5699  * Retrieves the current value of the operation used for rendering the Evas object.
5700  * @param   obj The given Evas object.
5701  * @return  one of the enumerated values in Evas_Render_Op.
5702  * @ingroup Evas_Object_Group_Extras
5703  */
5704 EAPI Evas_Render_Op            evas_object_render_op_get        (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
5705
5706 /**
5707  * Set whether to use precise (usually expensive) point collision
5708  * detection for a given Evas object.
5709  *
5710  * @param obj The given object.
5711  * @param precise Whether to use precise point collision detection or
5712  * not. The default value is false.
5713  *
5714  * Use this function to make Evas treat objects' transparent areas as
5715  * @b not belonging to it with regard to mouse pointer events. By
5716  * default, all of the object's boundary rectangle will be taken in
5717  * account for them.
5718  *
5719  * @warning By using precise point collision detection you'll be
5720  * making Evas more resource intensive.
5721  *
5722  * Example code follows.
5723  * @dontinclude evas-events.c
5724  * @skip if (strcmp(ev->keyname, "p") == 0)
5725  * @until }
5726  *
5727  * See the full example @ref Example_Evas_Events "here".
5728  *
5729  * @see evas_object_precise_is_inside_get()
5730  * @ingroup Evas_Object_Group_Extras
5731  */
5732    EAPI void                      evas_object_precise_is_inside_set(Evas_Object *obj, Eina_Bool precise) EINA_ARG_NONNULL(1);
5733
5734 /**
5735  * Determine whether an object is set to use precise point collision
5736  * detection.
5737  *
5738  * @param obj The given object.
5739  * @return whether @p obj is set to use precise point collision
5740  * detection or not The default value is false.
5741  *
5742  * @see evas_object_precise_is_inside_set() for an example
5743  *
5744  * @ingroup Evas_Object_Group_Extras
5745  */
5746    EAPI Eina_Bool                 evas_object_precise_is_inside_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
5747
5748 /**
5749  * Set a hint flag on the given Evas object that it's used as a "static
5750  * clipper".
5751  *
5752  * @param obj The given object.
5753  * @param is_static_clip @c EINA_TRUE if it's to be used as a static
5754  * clipper, @c EINA_FALSE otherwise.
5755  *
5756  * This is a hint to Evas that this object is used as a big static
5757  * clipper and shouldn't be moved with children and otherwise
5758  * considered specially. The default value for new objects is 
5759  * @c EINA_FALSE.
5760  *
5761  * @see evas_object_static_clip_get()
5762  *
5763  * @ingroup Evas_Object_Group_Extras
5764  */
5765    EAPI void                      evas_object_static_clip_set      (Evas_Object *obj, Eina_Bool is_static_clip) EINA_ARG_NONNULL(1);
5766
5767 /**
5768  * Get the "static clipper" hint flag for a given Evas object.
5769  *
5770  * @param obj The given object.
5771  * @return @c EINA_TRUE if it's set as a static clipper,
5772  * @c EINA_FALSE otherwise.
5773  *
5774  * @see evas_object_static_clip_set() for more details
5775  *
5776  * @ingroup Evas_Object_Group_Extras
5777  */
5778    EAPI Eina_Bool                 evas_object_static_clip_get      (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
5779
5780 /**
5781  * @}
5782  */
5783
5784 /**
5785  * @defgroup Evas_Object_Group_Find Finding Objects
5786  *
5787  * Functions that allows finding objects by their position, name or
5788  * other properties.
5789  *
5790  * @ingroup Evas_Object_Group
5791  */
5792
5793 /**
5794  * @addtogroup Evas_Object_Group_Find
5795  * @{
5796  */
5797
5798 /**
5799  * Retrieve the object that currently has focus.
5800  *
5801  * @param e The Evas canvas to query for focused object on.
5802  * @return The object that has focus or @c NULL if there is not one.
5803  *
5804  * Evas can have (at most) one of its objects focused at a time.
5805  * Focused objects will be the ones having <b>key events</b> delivered
5806  * to, which the programmer can act upon by means of
5807  * evas_object_event_callback_add() usage.
5808  *
5809  * @note Most users wouldn't be dealing directly with Evas' focused
5810  * objects. Instead, they would be using a higher level library for
5811  * that (like a toolkit, as Elementary) to handle focus and who's
5812  * receiving input for them.
5813  *
5814  * This call returns the object that currently has focus on the canvas
5815  * @p e or @c NULL, if none.
5816  *
5817  * @see evas_object_focus_set
5818  * @see evas_object_focus_get
5819  * @see evas_object_key_grab
5820  * @see evas_object_key_ungrab
5821  *
5822  * Example:
5823  * @dontinclude evas-events.c
5824  * @skip evas_event_callback_add(d.canvas, EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_IN,
5825  * @until evas_object_focus_set(d.bg, EINA_TRUE);
5826  * @dontinclude evas-events.c
5827  * @skip called when our rectangle gets focus
5828  * @until }
5829  *
5830  * In this example the @c event_info is exactly a pointer to that
5831  * focused rectangle. See the full @ref Example_Evas_Events "example".
5832  *
5833  * @ingroup Evas_Object_Group_Find
5834  */
5835 EAPI Evas_Object      *evas_focus_get                    (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
5836
5837 /**
5838  * Retrieves the object on the given evas with the given name.
5839  * @param   e    The given evas.
5840  * @param   name The given name.
5841  * @return  If successful, the Evas object with the given name.  Otherwise,
5842  *          @c NULL.
5843  * 
5844  * This looks for the evas object given a name by evas_object_name_set(). If
5845  * the name is not unique canvas-wide, then which one of the many objects
5846  * with that name is returned is undefined, so only use this if you can ensure
5847  * the object name is unique.
5848  * 
5849  * @ingroup Evas_Object_Group_Find
5850  */
5851 EAPI Evas_Object      *evas_object_name_find             (const Evas *e, const char *name) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
5852
5853 /**
5854  * Retrieves the object from children of the given object with the given name.
5855  * @param   obj  The parent (smart) object whose children to search.
5856  * @param   name The given name.
5857  * @param   recurse Set to the number of child levels to recurse (0 == don't recurse, 1 == only look at the children of @p obj or their immediate children, but no further etc.).
5858  * @return  If successful, the Evas object with the given name.  Otherwise,
5859  *          @c NULL.
5860  * 
5861  * This looks for the evas object given a name by evas_object_name_set(), but
5862  * it ONLY looks at the children of the object *p obj, and will only recurse
5863  * into those children if @p recurse is greater than 0. If the name is not
5864  * unique within immediate children (or the whole child tree) then it is not
5865  * defined which child object will be returned. If @p recurse is set to -1 then
5866  * it will recurse without limit.
5867  * 
5868  * @since 1.2
5869  * 
5870  * @ingroup Evas_Object_Group_Find
5871  */
5872 EAPI Evas_Object      *evas_object_name_child_find        (const Evas_Object *obj, const char *name, int recurse) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
5873
5874 /**
5875  * Retrieve the Evas object stacked at the top of a given position in
5876  * a canvas
5877  *
5878  * @param   e A handle to the canvas.
5879  * @param   x The horizontal coordinate of the position
5880  * @param   y The vertical coordinate of the position
5881  * @param   include_pass_events_objects Boolean flag to include or not
5882  * objects which pass events in this calculation
5883  * @param   include_hidden_objects Boolean flag to include or not hidden
5884  * objects in this calculation
5885  * @return  The Evas object that is over all other objects at the given
5886  * position.
5887  *
5888  * This function will traverse all the layers of the given canvas,
5889  * from top to bottom, querying for objects with areas covering the
5890  * given position. The user can remove from from the query
5891  * objects which are hidden and/or which are set to pass events.
5892  *
5893  * @warning This function will @b skip objects parented by smart
5894  * objects, acting only on the ones at the "top level", with regard to
5895  * object parenting.
5896  */
5897 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);
5898
5899 /**
5900  * Retrieve the Evas object stacked at the top at the position of the
5901  * mouse cursor, over a given canvas
5902  *
5903  * @param   e A handle to the canvas.
5904  * @return  The Evas object that is over all other objects at the mouse
5905  * pointer's position
5906  *
5907  * This function will traverse all the layers of the given canvas,
5908  * from top to bottom, querying for objects with areas covering the
5909  * mouse pointer's position, over @p e.
5910  *
5911  * @warning This function will @b skip objects parented by smart
5912  * objects, acting only on the ones at the "top level", with regard to
5913  * object parenting.
5914  */
5915 EAPI Evas_Object      *evas_object_top_at_pointer_get    (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
5916
5917 /**
5918  * Retrieve the Evas object stacked at the top of a given rectangular
5919  * region in a canvas
5920  *
5921  * @param   e A handle to the canvas.
5922  * @param   x The top left corner's horizontal coordinate for the
5923  * rectangular region
5924  * @param   y The top left corner's vertical coordinate for the
5925  * rectangular region
5926  * @param   w The width of the rectangular region
5927  * @param   h The height of the rectangular region
5928  * @param   include_pass_events_objects Boolean flag to include or not
5929  * objects which pass events in this calculation
5930  * @param   include_hidden_objects Boolean flag to include or not hidden
5931  * objects in this calculation
5932  * @return  The Evas object that is over all other objects at the given
5933  * rectangular region.
5934  *
5935  * This function will traverse all the layers of the given canvas,
5936  * from top to bottom, querying for objects with areas overlapping
5937  * with the given rectangular region inside @p e. The user can remove
5938  * from the query objects which are hidden and/or which are set to
5939  * pass events.
5940  *
5941  * @warning This function will @b skip objects parented by smart
5942  * objects, acting only on the ones at the "top level", with regard to
5943  * object parenting.
5944  */
5945 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);
5946
5947 /**
5948  * Retrieve a list of Evas objects lying over a given position in
5949  * a canvas
5950  *
5951  * @param   e A handle to the canvas.
5952  * @param   x The horizontal coordinate of the position
5953  * @param   y The vertical coordinate of the position
5954  * @param   include_pass_events_objects Boolean flag to include or not
5955  * objects which pass events in this calculation
5956  * @param   include_hidden_objects Boolean flag to include or not hidden
5957  * objects in this calculation
5958  * @return  The list of Evas objects that are over the given position
5959  * in @p e
5960  *
5961  * This function will traverse all the layers of the given canvas,
5962  * from top to bottom, querying for objects with areas covering the
5963  * given position. The user can remove from from the query
5964  * objects which are hidden and/or which are set to pass events.
5965  *
5966  * @warning This function will @b skip objects parented by smart
5967  * objects, acting only on the ones at the "top level", with regard to
5968  * object parenting.
5969  */
5970 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);
5971    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);
5972
5973 /**
5974  * Get the lowest (stacked) Evas object on the canvas @p e.
5975  *
5976  * @param e a valid canvas pointer
5977  * @return a pointer to the lowest object on it, if any, or @c NULL,
5978  * otherwise
5979  *
5980  * This function will take all populated layers in the canvas into
5981  * account, getting the lowest object for the lowest layer, naturally.
5982  *
5983  * @see evas_object_layer_get()
5984  * @see evas_object_layer_set()
5985  * @see evas_object_below_get()
5986  * @see evas_object_above_get()
5987  *
5988  * @warning This function will @b skip objects parented by smart
5989  * objects, acting only on the ones at the "top level", with regard to
5990  * object parenting.
5991  */
5992 EAPI Evas_Object      *evas_object_bottom_get            (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
5993
5994 /**
5995  * Get the highest (stacked) Evas object on the canvas @p e.
5996  *
5997  * @param e a valid canvas pointer
5998  * @return a pointer to the highest object on it, if any, or @c NULL,
5999  * otherwise
6000  *
6001  * This function will take all populated layers in the canvas into
6002  * account, getting the highest object for the highest layer,
6003  * naturally.
6004  *
6005  * @see evas_object_layer_get()
6006  * @see evas_object_layer_set()
6007  * @see evas_object_below_get()
6008  * @see evas_object_above_get()
6009  *
6010  * @warning This function will @b skip objects parented by smart
6011  * objects, acting only on the ones at the "top level", with regard to
6012  * object parenting.
6013  */
6014 EAPI Evas_Object      *evas_object_top_get               (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
6015
6016 /**
6017  * @}
6018  */
6019
6020 /**
6021  * @defgroup Evas_Object_Group_Interceptors Object Method Interceptors
6022  *
6023  * Evas provides a way to intercept method calls. The interceptor
6024  * callback may opt to completely deny the call, or may check and
6025  * change the parameters before continuing. The continuation of an
6026  * intercepted call is done by calling the intercepted call again,
6027  * from inside the interceptor callback.
6028  *
6029  * @ingroup Evas_Object_Group
6030  */
6031
6032 /**
6033  * @addtogroup Evas_Object_Group_Interceptors
6034  * @{
6035  */
6036
6037 typedef void (*Evas_Object_Intercept_Show_Cb) (void *data, Evas_Object *obj);
6038 typedef void (*Evas_Object_Intercept_Hide_Cb) (void *data, Evas_Object *obj);
6039 typedef void (*Evas_Object_Intercept_Move_Cb) (void *data, Evas_Object *obj, Evas_Coord x, Evas_Coord y);
6040 typedef void (*Evas_Object_Intercept_Resize_Cb) (void *data, Evas_Object *obj, Evas_Coord w, Evas_Coord h);
6041 typedef void (*Evas_Object_Intercept_Raise_Cb) (void *data, Evas_Object *obj);
6042 typedef void (*Evas_Object_Intercept_Lower_Cb) (void *data, Evas_Object *obj);
6043 typedef void (*Evas_Object_Intercept_Stack_Above_Cb) (void *data, Evas_Object *obj, Evas_Object *above);
6044 typedef void (*Evas_Object_Intercept_Stack_Below_Cb) (void *data, Evas_Object *obj, Evas_Object *above);
6045 typedef void (*Evas_Object_Intercept_Layer_Set_Cb) (void *data, Evas_Object *obj, int l);
6046 typedef void (*Evas_Object_Intercept_Color_Set_Cb) (void *data, Evas_Object *obj, int r, int g, int b, int a);
6047 typedef void (*Evas_Object_Intercept_Clip_Set_Cb) (void *data, Evas_Object *obj, Evas_Object *clip);
6048 typedef void (*Evas_Object_Intercept_Clip_Unset_Cb) (void *data, Evas_Object *obj);
6049
6050 /**
6051  * Set the callback function that intercepts a show event of a object.
6052  *
6053  * @param obj The given canvas object pointer.
6054  * @param func The given function to be the callback function.
6055  * @param data The data passed to the callback function.
6056  *
6057  * This function sets a callback function to intercepts a show event
6058  * of a canvas object.
6059  *
6060  * @see evas_object_intercept_show_callback_del().
6061  *
6062  */
6063 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);
6064
6065 /**
6066  * Unset the callback function that intercepts a show event of a
6067  * object.
6068  *
6069  * @param obj The given canvas object pointer.
6070  * @param func The given callback function.
6071  *
6072  * This function sets a callback function to intercepts a show event
6073  * of a canvas object.
6074  *
6075  * @see evas_object_intercept_show_callback_add().
6076  *
6077  */
6078 EAPI void             *evas_object_intercept_show_callback_del        (Evas_Object *obj, Evas_Object_Intercept_Show_Cb func) EINA_ARG_NONNULL(1, 2);
6079
6080 /**
6081  * Set the callback function that intercepts a hide event of a object.
6082  *
6083  * @param obj The given canvas object pointer.
6084  * @param func The given function to be the callback function.
6085  * @param data The data passed to the callback function.
6086  *
6087  * This function sets a callback function to intercepts a hide event
6088  * of a canvas object.
6089  *
6090  * @see evas_object_intercept_hide_callback_del().
6091  *
6092  */
6093 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);
6094
6095 /**
6096  * Unset the callback function that intercepts a hide event of a
6097  * object.
6098  *
6099  * @param obj The given canvas object pointer.
6100  * @param func The given callback function.
6101  *
6102  * This function sets a callback function to intercepts a hide event
6103  * of a canvas object.
6104  *
6105  * @see evas_object_intercept_hide_callback_add().
6106  *
6107  */
6108 EAPI void             *evas_object_intercept_hide_callback_del        (Evas_Object *obj, Evas_Object_Intercept_Hide_Cb func) EINA_ARG_NONNULL(1, 2);
6109
6110 /**
6111  * Set the callback function that intercepts a move event of a object.
6112  *
6113  * @param obj The given canvas object pointer.
6114  * @param func The given function to be the callback function.
6115  * @param data The data passed to the callback function.
6116  *
6117  * This function sets a callback function to intercepts a move event
6118  * of a canvas object.
6119  *
6120  * @see evas_object_intercept_move_callback_del().
6121  *
6122  */
6123 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);
6124
6125 /**
6126  * Unset the callback function that intercepts a move event of a
6127  * object.
6128  *
6129  * @param obj The given canvas object pointer.
6130  * @param func The given callback function.
6131  *
6132  * This function sets a callback function to intercepts a move event
6133  * of a canvas object.
6134  *
6135  * @see evas_object_intercept_move_callback_add().
6136  *
6137  */
6138 EAPI void             *evas_object_intercept_move_callback_del        (Evas_Object *obj, Evas_Object_Intercept_Move_Cb func) EINA_ARG_NONNULL(1, 2);
6139
6140    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);
6141    EAPI void             *evas_object_intercept_resize_callback_del      (Evas_Object *obj, Evas_Object_Intercept_Resize_Cb func) EINA_ARG_NONNULL(1, 2);
6142    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);
6143    EAPI void             *evas_object_intercept_raise_callback_del       (Evas_Object *obj, Evas_Object_Intercept_Raise_Cb func) EINA_ARG_NONNULL(1, 2);
6144    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);
6145    EAPI void             *evas_object_intercept_lower_callback_del       (Evas_Object *obj, Evas_Object_Intercept_Lower_Cb func) EINA_ARG_NONNULL(1, 2);
6146    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);
6147    EAPI void             *evas_object_intercept_stack_above_callback_del (Evas_Object *obj, Evas_Object_Intercept_Stack_Above_Cb func) EINA_ARG_NONNULL(1, 2);
6148    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);
6149    EAPI void             *evas_object_intercept_stack_below_callback_del (Evas_Object *obj, Evas_Object_Intercept_Stack_Below_Cb func) EINA_ARG_NONNULL(1, 2);
6150    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);
6151    EAPI void             *evas_object_intercept_layer_set_callback_del   (Evas_Object *obj, Evas_Object_Intercept_Layer_Set_Cb func) EINA_ARG_NONNULL(1, 2);
6152    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);
6153    EAPI void             *evas_object_intercept_color_set_callback_del   (Evas_Object *obj, Evas_Object_Intercept_Color_Set_Cb func) EINA_ARG_NONNULL(1, 2);
6154    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);
6155    EAPI void             *evas_object_intercept_clip_set_callback_del    (Evas_Object *obj, Evas_Object_Intercept_Clip_Set_Cb func) EINA_ARG_NONNULL(1, 2);
6156    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);
6157    EAPI void             *evas_object_intercept_clip_unset_callback_del  (Evas_Object *obj, Evas_Object_Intercept_Clip_Unset_Cb func) EINA_ARG_NONNULL(1, 2);
6158
6159 /**
6160  * @}
6161  */
6162
6163 /**
6164  * @defgroup Evas_Object_Specific Specific Object Functions
6165  *
6166  * Functions that work on specific objects.
6167  *
6168  */
6169
6170 /**
6171  * @defgroup Evas_Object_Rectangle Rectangle Object Functions
6172  *
6173  * @brief Function to create evas rectangle objects.
6174  *
6175  * There is only one function to deal with rectangle objects, this may make this
6176  * function seem useless given there are no functions to manipulate the created
6177  * rectangle, however the rectangle is actually very useful and should be
6178  * manipulated using the generic @ref Evas_Object_Group "evas object functions".
6179  *
6180  * The evas rectangle serves a number of key functions when working on evas
6181  * programs:
6182  * @li Background
6183  * @li Debugging
6184  * @li Clipper
6185  *
6186  * @section Background
6187  *
6188  * One extremely common requirement of evas programs is to have a solid color
6189  * background, this can be accomplished with the following very simple code:
6190  * @code
6191  * Evas_Object *bg = evas_object_rectangle_add(evas_canvas);
6192  * //Here we set the rectangles red, green, blue and opacity levels
6193  * evas_object_color_set(bg, 255, 255, 255, 255); // opaque white background
6194  * evas_object_resize(bg, WIDTH, HEIGHT); // covers full canvas
6195  * evas_object_show(bg);
6196  * @endcode
6197  *
6198  * This however will have issues if the @c evas_canvas is resized, however most
6199  * windows are created using ecore evas and that has a solution to using the
6200  * rectangle as a background:
6201  * @code
6202  * Evas_Object *bg = evas_object_rectangle_add(ecore_evas_get(ee));
6203  * //Here we set the rectangles red, green, blue and opacity levels
6204  * evas_object_color_set(bg, 255, 255, 255, 255); // opaque white background
6205  * evas_object_resize(bg, WIDTH, HEIGHT); // covers full canvas
6206  * evas_object_show(bg);
6207  * ecore_evas_object_associate(ee, bg, ECORE_EVAS_OBJECT_ASSOCIATE_BASE);
6208  * @endcode
6209  * So this gives us a white background to our window that will be resized
6210  * together with it.
6211  *
6212  * @section Debugging
6213  *
6214  * Debugging is a major part of any programmers task and when debugging visual
6215  * issues with evas programs the rectangle is an extremely useful tool. The
6216  * rectangle's simplicity means that it's easier to pinpoint issues with it than
6217  * with more complex objects. Therefore a common technique to use when writing
6218  * an evas program and not getting the desired visual result is to replace the
6219  * misbehaving object for a solid color rectangle and seeing how it interacts
6220  * with the other elements, this often allows us to notice clipping, parenting
6221  * or positioning issues. Once the issues have been identified and corrected the
6222  * rectangle can be replaced for the original part and in all likelihood any
6223  * remaining issues will be specific to that object's type.
6224  *
6225  * @section clipping Clipping
6226  *
6227  * Clipping serves two main functions:
6228  * @li Limiting visibility(i.e. hiding portions of an object).
6229  * @li Applying a layer of color to an object.
6230  *
6231  * @subsection hiding Limiting visibility
6232  *
6233  * It is often necessary to show only parts of an object, while it may be
6234  * possible to create an object that corresponds only to the part that must be
6235  * shown(and it isn't always possible) it's usually easier to use a a clipper. A
6236  * clipper is a rectangle that defines what's visible and what is not. The way
6237  * to do this is to create a solid white rectangle(which is the default, no need
6238  * to call evas_object_color_set()) and give it a position and size of what
6239  * should be visible. The following code exemplifies showing the center half of
6240  * @c my_evas_object:
6241  * @code
6242  * Evas_Object *clipper = evas_object_rectangle_add(evas_canvas);
6243  * evas_object_move(clipper, my_evas_object_x / 4, my_evas_object_y / 4);
6244  * evas_object_resize(clipper, my_evas_object_width / 2, my_evas_object_height / 2);
6245  * evas_object_clip_set(my_evas_object, clipper);
6246  * evas_object_show(clipper);
6247  * @endcode
6248  *
6249  * @subsection color Layer of color
6250  *
6251  * In the @ref clipping section we used a solid white clipper, which produced no
6252  * change in the color of the clipped object, it just hid what was outside the
6253  * clippers area. It is however sometimes desirable to change the of color an
6254  * object, this can be accomplished using a clipper that has a non-white color.
6255  * Clippers with color work by multiplying the colors of clipped object. The
6256  * following code will show how to remove all the red from an object:
6257  * @code
6258  * Evas_Object *clipper = evas_object_rectangle_add(evas);
6259  * evas_object_move(clipper, my_evas_object_x, my_evas_object_y);
6260  * evas_object_resize(clipper, my_evas_object_width, my_evas_object_height);
6261  * evas_object_color_set(clipper, 0, 255, 255, 255);
6262  * evas_object_clip_set(obj, clipper);
6263  * evas_object_show(clipper);
6264  * @endcode
6265  *
6266  * @warning We don't guarantee any proper results if you create a Rectangle 
6267  * object without setting the evas engine. 
6268  *
6269  * For an example that more fully exercise the use of an evas object rectangle
6270  * see @ref Example_Evas_Object_Manipulation.
6271  *
6272  * @ingroup Evas_Object_Specific
6273  */
6274
6275 /**
6276  * Adds a rectangle to the given evas.
6277  * @param   e The given evas.
6278  * @return  The new rectangle object.
6279  *
6280  * @ingroup Evas_Object_Rectangle
6281  */
6282 EAPI Evas_Object      *evas_object_rectangle_add         (Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
6283
6284 /**
6285  * @defgroup Evas_Object_Image Image Object Functions
6286  *
6287  * Here are grouped together functions used to create and manipulate
6288  * image objects. They are available to whichever occasion one needs
6289  * complex imagery on a GUI that could not be achieved by the other
6290  * Evas' primitive object types, or to make image manipulations.
6291  *
6292  * Evas will support whichever image file types it was compiled with
6293  * support to (its image loaders) -- check your software packager for
6294  * that information and see
6295  * evas_object_image_extension_can_load_get().
6296  *
6297  * @section Evas_Object_Image_Basics Image object basics
6298  *
6299  * The most common use of image objects -- to display an image on the
6300  * canvas -- is achieved by a common function triplet:
6301  * @code
6302  * img = evas_object_image_add(canvas);
6303  * evas_object_image_file_set(img, "path/to/img", NULL);
6304  * evas_object_image_fill_set(img, 0, 0, w, h);
6305  * @endcode
6306  * The first function, naturally, is creating the image object. Then,
6307  * one must set an source file on it, so that it knows where to fetch
6308  * image data from. Next, one must set <b>how to fill the image
6309  * object's area</b> with that given pixel data. One could use just a
6310  * sub-region of the original image or even have it tiled repeatedly
6311  * on the image object. For the common case of having the whole source
6312  * image to be displayed on the image object, stretched to the
6313  * destination's size, there's also a function helper, to be used
6314  * instead of evas_object_image_fill_set():
6315  * @code
6316  * evas_object_image_filled_set(img, EINA_TRUE);
6317  * @endcode
6318  * See those functions' documentation for more details.
6319  *
6320  * @section Evas_Object_Image_Scale Scale and resizing
6321  *
6322  * Resizing of image objects will scale their respective source images
6323  * to their areas, if they are set to "fill" the object's area
6324  * (evas_object_image_filled_set()). If the user wants any control on
6325  * the aspect ratio of an image for different sizes, he/she has to
6326  * take care of that themselves. There are functions to make images to
6327  * get loaded scaled (up or down) in memory, already, if the user is
6328  * going to use them at pre-determined sizes and wants to save
6329  * computations.
6330  *
6331  * Evas has even a scale cache, which will take care of caching scaled
6332  * versions of images with more often usage/hits. Finally, one can
6333  * have images being rescaled @b smoothly by Evas (more
6334  * computationally expensive) or not.
6335  *
6336  * @section Evas_Object_Image_Performance Performance hints
6337  *
6338  * When dealing with image objects, there are some tricks to boost the
6339  * performance of your application, if it does intense image loading
6340  * and/or manipulations, as in animations on a UI.
6341  *
6342  * @subsection Evas_Object_Image_Load Load hints
6343  *
6344  * In image viewer applications, for example, the user will be looking
6345  * at a given image, at full size, and will desire that the navigation
6346  * to the adjacent images on his/her album be fluid and fast. Thus,
6347  * while displaying a given image, the program can be on the
6348  * background loading the next and previous images already, so that
6349  * displaying them on the sequence is just a matter of repainting the
6350  * screen (and not decoding image data).
6351  *
6352  * Evas addresses this issue with <b>image pre-loading</b>. The code
6353  * for the situation above would be something like the following:
6354  * @code
6355  * prev = evas_object_image_filled_add(canvas);
6356  * evas_object_image_file_set(prev, "/path/to/prev", NULL);
6357  * evas_object_image_preload(prev, EINA_TRUE);
6358  *
6359  * next = evas_object_image_filled_add(canvas);
6360  * evas_object_image_file_set(next, "/path/to/next", NULL);
6361  * evas_object_image_preload(next, EINA_TRUE);
6362  * @endcode
6363  *
6364  * If you're loading images which are too big, consider setting
6365  * previously it's loading size to something smaller, in case you
6366  * won't expose them in real size. It may speed up the loading
6367  * considerably:
6368  * @code
6369  * //to load a scaled down version of the image in memory, if that's
6370  * //the size you'll be displaying it anyway
6371  * evas_object_image_load_scale_down_set(img, zoom);
6372  *
6373  * //optional: if you know you'll be showing a sub-set of the image's
6374  * //pixels, you can avoid loading the complementary data
6375  * evas_object_image_load_region_set(img, x, y, w, h);
6376  * @endcode
6377  * Refer to Elementary's Photocam widget for a high level (smart)
6378  * object which does lots of loading speed-ups for you.
6379  *
6380  * @subsection Evas_Object_Image_Animation Animation hints
6381  *
6382  * If you want to animate image objects on a UI (what you'd get by
6383  * concomitant usage of other libraries, like Ecore and Edje), there
6384  * are also some tips on how to boost the performance of your
6385  * application. If the animation involves resizing of an image (thus,
6386  * re-scaling), you'd better turn off smooth scaling on it @b during
6387  * the animation, turning it back on afterwards, for less
6388  * computations. Also, in this case you'd better flag the image object
6389  * in question not to cache scaled versions of it:
6390  * @code
6391  * evas_object_image_scale_hint_set(wd->img, EVAS_IMAGE_SCALE_HINT_DYNAMIC);
6392  *
6393  * // resizing takes place in between
6394  *
6395  * evas_object_image_scale_hint_set(wd->img, EVAS_IMAGE_SCALE_HINT_STATIC);
6396  * @endcode
6397  *
6398  * Finally, movement of opaque images through the canvas is less
6399  * expensive than of translucid ones, because of blending
6400  * computations.
6401  *
6402  * @section Evas_Object_Image_Borders Borders
6403  *
6404  * Evas provides facilities for one to specify an image's region to be
6405  * treated specially -- as "borders". This will make those regions be
6406  * treated specially on resizing scales, by keeping their aspect. This
6407  * makes setting frames around other objects on UIs easy.
6408  * See the following figures for a visual explanation:\n
6409  * @htmlonly
6410  * <img src="image-borders.png" style="max-width: 100%;" />
6411  * <a href="image-borders.png">Full-size</a>
6412  * @endhtmlonly
6413  * @image rtf image-borders.png
6414  * @image latex image-borders.eps width=\textwidth
6415  * @htmlonly
6416  * <img src="border-effect.png" style="max-width: 100%;" />
6417  * <a href="border-effect.png">Full-size</a>
6418  * @endhtmlonly
6419  * @image rtf border-effect.png
6420  * @image latex border-effect.eps width=\textwidth
6421  *
6422  * @section Evas_Object_Image_Manipulation Manipulating pixels
6423  *
6424  * Evas image objects can be used to manipulate raw pixels in many
6425  * ways.  The meaning of the data in the pixel arrays will depend on
6426  * the image's color space, be warned (see next section). You can set
6427  * your own data as an image's pixel data, fetch an image's pixel data
6428  * for saving/altering, convert images between different color spaces
6429  * and even advanced operations like setting a native surface as image
6430  * objects' data.
6431  *
6432  * @section Evas_Object_Image_Color_Spaces Color spaces
6433  *
6434  * Image objects may return or accept "image data" in multiple
6435  * formats. This is based on the color space of an object. Here is a
6436  * rundown on formats:
6437  *
6438  * - #EVAS_COLORSPACE_ARGB8888:
6439  *   This pixel format is a linear block of pixels, starting at the
6440  *   top-left row by row until the bottom right of the image or pixel
6441  *   region. All pixels are 32-bit unsigned int's with the high-byte
6442  *   being alpha and the low byte being blue in the format ARGB. Alpha
6443  *   may or may not be used by evas depending on the alpha flag of the
6444  *   image, but if not used, should be set to 0xff anyway.
6445  *   \n\n
6446  *   This colorspace uses premultiplied alpha. That means that R, G
6447  *   and B cannot exceed A in value. The conversion from
6448  *   non-premultiplied colorspace is:
6449  *   \n\n
6450  *   R = (r * a) / 255; G = (g * a) / 255; B = (b * a) / 255;
6451  *   \n\n
6452  *   So 50% transparent blue will be: 0x80000080. This will not be
6453  *   "dark" - just 50% transparent. Values are 0 == black, 255 ==
6454  *   solid or full red, green or blue.
6455  * .
6456  * - #EVAS_COLORSPACE_YCBCR422P601_PL:
6457  *   This is a pointer-list indirected set of YUV (YCbCr) pixel
6458  *   data. This means that the data returned or set is not actual
6459  *   pixel data, but pointers TO lines of pixel data. The list of
6460  *   pointers will first be N rows of pointers to the Y plane -
6461  *   pointing to the first pixel at the start of each row in the Y
6462  *   plane. N is the height of the image data in pixels. Each pixel in
6463  *   the Y, U and V planes is 1 byte exactly, packed. The next N / 2
6464  *   pointers will point to rows in the U plane, and the next N / 2
6465  *   pointers will point to the V plane rows. U and V planes are half
6466  *   the horizontal and vertical resolution of the Y plane.
6467  *   \n\n
6468  *   Row order is top to bottom and row pixels are stored left to
6469  *   right.
6470  *   \n\n
6471  *   There is a limitation that these images MUST be a multiple of 2
6472  *   pixels in size horizontally or vertically. This is due to the U
6473  *   and V planes being half resolution. Also note that this assumes
6474  *   the itu601 YUV colorspace specification. This is defined for
6475  *   standard television and mpeg streams. HDTV may use the itu709
6476  *   specification.
6477  *   \n\n
6478  *   Values are 0 to 255, indicating full or no signal in that plane
6479  *   respectively.
6480  * .
6481  * - #EVAS_COLORSPACE_YCBCR422P709_PL:
6482  *   Not implemented yet.
6483  * .
6484  * - #EVAS_COLORSPACE_RGB565_A5P:
6485  *   In the process of being implemented in 1 engine only. This may
6486  *   change.
6487  *   \n\n
6488  *   This is a pointer to image data for 16-bit half-word pixel data
6489  *   in 16bpp RGB 565 format (5 bits red, 6 bits green, 5 bits blue),
6490  *   with the high-byte containing red and the low byte containing
6491  *   blue, per pixel. This data is packed row by row from the top-left
6492  *   to the bottom right.
6493  *   \n\n
6494  *   If the image has an alpha channel enabled there will be an extra
6495  *   alpha plane after the color pixel plane. If not, then this data
6496  *   will not exist and should not be accessed in any way. This plane
6497  *   is a set of pixels with 1 byte per pixel defining the alpha
6498  *   values of all pixels in the image from the top-left to the bottom
6499  *   right of the image, row by row. Even though the values of the
6500  *   alpha pixels can be 0 to 255, only values 0 through to 32 are
6501  *   used, 32 being solid and 0 being transparent.
6502  *   \n\n
6503  *   RGB values can be 0 to 31 for red and blue and 0 to 63 for green,
6504  *   with 0 being black and 31 or 63 being full red, green or blue
6505  *   respectively. This colorspace is also pre-multiplied like
6506  *   EVAS_COLORSPACE_ARGB8888 so:
6507  *   \n\n
6508  *   R = (r * a) / 32; G = (g * a) / 32; B = (b * a) / 32;
6509  * .
6510  * - #EVAS_COLORSPACE_GRY8:
6511  *   The image is just a alpha mask (8 bit's per pixel). This is used
6512  *   for alpha masking.
6513  *
6514  * @warning We don't guarantee any proper results if you create a Image object
6515  * without setting the evas engine.
6516  * 
6517  * Some examples on this group of functions can be found @ref
6518  * Example_Evas_Images "here".
6519  *
6520  * @ingroup Evas_Object_Specific
6521  */
6522
6523 /**
6524  * @addtogroup Evas_Object_Image
6525  * @{
6526  */
6527
6528 typedef void (*Evas_Object_Image_Pixels_Get_Cb) (void *data, Evas_Object *o);
6529
6530
6531 /**
6532  * Creates a new image object on the given Evas @p e canvas.
6533  *
6534  * @param e The given canvas.
6535  * @return The created image object handle.
6536  *
6537  * @note If you intend to @b display an image somehow in a GUI,
6538  * besides binding it to a real image file/source (with
6539  * evas_object_image_file_set(), for example), you'll have to tell
6540  * this image object how to fill its space with the pixels it can get
6541  * from the source. See evas_object_image_filled_add(), for a helper
6542  * on the common case of scaling up an image source to the whole area
6543  * of the image object.
6544  *
6545  * @see evas_object_image_fill_set()
6546  *
6547  * Example:
6548  * @code
6549  * img = evas_object_image_add(canvas);
6550  * evas_object_image_file_set(img, "/path/to/img", NULL);
6551  * @endcode
6552  */
6553 EAPI Evas_Object             *evas_object_image_add                    (Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
6554
6555 /**
6556  * Creates a new image object that @b automatically scales its bound
6557  * image to the object's area, on both axis.
6558  *
6559  * @param e The given canvas.
6560  * @return The created image object handle.
6561  *
6562  * This is a helper function around evas_object_image_add() and
6563  * evas_object_image_filled_set(). It has the same effect of applying
6564  * those functions in sequence, which is a very common use case.
6565  *
6566  * @note Whenever this object gets resized, the bound image will be
6567  * rescaled, too.
6568  *
6569  * @see evas_object_image_add()
6570  * @see evas_object_image_filled_set()
6571  * @see evas_object_image_fill_set()
6572  */
6573 EAPI Evas_Object             *evas_object_image_filled_add             (Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
6574
6575
6576 /**
6577  * Sets the data for an image from memory to be loaded
6578  *
6579  * This is the same as evas_object_image_file_set() but the file to be loaded
6580  * may exist at an address in memory (the data for the file, not the filename
6581  * itself). The @p data at the address is copied and stored for future use, so
6582  * no @p data needs to be kept after this call is made. It will be managed and
6583  * freed for you when no longer needed. The @p size is limited to 2 gigabytes
6584  * in size, and must be greater than 0. A @c NULL @p data pointer is also 
6585  * invalid. Set the filename to @c NULL to reset to empty state and have the 
6586  * image file data freed from memory using evas_object_image_file_set().
6587  *
6588  * The @p format is optional (pass @c NULL if you don't need/use it). It is
6589  * used to help Evas guess better which loader to use for the data. It may
6590  * simply be the "extension" of the file as it would normally be on disk
6591  * such as "jpg" or "png" or "gif" etc.
6592  *
6593  * @param obj The given image object.
6594  * @param data The image file data address
6595  * @param size The size of the image file data in bytes
6596  * @param format The format of the file (optional), or @c NULL if not needed
6597  * @param key The image key in file, or @c NULL.
6598  */
6599 EAPI void                     evas_object_image_memfile_set            (Evas_Object *obj, void *data, int size, char *format, char *key) EINA_ARG_NONNULL(1, 2);
6600
6601 /**
6602  * Set the source file from where an image object must fetch the real
6603  * image data (it may be an Eet file, besides pure image ones).
6604  *
6605  * @param obj The given image object.
6606  * @param file The image file path.
6607  * @param key The image key in @p file (if its an Eet one), or @c
6608  * NULL, otherwise.
6609  *
6610  * If the file supports multiple data stored in it (as Eet files do),
6611  * you can specify the key to be used as the index of the image in
6612  * this file.
6613  *
6614  * Example:
6615  * @code
6616  * img = evas_object_image_add(canvas);
6617  * evas_object_image_file_set(img, "/path/to/img", NULL);
6618  * err = evas_object_image_load_error_get(img);
6619  * if (err != EVAS_LOAD_ERROR_NONE)
6620  *   {
6621  *      fprintf(stderr, "could not load image '%s'. error string is \"%s\"\n",
6622  *              valid_path, evas_load_error_str(err));
6623  *   }
6624  * else
6625  *   {
6626  *      evas_object_image_fill_set(img, 0, 0, w, h);
6627  *      evas_object_resize(img, w, h);
6628  *      evas_object_show(img);
6629  *   }
6630  * @endcode
6631  */
6632 EAPI void                     evas_object_image_file_set               (Evas_Object *obj, const char *file, const char *key) EINA_ARG_NONNULL(1);
6633
6634 /**
6635  * Retrieve the source file from where an image object is to fetch the
6636  * real image data (it may be an Eet file, besides pure image ones).
6637  *
6638  * @param obj The given image object.
6639  * @param file Location to store the image file path.
6640  * @param key Location to store the image key (if @p file is an Eet
6641  * one).
6642  *
6643  * You must @b not modify the strings on the returned pointers.
6644  *
6645  * @note Use @c NULL pointers on the file components you're not
6646  * interested in: they'll be ignored by the function.
6647  */
6648 EAPI void                     evas_object_image_file_get               (const Evas_Object *obj, const char **file, const char **key) EINA_ARG_NONNULL(1, 2);
6649
6650 /**
6651  * Set the dimensions for an image object's border, a region which @b
6652  * won't ever be scaled together with its center.
6653  *
6654  * @param obj The given image object.
6655  * @param l The border's left width.
6656  * @param r The border's right width.
6657  * @param t The border's top width.
6658  * @param b The border's bottom width.
6659  *
6660  * When Evas is rendering, an image source may be scaled to fit the
6661  * size of its image object. This function sets an area from the
6662  * borders of the image inwards which is @b not to be scaled. This
6663  * function is useful for making frames and for widget theming, where,
6664  * for example, buttons may be of varying sizes, but their border size
6665  * must remain constant.
6666  *
6667  * The units used for @p l, @p r, @p t and @p b are canvas units.
6668  *
6669  * @note The border region itself @b may be scaled by the
6670  * evas_object_image_border_scale_set() function.
6671  *
6672  * @note By default, image objects have no borders set, i. e. @c l, @c
6673  * r, @c t and @c b start as @c 0.
6674  *
6675  * See the following figures for visual explanation:\n
6676  * @htmlonly
6677  * <img src="image-borders.png" style="max-width: 100%;" />
6678  * <a href="image-borders.png">Full-size</a>
6679  * @endhtmlonly
6680  * @image rtf image-borders.png
6681  * @image latex image-borders.eps width=\textwidth
6682  * @htmlonly
6683  * <img src="border-effect.png" style="max-width: 100%;" />
6684  * <a href="border-effect.png">Full-size</a>
6685  * @endhtmlonly
6686  * @image rtf border-effect.png
6687  * @image latex border-effect.eps width=\textwidth
6688  *
6689  * @see evas_object_image_border_get()
6690  * @see evas_object_image_border_center_fill_set()
6691  */
6692 EAPI void                     evas_object_image_border_set             (Evas_Object *obj, int l, int r, int t, int b) EINA_ARG_NONNULL(1);
6693
6694 /**
6695  * Retrieve the dimensions for an image object's border, a region
6696  * which @b won't ever be scaled together with its center.
6697  *
6698  * @param obj The given image object.
6699  * @param l Location to store the border's left width in.
6700  * @param r Location to store the border's right width in.
6701  * @param t Location to store the border's top width in.
6702  * @param b Location to store the border's bottom width in.
6703  *
6704  * @note Use @c NULL pointers on the border components you're not
6705  * interested in: they'll be ignored by the function.
6706  *
6707  * See @ref evas_object_image_border_set() for more details.
6708  */
6709 EAPI void                     evas_object_image_border_get             (const Evas_Object *obj, int *l, int *r, int *t, int *b) EINA_ARG_NONNULL(1);
6710
6711 /**
6712  * Sets @b how the center part of the given image object (not the
6713  * borders) should be drawn when Evas is rendering it.
6714  *
6715  * @param obj The given image object.
6716  * @param fill Fill mode of the center region of @p obj (a value in
6717  * #Evas_Border_Fill_Mode).
6718  *
6719  * This function sets how the center part of the image object's source
6720  * image is to be drawn, which must be one of the values in
6721  * #Evas_Border_Fill_Mode. By center we mean the complementary part of
6722  * that defined by evas_object_image_border_set(). This one is very
6723  * useful for making frames and decorations. You would most probably
6724  * also be using a filled image (as in evas_object_image_filled_set())
6725  * to use as a frame.
6726  *
6727  * @see evas_object_image_border_center_fill_get()
6728  */
6729 EAPI void                     evas_object_image_border_center_fill_set (Evas_Object *obj, Evas_Border_Fill_Mode fill) EINA_ARG_NONNULL(1);
6730
6731 /**
6732  * Retrieves @b how the center part of the given image object (not the
6733  * borders) is to be drawn when Evas is rendering it.
6734  *
6735  * @param obj The given image object.
6736  * @return fill Fill mode of the center region of @p obj (a value in
6737  * #Evas_Border_Fill_Mode).
6738  *
6739  * See @ref evas_object_image_fill_set() for more details.
6740  */
6741 EAPI Evas_Border_Fill_Mode    evas_object_image_border_center_fill_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
6742
6743 /**
6744  * Set whether the image object's fill property should track the
6745  * object's size.
6746  *
6747  * @param obj The given image object.
6748  * @param setting @c EINA_TRUE, to make the fill property follow
6749  *        object size or @c EINA_FALSE, otherwise.
6750  *
6751  * If @p setting is @c EINA_TRUE, then every evas_object_resize() will
6752  * @b automatically trigger a call to evas_object_image_fill_set()
6753  * with the that new size (and @c 0, @c 0 as source image's origin),
6754  * so the bound image will fill the whole object's area.
6755  *
6756  * @see evas_object_image_filled_add()
6757  * @see evas_object_image_fill_get()
6758  */
6759 EAPI void                     evas_object_image_filled_set             (Evas_Object *obj, Eina_Bool setting) EINA_ARG_NONNULL(1);
6760
6761 /**
6762  * Retrieve whether the image object's fill property should track the
6763  * object's size.
6764  *
6765  * @param obj The given image object.
6766  * @return @c EINA_TRUE if it is tracking, @c EINA_FALSE, if not (and
6767  *         evas_object_fill_set() must be called manually).
6768  *
6769  * @see evas_object_image_filled_set() for more information
6770  */
6771 EAPI Eina_Bool                evas_object_image_filled_get             (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
6772
6773 /**
6774  * Sets the scaling factor (multiplier) for the borders of an image
6775  * object.
6776  *
6777  * @param obj The given image object.
6778  * @param scale The scale factor (default is @c 1.0 - i.e. no scaling)
6779  *
6780  * @see evas_object_image_border_set()
6781  * @see evas_object_image_border_scale_get()
6782  */
6783 EAPI void                     evas_object_image_border_scale_set       (Evas_Object *obj, double scale);
6784
6785 /**
6786  * Retrieves the scaling factor (multiplier) for the borders of an
6787  * image object.
6788  *
6789  * @param obj The given image object.
6790  * @return The scale factor set for its borders
6791  *
6792  * @see evas_object_image_border_set()
6793  * @see evas_object_image_border_scale_set()
6794  */
6795 EAPI double                   evas_object_image_border_scale_get       (const Evas_Object *obj);
6796
6797 /**
6798  * Set how to fill an image object's drawing rectangle given the
6799  * (real) image bound to it.
6800  *
6801  * @param obj The given image object to operate on.
6802  * @param x The x coordinate (from the top left corner of the bound
6803  *          image) to start drawing from.
6804  * @param y The y coordinate (from the top left corner of the bound
6805  *          image) to start drawing from.
6806  * @param w The width the bound image will be displayed at.
6807  * @param h The height the bound image will be displayed at.
6808  *
6809  * Note that if @p w or @p h are smaller than the dimensions of
6810  * @p obj, the displayed image will be @b tiled around the object's
6811  * area. To have only one copy of the bound image drawn, @p x and @p y
6812  * must be 0 and @p w and @p h need to be the exact width and height
6813  * of the image object itself, respectively.
6814  *
6815  * See the following image to better understand the effects of this
6816  * call. On this diagram, both image object and original image source
6817  * have @c a x @c a dimensions and the image itself is a circle, with
6818  * empty space around it:
6819  *
6820  * @image html image-fill.png
6821  * @image rtf image-fill.png
6822  * @image latex image-fill.eps
6823  *
6824  * @warning The default values for the fill parameters are @p x = 0,
6825  * @p y = 0, @p w = 0 and @p h = 0. Thus, if you're not using the
6826  * evas_object_image_filled_add() helper and want your image
6827  * displayed, you'll have to set valid values with this function on
6828  * your object.
6829  *
6830  * @note evas_object_image_filled_set() is a helper function which
6831  * will @b override the values set here automatically, for you, in a
6832  * given way.
6833  */
6834 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);
6835
6836 /**
6837  * Retrieve how an image object is to fill its drawing rectangle,
6838  * given the (real) image bound to it.
6839  *
6840  * @param obj The given image object.
6841  * @param x Location to store the x coordinate (from the top left
6842  *          corner of the bound image) to start drawing from.
6843  * @param y Location to store the y coordinate (from the top left
6844  *          corner of the bound image) to start drawing from.
6845  * @param w Location to store the width the bound image is to be
6846  *          displayed at.
6847  * @param h Location to store the height the bound image is to be
6848  *          displayed at.
6849  *
6850  * @note Use @c NULL pointers on the fill components you're not
6851  * interested in: they'll be ignored by the function.
6852  *
6853  * See @ref evas_object_image_fill_set() for more details.
6854  */
6855 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);
6856
6857 /**
6858  * Sets the tiling mode for the given evas image object's fill.
6859  * @param   obj   The given evas image object.
6860  * @param   spread One of EVAS_TEXTURE_REFLECT, EVAS_TEXTURE_REPEAT,
6861  * EVAS_TEXTURE_RESTRICT, or EVAS_TEXTURE_PAD.
6862  */
6863 EAPI void                     evas_object_image_fill_spread_set        (Evas_Object *obj, Evas_Fill_Spread spread) EINA_ARG_NONNULL(1);
6864
6865 /**
6866  * Retrieves the spread (tiling mode) for the given image object's
6867  * fill.
6868  *
6869  * @param   obj The given evas image object.
6870  * @return  The current spread mode of the image object.
6871  */
6872 EAPI Evas_Fill_Spread         evas_object_image_fill_spread_get        (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
6873
6874 /**
6875  * Sets the size of the given image object.
6876  *
6877  * @param obj The given image object.
6878  * @param w The new width of the image.
6879  * @param h The new height of the image.
6880  *
6881  * This function will scale down or crop the image so that it is
6882  * treated as if it were at the given size. If the size given is
6883  * smaller than the image, it will be cropped. If the size given is
6884  * larger, then the image will be treated as if it were in the upper
6885  * left hand corner of a larger image that is otherwise transparent.
6886  */
6887 EAPI void                     evas_object_image_size_set               (Evas_Object *obj, int w, int h) EINA_ARG_NONNULL(1);
6888
6889 /**
6890  * Retrieves the size of the given image object.
6891  *
6892  * @param obj The given image object.
6893  * @param w Location to store the width of the image in, or @c NULL.
6894  * @param h Location to store the height of the image in, or @c NULL.
6895  *
6896  * See @ref evas_object_image_size_set() for more details.
6897  */
6898 EAPI void                     evas_object_image_size_get               (const Evas_Object *obj, int *w, int *h) EINA_ARG_NONNULL(1);
6899
6900 /**
6901  * Retrieves the row stride of the given image object.
6902  *
6903  * @param obj The given image object.
6904  * @return The stride of the image (<b>in bytes</b>).
6905  *
6906  * The row stride is the number of bytes between the start of a row
6907  * and the start of the next row for image data.
6908  */
6909 EAPI int                      evas_object_image_stride_get             (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
6910
6911 /**
6912  * Retrieves a number representing any error that occurred during the
6913  * last loading of the given image object's source image.
6914  *
6915  * @param obj The given image object.
6916  * @return A value giving the last error that occurred. It should be
6917  *         one of the #Evas_Load_Error values. #EVAS_LOAD_ERROR_NONE
6918  *         is returned if there was no error.
6919  */
6920 EAPI Evas_Load_Error          evas_object_image_load_error_get         (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
6921
6922 /**
6923  * Sets the raw image data of the given image object.
6924  *
6925  * @param obj The given image object.
6926  * @param data The raw data, or @c NULL.
6927  *
6928  * Note that the raw data must be of the same size (see
6929  * evas_object_image_size_set(), which has to be called @b before this
6930  * one) and colorspace (see evas_object_image_colorspace_set()) of the
6931  * image. If data is @c NULL, the current image data will be
6932  * freed. Naturally, if one does not set an image object's data
6933  * manually, it will still have one, allocated by Evas.
6934  *
6935  * @see evas_object_image_data_get()
6936  */
6937 EAPI void                     evas_object_image_data_set               (Evas_Object *obj, void *data) EINA_ARG_NONNULL(1);
6938
6939 /**
6940  * Get a pointer to the raw image data of the given image object.
6941  *
6942  * @param obj The given image object.
6943  * @param for_writing Whether the data being retrieved will be
6944  *        modified (@c EINA_TRUE) or not (@c EINA_FALSE).
6945  * @return The raw image data.
6946  *
6947  * This function returns a pointer to an image object's internal pixel
6948  * buffer, for reading only or read/write. If you request it for
6949  * writing, the image will be marked dirty so that it gets redrawn at
6950  * the next update.
6951  *
6952  * Each time you call this function on an image object, its data
6953  * buffer will have an internal reference counter
6954  * incremented. Decrement it back by using
6955  * evas_object_image_data_set(). This is specially important for the
6956  * directfb Evas engine.
6957  *
6958  * This is best suited for when you want to modify an existing image,
6959  * without changing its dimensions.
6960  *
6961  * @note The contents' format returned by it depend on the color
6962  * space of the given image object.
6963  *
6964  * @note You may want to use evas_object_image_data_update_add() to
6965  * inform data changes, if you did any.
6966  *
6967  * @see evas_object_image_data_set()
6968  */
6969 EAPI void                    *evas_object_image_data_get               (const Evas_Object *obj, Eina_Bool for_writing) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
6970
6971 /**
6972  * Converts the raw image data of the given image object to the
6973  * specified colorspace.
6974  *
6975  * Note that this function does not modify the raw image data.  If the
6976  * requested colorspace is the same as the image colorspace nothing is
6977  * done and @c NULL is returned. You should use
6978  * evas_object_image_colorspace_get() to check the current image
6979  * colorspace.
6980  *
6981  * See @ref evas_object_image_colorspace_get.
6982  *
6983  * @param obj The given image object.
6984  * @param to_cspace The colorspace to which the image raw data will be converted.
6985  * @return data A newly allocated data in the format specified by to_cspace.
6986  */
6987 EAPI void                    *evas_object_image_data_convert           (Evas_Object *obj, Evas_Colorspace to_cspace) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
6988
6989 /**
6990  * Replaces the raw image data of the given image object.
6991  *
6992  * @param obj The given image object.
6993  * @param data The raw data to replace.
6994  *
6995  * This function lets the application replace an image object's
6996  * internal pixel buffer with an user-allocated one. For best results,
6997  * you should generally first call evas_object_image_size_set() with
6998  * the width and height for the new buffer.
6999  *
7000  * This call is best suited for when you will be using image data with
7001  * different dimensions than the existing image data, if any. If you
7002  * only need to modify the existing image in some fashion, then using
7003  * evas_object_image_data_get() is probably what you are after.
7004  *
7005  * Note that the caller is responsible for freeing the buffer when
7006  * finished with it, as user-set image data will not be automatically
7007  * freed when the image object is deleted.
7008  *
7009  * See @ref evas_object_image_data_get() for more details.
7010  *
7011  */
7012 EAPI void                     evas_object_image_data_copy_set          (Evas_Object *obj, void *data) EINA_ARG_NONNULL(1);
7013
7014 /**
7015  * Mark a sub-region of the given image object to be redrawn.
7016  *
7017  * @param obj The given image object.
7018  * @param x X-offset of the region to be updated.
7019  * @param y Y-offset of the region to be updated.
7020  * @param w Width of the region to be updated.
7021  * @param h Height of the region to be updated.
7022  *
7023  * This function schedules a particular rectangular region of an image
7024  * object to be updated (redrawn) at the next rendering cycle.
7025  */
7026 EAPI void                     evas_object_image_data_update_add        (Evas_Object *obj, int x, int y, int w, int h) EINA_ARG_NONNULL(1);
7027
7028 /**
7029  * Enable or disable alpha channel usage on the given image object.
7030  *
7031  * @param obj The given image object.
7032  * @param has_alpha Whether to use alpha channel (@c EINA_TRUE) data
7033  * or not (@c EINA_FALSE).
7034  *
7035  * This function sets a flag on an image object indicating whether or
7036  * not to use alpha channel data. A value of @c EINA_TRUE makes it use
7037  * alpha channel data, and @c EINA_FALSE makes it ignore that
7038  * data. Note that this has nothing to do with an object's color as
7039  * manipulated by evas_object_color_set().
7040  *
7041  * @see evas_object_image_alpha_get()
7042  */
7043 EAPI void                     evas_object_image_alpha_set              (Evas_Object *obj, Eina_Bool has_alpha) EINA_ARG_NONNULL(1);
7044
7045 /**
7046  * Retrieve whether alpha channel data is being used on the given
7047  * image object.
7048  *
7049  * @param obj The given image object.
7050  * @return Whether the alpha channel data is being used (@c EINA_TRUE)
7051  * or not (@c EINA_FALSE).
7052  *
7053  * This function returns @c EINA_TRUE if the image object's alpha
7054  * channel is being used, or @c EINA_FALSE otherwise.
7055  *
7056  * See @ref evas_object_image_alpha_set() for more details.
7057  */
7058 EAPI Eina_Bool                evas_object_image_alpha_get              (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
7059
7060 /**
7061  * Sets whether to use high-quality image scaling algorithm on the
7062  * given image object.
7063  *
7064  * @param obj The given image object.
7065  * @param smooth_scale Whether to use smooth scale or not.
7066  *
7067  * When enabled, a higher quality image scaling algorithm is used when
7068  * scaling images to sizes other than the source image's original
7069  * one. This gives better results but is more computationally
7070  * expensive.
7071  *
7072  * @note Image objects get created originally with smooth scaling @b
7073  * on.
7074  *
7075  * @see evas_object_image_smooth_scale_get()
7076  */
7077 EAPI void                     evas_object_image_smooth_scale_set       (Evas_Object *obj, Eina_Bool smooth_scale) EINA_ARG_NONNULL(1);
7078
7079 /**
7080  * Retrieves whether the given image object is using high-quality
7081  * image scaling algorithm.
7082  *
7083  * @param obj The given image object.
7084  * @return Whether smooth scale is being used.
7085  *
7086  * See @ref evas_object_image_smooth_scale_set() for more details.
7087  */
7088 EAPI Eina_Bool                evas_object_image_smooth_scale_get       (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
7089
7090 /**
7091  * Preload an image object's image data in the background
7092  *
7093  * @param obj The given image object.
7094  * @param cancel @c EINA_FALSE will add it the preloading work queue,
7095  *               @c EINA_TRUE will remove it (if it was issued before).
7096  *
7097  * This function requests the preload of the data image in the
7098  * background. The work is queued before being processed (because
7099  * there might be other pending requests of this type).
7100  *
7101  * Whenever the image data gets loaded, Evas will call
7102  * #EVAS_CALLBACK_IMAGE_PRELOADED registered callbacks on @p obj (what
7103  * may be immediately, if the data was already preloaded before).
7104  *
7105  * Use @c EINA_TRUE for @p cancel on scenarios where you don't need
7106  * the image data preloaded anymore.
7107  *
7108  * @note Any evas_object_show() call after evas_object_image_preload()
7109  * will make the latter to be @b cancelled, with the loading process
7110  * now taking place @b synchronously (and, thus, blocking the return
7111  * of the former until the image is loaded). It is highly advisable,
7112  * then, that the user preload an image with it being @b hidden, just
7113  * to be shown on the #EVAS_CALLBACK_IMAGE_PRELOADED event's callback.
7114  */
7115 EAPI void                     evas_object_image_preload                (Evas_Object *obj, Eina_Bool cancel) EINA_ARG_NONNULL(1);
7116
7117 /**
7118  * Reload an image object's image data.
7119  *
7120  * @param obj The given image object pointer.
7121  *
7122  * This function reloads the image data bound to image object @p obj.
7123  */
7124 EAPI void                     evas_object_image_reload                 (Evas_Object *obj) EINA_ARG_NONNULL(1);
7125
7126 /**
7127  * Save the given image object's contents to an (image) file.
7128  *
7129  * @param obj The given image object.
7130  * @param file The filename to be used to save the image (extension
7131  *        obligatory).
7132  * @param key The image key in the file (if an Eet one), or @c NULL,
7133  *        otherwise.
7134  * @param flags String containing the flags to be used (@c NULL for
7135  *        none).
7136  *
7137  * The extension suffix on @p file will determine which <b>saver
7138  * module</b> Evas is to use when saving, thus the final file's
7139  * format. If the file supports multiple data stored in it (Eet ones),
7140  * you can specify the key to be used as the index of the image in it.
7141  *
7142  * You can specify some flags when saving the image.  Currently
7143  * acceptable flags are @c quality and @c compress. Eg.: @c
7144  * "quality=100 compress=9"
7145  */
7146 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);
7147
7148 /**
7149  * Import pixels from given source to a given canvas image object.
7150  *
7151  * @param obj The given canvas object.
7152  * @param pixels The pixel's source to be imported.
7153  *
7154  * This function imports pixels from a given source to a given canvas image.
7155  *
7156  */
7157 EAPI Eina_Bool                evas_object_image_pixels_import          (Evas_Object *obj, Evas_Pixel_Import_Source *pixels) EINA_ARG_NONNULL(1, 2);
7158
7159 /**
7160  * Set the callback function to get pixels from a canvas' image.
7161  *
7162  * @param obj The given canvas pointer.
7163  * @param func The callback function.
7164  * @param data The data pointer to be passed to @a func.
7165  *
7166  * This functions sets a function to be the callback function that get
7167  * pixes from a image of the canvas.
7168  *
7169  */
7170 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);
7171
7172 /**
7173  * Mark whether the given image object is dirty (needs to be redrawn).
7174  *
7175  * @param obj The given image object.
7176  * @param dirty Whether the image is dirty.
7177  */
7178 EAPI void                     evas_object_image_pixels_dirty_set       (Evas_Object *obj, Eina_Bool dirty) EINA_ARG_NONNULL(1);
7179
7180 /**
7181  * Retrieves whether the given image object is dirty (needs to be redrawn).
7182  *
7183  * @param obj The given image object.
7184  * @return Whether the image is dirty.
7185  */
7186 EAPI Eina_Bool                evas_object_image_pixels_dirty_get       (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
7187
7188 /**
7189  * Set the DPI resolution of an image object's source image.
7190  *
7191  * @param obj The given canvas pointer.
7192  * @param dpi The new DPI resolution.
7193  *
7194  * This function sets the DPI resolution of a given loaded canvas
7195  * image. Most useful for the SVG image loader.
7196  *
7197  * @see evas_object_image_load_dpi_get()
7198  */
7199 EAPI void                     evas_object_image_load_dpi_set           (Evas_Object *obj, double dpi) EINA_ARG_NONNULL(1);
7200
7201 /**
7202  * Get the DPI resolution of a loaded image object in the canvas.
7203  *
7204  * @param obj The given canvas pointer.
7205  * @return The DPI resolution of the given canvas image.
7206  *
7207  * This function returns the DPI resolution of the given canvas image.
7208  *
7209  * @see evas_object_image_load_dpi_set() for more details
7210  */
7211 EAPI double                   evas_object_image_load_dpi_get           (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
7212
7213 /**
7214  * Set the size of a given image object's source image, when loading
7215  * it.
7216  *
7217  * @param obj The given canvas object.
7218  * @param w The new width of the image's load size.
7219  * @param h The new height of the image's load size.
7220  *
7221  * This function sets a new (loading) size for the given canvas
7222  * image.
7223  *
7224  * @see evas_object_image_load_size_get()
7225  */
7226 EAPI void                     evas_object_image_load_size_set          (Evas_Object *obj, int w, int h) EINA_ARG_NONNULL(1);
7227
7228 /**
7229  * Get the size of a given image object's source image, when loading
7230  * it.
7231  *
7232  * @param obj The given image object.
7233  * @param w Where to store the new width of the image's load size.
7234  * @param h Where to store the new height of the image's load size.
7235  *
7236  * @note Use @c NULL pointers on the size components you're not
7237  * interested in: they'll be ignored by the function.
7238  *
7239  * @see evas_object_image_load_size_set() for more details
7240  */
7241 EAPI void                     evas_object_image_load_size_get          (const Evas_Object *obj, int *w, int *h) EINA_ARG_NONNULL(1);
7242
7243 /**
7244  * Set the scale down factor of a given image object's source image,
7245  * when loading it.
7246  *
7247  * @param obj The given image object pointer.
7248  * @param scale_down The scale down factor.
7249  *
7250  * This function sets the scale down factor of a given canvas
7251  * image. Most useful for the SVG image loader.
7252  *
7253  * @see evas_object_image_load_scale_down_get()
7254  */
7255 EAPI void                     evas_object_image_load_scale_down_set    (Evas_Object *obj, int scale_down) EINA_ARG_NONNULL(1);
7256
7257 /**
7258  * get the scale down factor of a given image object's source image,
7259  * when loading it.
7260  *
7261  * @param obj The given image object pointer.
7262  *
7263  * @see evas_object_image_load_scale_down_set() for more details
7264  */
7265 EAPI int                      evas_object_image_load_scale_down_get    (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
7266
7267 /**
7268  * Inform a given image object to load a selective region of its
7269  * source image.
7270  *
7271  * @param obj The given image object pointer.
7272  * @param x X-offset of the region to be loaded.
7273  * @param y Y-offset of the region to be loaded.
7274  * @param w Width of the region to be loaded.
7275  * @param h Height of the region to be loaded.
7276  *
7277  * This function is useful when one is not showing all of an image's
7278  * area on its image object.
7279  *
7280  * @note The image loader for the image format in question has to
7281  * support selective region loading in order to this function to take
7282  * effect.
7283  *
7284  * @see evas_object_image_load_region_get()
7285  */
7286 EAPI void                     evas_object_image_load_region_set        (Evas_Object *obj, int x, int y, int w, int h) EINA_ARG_NONNULL(1);
7287
7288 /**
7289  * Retrieve the coordinates of a given image object's selective
7290  * (source image) load region.
7291  *
7292  * @param obj The given image object pointer.
7293  * @param x Where to store the X-offset of the region to be loaded.
7294  * @param y Where to store the Y-offset of the region to be loaded.
7295  * @param w Where to store the width of the region to be loaded.
7296  * @param h Where to store the height of the region to be loaded.
7297  *
7298  * @note Use @c NULL pointers on the coordinates you're not interested
7299  * in: they'll be ignored by the function.
7300  *
7301  * @see evas_object_image_load_region_get()
7302  */
7303 EAPI void                     evas_object_image_load_region_get        (const Evas_Object *obj, int *x, int *y, int *w, int *h) EINA_ARG_NONNULL(1);
7304
7305 /**
7306  * Define if the orientation information in the image file should be honored.
7307  *
7308  * @param obj The given image object pointer.
7309  * @param enable @c EINA_TRUE means that it should honor the orientation information
7310  * @since 1.1
7311  */
7312 EAPI void                     evas_object_image_load_orientation_set        (Evas_Object *obj, Eina_Bool enable) EINA_ARG_NONNULL(1);
7313
7314 /**
7315  * Get if the orientation information in the image file should be honored.
7316  *
7317  * @param obj The given image object pointer.
7318  * @since 1.1
7319  */
7320 EAPI Eina_Bool                evas_object_image_load_orientation_get        (const Evas_Object *obj) EINA_ARG_NONNULL(1);
7321
7322 /**
7323  * Set the colorspace of a given image of the canvas.
7324  *
7325  * @param obj The given image object pointer.
7326  * @param cspace The new color space.
7327  *
7328  * This function sets the colorspace of given canvas image.
7329  *
7330  */
7331 EAPI void                     evas_object_image_colorspace_set         (Evas_Object *obj, Evas_Colorspace cspace) EINA_ARG_NONNULL(1);
7332
7333 /**
7334  * Get the colorspace of a given image of the canvas.
7335  *
7336  * @param obj The given image object pointer.
7337  * @return The colorspace of the image.
7338  *
7339  * This function returns the colorspace of given canvas image.
7340  *
7341  */
7342 EAPI Evas_Colorspace          evas_object_image_colorspace_get         (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
7343
7344 /**
7345  * Get the support state of a given image
7346  *
7347  * @param obj The given image object pointer
7348  * @return The region support state
7349  * @since 1.2.0
7350  *
7351  * This function returns the state of the region support of given image
7352  */
7353 EAPI Eina_Bool          evas_object_image_region_support_get         (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
7354
7355 /**
7356  * Set the native surface of a given image of the canvas
7357  *
7358  * @param obj The given canvas pointer.
7359  * @param surf The new native surface.
7360  *
7361  * This function sets a native surface of a given canvas image.
7362  *
7363  */
7364 EAPI void                     evas_object_image_native_surface_set     (Evas_Object *obj, Evas_Native_Surface *surf) EINA_ARG_NONNULL(1, 2);
7365
7366 /**
7367  * Get the native surface of a given image of the canvas
7368  *
7369  * @param obj The given canvas pointer.
7370  * @return The native surface of the given canvas image.
7371  *
7372  * This function returns the native surface of a given canvas image.
7373  *
7374  */
7375 EAPI Evas_Native_Surface     *evas_object_image_native_surface_get     (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
7376
7377 /**
7378  * Set the video surface linked to a given image of the canvas
7379  *
7380  * @param obj The given canvas pointer.
7381  * @param surf The new video surface.
7382  * @since 1.1.0
7383  *
7384  * This function link a video surface to a given canvas image.
7385  *
7386  */
7387 EAPI void                     evas_object_image_video_surface_set      (Evas_Object *obj, Evas_Video_Surface *surf) EINA_ARG_NONNULL(1);
7388
7389 /**
7390  * Get the video surface linekd to a given image of the canvas
7391  *
7392  * @param obj The given canvas pointer.
7393  * @return The video surface of the given canvas image.
7394  * @since 1.1.0
7395  *
7396  * This function returns the video surface linked to a given canvas image.
7397  *
7398  */
7399 EAPI const Evas_Video_Surface *evas_object_image_video_surface_get      (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
7400
7401 /**
7402  * Set the scale hint of a given image of the canvas.
7403  *
7404  * @param obj The given image object pointer.
7405  * @param hint The scale hint, a value in
7406  * #Evas_Image_Scale_Hint.
7407  *
7408  * This function sets the scale hint value of the given image object
7409  * in the canvas, which will affect how Evas is to cache scaled
7410  * versions of its original source image.
7411  *
7412  * @see evas_object_image_scale_hint_get()
7413  */
7414 EAPI void                     evas_object_image_scale_hint_set         (Evas_Object *obj, Evas_Image_Scale_Hint hint) EINA_ARG_NONNULL(1);
7415
7416 /**
7417  * Get the scale hint of a given image of the canvas.
7418  *
7419  * @param obj The given image object pointer.
7420  * @return The scale hint value set on @p obj, a value in
7421  * #Evas_Image_Scale_Hint.
7422  *
7423  * This function returns the scale hint value of the given image
7424  * object of the canvas.
7425  *
7426  * @see evas_object_image_scale_hint_set() for more details.
7427  */
7428 EAPI Evas_Image_Scale_Hint    evas_object_image_scale_hint_get         (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
7429
7430 /**
7431  * Set the content hint setting of a given image object of the canvas.
7432  *
7433  * @param obj The given canvas pointer.
7434  * @param hint The content hint value, one of the
7435  * #Evas_Image_Content_Hint ones.
7436  *
7437  * This function sets the content hint value of the given image of the
7438  * canvas. For example, if you're on the GL engine and your driver
7439  * implementation supports it, setting this hint to
7440  * #EVAS_IMAGE_CONTENT_HINT_DYNAMIC will make it need @b zero copies
7441  * at texture upload time, which is an "expensive" operation.
7442  *
7443  * @see evas_object_image_content_hint_get()
7444  */
7445 EAPI void                     evas_object_image_content_hint_set       (Evas_Object *obj, Evas_Image_Content_Hint hint) EINA_ARG_NONNULL(1);
7446
7447 /**
7448  * Get the content hint setting of a given image object of the canvas.
7449  *
7450  * @param obj The given canvas pointer.
7451  * @return hint The content hint value set on it, one of the
7452  * #Evas_Image_Content_Hint ones (#EVAS_IMAGE_CONTENT_HINT_NONE means
7453  * an error).
7454  *
7455  * This function returns the content hint value of the given image of
7456  * the canvas.
7457  *
7458  * @see evas_object_image_content_hint_set()
7459  */
7460 EAPI Evas_Image_Content_Hint  evas_object_image_content_hint_get       (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
7461
7462
7463 /**
7464  * Enable an image to be used as an alpha mask.
7465  *
7466  * This will set any flags, and discard any excess image data not used as an
7467  * alpha mask.
7468  *
7469  * Note there is little point in using a image as alpha mask unless it has an
7470  * alpha channel.
7471  *
7472  * @param obj Object to use as an alpha mask.
7473  * @param ismask Use image as alphamask, must be true.
7474  */
7475 EAPI void                     evas_object_image_alpha_mask_set         (Evas_Object *obj, Eina_Bool ismask) EINA_ARG_NONNULL(1);
7476
7477 /**
7478  * Set the source object on an image object to used as a @b proxy.
7479  *
7480  * @param obj Proxy (image) object.
7481  * @param src Source object to use for the proxy.
7482  * @return @c EINA_TRUE on success, @c EINA_FALSE on error.
7483  *
7484  * If an image object is set to behave as a @b proxy, it will mirror
7485  * the rendering contents of a given @b source object in its drawing
7486  * region, without affecting that source in any way. The source must
7487  * be another valid Evas object. Other effects may be applied to the
7488  * proxy, such as a map (see evas_object_map_set()) to create a
7489  * reflection of the original object (for example).
7490  *
7491  * Any existing source object on @p obj will be removed after this
7492  * call. Setting @p src to @c NULL clears the proxy object (not in
7493  * "proxy state" anymore).
7494  *
7495  * @warning You cannot set a proxy as another proxy's source.
7496  *
7497  * @see evas_object_image_source_get()
7498  * @see evas_object_image_source_unset()
7499  */
7500 EAPI Eina_Bool                evas_object_image_source_set             (Evas_Object *obj, Evas_Object *src) EINA_ARG_NONNULL(1);
7501
7502 /**
7503  * Get the current source object of an image object.
7504  *
7505  * @param obj Image object
7506  * @return Source object (if any), or @c NULL, if not in "proxy mode"
7507  * (or on errors).
7508  *
7509  * @see evas_object_image_source_set() for more details
7510  */
7511 EAPI Evas_Object             *evas_object_image_source_get             (const Evas_Object *obj) EINA_ARG_NONNULL(1);
7512
7513 /**
7514  * Clear the source object on a proxy image object.
7515  *
7516  * @param obj Image object to clear source of.
7517  * @return @c EINA_TRUE on success, @c EINA_FALSE on error.
7518  *
7519  * This is equivalent to calling evas_object_image_source_set() with a
7520  * @c NULL source.
7521  */
7522 EAPI Eina_Bool                evas_object_image_source_unset           (Evas_Object *obj) EINA_ARG_NONNULL(1);
7523
7524 /**
7525  * Check if a file extension may be supported by @ref Evas_Object_Image.
7526  *
7527  * @param file The file to check
7528  * @return @c EINA_TRUE if we may be able to open it, @c EINA_FALSE if it's
7529  * unlikely.
7530  * @since 1.1.0
7531  *
7532  * If file is a Eina_Stringshare, use directly @ref evas_object_image_extension_can_load_fast_get.
7533  *
7534  * This functions is threadsafe.
7535  */
7536 EAPI Eina_Bool evas_object_image_extension_can_load_get(const char *file);
7537
7538 /**
7539  * Check if a file extension may be supported by @ref Evas_Object_Image.
7540  *
7541  * @param file The file to check, it should be an Eina_Stringshare.
7542  * @return @c EINA_TRUE if we may be able to open it, @c EINA_FALSE if it's
7543  * unlikely.
7544  * @since 1.1.0
7545  *
7546  * This functions is threadsafe.
7547  */
7548 EAPI Eina_Bool evas_object_image_extension_can_load_fast_get(const char *file);
7549
7550 /**
7551  * Check if an image object can be animated (have multiple frames)
7552  *
7553  * @param obj Image object
7554  * @return whether obj support animation
7555  *
7556  * This returns if the image file of an image object is capable of animation
7557  * such as an animated gif file might. This is only useful to be called once
7558  * the image object file has been set.
7559  * 
7560  * Example:
7561  * @code
7562  * extern Evas_Object *obj;
7563  *
7564  * if (evas_object_image_animated_get(obj))
7565  *   {
7566  *     int frame_count;
7567  *     int loop_count;
7568  *     Evas_Image_Animated_Loop_Hint loop_type;
7569  *     double duration;
7570  *
7571  *     frame_count = evas_object_image_animated_frame_count_get(obj);
7572  *     printf("This image has %d frames\n",frame_count);
7573  *
7574  *     duration = evas_object_image_animated_frame_duration_get(obj,1,0); 
7575  *     printf("Frame 1's duration is %f. You had better set object's frame to 2 after this duration using timer\n");
7576  *     
7577  *     loop_count = evas_object_image_animated_loop_count_get(obj);
7578  *     printf("loop count is %d. You had better run loop %d times\n",loop_count,loop_count);
7579  *
7580  *     loop_type = evas_object_image_animated_loop_type_get(obj);
7581  *     if (loop_type == EVAS_IMAGE_ANIMATED_HINT_LOOP)
7582  *       printf("You had better set frame like 1->2->3->1->2->3...\n");
7583  *     else if (loop_type == EVAS_IMAGE_ANIMATED_HINT_PINGPONG)
7584  *       printf("You had better set frame like 1->2->3->2->1->2...\n");
7585  *     else
7586  *       printf("Unknown loop type\n");
7587  *
7588  *     evas_object_image_animated_frame_set(obj,1);
7589  *     printf("You set image object's frame to 1. You can see frame 1\n");
7590  *   }
7591  * @endcode
7592  * 
7593  * @see evas_object_image_animated_get()
7594  * @see evas_object_image_animated_frame_count_get() 
7595  * @see evas_object_image_animated_loop_type_get()
7596  * @see evas_object_image_animated_loop_count_get()
7597  * @see evas_object_image_animated_frame_duration_get()
7598  * @see evas_object_image_animated_frame_set()
7599  * @since 1.1.0
7600  */
7601 EAPI Eina_Bool evas_object_image_animated_get(const Evas_Object *obj);
7602
7603 /**
7604  * Get the total number of frames of the image object.
7605  *
7606  * @param obj Image object
7607  * @return The number of frames
7608  *
7609  * This returns total number of frames the image object supports (if animated)
7610  * 
7611  * @see evas_object_image_animated_get()
7612  * @see evas_object_image_animated_frame_count_get() 
7613  * @see evas_object_image_animated_loop_type_get()
7614  * @see evas_object_image_animated_loop_count_get()
7615  * @see evas_object_image_animated_frame_duration_get()
7616  * @see evas_object_image_animated_frame_set()
7617  * @since 1.1.0
7618  */
7619 EAPI int evas_object_image_animated_frame_count_get(const Evas_Object *obj);
7620
7621 /**
7622  * Get the kind of looping the image object does.
7623  *
7624  * @param obj Image object
7625  * @return Loop type of the image object
7626  *
7627  * This returns the kind of looping the image object wants to do.
7628  * 
7629  * If it returns EVAS_IMAGE_ANIMATED_HINT_LOOP, you should display frames in a sequence like:
7630  * 1->2->3->1->2->3->1...
7631  * If it returns EVAS_IMAGE_ANIMATED_HINT_PINGPONG, it is better to
7632  * display frames in a sequence like: 1->2->3->2->1->2->3->1...
7633  * 
7634  * The default type is EVAS_IMAGE_ANIMATED_HINT_LOOP.
7635  *
7636  * @see evas_object_image_animated_get()
7637  * @see evas_object_image_animated_frame_count_get() 
7638  * @see evas_object_image_animated_loop_type_get()
7639  * @see evas_object_image_animated_loop_count_get()
7640  * @see evas_object_image_animated_frame_duration_get()
7641  * @see evas_object_image_animated_frame_set()
7642  * @since 1.1.0
7643  */
7644 EAPI Evas_Image_Animated_Loop_Hint evas_object_image_animated_loop_type_get(const Evas_Object *obj);
7645
7646 /**
7647  * Get the number times the animation of the object loops.
7648  *
7649  * @param obj Image object
7650  * @return The number of loop of an animated image object
7651  *
7652  * This returns loop count of image. The loop count is the number of times
7653  * the animation will play fully from first to last frame until the animation
7654  * should stop (at the final frame).
7655  * 
7656  * If 0 is returned, then looping should happen indefinitely (no limit to
7657  * the number of times it loops).
7658  *
7659  * @see evas_object_image_animated_get()
7660  * @see evas_object_image_animated_frame_count_get() 
7661  * @see evas_object_image_animated_loop_type_get()
7662  * @see evas_object_image_animated_loop_count_get()
7663  * @see evas_object_image_animated_frame_duration_get()
7664  * @see evas_object_image_animated_frame_set()
7665  * @since 1.1.0
7666  */
7667 EAPI int evas_object_image_animated_loop_count_get(const Evas_Object *obj);
7668
7669 /**
7670  * Get the duration of a sequence of frames.
7671  *
7672  * @param obj Image object
7673  * @param start_frame The first frame
7674  * @param fram_num Number of frames in the sequence
7675  *
7676  * This returns total duration that the specified sequence of frames should
7677  * take in seconds.
7678  * 
7679  * If you set start_frame to 1 and frame_num 0, you get frame 1's duration
7680  * If you set start_frame to 1 and frame_num 1, you get frame 1's duration + 
7681  * frame2's duration
7682  *
7683  * @see evas_object_image_animated_get()
7684  * @see evas_object_image_animated_frame_count_get() 
7685  * @see evas_object_image_animated_loop_type_get()
7686  * @see evas_object_image_animated_loop_count_get()
7687  * @see evas_object_image_animated_frame_duration_get()
7688  * @see evas_object_image_animated_frame_set()
7689  * @since 1.1.0
7690  */
7691 EAPI double evas_object_image_animated_frame_duration_get(const Evas_Object *obj, int start_frame, int fram_num);
7692
7693 /**
7694  * Set the frame to current frame of an image object
7695  *
7696  * @param obj The given image object.
7697  * @param frame_num The index of current frame
7698  *
7699  * This set image object's current frame to frame_num with 1 being the first
7700  * frame.
7701  *
7702  * @see evas_object_image_animated_get()
7703  * @see evas_object_image_animated_frame_count_get() 
7704  * @see evas_object_image_animated_loop_type_get()
7705  * @see evas_object_image_animated_loop_count_get()
7706  * @see evas_object_image_animated_frame_duration_get()
7707  * @see evas_object_image_animated_frame_set()
7708  * @since 1.1.0
7709  */
7710 EAPI void evas_object_image_animated_frame_set(Evas_Object *obj, int frame_num);
7711 /**
7712  * @}
7713  */
7714
7715 /**
7716  * @defgroup Evas_Object_Text Text Object Functions
7717  *
7718  * Functions that operate on single line, single style text objects.
7719  *
7720  * For multiline and multiple style text, see @ref Evas_Object_Textblock.
7721  *
7722  * See some @ref Example_Evas_Text "examples" on this group of functions.
7723  *
7724  * @warning We don't guarantee any proper results if you create a Text object
7725  * without setting the evas engine.
7726  *
7727  * @ingroup Evas_Object_Specific
7728  */
7729
7730 /**
7731  * @addtogroup Evas_Object_Text
7732  * @{
7733  */
7734
7735 /* basic styles (4 bits allocated use 0->10 now, 5 left) */
7736 #define EVAS_TEXT_STYLE_MASK_BASIC 0xf
7737
7738 /**
7739  * Text style type creation macro. Use style types on the 's'
7740  * arguments, being 'x' your style variable.
7741  */
7742 #define EVAS_TEXT_STYLE_BASIC_SET(x, s) \
7743    do { x = ((x) & ~EVAS_TEXT_STYLE_MASK_BASIC) | (s); } while (0)
7744
7745 #define EVAS_TEXT_STYLE_MASK_SHADOW_DIRECTION (0x7 << 4)
7746
7747 /**
7748  * Text style type creation macro. This one will impose shadow
7749  * directions on the style type variable -- use the @c
7750  * EVAS_TEXT_STYLE_SHADOW_DIRECTION_* values on 's', incrementally.
7751  */
7752 #define EVAS_TEXT_STYLE_SHADOW_DIRECTION_SET(x, s) \
7753    do { x = ((x) & ~EVAS_TEXT_STYLE_MASK_SHADOW_DIRECTION) | (s); } while (0)
7754
7755    typedef enum _Evas_Text_Style_Type
7756      {
7757         EVAS_TEXT_STYLE_PLAIN, /**< plain, standard text */
7758         EVAS_TEXT_STYLE_SHADOW, /**< text with shadow underneath */
7759         EVAS_TEXT_STYLE_OUTLINE, /**< text with an outline */
7760         EVAS_TEXT_STYLE_SOFT_OUTLINE, /**< text with a soft outline */
7761         EVAS_TEXT_STYLE_GLOW, /**< text with a glow effect */
7762         EVAS_TEXT_STYLE_OUTLINE_SHADOW, /**< text with both outline and shadow effects */
7763         EVAS_TEXT_STYLE_FAR_SHADOW, /**< text with (far) shadow underneath */
7764         EVAS_TEXT_STYLE_OUTLINE_SOFT_SHADOW, /**< text with outline and soft shadow effects combined */
7765         EVAS_TEXT_STYLE_SOFT_SHADOW, /**< text with (soft) shadow underneath */
7766         EVAS_TEXT_STYLE_FAR_SOFT_SHADOW, /**< text with (far soft) shadow underneath */
7767
7768         /* OR these to modify shadow direction (3 bits needed) */
7769         EVAS_TEXT_STYLE_SHADOW_DIRECTION_BOTTOM_RIGHT = (0x0 << 4), /**< shadow growing to bottom right */
7770         EVAS_TEXT_STYLE_SHADOW_DIRECTION_BOTTOM       = (0x1 << 4), /**< shadow growing to the bottom */
7771         EVAS_TEXT_STYLE_SHADOW_DIRECTION_BOTTOM_LEFT  = (0x2 << 4), /**< shadow growing to bottom left */
7772         EVAS_TEXT_STYLE_SHADOW_DIRECTION_LEFT         = (0x3 << 4), /**< shadow growing to the left */
7773         EVAS_TEXT_STYLE_SHADOW_DIRECTION_TOP_LEFT     = (0x4 << 4), /**< shadow growing to top left */
7774         EVAS_TEXT_STYLE_SHADOW_DIRECTION_TOP          = (0x5 << 4), /**< shadow growing to the top */
7775         EVAS_TEXT_STYLE_SHADOW_DIRECTION_TOP_RIGHT    = (0x6 << 4), /**< shadow growing to top right */
7776         EVAS_TEXT_STYLE_SHADOW_DIRECTION_RIGHT        = (0x7 << 4) /**< shadow growing to the right */
7777      } 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 */
7778
7779 /**
7780  * Creates a new text object on the provided canvas.
7781  *
7782  * @param e The canvas to create the text object on.
7783  * @return @c NULL on error, a pointer to a new text object on
7784  * success.
7785  *
7786  * Text objects are for simple, single line text elements. If you want
7787  * more elaborated text blocks, see @ref Evas_Object_Textblock.
7788  *
7789  * @see evas_object_text_font_source_set()
7790  * @see evas_object_text_font_set()
7791  * @see evas_object_text_text_set()
7792  */
7793 EAPI Evas_Object      *evas_object_text_add              (Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
7794
7795 /**
7796  * Set the font (source) file to be used on a given text object.
7797  *
7798  * @param obj The text object to set font for.
7799  * @param font The font file's path.
7800  *
7801  * This function allows the font file to be explicitly set for a given
7802  * text object, overriding system lookup, which will first occur in
7803  * the given file's contents.
7804  *
7805  * @see evas_object_text_font_get()
7806  */
7807 EAPI void              evas_object_text_font_source_set  (Evas_Object *obj, const char *font) EINA_ARG_NONNULL(1);
7808
7809 /**
7810  * Get the font file's path which is being used on a given text
7811  * object.
7812  *
7813  * @param obj The text object to set font for.
7814  * @return The font file's path.
7815  *
7816  * @see evas_object_text_font_get() for more details
7817  */
7818 EAPI const char       *evas_object_text_font_source_get  (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
7819
7820 /**
7821  * Set the font family and size on a given text object.
7822  *
7823  * @param obj The text object to set font for.
7824  * @param font The font (family) name.
7825  * @param size The font size, in points.
7826  *
7827  * This function allows the font name and size of a text object to be
7828  * set. The @p font string has to follow fontconfig's convention on
7829  * naming fonts, as it's the underlying library used to query system
7830  * fonts by Evas (see the @c fc-list command's output, on your system,
7831  * to get an idea).
7832  *
7833  * @see evas_object_text_font_get()
7834  * @see evas_object_text_font_source_set()
7835  */
7836    EAPI void              evas_object_text_font_set         (Evas_Object *obj, const char *font, Evas_Font_Size size) EINA_ARG_NONNULL(1);
7837
7838 /**
7839  * Retrieve the font family and size in use on a given text object.
7840  *
7841  * @param obj The evas text object to query for font information.
7842  * @param font A pointer to the location to store the font name in.
7843  * @param size A pointer to the location to store the font size in.
7844  *
7845  * This function allows the font name and size of a text object to be
7846  * queried. Be aware that the font name string is still owned by Evas
7847  * and should @b not have free() called on it by the caller of the
7848  * function.
7849  *
7850  * @see evas_object_text_font_set()
7851  */
7852 EAPI void              evas_object_text_font_get         (const Evas_Object *obj, const char **font, Evas_Font_Size *size) EINA_ARG_NONNULL(1);
7853
7854 /**
7855  * Sets the text string to be displayed by the given text object.
7856  *
7857  * @param obj The text object to set text string on.
7858  * @param text Text string to display on it.
7859  *
7860  * @see evas_object_text_text_get()
7861  */
7862 EAPI void              evas_object_text_text_set         (Evas_Object *obj, const char *text) EINA_ARG_NONNULL(1);
7863
7864 /**
7865  * Retrieves the text string currently being displayed by the given
7866  * text object.
7867  *
7868  * @param  obj The given text object.
7869  * @return The text string currently being displayed on it.
7870  *
7871  * @note Do not free() the return value.
7872  *
7873  * @see evas_object_text_text_set()
7874  */
7875 EAPI const char       *evas_object_text_text_get         (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
7876
7877 /**
7878  * @brief Sets the BiDi delimiters used in the textblock.
7879  *
7880  * BiDi delimiters are use for in-paragraph separation of bidi segments. This
7881  * is useful for example in recipients fields of e-mail clients where bidi
7882  * oddities can occur when mixing RTL and LTR.
7883  *
7884  * @param obj The given text object.
7885  * @param delim A null terminated string of delimiters, e.g ",|".
7886  * @since 1.1.0
7887  */
7888 EAPI void              evas_object_text_bidi_delimiters_set(Evas_Object *obj, const char *delim);
7889
7890 /**
7891  * @brief Gets the BiDi delimiters used in the textblock.
7892  *
7893  * BiDi delimiters are use for in-paragraph separation of bidi segments. This
7894  * is useful for example in recipients fields of e-mail clients where bidi
7895  * oddities can occur when mixing RTL and LTR.
7896  *
7897  * @param obj The given text object.
7898  * @return A null terminated string of delimiters, e.g ",|". If empty, returns NULL.
7899  * @since 1.1.0
7900  */
7901 EAPI const char       *evas_object_text_bidi_delimiters_get(const Evas_Object *obj);
7902
7903    EAPI Evas_Coord        evas_object_text_ascent_get       (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
7904    EAPI Evas_Coord        evas_object_text_descent_get      (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
7905    EAPI Evas_Coord        evas_object_text_max_ascent_get   (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
7906    EAPI Evas_Coord        evas_object_text_max_descent_get  (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
7907    EAPI Evas_Coord        evas_object_text_horiz_advance_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
7908    EAPI Evas_Coord        evas_object_text_vert_advance_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
7909    EAPI Evas_Coord        evas_object_text_inset_get        (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
7910
7911 /**
7912  * Retrieve position and dimension information of a character within a text @c Evas_Object.
7913  *
7914  * This function is used to obtain the X, Y, width and height of a the character
7915  * located at @p pos within the @c Evas_Object @p obj. @p obj must be a text object
7916  * as created with evas_object_text_add(). Any of the @c Evas_Coord parameters (@p cx,
7917  * @p cy, @p cw, @p ch) may be @c NULL in which case no value will be assigned to that
7918  * parameter.
7919  *
7920  * @param obj   The text object to retrieve position information for.
7921  * @param pos   The character position to request co-ordinates for.
7922  * @param cx    A pointer to an @c Evas_Coord to store the X value in (can be NULL).
7923  * @param cy    A pointer to an @c Evas_Coord to store the Y value in (can be NULL).
7924  * @param cw    A pointer to an @c Evas_Coord to store the Width value in (can be NULL).
7925  * @param ch    A pointer to an @c Evas_Coord to store the Height value in (can be NULL).
7926  *
7927  * @return @c EINA_FALSE on success, @c EINA_TRUE on error.
7928  */
7929 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);
7930    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);
7931
7932 /**
7933  * Returns the logical position of the last char in the text
7934  * up to the pos given. this is NOT the position of the last char
7935  * because of the possibility of RTL in the text.
7936  */
7937 EAPI int               evas_object_text_last_up_to_pos   (const Evas_Object *obj, Evas_Coord x, Evas_Coord y) EINA_ARG_NONNULL(1);
7938
7939 /**
7940  * Retrieves the style on use on the given text object.
7941  *
7942  * @param obj the given text object to set style on.
7943  * @return the style type in use.
7944  *
7945  * @see evas_object_text_style_set() for more details.
7946  */
7947 EAPI Evas_Text_Style_Type evas_object_text_style_get     (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
7948
7949 /**
7950  * Sets the style to apply on the given text object.
7951  *
7952  * @param obj the given text object to set style on.
7953  * @param type a style type.
7954  *
7955  * Text object styles are one of the values in
7956  * #Evas_Text_Style_Type. Some of those values are combinations of
7957  * more than one style, and some account for the direction of the
7958  * rendering of shadow effects.
7959  *
7960  * @note One may use the helper macros #EVAS_TEXT_STYLE_BASIC_SET and
7961  * #EVAS_TEXT_STYLE_SHADOW_DIRECTION_SET to assemble a style value.
7962  *
7963  * The following figure illustrates the text styles:
7964  *
7965  * @image html text-styles.png
7966  * @image rtf text-styles.png
7967  * @image latex text-styles.eps
7968  *
7969  * @see evas_object_text_style_get()
7970  * @see evas_object_text_shadow_color_set()
7971  * @see evas_object_text_outline_color_set()
7972  * @see evas_object_text_glow_color_set()
7973  * @see evas_object_text_glow2_color_set()
7974  */
7975 EAPI void              evas_object_text_style_set        (Evas_Object *obj, Evas_Text_Style_Type type) EINA_ARG_NONNULL(1);
7976
7977 /**
7978  * Sets the shadow color for the given text object.
7979  *
7980  * @param obj The given Evas text object.
7981  * @param r The red component of the given color.
7982  * @param g The green component of the given color.
7983  * @param b The blue component of the given color.
7984  * @param a The alpha component of the given color.
7985  *
7986  * Shadow effects, which are fading colors decorating the text
7987  * underneath it, will just be shown if the object is set to one of
7988  * the following styles:
7989  *
7990  * - #EVAS_TEXT_STYLE_SHADOW
7991  * - #EVAS_TEXT_STYLE_OUTLINE_SHADOW
7992  * - #EVAS_TEXT_STYLE_FAR_SHADOW
7993  * - #EVAS_TEXT_STYLE_OUTLINE_SOFT_SHADOW
7994  * - #EVAS_TEXT_STYLE_SOFT_SHADOW
7995  * - #EVAS_TEXT_STYLE_FAR_SOFT_SHADOW
7996  *
7997  * One can also change the direction where the shadow grows to, with
7998  * evas_object_text_style_set().
7999  *
8000  * @see evas_object_text_shadow_color_get()
8001  */
8002 EAPI void              evas_object_text_shadow_color_set (Evas_Object *obj, int r, int g, int b, int a) EINA_ARG_NONNULL(1);
8003
8004 /**
8005  * Retrieves the shadow color for the given text object.
8006  *
8007  * @param obj The given Evas text object.
8008  * @param r Pointer to variable to hold the red component of the given
8009  * color.
8010  * @param g Pointer to variable to hold the green component of the
8011  * given color.
8012  * @param b Pointer to variable to hold the blue component of the
8013  * given color.
8014  * @param a Pointer to variable to hold the alpha component of the
8015  * given color.
8016  *
8017  * @note Use @c NULL pointers on the color components you're not
8018  * interested in: they'll be ignored by the function.
8019  *
8020  * @see evas_object_text_shadow_color_set() for more details.
8021  */
8022 EAPI void              evas_object_text_shadow_color_get (const Evas_Object *obj, int *r, int *g, int *b, int *a) EINA_ARG_NONNULL(1);
8023
8024 /**
8025  * Sets the glow color for the given text object.
8026  *
8027  * @param obj The given Evas text object.
8028  * @param r The red component of the given color.
8029  * @param g The green component of the given color.
8030  * @param b The blue component of the given color.
8031  * @param a The alpha component of the given color.
8032  *
8033  * Glow effects, which are glowing colors decorating the text's
8034  * surroundings, will just be shown if the object is set to the
8035  * #EVAS_TEXT_STYLE_GLOW style.
8036  *
8037  * @note Glow effects are placed from a short distance of the text
8038  * itself, but no touching it. For glowing effects right on the
8039  * borders of the glyphs, see 'glow 2' effects
8040  * (evas_object_text_glow2_color_set()).
8041  *
8042  * @see evas_object_text_glow_color_get()
8043  */
8044 EAPI void              evas_object_text_glow_color_set   (Evas_Object *obj, int r, int g, int b, int a) EINA_ARG_NONNULL(1);
8045
8046 /**
8047  * Retrieves the glow color for the given text object.
8048  *
8049  * @param obj The given Evas text object.
8050  * @param r Pointer to variable to hold the red component of the given
8051  * color.
8052  * @param g Pointer to variable to hold the green component of the
8053  * given color.
8054  * @param b Pointer to variable to hold the blue component of the
8055  * given color.
8056  * @param a Pointer to variable to hold the alpha component of the
8057  * given color.
8058  *
8059  * @note Use @c NULL pointers on the color components you're not
8060  * interested in: they'll be ignored by the function.
8061  *
8062  * @see evas_object_text_glow_color_set() for more details.
8063  */
8064 EAPI void              evas_object_text_glow_color_get   (const Evas_Object *obj, int *r, int *g, int *b, int *a) EINA_ARG_NONNULL(1);
8065
8066 /**
8067  * Sets the 'glow 2' color for the given text object.
8068  *
8069  * @param obj The given Evas text object.
8070  * @param r The red component of the given color.
8071  * @param g The green component of the given color.
8072  * @param b The blue component of the given color.
8073  * @param a The alpha component of the given color.
8074  *
8075  * 'Glow 2' effects, which are glowing colors decorating the text's
8076  * (immediate) surroundings, will just be shown if the object is set
8077  * to the #EVAS_TEXT_STYLE_GLOW style. See also
8078  * evas_object_text_glow_color_set().
8079  *
8080  * @see evas_object_text_glow2_color_get()
8081  */
8082 EAPI void              evas_object_text_glow2_color_set  (Evas_Object *obj, int r, int g, int b, int a) EINA_ARG_NONNULL(1);
8083
8084 /**
8085  * Retrieves the 'glow 2' color for the given text object.
8086  *
8087  * @param obj The given Evas text object.
8088  * @param r Pointer to variable to hold the red component of the given
8089  * color.
8090  * @param g Pointer to variable to hold the green component of the
8091  * given color.
8092  * @param b Pointer to variable to hold the blue component of the
8093  * given color.
8094  * @param a Pointer to variable to hold the alpha component of the
8095  * given color.
8096  *
8097  * @note Use @c NULL pointers on the color components you're not
8098  * interested in: they'll be ignored by the function.
8099  *
8100  * @see evas_object_text_glow2_color_set() for more details.
8101  */
8102 EAPI void              evas_object_text_glow2_color_get  (const Evas_Object *obj, int *r, int *g, int *b, int *a) EINA_ARG_NONNULL(1);
8103
8104 /**
8105  * Sets the outline color for the given text object.
8106  *
8107  * @param obj The given Evas text object.
8108  * @param r The red component of the given color.
8109  * @param g The green component of the given color.
8110  * @param b The blue component of the given color.
8111  * @param a The alpha component of the given color.
8112  *
8113  * Outline effects (colored lines around text glyphs) will just be
8114  * shown if the object is set to one of the following styles:
8115  * - #EVAS_TEXT_STYLE_OUTLINE
8116  * - #EVAS_TEXT_STYLE_SOFT_OUTLINE
8117  * - #EVAS_TEXT_STYLE_OUTLINE_SHADOW
8118  * - #EVAS_TEXT_STYLE_OUTLINE_SOFT_SHADOW
8119  *
8120  * @see evas_object_text_outline_color_get()
8121  */
8122 EAPI void              evas_object_text_outline_color_set(Evas_Object *obj, int r, int g, int b, int a) EINA_ARG_NONNULL(1);
8123
8124 /**
8125  * Retrieves the outline color for the given text object.
8126  *
8127  * @param obj The given Evas text object.
8128  * @param r Pointer to variable to hold the red component of the given
8129  * color.
8130  * @param g Pointer to variable to hold the green component of the
8131  * given color.
8132  * @param b Pointer to variable to hold the blue component of the
8133  * given color.
8134  * @param a Pointer to variable to hold the alpha component of the
8135  * given color.
8136  *
8137  * @note Use @c NULL pointers on the color components you're not
8138  * interested in: they'll be ignored by the function.
8139  *
8140  * @see evas_object_text_outline_color_set() for more details.
8141  */
8142 EAPI void              evas_object_text_outline_color_get(const Evas_Object *obj, int *r, int *g, int *b, int *a) EINA_ARG_NONNULL(1);
8143
8144 /**
8145  * Gets the text style pad of a text object.
8146  *
8147  * @param obj The given text object.
8148  * @param l The left pad (or @c NULL).
8149  * @param r The right pad (or @c NULL).
8150  * @param t The top pad (or @c NULL).
8151  * @param b The bottom pad (or @c NULL).
8152  *
8153  */
8154 EAPI void              evas_object_text_style_pad_get    (const Evas_Object *obj, int *l, int *r, int *t, int *b) EINA_ARG_NONNULL(1);
8155
8156 /**
8157  * Retrieves the direction of the text currently being displayed in the
8158  * text object.
8159  * @param  obj The given evas text object.
8160  * @return the direction of the text
8161  */
8162 EAPI Evas_BiDi_Direction evas_object_text_direction_get  (const Evas_Object *obj) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
8163
8164 /**
8165  * @}
8166  */
8167
8168 /**
8169  * @defgroup Evas_Object_Textblock Textblock Object Functions
8170  *
8171  * Functions used to create and manipulate textblock objects. Unlike
8172  * @ref Evas_Object_Text, these handle complex text, doing multiple
8173  * styles and multiline text based on HTML-like tags. Of these extra
8174  * features will be heavier on memory and processing cost.
8175  *
8176  * @section Evas_Object_Textblock_Tutorial Textblock Object Tutorial
8177  *
8178  * This part explains about the textblock object's API and proper usage.
8179  * The main user of the textblock object is the edje entry object in Edje, so
8180  * that's a good place to learn from, but I think this document is more than
8181  * enough, if it's not, please contact me and I'll update it.
8182  *
8183  * @subsection textblock_intro Introduction
8184  * The textblock objects is, as implied, an object that can show big chunks of
8185  * text. Textblock supports many features including: Text formatting, automatic
8186  * and manual text alignment, embedding items (for example icons) and more.
8187  * Textblock has three important parts, the text paragraphs, the format nodes
8188  * and the cursors.
8189  *
8190  * You can use markup to format text, for example: "<font_size=50>Big!</font_size>".
8191  * You can also put more than one style directive in one tag:
8192  * "<font_size=50 color=#F00>Big and Red!</font_size>".
8193  * Please notice that we used "</font_size>" although the format also included
8194  * color, this is because the first format determines the matching closing tag's
8195  * name. You can also use anonymous tags, like: "<font_size=30>Big</>" which
8196  * just pop any type of format, but it's advised to use the named alternatives
8197  * instead.
8198  *
8199  * @subsection textblock_cursors Textblock Object Cursors
8200  * A textblock Cursor is data type that represents
8201  * a position in a textblock. Each cursor contains information about the
8202  * paragraph it points to, the position in that paragraph and the object itself.
8203  * Cursors register to textblock objects upon creation, this means that once
8204  * you created a cursor, it belongs to a specific obj and you can't for example
8205  * copy a cursor "into" a cursor of a different object. Registered cursors
8206  * also have the added benefit of updating automatically upon textblock changes,
8207  * this means that if you have a cursor pointing to a specific character, it'll
8208  * still point to it even after you change the whole object completely (as long
8209  * as the char was not deleted), this is not possible without updating, because
8210  * as mentioned, each cursor holds a character position. There are many
8211  * functions that handle cursors, just check out the evas_textblock_cursor*
8212  * functions. For creation and deletion of cursors check out:
8213  * @see evas_object_textblock_cursor_new()
8214  * @see evas_textblock_cursor_free()
8215  * @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).
8216  *
8217  * @subsection textblock_paragraphs Textblock Object Paragraphs
8218  * The textblock object is made out of text splitted to paragraphs (delimited
8219  * by the paragraph separation character). Each paragraph has many (or none)
8220  * format nodes associated with it which are responsible for the formatting
8221  * of that paragraph.
8222  *
8223  * @subsection textblock_format_nodes Textblock Object Format Nodes
8224  * As explained in @ref textblock_paragraphs each one of the format nodes
8225  * is associated with a paragraph.
8226  * There are two types of format nodes, visible and invisible:
8227  * Visible: formats that a cursor can point to, i.e formats that
8228  * occupy space, for example: newlines, tabs, items and etc. Some visible items
8229  * are made of two parts, in this case, only the opening tag is visible.
8230  * A closing tag (i.e a \</tag\> tag) should NEVER be visible.
8231  * Invisible: formats that don't occupy space, for example: bold and underline.
8232  * Being able to access format nodes is very important for some uses. For
8233  * example, edje uses the "<a>" format to create links in the text (and pop
8234  * popups above them when clicked). For the textblock object a is just a
8235  * formatting instruction (how to color the text), but edje utilizes the access
8236  * to the format nodes to make it do more.
8237  * For more information, take a look at all the evas_textblock_node_format_*
8238  * functions.
8239  * The translation of "<tag>" tags to actual format is done according to the
8240  * tags defined in the style, see @ref evas_textblock_style_set
8241  *
8242  * @subsection textblock_special_formats Special Formats
8243  * Textblock supports various format directives that can be used in markup. In
8244  * addition to the mentioned format directives, textblock allows creating
8245  * additional format directives using "tags" that can be set in the style see
8246  * @ref evas_textblock_style_set .
8247  *
8248  * Textblock supports the following formats:
8249  * @li font - Font description in fontconfig like format, e.g: "Sans:style=Italic:lang=hi". or "Serif:style=Bold".
8250  * @li font_weight - Overrides the weight defined in "font". E.g: "font_weight=Bold" is the same as "font=:style=Bold". Supported weights: "normal", "thin", "ultralight", "light", "book", "medium", "semibold", "bold", "ultrabold", "black", and "extrablack".
8251  * @li font_style - Overrides the style defined in "font". E.g: "font_style=Italic" is the same as "font=:style=Italic". Supported styles: "normal", "oblique", and "italic".
8252  * @li font_width - Overrides the width defined in "font". E.g: "font_width=Condensed" is the same as "font=:style=Condensed". Supported widths: "normal", "ultracondensed", "extracondensed", "condensed", "semicondensed", "semiexpanded", "expanded", "extraexpanded", and "ultraexpanded".
8253  * @li lang - Overrides the language defined in "font". E.g: "lang=he" is the same as "font=:lang=he".
8254  * @li font_fallbacks - A comma delimited list of fonts to try if finding the main font fails.
8255  * @li font_size - The font size in points.
8256  * @li font_source - The source of the font, e.g an eet file.
8257  * @li color - Text color in one of the following formats: "#RRGGBB", "#RRGGBBAA", "#RGB", and "#RGBA".
8258  * @li underline_color - color in one of the following formats: "#RRGGBB", "#RRGGBBAA", "#RGB", and "#RGBA".
8259  * @li underline2_color - color in one of the following formats: "#RRGGBB", "#RRGGBBAA", "#RGB", and "#RGBA".
8260  * @li outline_color - color in one of the following formats: "#RRGGBB", "#RRGGBBAA", "#RGB", and "#RGBA".
8261  * @li shadow_color - color in one of the following formats: "#RRGGBB", "#RRGGBBAA", "#RGB", and "#RGBA".
8262  * @li glow_color - color in one of the following formats: "#RRGGBB", "#RRGGBBAA", "#RGB", and "#RGBA".
8263  * @li glow2_color - color in one of the following formats: "#RRGGBB", "#RRGGBBAA", "#RGB", and "#RGBA".
8264  * @li backing_color - color in one of the following formats: "#RRGGBB", "#RRGGBBAA", "#RGB", and "#RGBA".
8265  * @li strikethrough_color - color in one of the following formats: "#RRGGBB", "#RRGGBBAA", "#RGB", and "#RGBA".
8266  * @li align - Either "auto" (meaning according to text direction), "left", "right", "center", "middle", a value between 0.0 and 1.0, or a value between 0% to 100%.
8267  * @li valign - Either "top", "bottom", "middle", "center", "baseline", "base", a value between 0.0 and 1.0, or a value between 0% to 100%.
8268  * @li wrap - "word", "char", "mixed", or "none".
8269  * @li left_margin - Either "reset", or a pixel value indicating the margin.
8270  * @li right_margin - Either "reset", or a pixel value indicating the margin.
8271  * @li underline - "on", "off", "single", or "double".
8272  * @li strikethrough - "on" or "off"
8273  * @li backing - "on" or "off"
8274  * @li style - Either "off", "none", "plain", "shadow", "outline", "soft_outline", "outline_shadow", "outline_soft_shadow", "glow", "far_shadow", "soft_shadow", or "far_soft_shadow".
8275  * @li tabstops - Pixel value for tab width.
8276  * @li linesize - Force a line size in pixels.
8277  * @li linerelsize - Either a floating point value or a percentage indicating the wanted size of the line relative to the calculated size.
8278  * @li linegap - Force a line gap in pixels.
8279  * @li linerelgap - Either a floating point value or a percentage indicating the wanted size of the line relative to the calculated size.
8280  * @li item - Creates an empty space that should be filled by an upper layer. Use "size", "abssize", or "relsize". To define the items size, and an optional: vsize=full/ascent to define the item's position in the line.
8281  * @li linefill - Either a float value or percentage indicating how much to fill the line.
8282  * @li ellipsis - Value between 0.0-1.0 to indicate the type of ellipsis, or -1.0 to indicate ellipsis isn't wanted.
8283  * @li password - "on" or "off". This is used to specifically turn replacing chars with the replacement char (i.e password mode) on and off.
8284  *
8285  * @warning We don't guarantee any proper results if you create a Textblock
8286  * object
8287  * without setting the evas engine.
8288  *
8289  * @todo put here some usage examples
8290  *
8291  * @ingroup Evas_Object_Specific
8292  *
8293  * @{
8294  */
8295
8296    typedef struct _Evas_Textblock_Style                 Evas_Textblock_Style;
8297    typedef struct _Evas_Textblock_Cursor                Evas_Textblock_Cursor;
8298    /**
8299     * @typedef Evas_Object_Textblock_Node_Format
8300     * A format node.
8301     */
8302    typedef struct _Evas_Object_Textblock_Node_Format    Evas_Object_Textblock_Node_Format;
8303    typedef struct _Evas_Textblock_Rectangle             Evas_Textblock_Rectangle;
8304
8305    struct _Evas_Textblock_Rectangle
8306      {
8307         Evas_Coord x, y, w, h;
8308      };
8309
8310    typedef enum _Evas_Textblock_Text_Type
8311      {
8312         EVAS_TEXTBLOCK_TEXT_RAW,
8313         EVAS_TEXTBLOCK_TEXT_PLAIN,
8314         EVAS_TEXTBLOCK_TEXT_MARKUP
8315      } Evas_Textblock_Text_Type;
8316
8317    typedef enum _Evas_Textblock_Cursor_Type
8318      {
8319         EVAS_TEXTBLOCK_CURSOR_UNDER,
8320         EVAS_TEXTBLOCK_CURSOR_BEFORE
8321      } Evas_Textblock_Cursor_Type;
8322
8323
8324 /**
8325  * Adds a textblock to the given evas.
8326  * @param   e The given evas.
8327  * @return  The new textblock object.
8328  */
8329 EAPI Evas_Object                 *evas_object_textblock_add(Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
8330
8331
8332 /**
8333  * Returns the unescaped version of escape.
8334  * @param escape the string to be escaped
8335  * @return the unescaped version of escape
8336  */
8337 EAPI const char                  *evas_textblock_escape_string_get(const char *escape) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
8338
8339 /**
8340  * Returns the escaped version of the string.
8341  * @param string to escape
8342  * @param len_ret the len of the part of the string that was used.
8343  * @return the escaped string.
8344  */
8345 EAPI const char                  *evas_textblock_string_escape_get(const char *string, int *len_ret) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
8346
8347 /**
8348  * Return the unescaped version of the string between start and end.
8349  *
8350  * @param escape_start the start of the string.
8351  * @param escape_end the end of the string.
8352  * @return the unescaped version of the range
8353  */
8354 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);
8355
8356 /**
8357  * Return the plain version of the markup.
8358  *
8359  * Works as if you set the markup to a textblock and then retrieve the plain
8360  * version of the text. i.e: <br> and <\n> will be replaced with \n, &...; with
8361  * the actual char and etc.
8362  *
8363  * @param obj The textblock object to work with. (if @c NULL, tries the 
8364  * default).
8365  * @param text The markup text (if @c NULL, return @c NULL).
8366  * @return An allocated plain text version of the markup.
8367  * @since 1.2.0
8368  */
8369 EAPI char                        *evas_textblock_text_markup_to_utf8(const Evas_Object *obj, const char *text) EINA_WARN_UNUSED_RESULT EINA_MALLOC;
8370
8371 /**
8372  * Return the markup version of the plain text.
8373  *
8374  * Replaces \\n -\> \<br/\> \\t -\> \<tab/\> and etc. Generally needed before you pass
8375  * plain text to be set in a textblock.
8376  *
8377  * @param obj the textblock object to work with (if @c NULL, it just does the
8378  * default behaviour, i.e with no extra object information).
8379  * @param text The markup text (if @c NULL, return @c NULL).
8380  * @return An allocated plain text version of the markup.
8381  * @since 1.2.0
8382  */
8383 EAPI char                        *evas_textblock_text_utf8_to_markup(const Evas_Object *obj, const char *text) EINA_WARN_UNUSED_RESULT EINA_MALLOC;
8384
8385 /**
8386  * Creates a new textblock style.
8387  * @return  The new textblock style.
8388  */
8389 EAPI Evas_Textblock_Style        *evas_textblock_style_new(void) EINA_WARN_UNUSED_RESULT EINA_MALLOC;
8390
8391 /**
8392  * Destroys a textblock style.
8393  * @param ts The textblock style to free.
8394  */
8395 EAPI void                         evas_textblock_style_free(Evas_Textblock_Style *ts) EINA_ARG_NONNULL(1);
8396
8397 /**
8398  * Sets the style ts to the style passed as text by text.
8399  * Expected a string consisting of many (or none) tag='format' pairs.
8400  *
8401  * @param ts  the style to set.
8402  * @param text the text to parse - NOT NULL.
8403  * @return Returns no value.
8404  */
8405 EAPI void                         evas_textblock_style_set(Evas_Textblock_Style *ts, const char *text) EINA_ARG_NONNULL(1);
8406
8407 /**
8408  * Return the text of the style ts.
8409  * @param ts  the style to get it's text.
8410  * @return the text of the style or null on error.
8411  */
8412 EAPI const char                  *evas_textblock_style_get(const Evas_Textblock_Style *ts) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
8413
8414
8415 /**
8416  * Set the objects style to ts.
8417  * @param obj the Evas object to set the style to.
8418  * @param ts  the style to set.
8419  * @return Returns no value.
8420  */
8421 EAPI void                         evas_object_textblock_style_set(Evas_Object *obj, Evas_Textblock_Style *ts) EINA_ARG_NONNULL(1);
8422
8423 /**
8424  * Return the style of an object.
8425  * @param obj  the object to get the style from.
8426  * @return the style of the object.
8427  */
8428 EAPI const Evas_Textblock_Style  *evas_object_textblock_style_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
8429
8430 /**
8431  * Push ts to the top of the user style stack.
8432  *
8433  * FIXME: API is solid but currently only supports 1 style in the stack.
8434  *
8435  * The user style overrides the corresponding elements of the regular style.
8436  * This is the proper way to do theme overrides in code.
8437  * @param obj the Evas object to set the style to.
8438  * @param ts  the style to set.
8439  * @return Returns no value.
8440  * @see evas_object_textblock_style_set
8441  * @since 1.2.0
8442  */
8443 EAPI void                         evas_object_textblock_style_user_push(Evas_Object *obj, Evas_Textblock_Style *ts) EINA_ARG_NONNULL(1);
8444
8445 /**
8446  * Del the from the top of the user style stack.
8447  *
8448  * @param obj  the object to get the style from.
8449  * @see evas_object_textblock_style_get
8450  * @since 1.2.0
8451  */
8452 EAPI void                        evas_object_textblock_style_user_pop(Evas_Object *obj) EINA_ARG_NONNULL(1);
8453
8454 /**
8455  * Get (don't remove) the style at the top of the user style stack.
8456  *
8457  * @param obj  the object to get the style from.
8458  * @return the style of the object.
8459  * @see evas_object_textblock_style_get
8460  * @since 1.2.0
8461  */
8462 EAPI const Evas_Textblock_Style  *evas_object_textblock_style_user_peek(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
8463
8464 /**
8465  * @brief Set the "replacement character" to use for the given textblock object.
8466  *
8467  * @param obj The given textblock object.
8468  * @param ch The charset name.
8469  */
8470 EAPI void                         evas_object_textblock_replace_char_set(Evas_Object *obj, const char *ch) EINA_ARG_NONNULL(1);
8471
8472 /**
8473  * @brief Get the "replacement character" for given textblock object. Returns
8474  * @c NULL if no replacement character is in use.
8475  *
8476  * @param obj The given textblock object
8477  * @return Replacement character or @c NULL.
8478  */
8479 EAPI const char                  *evas_object_textblock_replace_char_get(Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
8480
8481 /**
8482  * @brief Sets the vertical alignment of text within the textblock object
8483  * as a whole.
8484  *
8485  * Normally alignment is 0.0 (top of object). Values given should be
8486  * between 0.0 and 1.0 (1.0 bottom of object, 0.5 being vertically centered
8487  * etc.).
8488  *
8489  * @param obj The given textblock object.
8490  * @param align A value between @c 0.0 and @c 1.0.
8491  * @since 1.1.0
8492  */
8493 EAPI void                         evas_object_textblock_valign_set(Evas_Object *obj, double align);
8494
8495 /**
8496  * @brief Gets the vertical alignment of a textblock
8497  *
8498  * @param obj The given textblock object.
8499  * @return The alignment set for the object.
8500  * @since 1.1.0
8501  */
8502 EAPI double                       evas_object_textblock_valign_get(const Evas_Object *obj);
8503
8504 /**
8505  * @brief Sets the BiDi delimiters used in the textblock.
8506  *
8507  * BiDi delimiters are use for in-paragraph separation of bidi segments. This
8508  * is useful for example in recipients fields of e-mail clients where bidi
8509  * oddities can occur when mixing RTL and LTR.
8510  *
8511  * @param obj The given textblock object.
8512  * @param delim A null terminated string of delimiters, e.g ",|".
8513  * @since 1.1.0
8514  */
8515 EAPI void                         evas_object_textblock_bidi_delimiters_set(Evas_Object *obj, const char *delim);
8516
8517 /**
8518  * @brief Gets the BiDi delimiters used in the textblock.
8519  *
8520  * BiDi delimiters are use for in-paragraph separation of bidi segments. This
8521  * is useful for example in recipients fields of e-mail clients where bidi
8522  * oddities can occur when mixing RTL and LTR.
8523  *
8524  * @param obj The given textblock object.
8525  * @return A null terminated string of delimiters, e.g ",|". If empty, returns
8526  * @c NULL.
8527  * @since 1.1.0
8528  */
8529 EAPI const char                  *evas_object_textblock_bidi_delimiters_get(const Evas_Object *obj);
8530
8531 /**
8532  * @brief Sets newline mode. When true, newline character will behave
8533  * as a paragraph separator.
8534  *
8535  * @param obj The given textblock object.
8536  * @param mode @c EINA_TRUE for legacy mode, @c EINA_FALSE otherwise.
8537  * @since 1.1.0
8538  */
8539 EAPI void                         evas_object_textblock_legacy_newline_set(Evas_Object *obj, Eina_Bool mode) EINA_ARG_NONNULL(1);
8540
8541 /**
8542  * @brief Gets newline mode. When true, newline character behaves
8543  * as a paragraph separator.
8544  *
8545  * @param obj The given textblock object.
8546  * @return @c EINA_TRUE if in legacy mode, @c EINA_FALSE otherwise.
8547  * @since 1.1.0
8548  */
8549 EAPI Eina_Bool                    evas_object_textblock_legacy_newline_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
8550
8551
8552 /**
8553  * Sets the tetxblock's text to the markup text.
8554  *
8555  * @note assumes text does not include the unicode object replacement char (0xFFFC)
8556  *
8557  * @param obj  the textblock object.
8558  * @param text the markup text to use.
8559  * @return Return no value.
8560  */
8561 EAPI void                         evas_object_textblock_text_markup_set(Evas_Object *obj, const char *text) EINA_ARG_NONNULL(1);
8562
8563 /**
8564  * Prepends markup to the cursor cur.
8565  *
8566  * @note assumes text does not include the unicode object replacement char (0xFFFC)
8567  *
8568  * @param cur  the cursor to prepend to.
8569  * @param text the markup text to prepend.
8570  * @return Return no value.
8571  */
8572 EAPI void                         evas_object_textblock_text_markup_prepend(Evas_Textblock_Cursor *cur, const char *text) EINA_ARG_NONNULL(1, 2);
8573
8574 /**
8575  * Return the markup of the object.
8576  *
8577  * @param obj the Evas object.
8578  * @return the markup text of the object.
8579  */
8580 EAPI const char                  *evas_object_textblock_text_markup_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
8581
8582
8583 /**
8584  * Return the object's main cursor.
8585  *
8586  * @param obj the object.
8587  * @return The @p obj's main cursor.
8588  */
8589 EAPI Evas_Textblock_Cursor *evas_object_textblock_cursor_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
8590
8591 /**
8592  * Create a new cursor, associate it to the obj and init it to point
8593  * to the start of the textblock. Association to the object means the cursor
8594  * will be updated when the object will change.
8595  *
8596  * @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).
8597  *
8598  * @param obj the object to associate to.
8599  * @return the new cursor.
8600  */
8601 EAPI Evas_Textblock_Cursor       *evas_object_textblock_cursor_new(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
8602
8603
8604 /**
8605  * Free the cursor and unassociate it from the object.
8606  * @note do not use it to free unassociated cursors.
8607  *
8608  * @param cur the cursor to free.
8609  * @return Returns no value.
8610  */
8611 EAPI void                         evas_textblock_cursor_free(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8612
8613
8614 /**
8615  * Sets the cursor to the start of the first text node.
8616  *
8617  * @param cur the cursor to update.
8618  * @return Returns no value.
8619  */
8620 EAPI void                         evas_textblock_cursor_paragraph_first(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8621
8622 /**
8623  * sets the cursor to the end of the last text node.
8624  *
8625  * @param cur the cursor to set.
8626  * @return Returns no value.
8627  */
8628 EAPI void                         evas_textblock_cursor_paragraph_last(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8629
8630 /**
8631  * Advances to the start of the next text node
8632  *
8633  * @param cur the cursor to update
8634  * @return @c EINA_TRUE if it managed to advance a paragraph, @c EINA_FALSE
8635  * otherwise.
8636  */
8637 EAPI Eina_Bool                    evas_textblock_cursor_paragraph_next(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8638
8639 /**
8640  * Advances to the end of the previous text node
8641  *
8642  * @param cur the cursor to update
8643  * @return @c EINA_TRUE if it managed to advance a paragraph, @c EINA_FALSE
8644  * otherwise.
8645  */
8646 EAPI Eina_Bool                    evas_textblock_cursor_paragraph_prev(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8647
8648 /**
8649  * Returns the
8650  *
8651  * @param obj The evas, must not be @c NULL.
8652  * @param anchor the anchor name to get
8653  * @return Returns the list format node corresponding to the anchor, may be null if there are none.
8654  */
8655 EAPI const Eina_List             *evas_textblock_node_format_list_get(const Evas_Object *obj, const char *anchor) EINA_ARG_NONNULL(1, 2);
8656
8657 /**
8658  * Returns the first format node.
8659  *
8660  * @param obj The evas, must not be @c NULL.
8661  * @return Returns the first format node, may be null if there are none.
8662  */
8663 EAPI const Evas_Object_Textblock_Node_Format *evas_textblock_node_format_first_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
8664
8665 /**
8666  * Returns the last format node.
8667  *
8668  * @param obj The evas textblock, must not be NULL.
8669  * @return Returns the first format node, may be null if there are none.
8670  */
8671 EAPI const Evas_Object_Textblock_Node_Format *evas_textblock_node_format_last_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
8672
8673 /**
8674  * Returns the next format node (after n)
8675  *
8676  * @param n the current format node - not null.
8677  * @return Returns the next format node, may be null.
8678  */
8679 EAPI const Evas_Object_Textblock_Node_Format *evas_textblock_node_format_next_get(const Evas_Object_Textblock_Node_Format *n) EINA_ARG_NONNULL(1);
8680
8681 /**
8682  * Returns the prev format node (after n)
8683  *
8684  * @param n the current format node - not null.
8685  * @return Returns the prev format node, may be null.
8686  */
8687 EAPI const Evas_Object_Textblock_Node_Format *evas_textblock_node_format_prev_get(const Evas_Object_Textblock_Node_Format *n) EINA_ARG_NONNULL(1);
8688
8689 /**
8690  * Remove a format node and it's match. i.e, removes a \<tag\> \</tag\> pair.
8691  * Assumes the node is the first part of \<tag\> i.e, this won't work if
8692  * n is a closing tag.
8693  *
8694  * @param obj the Evas object of the textblock - not null.
8695  * @param n the current format node - not null.
8696  */
8697 EAPI void                         evas_textblock_node_format_remove_pair(Evas_Object *obj, Evas_Object_Textblock_Node_Format *n) EINA_ARG_NONNULL(1, 2);
8698
8699 /**
8700  * Sets the cursor to point to the place where format points to.
8701  *
8702  * @param cur the cursor to update.
8703  * @param n the format node to update according.
8704  * @deprecated duplicate of evas_textblock_cursor_at_format_set
8705  */
8706 EAPI void                         evas_textblock_cursor_set_at_format(Evas_Textblock_Cursor *cur, const Evas_Object_Textblock_Node_Format *n) EINA_ARG_NONNULL(1, 2);
8707
8708 /**
8709  * Return the format node at the position pointed by cur.
8710  *
8711  * @param cur the position to look at.
8712  * @return the format node if found, @c NULL otherwise.
8713  * @see evas_textblock_cursor_format_is_visible_get()
8714  */
8715 EAPI const Evas_Object_Textblock_Node_Format *evas_textblock_cursor_format_get(const Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8716
8717 /**
8718  * Get the text format representation of the format node.
8719  *
8720  * @param fnode the format node.
8721  * @return the textual format of the format node.
8722  */
8723 EAPI const char                  *evas_textblock_node_format_text_get(const Evas_Object_Textblock_Node_Format *fnode) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
8724
8725 /**
8726  * Set the cursor to point to the position of fmt.
8727  *
8728  * @param cur the cursor to update
8729  * @param fmt the format to update according to.
8730  */
8731 EAPI void                         evas_textblock_cursor_at_format_set(Evas_Textblock_Cursor *cur, const Evas_Object_Textblock_Node_Format *fmt) EINA_ARG_NONNULL(1, 2);
8732
8733 /**
8734  * Check if the current cursor position is a visible format. This way is more
8735  * efficient than evas_textblock_cursor_format_get() to check for the existence
8736  * of a visible format.
8737  *
8738  * @param cur the cursor to look at.
8739  * @return @c EINA_TRUE if the cursor points to a visible format, @c EINA_FALSE
8740  * otherwise.
8741  * @see evas_textblock_cursor_format_get()
8742  */
8743 EAPI Eina_Bool                    evas_textblock_cursor_format_is_visible_get(const Evas_Textblock_Cursor *cur) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
8744
8745 /**
8746  * Advances to the next format node
8747  *
8748  * @param cur the cursor to be updated.
8749  * @return @c EINA_TRUE on success @c EINA_FALSE otherwise.
8750  */
8751 EAPI Eina_Bool                    evas_textblock_cursor_format_next(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8752
8753 /**
8754  * Advances to the previous format node.
8755  *
8756  * @param cur the cursor to update.
8757  * @return @c EINA_TRUE on success @c EINA_FALSE otherwise.
8758  */
8759 EAPI Eina_Bool                    evas_textblock_cursor_format_prev(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8760
8761 /**
8762  * Returns true if the cursor points to a format.
8763  *
8764  * @param cur the cursor to check.
8765  * @return  @c EINA_TRUE if a cursor points to a format @c EINA_FALSE
8766  * otherwise.
8767  */
8768 EAPI Eina_Bool                    evas_textblock_cursor_is_format(const Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8769
8770 /**
8771  * Advances 1 char forward.
8772  *
8773  * @param cur the cursor to advance.
8774  * @return @c EINA_TRUE on success @c EINA_FALSE otherwise.
8775  */
8776 EAPI Eina_Bool                    evas_textblock_cursor_char_next(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8777
8778 /**
8779  * Advances 1 char backward.
8780  *
8781  * @param cur the cursor to advance.
8782  * @return @c EINA_TRUE on success @c EINA_FALSE otherwise.
8783  */
8784 EAPI Eina_Bool                    evas_textblock_cursor_char_prev(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8785
8786 /**
8787  * Moves the cursor to the start of the word under the cursor.
8788  *
8789  * @param cur the cursor to move.
8790  * @return @c EINA_TRUE on success @c EINA_FALSE otherwise.
8791  * @since 1.2.0
8792  */
8793 EAPI Eina_Bool                    evas_textblock_cursor_word_start(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8794
8795 /**
8796  * Moves the cursor to the end of the word under the cursor.
8797  *
8798  * @param cur the cursor to move.
8799  * @return @c EINA_TRUE on success @c EINA_FALSE otherwise.
8800  * @since 1.2.0
8801  */
8802 EAPI Eina_Bool                    evas_textblock_cursor_word_end(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8803
8804 /**
8805  * Go to the first char in the node the cursor is pointing on.
8806  *
8807  * @param cur the cursor to update.
8808  * @return Returns no value.
8809  */
8810 EAPI void                         evas_textblock_cursor_paragraph_char_first(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8811
8812 /**
8813  * Go to the last char in a text node.
8814  *
8815  * @param cur the cursor to update.
8816  * @return Returns no value.
8817  */
8818 EAPI void                         evas_textblock_cursor_paragraph_char_last(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8819
8820 /**
8821  * Go to the start of the current line
8822  *
8823  * @param cur the cursor to update.
8824  * @return Returns no value.
8825  */
8826 EAPI void                         evas_textblock_cursor_line_char_first(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8827
8828 /**
8829  * Go to the end of the current line.
8830  *
8831  * @param cur the cursor to update.
8832  * @return Returns no value.
8833  */
8834 EAPI void                         evas_textblock_cursor_line_char_last(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8835
8836 /**
8837  * Return the current cursor pos.
8838  *
8839  * @param cur the cursor to take the position from.
8840  * @return the position or -1 on error
8841  */
8842 EAPI int                          evas_textblock_cursor_pos_get(const Evas_Textblock_Cursor *cur) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
8843
8844 /**
8845  * Set the cursor pos.
8846  *
8847  * @param cur the cursor to be set.
8848  * @param pos the pos to set.
8849  */
8850 EAPI void                         evas_textblock_cursor_pos_set(Evas_Textblock_Cursor *cur, int pos) EINA_ARG_NONNULL(1);
8851
8852 /**
8853  * Go to the start of the line passed
8854  *
8855  * @param cur cursor to update.
8856  * @param line numer to set.
8857  * @return @c EINA_TRUE on success, @c EINA_FALSE on error.
8858  */
8859 EAPI Eina_Bool                    evas_textblock_cursor_line_set(Evas_Textblock_Cursor *cur, int line) EINA_ARG_NONNULL(1);
8860
8861 /**
8862  * Compare two cursors.
8863  *
8864  * @param cur1 the first cursor.
8865  * @param cur2 the second cursor.
8866  * @return -1 if cur1 < cur2, 0 if cur1 == cur2 and 1 otherwise.
8867  */
8868 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);
8869
8870 /**
8871  * Make cur_dest point to the same place as cur. Does not work if they don't
8872  * point to the same object.
8873  *
8874  * @param cur the source cursor.
8875  * @param cur_dest destination cursor.
8876  * @return Returns no value.
8877  */
8878 EAPI void                         evas_textblock_cursor_copy(const Evas_Textblock_Cursor *cur, Evas_Textblock_Cursor *cur_dest) EINA_ARG_NONNULL(1, 2);
8879
8880
8881 /**
8882  * Adds text to the current cursor position and set the cursor to *before*
8883  * the start of the text just added.
8884  *
8885  * @param cur the cursor to where to add text at.
8886  * @param text the text to add.
8887  * @return Returns the len of the text added.
8888  * @see evas_textblock_cursor_text_prepend()
8889  */
8890 EAPI int                          evas_textblock_cursor_text_append(Evas_Textblock_Cursor *cur, const char *text) EINA_ARG_NONNULL(1, 2);
8891
8892 /**
8893  * Adds text to the current cursor position and set the cursor to *after*
8894  * the start of the text just added.
8895  *
8896  * @param cur the cursor to where to add text at.
8897  * @param text the text to add.
8898  * @return Returns the len of the text added.
8899  * @see evas_textblock_cursor_text_append()
8900  */
8901 EAPI int                          evas_textblock_cursor_text_prepend(Evas_Textblock_Cursor *cur, const char *text) EINA_ARG_NONNULL(1, 2);
8902
8903
8904 /**
8905  * Adds format to the current cursor position. If the format being added is a
8906  * visible format, add it *before* the cursor position, otherwise, add it after.
8907  * This behavior is because visible formats are like characters and invisible
8908  * should be stacked in a way that the last one is added last.
8909  *
8910  * This function works with native formats, that means that style defined
8911  * tags like <br> won't work here. For those kind of things use markup prepend.
8912  *
8913  * @param cur the cursor to where to add format at.
8914  * @param format the format to add.
8915  * @return Returns true if a visible format was added, false otherwise.
8916  * @see evas_textblock_cursor_format_prepend()
8917  */
8918
8919 /**
8920  * Check if the current cursor position points to the terminating null of the
8921  * last paragraph. (shouldn't be allowed to point to the terminating null of
8922  * any previous paragraph anyway.
8923  *
8924  * @param cur the cursor to look at.
8925  * @return @c EINA_TRUE if the cursor points to the terminating null, @c EINA_FALSE otherwise.
8926  */
8927 EAPI Eina_Bool                    evas_textblock_cursor_format_append(Evas_Textblock_Cursor *cur, const char *format) EINA_ARG_NONNULL(1, 2);
8928
8929 /**
8930  * Adds format to the current cursor position. If the format being added is a
8931  * visible format, add it *before* the cursor position, otherwise, add it after.
8932  * This behavior is because visible formats are like characters and invisible
8933  * should be stacked in a way that the last one is added last.
8934  * If the format is visible the cursor is advanced after it.
8935  *
8936  * This function works with native formats, that means that style defined
8937  * tags like <br> won't work here. For those kind of things use markup prepend.
8938  *
8939  * @param cur the cursor to where to add format at.
8940  * @param format the format to add.
8941  * @return Returns true if a visible format was added, false otherwise.
8942  * @see evas_textblock_cursor_format_prepend()
8943  */
8944 EAPI Eina_Bool                    evas_textblock_cursor_format_prepend(Evas_Textblock_Cursor *cur, const char *format) EINA_ARG_NONNULL(1, 2);
8945
8946 /**
8947  * Delete the character at the location of the cursor. If there's a format
8948  * pointing to this position, delete it as well.
8949  *
8950  * @param cur the cursor pointing to the current location.
8951  * @return Returns no value.
8952  */
8953 EAPI void                         evas_textblock_cursor_char_delete(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8954
8955 /**
8956  * Delete the range between cur1 and cur2.
8957  *
8958  * @param cur1 one side of the range.
8959  * @param cur2 the second side of the range
8960  * @return Returns no value.
8961  */
8962 EAPI void                         evas_textblock_cursor_range_delete(Evas_Textblock_Cursor *cur1, Evas_Textblock_Cursor *cur2) EINA_ARG_NONNULL(1, 2);
8963
8964
8965 /**
8966  * Return the text of the paragraph cur points to - returns the text in markup.
8967  *
8968  * @param cur the cursor pointing to the paragraph.
8969  * @return the text on success, @c NULL otherwise.
8970  */
8971 EAPI const char                  *evas_textblock_cursor_paragraph_text_get(const Evas_Textblock_Cursor *cur) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
8972
8973 /**
8974  * Return the length of the paragraph, cheaper the eina_unicode_strlen()
8975  *
8976  * @param cur the position of the paragraph.
8977  * @return the length of the paragraph on success, -1 otehrwise.
8978  */
8979 EAPI int                          evas_textblock_cursor_paragraph_text_length_get(const Evas_Textblock_Cursor *cur) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
8980
8981 /**
8982  * Return the currently visible range.
8983  *
8984  * @param start the start of the range.
8985  * @param end the end of the range.
8986  * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
8987  * @since 1.1.0
8988  */
8989 EAPI Eina_Bool                         evas_textblock_cursor_visible_range_get(Evas_Textblock_Cursor *start, Evas_Textblock_Cursor *end) EINA_ARG_NONNULL(1, 2);
8990
8991 /**
8992  * Return the format nodes in the range between cur1 and cur2.
8993  *
8994  * @param cur1 one side of the range.
8995  * @param cur2 the other side of the range
8996  * @return the foramt nodes in the range. You have to free it.
8997  * @since 1.1.0
8998  */
8999 EAPI Eina_List *                 evas_textblock_cursor_range_formats_get(const Evas_Textblock_Cursor *cur1, const Evas_Textblock_Cursor *cur2) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2);
9000
9001 /**
9002  * Return the text in the range between cur1 and cur2
9003  *
9004  * @param cur1 one side of the range.
9005  * @param cur2 the other side of the range
9006  * @param format The form on which to return the text. Markup - in textblock markup. Plain - UTF8.
9007  * @return the text in the range
9008  * @see elm_entry_markup_to_utf8()
9009  */
9010 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);
9011
9012 /**
9013  * Return the content of the cursor.
9014  *
9015  * Free the returned string pointer when done (if it is not NULL).
9016  * 
9017  * @param cur the cursor
9018  * @return the text in the range, terminated by a nul byte (may be utf8).
9019  */
9020 EAPI char                        *evas_textblock_cursor_content_get(const Evas_Textblock_Cursor *cur) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
9021
9022
9023 /**
9024  * Returns the geometry of the cursor. Depends on the type of cursor requested.
9025  * This should be used instead of char_geometry_get because there are weird
9026  * special cases with BiDi text.
9027  * in '_' cursor mode (i.e a line below the char) it's the same as char_geometry
9028  * get, except for the case of the last char of a line which depends on the
9029  * paragraph direction.
9030  *
9031  * in '|' cursor mode (i.e a line between two chars) it is very variable.
9032  * For example consider the following visual string:
9033  * "abcCBA" (ABC are rtl chars), a cursor pointing on A should actually draw
9034  * a '|' between the c and the C.
9035  *
9036  * @param cur the cursor.
9037  * @param cx the x of the cursor
9038  * @param cy the y of the cursor
9039  * @param cw the width of the cursor
9040  * @param ch the height of the cursor
9041  * @param dir the direction of the cursor, can be NULL.
9042  * @param ctype the type of the cursor.
9043  * @return line number of the char on success, -1 on error.
9044  */
9045 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);
9046
9047 /**
9048  * Returns the geometry of the char at cur.
9049  *
9050  * @param cur the position of the char.
9051  * @param cx the x of the char.
9052  * @param cy the y of the char.
9053  * @param cw the w of the char.
9054  * @param ch the h of the char.
9055  * @return line number of the char on success, -1 on error.
9056  */
9057 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);
9058
9059 /**
9060  * Returns the geometry of the pen at cur.
9061  *
9062  * @param cur the position of the char.
9063  * @param cpen_x the pen_x of the char.
9064  * @param cy the y of the char.
9065  * @param cadv the adv of the char.
9066  * @param ch the h of the char.
9067  * @return line number of the char on success, -1 on error.
9068  */
9069 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);
9070
9071 /**
9072  * Returns the geometry of the line at cur.
9073  *
9074  * @param cur the position of the line.
9075  * @param cx the x of the line.
9076  * @param cy the y of the line.
9077  * @param cw the width of the line.
9078  * @param ch the height of the line.
9079  * @return line number of the line on success, -1 on error.
9080  */
9081 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);
9082
9083 /**
9084  * Set the position of the cursor according to the X and Y coordinates.
9085  *
9086  * @param cur the cursor to set.
9087  * @param x coord to set by.
9088  * @param y coord to set by.
9089  * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
9090  */
9091 EAPI Eina_Bool                    evas_textblock_cursor_char_coord_set(Evas_Textblock_Cursor *cur, Evas_Coord x, Evas_Coord y) EINA_ARG_NONNULL(1);
9092
9093 /**
9094  * Set the cursor position according to the y coord.
9095  *
9096  * @param cur the cur to be set.
9097  * @param y the coord to set by.
9098  * @return the line number found, -1 on error.
9099  */
9100 EAPI int                          evas_textblock_cursor_line_coord_set(Evas_Textblock_Cursor *cur, Evas_Coord y) EINA_ARG_NONNULL(1);
9101
9102 /**
9103  * Get the geometry of a range.
9104  *
9105  * @param cur1 one side of the range.
9106  * @param cur2 other side of the range.
9107  * @return a list of Rectangles representing the geometry of the range.
9108  */
9109 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);
9110    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);
9111
9112
9113 /**
9114  * Checks if the cursor points to the end of the line.
9115  *
9116  * @param cur the cursor to check.
9117  * @return @c EINA_TRUE if true, @c EINA_FALSE otherwise.
9118  */
9119 EAPI Eina_Bool                    evas_textblock_cursor_eol_get(const Evas_Textblock_Cursor *cur) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
9120
9121
9122 /**
9123  * Get the geometry of a line number.
9124  *
9125  * @param obj the object.
9126  * @param line the line number.
9127  * @param cx x coord of the line.
9128  * @param cy y coord of the line.
9129  * @param cw w coord of the line.
9130  * @param ch h coord of the line.
9131  * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
9132  */
9133 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);
9134
9135 /**
9136  * Clear the textblock object.
9137  * @note Does *NOT* free the Evas object itself.
9138  *
9139  * @param obj the object to clear.
9140  * @return nothing.
9141  */
9142 EAPI void                         evas_object_textblock_clear(Evas_Object *obj) EINA_ARG_NONNULL(1);
9143
9144 /**
9145  * Get the formatted width and height. This calculates the actual size after restricting
9146  * the textblock to the current size of the object.
9147  * The main difference between this and @ref evas_object_textblock_size_native_get
9148  * is that the "native" function does not wrapping into account
9149  * it just calculates the real width of the object if it was placed on an
9150  * infinite canvas, while this function gives the size after wrapping
9151  * according to the size restrictions of the object.
9152  *
9153  * For example for a textblock containing the text: "You shall not pass!"
9154  * with no margins or padding and assuming a monospace font and a size of
9155  * 7x10 char widths (for simplicity) has a native size of 19x1
9156  * and a formatted size of 5x4.
9157  *
9158  *
9159  * @param obj the Evas object.
9160  * @param w the width of the object.
9161  * @param h the height of the object
9162  * @return Returns no value.
9163  * @see evas_object_textblock_size_native_get
9164  */
9165 EAPI void                         evas_object_textblock_size_formatted_get(const Evas_Object *obj, Evas_Coord *w, Evas_Coord *h) EINA_ARG_NONNULL(1);
9166
9167 /**
9168  * Get the native width and height. This calculates the actual size without taking account
9169  * the current size of the object.
9170  * The main difference between this and @ref evas_object_textblock_size_formatted_get
9171  * is that the "native" function does not take wrapping into account
9172  * it just calculates the real width of the object if it was placed on an
9173  * infinite canvas, while the "formatted" function gives the size after
9174  * wrapping text according to the size restrictions of the object.
9175  *
9176  * For example for a textblock containing the text: "You shall not pass!"
9177  * with no margins or padding and assuming a monospace font and a size of
9178  * 7x10 char widths (for simplicity) has a native size of 19x1
9179  * and a formatted size of 5x4.
9180  *
9181  * @param obj the Evas object of the textblock
9182  * @param w the width returned
9183  * @param h the height returned
9184  * @return Returns no value.
9185  */
9186 EAPI void                         evas_object_textblock_size_native_get(const Evas_Object *obj, Evas_Coord *w, Evas_Coord *h) EINA_ARG_NONNULL(1);
9187    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);
9188 /**
9189  * @}
9190  */
9191
9192 /**
9193  * @defgroup Evas_Line_Group Line Object Functions
9194  *
9195  * Functions used to deal with evas line objects.
9196  *
9197  * @warning We don't guarantee any proper results if you create a Line object
9198  * without setting the evas engine.
9199  *
9200  * @ingroup Evas_Object_Specific
9201  *
9202  * @{
9203  */
9204
9205 /**
9206  * Adds a new evas line object to the given evas.
9207  * @param   e The given evas.
9208  * @return  The new evas line object.
9209  */
9210 EAPI Evas_Object      *evas_object_line_add              (Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
9211
9212 /**
9213  * Sets the coordinates of the end points of the given evas line object.
9214  * @param   obj The given evas line object.
9215  * @param   x1  The X coordinate of the first point.
9216  * @param   y1  The Y coordinate of the first point.
9217  * @param   x2  The X coordinate of the second point.
9218  * @param   y2  The Y coordinate of the second point.
9219  */
9220 EAPI void              evas_object_line_xy_set           (Evas_Object *obj, Evas_Coord x1, Evas_Coord y1, Evas_Coord x2, Evas_Coord y2);
9221
9222 /**
9223  * Retrieves the coordinates of the end points of the given evas line object.
9224  * @param obj The given line object.
9225  * @param x1  Pointer to an integer in which to store the X coordinate of the
9226  *            first end point.
9227  * @param y1  Pointer to an integer in which to store the Y coordinate of the
9228  *            first end point.
9229  * @param x2  Pointer to an integer in which to store the X coordinate of the
9230  *            second end point.
9231  * @param y2  Pointer to an integer in which to store the Y coordinate of the
9232  *            second end point.
9233  */
9234 EAPI void              evas_object_line_xy_get           (const Evas_Object *obj, Evas_Coord *x1, Evas_Coord *y1, Evas_Coord *x2, Evas_Coord *y2);
9235 /**
9236  * @}
9237  */
9238
9239 /**
9240  * @defgroup Evas_Object_Polygon Polygon Object Functions
9241  *
9242  * Functions that operate on evas polygon objects.
9243  *
9244  * Hint: as evas does not provide ellipse, smooth paths or circle, one
9245  * can calculate points and convert these to a polygon.
9246  *
9247  * @warning We don't guarantee any proper results if you create a Polygon 
9248  * object without setting the evas engine.
9249  *
9250  * @ingroup Evas_Object_Specific
9251  *
9252  * @{
9253  */
9254
9255 /**
9256  * Adds a new evas polygon object to the given evas.
9257  * @param   e The given evas.
9258  * @return  A new evas polygon object.
9259  */
9260 EAPI Evas_Object      *evas_object_polygon_add           (Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
9261
9262 /**
9263  * Adds the given point to the given evas polygon object.
9264  * @param obj The given evas polygon object.
9265  * @param x   The X coordinate of the given point.
9266  * @param y   The Y coordinate of the given point.
9267  * @ingroup Evas_Polygon_Group
9268  */
9269 EAPI void              evas_object_polygon_point_add     (Evas_Object *obj, Evas_Coord x, Evas_Coord y) EINA_ARG_NONNULL(1);
9270
9271 /**
9272  * Removes all of the points from the given evas polygon object.
9273  * @param   obj The given polygon object.
9274  */
9275 EAPI void              evas_object_polygon_points_clear  (Evas_Object *obj) EINA_ARG_NONNULL(1);
9276 /**
9277  * @}
9278  */
9279
9280 /* @since 1.2.0 */
9281 EAPI void              evas_object_is_frame_object_set(Evas_Object *obj, Eina_Bool is_frame);
9282
9283 /* @since 1.2.0 */
9284 EAPI Eina_Bool         evas_object_is_frame_object_get(Evas_Object *obj);
9285
9286 /**
9287  * @defgroup Evas_Smart_Group Smart Functions
9288  *
9289  * Functions that deal with #Evas_Smart structs, creating definition
9290  * (classes) of objects that will have customized behavior for methods
9291  * like evas_object_move(), evas_object_resize(),
9292  * evas_object_clip_set() and others.
9293  *
9294  * These objects will accept the generic methods defined in @ref
9295  * Evas_Object_Group and the extensions defined in @ref
9296  * Evas_Smart_Object_Group. There are a couple of existent smart
9297  * objects in Evas itself (see @ref Evas_Object_Box, @ref
9298  * Evas_Object_Table and @ref Evas_Smart_Object_Clipped).
9299  *
9300  * See also some @ref Example_Evas_Smart_Objects "examples" of this
9301  * group of functions.
9302  */
9303
9304 /**
9305  * @addtogroup Evas_Smart_Group
9306  * @{
9307  */
9308
9309 /**
9310  * @def EVAS_SMART_CLASS_VERSION
9311  *
9312  * The version you have to put into the version field in the
9313  * #Evas_Smart_Class struct. Used to safeguard from binaries with old
9314  * smart object intefaces running with newer ones.
9315  *
9316  * @ingroup Evas_Smart_Group
9317  */
9318 #define EVAS_SMART_CLASS_VERSION 4
9319 /**
9320  * @struct _Evas_Smart_Class
9321  *
9322  * A smart object's @b base class definition
9323  *
9324  * @ingroup Evas_Smart_Group
9325  */
9326 struct _Evas_Smart_Class
9327 {
9328    const char *name; /**< the name string of the class */
9329    int         version;
9330    void  (*add)         (Evas_Object *o); /**< code to be run when adding object to a canvas */
9331    void  (*del)         (Evas_Object *o); /**< code to be run when removing object to a canvas */
9332    void  (*move)        (Evas_Object *o, Evas_Coord x, Evas_Coord y); /**< code to be run when moving object on a canvas. @a x and @a y will be new coordinates one applied to the object. use evas_object_geometry_get() if you need the old values, during this call. after that, the old values will be lost. */
9333    void  (*resize)      (Evas_Object *o, Evas_Coord w, Evas_Coord h); /**< code to be run when resizing object on a canvas. @a w and @a h will be new dimensions one applied to the object. use evas_object_geometry_get() if you need the old values, during this call. after that, the old values will be lost. */
9334    void  (*show)        (Evas_Object *o); /**< code to be run when showing object on a canvas */
9335    void  (*hide)        (Evas_Object *o); /**< code to be run when hiding object on a canvas */
9336    void  (*color_set)   (Evas_Object *o, int r, int g, int b, int a); /**< code to be run when setting color of object on a canvas. @a r, @a g, @a b and @a y will be new color components one applied to the object. use evas_object_color_get() if you need the old values, during this call. after that, the old values will be lost. */
9337    void  (*clip_set)    (Evas_Object *o, Evas_Object *clip); /**< code to be run when setting clipper of object on a canvas. @a clip will be new clipper one applied to the object. use evas_object_clip_get() if you need the old one, during this call. after that, the old (object pointer) value will be lost. */
9338    void  (*clip_unset)  (Evas_Object *o); /**< code to be run when unsetting clipper of object on a canvas. if you need the pointer to a previous set clipper, during this call, use evas_object_clip_get(). after that, the old (object pointer) value will be lost. */
9339    void  (*calculate)   (Evas_Object *o); /**< code to be run when object has rendering updates on a canvas */
9340    void  (*member_add)  (Evas_Object *o, Evas_Object *child); /**< code to be run when a child member is added to object */
9341    void  (*member_del)  (Evas_Object *o, Evas_Object *child); /**< code to be run when a child member is removed from object */
9342
9343    const Evas_Smart_Class          *parent; /**< this class inherits from this parent */
9344    const Evas_Smart_Cb_Description *callbacks; /**< callbacks at this level, @c NULL terminated */
9345    void                            *interfaces; /**< to be used in a future near you */
9346    const void                      *data;
9347 };
9348
9349 /**
9350  * @struct _Evas_Smart_Cb_Description
9351  *
9352  * Describes a callback issued by a smart object
9353  * (evas_object_smart_callback_call()), as defined in its smart object
9354  * class. This is particularly useful to explain to end users and
9355  * their code (i.e., introspection) what the parameter @c event_info
9356  * will point to.
9357  *
9358  * @ingroup Evas_Smart_Group
9359  */
9360 struct _Evas_Smart_Cb_Description
9361 {
9362    const char *name; /**< callback name ("changed", for example) */
9363
9364    /**
9365     * @brief Hint on the type of @c event_info parameter's contents on
9366     * a #Evas_Smart_Cb callback.
9367     *
9368     * The type string uses the pattern similar to
9369     * http://dbus.freedesktop.org/doc/dbus-specification.html#message-protocol-signatures,
9370     * but extended to optionally include variable names within
9371     * brackets preceding types. Example:
9372     *
9373     * @li Structure with two integers:
9374     *     @c "(ii)"
9375     *
9376     * @li Structure called 'x' with two integers named 'a' and 'b':
9377     *     @c "[x]([a]i[b]i)"
9378     *
9379     * @li Array of integers:
9380     *     @c "ai"
9381     *
9382     * @li Array called 'x' of struct with two integers:
9383     *     @c "[x]a(ii)"
9384     *
9385     * @note This type string is used as a hint and is @b not validated
9386     *       or enforced in any way. Implementors should make the best
9387     *       use of it to help bindings, documentation and other users
9388     *       of introspection features.
9389     */
9390    const char *type;
9391 };
9392
9393 /**
9394  * @def EVAS_SMART_CLASS_INIT_NULL
9395  * Initializer to zero a whole Evas_Smart_Class structure.
9396  *
9397  * @see EVAS_SMART_CLASS_INIT_VERSION
9398  * @see EVAS_SMART_CLASS_INIT_NAME_VERSION
9399  * @see EVAS_SMART_CLASS_INIT_NAME_VERSION_PARENT
9400  * @see EVAS_SMART_CLASS_INIT_NAME_VERSION_PARENT_CALLBACKS
9401  * @ingroup Evas_Smart_Group
9402  */
9403 #define EVAS_SMART_CLASS_INIT_NULL {NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL}
9404
9405 /**
9406  * @def EVAS_SMART_CLASS_INIT_VERSION
9407  * Initializer to zero a whole Evas_Smart_Class structure and set version.
9408  *
9409  * Similar to EVAS_SMART_CLASS_INIT_NULL, but will set version field to
9410  * latest EVAS_SMART_CLASS_VERSION.
9411  *
9412  * @see EVAS_SMART_CLASS_INIT_NULL
9413  * @see EVAS_SMART_CLASS_INIT_NAME_VERSION
9414  * @see EVAS_SMART_CLASS_INIT_NAME_VERSION_PARENT
9415  * @see EVAS_SMART_CLASS_INIT_NAME_VERSION_PARENT_CALLBACKS
9416  * @ingroup Evas_Smart_Group
9417  */
9418 #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}
9419
9420 /**
9421  * @def EVAS_SMART_CLASS_INIT_NAME_VERSION
9422  * Initializer to zero a whole Evas_Smart_Class structure and set name
9423  * and version.
9424  *
9425  * Similar to EVAS_SMART_CLASS_INIT_NULL, but will set version field to
9426  * latest EVAS_SMART_CLASS_VERSION and name to the specified value.
9427  *
9428  * It will keep a reference to name field as a "const char *", that is,
9429  * name must be available while the structure is used (hint: static or global!)
9430  * and will not be modified.
9431  *
9432  * @see EVAS_SMART_CLASS_INIT_NULL
9433  * @see EVAS_SMART_CLASS_INIT_VERSION
9434  * @see EVAS_SMART_CLASS_INIT_NAME_VERSION_PARENT
9435  * @see EVAS_SMART_CLASS_INIT_NAME_VERSION_PARENT_CALLBACKS
9436  * @ingroup Evas_Smart_Group
9437  */
9438 #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}
9439
9440 /**
9441  * @def EVAS_SMART_CLASS_INIT_NAME_VERSION_PARENT
9442  * Initializer to zero a whole Evas_Smart_Class structure and set name,
9443  * version and parent class.
9444  *
9445  * Similar to EVAS_SMART_CLASS_INIT_NULL, but will set version field to
9446  * latest EVAS_SMART_CLASS_VERSION, name to the specified value and
9447  * parent class.
9448  *
9449  * It will keep a reference to name field as a "const char *", that is,
9450  * name must be available while the structure is used (hint: static or global!)
9451  * and will not be modified. Similarly, parent reference will be kept.
9452  *
9453  * @see EVAS_SMART_CLASS_INIT_NULL
9454  * @see EVAS_SMART_CLASS_INIT_VERSION
9455  * @see EVAS_SMART_CLASS_INIT_NAME_VERSION
9456  * @see EVAS_SMART_CLASS_INIT_NAME_VERSION_PARENT_CALLBACKS
9457  * @ingroup Evas_Smart_Group
9458  */
9459 #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}
9460
9461 /**
9462  * @def EVAS_SMART_CLASS_INIT_NAME_VERSION_PARENT_CALLBACKS
9463  * Initializer to zero a whole Evas_Smart_Class structure and set name,
9464  * version, parent class and callbacks definition.
9465  *
9466  * Similar to EVAS_SMART_CLASS_INIT_NULL, but will set version field to
9467  * latest EVAS_SMART_CLASS_VERSION, name to the specified value, parent
9468  * class and callbacks at this level.
9469  *
9470  * It will keep a reference to name field as a "const char *", that is,
9471  * name must be available while the structure is used (hint: static or global!)
9472  * and will not be modified. Similarly, parent and callbacks reference
9473  * will be kept.
9474  *
9475  * @see EVAS_SMART_CLASS_INIT_NULL
9476  * @see EVAS_SMART_CLASS_INIT_VERSION
9477  * @see EVAS_SMART_CLASS_INIT_NAME_VERSION
9478  * @see EVAS_SMART_CLASS_INIT_NAME_VERSION_PARENT
9479  * @ingroup Evas_Smart_Group
9480  */
9481 #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}
9482
9483 /**
9484  * @def EVAS_SMART_SUBCLASS_NEW
9485  *
9486  * Convenience macro to subclass a given Evas smart class.
9487  *
9488  * @param smart_name The name used for the smart class. e.g:
9489  * @c "Evas_Object_Box".
9490  * @param prefix Prefix used for all variables and functions defined
9491  * and referenced by this macro.
9492  * @param api_type Type of the structure used as API for the smart
9493  * class. Either #Evas_Smart_Class or something derived from it.
9494  * @param parent_type Type of the parent class API.
9495  * @param parent_func Function that gets the parent class. e.g:
9496  * evas_object_box_smart_class_get().
9497  * @param cb_desc Array of callback descriptions for this smart class.
9498  *
9499  * This macro saves some typing when writing a smart class derived
9500  * from another one. In order to work, the user @b must provide some
9501  * functions adhering to the following guidelines:
9502  *  - @<prefix@>_smart_set_user(): the @b internal @c _smart_set
9503  *    function (defined by this macro) will call this one, provided by
9504  *    the user, after inheriting everything from the parent, which
9505  *    should <b>take care of setting the right member functions for
9506  *    the class</b>, both overrides and extensions, if any.
9507  *  - If this new class should be subclassable as well, a @b public
9508  *    @c _smart_set() function is desirable to fill in the class used as
9509  *    parent by the children. It's up to the user to provide this
9510  *    interface, which will most likely call @<prefix@>_smart_set() to
9511  *    get the job done.
9512  *
9513  * After the macro's usage, the following will be defined for use:
9514  *  - @<prefix@>_parent_sc: A pointer to the @b parent smart
9515  *    class. When calling parent functions from overloaded ones, use
9516  *    this global variable.
9517  *  - @<prefix@>_smart_class_new(): this function returns the
9518  *    #Evas_Smart needed to create smart objects with this class,
9519  *    which should be passed to evas_object_smart_add().
9520  *
9521  * @warning @p smart_name has to be a pointer to a globally available
9522  * string! The smart class created here will just have a pointer set
9523  * to that, and all object instances will depend on it for smart class
9524  * name lookup.
9525  *
9526  * @ingroup Evas_Smart_Group
9527  */
9528 #define EVAS_SMART_SUBCLASS_NEW(smart_name, prefix, api_type, parent_type, parent_func, cb_desc) \
9529   static const parent_type * prefix##_parent_sc = NULL;         \
9530   static void prefix##_smart_set_user(api_type *api);           \
9531   static void prefix##_smart_set(api_type *api)                 \
9532   {                                                             \
9533      Evas_Smart_Class *sc;                                      \
9534      if (!(sc = (Evas_Smart_Class *)api))                       \
9535        return;                                                  \
9536      if (!prefix##_parent_sc)                                   \
9537        prefix##_parent_sc = parent_func();                      \
9538      evas_smart_class_inherit(sc, prefix##_parent_sc);          \
9539      prefix##_smart_set_user(api);                              \
9540   }                                                             \
9541   static Evas_Smart * prefix##_smart_class_new(void)            \
9542   {                                                             \
9543      static Evas_Smart *smart = NULL;                           \
9544      static api_type api;                                       \
9545      if (!smart)                                                \
9546        {                                                        \
9547           Evas_Smart_Class *sc = (Evas_Smart_Class *)&api;      \
9548           memset(&api, 0, sizeof(api_type));                    \
9549           sc->version = EVAS_SMART_CLASS_VERSION;               \
9550           sc->name = smart_name;                                \
9551           sc->callbacks = cb_desc;                              \
9552           prefix##_smart_set(&api);                             \
9553           smart = evas_smart_class_new(sc);                     \
9554        }                                                        \
9555      return smart;                                              \
9556   }
9557
9558 /**
9559  * @def EVAS_SMART_DATA_ALLOC
9560  *
9561  * Convenience macro to allocate smart data only if needed.
9562  *
9563  * When writing a subclassable smart object, the @c .add() function
9564  * will need to check if the smart private data was already allocated
9565  * by some child object or not. This macro makes it easier to do it.
9566  *
9567  * @note This is an idiom used when one calls the parent's @c .add()
9568  * after the specialized code. Naturally, the parent's base smart data
9569  * has to be contemplated as the specialized one's first member, for
9570  * things to work.
9571  *
9572  * @param o Evas object passed to the @c .add() function
9573  * @param priv_type The type of the data to allocate
9574  *
9575  * @ingroup Evas_Smart_Group
9576  */
9577 #define EVAS_SMART_DATA_ALLOC(o, priv_type) \
9578    priv_type *priv; \
9579    priv = evas_object_smart_data_get(o); \
9580    if (!priv) { \
9581       priv = (priv_type *)calloc(1, sizeof(priv_type)); \
9582       if (!priv) return; \
9583       evas_object_smart_data_set(o, priv); \
9584    }
9585
9586
9587 /**
9588  * Free an #Evas_Smart struct
9589  *
9590  * @param s the #Evas_Smart struct to free
9591  *
9592  * @warning If this smart handle was created using
9593  * evas_smart_class_new(), the associated #Evas_Smart_Class will not
9594  * be freed.
9595  *
9596  * @note If you're using the #EVAS_SMART_SUBCLASS_NEW schema to create your
9597  * smart object, note that an #Evas_Smart handle will be shared amongst all
9598  * instances of the given smart class, through a static variable.
9599  * Evas will internally count references on #Evas_Smart handles and free them
9600  * when they are not referenced anymore. Thus, this function is of no use
9601  * for Evas users, most probably.
9602  */
9603 EAPI void                             evas_smart_free                     (Evas_Smart *s) EINA_ARG_NONNULL(1);
9604
9605 /**
9606  * Creates a new #Evas_Smart from a given #Evas_Smart_Class struct
9607  *
9608  * @param sc the smart class definition
9609  * @return a new #Evas_Smart pointer
9610  *
9611  * #Evas_Smart handles are necessary to create new @b instances of
9612  * smart objects belonging to the class described by @p sc. That
9613  * handle will contain, besides the smart class interface definition,
9614  * all its smart callbacks infrastructure set, too.
9615  *
9616  * @note If you are willing to subclass a given smart class to
9617  * construct yours, consider using the #EVAS_SMART_SUBCLASS_NEW macro,
9618  * which will make use of this function automatically for you.
9619  */
9620 EAPI Evas_Smart                      *evas_smart_class_new                (const Evas_Smart_Class *sc) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
9621
9622 /**
9623  * Get the #Evas_Smart_Class handle of an #Evas_Smart struct
9624  *
9625  * @param s a valid #Evas_Smart pointer
9626  * @return the #Evas_Smart_Class in it
9627  */
9628 EAPI const Evas_Smart_Class          *evas_smart_class_get                (const Evas_Smart *s) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
9629
9630
9631 /**
9632  * @brief Get the data pointer set on an #Evas_Smart struct
9633  *
9634  * @param s a valid #Evas_Smart handle
9635  *
9636  * This data pointer is set as the data field in the #Evas_Smart_Class
9637  * passed in to evas_smart_class_new().
9638  */
9639 EAPI void                            *evas_smart_data_get                 (const Evas_Smart *s) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
9640
9641 /**
9642  * Get the smart callbacks known by this #Evas_Smart handle's smart
9643  * class hierarchy.
9644  *
9645  * @param s A valid #Evas_Smart handle.
9646  * @param[out] count Returns the number of elements in the returned
9647  * array.
9648  * @return The array with callback descriptions known by this smart
9649  *         class, with its size returned in @a count parameter. It
9650  *         should not be modified in any way. If no callbacks are
9651  *         known, @c NULL is returned. The array is sorted by event
9652  *         names and elements refer to the original values given to
9653  *         evas_smart_class_new()'s Evas_Smart_Class::callbacks
9654  *         (pointer to them).
9655  *
9656  * This is likely different from
9657  * evas_object_smart_callbacks_descriptions_get() as it will contain
9658  * the callbacks of @b all this class hierarchy sorted, while the
9659  * direct smart class member refers only to that specific class and
9660  * should not include parent's.
9661  *
9662  * If no callbacks are known, this function returns @c NULL.
9663  *
9664  * The array elements and thus their contents will be @b references to
9665  * original values given to evas_smart_class_new() as
9666  * Evas_Smart_Class::callbacks.
9667  *
9668  * The array is sorted by Evas_Smart_Cb_Description::name. The last
9669  * array element is a @c NULL pointer and is not accounted for in @a
9670  * count. Loop iterations can check any of these size indicators.
9671  *
9672  * @note objects may provide per-instance callbacks, use
9673  *       evas_object_smart_callbacks_descriptions_get() to get those
9674  *       as well.
9675  * @see evas_object_smart_callbacks_descriptions_get()
9676  */
9677 EAPI const Evas_Smart_Cb_Description **evas_smart_callbacks_descriptions_get(const Evas_Smart *s, unsigned int *count) EINA_ARG_NONNULL(1, 1);
9678
9679
9680 /**
9681  * Find a callback description for the callback named @a name.
9682  *
9683  * @param s The #Evas_Smart where to search for class registered smart
9684  * event callbacks.
9685  * @param name Name of the desired callback, which must @b not be @c
9686  *        NULL. The search has a special case for @a name being the
9687  *        same pointer as registered with #Evas_Smart_Cb_Description.
9688  *        One can use it to avoid excessive use of strcmp().
9689  * @return A reference to the description if found, or @c NULL, otherwise
9690  *
9691  * @see evas_smart_callbacks_descriptions_get()
9692  */
9693 EAPI const Evas_Smart_Cb_Description *evas_smart_callback_description_find(const Evas_Smart *s, const char *name) EINA_ARG_NONNULL(1, 2);
9694
9695
9696 /**
9697  * Sets one class to inherit from the other.
9698  *
9699  * Copy all function pointers, set @c parent to @a parent_sc and copy
9700  * everything after sizeof(Evas_Smart_Class) present in @a parent_sc,
9701  * using @a parent_sc_size as reference.
9702  *
9703  * This is recommended instead of a single memcpy() since it will take
9704  * care to not modify @a sc name, version, callbacks and possible
9705  * other members.
9706  *
9707  * @param sc child class.
9708  * @param parent_sc parent class, will provide attributes.
9709  * @param parent_sc_size size of parent_sc structure, child should be at least
9710  *        this size. Everything after @c Evas_Smart_Class size is copied
9711  *        using regular memcpy().
9712  */
9713 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);
9714
9715 /**
9716  * Get the number of users of the smart instance
9717  *
9718  * @param s The Evas_Smart to get the usage count of
9719  * @return The number of uses of the smart instance
9720  *
9721  * This function tells you how many more uses of the smart instance are in
9722  * existence. This should be used before freeing/clearing any of the
9723  * Evas_Smart_Class that was used to create the smart instance. The smart
9724  * instance will refer to data in the Evas_Smart_Class used to create it and
9725  * thus you cannot remove the original data until all users of it are gone.
9726  * When the usage count goes to 0, you can evas_smart_free() the smart
9727  * instance @p s and remove from memory any of the Evas_Smart_Class that
9728  * was used to create the smart instance, if you desire. Removing it from
9729  * memory without doing this will cause problems (crashes, undefined
9730  * behavior etc. etc.), so either never remove the original
9731  * Evas_Smart_Class data from memory (have it be a constant structure and
9732  * data), or use this API call and be very careful.
9733  */
9734 EAPI int                              evas_smart_usage_get(const Evas_Smart *s);
9735
9736   /**
9737    * @def evas_smart_class_inherit
9738    * Easy to use version of evas_smart_class_inherit_full().
9739    *
9740    * This version will use sizeof(parent_sc), copying everything.
9741    *
9742    * @param sc child class, will have methods copied from @a parent_sc
9743    * @param parent_sc parent class, will provide contents to be copied.
9744    * @return 1 on success, 0 on failure.
9745    * @ingroup Evas_Smart_Group
9746    */
9747 #define evas_smart_class_inherit(sc, parent_sc) evas_smart_class_inherit_full(sc, (Evas_Smart_Class *)parent_sc, sizeof(*parent_sc))
9748
9749 /**
9750  * @}
9751  */
9752
9753 /**
9754  * @defgroup Evas_Smart_Object_Group Smart Object Functions
9755  *
9756  * Functions dealing with Evas smart objects (instances).
9757  *
9758  * Smart objects are groupings of primitive Evas objects that behave
9759  * as a cohesive group. For instance, a file manager icon may be a
9760  * smart object composed of an image object, a text label and two
9761  * rectangles that appear behind the image and text when the icon is
9762  * selected. As a smart object, the normal Evas object API could be
9763  * used on the icon object.
9764  *
9765  * Besides that, generally smart objects implement a <b>specific
9766  * API</b>, so that users interact with its own custom features. The
9767  * API takes form of explicit exported functions one may call and
9768  * <b>smart callbacks</b>.
9769  *
9770  * @section Evas_Smart_Object_Group_Callbacks Smart events and callbacks
9771  *
9772  * Smart objects can elect events (smart events, from now on) occurring
9773  * inside of them to be reported back to their users via callback
9774  * functions (smart callbacks). This way, you can extend Evas' own
9775  * object events. They are defined by an <b>event string</b>, which
9776  * identifies them uniquely. There's also a function prototype
9777  * definition for the callback functions: #Evas_Smart_Cb.
9778  *
9779  * When defining an #Evas_Smart_Class, smart object implementors are
9780  * strongly encouraged to properly set the Evas_Smart_Class::callbacks
9781  * callbacks description array, so that the users of the smart object
9782  * can have introspection on its events API <b>at run time</b>.
9783  *
9784  * See some @ref Example_Evas_Smart_Objects "examples" of this group
9785  * of functions.
9786  *
9787  * @see @ref Evas_Smart_Group for class definitions.
9788  */
9789
9790 /**
9791  * @addtogroup Evas_Smart_Object_Group
9792  * @{
9793  */
9794
9795 /**
9796  * Instantiates a new smart object described by @p s.
9797  *
9798  * @param e the canvas on which to add the object
9799  * @param s the #Evas_Smart describing the smart object
9800  * @return a new #Evas_Object handle
9801  *
9802  * This is the function one should use when defining the public
9803  * function @b adding an instance of the new smart object to a given
9804  * canvas. It will take care of setting all of its internals to work
9805  * as they should, if the user set things properly, as seem on the
9806  * #EVAS_SMART_SUBCLASS_NEW, for example.
9807  *
9808  * @ingroup Evas_Smart_Object_Group
9809  */
9810 EAPI Evas_Object      *evas_object_smart_add             (Evas *e, Evas_Smart *s) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2) EINA_MALLOC;
9811
9812 /**
9813  * Set an Evas object as a member of a given smart object.
9814  *
9815  * @param obj The member object
9816  * @param smart_obj The smart object
9817  *
9818  * Members will automatically be stacked and layered together with the
9819  * smart object. The various stacking functions will operate on
9820  * members relative to the other members instead of the entire canvas,
9821  * since they now live on an exclusive layer (see
9822  * evas_object_stack_above(), for more details).
9823  *
9824  * Any @p smart_obj object's specific implementation of the @c
9825  * member_add() smart function will take place too, naturally.
9826  *
9827  * @see evas_object_smart_member_del()
9828  * @see evas_object_smart_members_get()
9829  *
9830  * @ingroup Evas_Smart_Object_Group
9831  */
9832 EAPI void              evas_object_smart_member_add      (Evas_Object *obj, Evas_Object *smart_obj) EINA_ARG_NONNULL(1, 2);
9833
9834 /**
9835  * Removes a member object from a given smart object.
9836  *
9837  * @param obj the member object
9838  * @ingroup Evas_Smart_Object_Group
9839  *
9840  * This removes a member object from a smart object, if it was added
9841  * to any. The object will still be on the canvas, but no longer
9842  * associated with whichever smart object it was associated with.
9843  *
9844  * @see evas_object_smart_member_add() for more details
9845  * @see evas_object_smart_members_get()
9846  */
9847 EAPI void              evas_object_smart_member_del      (Evas_Object *obj) EINA_ARG_NONNULL(1);
9848
9849 /**
9850  * Retrieves the list of the member objects of a given Evas smart
9851  * object
9852  *
9853  * @param obj the smart object to get members from
9854  * @return Returns the list of the member objects of @p obj.
9855  *
9856  * The returned list should be freed with @c eina_list_free() when you
9857  * no longer need it.
9858  *
9859  * @see evas_object_smart_member_add()
9860  * @see evas_object_smart_member_del()
9861 */
9862 EAPI Eina_List        *evas_object_smart_members_get     (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
9863
9864 /**
9865  * Gets the parent smart object of a given Evas object, if it has one.
9866  *
9867  * @param obj the Evas object you want to get the parent smart object
9868  * from
9869  * @return Returns the parent smart object of @a obj or @c NULL, if @a
9870  * obj is not a smart member of any
9871  *
9872  * @ingroup Evas_Smart_Object_Group
9873  */
9874 EAPI Evas_Object      *evas_object_smart_parent_get      (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
9875
9876 /**
9877  * Checks whether a given smart object or any of its smart object
9878  * parents is of a given smart class.
9879  *
9880  * @param obj An Evas smart object to check the type of
9881  * @param type The @b name (type) of the smart class to check for
9882  * @return @c EINA_TRUE, if @a obj or any of its parents is of type @a
9883  * type, @c EINA_FALSE otherwise
9884  *
9885  * If @p obj is not a smart object, this call will fail
9886  * immediately. Otherwise, make sure evas_smart_class_inherit() or its
9887  * sibling functions were used correctly when creating the smart
9888  * object's class, so it has a valid @b parent smart class pointer
9889  * set.
9890  *
9891  * The checks use smart classes names and <b>string
9892  * comparison</b>. There is a version of this same check using
9893  * <b>pointer comparison</b>, since a smart class' name is a single
9894  * string in Evas.
9895  *
9896  * @see evas_object_smart_type_check_ptr()
9897  * @see #EVAS_SMART_SUBCLASS_NEW
9898  *
9899  * @ingroup Evas_Smart_Object_Group
9900  */
9901 EAPI Eina_Bool         evas_object_smart_type_check      (const Evas_Object *obj, const char *type) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2);
9902
9903 /**
9904  * Checks whether a given smart object or any of its smart object
9905  * parents is of a given smart class, <b>using pointer comparison</b>.
9906  *
9907  * @param obj An Evas smart object to check the type of
9908  * @param type The type (name string) to check for. Must be the name
9909  * @return @c EINA_TRUE, if @a obj or any of its parents is of type @a
9910  * type, @c EINA_FALSE otherwise
9911  *
9912  * @see evas_object_smart_type_check() for more details
9913  *
9914  * @ingroup Evas_Smart_Object_Group
9915  */
9916 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);
9917
9918 /**
9919  * Get the #Evas_Smart from which @p obj smart object was created.
9920  *
9921  * @param obj a smart object
9922  * @return the #Evas_Smart handle or @c NULL, on errors
9923  *
9924  * @ingroup Evas_Smart_Object_Group
9925  */
9926 EAPI Evas_Smart       *evas_object_smart_smart_get       (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
9927
9928 /**
9929  * Retrieve user data stored on a given smart object.
9930  *
9931  * @param obj The smart object's handle
9932  * @return A pointer to data stored using
9933  *         evas_object_smart_data_set(), or @c NULL, if none has been
9934  *         set.
9935  *
9936  * @see evas_object_smart_data_set()
9937  *
9938  * @ingroup Evas_Smart_Object_Group
9939  */
9940 EAPI void             *evas_object_smart_data_get        (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
9941
9942 /**
9943  * Store a pointer to user data for a given smart object.
9944  *
9945  * @param obj The smart object's handle
9946  * @param data A pointer to user data
9947  *
9948  * This data is stored @b independently of the one set by
9949  * evas_object_data_set(), naturally.
9950  *
9951  * @see evas_object_smart_data_get()
9952  *
9953  * @ingroup Evas_Smart_Object_Group
9954  */
9955 EAPI void              evas_object_smart_data_set        (Evas_Object *obj, void *data) EINA_ARG_NONNULL(1);
9956
9957 /**
9958  * Add (register) a callback function to the smart event specified by
9959  * @p event on the smart object @p obj.
9960  *
9961  * @param obj a smart object
9962  * @param event the event's name string
9963  * @param func the callback function
9964  * @param data user data to be passed to the callback function
9965  *
9966  * Smart callbacks look very similar to Evas callbacks, but are
9967  * implemented as smart object's custom ones.
9968  *
9969  * This function adds a function callback to an smart object when the
9970  * event named @p event occurs in it. The function is @p func.
9971  *
9972  * In the event of a memory allocation error during addition of the
9973  * callback to the object, evas_alloc_error() should be used to
9974  * determine the nature of the error, if any, and the program should
9975  * sensibly try and recover.
9976  *
9977  * A smart callback function must have the ::Evas_Smart_Cb prototype
9978  * definition. The first parameter (@p data) in this definition will
9979  * have the same value passed to evas_object_smart_callback_add() as
9980  * the @p data parameter, at runtime. The second parameter @p obj is a
9981  * handle to the object on which the event occurred. The third
9982  * parameter, @p event_info, is a pointer to data which is totally
9983  * dependent on the smart object's implementation and semantic for the
9984  * given event.
9985  *
9986  * There is an infrastructure for introspection on smart objects'
9987  * events (see evas_smart_callbacks_descriptions_get()), but no
9988  * internal smart objects on Evas implement them yet.
9989  *
9990  * @see @ref Evas_Smart_Object_Group_Callbacks for more details.
9991  *
9992  * @see evas_object_smart_callback_del()
9993  * @ingroup Evas_Smart_Object_Group
9994  */
9995 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);
9996
9997 /**
9998  * Add (register) a callback function to the smart event specified by
9999  * @p event on the smart object @p obj. Except for the priority field,
10000  * it's exactly the same as @ref evas_object_smart_callback_add
10001  *
10002  * @param obj a smart object
10003  * @param event the event's name string
10004  * @param priority The priority of the callback, lower values called first.
10005  * @param func the callback function
10006  * @param data user data to be passed to the callback function
10007  *
10008  * @see evas_object_smart_callback_add
10009  * @since 1.1.0
10010  * @ingroup Evas_Smart_Object_Group
10011  */
10012 EAPI void              evas_object_smart_callback_priority_add(Evas_Object *obj, const char *event, Evas_Callback_Priority priority, Evas_Smart_Cb func, const void *data);
10013
10014 /**
10015  * Delete (unregister) a callback function from the smart event
10016  * specified by @p event on the smart object @p obj.
10017  *
10018  * @param obj a smart object
10019  * @param event the event's name string
10020  * @param func the callback function
10021  * @return the data pointer
10022  *
10023  * This function removes <b>the first</b> added smart callback on the
10024  * object @p obj matching the event name @p event and the registered
10025  * function pointer @p func. If the removal is successful it will also
10026  * return the data pointer that was passed to
10027  * evas_object_smart_callback_add() (that will be the same as the
10028  * parameter) when the callback(s) was(were) added to the canvas. If
10029  * not successful @c NULL will be returned.
10030  *
10031  * @see evas_object_smart_callback_add() for more details.
10032  *
10033  * @ingroup Evas_Smart_Object_Group
10034  */
10035 EAPI void             *evas_object_smart_callback_del    (Evas_Object *obj, const char *event, Evas_Smart_Cb func) EINA_ARG_NONNULL(1, 2, 3);
10036
10037 /**
10038  * Delete (unregister) a callback function from the smart event
10039  * specified by @p event on the smart object @p obj.
10040  *
10041  * @param obj a smart object
10042  * @param event the event's name string
10043  * @param func the callback function
10044  * @param data the data pointer that was passed to the callback
10045  * @return the data pointer
10046  *
10047  * This function removes <b>the first</b> added smart callback on the
10048  * object @p obj matching the event name @p event, the registered
10049  * function pointer @p func and the callback data pointer @p data. If
10050  * the removal is successful it will also return the data pointer that
10051  * was passed to evas_object_smart_callback_add() (that will be the same
10052  * as the parameter) when the callback(s) was(were) added to the canvas.
10053  * If not successful @c NULL will be returned. A common use would be to
10054  * remove an exact match of a callback
10055  *
10056  * @see evas_object_smart_callback_add() for more details.
10057  * @since 1.2.0
10058  * @ingroup Evas_Smart_Object_Group
10059  *
10060  * @note To delete all smart event callbacks which match @p type and @p func,
10061  * use evas_object_smart_callback_del().
10062  */
10063 EAPI void             *evas_object_smart_callback_del_full(Evas_Object *obj, const char *event, Evas_Smart_Cb func, const void *data) EINA_ARG_NONNULL(1, 2, 3);
10064
10065 /**
10066  * Call a given smart callback on the smart object @p obj.
10067  *
10068  * @param obj the smart object
10069  * @param event the event's name string
10070  * @param event_info pointer to an event specific struct or information to
10071  * pass to the callback functions registered on this smart event
10072  *
10073  * This should be called @b internally, from the smart object's own
10074  * code, when some specific event has occurred and the implementor
10075  * wants is to pertain to the object's events API (see @ref
10076  * Evas_Smart_Object_Group_Callbacks). The documentation for the smart
10077  * object should include a list of possible events and what type of @p
10078  * event_info to expect for each of them. Also, when defining an
10079  * #Evas_Smart_Class, smart object implementors are strongly
10080  * encouraged to properly set the Evas_Smart_Class::callbacks
10081  * callbacks description array, so that the users of the smart object
10082  * can have introspection on its events API <b>at run time</b>.
10083  *
10084  * @ingroup Evas_Smart_Object_Group
10085  */
10086 EAPI void              evas_object_smart_callback_call   (Evas_Object *obj, const char *event, void *event_info) EINA_ARG_NONNULL(1, 2);
10087
10088
10089 /**
10090  * Set an smart object @b instance's smart callbacks descriptions.
10091  *
10092  * @param obj A smart object
10093  * @param descriptions @c NULL terminated array with
10094  * #Evas_Smart_Cb_Description descriptions. Array elements won't be
10095  * modified at run time, but references to them and their contents
10096  * will be made, so this array should be kept alive during the whole
10097  * object's lifetime.
10098  * @return @c EINA_TRUE on success, @c EINA_FALSE on failure.
10099  *
10100  * These descriptions are hints to be used by introspection and are
10101  * not enforced in any way.
10102  *
10103  * It will not be checked if instance callbacks descriptions have the
10104  * same name as respective possibly registered in the smart object
10105  * @b class. Both are kept in different arrays and users of
10106  * evas_object_smart_callbacks_descriptions_get() should handle this
10107  * case as they wish.
10108  *
10109  * @note Becase @p descriptions must be @c NULL terminated, and
10110  *        because a @c NULL name makes little sense, too,
10111  *        Evas_Smart_Cb_Description::name must @b not be @c NULL.
10112  *
10113  * @note While instance callbacks descriptions are possible, they are
10114  *       @b not recommended. Use @b class callbacks descriptions
10115  *       instead as they make you smart object user's life simpler and
10116  *       will use less memory, as descriptions and arrays will be
10117  *       shared among all instances.
10118  *
10119  * @ingroup Evas_Smart_Object_Group
10120  */
10121 EAPI Eina_Bool         evas_object_smart_callbacks_descriptions_set(Evas_Object *obj, const Evas_Smart_Cb_Description *descriptions) EINA_ARG_NONNULL(1);
10122
10123 /**
10124  * Retrieve an smart object's know smart callback descriptions (both
10125  * instance and class ones).
10126  *
10127  * @param obj The smart object to get callback descriptions from.
10128  * @param class_descriptions Where to store class callbacks
10129  *        descriptions array, if any is known. If no descriptions are
10130  *        known, @c NULL is returned
10131  * @param class_count Returns how many class callbacks descriptions
10132  *        are known.
10133  * @param instance_descriptions Where to store instance callbacks
10134  *        descriptions array, if any is known. If no descriptions are
10135  *        known, @c NULL is returned.
10136  * @param instance_count Returns how many instance callbacks
10137  *        descriptions are known.
10138  *
10139  * This call searches for registered callback descriptions for both
10140  * instance and class of the given smart object. These arrays will be
10141  * sorted by Evas_Smart_Cb_Description::name and also @c NULL
10142  * terminated, so both @a class_count and @a instance_count can be
10143  * ignored, if the caller wishes so. The terminator @c NULL is not
10144  * counted in these values.
10145  *
10146  * @note If just class descriptions are of interest, try
10147  *       evas_smart_callbacks_descriptions_get() instead.
10148  *
10149  * @note Use @c NULL pointers on the descriptions/counters you're not
10150  * interested in: they'll be ignored by the function.
10151  *
10152  * @see evas_smart_callbacks_descriptions_get()
10153  *
10154  * @ingroup Evas_Smart_Object_Group
10155  */
10156 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);
10157
10158 /**
10159  * Find callback description for callback called @a name.
10160  *
10161  * @param obj the smart object.
10162  * @param name name of desired callback, must @b not be @c NULL.  The
10163  *        search have a special case for @a name being the same
10164  *        pointer as registered with Evas_Smart_Cb_Description, one
10165  *        can use it to avoid excessive use of strcmp().
10166  * @param class_description pointer to return class description or
10167  *        @c NULL if not found. If parameter is @c NULL, no search will
10168  *        be done on class descriptions.
10169  * @param instance_description pointer to return instance description
10170  *        or @c NULL if not found. If parameter is @c NULL, no search
10171  *        will be done on instance descriptions.
10172  * @return reference to description if found, @c NULL if not found.
10173  */
10174 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);
10175
10176
10177 /**
10178  * Mark smart object as changed, dirty.
10179  *
10180  * @param obj The given Evas smart object
10181  *
10182  * This will flag the given object as needing recalculation,
10183  * forcefully. As an effect, on the next rendering cycle it's @b
10184  * calculate() (see #Evas_Smart_Class) smart function will be called.
10185  *
10186  * @see evas_object_smart_need_recalculate_set().
10187  * @see evas_object_smart_calculate().
10188  *
10189  * @ingroup Evas_Smart_Object_Group
10190  */
10191 EAPI void              evas_object_smart_changed         (Evas_Object *obj) EINA_ARG_NONNULL(1);
10192
10193 /**
10194  * Set or unset the flag signalling that a given smart object needs to
10195  * get recalculated.
10196  *
10197  * @param obj the smart object
10198  * @param value whether one wants to set (@c EINA_TRUE) or to unset
10199  * (@c EINA_FALSE) the flag.
10200  *
10201  * If this flag is set, then the @c calculate() smart function of @p
10202  * obj will be called, if one is provided, during rendering phase of
10203  * Evas (see evas_render()), after which this flag will be
10204  * automatically unset.
10205  *
10206  * If that smart function is not provided for the given object, this
10207  * flag will be left unchanged.
10208  *
10209  * @note just setting this flag will not make the canvas' whole scene
10210  *       dirty, by itself, and evas_render() will have no effect. To
10211  *       force that, use evas_object_smart_changed(), that will also
10212  *       automatically call this function automatically, with
10213  *       @c EINA_TRUE as parameter.
10214  *
10215  * @see evas_object_smart_need_recalculate_get()
10216  * @see evas_object_smart_calculate()
10217  * @see evas_smart_objects_calculate()
10218  *
10219  * @ingroup Evas_Smart_Object_Group
10220  */
10221 EAPI void              evas_object_smart_need_recalculate_set(Evas_Object *obj, Eina_Bool value) EINA_ARG_NONNULL(1);
10222
10223 /**
10224  * Get the value of the flag signalling that a given smart object needs to
10225  * get recalculated.
10226  *
10227  * @param obj the smart object
10228  * @return if flag is set or not.
10229  *
10230  * @note this flag will be unset during the rendering phase, when the
10231  *       @c calculate() smart function is called, if one is provided.
10232  *       If it's not provided, then the flag will be left unchanged
10233  *       after the rendering phase.
10234  *
10235  * @see evas_object_smart_need_recalculate_set(), for more details
10236  *
10237  * @ingroup Evas_Smart_Object_Group
10238  */
10239 EAPI Eina_Bool         evas_object_smart_need_recalculate_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
10240
10241 /**
10242  * Call the @b calculate() smart function immediately on a given smart
10243  * object.
10244  *
10245  * @param obj the smart object's handle
10246  *
10247  * This will force immediate calculations (see #Evas_Smart_Class)
10248  * needed for renderization of this object and, besides, unset the
10249  * flag on it telling it needs recalculation for the next rendering
10250  * phase.
10251  *
10252  * @see evas_object_smart_need_recalculate_set()
10253  *
10254  * @ingroup Evas_Smart_Object_Group
10255  */
10256 EAPI void              evas_object_smart_calculate       (Evas_Object *obj) EINA_ARG_NONNULL(1);
10257
10258 /**
10259  * Call user-provided @c calculate() smart functions and unset the
10260  * flag signalling that the object needs to get recalculated to @b all
10261  * smart objects in the canvas.
10262  *
10263  * @param e The canvas to calculate all smart objects in
10264  *
10265  * @see evas_object_smart_need_recalculate_set()
10266  *
10267  * @ingroup Evas_Smart_Object_Group
10268  */
10269 EAPI void              evas_smart_objects_calculate      (Evas *e);
10270
10271 /**
10272  * This gets the internal counter that counts the number of smart calculations
10273  * 
10274  * @param e The canvas to get the calculate counter from
10275  * 
10276  * Whenever evas performs smart object calculations on the whole canvas
10277  * it increments a counter by 1. This is the smart object calculate counter
10278  * that this function returns the value of. It starts at the value of 0 and
10279  * will increase (and eventually wrap around to negative values and so on) by
10280  * 1 every time objects are calculated. You can use this counter to ensure
10281  * you don't re-do calculations withint the same calculation generation/run
10282  * if the calculations maybe cause self-feeding effects.
10283  * 
10284  * @ingroup Evas_Smart_Object_Group
10285  * @since 1.1
10286  */
10287 EAPI int               evas_smart_objects_calculate_count_get (const Evas *e);
10288    
10289 /**
10290  * Moves all children objects of a given smart object relative to a
10291  * given offset.
10292  *
10293  * @param obj the smart object.
10294  * @param dx horizontal offset (delta).
10295  * @param dy vertical offset (delta).
10296  *
10297  * This will make each of @p obj object's children to move, from where
10298  * they before, with those delta values (offsets) on both directions.
10299  *
10300  * @note This is most useful on custom smart @c move() functions.
10301  *
10302  * @note Clipped smart objects already make use of this function on
10303  * their @c move() smart function definition.
10304  */
10305 EAPI void                    evas_object_smart_move_children_relative(Evas_Object *obj, Evas_Coord dx, Evas_Coord dy) EINA_ARG_NONNULL(1);
10306
10307 /**
10308  * @}
10309  */
10310
10311 /**
10312  * @defgroup Evas_Smart_Object_Clipped Clipped Smart Object
10313  *
10314  * Clipped smart object is a base to construct other smart objects
10315  * based on the concept of having an internal clipper that is applied
10316  * to all children objects. This clipper will control the visibility,
10317  * clipping and color of sibling objects (remember that the clipping
10318  * is recursive, and clipper color modulates the color of its
10319  * clippees). By default, this base will also move children relatively
10320  * to the parent, and delete them when parent is deleted. In other
10321  * words, it is the base for simple object grouping.
10322  *
10323  * See some @ref Example_Evas_Smart_Objects "examples" of this group
10324  * of functions.
10325  *
10326  * @see evas_object_smart_clipped_smart_set()
10327  *
10328  * @ingroup Evas_Smart_Object_Group
10329  */
10330
10331 /**
10332  * @addtogroup Evas_Smart_Object_Clipped
10333  * @{
10334  */
10335
10336 /**
10337  * Every subclass should provide this at the beginning of their own
10338  * data set with evas_object_smart_data_set().
10339  */
10340   typedef struct _Evas_Object_Smart_Clipped_Data Evas_Object_Smart_Clipped_Data;
10341   struct _Evas_Object_Smart_Clipped_Data
10342   {
10343      Evas_Object *clipper;
10344      Evas        *evas;
10345   };
10346
10347
10348 /**
10349  * Get the clipper object for the given clipped smart object.
10350  *
10351  * @param obj the clipped smart object to retrieve associated clipper
10352  * from.
10353  * @return the clipper object.
10354  *
10355  * Use this function if you want to change any of this clipper's
10356  * properties, like colors.
10357  *
10358  * @see evas_object_smart_clipped_smart_add()
10359  */
10360 EAPI Evas_Object            *evas_object_smart_clipped_clipper_get   (Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
10361
10362 /**
10363  * Set a given smart class' callbacks so it implements the <b>clipped smart
10364  * object"</b>'s interface.
10365  *
10366  * @param sc The smart class handle to operate on
10367  *
10368  * This call will assign all the required methods of the @p sc
10369  * #Evas_Smart_Class instance to the implementations set for clipped
10370  * smart objects. If one wants to "subclass" it, call this function
10371  * and then override desired values. If one wants to call any original
10372  * method, save it somewhere. Example:
10373  *
10374  * @code
10375  * static Evas_Smart_Class parent_sc = EVAS_SMART_CLASS_INIT_NULL;
10376  *
10377  * static void my_class_smart_add(Evas_Object *o)
10378  * {
10379  *    parent_sc.add(o);
10380  *    evas_object_color_set(evas_object_smart_clipped_clipper_get(o),
10381  *                          255, 0, 0, 255);
10382  * }
10383  *
10384  * Evas_Smart_Class *my_class_new(void)
10385  * {
10386  *    static Evas_Smart_Class sc = EVAS_SMART_CLASS_INIT_NAME_VERSION("MyClass");
10387  *    if (!parent_sc.name)
10388  *      {
10389  *         evas_object_smart_clipped_smart_set(&sc);
10390  *         parent_sc = sc;
10391  *         sc.add = my_class_smart_add;
10392  *      }
10393  *    return &sc;
10394  * }
10395  * @endcode
10396  *
10397  * Default behavior for each of #Evas_Smart_Class functions on a
10398  * clipped smart object are:
10399  * - @c add: creates a hidden clipper with "infinite" size, to clip
10400  *    any incoming members;
10401  *  - @c del: delete all children objects;
10402  *  - @c move: move all objects relative relatively;
10403  *  - @c resize: <b>not defined</b>;
10404  *  - @c show: if there are children objects, show clipper;
10405  *  - @c hide: hides clipper;
10406  *  - @c color_set: set the color of clipper;
10407  *  - @c clip_set: set clipper of clipper;
10408  *  - @c clip_unset: unset the clipper of clipper;
10409  *
10410  * @note There are other means of assigning parent smart classes to
10411  * child ones, like the #EVAS_SMART_SUBCLASS_NEW macro or the
10412  * evas_smart_class_inherit_full() function.
10413  */
10414 EAPI void                    evas_object_smart_clipped_smart_set     (Evas_Smart_Class *sc) EINA_ARG_NONNULL(1);
10415
10416 /**
10417  * Get a pointer to the <b>clipped smart object's</b> class, to use
10418  * for proper inheritance
10419  *
10420  * @see #Evas_Smart_Object_Clipped for more information on this smart
10421  * class
10422  */
10423 EAPI const Evas_Smart_Class *evas_object_smart_clipped_class_get     (void) EINA_CONST;
10424
10425 /**
10426  * @}
10427  */
10428
10429 /**
10430  * @defgroup Evas_Object_Box Box Smart Object
10431  *
10432  * A box is a convenience smart object that packs children inside it
10433  * in @b sequence, using a layouting function specified by the
10434  * user. There are a couple of pre-made layouting functions <b>built-in
10435  * in Evas</b>, all of them using children size hints to define their
10436  * size and alignment inside their cell space.
10437  *
10438  * Examples on this smart object's usage:
10439  * - @ref Example_Evas_Box
10440  * - @ref Example_Evas_Size_Hints
10441  *
10442  * @see @ref Evas_Object_Group_Size_Hints
10443  *
10444  * @ingroup Evas_Smart_Object_Group
10445  */
10446
10447 /**
10448  * @addtogroup Evas_Object_Box
10449  * @{
10450  */
10451
10452 /**
10453  * @typedef Evas_Object_Box_Api
10454  *
10455  * Smart class extension, providing extra box object requirements.
10456  *
10457  * @ingroup Evas_Object_Box
10458  */
10459    typedef struct _Evas_Object_Box_Api        Evas_Object_Box_Api;
10460
10461 /**
10462  * @typedef Evas_Object_Box_Data
10463  *
10464  * Smart object instance data, providing box object requirements.
10465  *
10466  * @ingroup Evas_Object_Box
10467  */
10468    typedef struct _Evas_Object_Box_Data       Evas_Object_Box_Data;
10469
10470 /**
10471  * @typedef Evas_Object_Box_Option
10472  *
10473  * The base structure for a box option. Box options are a way of
10474  * extending box items properties, which will be taken into account
10475  * for layouting decisions. The box layouting functions provided by
10476  * Evas will only rely on objects' canonical size hints to layout
10477  * them, so the basic box option has @b no (custom) property set.
10478  *
10479  * Users creating their own layouts, but not depending on extra child
10480  * items' properties, would be fine just using
10481  * evas_object_box_layout_set(). But if one desires a layout depending
10482  * on extra child properties, he/she has to @b subclass the box smart
10483  * object. Thus, by using evas_object_box_smart_class_get() and
10484  * evas_object_box_smart_set(), the @c option_new() and @c
10485  * option_free() smart class functions should be properly
10486  * redefined/extended.
10487  *
10488  * Object properties are bound to an integer identifier and must have
10489  * a name string. Their values are open to any data. See the API on
10490  * option properties for more details.
10491  *
10492  * @ingroup Evas_Object_Box
10493  */
10494    typedef struct _Evas_Object_Box_Option     Evas_Object_Box_Option;
10495
10496 /**
10497  * @typedef Evas_Object_Box_Layout
10498  *
10499  * Function signature for an Evas box object layouting routine. By
10500  * @a o it will be passed the box object in question, by @a priv it will
10501  * be passed the box's internal data and, by @a user_data, it will be
10502  * passed any custom data one could have set to a given box layouting
10503  * function, with evas_object_box_layout_set().
10504  *
10505  * @ingroup Evas_Object_Box
10506  */
10507    typedef void (*Evas_Object_Box_Layout) (Evas_Object *o, Evas_Object_Box_Data *priv, void *user_data);
10508
10509 /**
10510  * @def EVAS_OBJECT_BOX_API_VERSION
10511  *
10512  * Current version for Evas box object smart class, a value which goes
10513  * to _Evas_Object_Box_Api::version.
10514  *
10515  * @ingroup Evas_Object_Box
10516  */
10517 #define EVAS_OBJECT_BOX_API_VERSION 1
10518
10519 /**
10520  * @struct _Evas_Object_Box_Api
10521  *
10522  * This structure should be used by any smart class inheriting from
10523  * the box's one, to provide custom box behavior which could not be
10524  * achieved only by providing a layout function, with
10525  * evas_object_box_layout_set().
10526  *
10527  * @extends Evas_Smart_Class
10528  * @ingroup Evas_Object_Box
10529  */
10530    struct _Evas_Object_Box_Api
10531    {
10532       Evas_Smart_Class          base; /**< Base smart class struct, need for all smart objects */
10533       int                       version; /**< Version of this smart class definition */
10534       Evas_Object_Box_Option *(*append)           (Evas_Object *o, Evas_Object_Box_Data *priv, Evas_Object *child); /**< Smart function to append child elements in boxes */
10535       Evas_Object_Box_Option *(*prepend)          (Evas_Object *o, Evas_Object_Box_Data *priv, Evas_Object *child); /**< Smart function to prepend child elements in boxes */
10536       Evas_Object_Box_Option *(*insert_before)    (Evas_Object *o, Evas_Object_Box_Data *priv, Evas_Object *child, const Evas_Object *reference); /**< Smart function to insert a child element before another in boxes */
10537       Evas_Object_Box_Option *(*insert_after)     (Evas_Object *o, Evas_Object_Box_Data *priv, Evas_Object *child, const Evas_Object *reference); /**< Smart function to insert a child element after another in boxes */
10538       Evas_Object_Box_Option *(*insert_at)        (Evas_Object *o, Evas_Object_Box_Data *priv, Evas_Object *child, unsigned int pos); /**< Smart function to insert a child element at a given position on boxes */
10539       Evas_Object            *(*remove)           (Evas_Object *o, Evas_Object_Box_Data *priv, Evas_Object *child); /**< Smart function to remove a child element from boxes */
10540       Evas_Object            *(*remove_at)        (Evas_Object *o, Evas_Object_Box_Data *priv, unsigned int pos); /**< Smart function to remove a child element from boxes, by its position */
10541       Eina_Bool               (*property_set)     (Evas_Object *o, Evas_Object_Box_Option *opt, int property, va_list args); /**< Smart function to set a custom property on a box child */
10542       Eina_Bool               (*property_get)     (const Evas_Object *o, Evas_Object_Box_Option *opt, int property, va_list args); /**< Smart function to retrieve a custom property from a box child */
10543       const char             *(*property_name_get)(const Evas_Object *o, int property); /**< Smart function to get the name of a custom property of box children */
10544       int                     (*property_id_get)  (const Evas_Object *o, const char *name); /**< Smart function to get the numerical ID of a custom property of box children */
10545       Evas_Object_Box_Option *(*option_new)       (Evas_Object *o, Evas_Object_Box_Data *priv, Evas_Object *child); /**< Smart function to create a new box option struct */
10546       void                    (*option_free)      (Evas_Object *o, Evas_Object_Box_Data *priv, Evas_Object_Box_Option *opt); /**< Smart function to delete a box option struct */
10547    };
10548
10549 /**
10550  * @def EVAS_OBJECT_BOX_API_INIT
10551  *
10552  * Initializer for a whole #Evas_Object_Box_Api structure, with
10553  * @c NULL values on its specific fields.
10554  *
10555  * @param smart_class_init initializer to use for the "base" field
10556  * (#Evas_Smart_Class).
10557  *
10558  * @see EVAS_SMART_CLASS_INIT_NULL
10559  * @see EVAS_SMART_CLASS_INIT_VERSION
10560  * @see EVAS_SMART_CLASS_INIT_NAME_VERSION
10561  * @see EVAS_OBJECT_BOX_API_INIT_NULL
10562  * @see EVAS_OBJECT_BOX_API_INIT_VERSION
10563  * @see EVAS_OBJECT_BOX_API_INIT_NAME_VERSION
10564  * @ingroup Evas_Object_Box
10565  */
10566 #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}
10567
10568 /**
10569  * @def EVAS_OBJECT_BOX_API_INIT_NULL
10570  *
10571  * Initializer to zero out a whole #Evas_Object_Box_Api structure.
10572  *
10573  * @see EVAS_OBJECT_BOX_API_INIT_VERSION
10574  * @see EVAS_OBJECT_BOX_API_INIT_NAME_VERSION
10575  * @see EVAS_OBJECT_BOX_API_INIT
10576  * @ingroup Evas_Object_Box
10577  */
10578 #define EVAS_OBJECT_BOX_API_INIT_NULL EVAS_OBJECT_BOX_API_INIT(EVAS_SMART_CLASS_INIT_NULL)
10579
10580 /**
10581  * @def EVAS_OBJECT_BOX_API_INIT_VERSION
10582  *
10583  * Initializer to zero out a whole #Evas_Object_Box_Api structure and
10584  * set a specific version on it.
10585  *
10586  * This is similar to #EVAS_OBJECT_BOX_API_INIT_NULL, but it will set
10587  * the version field of #Evas_Smart_Class (base field) to the latest
10588  * #EVAS_SMART_CLASS_VERSION.
10589  *
10590  * @see EVAS_OBJECT_BOX_API_INIT_NULL
10591  * @see EVAS_OBJECT_BOX_API_INIT_NAME_VERSION
10592  * @see EVAS_OBJECT_BOX_API_INIT
10593  * @ingroup Evas_Object_Box
10594  */
10595 #define EVAS_OBJECT_BOX_API_INIT_VERSION EVAS_OBJECT_BOX_API_INIT(EVAS_SMART_CLASS_INIT_VERSION)
10596
10597 /**
10598  * @def EVAS_OBJECT_BOX_API_INIT_NAME_VERSION
10599  *
10600  * Initializer to zero out a whole #Evas_Object_Box_Api structure and
10601  * set its name and version.
10602  *
10603  * This is similar to #EVAS_OBJECT_BOX_API_INIT_NULL, but it will also
10604  * set the version field of #Evas_Smart_Class (base field) to the
10605  * latest #EVAS_SMART_CLASS_VERSION and name it to the specific value.
10606  *
10607  * It will keep a reference to the name field as a <c>"const char *"</c>,
10608  * i.e., the name must be available while the structure is
10609  * used (hint: static or global variable!) and must not be modified.
10610  *
10611  * @see EVAS_OBJECT_BOX_API_INIT_NULL
10612  * @see EVAS_OBJECT_BOX_API_INIT_VERSION
10613  * @see EVAS_OBJECT_BOX_API_INIT
10614  * @ingroup Evas_Object_Box
10615  */
10616 #define EVAS_OBJECT_BOX_API_INIT_NAME_VERSION(name) EVAS_OBJECT_BOX_API_INIT(EVAS_SMART_CLASS_INIT_NAME_VERSION(name))
10617
10618 /**
10619  * @struct _Evas_Object_Box_Data
10620  *
10621  * This structure augments clipped smart object's instance data,
10622  * providing extra members required by generic box implementation. If
10623  * a subclass inherits from #Evas_Object_Box_Api, then it may augment
10624  * #Evas_Object_Box_Data to fit its own needs.
10625  *
10626  * @extends Evas_Object_Smart_Clipped_Data
10627  * @ingroup Evas_Object_Box
10628  */
10629    struct _Evas_Object_Box_Data
10630    {
10631       Evas_Object_Smart_Clipped_Data   base;
10632       const Evas_Object_Box_Api       *api;
10633       struct {
10634          double                        h, v;
10635       } align;
10636       struct {
10637          Evas_Coord                    h, v;
10638       } pad;
10639       Eina_List                       *children;
10640       struct {
10641          Evas_Object_Box_Layout        cb;
10642          void                         *data;
10643          void                        (*free_data)(void *data);
10644       } layout;
10645       Eina_Bool                        layouting : 1;
10646       Eina_Bool                        children_changed : 1;
10647    };
10648
10649    struct _Evas_Object_Box_Option
10650    {
10651       Evas_Object *obj; /**< Pointer to the box child object, itself */
10652       Eina_Bool    max_reached:1;
10653       Eina_Bool    min_reached:1;
10654       Evas_Coord   alloc_size;
10655    }; /**< #Evas_Object_Box_Option struct fields */
10656
10657 /**
10658  * Set the default box @a api struct (Evas_Object_Box_Api)
10659  * with the default values. May be used to extend that API.
10660  *
10661  * @param api The box API struct to set back, most probably with
10662  * overridden fields (on class extensions scenarios)
10663  */
10664 EAPI void                       evas_object_box_smart_set                             (Evas_Object_Box_Api *api) EINA_ARG_NONNULL(1);
10665
10666 /**
10667  * Get the Evas box smart class, for inheritance purposes.
10668  *
10669  * @return the (canonical) Evas box smart class.
10670  *
10671  * The returned value is @b not to be modified, just use it as your
10672  * parent class.
10673  */
10674 EAPI const Evas_Object_Box_Api *evas_object_box_smart_class_get                       (void) EINA_CONST;
10675
10676 /**
10677  * Set a new layouting function to a given box object
10678  *
10679  * @param o The box object to operate on.
10680  * @param cb The new layout function to set on @p o.
10681  * @param data Data pointer to be passed to @p cb.
10682  * @param free_data Function to free @p data, if need be.
10683  *
10684  * A box layout function affects how a box object displays child
10685  * elements within its area. The list of pre-defined box layouts
10686  * available in Evas is:
10687  * - evas_object_box_layout_horizontal()
10688  * - evas_object_box_layout_vertical()
10689  * - evas_object_box_layout_homogeneous_horizontal()
10690  * - evas_object_box_layout_homogeneous_vertical()
10691  * - evas_object_box_layout_homogeneous_max_size_horizontal()
10692  * - evas_object_box_layout_homogeneous_max_size_vertical()
10693  * - evas_object_box_layout_flow_horizontal()
10694  * - evas_object_box_layout_flow_vertical()
10695  * - evas_object_box_layout_stack()
10696  *
10697  * Refer to each of their documentation texts for details on them.
10698  *
10699  * @note A box layouting function will be triggered by the @c
10700  * 'calculate' smart callback of the box's smart class.
10701  */
10702 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);
10703
10704 /**
10705  * Add a new box object on the provided canvas.
10706  *
10707  * @param evas The canvas to create the box object on.
10708  * @return @c NULL on error, a pointer to a new box object on
10709  * success.
10710  *
10711  * After instantiation, if a box object hasn't its layout function
10712  * set, via evas_object_box_layout_set(), it will have it by default
10713  * set to evas_object_box_layout_horizontal(). The remaining
10714  * properties of the box must be set/retrieved via
10715  * <c>evas_object_box_{h,v}_{align,padding}_{get,set)()</c>.
10716  */
10717 EAPI Evas_Object               *evas_object_box_add                                   (Evas *evas) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
10718
10719 /**
10720  * Add a new box as a @b child of a given smart object.
10721  *
10722  * @param parent The parent smart object to put the new box in.
10723  * @return @c NULL on error, a pointer to a new box object on
10724  * success.
10725  *
10726  * This is a helper function that has the same effect of putting a new
10727  * box object into @p parent by use of evas_object_smart_member_add().
10728  *
10729  * @see evas_object_box_add()
10730  */
10731 EAPI Evas_Object               *evas_object_box_add_to                                (Evas_Object *parent) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
10732
10733 /**
10734  * Layout function which sets the box @a o to a (basic) horizontal box
10735  *
10736  * @param o The box object in question
10737  * @param priv The smart data of the @p o
10738  * @param data The data pointer passed on
10739  * evas_object_box_layout_set(), if any
10740  *
10741  * In this layout, the box object's overall behavior is controlled by
10742  * its padding/alignment properties, which are set by the
10743  * <c>evas_object_box_{h,v}_{align,padding}_set()</c> family of
10744  * functions. The size hints of the elements in the box -- set by the
10745  * <c>evas_object_size_hint_{align,padding,weight}_set()</c> functions
10746  * -- also control the way this function works.
10747  *
10748  * \par Box's properties:
10749  * @c align_h controls the horizontal alignment of the child objects
10750  * relative to the containing box. When set to @c 0.0, children are
10751  * aligned to the left. A value of @c 1.0 makes them aligned to the
10752  * right border. Values in between align them proportionally. Note
10753  * that if the size required by the children, which is given by their
10754  * widths and the @c padding_h property of the box, is bigger than the
10755  * their container's width, the children will be displayed out of the
10756  * box's bounds. A negative value of @c align_h makes the box to
10757  * @b justify its children. The padding between them, in this case, is
10758  * corrected so that the leftmost one touches the left border and the
10759  * rightmost one touches the right border (even if they must
10760  * overlap). The @c align_v and @c padding_v properties of the box
10761  * @b don't contribute to its behaviour when this layout is chosen.
10762  *
10763  * \par Child element's properties:
10764  * @c align_x does @b not influence the box's behavior. @c padding_l
10765  * and @c padding_r sum up to the container's horizontal padding
10766  * between elements. The child's @c padding_t, @c padding_b and
10767  * @c align_y properties apply for padding/alignment relative to the
10768  * overall height of the box. Finally, there is the @c weight_x
10769  * property, which, if set to a non-zero value, tells the container
10770  * that the child width is @b not pre-defined. If the container can't
10771  * accommodate all its children, it sets the widths of the ones
10772  * <b>with weights</b> to sizes as small as they can all fit into
10773  * it. If the size required by the children is less than the
10774  * available, the box increases its childrens' (which have weights)
10775  * widths as to fit the remaining space. The @c weight_x property,
10776  * besides telling the element is resizable, gives a @b weight for the
10777  * resizing process.  The parent box will try to distribute (or take
10778  * off) widths accordingly to the @b normalized list of weigths: most
10779  * weighted children remain/get larger in this process than the least
10780  * ones. @c weight_y does not influence the layout.
10781  *
10782  * If one desires that, besides having weights, child elements must be
10783  * resized bounded to a minimum or maximum size, those size hints must
10784  * be set, by the <c>evas_object_size_hint_{min,max}_set()</c>
10785  * functions.
10786  */
10787 EAPI void                       evas_object_box_layout_horizontal                     (Evas_Object *o, Evas_Object_Box_Data *priv, void *data) EINA_ARG_NONNULL(1, 2);
10788
10789 /**
10790  * Layout function which sets the box @a o to a (basic) vertical box
10791  *
10792  * This function behaves analogously to
10793  * evas_object_box_layout_horizontal(). The description of its
10794  * behaviour can be derived from that function's documentation.
10795  */
10796 EAPI void                       evas_object_box_layout_vertical                       (Evas_Object *o, Evas_Object_Box_Data *priv, void *data) EINA_ARG_NONNULL(1, 2);
10797
10798 /**
10799  * Layout function which sets the box @a o to a @b homogeneous
10800  * vertical box
10801  *
10802  * This function behaves analogously to
10803  * evas_object_box_layout_homogeneous_horizontal().  The description
10804  * of its behaviour can be derived from that function's documentation.
10805  */
10806 EAPI void                       evas_object_box_layout_homogeneous_vertical           (Evas_Object *o, Evas_Object_Box_Data *priv, void *data) EINA_ARG_NONNULL(1, 2);
10807
10808 /**
10809  * Layout function which sets the box @a o to a @b homogeneous
10810  * horizontal box
10811  *
10812  * @param o The box object in question
10813  * @param priv The smart data of the @p o
10814  * @param data The data pointer passed on
10815  * evas_object_box_layout_set(), if any
10816  *
10817  * In a homogeneous horizontal box, its width is divided @b equally
10818  * between the contained objects. The box's overall behavior is
10819  * controlled by its padding/alignment properties, which are set by
10820  * the <c>evas_object_box_{h,v}_{align,padding}_set()</c> family of
10821  * functions.  The size hints the elements in the box -- set by the
10822  * <c>evas_object_size_hint_{align,padding,weight}_set()</c> functions
10823  * -- also control the way this function works.
10824  *
10825  * \par Box's properties:
10826  * @c align_h has no influence on the box for this layout.
10827  * @c padding_h tells the box to draw empty spaces of that size, in
10828  * pixels, between the (equal) child objects's cells. The @c align_v
10829  * and @c padding_v properties of the box don't contribute to its
10830  * behaviour when this layout is chosen.
10831  *
10832  * \par Child element's properties:
10833  * @c padding_l and @c padding_r sum up to the required width of the
10834  * child element. The @c align_x property tells the relative position
10835  * of this overall child width in its allocated cell (@c 0.0 to
10836  * extreme left, @c 1.0 to extreme right). A value of @c -1.0 to
10837  * @c align_x makes the box try to resize this child element to the exact
10838  * width of its cell (respecting the minimum and maximum size hints on
10839  * the child's width and accounting for its horizontal padding
10840  * hints). The child's @c padding_t, @c padding_b and @c align_y
10841  * properties apply for padding/alignment relative to the overall
10842  * height of the box. A value of @c -1.0 to @c align_y makes the box
10843  * try to resize this child element to the exact height of its parent
10844  * (respecting the maximum size hint on the child's height).
10845  */
10846 EAPI void                       evas_object_box_layout_homogeneous_horizontal         (Evas_Object *o, Evas_Object_Box_Data *priv, void *data) EINA_ARG_NONNULL(1, 2);
10847
10848 /**
10849  * Layout function which sets the box @a o to a <b>maximum size,
10850  * homogeneous</b> horizontal box
10851  *
10852  * @param o The box object in question
10853  * @param priv The smart data of the @p o
10854  * @param data The data pointer passed on
10855  * evas_object_box_layout_set(), if any
10856  *
10857  * In a maximum size, homogeneous horizontal box, besides having cells
10858  * of <b>equal size</b> reserved for the child objects, this size will
10859  * be defined by the size of the @b largest child in the box (in
10860  * width). The box's overall behavior is controlled by its properties,
10861  * which are set by the
10862  * <c>evas_object_box_{h,v}_{align,padding}_set()</c> family of
10863  * functions.  The size hints of the elements in the box -- set by the
10864  * <c>evas_object_size_hint_{align,padding,weight}_set()</c> functions
10865  * -- also control the way this function works.
10866  *
10867  * \par Box's properties:
10868  * @c padding_h tells the box to draw empty spaces of that size, in
10869  * pixels, between the child objects's cells. @c align_h controls the
10870  * horizontal alignment of the child objects, relative to the
10871  * containing box. When set to @c 0.0, children are aligned to the
10872  * left. A value of @c 1.0 lets them aligned to the right
10873  * border. Values in between align them proportionally. A negative
10874  * value of @c align_h makes the box to @b justify its children
10875  * cells. The padding between them, in this case, is corrected so that
10876  * the leftmost one touches the left border and the rightmost one
10877  * touches the right border (even if they must overlap). The
10878  * @c align_v and @c padding_v properties of the box don't contribute to
10879  * its behaviour when this layout is chosen.
10880  *
10881  * \par Child element's properties:
10882  * @c padding_l and @c padding_r sum up to the required width of the
10883  * child element. The @c align_x property tells the relative position
10884  * of this overall child width in its allocated cell (@c 0.0 to
10885  * extreme left, @c 1.0 to extreme right). A value of @c -1.0 to
10886  * @c align_x makes the box try to resize this child element to the exact
10887  * width of its cell (respecting the minimum and maximum size hints on
10888  * the child's width and accounting for its horizontal padding
10889  * hints). The child's @c padding_t, @c padding_b and @c align_y
10890  * properties apply for padding/alignment relative to the overall
10891  * height of the box. A value of @c -1.0 to @c align_y makes the box
10892  * try to resize this child element to the exact height of its parent
10893  * (respecting the max hint on the child's height).
10894  */
10895 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);
10896
10897 /**
10898  * Layout function which sets the box @a o to a <b>maximum size,
10899  * homogeneous</b> vertical box
10900  *
10901  * This function behaves analogously to
10902  * evas_object_box_layout_homogeneous_max_size_horizontal(). The
10903  * description of its behaviour can be derived from that function's
10904  * documentation.
10905  */
10906 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);
10907
10908 /**
10909  * Layout function which sets the box @a o to a @b flow horizontal
10910  * box.
10911  *
10912  * @param o The box object in question
10913  * @param priv The smart data of the @p o
10914  * @param data The data pointer passed on
10915  * evas_object_box_layout_set(), if any
10916  *
10917  * In a flow horizontal box, the box's child elements are placed in
10918  * @b rows (think of text as an analogy). A row has as much elements as
10919  * can fit into the box's width. The box's overall behavior is
10920  * controlled by its properties, which are set by the
10921  * <c>evas_object_box_{h,v}_{align,padding}_set()</c> family of
10922  * functions.  The size hints of the elements in the box -- set by the
10923  * <c>evas_object_size_hint_{align,padding,weight}_set()</c> functions
10924  * -- also control the way this function works.
10925  *
10926  * \par Box's properties:
10927  * @c padding_h tells the box to draw empty spaces of that size, in
10928  * pixels, between the child objects's cells. @c align_h dictates the
10929  * horizontal alignment of the rows (@c 0.0 to left align them, @c 1.0
10930  * to right align). A value of @c -1.0 to @c align_h lets the rows
10931  * @b justified horizontally. @c align_v controls the vertical alignment
10932  * of the entire set of rows (@c 0.0 to top, @c 1.0 to bottom). A
10933  * value of @c -1.0 to @c align_v makes the box to @b justify the rows
10934  * vertically. The padding between them, in this case, is corrected so
10935  * that the first row touches the top border and the last one touches
10936  * the bottom border (even if they must overlap). @c padding_v has no
10937  * influence on the layout.
10938  *
10939  * \par Child element's properties:
10940  * @c padding_l and @c padding_r sum up to the required width of the
10941  * child element. The @c align_x property has no influence on the
10942  * layout. The child's @c padding_t and @c padding_b sum up to the
10943  * required height of the child element and is the only means (besides
10944  * row justifying) of setting space between rows. Note, however, that
10945  * @c align_y dictates positioning relative to the <b>largest
10946  * height</b> required by a child object in the actual row.
10947  */
10948 EAPI void                       evas_object_box_layout_flow_horizontal                (Evas_Object *o, Evas_Object_Box_Data *priv, void *data) EINA_ARG_NONNULL(1, 2);
10949
10950 /**
10951  * Layout function which sets the box @a o to a @b flow vertical box.
10952  *
10953  * This function behaves analogously to
10954  * evas_object_box_layout_flow_horizontal(). The description of its
10955  * behaviour can be derived from that function's documentation.
10956  */
10957 EAPI void                       evas_object_box_layout_flow_vertical                  (Evas_Object *o, Evas_Object_Box_Data *priv, void *data) EINA_ARG_NONNULL(1, 2);
10958
10959 /**
10960  * Layout function which sets the box @a o to a @b stacking box
10961  *
10962  * @param o The box object in question
10963  * @param priv The smart data of the @p o
10964  * @param data The data pointer passed on
10965  * evas_object_box_layout_set(), if any
10966  *
10967  * In a stacking box, all children will be given the same size -- the
10968  * box's own size -- and they will be stacked one above the other, so
10969  * that the first object in @p o's internal list of child elements
10970  * will be the bottommost in the stack.
10971  *
10972  * \par Box's properties:
10973  * No box properties are used.
10974  *
10975  * \par Child element's properties:
10976  * @c padding_l and @c padding_r sum up to the required width of the
10977  * child element. The @c align_x property tells the relative position
10978  * of this overall child width in its allocated cell (@c 0.0 to
10979  * extreme left, @c 1.0 to extreme right). A value of @c -1.0 to @c
10980  * align_x makes the box try to resize this child element to the exact
10981  * width of its cell (respecting the min and max hints on the child's
10982  * width and accounting for its horizontal padding properties). The
10983  * same applies to the vertical axis.
10984  */
10985 EAPI void                       evas_object_box_layout_stack                          (Evas_Object *o, Evas_Object_Box_Data *priv, void *data) EINA_ARG_NONNULL(1, 2);
10986
10987 /**
10988  * Set the alignment of the whole bounding box of contents, for a
10989  * given box object.
10990  *
10991  * @param o The given box object to set alignment from
10992  * @param horizontal The horizontal alignment, in pixels
10993  * @param vertical the vertical alignment, in pixels
10994  *
10995  * This will influence how a box object is to align its bounding box
10996  * of contents within its own area. The values @b must be in the range
10997  * @c 0.0 - @c 1.0, or undefined behavior is expected. For horizontal
10998  * alignment, @c 0.0 means to the left, with @c 1.0 meaning to the
10999  * right. For vertical alignment, @c 0.0 means to the top, with @c 1.0
11000  * meaning to the bottom.
11001  *
11002  * @note The default values for both alignments is @c 0.5.
11003  *
11004  * @see evas_object_box_align_get()
11005  */
11006 EAPI void                       evas_object_box_align_set                             (Evas_Object *o, double horizontal, double vertical) EINA_ARG_NONNULL(1);
11007
11008 /**
11009  * Get the alignment of the whole bounding box of contents, for a
11010  * given box object.
11011  *
11012  * @param o The given box object to get alignment from
11013  * @param horizontal Pointer to a variable where to store the
11014  * horizontal alignment
11015  * @param vertical Pointer to a variable where to store the vertical
11016  * alignment
11017  *
11018  * @see evas_object_box_align_set() for more information
11019  */
11020 EAPI void                       evas_object_box_align_get                             (const Evas_Object *o, double *horizontal, double *vertical) EINA_ARG_NONNULL(1);
11021
11022 /**
11023  * Set the (space) padding between cells set for a given box object.
11024  *
11025  * @param o The given box object to set padding from
11026  * @param horizontal The horizontal padding, in pixels
11027  * @param vertical the vertical padding, in pixels
11028  *
11029  * @note The default values for both padding components is @c 0.
11030  *
11031  * @see evas_object_box_padding_get()
11032  */
11033 EAPI void                       evas_object_box_padding_set                           (Evas_Object *o, Evas_Coord horizontal, Evas_Coord vertical) EINA_ARG_NONNULL(1);
11034
11035 /**
11036  * Get the (space) padding between cells set for a given box object.
11037  *
11038  * @param o The given box object to get padding from
11039  * @param horizontal Pointer to a variable where to store the
11040  * horizontal padding
11041  * @param vertical Pointer to a variable where to store the vertical
11042  * padding
11043  *
11044  * @see evas_object_box_padding_set()
11045  */
11046 EAPI void                       evas_object_box_padding_get                           (const Evas_Object *o, Evas_Coord *horizontal, Evas_Coord *vertical) EINA_ARG_NONNULL(1);
11047
11048 /**
11049  * Append a new @a child object to the given box object @a o.
11050  *
11051  * @param o The given box object
11052  * @param child A child Evas object to be made a member of @p o
11053  * @return A box option bound to the recently added box item or @c
11054  * NULL, on errors
11055  *
11056  * On success, the @c "child,added" smart event will take place.
11057  *
11058  * @note The actual placing of the item relative to @p o's area will
11059  * depend on the layout set to it. For example, on horizontal layouts
11060  * an item in the end of the box's list of children will appear on its
11061  * right.
11062  *
11063  * @note This call will trigger the box's _Evas_Object_Box_Api::append
11064  * smart function.
11065  */
11066 EAPI Evas_Object_Box_Option    *evas_object_box_append                                (Evas_Object *o, Evas_Object *child) EINA_ARG_NONNULL(1, 2);
11067
11068 /**
11069  * Prepend a new @a child object to the given box object @a o.
11070  *
11071  * @param o The given box object
11072  * @param child A child Evas object to be made a member of @p o
11073  * @return A box option bound to the recently added box item or @c
11074  * NULL, on errors
11075  *
11076  * On success, the @c "child,added" smart event will take place.
11077  *
11078  * @note The actual placing of the item relative to @p o's area will
11079  * depend on the layout set to it. For example, on horizontal layouts
11080  * an item in the beginning of the box's list of children will appear
11081  * on its left.
11082  *
11083  * @note This call will trigger the box's
11084  * _Evas_Object_Box_Api::prepend smart function.
11085  */
11086 EAPI Evas_Object_Box_Option    *evas_object_box_prepend                               (Evas_Object *o, Evas_Object *child) EINA_ARG_NONNULL(1, 2);
11087
11088 /**
11089  * Insert a new @a child object <b>before another existing one</b>, in
11090  * a given box object @a o.
11091  *
11092  * @param o The given box object
11093  * @param child A child Evas object to be made a member of @p o
11094  * @param reference The child object to place this new one before
11095  * @return A box option bound to the recently added box item or @c
11096  * NULL, on errors
11097  *
11098  * On success, the @c "child,added" smart event will take place.
11099  *
11100  * @note This function will fail if @p reference is not a member of @p
11101  * o.
11102  *
11103  * @note The actual placing of the item relative to @p o's area will
11104  * depend on the layout set to it.
11105  *
11106  * @note This call will trigger the box's
11107  * _Evas_Object_Box_Api::insert_before smart function.
11108  */
11109 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);
11110
11111 /**
11112  * Insert a new @a child object <b>after another existing one</b>, in
11113  * a given box object @a o.
11114  *
11115  * @param o The given box object
11116  * @param child A child Evas object to be made a member of @p o
11117  * @param reference The child object to place this new one after
11118  * @return A box option bound to the recently added box item or @c
11119  * NULL, on errors
11120  *
11121  * On success, the @c "child,added" smart event will take place.
11122  *
11123  * @note This function will fail if @p reference is not a member of @p
11124  * o.
11125  *
11126  * @note The actual placing of the item relative to @p o's area will
11127  * depend on the layout set to it.
11128  *
11129  * @note This call will trigger the box's
11130  * _Evas_Object_Box_Api::insert_after smart function.
11131  */
11132 EAPI Evas_Object_Box_Option    *evas_object_box_insert_after                          (Evas_Object *o, Evas_Object *child, const Evas_Object *reference) EINA_ARG_NONNULL(1, 2, 3);
11133
11134 /**
11135  * Insert a new @a child object <b>at a given position</b>, in a given
11136  * box object @a o.
11137  *
11138  * @param o The given box object
11139  * @param child A child Evas object to be made a member of @p o
11140  * @param pos The numeric position (starting from @c 0) to place the
11141  * new child object at
11142  * @return A box option bound to the recently added box item or @c
11143  * NULL, on errors
11144  *
11145  * On success, the @c "child,added" smart event will take place.
11146  *
11147  * @note This function will fail if the given position is invalid,
11148  * given @p o's internal list of elements.
11149  *
11150  * @note The actual placing of the item relative to @p o's area will
11151  * depend on the layout set to it.
11152  *
11153  * @note This call will trigger the box's
11154  * _Evas_Object_Box_Api::insert_at smart function.
11155  */
11156 EAPI Evas_Object_Box_Option    *evas_object_box_insert_at                             (Evas_Object *o, Evas_Object *child, unsigned int pos) EINA_ARG_NONNULL(1, 2);
11157
11158 /**
11159  * Remove a given object from a box object, unparenting it again.
11160  *
11161  * @param o The box object to remove a child object from
11162  * @param child The handle to the child object to be removed
11163  * @return @c EINA_TRUE, on success, @c EINA_FALSE otherwise
11164  *
11165  * On removal, you'll get an unparented object again, just as it was
11166  * before you inserted it in the box. The
11167  * _Evas_Object_Box_Api::option_free box smart callback will be called
11168  * automatically for you and, also, the @c "child,removed" smart event
11169  * will take place.
11170  *
11171  * @note This call will trigger the box's _Evas_Object_Box_Api::remove
11172  * smart function.
11173  */
11174 EAPI Eina_Bool                  evas_object_box_remove                                (Evas_Object *o, Evas_Object *child) EINA_ARG_NONNULL(1, 2);
11175
11176 /**
11177  * Remove an object, <b>bound to a given position</b> in a box object,
11178  * unparenting it again.
11179  *
11180  * @param o The box object to remove a child object from
11181  * @param pos The numeric position (starting from @c 0) of the child
11182  * object to be removed
11183  * @return @c EINA_TRUE, on success, @c EINA_FALSE otherwise
11184  *
11185  * On removal, you'll get an unparented object again, just as it was
11186  * before you inserted it in the box. The @c option_free() box smart
11187  * callback will be called automatically for you and, also, the
11188  * @c "child,removed" smart event will take place.
11189  *
11190  * @note This function will fail if the given position is invalid,
11191  * given @p o's internal list of elements.
11192  *
11193  * @note This call will trigger the box's
11194  * _Evas_Object_Box_Api::remove_at smart function.
11195  */
11196 EAPI Eina_Bool                  evas_object_box_remove_at                             (Evas_Object *o, unsigned int pos) EINA_ARG_NONNULL(1);
11197
11198 /**
11199  * Remove @b all child objects from a box object, unparenting them
11200  * again.
11201  *
11202  * @param o The box object to remove a child object from
11203  * @param clear if true, it will delete just removed children.
11204  * @return @c EINA_TRUE, on success, @c EINA_FALSE otherwise
11205  *
11206  * This has the same effect of calling evas_object_box_remove() on
11207  * each of @p o's child objects, in sequence. If, and only if, all
11208  * those calls succeed, so does this one.
11209  */
11210 EAPI Eina_Bool                  evas_object_box_remove_all                            (Evas_Object *o, Eina_Bool clear) EINA_ARG_NONNULL(1);
11211
11212 /**
11213  * Get an iterator to walk the list of children of a given box object.
11214  *
11215  * @param o The box to retrieve an items iterator from
11216  * @return An iterator on @p o's child objects, on success, or @c NULL,
11217  * on errors
11218  *
11219  * @note Do @b not remove or delete objects while walking the list.
11220  */
11221 EAPI Eina_Iterator             *evas_object_box_iterator_new                          (const Evas_Object *o) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
11222
11223 /**
11224  * Get an accessor (a structure providing random items access) to the
11225  * list of children of a given box object.
11226  *
11227  * @param o The box to retrieve an items iterator from
11228  * @return An accessor on @p o's child objects, on success, or @c NULL,
11229  * on errors
11230  *
11231  * @note Do not remove or delete objects while walking the list.
11232  */
11233 EAPI Eina_Accessor             *evas_object_box_accessor_new                          (const Evas_Object *o) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
11234
11235 /**
11236  * Get the list of children objects in a given box object.
11237  *
11238  * @param o The box to retrieve an items list from
11239  * @return A list of @p o's child objects, on success, or @c NULL,
11240  * on errors (or if it has no child objects)
11241  *
11242  * The returned list should be freed with @c eina_list_free() when you
11243  * no longer need it.
11244  *
11245  * @note This is a duplicate of the list kept by the box internally.
11246  *       It's up to the user to destroy it when it no longer needs it.
11247  *       It's possible to remove objects from the box when walking
11248  *       this list, but these removals won't be reflected on it.
11249  */
11250 EAPI Eina_List                 *evas_object_box_children_get                          (const Evas_Object *o) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
11251
11252 /**
11253  * Get the name of the property of the child elements of the box @a o
11254  * which have @a id as identifier
11255  *
11256  * @param o The box to search child options from
11257  * @param property The numerical identifier of the option being searched,
11258  * for its name
11259  * @return The name of the given property or @c NULL, on errors.
11260  *
11261  * @note This call won't do anything for a canonical Evas box. Only
11262  * users which have @b subclassed it, setting custom box items options
11263  * (see #Evas_Object_Box_Option) on it, would benefit from this
11264  * function. They'd have to implement it and set it to be the
11265  * _Evas_Object_Box_Api::property_name_get smart class function of the
11266  * box, which is originally set to @c NULL.
11267  */
11268 EAPI const char                *evas_object_box_option_property_name_get              (const Evas_Object *o, int property) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
11269
11270 /**
11271  * Get the numerical identifier of the property of the child elements
11272  * of the box @a o which have @a name as name string
11273  *
11274  * @param o The box to search child options from
11275  * @param name The name string of the option being searched, for
11276  * its ID
11277  * @return The numerical ID of the given property or @c -1, on
11278  * errors.
11279  *
11280  * @note This call won't do anything for a canonical Evas box. Only
11281  * users which have @b subclassed it, setting custom box items options
11282  * (see #Evas_Object_Box_Option) on it, would benefit from this
11283  * function. They'd have to implement it and set it to be the
11284  * _Evas_Object_Box_Api::property_id_get smart class function of the
11285  * box, which is originally set to @c NULL.
11286  */
11287 EAPI int                        evas_object_box_option_property_id_get                (const Evas_Object *o, const char *name) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2);
11288
11289 /**
11290  * Set a property value (by its given numerical identifier), on a
11291  * given box child element
11292  *
11293  * @param o The box parenting the child element
11294  * @param opt The box option structure bound to the child box element
11295  * to set a property on
11296  * @param property The numerical ID of the given property
11297  * @param ... (List of) actual value(s) to be set for this
11298  * property. It (they) @b must be of the same type the user has
11299  * defined for it (them).
11300  * @return @c EINA_TRUE on success, @c EINA_FALSE on failure.
11301  *
11302  * @note This call won't do anything for a canonical Evas box. Only
11303  * users which have @b subclassed it, setting custom box items options
11304  * (see #Evas_Object_Box_Option) on it, would benefit from this
11305  * function. They'd have to implement it and set it to be the
11306  * _Evas_Object_Box_Api::property_set smart class function of the box,
11307  * which is originally set to @c NULL.
11308  *
11309  * @note This function will internally create a variable argument
11310  * list, with the values passed after @p property, and call
11311  * evas_object_box_option_property_vset() with this list and the same
11312  * previous arguments.
11313  */
11314 EAPI Eina_Bool                  evas_object_box_option_property_set                   (Evas_Object *o, Evas_Object_Box_Option *opt, int property, ...) EINA_ARG_NONNULL(1, 2);
11315
11316 /**
11317  * Set a property value (by its given numerical identifier), on a
11318  * given box child element -- by a variable argument list
11319  *
11320  * @param o The box parenting the child element
11321  * @param opt The box option structure bound to the child box element
11322  * to set a property on
11323  * @param property The numerical ID of the given property
11324  * @param args The variable argument list implementing the value to
11325  * be set for this property. It @b must be of the same type the user has
11326  * defined for it.
11327  * @return @c EINA_TRUE on success, @c EINA_FALSE on failure.
11328  *
11329  * This is a variable argument list variant of the
11330  * evas_object_box_option_property_set(). See its documentation for
11331  * more details.
11332  */
11333 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);
11334
11335 /**
11336  * Get a property's value (by its given numerical identifier), on a
11337  * given box child element
11338  *
11339  * @param o The box parenting the child element
11340  * @param opt The box option structure bound to the child box element
11341  * to get a property from
11342  * @param property The numerical ID of the given property
11343  * @param ... (List of) pointer(s) where to store the value(s) set for
11344  * this property. It (they) @b must point to variable(s) of the same
11345  * type the user has defined for it (them).
11346  * @return @c EINA_TRUE on success, @c EINA_FALSE on failure.
11347  *
11348  * @note This call won't do anything for a canonical Evas box. Only
11349  * users which have @b subclassed it, getting custom box items options
11350  * (see #Evas_Object_Box_Option) on it, would benefit from this
11351  * function. They'd have to implement it and get it to be the
11352  * _Evas_Object_Box_Api::property_get smart class function of the
11353  * box, which is originally get to @c NULL.
11354  *
11355  * @note This function will internally create a variable argument
11356  * list, with the values passed after @p property, and call
11357  * evas_object_box_option_property_vget() with this list and the same
11358  * previous arguments.
11359  */
11360 EAPI Eina_Bool                  evas_object_box_option_property_get                   (const Evas_Object *o, Evas_Object_Box_Option *opt, int property, ...) EINA_ARG_NONNULL(1, 2);
11361
11362 /**
11363  * Get a property's value (by its given numerical identifier), on a
11364  * given box child element -- by a variable argument list
11365  *
11366  * @param o The box parenting the child element
11367  * @param opt The box option structure bound to the child box element
11368  * to get a property from
11369  * @param property The numerical ID of the given property
11370  * @param args The variable argument list with pointers to where to
11371  * store the values of this property. They @b must point to variables
11372  * of the same type the user has defined for them.
11373  * @return @c EINA_TRUE on success, @c EINA_FALSE on failure.
11374  *
11375  * This is a variable argument list variant of the
11376  * evas_object_box_option_property_get(). See its documentation for
11377  * more details.
11378  */
11379 EAPI Eina_Bool                  evas_object_box_option_property_vget                  (const Evas_Object *o, Evas_Object_Box_Option *opt, int property, va_list args) EINA_ARG_NONNULL(1, 2);
11380
11381 /**
11382  * @}
11383  */
11384
11385 /**
11386  * @defgroup Evas_Object_Table Table Smart Object.
11387  *
11388  * Convenience smart object that packs children using a tabular
11389  * layout using children size hints to define their size and
11390  * alignment inside their cell space.
11391  *
11392  * @ref tutorial_table shows how to use this Evas_Object.
11393  *
11394  * @see @ref Evas_Object_Group_Size_Hints
11395  *
11396  * @ingroup Evas_Smart_Object_Group
11397  *
11398  * @{
11399  */
11400
11401 /**
11402  * @brief Create a new table.
11403  *
11404  * @param evas Canvas in which table will be added.
11405  */
11406 EAPI Evas_Object                        *evas_object_table_add             (Evas *evas) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
11407
11408 /**
11409  * @brief Create a table that is child of a given element @a parent.
11410  *
11411  * @see evas_object_table_add()
11412  */
11413 EAPI Evas_Object                        *evas_object_table_add_to          (Evas_Object *parent) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
11414
11415 /**
11416  * @brief Set how this table should layout children.
11417  *
11418  * @todo consider aspect hint and respect it.
11419  *
11420  * @par EVAS_OBJECT_TABLE_HOMOGENEOUS_NONE
11421  * If table does not use homogeneous mode then columns and rows will
11422  * be calculated based on hints of individual cells. This operation
11423  * mode is more flexible, but more complex and heavy to calculate as
11424  * well. @b Weight properties are handled as a boolean expand. Negative
11425  * alignment will be considered as 0.5. This is the default.
11426  *
11427  * @todo @c EVAS_OBJECT_TABLE_HOMOGENEOUS_NONE should balance weight.
11428  *
11429  * @par EVAS_OBJECT_TABLE_HOMOGENEOUS_TABLE
11430  * When homogeneous is relative to table the own table size is divided
11431  * equally among children, filling the whole table area. That is, if
11432  * table has @c WIDTH and @c COLUMNS, each cell will get <tt>WIDTH /
11433  * COLUMNS</tt> pixels. If children have minimum size that is larger
11434  * than this amount (including padding), then it will overflow and be
11435  * aligned respecting the alignment hint, possible overlapping sibling
11436  * cells. @b Weight hint is used as a boolean, if greater than zero it
11437  * will make the child expand in that axis, taking as much space as
11438  * possible (bounded to maximum size hint). Negative alignment will be
11439  * considered as 0.5.
11440  *
11441  * @par EVAS_OBJECT_TABLE_HOMOGENEOUS_ITEM
11442  * When homogeneous is relative to item it means the greatest minimum
11443  * cell size will be used. That is, if no element is set to expand,
11444  * the table will have its contents to a minimum size, the bounding
11445  * box of all these children will be aligned relatively to the table
11446  * object using evas_object_table_align_get(). If the table area is
11447  * too small to hold this minimum bounding box, then the objects will
11448  * keep their size and the bounding box will overflow the box area,
11449  * still respecting the alignment. @b Weight hint is used as a
11450  * boolean, if greater than zero it will make that cell expand in that
11451  * axis, toggling the <b>expand mode</b>, which makes the table behave
11452  * much like @b EVAS_OBJECT_TABLE_HOMOGENEOUS_TABLE, except that the
11453  * bounding box will overflow and items will not overlap siblings. If
11454  * no minimum size is provided at all then the table will fallback to
11455  * expand mode as well.
11456  */
11457 EAPI void                                evas_object_table_homogeneous_set (Evas_Object *o, Evas_Object_Table_Homogeneous_Mode homogeneous) EINA_ARG_NONNULL(1);
11458
11459 /**
11460  * Get the current layout homogeneous mode.
11461  *
11462  * @see evas_object_table_homogeneous_set()
11463  */
11464 EAPI Evas_Object_Table_Homogeneous_Mode  evas_object_table_homogeneous_get (const Evas_Object *o) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
11465
11466 /**
11467  * Set padding between cells.
11468  */
11469 EAPI void                                evas_object_table_padding_set     (Evas_Object *o, Evas_Coord horizontal, Evas_Coord vertical) EINA_ARG_NONNULL(1);
11470
11471 /**
11472  * Get padding between cells.
11473  */
11474 EAPI void                                evas_object_table_padding_get     (const Evas_Object *o, Evas_Coord *horizontal, Evas_Coord *vertical) EINA_ARG_NONNULL(1);
11475
11476 /**
11477  * Set the alignment of the whole bounding box of contents.
11478  */
11479 EAPI void                                evas_object_table_align_set       (Evas_Object *o, double horizontal, double vertical) EINA_ARG_NONNULL(1);
11480
11481 /**
11482  * Get alignment of the whole bounding box of contents.
11483  */
11484 EAPI void                                evas_object_table_align_get       (const Evas_Object *o, double *horizontal, double *vertical) EINA_ARG_NONNULL(1);
11485
11486 /**
11487  * Sets the mirrored mode of the table. In mirrored mode the table items go
11488  * from right to left instead of left to right. That is, 1,1 is top right, not
11489  * top left.
11490  *
11491  * @param o The table object.
11492  * @param mirrored the mirrored mode to set
11493  * @since 1.1.0
11494  */
11495 EAPI void                                evas_object_table_mirrored_set    (Evas_Object *o, Eina_Bool mirrored) EINA_ARG_NONNULL(1);
11496
11497 /**
11498  * Gets the mirrored mode of the table.
11499  *
11500  * @param o The table object.
11501  * @return @c EINA_TRUE if it's a mirrored table, @c EINA_FALSE otherwise.
11502  * @since 1.1.0
11503  * @see evas_object_table_mirrored_set()
11504  */
11505 EAPI Eina_Bool                           evas_object_table_mirrored_get    (const Evas_Object *o) EINA_ARG_NONNULL(1);
11506
11507 /**
11508  * Get packing location of a child of table
11509  *
11510  * @param o The given table object.
11511  * @param child The child object to add.
11512  * @param col pointer to store relative-horizontal position to place child.
11513  * @param row pointer to store relative-vertical position to place child.
11514  * @param colspan pointer to store how many relative-horizontal position to use for this child.
11515  * @param rowspan pointer to store how many relative-vertical position to use for this child.
11516  *
11517  * @return 1 on success, 0 on failure.
11518  * @since 1.1.0
11519  */
11520 EAPI Eina_Bool                           evas_object_table_pack_get(const Evas_Object *o, Evas_Object *child, unsigned short *col, unsigned short *row, unsigned short *colspan, unsigned short *rowspan);
11521
11522 /**
11523  * Add a new child to a table object or set its current packing.
11524  *
11525  * @param o The given table object.
11526  * @param child The child object to add.
11527  * @param col relative-horizontal position to place child.
11528  * @param row relative-vertical position to place child.
11529  * @param colspan how many relative-horizontal position to use for this child.
11530  * @param rowspan how many relative-vertical position to use for this child.
11531  *
11532  * @return 1 on success, 0 on failure.
11533  */
11534 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);
11535
11536 /**
11537  * Remove child from table.
11538  *
11539  * @note removing a child will immediately call a walk over children in order
11540  *       to recalculate numbers of columns and rows. If you plan to remove
11541  *       all children, use evas_object_table_clear() instead.
11542  *
11543  * @return 1 on success, 0 on failure.
11544  */
11545 EAPI Eina_Bool                           evas_object_table_unpack          (Evas_Object *o, Evas_Object *child) EINA_ARG_NONNULL(1, 2);
11546
11547 /**
11548  * Faster way to remove all child objects from a table object.
11549  *
11550  * @param o The given table object.
11551  * @param clear if true, it will delete just removed children.
11552  */
11553 EAPI void                                evas_object_table_clear           (Evas_Object *o, Eina_Bool clear) EINA_ARG_NONNULL(1);
11554
11555 /**
11556  * Get the number of columns and rows this table takes.
11557  *
11558  * @note columns and rows are virtual entities, one can specify a table
11559  *       with a single object that takes 4 columns and 5 rows. The only
11560  *       difference for a single cell table is that paddings will be
11561  *       accounted proportionally.
11562  */
11563 EAPI void                                evas_object_table_col_row_size_get(const Evas_Object *o, int *cols, int *rows) EINA_ARG_NONNULL(1);
11564
11565 /**
11566  * Get an iterator to walk the list of children for the table.
11567  *
11568  * @note Do not remove or delete objects while walking the list.
11569  */
11570 EAPI Eina_Iterator                      *evas_object_table_iterator_new    (const Evas_Object *o) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
11571
11572 /**
11573  * Get an accessor to get random access to the list of children for the table.
11574  *
11575  * @note Do not remove or delete objects while walking the list.
11576  */
11577 EAPI Eina_Accessor                      *evas_object_table_accessor_new    (const Evas_Object *o) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
11578
11579 /**
11580  * Get the list of children for the table.
11581  *
11582  * @note This is a duplicate of the list kept by the table internally.
11583  *       It's up to the user to destroy it when it no longer needs it.
11584  *       It's possible to remove objects from the table when walking this
11585  *       list, but these removals won't be reflected on it.
11586  */
11587 EAPI Eina_List                          *evas_object_table_children_get    (const Evas_Object *o) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
11588
11589 /**
11590  * Get the child of the table at the given coordinates
11591  *
11592  * @note This does not take into account col/row spanning
11593  */
11594 EAPI Evas_Object                        *evas_object_table_child_get       (const Evas_Object *o, unsigned short col, unsigned short row) EINA_ARG_NONNULL(1);
11595 /**
11596  * @}
11597  */
11598
11599 /**
11600  * @defgroup Evas_Object_Grid Grid Smart Object.
11601  *
11602  * Convenience smart object that packs children under a regular grid
11603  * layout, using their virtual grid location and size to determine
11604  * children's positions inside the grid object's area.
11605  *
11606  * @ingroup Evas_Smart_Object_Group
11607  * @since 1.1.0
11608  */
11609
11610 /**
11611  * @addtogroup Evas_Object_Grid
11612  * @{
11613  */
11614
11615 /**
11616  * Create a new grid.
11617  *
11618  * It's set to a virtual size of 1x1 by default and add children with
11619  * evas_object_grid_pack().
11620  * @since 1.1.0
11621  */
11622 EAPI Evas_Object                        *evas_object_grid_add             (Evas *evas) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
11623
11624 /**
11625  * Create a grid that is child of a given element @a parent.
11626  *
11627  * @see evas_object_grid_add()
11628  * @since 1.1.0
11629  */
11630 EAPI Evas_Object                        *evas_object_grid_add_to          (Evas_Object *parent) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
11631
11632 /**
11633  * Set the virtual resolution for the grid
11634  *
11635  * @param o The grid object to modify
11636  * @param w The virtual horizontal size (resolution) in integer units
11637  * @param h The virtual vertical size (resolution) in integer units
11638  * @since 1.1.0
11639  */
11640 EAPI void                                evas_object_grid_size_set        (Evas_Object *o, int w, int h) EINA_ARG_NONNULL(1);
11641
11642 /**
11643  * Get the current virtual resolution
11644  *
11645  * @param o The grid object to query
11646  * @param w A pointer to an integer to store the virtual width
11647  * @param h A pointer to an integer to store the virtual height
11648  * @see evas_object_grid_size_set()
11649  * @since 1.1.0
11650  */
11651 EAPI void                                evas_object_grid_size_get        (const Evas_Object *o, int *w, int *h) EINA_ARG_NONNULL(1);
11652
11653 /**
11654  * Sets the mirrored mode of the grid. In mirrored mode the grid items go
11655  * from right to left instead of left to right. That is, 0,0 is top right, not
11656  * to left.
11657  *
11658  * @param o The grid object.
11659  * @param mirrored the mirrored mode to set
11660  * @since 1.1.0
11661  */
11662 EAPI void                                evas_object_grid_mirrored_set    (Evas_Object *o, Eina_Bool mirrored) EINA_ARG_NONNULL(1);
11663
11664 /**
11665  * Gets the mirrored mode of the grid.
11666  *
11667  * @param o The grid object.
11668  * @return @c EINA_TRUE if it's a mirrored grid, @c EINA_FALSE otherwise.
11669  * @see evas_object_grid_mirrored_set()
11670  * @since 1.1.0
11671  */
11672 EAPI Eina_Bool                           evas_object_grid_mirrored_get    (const Evas_Object *o) EINA_ARG_NONNULL(1);
11673
11674 /**
11675  * Add a new child to a grid object.
11676  *
11677  * @param o The given grid object.
11678  * @param child The child object to add.
11679  * @param x The virtual x coordinate of the child
11680  * @param y The virtual y coordinate of the child
11681  * @param w The virtual width of the child
11682  * @param h The virtual height of the child
11683  * @return 1 on success, 0 on failure.
11684  * @since 1.1.0
11685  */
11686 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);
11687
11688 /**
11689  * Remove child from grid.
11690  *
11691  * @note removing a child will immediately call a walk over children in order
11692  *       to recalculate numbers of columns and rows. If you plan to remove
11693  *       all children, use evas_object_grid_clear() instead.
11694  *
11695  * @return 1 on success, 0 on failure.
11696  * @since 1.1.0
11697  */
11698 EAPI Eina_Bool                           evas_object_grid_unpack          (Evas_Object *o, Evas_Object *child) EINA_ARG_NONNULL(1, 2);
11699
11700 /**
11701  * Faster way to remove all child objects from a grid object.
11702  *
11703  * @param o The given grid object.
11704  * @param clear if true, it will delete just removed children.
11705  * @since 1.1.0
11706  */
11707 EAPI void                                evas_object_grid_clear           (Evas_Object *o, Eina_Bool clear) EINA_ARG_NONNULL(1);
11708
11709 /**
11710  * Get the pack options for a grid child
11711  *
11712  * Get the pack x, y, width and height in virtual coordinates set by
11713  * evas_object_grid_pack()
11714  * @param o The grid object
11715  * @param child The grid child to query for coordinates
11716  * @param x The pointer to where the x coordinate will be returned
11717  * @param y The pointer to where the y coordinate will be returned
11718  * @param w The pointer to where the width will be returned
11719  * @param h The pointer to where the height will be returned
11720  * @return 1 on success, 0 on failure.
11721  * @since 1.1.0
11722  */
11723 EAPI Eina_Bool                           evas_object_grid_pack_get        (const Evas_Object *o, Evas_Object *child, int *x, int *y, int *w, int *h);
11724
11725 /**
11726  * Get an iterator to walk the list of children for the grid.
11727  *
11728  * @note Do not remove or delete objects while walking the list.
11729  * @since 1.1.0
11730  */
11731 EAPI Eina_Iterator                      *evas_object_grid_iterator_new    (const Evas_Object *o) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
11732
11733 /**
11734  * Get an accessor to get random access to the list of children for the grid.
11735  *
11736  * @note Do not remove or delete objects while walking the list.
11737  * @since 1.1.0
11738  */
11739 EAPI Eina_Accessor                      *evas_object_grid_accessor_new    (const Evas_Object *o) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
11740
11741 /**
11742  * Get the list of children for the grid.
11743  *
11744  * @note This is a duplicate of the list kept by the grid internally.
11745  *       It's up to the user to destroy it when it no longer needs it.
11746  *       It's possible to remove objects from the grid when walking this
11747  *       list, but these removals won't be reflected on it.
11748  * @since 1.1.0
11749  */
11750 EAPI Eina_List                          *evas_object_grid_children_get    (const Evas_Object *o) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
11751
11752 /**
11753  * @}
11754  */
11755
11756 /**
11757  * @defgroup Evas_Cserve Shared Image Cache Server
11758  *
11759  * Evas has an (optional) module which provides client-server
11760  * infrastructure to <b>share bitmaps across multiple processes</b>,
11761  * saving data and processing power.
11762  *
11763  * Be warned that it @b doesn't work when <b>threaded image
11764  * preloading</b> is enabled for Evas, though.
11765  */
11766    typedef struct _Evas_Cserve_Stats       Evas_Cserve_Stats;
11767    typedef struct _Evas_Cserve_Image_Cache Evas_Cserve_Image_Cache;
11768    typedef struct _Evas_Cserve_Image       Evas_Cserve_Image;
11769    typedef struct _Evas_Cserve_Config      Evas_Cserve_Config;
11770
11771 /**
11772  * Statistics about the server that shares cached bitmaps.
11773  * @ingroup Evas_Cserve
11774  */
11775    struct _Evas_Cserve_Stats
11776      {
11777         int    saved_memory; /**< current amount of saved memory, in bytes */
11778         int    wasted_memory; /**< current amount of wasted memory, in bytes */
11779         int    saved_memory_peak; /**< peak amount of saved memory, in bytes */
11780         int    wasted_memory_peak; /**< peak amount of wasted memory, in bytes */
11781         double saved_time_image_header_load; /**< time, in seconds, saved in header loads by sharing cached loads instead */
11782         double saved_time_image_data_load; /**< time, in seconds, saved in data loads by sharing cached loads instead */
11783      };
11784
11785 /**
11786  * A handle of a cache of images shared by a server.
11787  * @ingroup Evas_Cserve
11788  */
11789    struct _Evas_Cserve_Image_Cache
11790      {
11791         struct {
11792            int     mem_total;
11793            int     count;
11794         } active, cached;
11795         Eina_List *images;
11796      };
11797
11798 /**
11799  * A handle to an image shared by a server.
11800  * @ingroup Evas_Cserve
11801  */
11802    struct _Evas_Cserve_Image
11803      {
11804         const char *file, *key;
11805         int         w, h;
11806         time_t      file_mod_time;
11807         time_t      file_checked_time;
11808         time_t      cached_time;
11809         int         refcount;
11810         int         data_refcount;
11811         int         memory_footprint;
11812         double      head_load_time;
11813         double      data_load_time;
11814         Eina_Bool   alpha : 1;
11815         Eina_Bool   data_loaded : 1;
11816         Eina_Bool   active : 1;
11817         Eina_Bool   dead : 1;
11818         Eina_Bool   useless : 1;
11819      };
11820
11821 /**
11822  * Configuration that controls the server that shares cached bitmaps.
11823  * @ingroup Evas_Cserve
11824  */
11825     struct _Evas_Cserve_Config
11826      {
11827         int cache_max_usage;
11828         int cache_item_timeout;
11829         int cache_item_timeout_check;
11830      };
11831
11832
11833 /**
11834  * Retrieves if the system wants to share bitmaps using the server.
11835  * @return @c EINA_TRUE if it wants, @c EINA_FALSE otherwise.
11836  * @ingroup Evas_Cserve
11837  */
11838 EAPI Eina_Bool         evas_cserve_want_get                   (void) EINA_WARN_UNUSED_RESULT;
11839
11840 /**
11841  * Retrieves if the system is connected to the server used to share
11842  * bitmaps.
11843  *
11844  * @return @c EINA_TRUE if it's connected, @c EINA_FALSE otherwise.
11845  * @ingroup Evas_Cserve
11846  */
11847 EAPI Eina_Bool         evas_cserve_connected_get              (void) EINA_WARN_UNUSED_RESULT;
11848
11849 /**
11850  * Retrieves statistics from a running bitmap sharing server.
11851  * @param stats pointer to structure to fill with statistics about the
11852  *        bitmap cache server.
11853  *
11854  * @return @c EINA_TRUE if @p stats were filled with data,
11855  *         @c EINA_FALSE otherwise (when @p stats is untouched)
11856  * @ingroup Evas_Cserve
11857  */
11858 EAPI Eina_Bool         evas_cserve_stats_get                  (Evas_Cserve_Stats *stats) EINA_WARN_UNUSED_RESULT;
11859
11860 /**
11861  * Completely discard/clean a given images cache, thus re-setting it.
11862  *
11863  * @param cache A handle to the given images cache.
11864  */
11865 EAPI void              evas_cserve_image_cache_contents_clean (Evas_Cserve_Image_Cache *cache);
11866
11867 /**
11868  * Retrieves the current configuration of the Evas image caching
11869  * server.
11870  *
11871  * @param config where to store current image caching server's
11872  * configuration.
11873  *
11874  * @return @c EINA_TRUE if @p config was filled with data,
11875  *         @c EINA_FALSE otherwise (when @p config is untouched)
11876  *
11877  * The fields of @p config will be altered to reflect the current
11878  * configuration's values.
11879  *
11880  * @see evas_cserve_config_set()
11881  *
11882  * @ingroup Evas_Cserve
11883  */
11884 EAPI Eina_Bool         evas_cserve_config_get                 (Evas_Cserve_Config *config) EINA_WARN_UNUSED_RESULT;
11885
11886 /**
11887  * Changes the configurations of the Evas image caching server.
11888  *
11889  * @param config A bitmap cache configuration handle with fields set
11890  * to desired configuration values.
11891  * @return @c EINA_TRUE if @p config was successfully applied,
11892  *         @c EINA_FALSE otherwise.
11893  *
11894  * @see evas_cserve_config_get()
11895  *
11896  * @ingroup Evas_Cserve
11897  */
11898 EAPI Eina_Bool         evas_cserve_config_set                 (const Evas_Cserve_Config *config) EINA_WARN_UNUSED_RESULT;
11899
11900 /**
11901  * Force the system to disconnect from the bitmap caching server.
11902  *
11903  * @ingroup Evas_Cserve
11904  */
11905 EAPI void              evas_cserve_disconnect                 (void);
11906
11907 /**
11908  * @defgroup Evas_Utils General Utilities
11909  *
11910  * Some functions that are handy but are not specific of canvas or
11911  * objects.
11912  */
11913
11914 /**
11915  * Converts the given Evas image load error code into a string
11916  * describing it in english.
11917  *
11918  * @param error the error code, a value in ::Evas_Load_Error.
11919  * @return Always returns a valid string. If the given @p error is not
11920  *         supported, <code>"Unknown error"</code> is returned.
11921  *
11922  * Mostly evas_object_image_file_set() would be the function setting
11923  * that error value afterwards, but also evas_object_image_load(),
11924  * evas_object_image_save(), evas_object_image_data_get(),
11925  * evas_object_image_data_convert(), evas_object_image_pixels_import()
11926  * and evas_object_image_is_inside(). This function is meant to be
11927  * used in conjunction with evas_object_image_load_error_get(), as in:
11928  *
11929  * Example code:
11930  * @dontinclude evas-images.c
11931  * @skip img1 =
11932  * @until ecore_main_loop_begin(
11933  *
11934  * Here, being @c valid_path the path to a valid image and @c
11935  * bogus_path a path to a file which does not exist, the two outputs
11936  * of evas_load_error_str() would be (if no other errors occur):
11937  * <code>"No error on load"</code> and <code>"File (or file path) does
11938  * not exist"</code>, respectively. See the full @ref
11939  * Example_Evas_Images "example".
11940  *
11941  * @ingroup Evas_Utils
11942  */
11943 EAPI const char       *evas_load_error_str               (Evas_Load_Error error);
11944
11945 /* Evas utility routines for color space conversions */
11946 /* hsv color space has h in the range 0.0 to 360.0, and s,v in the range 0.0 to 1.0 */
11947 /* rgb color space has r,g,b in the range 0 to 255 */
11948
11949 /**
11950  * Convert a given color from HSV to RGB format.
11951  *
11952  * @param h The Hue component of the color.
11953  * @param s The Saturation component of the color.
11954  * @param v The Value component of the color.
11955  * @param r The Red component of the color.
11956  * @param g The Green component of the color.
11957  * @param b The Blue component of the color.
11958  *
11959  * This function converts a given color in HSV color format to RGB
11960  * color format.
11961  *
11962  * @ingroup Evas_Utils
11963  **/
11964 EAPI void              evas_color_hsv_to_rgb             (float h, float s, float v, int *r, int *g, int *b);
11965
11966 /**
11967  * Convert a given color from RGB to HSV format.
11968  *
11969  * @param r The Red component of the color.
11970  * @param g The Green component of the color.
11971  * @param b The Blue component of the color.
11972  * @param h The Hue component of the color.
11973  * @param s The Saturation component of the color.
11974  * @param v The Value component of the color.
11975  *
11976  * This function converts a given color in RGB color format to HSV
11977  * color format.
11978  *
11979  * @ingroup Evas_Utils
11980  **/
11981 EAPI void              evas_color_rgb_to_hsv             (int r, int g, int b, float *h, float *s, float *v);
11982
11983 /* argb color space has a,r,g,b in the range 0 to 255 */
11984
11985 /**
11986  * Pre-multiplies a rgb triplet by an alpha factor.
11987  *
11988  * @param a The alpha factor.
11989  * @param r The Red component of the color.
11990  * @param g The Green component of the color.
11991  * @param b The Blue component of the color.
11992  *
11993  * This function pre-multiplies a given rgb triplet by an alpha
11994  * factor. Alpha factor is used to define transparency.
11995  *
11996  * @ingroup Evas_Utils
11997  **/
11998 EAPI void              evas_color_argb_premul            (int a, int *r, int *g, int *b);
11999
12000 /**
12001  * Undo pre-multiplication of a rgb triplet by an alpha factor.
12002  *
12003  * @param a The alpha factor.
12004  * @param r The Red component of the color.
12005  * @param g The Green component of the color.
12006  * @param b The Blue component of the color.
12007  *
12008  * This function undoes pre-multiplication a given rbg triplet by an
12009  * alpha factor. Alpha factor is used to define transparency.
12010  *
12011  * @see evas_color_argb_premul().
12012  *
12013  * @ingroup Evas_Utils
12014  **/
12015 EAPI void              evas_color_argb_unpremul          (int a, int *r, int *g, int *b);
12016
12017
12018 /**
12019  * Pre-multiplies data by an alpha factor.
12020  *
12021  * @param data The data value.
12022  * @param len  The length value.
12023  *
12024  * This function pre-multiplies a given data by an alpha
12025  * factor. Alpha factor is used to define transparency.
12026  *
12027  * @ingroup Evas_Utils
12028  **/
12029 EAPI void              evas_data_argb_premul             (unsigned int *data, unsigned int len);
12030
12031 /**
12032  * Undo pre-multiplication data by an alpha factor.
12033  *
12034  * @param data The data value.
12035  * @param len  The length value.
12036  *
12037  * This function undoes pre-multiplication of a given data by an alpha
12038  * factor. Alpha factor is used to define transparency.
12039  *
12040  * @ingroup Evas_Utils
12041  **/
12042 EAPI void              evas_data_argb_unpremul           (unsigned int *data, unsigned int len);
12043
12044 /* string and font handling */
12045
12046 /**
12047  * Gets the next character in the string
12048  *
12049  * Given the UTF-8 string in @p str, and starting byte position in @p pos,
12050  * this function will place in @p decoded the decoded code point at @p pos
12051  * and return the byte index for the next character in the string.
12052  *
12053  * The only boundary check done is that @p pos must be >= 0. Other than that,
12054  * no checks are performed, so passing an index value that's not within the
12055  * length of the string will result in undefined behavior.
12056  *
12057  * @param str The UTF-8 string
12058  * @param pos The byte index where to start
12059  * @param decoded Address where to store the decoded code point. Optional.
12060  *
12061  * @return The byte index of the next character
12062  *
12063  * @ingroup Evas_Utils
12064  */
12065 EAPI int               evas_string_char_next_get         (const char *str, int pos, int *decoded) EINA_ARG_NONNULL(1);
12066
12067 /**
12068  * Gets the previous character in the string
12069  *
12070  * Given the UTF-8 string in @p str, and starting byte position in @p pos,
12071  * this function will place in @p decoded the decoded code point at @p pos
12072  * and return the byte index for the previous character in the string.
12073  *
12074  * The only boundary check done is that @p pos must be >= 1. Other than that,
12075  * no checks are performed, so passing an index value that's not within the
12076  * length of the string will result in undefined behavior.
12077  *
12078  * @param str The UTF-8 string
12079  * @param pos The byte index where to start
12080  * @param decoded Address where to store the decoded code point. Optional.
12081  *
12082  * @return The byte index of the previous character
12083  *
12084  * @ingroup Evas_Utils
12085  */
12086 EAPI int               evas_string_char_prev_get         (const char *str, int pos, int *decoded) EINA_ARG_NONNULL(1);
12087
12088 /**
12089  * Get the length in characters of the string.
12090  * @param  str The string to get the length of.
12091  * @return The length in characters (not bytes)
12092  * @ingroup Evas_Utils
12093  */
12094 EAPI int               evas_string_char_len_get          (const char *str) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
12095
12096 /**
12097  * @defgroup Evas_Keys Key Input Functions
12098  *
12099  * Functions which feed key events to the canvas.
12100  *
12101  * As explained in @ref intro_not_evas, Evas is @b not aware of input
12102  * systems at all. Then, the user, if using it crudely (evas_new()),
12103  * will have to feed it with input events, so that it can react
12104  * somehow. If, however, the user creates a canvas by means of the
12105  * Ecore_Evas wrapper, it will automatically bind the chosen display
12106  * engine's input events to the canvas, for you.
12107  *
12108  * This group presents the functions dealing with the feeding of key
12109  * events to the canvas. On most of them, one has to reference a given
12110  * key by a name (<code>keyname</code> argument). Those are
12111  * <b>platform dependent</b> symbolic names for the keys. Sometimes
12112  * you'll get the right <code>keyname</code> by simply using an ASCII
12113  * value of the key name, but it won't be like that always.
12114  *
12115  * Typical platforms are Linux frame buffer (Ecore_FB) and X server
12116  * (Ecore_X) when using Evas with Ecore and Ecore_Evas. Please refer
12117  * to your display engine's documentation when using evas through an
12118  * Ecore helper wrapper when you need the <code>keyname</code>s.
12119  *
12120  * Example:
12121  * @dontinclude evas-events.c
12122  * @skip mods = evas_key_modifier_get(evas);
12123  * @until {
12124  *
12125  * All the other @c evas_key functions behave on the same manner. See
12126  * the full @ref Example_Evas_Events "example".
12127  *
12128  * @ingroup Evas_Canvas
12129  */
12130
12131 /**
12132  * @addtogroup Evas_Keys
12133  * @{
12134  */
12135
12136 /**
12137  * Returns a handle to the list of modifier keys registered in the
12138  * canvas @p e. This is required to check for which modifiers are set
12139  * at a given time with the evas_key_modifier_is_set() function.
12140  *
12141  * @param e The pointer to the Evas canvas
12142  *
12143  * @see evas_key_modifier_add
12144  * @see evas_key_modifier_del
12145  * @see evas_key_modifier_on
12146  * @see evas_key_modifier_off
12147  * @see evas_key_modifier_is_set
12148  *
12149  * @return An ::Evas_Modifier handle to query Evas' keys subsystem
12150  *      with evas_key_modifier_is_set(), or @c NULL on error.
12151  */
12152 EAPI const Evas_Modifier *evas_key_modifier_get          (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
12153
12154 /**
12155  * Returns a handle to the list of lock keys registered in the canvas
12156  * @p e. This is required to check for which locks are set at a given
12157  * time with the evas_key_lock_is_set() function.
12158  *
12159  * @param e The pointer to the Evas canvas
12160  *
12161  * @see evas_key_lock_add
12162  * @see evas_key_lock_del
12163  * @see evas_key_lock_on
12164  * @see evas_key_lock_off
12165  * @see evas_key_lock_is_set
12166  *
12167  * @return An ::Evas_Lock handle to query Evas' keys subsystem with
12168  *      evas_key_lock_is_set(), or @c NULL on error.
12169  */
12170 EAPI const Evas_Lock     *evas_key_lock_get              (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
12171
12172
12173 /**
12174  * Checks the state of a given modifier key, at the time of the
12175  * call. If the modifier is set, such as shift being pressed, this
12176  * function returns @c Eina_True.
12177  *
12178  * @param m The current modifiers set, as returned by
12179  *        evas_key_modifier_get().
12180  * @param keyname The name of the modifier key to check status for.
12181  *
12182  * @return @c Eina_True if the modifier key named @p keyname is on, @c
12183  *         Eina_False otherwise.
12184  *
12185  * @see evas_key_modifier_add
12186  * @see evas_key_modifier_del
12187  * @see evas_key_modifier_get
12188  * @see evas_key_modifier_on
12189  * @see evas_key_modifier_off
12190  */
12191 EAPI Eina_Bool            evas_key_modifier_is_set       (const Evas_Modifier *m, const char *keyname) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2);
12192
12193
12194 /**
12195  * Checks the state of a given lock key, at the time of the call. If
12196  * the lock is set, such as caps lock, this function returns @c
12197  * Eina_True.
12198  *
12199  * @param l The current locks set, as returned by evas_key_lock_get().
12200  * @param keyname The name of the lock key to check status for.
12201  *
12202  * @return @c Eina_True if the @p keyname lock key is set, @c
12203  *        Eina_False otherwise.
12204  *
12205  * @see evas_key_lock_get
12206  * @see evas_key_lock_add
12207  * @see evas_key_lock_del
12208  * @see evas_key_lock_on
12209  * @see evas_key_lock_off
12210  */
12211 EAPI Eina_Bool            evas_key_lock_is_set           (const Evas_Lock *l, const char *keyname) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2);
12212
12213
12214 /**
12215  * Adds the @p keyname key to the current list of modifier keys.
12216  *
12217  * @param e The pointer to the Evas canvas
12218  * @param keyname The name of the modifier key to add to the list of
12219  *        Evas modifiers.
12220  *
12221  * Modifiers are keys like shift, alt and ctrl, i.e., keys which are
12222  * meant to be pressed together with others, altering the behavior of
12223  * the secondly pressed keys somehow. Evas is so that these keys can
12224  * be user defined.
12225  *
12226  * This call allows custom modifiers to be added to the Evas system at
12227  * run time. It is then possible to set and unset modifier keys
12228  * programmatically for other parts of the program to check and act
12229  * on. Programmers using Evas would check for modifier keys on key
12230  * event callbacks using evas_key_modifier_is_set().
12231  *
12232  * @see evas_key_modifier_del
12233  * @see evas_key_modifier_get
12234  * @see evas_key_modifier_on
12235  * @see evas_key_modifier_off
12236  * @see evas_key_modifier_is_set
12237  *
12238  * @note If the programmer instantiates the canvas by means of the
12239  *       ecore_evas_new() family of helper functions, Ecore will take
12240  *       care of registering on it all standard modifiers: "Shift",
12241  *       "Control", "Alt", "Meta", "Hyper", "Super".
12242  */
12243 EAPI void                 evas_key_modifier_add          (Evas *e, const char *keyname) EINA_ARG_NONNULL(1, 2);
12244
12245 /**
12246  * Removes the @p keyname key from the current list of modifier keys
12247  * on canvas @p e.
12248  *
12249  * @param e The pointer to the Evas canvas
12250  * @param keyname The name of the key to remove from the modifiers list.
12251  *
12252  * @see evas_key_modifier_add
12253  * @see evas_key_modifier_get
12254  * @see evas_key_modifier_on
12255  * @see evas_key_modifier_off
12256  * @see evas_key_modifier_is_set
12257  */
12258 EAPI void                 evas_key_modifier_del          (Evas *e, const char *keyname) EINA_ARG_NONNULL(1, 2);
12259
12260 /**
12261  * Adds the @p keyname key to the current list of lock keys.
12262  *
12263  * @param e The pointer to the Evas canvas
12264  * @param keyname The name of the key to add to the locks list.
12265  *
12266  * Locks are keys like caps lock, num lock or scroll lock, i.e., keys
12267  * which are meant to be pressed once -- toggling a binary state which
12268  * is bound to it -- and thus altering the behavior of all
12269  * subsequently pressed keys somehow, depending on its state. Evas is
12270  * so that these keys can be defined by the user.
12271  *
12272  * This allows custom locks to be added to the evas system at run
12273  * time. It is then possible to set and unset lock keys
12274  * programmatically for other parts of the program to check and act
12275  * on. Programmers using Evas would check for lock keys on key event
12276  * callbacks using evas_key_lock_is_set().
12277  *
12278  * @see evas_key_lock_get
12279  * @see evas_key_lock_del
12280  * @see evas_key_lock_on
12281  * @see evas_key_lock_off
12282  * @see evas_key_lock_is_set
12283  *
12284  * @note If the programmer instantiates the canvas by means of the
12285  *       ecore_evas_new() family of helper functions, Ecore will take
12286  *       care of registering on it all standard lock keys: "Caps_Lock",
12287  *       "Num_Lock", "Scroll_Lock".
12288  */
12289 EAPI void                 evas_key_lock_add              (Evas *e, const char *keyname) EINA_ARG_NONNULL(1, 2);
12290
12291 /**
12292  * Removes the @p keyname key from the current list of lock keys on
12293  * canvas @p e.
12294  *
12295  * @param e The pointer to the Evas canvas
12296  * @param keyname The name of the key to remove from the locks list.
12297  *
12298  * @see evas_key_lock_get
12299  * @see evas_key_lock_add
12300  * @see evas_key_lock_on
12301  * @see evas_key_lock_off
12302  */
12303 EAPI void                 evas_key_lock_del              (Evas *e, const char *keyname) EINA_ARG_NONNULL(1, 2);
12304
12305
12306 /**
12307  * Enables or turns on programmatically the modifier key with name @p
12308  * keyname.
12309  *
12310  * @param e The pointer to the Evas canvas
12311  * @param keyname The name of the modifier to enable.
12312  *
12313  * The effect will be as if the key was pressed for the whole time
12314  * between this call and a matching evas_key_modifier_off().
12315  *
12316  * @see evas_key_modifier_add
12317  * @see evas_key_modifier_get
12318  * @see evas_key_modifier_off
12319  * @see evas_key_modifier_is_set
12320  */
12321 EAPI void                 evas_key_modifier_on           (Evas *e, const char *keyname) EINA_ARG_NONNULL(1, 2);
12322
12323 /**
12324  * Disables or turns off programmatically the modifier key with name
12325  * @p keyname.
12326  *
12327  * @param e The pointer to the Evas canvas
12328  * @param keyname The name of the modifier to disable.
12329  *
12330  * @see evas_key_modifier_add
12331  * @see evas_key_modifier_get
12332  * @see evas_key_modifier_on
12333  * @see evas_key_modifier_is_set
12334  */
12335 EAPI void                 evas_key_modifier_off          (Evas *e, const char *keyname) EINA_ARG_NONNULL(1, 2);
12336
12337 /**
12338  * Enables or turns on programmatically the lock key with name @p
12339  * keyname.
12340  *
12341  * @param e The pointer to the Evas canvas
12342  * @param keyname The name of the lock to enable.
12343  *
12344  * The effect will be as if the key was put on its active state after
12345  * this call.
12346  *
12347  * @see evas_key_lock_get
12348  * @see evas_key_lock_add
12349  * @see evas_key_lock_del
12350  * @see evas_key_lock_off
12351  */
12352 EAPI void                 evas_key_lock_on               (Evas *e, const char *keyname) EINA_ARG_NONNULL(1, 2);
12353
12354 /**
12355  * Disables or turns off programmatically the lock key with name @p
12356  * keyname.
12357  *
12358  * @param e The pointer to the Evas canvas
12359  * @param keyname The name of the lock to disable.
12360  *
12361  * The effect will be as if the key was put on its inactive state
12362  * after this call.
12363  *
12364  * @see evas_key_lock_get
12365  * @see evas_key_lock_add
12366  * @see evas_key_lock_del
12367  * @see evas_key_lock_on
12368  */
12369 EAPI void                 evas_key_lock_off              (Evas *e, const char *keyname) EINA_ARG_NONNULL(1, 2);
12370
12371
12372 /**
12373  * Creates a bit mask from the @p keyname @b modifier key. Values
12374  * returned from different calls to it may be ORed together,
12375  * naturally.
12376  *
12377  * @param e The canvas whom to query the bit mask from.
12378  * @param keyname The name of the modifier key to create the mask for.
12379  *
12380  * @returns the bit mask or 0 if the @p keyname key wasn't registered as a
12381  *          modifier for canvas @p e.
12382  *
12383  * This function is meant to be using in conjunction with
12384  * evas_object_key_grab()/evas_object_key_ungrab(). Go check their
12385  * documentation for more information.
12386  *
12387  * @see evas_key_modifier_add
12388  * @see evas_key_modifier_get
12389  * @see evas_key_modifier_on
12390  * @see evas_key_modifier_off
12391  * @see evas_key_modifier_is_set
12392  * @see evas_object_key_grab
12393  * @see evas_object_key_ungrab
12394  */
12395 EAPI Evas_Modifier_Mask   evas_key_modifier_mask_get     (const Evas *e, const char *keyname) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2);
12396
12397
12398 /**
12399  * Requests @p keyname key events be directed to @p obj.
12400  *
12401  * @param obj the object to direct @p keyname events to.
12402  * @param keyname the key to request events for.
12403  * @param modifiers a mask of modifiers that must be present to
12404  * trigger the event.
12405  * @param not_modifiers a mask of modifiers that must @b not be present
12406  * to trigger the event.
12407  * @param exclusive request that the @p obj is the only object
12408  * receiving the @p keyname events.
12409  * @return @c EINA_TRUE, if the call succeeded, @c EINA_FALSE otherwise.
12410  *
12411  * Key grabs allow one or more objects to receive key events for
12412  * specific key strokes even if other objects have focus. Whenever a
12413  * key is grabbed, only the objects grabbing it will get the events
12414  * for the given keys.
12415  *
12416  * @p keyname is a platform dependent symbolic name for the key
12417  * pressed (see @ref Evas_Keys for more information).
12418  *
12419  * @p modifiers and @p not_modifiers are bit masks of all the
12420  * modifiers that must and mustn't, respectively, be pressed along
12421  * with @p keyname key in order to trigger this new key
12422  * grab. Modifiers can be things such as Shift and Ctrl as well as
12423  * user defined types via evas_key_modifier_add(). Retrieve them with
12424  * evas_key_modifier_mask_get() or use @c 0 for empty masks.
12425  *
12426  * @p exclusive will make the given object the only one permitted to
12427  * grab the given key. If given @c EINA_TRUE, subsequent calls on this
12428  * function with different @p obj arguments will fail, unless the key
12429  * is ungrabbed again.
12430  *
12431  * Example code follows.
12432  * @dontinclude evas-events.c
12433  * @skip if (d.focus)
12434  * @until else
12435  *
12436  * See the full example @ref Example_Evas_Events "here".
12437  *
12438  * @warning Providing impossible modifier sets creates undefined behavior
12439  *
12440  * @see evas_object_key_ungrab
12441  * @see evas_object_focus_set
12442  * @see evas_object_focus_get
12443  * @see evas_focus_get
12444  * @see evas_key_modifier_add
12445  */
12446 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);
12447
12448 /**
12449  * Removes the grab on @p keyname key events by @p obj.
12450  *
12451  * @param obj the object that has an existing key grab.
12452  * @param keyname the key the grab is set for.
12453  * @param modifiers a mask of modifiers that must be present to
12454  * trigger the event.
12455  * @param not_modifiers a mask of modifiers that must not not be
12456  * present to trigger the event.
12457  *
12458  * Removes a key grab on @p obj if @p keyname, @p modifiers, and @p
12459  * not_modifiers match.
12460  *
12461  * Example code follows.
12462  * @dontinclude evas-events.c
12463  * @skip got here by key grabs
12464  * @until }
12465  *
12466  * See the full example @ref Example_Evas_Events "here".
12467  *
12468  * @see evas_object_key_grab
12469  * @see evas_object_focus_set
12470  * @see evas_object_focus_get
12471  * @see evas_focus_get
12472  */
12473 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);
12474
12475 /**
12476  * @}
12477  */
12478
12479 /**
12480  * @defgroup Evas_Touch_Point_List Touch Point List Functions
12481  *
12482  * Functions to get information of touched points in the Evas.
12483  *
12484  * Evas maintains list of touched points on the canvas. Each point has
12485  * its co-ordinates, id and state. You can get the number of touched
12486  * points and information of each point using evas_touch_point_list
12487  * functions.
12488  *
12489  * @ingroup Evas_Canvas
12490  */
12491
12492 /**
12493  * @addtogroup Evas_Touch_Point_List
12494  * @{
12495  */
12496
12497 /**
12498  * Get the number of touched point in the evas.
12499  *
12500  * @param e The pointer to the Evas canvas.
12501  * @return The number of touched point on the evas.
12502  *
12503  * New touched point is added to the list whenever touching the evas
12504  * and point is removed whenever removing touched point from the evas.
12505  *
12506  * Example:
12507  * @code
12508  * extern Evas *evas;
12509  * int count;
12510  *
12511  * count = evas_touch_point_list_count(evas);
12512  * printf("The count of touch points: %i\n", count);
12513  * @endcode
12514  *
12515  * @see evas_touch_point_list_nth_xy_get()
12516  * @see evas_touch_point_list_nth_id_get()
12517  * @see evas_touch_point_list_nth_state_get()
12518  */
12519 EAPI unsigned int           evas_touch_point_list_count(Evas *e) EINA_ARG_NONNULL(1);
12520
12521 /**
12522  * This function returns the nth touch point's co-ordinates.
12523  *
12524  * @param e The pointer to the Evas canvas.
12525  * @param n The number of the touched point (0 being the first).
12526  * @param x The pointer to a Evas_Coord to be filled in.
12527  * @param y The pointer to a Evas_Coord to be filled in.
12528  *
12529  * Touch point's co-ordinates is updated whenever moving that point
12530  * on the canvas.
12531  *
12532  * Example:
12533  * @code
12534  * extern Evas *evas;
12535  * Evas_Coord x, y;
12536  *
12537  * if (evas_touch_point_list_count(evas))
12538  *   {
12539  *      evas_touch_point_nth_xy_get(evas, 0, &x, &y);
12540  *      printf("The first touch point's co-ordinate: (%i, %i)\n", x, y);
12541  *   }
12542  * @endcode
12543  *
12544  * @see evas_touch_point_list_count()
12545  * @see evas_touch_point_list_nth_id_get()
12546  * @see evas_touch_point_list_nth_state_get()
12547  */
12548 EAPI void                   evas_touch_point_list_nth_xy_get(Evas *e, unsigned int n, Evas_Coord *x, Evas_Coord *y) EINA_ARG_NONNULL(1);
12549
12550 /**
12551  * This function returns the @p id of nth touch point.
12552  *
12553  * @param e The pointer to the Evas canvas.
12554  * @param n The number of the touched point (0 being the first).
12555  * @return id of nth touch point, if the call succeeded, -1 otherwise.
12556  *
12557  * The point which comes from Mouse Event has @p id 0 and The point
12558  * which comes from Multi Event has @p id that is same as Multi
12559  * Event's device id.
12560  *
12561  * Example:
12562  * @code
12563  * extern Evas *evas;
12564  * int id;
12565  *
12566  * if (evas_touch_point_list_count(evas))
12567  *   {
12568  *      id = evas_touch_point_nth_id_get(evas, 0);
12569  *      printf("The first touch point's id: %i\n", id);
12570  *   }
12571  * @endcode
12572  *
12573  * @see evas_touch_point_list_count()
12574  * @see evas_touch_point_list_nth_xy_get()
12575  * @see evas_touch_point_list_nth_state_get()
12576  */
12577 EAPI int                    evas_touch_point_list_nth_id_get(Evas *e, unsigned int n) EINA_ARG_NONNULL(1);
12578
12579 /**
12580  * This function returns the @p state of nth touch point.
12581  *
12582  * @param e The pointer to the Evas canvas.
12583  * @param n The number of the touched point (0 being the first).
12584  * @return @p state of nth touch point, if the call succeeded,
12585  *         EVAS_TOUCH_POINT_CANCEL otherwise.
12586  *
12587  * The point's @p state is EVAS_TOUCH_POINT_DOWN when pressed,
12588  * EVAS_TOUCH_POINT_STILL when the point is not moved after pressed,
12589  * EVAS_TOUCH_POINT_MOVE when moved at least once after pressed and
12590  * EVAS_TOUCH_POINT_UP when released.
12591  *
12592  * Example:
12593  * @code
12594  * extern Evas *evas;
12595  * Evas_Touch_Point_State state;
12596  *
12597  * if (evas_touch_point_list_count(evas))
12598  *   {
12599  *      state = evas_touch_point_nth_state_get(evas, 0);
12600  *      printf("The first touch point's state: %i\n", state);
12601  *   }
12602  * @endcode
12603  *
12604  * @see evas_touch_point_list_count()
12605  * @see evas_touch_point_list_nth_xy_get()
12606  * @see evas_touch_point_list_nth_id_get()
12607  */
12608 EAPI Evas_Touch_Point_State evas_touch_point_list_nth_state_get(Evas *e, unsigned int n) EINA_ARG_NONNULL(1);
12609
12610 /**
12611  * @}
12612  */
12613
12614 #ifdef __cplusplus
12615 }
12616 #endif
12617
12618 #endif