From: Jérôme Pinot <ngc891@gmail.com>
[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 ChunEon Park <hermet@@hermet.pe.kr>
302 @author Christopher 'devilhorns' Michael <cpmichael1@comcast.net>
303 @author Seungsoo Woo <om101.woo@samsung.com>
304
305 Please contact <enlightenment-devel@lists.sourceforge.net> to get in
306 contact with the developers and maintainers.
307 */
308
309 #ifndef _EVAS_H
310 #define _EVAS_H
311
312 #include <time.h>
313
314 #include <Eina.h>
315
316 #ifdef EAPI
317 # undef EAPI
318 #endif
319
320 #ifdef _WIN32
321 # ifdef EFL_EVAS_BUILD
322 #  ifdef DLL_EXPORT
323 #   define EAPI __declspec(dllexport)
324 #  else
325 #   define EAPI
326 #  endif /* ! DLL_EXPORT */
327 # else
328 #  define EAPI __declspec(dllimport)
329 # endif /* ! EFL_EVAS_BUILD */
330 #else
331 # ifdef __GNUC__
332 #  if __GNUC__ >= 4
333 #   define EAPI __attribute__ ((visibility("default")))
334 #  else
335 #   define EAPI
336 #  endif
337 # else
338 #  define EAPI
339 # endif
340 #endif /* ! _WIN32 */
341
342 #ifdef __cplusplus
343 extern "C" {
344 #endif
345
346 #define EVAS_VERSION_MAJOR 1
347 #define EVAS_VERSION_MINOR 2
348
349 typedef struct _Evas_Version
350 {
351    int major;
352    int minor;
353    int micro;
354    int revision;
355 } Evas_Version;
356
357 EAPI extern Evas_Version *evas_version;
358
359 /**
360  * @file
361  * @brief These routines are used for Evas library interaction.
362  *
363  * @todo check boolean return values and convert to Eina_Bool
364  * @todo change all api to use EINA_SAFETY_*
365  * @todo finish api documentation
366  */
367
368 /* BiDi exposed stuff */
369    /*FIXME: document */
370 typedef enum _Evas_BiDi_Direction
371 {
372    EVAS_BIDI_DIRECTION_NATURAL,
373    EVAS_BIDI_DIRECTION_NEUTRAL = EVAS_BIDI_DIRECTION_NATURAL,
374    EVAS_BIDI_DIRECTION_LTR,
375    EVAS_BIDI_DIRECTION_RTL
376 } Evas_BiDi_Direction;
377
378 /**
379  * Identifier of callbacks to be set for Evas canvases or Evas
380  * objects.
381  *
382  * The following figure illustrates some Evas callbacks:
383  *
384  * @image html evas-callbacks.png
385  * @image rtf evas-callbacks.png
386  * @image latex evas-callbacks.eps
387  *
388  * @see evas_object_event_callback_add()
389  * @see evas_event_callback_add()
390  */
391 typedef enum _Evas_Callback_Type
392 {
393    /*
394     * The following events are only for use with Evas objects, with
395     * evas_object_event_callback_add():
396     */
397    EVAS_CALLBACK_MOUSE_IN, /**< Mouse In Event */
398    EVAS_CALLBACK_MOUSE_OUT, /**< Mouse Out Event */
399    EVAS_CALLBACK_MOUSE_DOWN, /**< Mouse Button Down Event */
400    EVAS_CALLBACK_MOUSE_UP, /**< Mouse Button Up Event */
401    EVAS_CALLBACK_MOUSE_MOVE, /**< Mouse Move Event */
402    EVAS_CALLBACK_MOUSE_WHEEL, /**< Mouse Wheel Event */
403    EVAS_CALLBACK_MULTI_DOWN, /**< Multi-touch Down Event */
404    EVAS_CALLBACK_MULTI_UP, /**< Multi-touch Up Event */
405    EVAS_CALLBACK_MULTI_MOVE, /**< Multi-touch Move Event */
406    EVAS_CALLBACK_FREE, /**< Object Being Freed (Called after Del) */
407    EVAS_CALLBACK_KEY_DOWN, /**< Key Press Event */
408    EVAS_CALLBACK_KEY_UP, /**< Key Release Event */
409    EVAS_CALLBACK_FOCUS_IN, /**< Focus In Event */
410    EVAS_CALLBACK_FOCUS_OUT, /**< Focus Out Event */
411    EVAS_CALLBACK_SHOW, /**< Show Event */
412    EVAS_CALLBACK_HIDE, /**< Hide Event */
413    EVAS_CALLBACK_MOVE, /**< Move Event */
414    EVAS_CALLBACK_RESIZE, /**< Resize Event */
415    EVAS_CALLBACK_RESTACK, /**< Restack Event */
416    EVAS_CALLBACK_DEL, /**< Object Being Deleted (called before Free) */
417    EVAS_CALLBACK_HOLD, /**< Events go on/off hold */
418    EVAS_CALLBACK_CHANGED_SIZE_HINTS, /**< Size hints changed event */
419    EVAS_CALLBACK_IMAGE_PRELOADED, /**< Image has been preloaded */
420
421    /*
422     * The following events are only for use with Evas canvases, with
423     * evas_event_callback_add():
424     */
425    EVAS_CALLBACK_CANVAS_FOCUS_IN, /**< Canvas got focus as a whole */
426    EVAS_CALLBACK_CANVAS_FOCUS_OUT, /**< Canvas lost focus as a whole */
427    EVAS_CALLBACK_RENDER_FLUSH_PRE, /**< Called just before rendering is updated on the canvas target */
428    EVAS_CALLBACK_RENDER_FLUSH_POST, /**< Called just after rendering is updated on the canvas target */
429    EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_IN, /**< Canvas object got focus */
430    EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_OUT, /**< Canvas object lost focus */
431
432    /*
433     * More Evas object event types - see evas_object_event_callback_add():
434     */
435    EVAS_CALLBACK_IMAGE_UNLOADED, /**< Image data has been unloaded (by some mechanims in Evas that throw out original image data) */
436
437    EVAS_CALLBACK_RENDER_PRE, /**< Called just before rendering starts on the canvas target @since 1.2 */
438    EVAS_CALLBACK_RENDER_POST, /**< Called just after rendering stops on the canvas target @since 1.2 */
439      
440    EVAS_CALLBACK_LAST /**< kept as last element/sentinel -- not really an event */
441 } Evas_Callback_Type; /**< The types of events triggering a callback */
442
443 /**
444  * @def EVAS_CALLBACK_PRIORITY_BEFORE
445  * Slightly more prioritized than default.
446  * @since 1.1.0
447  */
448 #define EVAS_CALLBACK_PRIORITY_BEFORE -100
449 /**
450  * @def EVAS_CALLBACK_PRIORITY_DEFAULT
451  * Default callback priority level
452  * @since 1.1.0
453  */
454 #define EVAS_CALLBACK_PRIORITY_DEFAULT 0
455 /**
456  * @def EVAS_CALLBACK_PRIORITY_AFTER
457  * Slightly less prioritized than default.
458  * @since 1.1.0
459  */
460 #define EVAS_CALLBACK_PRIORITY_AFTER 100
461
462 /**
463  * @typedef Evas_Callback_Priority
464  *
465  * Callback priority value. Range is -32k - 32k. The lower the number, the
466  * bigger the priority.
467  *
468  * @see EVAS_CALLBACK_PRIORITY_AFTER
469  * @see EVAS_CALLBACK_PRIORITY_BEFORE
470  * @see EVAS_CALLBACK_PRIORITY_DEFAULT
471  *
472  * @since 1.1.0
473  */
474 typedef short Evas_Callback_Priority;
475
476 /**
477  * Flags for Mouse Button events
478  */
479 typedef enum _Evas_Button_Flags
480 {
481    EVAS_BUTTON_NONE = 0, /**< No extra mouse button data */
482    EVAS_BUTTON_DOUBLE_CLICK = (1 << 0), /**< This mouse button press was the 2nd press of a double click */
483    EVAS_BUTTON_TRIPLE_CLICK = (1 << 1) /**< This mouse button press was the 3rd press of a triple click */
484 } Evas_Button_Flags; /**< Flags for Mouse Button events */
485
486 /**
487  * Flags for Events
488  */
489 typedef enum _Evas_Event_Flags
490 {
491    EVAS_EVENT_FLAG_NONE = 0, /**< No fancy flags set */
492    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 */
493    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 */
494 } Evas_Event_Flags; /**< Flags for Events */
495
496 /**
497  * State of Evas_Coord_Touch_Point
498  */
499 typedef enum _Evas_Touch_Point_State
500 {
501    EVAS_TOUCH_POINT_DOWN, /**< Touch point is pressed down */
502    EVAS_TOUCH_POINT_UP, /**< Touch point is released */
503    EVAS_TOUCH_POINT_MOVE, /**< Touch point is moved */
504    EVAS_TOUCH_POINT_STILL, /**< Touch point is not moved after pressed */
505    EVAS_TOUCH_POINT_CANCEL /**< Touch point is cancelled */
506 } Evas_Touch_Point_State;
507
508 /**
509  * Flags for Font Hinting
510  * @ingroup Evas_Font_Group
511  */
512 typedef enum _Evas_Font_Hinting_Flags
513 {
514    EVAS_FONT_HINTING_NONE, /**< No font hinting */
515    EVAS_FONT_HINTING_AUTO, /**< Automatic font hinting */
516    EVAS_FONT_HINTING_BYTECODE /**< Bytecode font hinting */
517 } Evas_Font_Hinting_Flags; /**< Flags for Font Hinting */
518
519 /**
520  * Colorspaces for pixel data supported by Evas
521  * @ingroup Evas_Object_Image
522  */
523 typedef enum _Evas_Colorspace
524 {
525    EVAS_COLORSPACE_ARGB8888, /**< ARGB 32 bits per pixel, high-byte is Alpha, accessed 1 32bit word at a time */
526      /* these are not currently supported - but planned for the future */
527    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 */
528    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 */
529    EVAS_COLORSPACE_RGB565_A5P, /**< 16bit rgb565 + Alpha plane at end - 5 bits of the 8 being used per alpha byte */
530    EVAS_COLORSPACE_GRY8, /**< 8bit grayscale */
531    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 */
532    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. */
533    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. */
534 } Evas_Colorspace; /**< Colorspaces for pixel data supported by Evas */
535
536 /**
537  * How to pack items into cells in a table.
538  * @ingroup Evas_Object_Table
539  *
540  * @see evas_object_table_homogeneous_set() for an explanation of the function of
541  * each one.
542  */
543 typedef enum _Evas_Object_Table_Homogeneous_Mode
544 {
545   EVAS_OBJECT_TABLE_HOMOGENEOUS_NONE = 0,
546   EVAS_OBJECT_TABLE_HOMOGENEOUS_TABLE = 1,
547   EVAS_OBJECT_TABLE_HOMOGENEOUS_ITEM = 2
548 } Evas_Object_Table_Homogeneous_Mode; /**< Table cell pack mode. */
549
550 typedef struct _Evas_Coord_Rectangle  Evas_Coord_Rectangle; /**< A generic rectangle handle */
551 typedef struct _Evas_Point                   Evas_Point; /**< integer point */
552
553 typedef struct _Evas_Coord_Point             Evas_Coord_Point;  /**< Evas_Coord point */
554 typedef struct _Evas_Coord_Precision_Point   Evas_Coord_Precision_Point; /**< Evas_Coord point with sub-pixel precision */
555
556 typedef struct _Evas_Position                Evas_Position; /**< associates given point in Canvas and Output */
557 typedef struct _Evas_Precision_Position      Evas_Precision_Position; /**< associates given point in Canvas and Output, with sub-pixel precision */
558
559 /**
560  * @typedef Evas_Smart_Class
561  *
562  * A smart object's @b base class definition
563  *
564  * @ingroup Evas_Smart_Group
565  */
566 typedef struct _Evas_Smart_Class             Evas_Smart_Class;
567
568 /**
569  * @typedef Evas_Smart_Cb_Description
570  *
571  * A smart object callback description, used to provide introspection
572  *
573  * @ingroup Evas_Smart_Group
574  */
575 typedef struct _Evas_Smart_Cb_Description    Evas_Smart_Cb_Description;
576
577 /**
578  * @typedef Evas_Map
579  *
580  * An opaque handle to map points
581  *
582  * @see evas_map_new()
583  * @see evas_map_free()
584  * @see evas_map_dup()
585  *
586  * @ingroup Evas_Object_Group_Map
587  */
588 typedef struct _Evas_Map            Evas_Map;
589
590 /**
591  * @typedef Evas
592  *
593  * An opaque handle to an Evas canvas.
594  *
595  * @see evas_new()
596  * @see evas_free()
597  *
598  * @ingroup Evas_Canvas
599  */
600 typedef struct _Evas                Evas;
601
602 /**
603  * @typedef Evas_Object
604  * An Evas Object handle.
605  * @ingroup Evas_Object_Group
606  */
607 typedef struct _Evas_Object         Evas_Object;
608
609 typedef void                        Evas_Performance; /**< An Evas Performance handle */
610 typedef struct _Evas_Modifier       Evas_Modifier; /**< An opaque type containing information on which modifier keys are registered in an Evas canvas */
611 typedef struct _Evas_Lock           Evas_Lock; /**< An opaque type containing information on which lock keys are registered in an Evas canvas */
612 typedef struct _Evas_Smart          Evas_Smart; /**< An Evas Smart Object handle */
613 typedef struct _Evas_Native_Surface Evas_Native_Surface; /**< A generic datatype for engine specific native surface information */
614
615  /**
616   * @typedef Evas_Video_Surface
617   *
618   * A generic datatype for video specific surface information
619   * @see evas_object_image_video_surface_set
620   * @see evas_object_image_video_surface_get
621   * @since 1.1.0
622   */
623 typedef struct _Evas_Video_Surface  Evas_Video_Surface;
624
625 typedef unsigned long long          Evas_Modifier_Mask; /**< An Evas modifier mask type */
626
627 typedef int                         Evas_Coord;
628 typedef int                         Evas_Font_Size;
629 typedef int                         Evas_Angle;
630
631 struct _Evas_Coord_Rectangle /**< A rectangle in Evas_Coord */
632 {
633    Evas_Coord x; /**< top-left x co-ordinate of rectangle */
634    Evas_Coord y; /**< top-left y co-ordinate of rectangle */
635    Evas_Coord w; /**< width of rectangle */
636    Evas_Coord h; /**< height of rectangle */
637 };
638
639 struct _Evas_Point
640 {
641    int x, y;
642 };
643
644 struct _Evas_Coord_Point
645 {
646    Evas_Coord x, y;
647 };
648
649 struct _Evas_Coord_Precision_Point
650 {
651    Evas_Coord x, y;
652    double xsub, ysub;
653 };
654
655 struct _Evas_Position
656 {
657     Evas_Point output;
658     Evas_Coord_Point canvas;
659 };
660
661 struct _Evas_Precision_Position
662 {
663     Evas_Point output;
664     Evas_Coord_Precision_Point canvas;
665 };
666
667 typedef enum _Evas_Aspect_Control
668 {
669    EVAS_ASPECT_CONTROL_NONE = 0, /**< Preference on scaling unset */
670    EVAS_ASPECT_CONTROL_NEITHER = 1, /**< Same effect as unset preference on scaling */
671    EVAS_ASPECT_CONTROL_HORIZONTAL = 2, /**< Use all horizontal container space to place an object, using the given aspect */
672    EVAS_ASPECT_CONTROL_VERTICAL = 3, /**< Use all vertical container space to place an object, using the given aspect */
673    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 */
674 } Evas_Aspect_Control; /**< Aspect types/policies for scaling size hints, used for evas_object_size_hint_aspect_set() */
675
676 typedef struct _Evas_Pixel_Import_Source Evas_Pixel_Import_Source; /**< A source description of pixels for importing pixels */
677 typedef struct _Evas_Engine_Info      Evas_Engine_Info; /**< A generic Evas Engine information structure */
678 typedef struct _Evas_Device           Evas_Device; /**< A source device handle - where the event came from */
679 typedef struct _Evas_Event_Mouse_Down Evas_Event_Mouse_Down; /**< Event structure for #EVAS_CALLBACK_MOUSE_DOWN event callbacks */
680 typedef struct _Evas_Event_Mouse_Up   Evas_Event_Mouse_Up; /**< Event structure for #EVAS_CALLBACK_MOUSE_UP event callbacks */
681 typedef struct _Evas_Event_Mouse_In   Evas_Event_Mouse_In; /**< Event structure for #EVAS_CALLBACK_MOUSE_IN event callbacks */
682 typedef struct _Evas_Event_Mouse_Out  Evas_Event_Mouse_Out; /**< Event structure for #EVAS_CALLBACK_MOUSE_OUT event callbacks */
683 typedef struct _Evas_Event_Mouse_Move Evas_Event_Mouse_Move; /**< Event structure for #EVAS_CALLBACK_MOUSE_MOVE event callbacks */
684 typedef struct _Evas_Event_Mouse_Wheel Evas_Event_Mouse_Wheel; /**< Event structure for #EVAS_CALLBACK_MOUSE_WHEEL event callbacks */
685 typedef struct _Evas_Event_Multi_Down Evas_Event_Multi_Down; /**< Event structure for #EVAS_CALLBACK_MULTI_DOWN event callbacks */
686 typedef struct _Evas_Event_Multi_Up   Evas_Event_Multi_Up; /**< Event structure for #EVAS_CALLBACK_MULTI_UP event callbacks */
687 typedef struct _Evas_Event_Multi_Move Evas_Event_Multi_Move; /**< Event structure for #EVAS_CALLBACK_MULTI_MOVE event callbacks */
688 typedef struct _Evas_Event_Key_Down   Evas_Event_Key_Down; /**< Event structure for #EVAS_CALLBACK_KEY_DOWN event callbacks */
689 typedef struct _Evas_Event_Key_Up     Evas_Event_Key_Up; /**< Event structure for #EVAS_CALLBACK_KEY_UP event callbacks */
690 typedef struct _Evas_Event_Hold       Evas_Event_Hold; /**< Event structure for #EVAS_CALLBACK_HOLD event callbacks */
691
692 typedef enum _Evas_Load_Error
693 {
694    EVAS_LOAD_ERROR_NONE = 0, /**< No error on load */
695    EVAS_LOAD_ERROR_GENERIC = 1, /**< A non-specific error occurred */
696    EVAS_LOAD_ERROR_DOES_NOT_EXIST = 2, /**< File (or file path) does not exist */
697    EVAS_LOAD_ERROR_PERMISSION_DENIED = 3, /**< Permission denied to an existing file (or path) */
698    EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED = 4, /**< Allocation of resources failure prevented load */
699    EVAS_LOAD_ERROR_CORRUPT_FILE = 5, /**< File corrupt (but was detected as a known format) */
700    EVAS_LOAD_ERROR_UNKNOWN_FORMAT = 6 /**< File is not a known format */
701 } Evas_Load_Error; /**< Evas image load error codes one can get - see evas_load_error_str() too. */
702
703
704 typedef enum _Evas_Alloc_Error
705 {
706    EVAS_ALLOC_ERROR_NONE = 0, /**< No allocation error */
707    EVAS_ALLOC_ERROR_FATAL = 1, /**< Allocation failed despite attempts to free up memory */
708    EVAS_ALLOC_ERROR_RECOVERED = 2 /**< Allocation succeeded, but extra memory had to be found by freeing up speculative resources */
709 } Evas_Alloc_Error; /**< Possible allocation errors returned by evas_alloc_error() */
710
711 typedef enum _Evas_Fill_Spread
712 {
713    EVAS_TEXTURE_REFLECT = 0, /**< image fill tiling mode - tiling reflects */
714    EVAS_TEXTURE_REPEAT = 1, /**< tiling repeats */
715    EVAS_TEXTURE_RESTRICT = 2, /**< tiling clamps - range offset ignored */
716    EVAS_TEXTURE_RESTRICT_REFLECT = 3, /**< tiling clamps and any range offset reflects */
717    EVAS_TEXTURE_RESTRICT_REPEAT = 4, /**< tiling clamps and any range offset repeats */
718    EVAS_TEXTURE_PAD = 5 /**< tiling extends with end values */
719 } Evas_Fill_Spread; /**< Fill types used for evas_object_image_fill_spread_set() */
720
721 typedef enum _Evas_Pixel_Import_Pixel_Format
722 {
723    EVAS_PIXEL_FORMAT_NONE = 0, /**< No pixel format */
724    EVAS_PIXEL_FORMAT_ARGB32 = 1, /**< ARGB 32bit pixel format with A in the high byte per 32bit pixel word */
725    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 */
726 } Evas_Pixel_Import_Pixel_Format; /**< Pixel format for import call. See evas_object_image_pixels_import() */
727
728 struct _Evas_Pixel_Import_Source
729 {
730    Evas_Pixel_Import_Pixel_Format format; /**< pixel format type ie ARGB32, YUV420P_601 etc. */
731    int w, h; /**< width and height of source in pixels */
732    void **rows; /**< an array of pointers (size depends on format) pointing to left edge of each scanline */
733 };
734
735 /* magic version number to know what the native surf struct looks like */
736 #define EVAS_NATIVE_SURFACE_VERSION 2
737
738 typedef enum _Evas_Native_Surface_Type
739 {
740    EVAS_NATIVE_SURFACE_NONE,
741    EVAS_NATIVE_SURFACE_X11,
742    EVAS_NATIVE_SURFACE_OPENGL
743 } Evas_Native_Surface_Type;
744
745 struct _Evas_Native_Surface
746 {
747    int                         version;
748    Evas_Native_Surface_Type    type;
749    union {
750      struct {
751        void          *visual; /**< visual of the pixmap to use (Visual) */
752        unsigned long  pixmap; /**< pixmap id to use (Pixmap) */
753      } x11;
754      struct {
755        unsigned int   texture_id; /**< opengl texture id to use from glGenTextures() */
756        unsigned int   framebuffer_id; /**< 0 if not a FBO, FBO id otherwise from glGenFramebuffers() */
757        unsigned int   internal_format; /**< same as 'internalFormat' for glTexImage2D() */
758        unsigned int   format; /**< same as 'format' for glTexImage2D() */
759        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) */
760      } opengl;
761    } data;
762 };
763
764 /**
765  * @def EVAS_VIDEO_SURFACE_VERSION
766  * Magic version number to know what the video surf struct looks like
767  * @since 1.1.0
768  */
769 #define EVAS_VIDEO_SURFACE_VERSION 1
770
771 typedef void (*Evas_Video_Cb)(void *data, Evas_Object *obj, const Evas_Video_Surface *surface);
772 typedef void (*Evas_Video_Coord_Cb)(void *data, Evas_Object *obj, const Evas_Video_Surface *surface, Evas_Coord a, Evas_Coord b);
773
774 struct _Evas_Video_Surface
775 {
776    int version;
777
778    Evas_Video_Coord_Cb move; /**< Move the video surface to this position */
779    Evas_Video_Coord_Cb resize; /**< Resize the video surface to that size */
780    Evas_Video_Cb show; /**< Show the video overlay surface */
781    Evas_Video_Cb hide; /**< Hide the video overlay surface */
782    Evas_Video_Cb update_pixels; /**< Please update the Evas_Object_Image pixels when called */
783
784    Evas_Object   *parent;
785    void          *data;
786 };
787
788 #define EVAS_LAYER_MIN -32768 /**< bottom-most layer number */
789 #define EVAS_LAYER_MAX 32767  /**< top-most layer number */
790
791 #define EVAS_COLOR_SPACE_ARGB 0 /**< Not used for anything */
792 #define EVAS_COLOR_SPACE_AHSV 1 /**< Not used for anything */
793 #define EVAS_TEXT_INVALID -1 /**< Not used for anything */
794 #define EVAS_TEXT_SPECIAL -2 /**< Not used for anything */
795
796 #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() */
797 #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() */
798 #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) */
799 #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) */
800 #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 */
801 #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 */
802
803 /**
804  * How the object should be rendered to output.
805  * @ingroup Evas_Object_Group_Extras
806  */
807 typedef enum _Evas_Render_Op
808 {
809    EVAS_RENDER_BLEND = 0, /**< default op: d = d*(1-sa) + s */
810    EVAS_RENDER_BLEND_REL = 1, /**< d = d*(1 - sa) + s*da */
811    EVAS_RENDER_COPY = 2, /**< d = s */
812    EVAS_RENDER_COPY_REL = 3, /**< d = s*da */
813    EVAS_RENDER_ADD = 4, /* d = d + s */
814    EVAS_RENDER_ADD_REL = 5, /**< d = d + s*da */
815    EVAS_RENDER_SUB = 6, /**< d = d - s */
816    EVAS_RENDER_SUB_REL = 7, /* d = d - s*da */
817    EVAS_RENDER_TINT = 8, /**< d = d*s + d*(1 - sa) + s*(1 - da) */
818    EVAS_RENDER_TINT_REL = 9, /**< d = d*(1 - sa + s) */
819    EVAS_RENDER_MASK = 10, /**< d = d*sa */
820    EVAS_RENDER_MUL = 11 /**< d = d*s */
821 } Evas_Render_Op; /**< How the object should be rendered to output. */
822
823 typedef enum _Evas_Border_Fill_Mode
824 {
825    EVAS_BORDER_FILL_NONE = 0, /**< Image's center region is @b not to be rendered */
826    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 */
827    EVAS_BORDER_FILL_SOLID = 2 /**< Image's center region is to be made solid, even if it has transparency on it */
828 } Evas_Border_Fill_Mode; /**< How an image's center region (the complement to the border region) should be rendered by Evas */
829
830 typedef enum _Evas_Image_Scale_Hint
831 {
832    EVAS_IMAGE_SCALE_HINT_NONE = 0, /**< No scale hint at all */
833    EVAS_IMAGE_SCALE_HINT_DYNAMIC = 1, /**< Image is being re-scaled over time, thus turning scaling cache @b off for its data */
834    EVAS_IMAGE_SCALE_HINT_STATIC = 2 /**< Image is not being re-scaled over time, thus turning scaling cache @b on for its data */
835 } Evas_Image_Scale_Hint; /**< How an image's data is to be treated by Evas, with regard to scaling cache */
836
837 typedef enum _Evas_Image_Animated_Loop_Hint
838 {
839    EVAS_IMAGE_ANIMATED_HINT_NONE = 0,
840    EVAS_IMAGE_ANIMATED_HINT_LOOP = 1, /**< Image's animation mode is loop like 1->2->3->1->2->3 */
841    EVAS_IMAGE_ANIMATED_HINT_PINGPONG = 2 /**< Image's animation mode is pingpong like 1->2->3->2->1-> ... */
842 } Evas_Image_Animated_Loop_Hint;
843
844 typedef enum _Evas_Engine_Render_Mode
845 {
846    EVAS_RENDER_MODE_BLOCKING = 0,
847    EVAS_RENDER_MODE_NONBLOCKING = 1,
848 } Evas_Engine_Render_Mode;
849
850 typedef enum _Evas_Image_Content_Hint
851 {
852    EVAS_IMAGE_CONTENT_HINT_NONE = 0, /**< No hint at all */
853    EVAS_IMAGE_CONTENT_HINT_DYNAMIC = 1, /**< The contents will change over time */
854    EVAS_IMAGE_CONTENT_HINT_STATIC = 2 /**< The contents won't change over time */
855 } Evas_Image_Content_Hint; /**< How an image's data is to be treated by Evas, for optimization */
856
857 struct _Evas_Engine_Info /** Generic engine information. Generic info is useless */
858 {
859    int magic; /**< Magic number */
860 };
861
862 struct _Evas_Event_Mouse_Down /** Mouse button press event */
863 {
864    int button; /**< Mouse button number that went down (1 - 32) */
865
866    Evas_Point output; /**< The X/Y location of the cursor */
867    Evas_Coord_Point canvas; /**< The X/Y location of the cursor */
868
869    void          *data;
870    Evas_Modifier *modifiers; /**< modifier keys pressed during the event */
871    Evas_Lock     *locks;
872
873    Evas_Button_Flags flags; /**< button flags set during the event */
874    unsigned int      timestamp;
875    Evas_Event_Flags  event_flags;
876    Evas_Device      *dev;
877 };
878
879 struct _Evas_Event_Mouse_Up /** Mouse button release event */
880 {
881    int button; /**< Mouse button number that was raised (1 - 32) */
882
883    Evas_Point output;
884    Evas_Coord_Point canvas;
885
886    void          *data;
887    Evas_Modifier *modifiers;
888    Evas_Lock     *locks;
889
890    Evas_Button_Flags flags;
891    unsigned int      timestamp;
892    Evas_Event_Flags  event_flags;
893    Evas_Device      *dev;
894 };
895
896 struct _Evas_Event_Mouse_In /** Mouse enter event */
897 {
898    int buttons; /**< Button pressed mask, Bits set to 1 are buttons currently pressed (bit 0 = mouse button 1, bit 1 = mouse button 2 etc.) */
899
900    Evas_Point output;
901    Evas_Coord_Point canvas;
902
903    void          *data;
904    Evas_Modifier *modifiers;
905    Evas_Lock     *locks;
906    unsigned int   timestamp;
907    Evas_Event_Flags  event_flags;
908    Evas_Device      *dev;
909 };
910
911 struct _Evas_Event_Mouse_Out /** Mouse leave event */
912 {
913    int buttons; /**< Button pressed mask, Bits set to 1 are buttons currently pressed (bit 0 = mouse button 1, bit 1 = mouse button 2 etc.) */
914
915
916    Evas_Point output;
917    Evas_Coord_Point canvas;
918
919    void          *data;
920    Evas_Modifier *modifiers;
921    Evas_Lock     *locks;
922    unsigned int   timestamp;
923    Evas_Event_Flags  event_flags;
924    Evas_Device      *dev;
925 };
926
927 struct _Evas_Event_Mouse_Move /** Mouse button down event */
928 {
929    int buttons; /**< Button pressed mask, Bits set to 1 are buttons currently pressed (bit 0 = mouse button 1, bit 1 = mouse button 2 etc.) */
930
931    Evas_Position cur, prev;
932
933    void          *data;
934    Evas_Modifier *modifiers;
935    Evas_Lock     *locks;
936    unsigned int   timestamp;
937    Evas_Event_Flags  event_flags;
938    Evas_Device      *dev;
939 };
940
941 struct _Evas_Event_Mouse_Wheel /** Wheel event */
942 {
943    int direction; /* 0 = default up/down wheel FIXME: more wheel types */
944    int z; /* ...,-2,-1 = down, 1,2,... = up */
945
946    Evas_Point output;
947    Evas_Coord_Point canvas;
948
949    void          *data;
950    Evas_Modifier *modifiers;
951    Evas_Lock     *locks;
952    unsigned int   timestamp;
953    Evas_Event_Flags  event_flags;
954    Evas_Device      *dev;
955 };
956
957 struct _Evas_Event_Multi_Down /** Multi button press event */
958 {
959    int device; /**< Multi device number that went down (1 or more for extra touches) */
960    double radius, radius_x, radius_y;
961    double pressure, angle;
962
963    Evas_Point output;
964    Evas_Coord_Precision_Point canvas;
965
966    void          *data;
967    Evas_Modifier *modifiers;
968    Evas_Lock     *locks;
969
970    Evas_Button_Flags flags;
971    unsigned int      timestamp;
972    Evas_Event_Flags  event_flags;
973    Evas_Device      *dev;
974 };
975
976 struct _Evas_Event_Multi_Up /** Multi button release event */
977 {
978    int device; /**< Multi device number that went up (1 or more for extra touches) */
979    double radius, radius_x, radius_y;
980    double pressure, angle;
981
982    Evas_Point output;
983    Evas_Coord_Precision_Point canvas;
984
985    void          *data;
986    Evas_Modifier *modifiers;
987    Evas_Lock     *locks;
988
989    Evas_Button_Flags flags;
990    unsigned int      timestamp;
991    Evas_Event_Flags  event_flags;
992    Evas_Device      *dev;
993 };
994
995 struct _Evas_Event_Multi_Move /** Multi button down event */
996 {
997    int device; /**< Multi device number that moved (1 or more for extra touches) */
998    double radius, radius_x, radius_y;
999    double pressure, angle;
1000
1001    Evas_Precision_Position cur;
1002
1003    void          *data;
1004    Evas_Modifier *modifiers;
1005    Evas_Lock     *locks;
1006    unsigned int   timestamp;
1007    Evas_Event_Flags  event_flags;
1008    Evas_Device      *dev;
1009 };
1010
1011 struct _Evas_Event_Key_Down /** Key press event */
1012 {
1013    char          *keyname; /**< the name string of the key pressed */
1014    void          *data;
1015    Evas_Modifier *modifiers;
1016    Evas_Lock     *locks;
1017
1018    const char    *key; /**< The logical key : (eg shift+1 == exclamation) */
1019    const char    *string; /**< A UTF8 string if this keystroke has produced a visible string to be ADDED */
1020    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 */
1021    unsigned int   timestamp;
1022    Evas_Event_Flags  event_flags;
1023    Evas_Device      *dev;
1024 };
1025
1026 struct _Evas_Event_Key_Up /** Key release event */
1027 {
1028    char          *keyname; /**< the name string of the key released */
1029    void          *data;
1030    Evas_Modifier *modifiers;
1031    Evas_Lock     *locks;
1032
1033    const char    *key; /**< The logical key : (eg shift+1 == exclamation) */
1034    const char    *string; /**< A UTF8 string if this keystroke has produced a visible string to be ADDED */
1035    const char    *compose; /**< A UTF8 string if this keystroke has modified a string in the middle of being composed - this string replaces the previous one */
1036    unsigned int   timestamp;
1037    Evas_Event_Flags  event_flags;
1038    Evas_Device      *dev;
1039 };
1040
1041 struct _Evas_Event_Hold /** Hold change event */
1042 {
1043    int            hold; /**< The hold flag */
1044    void          *data;
1045
1046    unsigned int   timestamp;
1047    Evas_Event_Flags  event_flags;
1048    Evas_Device      *dev;
1049 };
1050
1051 /**
1052  * How the mouse pointer should be handled by Evas.
1053  *
1054  * In the mode #EVAS_OBJECT_POINTER_MODE_AUTOGRAB, when a mouse button
1055  * is pressed down over an object and held, with the mouse pointer
1056  * being moved outside of it, the pointer still behaves as being bound
1057  * to that object, albeit out of its drawing region. When the button
1058  * is released, the event will be fed to the object, that may check if
1059  * the final position is over it or not and do something about it.
1060  *
1061  * In the mode #EVAS_OBJECT_POINTER_MODE_NOGRAB, the pointer will
1062  * always be bound to the object right below it.
1063  *
1064  * @ingroup Evas_Object_Group_Extras
1065  */
1066 typedef enum _Evas_Object_Pointer_Mode
1067 {
1068    EVAS_OBJECT_POINTER_MODE_AUTOGRAB, /**< default, X11-like */
1069    EVAS_OBJECT_POINTER_MODE_NOGRAB, /**< pointer always bound to the object right below it */
1070    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 */
1071 } Evas_Object_Pointer_Mode; /**< How the mouse pointer should be handled by Evas. */
1072
1073 typedef void      (*Evas_Smart_Cb) (void *data, Evas_Object *obj, void *event_info); /**< Evas smart objects' "smart callback" function signature */
1074 typedef void      (*Evas_Event_Cb) (void *data, Evas *e, void *event_info); /**< Evas event callback function signature */
1075 typedef Eina_Bool (*Evas_Object_Event_Post_Cb) (void *data, Evas *e);
1076 typedef void      (*Evas_Object_Event_Cb) (void *data, Evas *e, Evas_Object *obj, void *event_info); /**< Evas object event callback function signature */
1077 typedef void      (*Evas_Async_Events_Put_Cb)(void *target, Evas_Callback_Type type, void *event_info);
1078
1079 /**
1080  * @defgroup Evas_Group Top Level Functions
1081  *
1082  * Functions that affect Evas as a whole.
1083  */
1084
1085 /**
1086  * Initialize Evas
1087  *
1088  * @return The init counter value.
1089  *
1090  * This function initializes Evas and increments a counter of the
1091  * number of calls to it. It returns the new counter's value.
1092  *
1093  * @see evas_shutdown().
1094  *
1095  * Most EFL users wouldn't be using this function directly, because
1096  * they wouldn't access Evas directly by themselves. Instead, they
1097  * would be using higher level helpers, like @c ecore_evas_init().
1098  * See http://docs.enlightenment.org/auto/ecore/.
1099  *
1100  * You should be using this if your use is something like the
1101  * following. The buffer engine is just one of the many ones Evas
1102  * provides.
1103  *
1104  * @dontinclude evas-buffer-simple.c
1105  * @skip int main
1106  * @until return -1;
1107  * And being the canvas creation something like:
1108  * @skip static Evas *create_canvas
1109  * @until    evas_output_viewport_set(canvas,
1110  *
1111  * Note that this is code creating an Evas canvas with no usage of
1112  * Ecore helpers at all -- no linkage with Ecore on this scenario,
1113  * thus. Again, this wouldn't be on Evas common usage for most
1114  * developers. See the full @ref Example_Evas_Buffer_Simple "example".
1115  *
1116  * @ingroup Evas_Group
1117  */
1118 EAPI int               evas_init                         (void);
1119
1120 /**
1121  * Shutdown Evas
1122  *
1123  * @return Evas' init counter value.
1124  *
1125  * This function finalizes Evas, decrementing the counter of the
1126  * number of calls to the function evas_init(). This new value for the
1127  * counter is returned.
1128  *
1129  * @see evas_init().
1130  *
1131  * If you were the sole user of Evas, by means of evas_init(), you can
1132  * check if it's being properly shut down by expecting a return value
1133  * of 0.
1134  *
1135  * Example code follows.
1136  * @dontinclude evas-buffer-simple.c
1137  * @skip // NOTE: use ecore_evas_buffer_new
1138  * @until evas_shutdown
1139  * Where that function would contain:
1140  * @skip   evas_free(canvas)
1141  * @until   evas_free(canvas)
1142  *
1143  * Most users would be using ecore_evas_shutdown() instead, like told
1144  * in evas_init(). See the full @ref Example_Evas_Buffer_Simple
1145  * "example".
1146  *
1147  * @ingroup Evas_Group
1148  */
1149 EAPI int               evas_shutdown                     (void);
1150
1151
1152 /**
1153  * Return if any allocation errors have occurred during the prior function
1154  * @return The allocation error flag
1155  *
1156  * This function will return if any memory allocation errors occurred during,
1157  * and what kind they were. The return value will be one of
1158  * EVAS_ALLOC_ERROR_NONE, EVAS_ALLOC_ERROR_FATAL or EVAS_ALLOC_ERROR_RECOVERED
1159  * with each meaning something different.
1160  *
1161  * EVAS_ALLOC_ERROR_NONE means that no errors occurred at all and the function
1162  * worked as expected.
1163  *
1164  * EVAS_ALLOC_ERROR_FATAL means the function was completely unable to perform
1165  * its job and will  have  exited as cleanly as possible. The programmer
1166  * should consider this as a sign of very low memory and should try and safely
1167  * recover from the prior functions failure (or try free up memory elsewhere
1168  * and try again after more memory is freed).
1169  *
1170  * EVAS_ALLOC_ERROR_RECOVERED means that an allocation error occurred, but was
1171  * recovered from by evas finding memory of its own it has allocated and
1172  * freeing what it sees as not really usefully allocated memory. What is freed
1173  * may vary. Evas may reduce the resolution of images, free cached images or
1174  * fonts, trhow out pre-rendered data, reduce the complexity of change lists
1175  * etc. Evas and the program will function as per normal after this, but this
1176  * is a sign of low memory, and it is suggested that the program try and
1177  * identify memory it doesn't need, and free it.
1178  *
1179  * Example:
1180  * @code
1181  * extern Evas_Object *object;
1182  * void callback (void *data, Evas *e, Evas_Object *obj, void *event_info);
1183  *
1184  * evas_object_event_callback_add(object, EVAS_CALLBACK_MOUSE_DOWN, callback, NULL);
1185  * if (evas_alloc_error() == EVAS_ALLOC_ERROR_FATAL)
1186  *   {
1187  *     fprintf(stderr, "ERROR: Completely unable to attach callback. Must\n");
1188  *     fprintf(stderr, "       destroy object now as it cannot be used.\n");
1189  *     evas_object_del(object);
1190  *     object = NULL;
1191  *     fprintf(stderr, "WARNING: Memory is really low. Cleaning out RAM.\n");
1192  *     my_memory_cleanup();
1193  *   }
1194  * if (evas_alloc_error() == EVAS_ALLOC_ERROR_RECOVERED)
1195  *   {
1196  *     fprintf(stderr, "WARNING: Memory is really low. Cleaning out RAM.\n");
1197  *     my_memory_cleanup();
1198  *   }
1199  * @endcode
1200  *
1201  * @ingroup Evas_Group
1202  */
1203 EAPI Evas_Alloc_Error  evas_alloc_error                  (void);
1204
1205
1206 /**
1207  * @brief Get evas' internal asynchronous events read file descriptor.
1208  *
1209  * @return The canvas' asynchronous events read file descriptor.
1210  *
1211  * Evas' asynchronous events are meant to be dealt with internally,
1212  * i. e., when building stuff to be glued together into the EFL
1213  * infrastructure -- a module, for example. The context which demands
1214  * its use is when calculations need to be done out of the main
1215  * thread, asynchronously, and some action must be performed after
1216  * that.
1217  *
1218  * An example of actual use of this API is for image asynchronous
1219  * preload inside evas. If the canvas was instantiated through
1220  * ecore-evas usage, ecore itself will take care of calling those
1221  * events' processing.
1222  *
1223  * This function returns the read file descriptor where to get the
1224  * asynchronous events of the canvas. Naturally, other mainloops,
1225  * apart from ecore, may make use of it.
1226  *
1227  * @ingroup Evas_Group
1228  */
1229 EAPI int               evas_async_events_fd_get          (void) EINA_WARN_UNUSED_RESULT;
1230
1231 /**
1232  * @brief Trigger the processing of all events waiting on the file
1233  * descriptor returned by evas_async_events_fd_get().
1234  *
1235  * @return The number of events processed.
1236  *
1237  * All asynchronous events queued up by evas_async_events_put() are
1238  * processed here. More precisely, the callback functions, informed
1239  * together with other event parameters, when queued, get called (with
1240  * those parameters), in that order.
1241  *
1242  * @ingroup Evas_Group
1243  */
1244 EAPI int               evas_async_events_process         (void);
1245
1246 /**
1247 * Insert asynchronous events on the canvas.
1248  *
1249  * @param target The target to be affected by the events.
1250  * @param type The type of callback function.
1251  * @param event_info Information about the event.
1252  * @param func The callback function pointer.
1253  *
1254  * This is the way, for a routine running outside evas' main thread,
1255  * to report an asynchronous event. A callback function is informed,
1256  * whose call is to happen after evas_async_events_process() is
1257  * called.
1258  *
1259  * @ingroup Evas_Group
1260  */
1261 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);
1262
1263 /**
1264  * @defgroup Evas_Canvas Canvas Functions
1265  *
1266  * Low level Evas canvas functions. Sub groups will present more high
1267  * level ones, though.
1268  *
1269  * Most of these functions deal with low level Evas actions, like:
1270  * @li create/destroy raw canvases, not bound to any displaying engine
1271  * @li tell a canvas i got focused (in a windowing context, for example)
1272  * @li tell a canvas a region should not be calculated anymore in rendering
1273  * @li tell a canvas to render its contents, immediately
1274  *
1275  * Most users will be using Evas by means of the @c Ecore_Evas
1276  * wrapper, which deals with all the above mentioned issues
1277  * automatically for them. Thus, you'll be looking at this section
1278  * only if you're building low level stuff.
1279  *
1280  * The groups within present you functions that deal with the canvas
1281  * directly, too, and not yet with its @b objects. They are the
1282  * functions you need to use at a minimum to get a working canvas.
1283  *
1284  * Some of the functions in this group are exemplified @ref
1285  * Example_Evas_Events "here".
1286  */
1287
1288 /**
1289  * Creates a new empty evas.
1290  *
1291  * Note that before you can use the evas, you will to at a minimum:
1292  * @li Set its render method with @ref evas_output_method_set .
1293  * @li Set its viewport size with @ref evas_output_viewport_set .
1294  * @li Set its size of the canvas with @ref evas_output_size_set .
1295  * @li Ensure that the render engine is given the correct settings
1296  *     with @ref evas_engine_info_set .
1297  *
1298  * This function should only fail if the memory allocation fails
1299  *
1300  * @note this function is very low level. Instead of using it
1301  *       directly, consider using the high level functions in
1302  *       Ecore_Evas such as @c ecore_evas_new(). See
1303  *       http://docs.enlightenment.org/auto/ecore/.
1304  *
1305  * @attention it is recommended that one calls evas_init() before
1306  *       creating new canvas.
1307  *
1308  * @return A new uninitialised Evas canvas on success.  Otherwise, @c
1309  * NULL.
1310  * @ingroup Evas_Canvas
1311  */
1312 EAPI Evas             *evas_new                          (void) EINA_WARN_UNUSED_RESULT EINA_MALLOC;
1313
1314 /**
1315  * Frees the given evas and any objects created on it.
1316  *
1317  * Any objects with 'free' callbacks will have those callbacks called
1318  * in this function.
1319  *
1320  * @param   e The given evas.
1321  *
1322  * @ingroup Evas_Canvas
1323  */
1324 EAPI void              evas_free                         (Evas *e)  EINA_ARG_NONNULL(1);
1325
1326 /**
1327  * Inform to the evas that it got the focus.
1328  *
1329  * @param e The evas to change information.
1330  * @ingroup Evas_Canvas
1331  */
1332 EAPI void              evas_focus_in                     (Evas *e);
1333
1334 /**
1335  * Inform to the evas that it lost the focus.
1336  *
1337  * @param e The evas to change information.
1338  * @ingroup Evas_Canvas
1339  */
1340 EAPI void              evas_focus_out                    (Evas *e);
1341
1342 /**
1343  * Get the focus state known by the given evas
1344  *
1345  * @param e The evas to query information.
1346  * @ingroup Evas_Canvas
1347  */
1348 EAPI Eina_Bool         evas_focus_state_get              (const Evas *e);
1349
1350 /**
1351  * Push the nochange flag up 1
1352  *
1353  * This tells evas, that while the nochange flag is greater than 0, do not
1354  * mark objects as "changed" when making changes.
1355  *
1356  * @param e The evas to change information.
1357  * @ingroup Evas_Canvas
1358  */
1359 EAPI void              evas_nochange_push                (Evas *e);
1360
1361 /**
1362  * Pop the nochange flag down 1
1363  *
1364  * This tells evas, that while the nochange flag is greater than 0, do not
1365  * mark objects as "changed" when making changes.
1366  *
1367  * @param e The evas to change information.
1368  * @ingroup Evas_Canvas
1369  */
1370 EAPI void              evas_nochange_pop                 (Evas *e);
1371
1372
1373 /**
1374  * Attaches a specific pointer to the evas for fetching later
1375  *
1376  * @param e The canvas to attach the pointer to
1377  * @param data The pointer to attach
1378  * @ingroup Evas_Canvas
1379  */
1380 EAPI void              evas_data_attach_set              (Evas *e, void *data) EINA_ARG_NONNULL(1);
1381
1382 /**
1383  * Returns the pointer attached by evas_data_attach_set()
1384  *
1385  * @param e The canvas to attach the pointer to
1386  * @return The pointer attached
1387  * @ingroup Evas_Canvas
1388  */
1389 EAPI void             *evas_data_attach_get              (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
1390
1391
1392 /**
1393  * Add a damage rectangle.
1394  *
1395  * @param e The given canvas pointer.
1396  * @param x The rectangle's left position.
1397  * @param y The rectangle's top position.
1398  * @param w The rectangle's width.
1399  * @param h The rectangle's height.
1400  *
1401  * This is the function by which one tells evas that a part of the
1402  * canvas has to be repainted.
1403  *
1404  * @ingroup Evas_Canvas
1405  */
1406 EAPI void              evas_damage_rectangle_add         (Evas *e, int x, int y, int w, int h) EINA_ARG_NONNULL(1);
1407
1408 /**
1409  * Add an "obscured region" to an Evas canvas.
1410  *
1411  * @param e The given canvas pointer.
1412  * @param x The rectangle's top left corner's horizontal coordinate.
1413  * @param y The rectangle's top left corner's vertical coordinate
1414  * @param w The rectangle's width.
1415  * @param h The rectangle's height.
1416  *
1417  * This is the function by which one tells an Evas canvas that a part
1418  * of it <b>must not</b> be repainted. The region must be
1419  * rectangular and its coordinates inside the canvas viewport are
1420  * passed in the call. After this call, the region specified won't
1421  * participate in any form in Evas' calculations and actions during
1422  * its rendering updates, having its displaying content frozen as it
1423  * was just after this function took place.
1424  *
1425  * We call it "obscured region" because the most common use case for
1426  * this rendering (partial) freeze is something else (most probably
1427  * other canvas) being on top of the specified rectangular region,
1428  * thus shading it completely from the user's final scene in a
1429  * display. To avoid unnecessary processing, one should indicate to the
1430  * obscured canvas not to bother about the non-important area.
1431  *
1432  * The majority of users won't have to worry about this function, as
1433  * they'll be using just one canvas in their applications, with
1434  * nothing inset or on top of it in any form.
1435  *
1436  * To make this region one that @b has to be repainted again, call the
1437  * function evas_obscured_clear().
1438  *
1439  * @note This is a <b>very low level function</b>, which most of
1440  * Evas' users wouldn't care about.
1441  *
1442  * @note This function does @b not flag the canvas as having its state
1443  * changed. If you want to re-render it afterwards expecting new
1444  * contents, you have to add "damage" regions yourself (see
1445  * evas_damage_rectangle_add()).
1446  *
1447  * @see evas_obscured_clear()
1448  * @see evas_render_updates()
1449  *
1450  * Example code follows.
1451  * @dontinclude evas-events.c
1452  * @skip add an obscured
1453  * @until evas_obscured_clear(evas);
1454  *
1455  * In that example, pressing the "Ctrl" and "o" keys will impose or
1456  * remove an obscured region in the middle of the canvas. You'll get
1457  * the same contents at the time the key was pressed, if toggling it
1458  * on, until you toggle it off again (make sure the animation is
1459  * running on to get the idea better). See the full @ref
1460  * Example_Evas_Events "example".
1461  *
1462  * @ingroup Evas_Canvas
1463  */
1464 EAPI void              evas_obscured_rectangle_add       (Evas *e, int x, int y, int w, int h) EINA_ARG_NONNULL(1);
1465
1466 /**
1467  * Remove all "obscured regions" from an Evas canvas.
1468  *
1469  * @param e The given canvas pointer.
1470  *
1471  * This function removes all the rectangles from the obscured regions
1472  * list of the canvas @p e. It takes obscured areas added with
1473  * evas_obscured_rectangle_add() and make them again a regions that @b
1474  * have to be repainted on rendering updates.
1475  *
1476  * @note This is a <b>very low level function</b>, which most of
1477  * Evas' users wouldn't care about.
1478  *
1479  * @note This function does @b not flag the canvas as having its state
1480  * changed. If you want to re-render it afterwards expecting new
1481  * contents, you have to add "damage" regions yourself (see
1482  * evas_damage_rectangle_add()).
1483  *
1484  * @see evas_obscured_rectangle_add() for an example
1485  * @see evas_render_updates()
1486  *
1487  * @ingroup Evas_Canvas
1488  */
1489 EAPI void              evas_obscured_clear               (Evas *e) EINA_ARG_NONNULL(1);
1490
1491 /**
1492  * Force immediate renderization of the given Evas canvas.
1493  *
1494  * @param e The given canvas pointer.
1495  * @return A newly allocated list of updated rectangles of the canvas
1496  *        (@c Eina_Rectangle structs). Free this list with
1497  *        evas_render_updates_free().
1498  *
1499  * This function forces an immediate renderization update of the given
1500  * canvas @p e.
1501  *
1502  * @note This is a <b>very low level function</b>, which most of
1503  * Evas' users wouldn't care about. One would use it, for example, to
1504  * grab an Evas' canvas update regions and paint them back, using the
1505  * canvas' pixmap, on a displaying system working below Evas.
1506  *
1507  * @note Evas is a stateful canvas. If no operations changing its
1508  * state took place since the last rendering action, you won't see no
1509  * changes and this call will be a no-op.
1510  *
1511  * Example code follows.
1512  * @dontinclude evas-events.c
1513  * @skip add an obscured
1514  * @until d.obscured = !d.obscured;
1515  *
1516  * See the full @ref Example_Evas_Events "example".
1517  *
1518  * @ingroup Evas_Canvas
1519  */
1520 EAPI Eina_List        *evas_render_updates               (Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
1521
1522 /**
1523  * Free the rectangles returned by evas_render_updates().
1524  *
1525  * @param updates The list of updated rectangles of the canvas.
1526  *
1527  * This function removes the region from the render updates list. It
1528  * makes the region doesn't be render updated anymore.
1529  *
1530  * @see evas_render_updates() for an example
1531  *
1532  * @ingroup Evas_Canvas
1533  */
1534 EAPI void              evas_render_updates_free          (Eina_List *updates);
1535
1536 /**
1537  * Force renderization of the given canvas.
1538  *
1539  * @param e The given canvas pointer.
1540  *
1541  * @ingroup Evas_Canvas
1542  */
1543 EAPI void              evas_render                       (Evas *e) EINA_ARG_NONNULL(1);
1544
1545 /**
1546  * Update the canvas internal objects but not triggering immediate
1547  * renderization.
1548  *
1549  * @param e The given canvas pointer.
1550  *
1551  * This function updates the canvas internal objects not triggering
1552  * renderization. To force renderization function evas_render() should
1553  * be used.
1554  *
1555  * @see evas_render.
1556  *
1557  * @ingroup Evas_Canvas
1558  */
1559 EAPI void              evas_norender                     (Evas *e) EINA_ARG_NONNULL(1);
1560
1561 /**
1562  * Make the canvas discard internally cached data used for rendering.
1563  *
1564  * @param e The given canvas pointer.
1565  *
1566  * This function flushes the arrays of delete, active and render objects.
1567  * Other things it may also discard are: shared memory segments,
1568  * temporary scratch buffers, cached data to avoid re-compute of that data etc.
1569  *
1570  * @ingroup Evas_Canvas
1571  */
1572 EAPI void              evas_render_idle_flush            (Evas *e) EINA_ARG_NONNULL(1);
1573
1574 /**
1575  * Make the canvas discard as much data as possible used by the engine at
1576  * runtime.
1577  *
1578  * @param e The given canvas pointer.
1579  *
1580  * This function will unload images, delete textures and much more, where
1581  * possible. You may also want to call evas_render_idle_flush() immediately
1582  * prior to this to perhaps discard a little more, though evas_render_dump()
1583  * should implicitly delete most of what evas_render_idle_flush() might
1584  * discard too.
1585  *
1586  * @ingroup Evas_Canvas
1587  */
1588 EAPI void              evas_render_dump                  (Evas *e) EINA_ARG_NONNULL(1);
1589
1590 /**
1591  * @defgroup Evas_Output_Method Render Engine Functions
1592  *
1593  * Functions that are used to set the render engine for a given
1594  * function, and then get that engine working.
1595  *
1596  * The following code snippet shows how they can be used to
1597  * initialise an evas that uses the X11 software engine:
1598  * @code
1599  * Evas *evas;
1600  * Evas_Engine_Info_Software_X11 *einfo;
1601  * extern Display *display;
1602  * extern Window win;
1603  *
1604  * evas_init();
1605  *
1606  * evas = evas_new();
1607  * evas_output_method_set(evas, evas_render_method_lookup("software_x11"));
1608  * evas_output_size_set(evas, 640, 480);
1609  * evas_output_viewport_set(evas, 0, 0, 640, 480);
1610  * einfo = (Evas_Engine_Info_Software_X11 *)evas_engine_info_get(evas);
1611  * einfo->info.display = display;
1612  * einfo->info.visual = DefaultVisual(display, DefaultScreen(display));
1613  * einfo->info.colormap = DefaultColormap(display, DefaultScreen(display));
1614  * einfo->info.drawable = win;
1615  * einfo->info.depth = DefaultDepth(display, DefaultScreen(display));
1616  * evas_engine_info_set(evas, (Evas_Engine_Info *)einfo);
1617  * @endcode
1618  *
1619  * @ingroup Evas_Canvas
1620  */
1621
1622 /**
1623  * Look up a numeric ID from a string name of a rendering engine.
1624  *
1625  * @param name the name string of an engine
1626  * @return A numeric (opaque) ID for the rendering engine
1627  * @ingroup Evas_Output_Method
1628  *
1629  * This function looks up a numeric return value for the named engine
1630  * in the string @p name. This is a normal C string, NUL byte
1631  * terminated. The name is case sensitive. If the rendering engine is
1632  * available, a numeric ID for that engine is returned that is not
1633  * 0. If the engine is not available, 0 is returned, indicating an
1634  * invalid engine.
1635  *
1636  * The programmer should NEVER rely on the numeric ID of an engine
1637  * unless it is returned by this function. Programs should NOT be
1638  * written accessing render method ID's directly, without first
1639  * obtaining it from this function.
1640  *
1641  * @attention it is mandatory that one calls evas_init() before
1642  *       looking up the render method.
1643  *
1644  * Example:
1645  * @code
1646  * int engine_id;
1647  * Evas *evas;
1648  *
1649  * evas_init();
1650  *
1651  * evas = evas_new();
1652  * if (!evas)
1653  *   {
1654  *     fprintf(stderr, "ERROR: Canvas creation failed. Fatal error.\n");
1655  *     exit(-1);
1656  *   }
1657  * engine_id = evas_render_method_lookup("software_x11");
1658  * if (!engine_id)
1659  *   {
1660  *     fprintf(stderr, "ERROR: Requested rendering engine is absent.\n");
1661  *     exit(-1);
1662  *   }
1663  * evas_output_method_set(evas, engine_id);
1664  * @endcode
1665  */
1666 EAPI int               evas_render_method_lookup         (const char *name) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
1667
1668 /**
1669  * List all the rendering engines compiled into the copy of the Evas library
1670  *
1671  * @return A linked list whose data members are C strings of engine names
1672  * @ingroup Evas_Output_Method
1673  *
1674  * Calling this will return a handle (pointer) to an Evas linked
1675  * list. Each node in the linked list will have the data pointer be a
1676  * (char *) pointer to the name string of the rendering engine
1677  * available. The strings should never be modified, neither should the
1678  * list be modified. This list should be cleaned up as soon as the
1679  * program no longer needs it using evas_render_method_list_free(). If
1680  * no engines are available from Evas, NULL will be returned.
1681  *
1682  * Example:
1683  * @code
1684  * Eina_List *engine_list, *l;
1685  * char *engine_name;
1686  *
1687  * engine_list = evas_render_method_list();
1688  * if (!engine_list)
1689  *   {
1690  *     fprintf(stderr, "ERROR: Evas supports no engines! Exit.\n");
1691  *     exit(-1);
1692  *   }
1693  * printf("Available Evas Engines:\n");
1694  * EINA_LIST_FOREACH(engine_list, l, engine_name)
1695  *     printf("%s\n", engine_name);
1696  * evas_render_method_list_free(engine_list);
1697  * @endcode
1698  */
1699 EAPI Eina_List        *evas_render_method_list           (void) EINA_WARN_UNUSED_RESULT;
1700
1701 /**
1702  * This function should be called to free a list of engine names
1703  *
1704  * @param list The Eina_List base pointer for the engine list to be freed
1705  * @ingroup Evas_Output_Method
1706  *
1707  * When this function is called it will free the engine list passed in
1708  * as @p list. The list should only be a list of engines generated by
1709  * calling evas_render_method_list(). If @p list is NULL, nothing will
1710  * happen.
1711  *
1712  * Example:
1713  * @code
1714  * Eina_List *engine_list, *l;
1715  * char *engine_name;
1716  *
1717  * engine_list = evas_render_method_list();
1718  * if (!engine_list)
1719  *   {
1720  *     fprintf(stderr, "ERROR: Evas supports no engines! Exit.\n");
1721  *     exit(-1);
1722  *   }
1723  * printf("Available Evas Engines:\n");
1724  * EINA_LIST_FOREACH(engine_list, l, engine_name)
1725  *     printf("%s\n", engine_name);
1726  * evas_render_method_list_free(engine_list);
1727  * @endcode
1728  */
1729 EAPI void              evas_render_method_list_free      (Eina_List *list);
1730
1731
1732 /**
1733  * Sets the output engine for the given evas.
1734  *
1735  * Once the output engine for an evas is set, any attempt to change it
1736  * will be ignored.  The value for @p render_method can be found using
1737  * @ref evas_render_method_lookup .
1738  *
1739  * @param   e             The given evas.
1740  * @param   render_method The numeric engine value to use.
1741  *
1742  * @attention it is mandatory that one calls evas_init() before
1743  *       setting the output method.
1744  *
1745  * @ingroup Evas_Output_Method
1746  */
1747 EAPI void              evas_output_method_set            (Evas *e, int render_method) EINA_ARG_NONNULL(1);
1748
1749 /**
1750  * Retrieves the number of the output engine used for the given evas.
1751  * @param   e The given evas.
1752  * @return  The ID number of the output engine being used.  @c 0 is
1753  *          returned if there is an error.
1754  * @ingroup Evas_Output_Method
1755  */
1756 EAPI int               evas_output_method_get            (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
1757
1758
1759 /**
1760  * Retrieves the current render engine info struct from the given evas.
1761  *
1762  * The returned structure is publicly modifiable.  The contents are
1763  * valid until either @ref evas_engine_info_set or @ref evas_render
1764  * are called.
1765  *
1766  * This structure does not need to be freed by the caller.
1767  *
1768  * @param   e The given evas.
1769  * @return  A pointer to the Engine Info structure.  @c NULL is returned if
1770  *          an engine has not yet been assigned.
1771  * @ingroup Evas_Output_Method
1772  */
1773 EAPI Evas_Engine_Info *evas_engine_info_get              (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
1774
1775 /**
1776  * Applies the engine settings for the given evas from the given @c
1777  * Evas_Engine_Info structure.
1778  *
1779  * To get the Evas_Engine_Info structure to use, call @ref
1780  * evas_engine_info_get .  Do not try to obtain a pointer to an
1781  * @c Evas_Engine_Info structure in any other way.
1782  *
1783  * You will need to call this function at least once before you can
1784  * create objects on an evas or render that evas.  Some engines allow
1785  * their settings to be changed more than once.
1786  *
1787  * Once called, the @p info pointer should be considered invalid.
1788  *
1789  * @param   e    The pointer to the Evas Canvas
1790  * @param   info The pointer to the Engine Info to use
1791  * @return  1 if no error occurred, 0 otherwise
1792  * @ingroup Evas_Output_Method
1793  */
1794 EAPI Eina_Bool         evas_engine_info_set              (Evas *e, Evas_Engine_Info *info) EINA_ARG_NONNULL(1);
1795
1796 /**
1797  * @defgroup Evas_Output_Size Output and Viewport Resizing Functions
1798  *
1799  * Functions that set and retrieve the output and viewport size of an
1800  * evas.
1801  *
1802  * @ingroup Evas_Canvas
1803  */
1804
1805 /**
1806  * Sets the output size of the render engine of the given evas.
1807  *
1808  * The evas will render to a rectangle of the given size once this
1809  * function is called.  The output size is independent of the viewport
1810  * size.  The viewport will be stretched to fill the given rectangle.
1811  *
1812  * The units used for @p w and @p h depend on the engine used by the
1813  * evas.
1814  *
1815  * @param   e The given evas.
1816  * @param   w The width in output units, usually pixels.
1817  * @param   h The height in output units, usually pixels.
1818  * @ingroup Evas_Output_Size
1819  */
1820 EAPI void              evas_output_size_set              (Evas *e, int w, int h) EINA_ARG_NONNULL(1);
1821
1822 /**
1823  * Retrieve the output size of the render engine of the given evas.
1824  *
1825  * The output size is given in whatever the output units are for the
1826  * engine.
1827  *
1828  * If either @p w or @p h is @c NULL, then it is ignored.  If @p e is
1829  * invalid, the returned results are undefined.
1830  *
1831  * @param   e The given evas.
1832  * @param   w The pointer to an integer to store the width in.
1833  * @param   h The pointer to an integer to store the height in.
1834  * @ingroup Evas_Output_Size
1835  */
1836 EAPI void              evas_output_size_get              (const Evas *e, int *w, int *h) EINA_ARG_NONNULL(1);
1837
1838 /**
1839  * Sets the output viewport of the given evas in evas units.
1840  *
1841  * The output viewport is the area of the evas that will be visible to
1842  * the viewer.  The viewport will be stretched to fit the output
1843  * target of the evas when rendering is performed.
1844  *
1845  * @note The coordinate values do not have to map 1-to-1 with the output
1846  *       target.  However, it is generally advised that it is done for ease
1847  *       of use.
1848  *
1849  * @param   e The given evas.
1850  * @param   x The top-left corner x value of the viewport.
1851  * @param   y The top-left corner y value of the viewport.
1852  * @param   w The width of the viewport.  Must be greater than 0.
1853  * @param   h The height of the viewport.  Must be greater than 0.
1854  * @ingroup Evas_Output_Size
1855  */
1856 EAPI void              evas_output_viewport_set          (Evas *e, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h) EINA_ARG_NONNULL(1);
1857
1858 /**
1859  * Get the render engine's output viewport co-ordinates in canvas units.
1860  * @param e The pointer to the Evas Canvas
1861  * @param x The pointer to a x variable to be filled in
1862  * @param y The pointer to a y variable to be filled in
1863  * @param w The pointer to a width variable to be filled in
1864  * @param h The pointer to a height variable to be filled in
1865  * @ingroup Evas_Output_Size
1866  *
1867  * Calling this function writes the current canvas output viewport
1868  * size and location values into the variables pointed to by @p x, @p
1869  * y, @p w and @p h.  On success the variables have the output
1870  * location and size values written to them in canvas units. Any of @p
1871  * x, @p y, @p w or @p h that are NULL will not be written to. If @p e
1872  * is invalid, the results are undefined.
1873  *
1874  * Example:
1875  * @code
1876  * extern Evas *evas;
1877  * Evas_Coord x, y, width, height;
1878  *
1879  * evas_output_viewport_get(evas, &x, &y, &w, &h);
1880  * @endcode
1881  */
1882 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);
1883
1884 /**
1885  * Sets the output framespace size of the render engine of the given evas.
1886  *
1887  * The framespace size is used in the Wayland engines to denote space where 
1888  * the output is not drawn. This is mainly used in ecore_evas to draw borders
1889  *
1890  * The units used for @p w and @p h depend on the engine used by the
1891  * evas.
1892  *
1893  * @param   e The given evas.
1894  * @param   x The left coordinate in output units, usually pixels.
1895  * @param   y The top coordinate in output units, usually pixels.
1896  * @param   w The width in output units, usually pixels.
1897  * @param   h The height in output units, usually pixels.
1898  * @ingroup Evas_Output_Size
1899  * @since 1.1.0
1900  */
1901 EAPI void              evas_output_framespace_set        (Evas *e, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h);
1902
1903 /**
1904  * Get the render engine's output framespace co-ordinates in canvas units.
1905  * 
1906  * @param e The pointer to the Evas Canvas
1907  * @param x The pointer to a x variable to be filled in
1908  * @param y The pointer to a y variable to be filled in
1909  * @param w The pointer to a width variable to be filled in
1910  * @param h The pointer to a height variable to be filled in
1911  * @ingroup Evas_Output_Size
1912  * @since 1.1.0
1913  */
1914 EAPI void              evas_output_framespace_get        (const Evas *e, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h);
1915
1916 /**
1917  * @defgroup Evas_Coord_Mapping_Group Coordinate Mapping Functions
1918  *
1919  * Functions that are used to map coordinates from the canvas to the
1920  * screen or the screen to the canvas.
1921  *
1922  * @ingroup Evas_Canvas
1923  */
1924
1925 /**
1926  * Convert/scale an ouput screen co-ordinate into canvas co-ordinates
1927  *
1928  * @param e The pointer to the Evas Canvas
1929  * @param x The screen/output x co-ordinate
1930  * @return The screen co-ordinate translated to canvas unit co-ordinates
1931  * @ingroup Evas_Coord_Mapping_Group
1932  *
1933  * This function takes in a horizontal co-ordinate as the @p x
1934  * parameter and converts it into canvas units, accounting for output
1935  * size, viewport size and location, returning it as the function
1936  * return value. If @p e is invalid, the results are undefined.
1937  *
1938  * Example:
1939  * @code
1940  * extern Evas *evas;
1941  * extern int screen_x;
1942  * Evas_Coord canvas_x;
1943  *
1944  * canvas_x = evas_coord_screen_x_to_world(evas, screen_x);
1945  * @endcode
1946  */
1947 EAPI Evas_Coord        evas_coord_screen_x_to_world      (const Evas *e, int x) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
1948
1949 /**
1950  * Convert/scale an ouput screen co-ordinate into canvas co-ordinates
1951  *
1952  * @param e The pointer to the Evas Canvas
1953  * @param y The screen/output y co-ordinate
1954  * @return The screen co-ordinate translated to canvas unit co-ordinates
1955  * @ingroup Evas_Coord_Mapping_Group
1956  *
1957  * This function takes in a vertical co-ordinate as the @p y parameter
1958  * and converts it into canvas units, accounting for output size,
1959  * viewport size and location, returning it as the function return
1960  * value. If @p e is invalid, the results are undefined.
1961  *
1962  * Example:
1963  * @code
1964  * extern Evas *evas;
1965  * extern int screen_y;
1966  * Evas_Coord canvas_y;
1967  *
1968  * canvas_y = evas_coord_screen_y_to_world(evas, screen_y);
1969  * @endcode
1970  */
1971 EAPI Evas_Coord        evas_coord_screen_y_to_world      (const Evas *e, int y) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
1972
1973 /**
1974  * Convert/scale a canvas co-ordinate into output screen co-ordinates
1975  *
1976  * @param e The pointer to the Evas Canvas
1977  * @param x The canvas x co-ordinate
1978  * @return The output/screen co-ordinate translated to output co-ordinates
1979  * @ingroup Evas_Coord_Mapping_Group
1980  *
1981  * This function takes in a horizontal co-ordinate as the @p x
1982  * parameter and converts it into output units, accounting for output
1983  * size, viewport size and location, returning it as the function
1984  * return value. If @p e is invalid, the results are undefined.
1985  *
1986  * Example:
1987  * @code
1988  * extern Evas *evas;
1989  * int screen_x;
1990  * extern Evas_Coord canvas_x;
1991  *
1992  * screen_x = evas_coord_world_x_to_screen(evas, canvas_x);
1993  * @endcode
1994  */
1995 EAPI int               evas_coord_world_x_to_screen      (const Evas *e, Evas_Coord x) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
1996
1997 /**
1998  * Convert/scale a canvas co-ordinate into output screen co-ordinates
1999  *
2000  * @param e The pointer to the Evas Canvas
2001  * @param y The canvas y co-ordinate
2002  * @return The output/screen co-ordinate translated to output co-ordinates
2003  * @ingroup Evas_Coord_Mapping_Group
2004  *
2005  * This function takes in a vertical co-ordinate as the @p x parameter
2006  * and converts it into output units, accounting for output size,
2007  * viewport size and location, returning it as the function return
2008  * value. If @p e is invalid, the results are undefined.
2009  *
2010  * Example:
2011  * @code
2012  * extern Evas *evas;
2013  * int screen_y;
2014  * extern Evas_Coord canvas_y;
2015  *
2016  * screen_y = evas_coord_world_y_to_screen(evas, canvas_y);
2017  * @endcode
2018  */
2019 EAPI int               evas_coord_world_y_to_screen      (const Evas *e, Evas_Coord y) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
2020
2021 /**
2022  * @defgroup Evas_Pointer_Group Pointer (Mouse) Functions
2023  *
2024  * Functions that deal with the status of the pointer (mouse cursor).
2025  *
2026  * @ingroup Evas_Canvas
2027  */
2028
2029 /**
2030  * This function returns the current known pointer co-ordinates
2031  *
2032  * @param e The pointer to the Evas Canvas
2033  * @param x The pointer to an integer to be filled in
2034  * @param y The pointer to an integer to be filled in
2035  * @ingroup Evas_Pointer_Group
2036  *
2037  * This function returns the current known screen/output co-ordinates
2038  * of the mouse pointer and sets the contents of the integers pointed
2039  * to by @p x and @p y to contain these co-ordinates. If @p e is not a
2040  * valid canvas the results of this function are undefined.
2041  *
2042  * Example:
2043  * @code
2044  * extern Evas *evas;
2045  * int mouse_x, mouse_y;
2046  *
2047  * evas_pointer_output_xy_get(evas, &mouse_x, &mouse_y);
2048  * printf("Mouse is at screen position %i, %i\n", mouse_x, mouse_y);
2049  * @endcode
2050  */
2051 EAPI void              evas_pointer_output_xy_get        (const Evas *e, int *x, int *y) EINA_ARG_NONNULL(1);
2052
2053 /**
2054  * This function returns the current known pointer co-ordinates
2055  *
2056  * @param e The pointer to the Evas Canvas
2057  * @param x The pointer to a Evas_Coord to be filled in
2058  * @param y The pointer to a Evas_Coord to be filled in
2059  * @ingroup Evas_Pointer_Group
2060  *
2061  * This function returns the current known canvas unit co-ordinates of
2062  * the mouse pointer and sets the contents of the Evas_Coords pointed
2063  * to by @p x and @p y to contain these co-ordinates. If @p e is not a
2064  * valid canvas the results of this function are undefined.
2065  *
2066  * Example:
2067  * @code
2068  * extern Evas *evas;
2069  * Evas_Coord mouse_x, mouse_y;
2070  *
2071  * evas_pointer_output_xy_get(evas, &mouse_x, &mouse_y);
2072  * printf("Mouse is at canvas position %f, %f\n", mouse_x, mouse_y);
2073  * @endcode
2074  */
2075 EAPI void              evas_pointer_canvas_xy_get        (const Evas *e, Evas_Coord *x, Evas_Coord *y) EINA_ARG_NONNULL(1);
2076
2077 /**
2078  * Returns a bitmask with the mouse buttons currently pressed, set to 1
2079  *
2080  * @param e The pointer to the Evas Canvas
2081  * @return A bitmask of the currently depressed buttons on the canvas
2082  * @ingroup Evas_Pointer_Group
2083  *
2084  * Calling this function will return a 32-bit integer with the
2085  * appropriate bits set to 1 that correspond to a mouse button being
2086  * depressed. This limits Evas to a mouse devices with a maximum of 32
2087  * buttons, but that is generally in excess of any host system's
2088  * pointing device abilities.
2089  *
2090  * A canvas by default begins with no mouse buttons being pressed and
2091  * only calls to evas_event_feed_mouse_down(),
2092  * evas_event_feed_mouse_down_data(), evas_event_feed_mouse_up() and
2093  * evas_event_feed_mouse_up_data() will alter that.
2094  *
2095  * The least significant bit corresponds to the first mouse button
2096  * (button 1) and the most significant bit corresponds to the last
2097  * mouse button (button 32).
2098  *
2099  * If @p e is not a valid canvas, the return value is undefined.
2100  *
2101  * Example:
2102  * @code
2103  * extern Evas *evas;
2104  * int button_mask, i;
2105  *
2106  * button_mask = evas_pointer_button_down_mask_get(evas);
2107  * printf("Buttons currently pressed:\n");
2108  * for (i = 0; i < 32; i++)
2109  *   {
2110  *     if ((button_mask & (1 << i)) != 0) printf("Button %i\n", i + 1);
2111  *   }
2112  * @endcode
2113  */
2114 EAPI int               evas_pointer_button_down_mask_get (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
2115
2116 /**
2117  * Returns whether the mouse pointer is logically inside the canvas
2118  *
2119  * @param e The pointer to the Evas Canvas
2120  * @return An integer that is 1 if the mouse is inside the canvas, 0 otherwise
2121  * @ingroup Evas_Pointer_Group
2122  *
2123  * When this function is called it will return a value of either 0 or
2124  * 1, depending on if evas_event_feed_mouse_in(),
2125  * evas_event_feed_mouse_in_data(), or evas_event_feed_mouse_out(),
2126  * evas_event_feed_mouse_out_data() have been called to feed in a
2127  * mouse enter event into the canvas.
2128  *
2129  * A return value of 1 indicates the mouse is logically inside the
2130  * canvas, and 0 implies it is logically outside the canvas.
2131  *
2132  * A canvas begins with the mouse being assumed outside (0).
2133  *
2134  * If @p e is not a valid canvas, the return value is undefined.
2135  *
2136  * Example:
2137  * @code
2138  * extern Evas *evas;
2139  *
2140  * if (evas_pointer_inside_get(evas)) printf("Mouse is in!\n");
2141  * else printf("Mouse is out!\n");
2142  * @endcode
2143  */
2144 EAPI Eina_Bool         evas_pointer_inside_get           (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
2145    EAPI void              evas_sync(Evas *e) EINA_ARG_NONNULL(1);
2146
2147 /**
2148  * @defgroup Evas_Canvas_Events Canvas Events
2149  *
2150  * Functions relating to canvas events, which are mainly reports on
2151  * its internal states changing (an object got focused, the rendering
2152  * is updated, etc).
2153  *
2154  * Some of the functions in this group are exemplified @ref
2155  * Example_Evas_Events "here".
2156  *
2157  * @ingroup Evas_Canvas
2158  */
2159
2160 /**
2161  * @addtogroup Evas_Canvas_Events
2162  * @{
2163  */
2164
2165 /**
2166  * Add (register) a callback function to a given canvas event.
2167  *
2168  * @param e Canvas to attach a callback to
2169  * @param type The type of event that will trigger the callback
2170  * @param func The (callback) function to be called when the event is
2171  *        triggered
2172  * @param data The data pointer to be passed to @p func
2173  *
2174  * This function adds a function callback to the canvas @p e when the
2175  * event of type @p type occurs on it. The function pointer is @p
2176  * func.
2177  *
2178  * In the event of a memory allocation error during the addition of
2179  * the callback to the canvas, evas_alloc_error() should be used to
2180  * determine the nature of the error, if any, and the program should
2181  * sensibly try and recover.
2182  *
2183  * A callback function must have the ::Evas_Event_Cb prototype
2184  * definition. The first parameter (@p data) in this definition will
2185  * have the same value passed to evas_event_callback_add() as the @p
2186  * data parameter, at runtime. The second parameter @p e is the canvas
2187  * pointer on which the event occurred. The third parameter @p
2188  * event_info is a pointer to a data structure that may or may not be
2189  * passed to the callback, depending on the event type that triggered
2190  * the callback. This is so because some events don't carry extra
2191  * context with them, but others do.
2192  *
2193  * The event type @p type to trigger the function may be one of
2194  * #EVAS_CALLBACK_RENDER_FLUSH_PRE, #EVAS_CALLBACK_RENDER_FLUSH_POST,
2195  * #EVAS_CALLBACK_CANVAS_FOCUS_IN, #EVAS_CALLBACK_CANVAS_FOCUS_OUT,
2196  * #EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_IN and
2197  * #EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_OUT. This determines the kind of
2198  * event that will trigger the callback to be called. Only the last
2199  * two of the event types listed here provide useful event information
2200  * data -- a pointer to the recently focused Evas object. For the
2201  * others the @p event_info pointer is going to be @c NULL.
2202  *
2203  * Example:
2204  * @dontinclude evas-events.c
2205  * @skip evas_event_callback_add(d.canvas, EVAS_CALLBACK_RENDER_FLUSH_PRE
2206  * @until two canvas event callbacks
2207  *
2208  * Looking to the callbacks registered above,
2209  * @dontinclude evas-events.c
2210  * @skip called when our rectangle gets focus
2211  * @until let's have our events back
2212  *
2213  * we see that the canvas flushes its rendering pipeline
2214  * (#EVAS_CALLBACK_RENDER_FLUSH_PRE) whenever the @c _resize_cb
2215  * routine takes place: it has to redraw that image at a different
2216  * size. Also, the callback on an object being focused comes just
2217  * after we focus it explicitly, on code.
2218  *
2219  * See the full @ref Example_Evas_Events "example".
2220  *
2221  * @note Be careful not to add the same callback multiple times, if
2222  * that's not what you want, because Evas won't check if a callback
2223  * existed before exactly as the one being registered (and thus, call
2224  * it more than once on the event, in this case). This would make
2225  * sense if you passed different functions and/or callback data, only.
2226  */
2227 EAPI void              evas_event_callback_add              (Evas *e, Evas_Callback_Type type, Evas_Event_Cb func, const void *data) EINA_ARG_NONNULL(1, 3);
2228
2229 /**
2230  * Add (register) a callback function to a given canvas event with a
2231  * non-default priority set. Except for the priority field, it's exactly the
2232  * same as @ref evas_event_callback_add
2233  *
2234  * @param e Canvas to attach a callback to
2235  * @param type The type of event that will trigger the callback
2236  * @param priority The priority of the callback, lower values called first.
2237  * @param func The (callback) function to be called when the event is
2238  *        triggered
2239  * @param data The data pointer to be passed to @p func
2240  *
2241  * @see evas_event_callback_add
2242  * @since 1.1.0
2243  */
2244 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);
2245
2246 /**
2247  * Delete a callback function from the canvas.
2248  *
2249  * @param e Canvas to remove a callback from
2250  * @param type The type of event that was triggering the callback
2251  * @param func The function that was to be called when the event was triggered
2252  * @return The data pointer that was to be passed to the callback
2253  *
2254  * This function removes the most recently added callback from the
2255  * canvas @p e which was triggered by the event type @p type and was
2256  * calling the function @p func when triggered. If the removal is
2257  * successful it will also return the data pointer that was passed to
2258  * evas_event_callback_add() when the callback was added to the
2259  * canvas. If not successful NULL will be returned.
2260  *
2261  * Example:
2262  * @code
2263  * extern Evas *e;
2264  * void *my_data;
2265  * void focus_in_callback(void *data, Evas *e, void *event_info);
2266  *
2267  * my_data = evas_event_callback_del(ebject, EVAS_CALLBACK_CANVAS_FOCUS_IN, focus_in_callback);
2268  * @endcode
2269  */
2270 EAPI void             *evas_event_callback_del              (Evas *e, Evas_Callback_Type type, Evas_Event_Cb func) EINA_ARG_NONNULL(1, 3);
2271
2272 /**
2273  * Delete (unregister) a callback function registered to a given
2274  * canvas event.
2275  *
2276  * @param e Canvas to remove an event callback from
2277  * @param type The type of event that was triggering the callback
2278  * @param func The function that was to be called when the event was
2279  *        triggered
2280  * @param data The data pointer that was to be passed to the callback
2281  * @return The data pointer that was to be passed to the callback
2282  *
2283  * This function removes <b>the first</b> added callback from the
2284  * canvas @p e matching the event type @p type, the registered
2285  * function pointer @p func and the callback data pointer @p data. If
2286  * the removal is successful it will also return the data pointer that
2287  * was passed to evas_event_callback_add() (that will be the same as
2288  * the parameter) when the callback(s) was(were) added to the
2289  * canvas. If not successful @c NULL will be returned. A common use
2290  * would be to remove an exact match of a callback.
2291  *
2292  * Example:
2293  * @dontinclude evas-events.c
2294  * @skip evas_event_callback_del_full(evas, EVAS_CALLBACK_RENDER_FLUSH_PRE,
2295  * @until _object_focus_in_cb, NULL);
2296  *
2297  * See the full @ref Example_Evas_Events "example".
2298  *
2299  * @note For deletion of canvas events callbacks filtering by just
2300  * type and function pointer, user evas_event_callback_del().
2301  */
2302 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);
2303
2304 /**
2305  * Push a callback on the post-event callback stack
2306  *
2307  * @param e Canvas to push the callback on
2308  * @param func The function that to be called when the stack is unwound
2309  * @param data The data pointer to be passed to the callback
2310  *
2311  * Evas has a stack of callbacks that get called after all the callbacks for
2312  * an event have triggered (all the objects it triggers on and all the callbacks
2313  * in each object triggered). When all these have been called, the stack is
2314  * unwond from most recently to least recently pushed item and removed from the
2315  * stack calling the callback set for it.
2316  *
2317  * This is intended for doing reverse logic-like processing, example - when a
2318  * child object that happens to get the event later is meant to be able to
2319  * "steal" functions from a parent and thus on unwind of this stack have its
2320  * function called first, thus being able to set flags, or return 0 from the
2321  * post-callback that stops all other post-callbacks in the current stack from
2322  * being called (thus basically allowing a child to take control, if the event
2323  * callback prepares information ready for taking action, but the post callback
2324  * actually does the action).
2325  *
2326  */
2327 EAPI void              evas_post_event_callback_push        (Evas *e, Evas_Object_Event_Post_Cb func, const void *data);
2328
2329 /**
2330  * Remove a callback from the post-event callback stack
2331  *
2332  * @param e Canvas to push the callback on
2333  * @param func The function that to be called when the stack is unwound
2334  *
2335  * This removes a callback from the stack added with
2336  * evas_post_event_callback_push(). The first instance of the function in
2337  * the callback stack is removed from being executed when the stack is
2338  * unwound. Further instances may still be run on unwind.
2339  */
2340 EAPI void              evas_post_event_callback_remove      (Evas *e, Evas_Object_Event_Post_Cb func);
2341
2342 /**
2343  * Remove a callback from the post-event callback stack
2344  *
2345  * @param e Canvas to push the callback on
2346  * @param func The function that to be called when the stack is unwound
2347  * @param data The data pointer to be passed to the callback
2348  *
2349  * This removes a callback from the stack added with
2350  * evas_post_event_callback_push(). The first instance of the function and data
2351  * in the callback stack is removed from being executed when the stack is
2352  * unwound. Further instances may still be run on unwind.
2353  */
2354 EAPI void              evas_post_event_callback_remove_full (Evas *e, Evas_Object_Event_Post_Cb func, const void *data);
2355
2356 /**
2357  * @defgroup Evas_Event_Freezing_Group Input Events Freezing Functions
2358  *
2359  * Functions that deal with the freezing of input event processing of
2360  * an Evas canvas.
2361  *
2362  * There might be scenarios during a graphical user interface
2363  * program's use when the developer wishes the users wouldn't be able
2364  * to deliver input events to this application. It may, for example,
2365  * be the time for it to populate a view or to change some
2366  * layout. Assuming proper behavior with user interaction during this
2367  * exact time would be hard, as things are in a changing state. The
2368  * programmer can then tell the canvas to ignore input events,
2369  * bringing it back to normal behavior when he/she wants.
2370  *
2371  * Most of the time use of freezing events is done like this:
2372  * @code
2373  * evas_event_freeze(my_evas_canvas);
2374  * function_that_does_work_which_cant_be_interrupted_by_events();
2375  * evas_event_thaw(my_evas_canvas);
2376  * @endcode
2377  *
2378  * Some of the functions in this group are exemplified @ref
2379  * Example_Evas_Events "here".
2380  *
2381  * @ingroup Evas_Canvas_Events
2382  */
2383
2384 /**
2385  * @addtogroup Evas_Event_Freezing_Group
2386  * @{
2387  */
2388
2389 /**
2390  * Set the default set of flags an event begins with
2391  * 
2392  * @param e The canvas to set the default event flags of
2393  * @param flags The default flags to use
2394  * 
2395  * Events in evas can have an event_flags member. This starts out with
2396  * and initial value (no flags). this lets you set the default flags that
2397  * an event begins with to be @p flags
2398  * 
2399  * @since 1.2
2400  */
2401 EAPI void              evas_event_default_flags_set      (Evas *e, Evas_Event_Flags flags) EINA_ARG_NONNULL(1);
2402
2403 /**
2404  * Get the defaulty set of flags an event begins with
2405  * 
2406  * @param e The canvas to get the default event flags from
2407  * @return The default event flags for that canvas
2408  * 
2409  * This gets the default event flags events are produced with when fed in.
2410  * 
2411  * @see evas_event_default_flags_set()
2412  * @since 1.2
2413  */
2414 EAPI Evas_Event_Flags  evas_event_default_flags_get      (const Evas *e) EINA_ARG_NONNULL(1);
2415
2416 /**
2417  * Freeze all input events processing.
2418  *
2419  * @param e The canvas to freeze input events processing on.
2420  *
2421  * This function will indicate to Evas that the canvas @p e is to have
2422  * all input event processing frozen until a matching
2423  * evas_event_thaw() function is called on the same canvas. All events
2424  * of this kind during the freeze will get @b discarded. Every freeze
2425  * call must be matched by a thaw call in order to completely thaw out
2426  * a canvas (i.e. these calls may be nested). The most common use is
2427  * when you don't want the user to interact with your user interface
2428  * when you're populating a view or changing the layout.
2429  *
2430  * Example:
2431  * @dontinclude evas-events.c
2432  * @skip freeze input for 3 seconds
2433  * @until }
2434  * @dontinclude evas-events.c
2435  * @skip let's have our events back
2436  * @until }
2437  *
2438  * See the full @ref Example_Evas_Events "example".
2439  *
2440  * If you run that example, you'll see the canvas ignoring all input
2441  * events for 3 seconds, when the "f" key is pressed. In a more
2442  * realistic code we would be freezing while a toolkit or Edje was
2443  * doing some UI changes, thawing it back afterwards.
2444  */
2445 EAPI void              evas_event_freeze                 (Evas *e) EINA_ARG_NONNULL(1);
2446
2447 /**
2448  * Thaw a canvas out after freezing (for input events).
2449  *
2450  * @param e The canvas to thaw out.
2451  *
2452  * This will thaw out a canvas after a matching evas_event_freeze()
2453  * call. If this call completely thaws out a canvas, i.e., there's no
2454  * other unbalanced call to evas_event_freeze(), events will start to
2455  * be processed again, but any "missed" events will @b not be
2456  * evaluated.
2457  *
2458  * See evas_event_freeze() for an example.
2459  */
2460 EAPI void              evas_event_thaw                   (Evas *e) EINA_ARG_NONNULL(1);
2461
2462 /**
2463  * Return the freeze count on input events of a given canvas.
2464  *
2465  * @param e The canvas to fetch the freeze count from.
2466  *
2467  * This returns the number of times the canvas has been told to freeze
2468  * input events. It is possible to call evas_event_freeze() multiple
2469  * times, and these must be matched by evas_event_thaw() calls. This
2470  * call allows the program to discover just how many times things have
2471  * been frozen in case it may want to break out of a deep freeze state
2472  * where the count is high.
2473  *
2474  * Example:
2475  * @code
2476  * extern Evas *evas;
2477  *
2478  * while (evas_event_freeze_get(evas) > 0) evas_event_thaw(evas);
2479  * @endcode
2480  *
2481  */
2482 EAPI int               evas_event_freeze_get             (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
2483
2484 /**
2485  * After thaw of a canvas, re-evaluate the state of objects and call callbacks
2486  *
2487  * @param e The canvas to evaluate after a thaw
2488  *
2489  * This is normally called after evas_event_thaw() to re-evaluate mouse
2490  * containment and other states and thus also call callbacks for mouse in and
2491  * out on new objects if the state change demands it.
2492  */
2493 EAPI void              evas_event_thaw_eval              (Evas *e) EINA_ARG_NONNULL(1);
2494
2495 /**
2496  * @}
2497  */
2498
2499 /**
2500  * @defgroup Evas_Event_Feeding_Group Input Events Feeding Functions
2501  *
2502  * Functions to tell Evas that input events happened and should be
2503  * processed.
2504  *
2505  * @warning Most of the time these functions are @b not what you're looking for.
2506  * These functions should only be used if you're not working with ecore evas(or
2507  * another input handling system). If you're not using ecore evas please
2508  * consider using it, in most situation it will make life a lot easier.
2509  *
2510  * As explained in @ref intro_not_evas, Evas does not know how to poll
2511  * for input events, so the developer should do it and then feed such
2512  * events to the canvas to be processed. This is only required if
2513  * operating Evas directly. Modules such as Ecore_Evas do that for
2514  * you.
2515  *
2516  * Some of the functions in this group are exemplified @ref
2517  * Example_Evas_Events "here".
2518  *
2519  * @ingroup Evas_Canvas_Events
2520  */
2521
2522 /**
2523  * @addtogroup Evas_Event_Feeding_Group
2524  * @{
2525  */
2526
2527 /**
2528  * Get the number of mouse or multi presses currently active
2529  *
2530  * @p e The given canvas pointer.
2531  * @return The numer of presses (0 if none active).
2532  *
2533  * @since 1.2
2534  */
2535 EAPI int               evas_event_down_count_get         (const Evas *e) EINA_ARG_NONNULL(1);
2536
2537 /**
2538  * Mouse down event feed.
2539  *
2540  * @param e The given canvas pointer.
2541  * @param b The button number.
2542  * @param flags The evas button flags.
2543  * @param timestamp The timestamp of the mouse down event.
2544  * @param data The data for canvas.
2545  *
2546  * This function will set some evas properties that is necessary when
2547  * the mouse button is pressed. It prepares information to be treated
2548  * by the callback function.
2549  *
2550  */
2551 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);
2552
2553 /**
2554  * Mouse up event feed.
2555  *
2556  * @param e The given canvas pointer.
2557  * @param b The button number.
2558  * @param flags evas button flags.
2559  * @param timestamp The timestamp of the mouse up event.
2560  * @param data The data for canvas.
2561  *
2562  * This function will set some evas properties that is necessary when
2563  * the mouse button is released. It prepares information to be treated
2564  * by the callback function.
2565  *
2566  */
2567 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);
2568
2569 /**
2570  * Mouse move event feed.
2571  *
2572  * @param e The given canvas pointer.
2573  * @param x The horizontal position of the mouse pointer.
2574  * @param y The vertical position of the mouse pointer.
2575  * @param timestamp The timestamp of the mouse up event.
2576  * @param data The data for canvas.
2577  *
2578  * This function will set some evas properties that is necessary when
2579  * the mouse is moved from its last position. It prepares information
2580  * to be treated by the callback function.
2581  *
2582  */
2583 EAPI void              evas_event_feed_mouse_move        (Evas *e, int x, int y, unsigned int timestamp, const void *data) EINA_ARG_NONNULL(1);
2584
2585 /**
2586  * Mouse in event feed.
2587  *
2588  * @param e The given canvas pointer.
2589  * @param timestamp The timestamp of the mouse up event.
2590  * @param data The data for canvas.
2591  *
2592  * This function will set some evas properties that is necessary when
2593  * the mouse in event happens. It prepares information to be treated
2594  * by the callback function.
2595  *
2596  */
2597 EAPI void              evas_event_feed_mouse_in          (Evas *e, unsigned int timestamp, const void *data) EINA_ARG_NONNULL(1);
2598
2599 /**
2600  * Mouse out event feed.
2601  *
2602  * @param e The given canvas pointer.
2603  * @param timestamp Timestamp of the mouse up event.
2604  * @param data The data for canvas.
2605  *
2606  * This function will set some evas properties that is necessary when
2607  * the mouse out event happens. It prepares information to be treated
2608  * by the callback function.
2609  *
2610  */
2611 EAPI void              evas_event_feed_mouse_out         (Evas *e, unsigned int timestamp, const void *data) EINA_ARG_NONNULL(1);
2612    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);
2613    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);
2614    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);
2615
2616 /**
2617  * Mouse cancel event feed.
2618  *
2619  * @param e The given canvas pointer.
2620  * @param timestamp The timestamp of the mouse up event.
2621  * @param data The data for canvas.
2622  *
2623  * This function will call evas_event_feed_mouse_up() when a
2624  * mouse cancel event happens.
2625  *
2626  */
2627 EAPI void              evas_event_feed_mouse_cancel      (Evas *e, unsigned int timestamp, const void *data) EINA_ARG_NONNULL(1);
2628
2629 /**
2630  * Mouse wheel event feed.
2631  *
2632  * @param e The given canvas pointer.
2633  * @param direction The wheel mouse direction.
2634  * @param z How much mouse wheel was scrolled up or down.
2635  * @param timestamp The timestamp of the mouse up event.
2636  * @param data The data for canvas.
2637  *
2638  * This function will set some evas properties that is necessary when
2639  * the mouse wheel is scrolled up or down. It prepares information to
2640  * be treated by the callback function.
2641  *
2642  */
2643 EAPI void              evas_event_feed_mouse_wheel       (Evas *e, int direction, int z, unsigned int timestamp, const void *data) EINA_ARG_NONNULL(1);
2644
2645 /**
2646  * Key down event feed
2647  *
2648  * @param e The canvas to thaw out
2649  * @param keyname  Name of the key
2650  * @param key The key pressed.
2651  * @param string A String
2652  * @param compose The compose string
2653  * @param timestamp Timestamp of the mouse up event
2654  * @param data Data for canvas.
2655  *
2656  * This function will set some evas properties that is necessary when
2657  * a key is pressed. It prepares information to be treated by the
2658  * callback function.
2659  *
2660  */
2661 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);
2662
2663 /**
2664  * Key up event feed
2665  *
2666  * @param e The canvas to thaw out
2667  * @param keyname  Name of the key
2668  * @param key The key released.
2669  * @param string string
2670  * @param compose compose
2671  * @param timestamp Timestamp of the mouse up event
2672  * @param data Data for canvas.
2673  *
2674  * This function will set some evas properties that is necessary when
2675  * a key is released. It prepares information to be treated by the
2676  * callback function.
2677  *
2678  */
2679 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);
2680
2681 /**
2682  * Hold event feed
2683  *
2684  * @param e The given canvas pointer.
2685  * @param hold The hold.
2686  * @param timestamp The timestamp of the mouse up event.
2687  * @param data The data for canvas.
2688  *
2689  * This function makes the object to stop sending events.
2690  *
2691  */
2692 EAPI void              evas_event_feed_hold              (Evas *e, int hold, unsigned int timestamp, const void *data) EINA_ARG_NONNULL(1);
2693
2694 /**
2695  * Re feed event.
2696  *
2697  * @param e The given canvas pointer.
2698  * @param event_copy the event to refeed
2699  * @param event_type Event type
2700  *
2701  * This function re-feeds the event pointed by event_copy
2702  *
2703  * This function call evas_event_feed_* functions, so it can
2704  * cause havoc if not used wisely. Please use it responsibly.
2705  */
2706 EAPI void              evas_event_refeed_event           (Evas *e, void *event_copy, Evas_Callback_Type event_type) EINA_ARG_NONNULL(1);
2707
2708
2709 /**
2710  * @}
2711  */
2712
2713 /**
2714  * @}
2715  */
2716
2717 /**
2718  * @defgroup Evas_Image_Group Image Functions
2719  *
2720  * Functions that deals with images at canvas level.
2721  *
2722  * @ingroup Evas_Canvas
2723  */
2724
2725 /**
2726  * @addtogroup Evas_Image_Group
2727  * @{
2728  */
2729
2730 /**
2731  * Flush the image cache of the canvas.
2732  *
2733  * @param e The given evas pointer.
2734  *
2735  * This function flushes image cache of canvas.
2736  *
2737  */
2738 EAPI void              evas_image_cache_flush            (Evas *e) EINA_ARG_NONNULL(1);
2739
2740 /**
2741  * Reload the image cache
2742  *
2743  * @param e The given evas pointer.
2744  *
2745  * This function reloads the image cache of canvas.
2746  *
2747  */
2748 EAPI void              evas_image_cache_reload           (Evas *e) EINA_ARG_NONNULL(1);
2749
2750 /**
2751  * Set the image cache.
2752  *
2753  * @param e The given evas pointer.
2754  * @param size The cache size.
2755  *
2756  * This function sets the image cache of canvas in bytes.
2757  *
2758  */
2759 EAPI void              evas_image_cache_set              (Evas *e, int size) EINA_ARG_NONNULL(1);
2760
2761 /**
2762  * Get the image cache
2763  *
2764  * @param e The given evas pointer.
2765  *
2766  * This function returns the image cache size of canvas in bytes.
2767  *
2768  */
2769 EAPI int               evas_image_cache_get              (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
2770
2771 /**
2772  * Get the maximum image size evas can possibly handle
2773  *
2774  * @param e The given evas pointer.
2775  * @param maxw Pointer to hold the return value in pixels of the maxumum width
2776  * @param maxh Pointer to hold the return value in pixels of the maximum height
2777  *
2778  * This function returns the larges image or surface size that evas can handle
2779  * in pixels, and if there is one, returns EINA_TRUE. It returns EINA_FALSE
2780  * if no extra constraint on maximum image size exists. You still should
2781  * check the return values of @p maxw and @p maxh as there may still be a
2782  * limit, just a much higher one.
2783  *
2784  * @since 1.1
2785  */
2786 EAPI Eina_Bool         evas_image_max_size_get           (const Evas *e, int *maxw, int *maxh) EINA_ARG_NONNULL(1);
2787
2788 /**
2789  * @}
2790  */
2791
2792 /**
2793  * @defgroup Evas_Font_Group Font Functions
2794  *
2795  * Functions that deals with fonts.
2796  *
2797  * @ingroup Evas_Canvas
2798  */
2799
2800 /**
2801  * Changes the font hinting for the given evas.
2802  *
2803  * @param e The given evas.
2804  * @param hinting The hinting to use, one of #EVAS_FONT_HINTING_NONE,
2805  *        #EVAS_FONT_HINTING_AUTO, #EVAS_FONT_HINTING_BYTECODE.
2806  * @ingroup Evas_Font_Group
2807  */
2808 EAPI void                     evas_font_hinting_set        (Evas *e, Evas_Font_Hinting_Flags hinting) EINA_ARG_NONNULL(1);
2809
2810 /**
2811  * Retrieves the font hinting used by the given evas.
2812  *
2813  * @param e The given evas to query.
2814  * @return The hinting in use, one of #EVAS_FONT_HINTING_NONE,
2815  *         #EVAS_FONT_HINTING_AUTO, #EVAS_FONT_HINTING_BYTECODE.
2816  * @ingroup Evas_Font_Group
2817  */
2818 EAPI Evas_Font_Hinting_Flags  evas_font_hinting_get        (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
2819
2820 /**
2821  * Checks if the font hinting is supported by the given evas.
2822  *
2823  * @param e The given evas to query.
2824  * @param hinting The hinting to use, one of #EVAS_FONT_HINTING_NONE,
2825  *        #EVAS_FONT_HINTING_AUTO, #EVAS_FONT_HINTING_BYTECODE.
2826  * @return @c EINA_TRUE if it is supported, @c EINA_FALSE otherwise.
2827  * @ingroup Evas_Font_Group
2828  */
2829 EAPI Eina_Bool                evas_font_hinting_can_hint   (const Evas *e, Evas_Font_Hinting_Flags hinting) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
2830
2831
2832 /**
2833  * Force the given evas and associated engine to flush its font cache.
2834  *
2835  * @param e The given evas to flush font cache.
2836  * @ingroup Evas_Font_Group
2837  */
2838 EAPI void                     evas_font_cache_flush        (Evas *e) EINA_ARG_NONNULL(1);
2839
2840 /**
2841  * Changes the size of font cache of the given evas.
2842  *
2843  * @param e The given evas to flush font cache.
2844  * @param size The size, in bytes.
2845  *
2846  * @ingroup Evas_Font_Group
2847  */
2848 EAPI void                     evas_font_cache_set          (Evas *e, int size) EINA_ARG_NONNULL(1);
2849
2850 /**
2851  * Changes the size of font cache of the given evas.
2852  *
2853  * @param e The given evas to flush font cache.
2854  * @return The size, in bytes.
2855  *
2856  * @ingroup Evas_Font_Group
2857  */
2858 EAPI int                      evas_font_cache_get          (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
2859
2860
2861 /**
2862  * List of available font descriptions known or found by this evas.
2863  *
2864  * The list depends on Evas compile time configuration, such as
2865  * fontconfig support, and the paths provided at runtime as explained
2866  * in @ref Evas_Font_Path_Group.
2867  *
2868  * @param e The evas instance to query.
2869  * @return a newly allocated list of strings. Do not change the
2870  *         strings.  Be sure to call evas_font_available_list_free()
2871  *         after you're done.
2872  *
2873  * @ingroup Evas_Font_Group
2874  */
2875 EAPI Eina_List               *evas_font_available_list     (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
2876
2877 /**
2878  * Free list of font descriptions returned by evas_font_dir_available_list().
2879  *
2880  * @param e The evas instance that returned such list.
2881  * @param available the list returned by evas_font_dir_available_list().
2882  *
2883  * @ingroup Evas_Font_Group
2884  */
2885 EAPI void                     evas_font_available_list_free(Evas *e, Eina_List *available) EINA_ARG_NONNULL(1);
2886
2887 /**
2888  * @defgroup Evas_Font_Path_Group Font Path Functions
2889  *
2890  * Functions that edit the paths being used to load fonts.
2891  *
2892  * @ingroup Evas_Font_Group
2893  */
2894
2895 /**
2896  * Removes all font paths loaded into memory for the given evas.
2897  * @param   e The given evas.
2898  * @ingroup Evas_Font_Path_Group
2899  */
2900 EAPI void              evas_font_path_clear              (Evas *e) EINA_ARG_NONNULL(1);
2901
2902 /**
2903  * Appends a font path to the list of font paths used by the given evas.
2904  * @param   e    The given evas.
2905  * @param   path The new font path.
2906  * @ingroup Evas_Font_Path_Group
2907  */
2908 EAPI void              evas_font_path_append             (Evas *e, const char *path) EINA_ARG_NONNULL(1, 2);
2909
2910 /**
2911  * Prepends 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_prepend            (Evas *e, const char *path) EINA_ARG_NONNULL(1, 2);
2917
2918 /**
2919  * Retrieves the list of font paths used by the given evas.
2920  * @param   e The given evas.
2921  * @return  The list of font paths used.
2922  * @ingroup Evas_Font_Path_Group
2923  */
2924 EAPI const Eina_List  *evas_font_path_list               (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
2925
2926 /**
2927  * @defgroup Evas_Object_Group Generic Object Functions
2928  *
2929  * Functions that manipulate generic Evas objects.
2930  *
2931  * All Evas displaying units are Evas objects. One handles them all by
2932  * means of the handle ::Evas_Object. Besides Evas treats their
2933  * objects equally, they have @b types, which define their specific
2934  * behavior (and individual API).
2935  *
2936  * Evas comes with a set of built-in object types:
2937  *   - rectangle,
2938  *   - line,
2939  *   - polygon,
2940  *   - text,
2941  *   - textblock and
2942  *   - image.
2943  *
2944  * These functions apply to @b any Evas object, whichever type that
2945  * may have.
2946  *
2947  * @note The built-in types which are most used are rectangles, text
2948  * and images. In fact, with these ones one can create 2D interfaces
2949  * of arbitrary complexity and EFL makes it easy.
2950  */
2951
2952 /**
2953  * @defgroup Evas_Object_Group_Basic Basic Object Manipulation
2954  *
2955  * Almost every evas object created will have some generic function used to
2956  * manipulate it. That's because there are a number of basic actions to be done
2957  * to objects that are irrespective of the object's type, things like:
2958  * @li Showing/Hiding
2959  * @li Setting(and getting) geometry
2960  * @li Bring up or down a layer
2961  * @li Color management
2962  * @li Handling focus
2963  * @li Clipping
2964  * @li Reference counting
2965  *
2966  * All of this issues are handled through the functions here grouped. Examples
2967  * of these function can be seen in @ref Example_Evas_Object_Manipulation(which
2968  * deals with the most common ones) and in @ref Example_Evas_Stacking(which
2969  * deals with stacking functions).
2970  *
2971  * @ingroup Evas_Object_Group
2972  */
2973
2974 /**
2975  * @addtogroup Evas_Object_Group_Basic
2976  * @{
2977  */
2978
2979 /**
2980  * Clip one object to another.
2981  *
2982  * @param obj The object to be clipped
2983  * @param clip The object to clip @p obj by
2984  *
2985  * This function will clip the object @p obj to the area occupied by
2986  * the object @p clip. This means the object @p obj will only be
2987  * visible within the area occupied by the clipping object (@p clip).
2988  *
2989  * The color of the object being clipped will be multiplied by the
2990  * color of the clipping one, so the resulting color for the former
2991  * will be <code>RESULT = (OBJ * CLIP) / (255 * 255)</code>, per color
2992  * element (red, green, blue and alpha).
2993  *
2994  * Clipping is recursive, so clipping objects may be clipped by
2995  * others, and their color will in term be multiplied. You may @b not
2996  * set up circular clipping lists (i.e. object 1 clips object 2, which
2997  * clips object 1): the behavior of Evas is undefined in this case.
2998  *
2999  * Objects which do not clip others are visible in the canvas as
3000  * normal; <b>those that clip one or more objects become invisible
3001  * themselves</b>, only affecting what they clip. If an object ceases
3002  * to have other objects being clipped by it, it will become visible
3003  * again.
3004  *
3005  * The visibility of an object affects the objects that are clipped by
3006  * it, so if the object clipping others is not shown (as in
3007  * evas_object_show()), the objects clipped by it will not be shown
3008  * either.
3009  *
3010  * If @p obj was being clipped by another object when this function is
3011  * called, it gets implicitly removed from the old clipper's domain
3012  * and is made now to be clipped by its new clipper.
3013  *
3014  * The following figure illustrates some clipping in Evas:
3015  *
3016  * @image html clipping.png
3017  * @image rtf clipping.png
3018  * @image latex clipping.eps
3019  *
3020  * @note At the moment the <b>only objects that can validly be used to
3021  * clip other objects are rectangle objects</b>. All other object
3022  * types are invalid and the result of using them is undefined. The
3023  * clip object @p clip must be a valid object, but can also be @c
3024  * NULL, in which case the effect of this function is the same as
3025  * calling evas_object_clip_unset() on the @p obj object.
3026  *
3027  * Example:
3028  * @dontinclude evas-object-manipulation.c
3029  * @skip solid white clipper (note that it's the default color for a
3030  * @until evas_object_show(d.clipper);
3031  *
3032  * See the full @ref Example_Evas_Object_Manipulation "example".
3033  */
3034 EAPI void              evas_object_clip_set              (Evas_Object *obj, Evas_Object *clip) EINA_ARG_NONNULL(1, 2);
3035
3036 /**
3037  * Get the object clipping @p obj (if any).
3038  *
3039  * @param obj The object to get the clipper from
3040  *
3041  * This function returns the object clipping @p obj. If @p obj is
3042  * not being clipped at all, @c NULL is returned. The object @p obj
3043  * must be a valid ::Evas_Object.
3044  *
3045  * See also evas_object_clip_set(), evas_object_clip_unset() and
3046  * evas_object_clipees_get().
3047  *
3048  * Example:
3049  * @dontinclude evas-object-manipulation.c
3050  * @skip if (evas_object_clip_get(d.img) == d.clipper)
3051  * @until return
3052  *
3053  * See the full @ref Example_Evas_Object_Manipulation "example".
3054  */
3055 EAPI Evas_Object      *evas_object_clip_get              (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
3056
3057 /**
3058  * Disable/cease clipping on a clipped @p obj object.
3059  *
3060  * @param obj The object to cease clipping on
3061  *
3062  * This function disables clipping for the object @p obj, if it was
3063  * already clipped, i.e., its visibility and color get detached from
3064  * the previous clipper. If it wasn't, this has no effect. The object
3065  * @p obj must be a valid ::Evas_Object.
3066  *
3067  * See also evas_object_clip_set() (for an example),
3068  * evas_object_clipees_get() and evas_object_clip_get().
3069  *
3070  */
3071 EAPI void              evas_object_clip_unset            (Evas_Object *obj);
3072
3073 /**
3074  * Return a list of objects currently clipped by @p obj.
3075  *
3076  * @param obj The object to get a list of clippees from
3077  * @return a list of objects being clipped by @p obj
3078  *
3079  * This returns the internal list handle that contains all objects
3080  * clipped by the object @p obj. If none are clipped by it, the call
3081  * returns @c NULL. This list is only valid until the clip list is
3082  * changed and should be fetched again with another call to
3083  * evas_object_clipees_get() if any objects being clipped by this
3084  * object are unclipped, clipped by a new object, deleted or get the
3085  * clipper deleted. These operations will invalidate the list
3086  * returned, so it should not be used anymore after that point. Any
3087  * use of the list after this may have undefined results, possibly
3088  * leading to crashes. The object @p obj must be a valid
3089  * ::Evas_Object.
3090  *
3091  * See also evas_object_clip_set(), evas_object_clip_unset() and
3092  * evas_object_clip_get().
3093  *
3094  * Example:
3095  * @code
3096  * extern Evas_Object *obj;
3097  * Evas_Object *clipper;
3098  *
3099  * clipper = evas_object_clip_get(obj);
3100  * if (clipper)
3101  *   {
3102  *     Eina_List *clippees, *l;
3103  *     Evas_Object *obj_tmp;
3104  *
3105  *     clippees = evas_object_clipees_get(clipper);
3106  *     printf("Clipper clips %i objects\n", eina_list_count(clippees));
3107  *     EINA_LIST_FOREACH(clippees, l, obj_tmp)
3108  *         evas_object_show(obj_tmp);
3109  *   }
3110  * @endcode
3111  */
3112 EAPI const Eina_List  *evas_object_clipees_get           (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
3113
3114
3115 /**
3116  * Sets or unsets a given object as the currently focused one on its
3117  * canvas.
3118  *
3119  * @param obj The object to be focused or unfocused.
3120  * @param focus @c EINA_TRUE, to set it as focused or @c EINA_FALSE,
3121  * to take away the focus from it.
3122  *
3123  * Changing focus only affects where (key) input events go. There can
3124  * be only one object focused at any time. If @p focus is @c
3125  * EINA_TRUE, @p obj will be set as the currently focused object and
3126  * it will receive all keyboard events that are not exclusive key
3127  * grabs on other objects.
3128  *
3129  * Example:
3130  * @dontinclude evas-events.c
3131  * @skip evas_object_focus_set
3132  * @until evas_object_focus_set
3133  *
3134  * See the full example @ref Example_Evas_Events "here".
3135  *
3136  * @see evas_object_focus_get
3137  * @see evas_focus_get
3138  * @see evas_object_key_grab
3139  * @see evas_object_key_ungrab
3140  */
3141 EAPI void              evas_object_focus_set             (Evas_Object *obj, Eina_Bool focus) EINA_ARG_NONNULL(1);
3142
3143 /**
3144  * Retrieve whether an object has the focus.
3145  *
3146  * @param obj The object to retrieve focus information from.
3147  * @return @c EINA_TRUE if the object has the focus, @c EINA_FALSE
3148  * otherwise.
3149  *
3150  * If the passed object is the currently focused one, @c EINA_TRUE is
3151  * returned. @c EINA_FALSE is returned, otherwise.
3152  *
3153  * Example:
3154  * @dontinclude evas-events.c
3155  * @skip And again
3156  * @until something is bad
3157  *
3158  * See the full example @ref Example_Evas_Events "here".
3159  *
3160  * @see evas_object_focus_set
3161  * @see evas_focus_get
3162  * @see evas_object_key_grab
3163  * @see evas_object_key_ungrab
3164  */
3165 EAPI Eina_Bool         evas_object_focus_get             (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
3166
3167
3168 /**
3169  * Sets the layer of the its canvas that the given object will be part
3170  * of.
3171  *
3172  * @param   obj The given Evas object.
3173  * @param   l   The number of the layer to place the object on.
3174  *          Must be between #EVAS_LAYER_MIN and #EVAS_LAYER_MAX.
3175  *
3176  * If you don't use this function, you'll be dealing with an @b unique
3177  * layer of objects, the default one. Additional layers are handy when
3178  * you don't want a set of objects to interfere with another set with
3179  * regard to @b stacking. Two layers are completely disjoint in that
3180  * matter.
3181  *
3182  * This is a low-level function, which you'd be using when something
3183  * should be always on top, for example.
3184  *
3185  * @warning Be careful, it doesn't make sense to change the layer of
3186  * smart objects' children. Smart objects have a layer of their own,
3187  * which should contain all their children objects.
3188  *
3189  * @see evas_object_layer_get()
3190  */
3191 EAPI void              evas_object_layer_set             (Evas_Object *obj, short l) EINA_ARG_NONNULL(1);
3192
3193 /**
3194  * Retrieves the layer of its canvas that the given object is part of.
3195  *
3196  * @param   obj The given Evas object to query layer from
3197  * @return  Number of the its layer
3198  *
3199  * @see evas_object_layer_set()
3200  */
3201 EAPI short             evas_object_layer_get             (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
3202
3203
3204 /**
3205  * Sets the name of the given Evas object to the given name.
3206  *
3207  * @param   obj  The given object.
3208  * @param   name The given name.
3209  *
3210  * There might be occasions where one would like to name his/her
3211  * objects.
3212  *
3213  * Example:
3214  * @dontinclude evas-events.c
3215  * @skip d.bg = evas_object_rectangle_add(d.canvas);
3216  * @until evas_object_name_set(d.bg, "our dear rectangle");
3217  *
3218  * See the full @ref Example_Evas_Events "example".
3219  */
3220 EAPI void              evas_object_name_set              (Evas_Object *obj, const char *name) EINA_ARG_NONNULL(1);
3221
3222 /**
3223  * Retrieves the name of the given Evas object.
3224  *
3225  * @param   obj The given object.
3226  * @return  The name of the object or @c NULL, if no name has been given
3227  *          to it.
3228  *
3229  * Example:
3230  * @dontinclude evas-events.c
3231  * @skip fprintf(stdout, "An object got focused: %s\n",
3232  * @until evas_focus_get
3233  *
3234  * See the full @ref Example_Evas_Events "example".
3235  */
3236 EAPI const char       *evas_object_name_get              (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
3237
3238
3239 /**
3240  * Increments object reference count to defer its deletion.
3241  *
3242  * @param obj The given Evas object to reference
3243  *
3244  * This increments the reference count of an object, which if greater
3245  * than 0 will defer deletion by evas_object_del() until all
3246  * references are released back (counter back to 0). References cannot
3247  * go below 0 and unreferencing past that will result in the reference
3248  * count being limited to 0. References are limited to <c>2^32 - 1</c>
3249  * for an object. Referencing it more than this will result in it
3250  * being limited to this value.
3251  *
3252  * @see evas_object_unref()
3253  * @see evas_object_del()
3254  *
3255  * @note This is a <b>very simple</b> reference counting mechanism! For
3256  * instance, Evas is not ready to check for pending references on a
3257  * canvas deletion, or things like that. This is useful on scenarios
3258  * where, inside a code block, callbacks exist which would possibly
3259  * delete an object we are operating on afterwards. Then, one would
3260  * evas_object_ref() it on the beginning of the block and
3261  * evas_object_unref() it on the end. It would then be deleted at this
3262  * point, if it should be.
3263  *
3264  * Example:
3265  * @code
3266  *  evas_object_ref(obj);
3267  *
3268  *  // action here...
3269  *  evas_object_smart_callback_call(obj, SIG_SELECTED, NULL);
3270  *  // more action here...
3271  *  evas_object_unref(obj);
3272  * @endcode
3273  *
3274  * @ingroup Evas_Object_Group_Basic
3275  * @since 1.1.0
3276  */
3277 EAPI void              evas_object_ref                   (Evas_Object *obj);
3278
3279 /**
3280  * Decrements object reference count.
3281  *
3282  * @param obj The given Evas object to unreference
3283  *
3284  * This decrements the reference count of an object. If the object has
3285  * had evas_object_del() called on it while references were more than
3286  * 0, it will be deleted at the time this function is called and puts
3287  * the counter back to 0. See evas_object_ref() for more information.
3288  *
3289  * @see evas_object_ref() (for an example)
3290  * @see evas_object_del()
3291  *
3292  * @ingroup Evas_Object_Group_Basic
3293  * @since 1.1.0
3294  */
3295 EAPI void              evas_object_unref                 (Evas_Object *obj);
3296
3297 /**
3298  * Get the object reference count.
3299  *
3300  * @param obj The given Evas object to query
3301  *
3302  * This gets the reference count for an object (normally 0 until it is
3303  * referenced). Values of 1 or greater mean that someone is holding a
3304  * reference to this object that needs to be unreffed before it can be
3305  * deleted.
3306  *
3307  * @see evas_object_ref()
3308  * @see evas_object_unref()
3309  * @see evas_object_del()
3310  *
3311  * @ingroup Evas_Object_Group_Basic
3312  * @since 1.2.0
3313  */
3314 EAPI int               evas_object_ref_get               (const Evas_Object *obj);
3315
3316
3317 /**
3318  * Marks the given Evas object for deletion (when Evas will free its
3319  * memory).
3320  *
3321  * @param obj The given Evas object.
3322  *
3323  * This call will mark @p obj for deletion, which will take place
3324  * whenever it has no more references to it (see evas_object_ref() and
3325  * evas_object_unref()).
3326  *
3327  * At actual deletion time, which may or may not be just after this
3328  * call, ::EVAS_CALLBACK_DEL and ::EVAS_CALLBACK_FREE callbacks will
3329  * be called. If the object currently had the focus, its
3330  * ::EVAS_CALLBACK_FOCUS_OUT callback will also be called.
3331  *
3332  * @see evas_object_ref()
3333  * @see evas_object_unref()
3334  *
3335  * @ingroup Evas_Object_Group_Basic
3336  */
3337 EAPI void              evas_object_del                   (Evas_Object *obj) EINA_ARG_NONNULL(1);
3338
3339 /**
3340  * Move the given Evas object to the given location inside its
3341  * canvas' viewport.
3342  *
3343  * @param obj The given Evas object.
3344  * @param x   X position to move the object to, in canvas units.
3345  * @param y   Y position to move the object to, in canvas units.
3346  *
3347  * Besides being moved, the object's ::EVAS_CALLBACK_MOVE callback
3348  * will be called.
3349  *
3350  * @note Naturally, newly created objects are placed at the canvas'
3351  * origin: <code>0, 0</code>.
3352  *
3353  * Example:
3354  * @dontinclude evas-object-manipulation.c
3355  * @skip evas_object_image_border_set(d.clipper_border, 3, 3, 3, 3);
3356  * @until evas_object_show
3357  *
3358  * See the full @ref Example_Evas_Object_Manipulation "example".
3359  *
3360  * @ingroup Evas_Object_Group_Basic
3361  */
3362 EAPI void              evas_object_move                  (Evas_Object *obj, Evas_Coord x, Evas_Coord y) EINA_ARG_NONNULL(1);
3363
3364 /**
3365  * Changes the size of the given Evas object.
3366  *
3367  * @param obj The given Evas object.
3368  * @param w   The new width of the Evas object.
3369  * @param h   The new height of the Evas object.
3370  *
3371  * Besides being resized, the object's ::EVAS_CALLBACK_RESIZE callback
3372  * will be called.
3373  *
3374  * @note Newly created objects have zeroed dimensions. Then, you most
3375  * probably want to use evas_object_resize() on them after they are
3376  * created.
3377  *
3378  * @note Be aware that resizing an object changes its drawing area,
3379  * but that does imply the object is rescaled! For instance, images
3380  * are filled inside their drawing area using the specifications of
3381  * evas_object_image_fill_set(). Thus to scale the image to match
3382  * exactly your drawing area, you need to change the
3383  * evas_object_image_fill_set() as well.
3384  *
3385  * @note This is more evident in images, but text, textblock, lines
3386  * and polygons will behave similarly. Check their specific APIs to
3387  * know how to achieve your desired behavior. Consider the following
3388  * example:
3389  *
3390  * @code
3391  * // rescale image to fill exactly its area without tiling:
3392  * evas_object_resize(img, w, h);
3393  * evas_object_image_fill_set(img, 0, 0, w, h);
3394  * @endcode
3395  *
3396  * @ingroup Evas_Object_Group_Basic
3397  */
3398 EAPI void              evas_object_resize                (Evas_Object *obj, Evas_Coord w, Evas_Coord h) EINA_ARG_NONNULL(1);
3399
3400 /**
3401  * Retrieves the position and (rectangular) size of the given Evas
3402  * object.
3403  *
3404  * @param obj The given Evas object.
3405  * @param x Pointer to an integer in which to store the X coordinate
3406  *          of the object.
3407  * @param y Pointer to an integer in which to store the Y coordinate
3408  *          of the object.
3409  * @param w Pointer to an integer in which to store the width of the
3410  *          object.
3411  * @param h Pointer to an integer in which to store the height of the
3412  *          object.
3413  *
3414  * The position, naturally, will be relative to the top left corner of
3415  * the canvas' viewport.
3416  *
3417  * @note Use @c NULL pointers on the geometry components you're not
3418  * interested in: they'll be ignored by the function.
3419  *
3420  * Example:
3421  * @dontinclude evas-events.c
3422  * @skip int w, h, cw, ch;
3423  * @until return
3424  *
3425  * See the full @ref Example_Evas_Events "example".
3426  *
3427  * @ingroup Evas_Object_Group_Basic
3428  */
3429 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);
3430
3431
3432 /**
3433  * Makes the given Evas object visible.
3434  *
3435  * @param obj The given Evas object.
3436  *
3437  * Besides becoming visible, the object's ::EVAS_CALLBACK_SHOW
3438  * callback will be called.
3439  *
3440  * @see evas_object_hide() for more on object visibility.
3441  * @see evas_object_visible_get()
3442  *
3443  * @ingroup Evas_Object_Group_Basic
3444  */
3445 EAPI void              evas_object_show                  (Evas_Object *obj) EINA_ARG_NONNULL(1);
3446
3447 /**
3448  * Makes the given Evas object invisible.
3449  *
3450  * @param obj The given Evas object.
3451  *
3452  * Hidden objects, besides not being shown at all in your canvas,
3453  * won't be checked for changes on the canvas rendering
3454  * process. Furthermore, they will not catch input events. Thus, they
3455  * are much ligher (in processing needs) than an object that is
3456  * invisible due to indirect causes, such as being clipped or out of
3457  * the canvas' viewport.
3458  *
3459  * Besides becoming hidden, @p obj object's ::EVAS_CALLBACK_SHOW
3460  * callback will be called.
3461  *
3462  * @note All objects are created in the hidden state! If you want them
3463  * shown, use evas_object_show() after their creation.
3464  *
3465  * @see evas_object_show()
3466  * @see evas_object_visible_get()
3467  *
3468  * Example:
3469  * @dontinclude evas-object-manipulation.c
3470  * @skip if (evas_object_visible_get(d.clipper))
3471  * @until return
3472  *
3473  * See the full @ref Example_Evas_Object_Manipulation "example".
3474  *
3475  * @ingroup Evas_Object_Group_Basic
3476  */
3477 EAPI void              evas_object_hide                  (Evas_Object *obj) EINA_ARG_NONNULL(1);
3478
3479 /**
3480  * Retrieves whether or not the given Evas object is visible.
3481  *
3482  * @param   obj The given Evas object.
3483  * @return @c EINA_TRUE if the object is visible, @c EINA_FALSE
3484  * otherwise.
3485  *
3486  * This retrieves an object's visibility as the one enforced by
3487  * evas_object_show() and evas_object_hide().
3488  *
3489  * @note The value returned isn't, by any means, influenced by
3490  * clippers covering @p obj, it being out of its canvas' viewport or
3491  * stacked below other object.
3492  *
3493  * @see evas_object_show()
3494  * @see evas_object_hide() (for an example)
3495  *
3496  * @ingroup Evas_Object_Group_Basic
3497  */
3498 EAPI Eina_Bool         evas_object_visible_get           (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
3499
3500
3501 /**
3502  * Sets the general/main color of the given Evas object to the given
3503  * one.
3504  *
3505  * @param obj The given Evas object.
3506  * @param r   The red component of the given color.
3507  * @param g   The green component of the given color.
3508  * @param b   The blue component of the given color.
3509  * @param a   The alpha component of the given color.
3510  *
3511  * @see evas_object_color_get() (for an example)
3512  * @note These color values are expected to be premultiplied by @p a.
3513  *
3514  * @ingroup Evas_Object_Group_Basic
3515  */
3516 EAPI void              evas_object_color_set             (Evas_Object *obj, int r, int g, int b, int a) EINA_ARG_NONNULL(1);
3517
3518 /**
3519  * Retrieves the general/main color of the given Evas object.
3520  *
3521  * @param obj The given Evas object to retrieve color from.
3522  * @param r Pointer to an integer in which to store the red component
3523  *          of the color.
3524  * @param g Pointer to an integer in which to store the green
3525  *          component of the color.
3526  * @param b Pointer to an integer in which to store the blue component
3527  *          of the color.
3528  * @param a Pointer to an integer in which to store the alpha
3529  *          component of the color.
3530  *
3531  * Retrieves the “main” color's RGB component (and alpha channel)
3532  * values, <b>which range from 0 to 255</b>. For the alpha channel,
3533  * which defines the object's transparency level, 0 means totally
3534  * transparent, while 255 means opaque. These color values are
3535  * premultiplied by the alpha value.
3536  *
3537  * Usually you’ll use this attribute for text and rectangle objects,
3538  * where the “main” color is their unique one. If set for objects
3539  * which themselves have colors, like the images one, those colors get
3540  * modulated by this one.
3541  *
3542  * @note All newly created Evas rectangles get the default color
3543  * values of <code>255 255 255 255</code> (opaque white).
3544  *
3545  * @note Use @c NULL pointers on the components you're not interested
3546  * in: they'll be ignored by the function.
3547  *
3548  * Example:
3549  * @dontinclude evas-object-manipulation.c
3550  * @skip int alpha, r, g, b;
3551  * @until return
3552  *
3553  * See the full @ref Example_Evas_Object_Manipulation "example".
3554  *
3555  * @ingroup Evas_Object_Group_Basic
3556  */
3557 EAPI void              evas_object_color_get             (const Evas_Object *obj, int *r, int *g, int *b, int *a) EINA_ARG_NONNULL(1);
3558
3559
3560 /**
3561  * Retrieves the Evas canvas that the given object lives on.
3562  *
3563  * @param   obj The given Evas object.
3564  * @return  A pointer to the canvas where the object is on.
3565  *
3566  * This function is most useful at code contexts where you need to
3567  * operate on the canvas but have only the object pointer.
3568  *
3569  * @ingroup Evas_Object_Group_Basic
3570  */
3571 EAPI Evas             *evas_object_evas_get              (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
3572
3573 /**
3574  * Retrieves the type of the given Evas object.
3575  *
3576  * @param obj The given object.
3577  * @return The type of the object.
3578  *
3579  * For Evas' builtin types, the return strings will be one of:
3580  *   - <c>"rectangle"</c>,
3581  *   - <c>"line"</c>,
3582  *   - <c>"polygon"</c>,
3583  *   - <c>"text"</c>,
3584  *   - <c>"textblock"</c> and
3585  *   - <c>"image"</c>.
3586  *
3587  * For Evas smart objects (see @ref Evas_Smart_Group), the name of the
3588  * smart class itself is returned on this call. For the built-in smart
3589  * objects, these names are:
3590  *   - <c>"EvasObjectSmartClipped"</c>, for the clipped smart object
3591  *   - <c>"Evas_Object_Box"</c>, for the box object and
3592  *   - <c>"Evas_Object_Table"</c>, for the table object.
3593  *
3594  * Example:
3595  * @dontinclude evas-object-manipulation.c
3596  * @skip d.img = evas_object_image_filled_add(d.canvas);
3597  * @until border on the
3598  *
3599  * See the full @ref Example_Evas_Object_Manipulation "example".
3600  */
3601 EAPI const char       *evas_object_type_get              (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
3602
3603 /**
3604  * Raise @p obj to the top of its layer.
3605  *
3606  * @param obj the object to raise
3607  *
3608  * @p obj will, then, be the highest one in the layer it belongs
3609  * to. Object on other layers won't get touched.
3610  *
3611  * @see evas_object_stack_above()
3612  * @see evas_object_stack_below()
3613  * @see evas_object_lower()
3614  */
3615 EAPI void              evas_object_raise                 (Evas_Object *obj) EINA_ARG_NONNULL(1);
3616
3617 /**
3618  * Lower @p obj to the bottom of its layer.
3619  *
3620  * @param obj the object to lower
3621  *
3622  * @p obj will, then, be the lowest one in the layer it belongs
3623  * to. Objects on other layers won't get touched.
3624  *
3625  * @see evas_object_stack_above()
3626  * @see evas_object_stack_below()
3627  * @see evas_object_raise()
3628  */
3629 EAPI void              evas_object_lower                 (Evas_Object *obj) EINA_ARG_NONNULL(1);
3630
3631 /**
3632  * Stack @p obj immediately above @p above
3633  *
3634  * @param obj the object to stack
3635  * @param above the object above which to stack
3636  *
3637  * Objects, in a given canvas, are stacked in the order they get added
3638  * to it.  This means that, if they overlap, the highest ones will
3639  * cover the lowest ones, in that order. This function is a way to
3640  * change the stacking order for the objects.
3641  *
3642  * This function is intended to be used with <b>objects belonging to
3643  * the same layer</b> in a given canvas, otherwise it will fail (and
3644  * accomplish nothing).
3645  *
3646  * If you have smart objects on your canvas and @p obj is a member of
3647  * one of them, then @p above must also be a member of the same
3648  * smart object.
3649  *
3650  * Similarly, if @p obj is not a member of a smart object, @p above
3651  * must not be either.
3652  *
3653  * @see evas_object_layer_get()
3654  * @see evas_object_layer_set()
3655  * @see evas_object_stack_below()
3656  */
3657 EAPI void              evas_object_stack_above           (Evas_Object *obj, Evas_Object *above) EINA_ARG_NONNULL(1, 2);
3658
3659 /**
3660  * Stack @p obj immediately below @p below
3661  *
3662  * @param obj the object to stack
3663  * @param below the object below which to stack
3664  *
3665  * Objects, in a given canvas, are stacked in the order they get added
3666  * to it.  This means that, if they overlap, the highest ones will
3667  * cover the lowest ones, in that order. This function is a way to
3668  * change the stacking order for the objects.
3669  *
3670  * This function is intended to be used with <b>objects belonging to
3671  * the same layer</b> in a given canvas, otherwise it will fail (and
3672  * accomplish nothing).
3673  *
3674  * If you have smart objects on your canvas and @p obj is a member of
3675  * one of them, then @p below must also be a member of the same
3676  * smart object.
3677  *
3678  * Similarly, if @p obj is not a member of a smart object, @p below
3679  * must not be either.
3680  *
3681  * @see evas_object_layer_get()
3682  * @see evas_object_layer_set()
3683  * @see evas_object_stack_below()
3684  */
3685 EAPI void              evas_object_stack_below           (Evas_Object *obj, Evas_Object *below) EINA_ARG_NONNULL(1, 2);
3686
3687 /**
3688  * Get the Evas object stacked right above @p obj
3689  *
3690  * @param obj an #Evas_Object
3691  * @return the #Evas_Object directly above @p obj, if any, or @c NULL,
3692  * if none
3693  *
3694  * This function will traverse layers in its search, if there are
3695  * objects on layers above the one @p obj is placed at.
3696  *
3697  * @see evas_object_layer_get()
3698  * @see evas_object_layer_set()
3699  * @see evas_object_below_get()
3700  *
3701  */
3702 EAPI Evas_Object      *evas_object_above_get             (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
3703
3704 /**
3705  * Get the Evas object stacked right below @p obj
3706  *
3707  * @param obj an #Evas_Object
3708  * @return the #Evas_Object directly below @p obj, if any, or @c NULL,
3709  * if none
3710  *
3711  * This function will traverse layers in its search, if there are
3712  * objects on layers below the one @p obj is placed at.
3713  *
3714  * @see evas_object_layer_get()
3715  * @see evas_object_layer_set()
3716  * @see evas_object_below_get()
3717  */
3718 EAPI Evas_Object      *evas_object_below_get             (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
3719
3720 /**
3721  * @}
3722  */
3723
3724 /**
3725  * @defgroup Evas_Object_Group_Events Object Events
3726  *
3727  * Objects generate events when they are moved, resized, when their
3728  * visibility change, when they are deleted and so on. These methods
3729  * allow one to be notified about and to handle such events.
3730  *
3731  * Objects also generate events on input (keyboard and mouse), if they
3732  * accept them (are visible, focused, etc).
3733  *
3734  * For each of those events, Evas provides a way for one to register
3735  * callback functions to be issued just after they happen.
3736  *
3737  * The following figure illustrates some Evas (event) callbacks:
3738  *
3739  * @image html evas-callbacks.png
3740  * @image rtf evas-callbacks.png
3741  * @image latex evas-callbacks.eps
3742  *
3743  * These events have their values in the #Evas_Callback_Type
3744  * enumeration, which has also ones happening on the canvas level (see
3745  * #Evas_Canvas_Events ).
3746  *
3747  * Examples on this group of functions can be found @ref
3748  * Example_Evas_Stacking "here" and @ref Example_Evas_Events "here".
3749  *
3750  * @ingroup Evas_Object_Group
3751  */
3752
3753 /**
3754  * @addtogroup Evas_Object_Group_Events
3755  * @{
3756  */
3757
3758 /**
3759  * Add (register) a callback function to a given Evas object event.
3760  *
3761  * @param obj Object to attach a callback to
3762  * @param type The type of event that will trigger the callback
3763  * @param func The function to be called when the event is triggered
3764  * @param data The data pointer to be passed to @p func
3765  *
3766  * This function adds a function callback to an object when the event
3767  * of type @p type occurs on object @p obj. The function is @p func.
3768  *
3769  * In the event of a memory allocation error during addition of the
3770  * callback to the object, evas_alloc_error() should be used to
3771  * determine the nature of the error, if any, and the program should
3772  * sensibly try and recover.
3773  *
3774  * A callback function must have the ::Evas_Object_Event_Cb prototype
3775  * definition. The first parameter (@p data) in this definition will
3776  * have the same value passed to evas_object_event_callback_add() as
3777  * the @p data parameter, at runtime. The second parameter @p e is the
3778  * canvas pointer on which the event occurred. The third parameter is
3779  * a pointer to the object on which event occurred. Finally, the
3780  * fourth parameter @p event_info is a pointer to a data structure
3781  * that may or may not be passed to the callback, depending on the
3782  * event type that triggered the callback. This is so because some
3783  * events don't carry extra context with them, but others do.
3784  *
3785  * The event type @p type to trigger the function may be one of
3786  * #EVAS_CALLBACK_MOUSE_IN, #EVAS_CALLBACK_MOUSE_OUT,
3787  * #EVAS_CALLBACK_MOUSE_DOWN, #EVAS_CALLBACK_MOUSE_UP,
3788  * #EVAS_CALLBACK_MOUSE_MOVE, #EVAS_CALLBACK_MOUSE_WHEEL,
3789  * #EVAS_CALLBACK_MULTI_DOWN, #EVAS_CALLBACK_MULTI_UP,
3790  * #EVAS_CALLBACK_MULTI_MOVE, #EVAS_CALLBACK_FREE,
3791  * #EVAS_CALLBACK_KEY_DOWN, #EVAS_CALLBACK_KEY_UP,
3792  * #EVAS_CALLBACK_FOCUS_IN, #EVAS_CALLBACK_FOCUS_OUT,
3793  * #EVAS_CALLBACK_SHOW, #EVAS_CALLBACK_HIDE, #EVAS_CALLBACK_MOVE,
3794  * #EVAS_CALLBACK_RESIZE, #EVAS_CALLBACK_RESTACK, #EVAS_CALLBACK_DEL,
3795  * #EVAS_CALLBACK_HOLD, #EVAS_CALLBACK_CHANGED_SIZE_HINTS,
3796  * #EVAS_CALLBACK_IMAGE_PRELOADED or #EVAS_CALLBACK_IMAGE_UNLOADED.
3797  *
3798  * This determines the kind of event that will trigger the callback.
3799  * What follows is a list explaining better the nature of each type of
3800  * event, along with their associated @p event_info pointers:
3801  *
3802  * - #EVAS_CALLBACK_MOUSE_IN: @p event_info is a pointer to an
3803  *   #Evas_Event_Mouse_In struct\n\n
3804  *   This event is triggered when the mouse pointer enters the area
3805  *   (not shaded by other objects) of the object @p obj. This may
3806  *   occur by the mouse pointer being moved by
3807  *   evas_event_feed_mouse_move() calls, or by the object being shown,
3808  *   raised, moved, resized, or other objects being moved out of the
3809  *   way, hidden or lowered, whatever may cause the mouse pointer to
3810  *   get on top of @p obj, having been on top of another object
3811  *   previously.
3812  *
3813  * - #EVAS_CALLBACK_MOUSE_OUT: @p event_info is a pointer to an
3814  *   #Evas_Event_Mouse_Out struct\n\n
3815  *   This event is triggered exactly like #EVAS_CALLBACK_MOUSE_IN is,
3816  *   but it occurs when the mouse pointer exits an object's area. Note
3817  *   that no mouse out events will be reported if the mouse pointer is
3818  *   implicitly grabbed to an object (mouse buttons are down, having
3819  *   been pressed while the pointer was over that object). In these
3820  *   cases, mouse out events will be reported once all buttons are
3821  *   released, if the mouse pointer has left the object's area. The
3822  *   indirect ways of taking off the mouse pointer from an object,
3823  *   like cited above, for #EVAS_CALLBACK_MOUSE_IN, also apply here,
3824  *   naturally.
3825  *
3826  * - #EVAS_CALLBACK_MOUSE_DOWN: @p event_info is a pointer to an
3827  *   #Evas_Event_Mouse_Down struct\n\n
3828  *   This event is triggered by a mouse button being pressed while the
3829  *   mouse pointer is over an object. If the pointer mode for Evas is
3830  *   #EVAS_OBJECT_POINTER_MODE_AUTOGRAB (default), this causes this
3831  *   object to <b>passively grab the mouse</b> until all mouse buttons
3832  *   have been released: all future mouse events will be reported to
3833  *   only this object until no buttons are down. That includes mouse
3834  *   move events, mouse in and mouse out events, and further button
3835  *   presses. When all buttons are released, event propagation will
3836  *   occur as normal (see #Evas_Object_Pointer_Mode).
3837  *
3838  * - #EVAS_CALLBACK_MOUSE_UP: @p event_info is a pointer to an
3839  *   #Evas_Event_Mouse_Up struct\n\n
3840  *   This event is triggered by a mouse button being released while
3841  *   the mouse pointer is over an object's area (or when passively
3842  *   grabbed to an object).
3843  *
3844  * - #EVAS_CALLBACK_MOUSE_MOVE: @p event_info is a pointer to an
3845  *   #Evas_Event_Mouse_Move struct\n\n
3846  *   This event is triggered by the mouse pointer being moved while
3847  *   over an object's area (or while passively grabbed to an object).
3848  *
3849  * - #EVAS_CALLBACK_MOUSE_WHEEL: @p event_info is a pointer to an
3850  *   #Evas_Event_Mouse_Wheel struct\n\n
3851  *   This event is triggered by the mouse wheel being rolled while the
3852  *   mouse pointer is over an object (or passively grabbed to an
3853  *   object).
3854  *
3855  * - #EVAS_CALLBACK_MULTI_DOWN: @p event_info is a pointer to an
3856  *   #Evas_Event_Multi_Down struct
3857  *
3858  * - #EVAS_CALLBACK_MULTI_UP: @p event_info is a pointer to an
3859  *   #Evas_Event_Multi_Up struct
3860  *
3861  * - #EVAS_CALLBACK_MULTI_MOVE: @p event_info is a pointer to an
3862  *   #Evas_Event_Multi_Move struct
3863  *
3864  * - #EVAS_CALLBACK_FREE: @p event_info is @c NULL \n\n
3865  *   This event is triggered just before Evas is about to free all
3866  *   memory used by an object and remove all references to it. This is
3867  *   useful for programs to use if they attached data to an object and
3868  *   want to free it when the object is deleted. The object is still
3869  *   valid when this callback is called, but after it returns, there
3870  *   is no guarantee on the object's validity.
3871  *
3872  * - #EVAS_CALLBACK_KEY_DOWN: @p event_info is a pointer to an
3873  *   #Evas_Event_Key_Down struct\n\n
3874  *   This callback is called when a key is pressed and the focus is on
3875  *   the object, or a key has been grabbed to a particular object
3876  *   which wants to intercept the key press regardless of what object
3877  *   has the focus.
3878  *
3879  * - #EVAS_CALLBACK_KEY_UP: @p event_info is a pointer to an
3880  *   #Evas_Event_Key_Up struct \n\n
3881  *   This callback is called when a key is released and the focus is
3882  *   on the object, or a key has been grabbed to a particular object
3883  *   which wants to intercept the key release regardless of what
3884  *   object has the focus.
3885  *
3886  * - #EVAS_CALLBACK_FOCUS_IN: @p event_info is @c NULL \n\n
3887  *   This event is called when an object gains the focus. When it is
3888  *   called the object has already gained the focus.
3889  *
3890  * - #EVAS_CALLBACK_FOCUS_OUT: @p event_info is @c NULL \n\n
3891  *   This event is triggered when an object loses the focus. When it
3892  *   is called the object has already lost the focus.
3893  *
3894  * - #EVAS_CALLBACK_SHOW: @p event_info is @c NULL \n\n
3895  *   This event is triggered by the object being shown by
3896  *   evas_object_show().
3897  *
3898  * - #EVAS_CALLBACK_HIDE: @p event_info is @c NULL \n\n
3899  *   This event is triggered by an object being hidden by
3900  *   evas_object_hide().
3901  *
3902  * - #EVAS_CALLBACK_MOVE: @p event_info is @c NULL \n\n
3903  *   This event is triggered by an object being
3904  *   moved. evas_object_move() can trigger this, as can any
3905  *   object-specific manipulations that would mean the object's origin
3906  *   could move.
3907  *
3908  * - #EVAS_CALLBACK_RESIZE: @p event_info is @c NULL \n\n
3909  *   This event is triggered by an object being resized. Resizes can
3910  *   be triggered by evas_object_resize() or by any object-specific
3911  *   calls that may cause the object to resize.
3912  *
3913  * - #EVAS_CALLBACK_RESTACK: @p event_info is @c NULL \n\n
3914  *   This event is triggered by an object being re-stacked. Stacking
3915  *   changes can be triggered by
3916  *   evas_object_stack_below()/evas_object_stack_above() and others.
3917  *
3918  * - #EVAS_CALLBACK_DEL: @p event_info is @c NULL.
3919  *
3920  * - #EVAS_CALLBACK_HOLD: @p event_info is a pointer to an
3921  *   #Evas_Event_Hold struct
3922  *
3923  * - #EVAS_CALLBACK_CHANGED_SIZE_HINTS: @p event_info is @c NULL.
3924  *
3925  * - #EVAS_CALLBACK_IMAGE_PRELOADED: @p event_info is @c NULL.
3926  *
3927  * - #EVAS_CALLBACK_IMAGE_UNLOADED: @p event_info is @c NULL.
3928  *
3929  * @note Be careful not to add the same callback multiple times, if
3930  * that's not what you want, because Evas won't check if a callback
3931  * existed before exactly as the one being registered (and thus, call
3932  * it more than once on the event, in this case). This would make
3933  * sense if you passed different functions and/or callback data, only.
3934  *
3935  * Example:
3936  * @dontinclude evas-events.c
3937  * @skip evas_object_event_callback_add(
3938  * @until }
3939  *
3940  * See the full example @ref Example_Evas_Events "here".
3941  *
3942  */
3943    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);
3944
3945 /**
3946  * Add (register) a callback function to a given Evas object event with a
3947  * non-default priority set. Except for the priority field, it's exactly the
3948  * same as @ref evas_object_event_callback_add
3949  *
3950  * @param obj Object to attach a callback to
3951  * @param type The type of event that will trigger the callback
3952  * @param priority The priority of the callback, lower values called first.
3953  * @param func The function to be called when the event is triggered
3954  * @param data The data pointer to be passed to @p func
3955  *
3956  * @see evas_object_event_callback_add
3957  * @since 1.1.0
3958  */
3959 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);
3960
3961 /**
3962  * Delete a callback function from an object
3963  *
3964  * @param obj Object to remove a callback from
3965  * @param type The type of event that was triggering the callback
3966  * @param func The function that was to be called when the event was triggered
3967  * @return The data pointer that was to be passed to the callback
3968  *
3969  * This function removes the most recently added callback from the
3970  * object @p obj which was triggered by the event type @p type and was
3971  * calling the function @p func when triggered. If the removal is
3972  * successful it will also return the data pointer that was passed to
3973  * evas_object_event_callback_add() when the callback was added to the
3974  * object. If not successful NULL will be returned.
3975  *
3976  * Example:
3977  * @code
3978  * extern Evas_Object *object;
3979  * void *my_data;
3980  * void up_callback(void *data, Evas *e, Evas_Object *obj, void *event_info);
3981  *
3982  * my_data = evas_object_event_callback_del(object, EVAS_CALLBACK_MOUSE_UP, up_callback);
3983  * @endcode
3984  */
3985 EAPI void             *evas_object_event_callback_del     (Evas_Object *obj, Evas_Callback_Type type, Evas_Object_Event_Cb func) EINA_ARG_NONNULL(1, 3);
3986
3987 /**
3988  * Delete (unregister) a callback function registered to a given
3989  * Evas object event.
3990  *
3991  * @param obj Object to remove a callback from
3992  * @param type The type of event that was triggering the callback
3993  * @param func The function that was to be called when the event was
3994  * triggered
3995  * @param data The data pointer that was to be passed to the callback
3996  * @return The data pointer that was to be passed to the callback
3997  *
3998  * This function removes the most recently added callback from the
3999  * object @p obj, which was triggered by the event type @p type and was
4000  * calling the function @p func with data @p data, when triggered. If
4001  * the removal is successful it will also return the data pointer that
4002  * was passed to evas_object_event_callback_add() (that will be the
4003  * same as the parameter) when the callback was added to the
4004  * object. In errors, @c NULL will be returned.
4005  *
4006  * @note For deletion of Evas object events callbacks filtering by
4007  * just type and function pointer, user
4008  * evas_object_event_callback_del().
4009  *
4010  * Example:
4011  * @code
4012  * extern Evas_Object *object;
4013  * void *my_data;
4014  * void up_callback(void *data, Evas *e, Evas_Object *obj, void *event_info);
4015  *
4016  * my_data = evas_object_event_callback_del_full(object, EVAS_CALLBACK_MOUSE_UP, up_callback, data);
4017  * @endcode
4018  */
4019 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);
4020
4021
4022 /**
4023  * Set whether an Evas object is to pass (ignore) events.
4024  *
4025  * @param obj the Evas object to operate on
4026  * @param pass whether @p obj is to pass events (@c EINA_TRUE) or not
4027  * (@c EINA_FALSE)
4028  *
4029  * If @p pass is @c EINA_TRUE, it will make events on @p obj to be @b
4030  * ignored. They will be triggered on the @b next lower object (that
4031  * is not set to pass events), instead (see evas_object_below_get()).
4032  *
4033  * If @p pass is @c EINA_FALSE, events will be processed on that
4034  * object as normal.
4035  *
4036  * @see evas_object_pass_events_get() for an example
4037  * @see evas_object_repeat_events_set()
4038  * @see evas_object_propagate_events_set()
4039  * @see evas_object_freeze_events_set()
4040  */
4041 EAPI void              evas_object_pass_events_set        (Evas_Object *obj, Eina_Bool pass) EINA_ARG_NONNULL(1);
4042
4043 /**
4044  * Determine whether an object is set to pass (ignore) events.
4045  *
4046  * @param obj the Evas object to get information from.
4047  * @return pass whether @p obj is set to pass events (@c EINA_TRUE) or not
4048  * (@c EINA_FALSE)
4049  *
4050  * Example:
4051  * @dontinclude evas-stacking.c
4052  * @skip if (strcmp(ev->keyname, "p") == 0)
4053  * @until }
4054  *
4055  * See the full @ref Example_Evas_Stacking "example".
4056  *
4057  * @see evas_object_pass_events_set()
4058  * @see evas_object_repeat_events_get()
4059  * @see evas_object_propagate_events_get()
4060  * @see evas_object_freeze_events_get()
4061  */
4062 EAPI Eina_Bool         evas_object_pass_events_get        (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
4063
4064 /**
4065  * Set whether an Evas object is to repeat events.
4066  *
4067  * @param obj the Evas object to operate on
4068  * @param repeat whether @p obj is to repeat events (@c EINA_TRUE) or not
4069  * (@c EINA_FALSE)
4070  *
4071  * If @p repeat is @c EINA_TRUE, it will make events on @p obj to also
4072  * be repeated for the @b next lower object in the objects' stack (see
4073  * see evas_object_below_get()).
4074  *
4075  * If @p repeat is @c EINA_FALSE, events occurring on @p obj will be
4076  * processed only on it.
4077  *
4078  * Example:
4079  * @dontinclude evas-stacking.c
4080  * @skip if (strcmp(ev->keyname, "r") == 0)
4081  * @until }
4082  *
4083  * See the full @ref Example_Evas_Stacking "example".
4084  *
4085  * @see evas_object_repeat_events_get()
4086  * @see evas_object_pass_events_set()
4087  * @see evas_object_propagate_events_set()
4088  * @see evas_object_freeze_events_set()
4089  */
4090 EAPI void              evas_object_repeat_events_set      (Evas_Object *obj, Eina_Bool repeat) EINA_ARG_NONNULL(1);
4091
4092 /**
4093  * Determine whether an object is set to repeat events.
4094  *
4095  * @param obj the given Evas object pointer
4096  * @return whether @p obj is set to repeat events (@c EINA_TRUE)
4097  * or not (@c EINA_FALSE)
4098  *
4099  * @see evas_object_repeat_events_set() for an example
4100  * @see evas_object_pass_events_get()
4101  * @see evas_object_propagate_events_get()
4102  * @see evas_object_freeze_events_get()
4103  */
4104 EAPI Eina_Bool         evas_object_repeat_events_get      (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
4105
4106 /**
4107  * Set whether events on a smart object's member should get propagated
4108  * up to its parent.
4109  *
4110  * @param obj the smart object's child to operate on
4111  * @param prop whether to propagate events (@c EINA_TRUE) or not (@c
4112  * EINA_FALSE)
4113  *
4114  * This function has @b no effect if @p obj is not a member of a smart
4115  * object.
4116  *
4117  * If @p prop is @c EINA_TRUE, events occurring on this object will be
4118  * propagated on to the smart object of which @p obj is a member.  If
4119  * @p prop is @c EINA_FALSE, events occurring on this object will @b
4120  * not be propagated on to the smart object of which @p obj is a
4121  * member.  The default value is @c EINA_TRUE.
4122  *
4123  * @see evas_object_propagate_events_get()
4124  * @see evas_object_repeat_events_set()
4125  * @see evas_object_pass_events_set()
4126  * @see evas_object_freeze_events_set()
4127  */
4128 EAPI void              evas_object_propagate_events_set   (Evas_Object *obj, Eina_Bool prop) EINA_ARG_NONNULL(1);
4129
4130 /**
4131  * Retrieve whether an Evas object is set to propagate events.
4132  *
4133  * @param obj the given Evas object pointer
4134  * @return whether @p obj is set to propagate events (@c EINA_TRUE)
4135  * or not (@c EINA_FALSE)
4136  *
4137  * @see evas_object_propagate_events_set()
4138  * @see evas_object_repeat_events_get()
4139  * @see evas_object_pass_events_get()
4140  * @see evas_object_freeze_events_get()
4141  */
4142 EAPI Eina_Bool         evas_object_propagate_events_get   (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
4143
4144 /**
4145  * Set whether an Evas object is to freeze (discard) events.
4146  *
4147  * @param obj the Evas object to operate on
4148  * @param freeze pass whether @p obj is to freeze events (@c EINA_TRUE) or not
4149  * (@c EINA_FALSE)
4150  *
4151  * If @p freeze is @c EINA_TRUE, it will make events on @p obj to be @b
4152  * discarded. Unlike evas_object_pass_events_set(), events will not be
4153  * passed to @b next lower object. This API can be used for blocking 
4154  * events while @p obj is on transiting. 
4155  *
4156  * If @p freeze is @c EINA_FALSE, events will be processed on that
4157  * object as normal.
4158  *
4159  * @see evas_object_freeze_events_get()
4160  * @see evas_object_pass_events_set()
4161  * @see evas_object_repeat_events_set()
4162  * @see evas_object_propagate_events_set()
4163  * @since 1.1.0
4164  */
4165 EAPI void              evas_object_freeze_events_set(Evas_Object *obj, Eina_Bool freeze) EINA_ARG_NONNULL(1);
4166
4167 /**
4168  * Determine whether an object is set to freeze (discard) events.
4169  *
4170  * @param obj the Evas object to get information from.
4171  * @return freeze whether @p obj is set to freeze events (@c EINA_TRUE) or
4172  * not (@c EINA_FALSE)
4173  *
4174  * @see evas_object_freeze_events_set()
4175  * @see evas_object_pass_events_get()
4176  * @see evas_object_repeat_events_get()
4177  * @see evas_object_propagate_events_get()
4178  * @since 1.1.0
4179  */
4180 EAPI Eina_Bool         evas_object_freeze_events_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
4181
4182 /**
4183  * @}
4184  */
4185
4186 /**
4187  * @defgroup Evas_Object_Group_Map UV Mapping (Rotation, Perspective, 3D...)
4188  *
4189  * Evas allows different transformations to be applied to all kinds of
4190  * objects. These are applied by means of UV mapping.
4191  *
4192  * With UV mapping, one maps points in the source object to a 3D space
4193  * positioning at target. This allows rotation, perspective, scale and
4194  * lots of other effects, depending on the map that is used.
4195  *
4196  * Each map point may carry a multiplier color. If properly
4197  * calculated, these can do shading effects on the object, producing
4198  * 3D effects.
4199  *
4200  * As usual, Evas provides both the raw and easy to use methods. The
4201  * raw methods allow developer to create its maps somewhere else,
4202  * maybe load them from some file format. The easy to use methods,
4203  * calculate the points given some high-level parameters, such as
4204  * rotation angle, ambient light and so on.
4205  *
4206  * @note applying mapping will reduce performance, so use with
4207  *       care. The impact on performance depends on engine in
4208  *       use. Software is quite optimized, but not as fast as OpenGL.
4209  *
4210  * @section sec-map-points Map points
4211  * @subsection subsec-rotation Rotation
4212  *
4213  * A map consists of a set of points, currently only four are supported. Each
4214  * of these points contains a set of canvas coordinates @c x and @c y that
4215  * can be used to alter the geometry of the mapped object, and a @c z
4216  * coordinate that indicates the depth of that point. This last coordinate
4217  * does not normally affect the map, but it's used by several of the utility
4218  * functions to calculate the right position of the point given other
4219  * parameters.
4220  *
4221  * The coordinates for each point are set with evas_map_point_coord_set().
4222  * The following image shows a map set to match the geometry of an existing
4223  * object.
4224  *
4225  * @image html map-set-map-points-1.png
4226  * @image rtf map-set-map-points-1.png
4227  * @image latex map-set-map-points-1.eps
4228  *
4229  * This is a common practice, so there are a few functions that help make it
4230  * easier.
4231  *
4232  * evas_map_util_points_populate_from_geometry() sets the coordinates of each
4233  * point in the given map to match the rectangle defined by the function
4234  * parameters.
4235  *
4236  * evas_map_util_points_populate_from_object() and
4237  * evas_map_util_points_populate_from_object_full() both take an object and
4238  * set the map points to match its geometry. The difference between the two
4239  * is that the first function sets the @c z value of all points to 0, while
4240  * the latter receives the value to set in said coordinate as a parameter.
4241  *
4242  * The following lines of code all produce the same result as in the image
4243  * above.
4244  * @code
4245  * evas_map_util_points_populate_from_geometry(m, 100, 100, 200, 200, 0);
4246  * // Assuming o is our original object
4247  * evas_object_move(o, 100, 100);
4248  * evas_object_resize(o, 200, 200);
4249  * evas_map_util_points_populate_from_object(m, o);
4250  * evas_map_util_points_populate_from_object_full(m, o, 0);
4251  * @endcode
4252  *
4253  * Several effects can be applied to an object by simply setting each point
4254  * of the map to the right coordinates. For example, a simulated perspective
4255  * could be achieve as follows.
4256  *
4257  * @image html map-set-map-points-2.png
4258  * @image rtf map-set-map-points-2.png
4259  * @image latex map-set-map-points-2.eps
4260  *
4261  * As said before, the @c z coordinate is unused here so when setting points
4262  * by hand, its value is of no importance.
4263  *
4264  * @image html map-set-map-points-3.png
4265  * @image rtf map-set-map-points-3.png
4266  * @image latex map-set-map-points-3.eps
4267  *
4268  * In all three cases above, setting the map to be used by the object is the
4269  * same.
4270  * @code
4271  * evas_object_map_set(o, m);
4272  * evas_object_map_enable_set(o, EINA_TRUE);
4273  * @endcode
4274  *
4275  * Doing things this way, however, is a lot of work that can be avoided by
4276  * using the provided utility functions, as described in the next section.
4277  *
4278  * @section map-utils Utility functions
4279  *
4280  * Utility functions take an already set up map and alter it to produce a
4281  * specific effect. For example, to rotate an object around its own center
4282  * you would need to take the rotation angle, the coordinates of each corner
4283  * of the object and do all the math to get the new set of coordinates that
4284  * need to tbe set in the map.
4285  *
4286  * Or you can use this code:
4287  * @code
4288  * evas_object_geometry_get(o, &x, &y, &w, &h);
4289  * m = evas_map_new(4);
4290  * evas_map_util_points_populate_from_object(m, o);
4291  * evas_map_util_rotate(m, 45, x + (w / 2), y + (h / 2));
4292  * evas_object_map_set(o, m);
4293  * evas_object_map_enable_set(o, EINA_TRUE);
4294  * evas_map_free(m);
4295  * @endcode
4296  *
4297  * Which will rotate the object around its center point in a 45 degree angle
4298  * in the clockwise direction, taking it from this
4299  *
4300  * @image html map-rotation-2d-1.png
4301  * @image rtf map-rotation-2d-1.png
4302  * @image latex map-rotation-2d-1.eps
4303  *
4304  * to this
4305  *
4306  * @image html map-rotation-2d-2.png
4307  * @image rtf map-rotation-2d-2.png
4308  * @image latex map-rotation-2d-2.eps
4309  *
4310  * Objects may be rotated around any other point just by setting the last two
4311  * paramaters of the evas_map_util_rotate() function to the right values. A
4312  * circle of roughly the diameter of the object overlaid on each image shows
4313  * where the center of rotation is set for each example.
4314  *
4315  * For example, this code
4316  * @code
4317  * evas_object_geometry_get(o, &x, &y, &w, &h);
4318  * m = evas_map_new(4);
4319  * evas_map_util_points_populate_from_object(m, o);
4320  * evas_map_util_rotate(m, 45, x + w - 20, y + h - 20);
4321  * evas_object_map_set(o, m);
4322  * evas_object_map_enable_set(o, EINA_TRUE);
4323  * evas_map_free(m);
4324  * @endcode
4325  *
4326  * produces something like
4327  *
4328  * @image html map-rotation-2d-3.png
4329  * @image rtf map-rotation-2d-3.png
4330  * @image latex map-rotation-2d-3.eps
4331  *
4332  * And the following
4333  * @code
4334  * evas_output_size_get(evas, &w, &h);
4335  * m = evas_map_new(4);
4336  * evas_map_util_points_populate_from_object(m, o);
4337  * evas_map_util_rotate(m, 45, w, h);
4338  * evas_object_map_set(o, m);
4339  * evas_object_map_enable_set(o, EINA_TRUE);
4340  * evas_map_free(m);
4341  * @endcode
4342  *
4343  * rotates the object around the center of the window
4344  *
4345  * @image html map-rotation-2d-4.png
4346  * @image rtf map-rotation-2d-4.png
4347  * @image latex map-rotation-2d-4.eps
4348  *
4349  * @subsection subsec-3d 3D Maps
4350  *
4351  * Maps can also be used to achieve the effect of 3-dimensionality. When doing
4352  * this, the @c z coordinate of each point counts, with higher values meaning
4353  * the point is further into the screen, and smaller values (negative, usually)
4354  * meaning the point is closwer towards the user.
4355  *
4356  * Thinking in 3D also introduces the concept of back-face of an object. An
4357  * object is said to be facing the user when all its points are placed in a
4358  * clockwise fashion. The next image shows this, with each point showing the
4359  * with which is identified within the map.
4360  *
4361  * @image html map-point-order-face.png
4362  * @image rtf map-point-order-face.png
4363  * @image latex map-point-order-face.eps
4364  *
4365  * Rotating this map around the @c Y axis would leave the order of the points
4366  * in a counter-clockwise fashion, as seen in the following image.
4367  *
4368  * @image html map-point-order-back.png
4369  * @image rtf map-point-order-back.png
4370  * @image latex map-point-order-back.eps
4371  *
4372  * This way we can say that we are looking at the back face of the object.
4373  * This will have stronger implications later when we talk about lighting.
4374  *
4375  * To know if a map is facing towards the user or not it's enough to use
4376  * the evas_map_util_clockwise_get() function, but this is normally done
4377  * after all the other operations are applied on the map.
4378  *
4379  * @subsection subsec-3d-rot 3D rotation and perspective
4380  *
4381  * Much like evas_map_util_rotate(), there's the function
4382  * evas_map_util_3d_rotate() that transforms the map to apply a 3D rotation
4383  * to an object. As in its 2D counterpart, the rotation can be applied around
4384  * any point in the canvas, this time with a @c z coordinate too. The rotation
4385  * can also be around any of the 3 axis.
4386  *
4387  * Starting from this simple setup
4388  *
4389  * @image html map-3d-basic-1.png
4390  * @image rtf map-3d-basic-1.png
4391  * @image latex map-3d-basic-1.eps
4392  *
4393  * and setting maps so that the blue square to rotate on all axis around a
4394  * sphere that uses the object as its center, and the red square to rotate
4395  * around the @c Y axis, we get the following. A simple overlay over the image
4396  * shows the original geometry of each object and the axis around which they
4397  * are being rotated, with the @c Z one not appearing due to being orthogonal
4398  * to the screen.
4399  *
4400  * @image html map-3d-basic-2.png
4401  * @image rtf map-3d-basic-2.png
4402  * @image latex map-3d-basic-2.eps
4403  *
4404  * which doesn't look very real. This can be helped by adding perspective
4405  * to the transformation, which can be simply done by calling
4406  * evas_map_util_3d_perspective() on the map after its position has been set.
4407  * The result in this case, making the vanishing point the center of each
4408  * object:
4409  *
4410  * @image html map-3d-basic-3.png
4411  * @image rtf map-3d-basic-3.png
4412  * @image latex map-3d-basic-3.eps
4413  *
4414  * @section sec-color Color and lighting
4415  *
4416  * Each point in a map can be set to a color, which will be multiplied with
4417  * the objects own color and linearly interpolated in between adjacent points.
4418  * This is done with evas_map_point_color_set() for each point of the map,
4419  * or evas_map_util_points_color_set() to set every point to the same color.
4420  *
4421  * When using 3D effects, colors can be used to improve the looks of them by
4422  * simulating a light source. The evas_map_util_3d_lighting() function makes
4423  * this task easier by taking the coordinates of the light source and its
4424  * color, along with the color of the ambient light. Evas then sets the color
4425  * of each point based on the distance to the light source, the angle with
4426  * which the object is facing the light and the ambient light. Here, the
4427  * orientation of each point as explained before, becomes more important.
4428  * If the map is defined counter-clockwise, the object will be facing away
4429  * from the user and thus become obscured, since no light would be reflecting
4430  * from it.
4431  *
4432  * @image html map-light.png
4433  * @image rtf map-light.png
4434  * @image latex map-light.eps
4435  * @note Object facing the light source
4436  *
4437  * @image html map-light2.png
4438  * @image rtf map-light2.png
4439  * @image latex map-light2.eps
4440  * @note Same object facing away from the user
4441  *
4442  * @section Image mapping
4443  *
4444  * @image html map-uv-mapping-1.png
4445  * @image rtf map-uv-mapping-1.png
4446  * @image latex map-uv-mapping-1.eps
4447  *
4448  * Images need some special handling when mapped. Evas can easily take care
4449  * of objects and do almost anything with them, but it's completely oblivious
4450  * to the content of images, so each point in the map needs to be told to what
4451  * pixel in the source image it belongs. Failing to do may sometimes result
4452  * in the expected behavior, or it may look like a partial work.
4453  *
4454  * The next image illustrates one possibility of a map being set to an image
4455  * object, without setting the right UV mapping for each point. The objects
4456  * themselves are mapped properly to their new geometry, but the image content
4457  * may not be displayed correctly within the mapped object.
4458  *
4459  * @image html map-uv-mapping-2.png
4460  * @image rtf map-uv-mapping-2.png
4461  * @image latex map-uv-mapping-2.eps
4462  *
4463  * Once Evas knows how to handle the source image within the map, it will
4464  * transform it as needed. This is done with evas_map_point_image_uv_set(),
4465  * which tells the map to which pixel in image it maps.
4466  *
4467  * To match our example images to the maps above all we need is the size of
4468  * each image, which can always be found with evas_object_image_size_get().
4469  *
4470  * @code
4471  * evas_map_point_image_uv_set(m, 0, 0, 0);
4472  * evas_map_point_image_uv_set(m, 1, 150, 0);
4473  * evas_map_point_image_uv_set(m, 2, 150, 200);
4474  * evas_map_point_image_uv_set(m, 3, 0, 200);
4475  * evas_object_map_set(o, m);
4476  * evas_object_map_enable_set(o, EINA_TRUE);
4477  *
4478  * evas_map_point_image_uv_set(m, 0, 0, 0);
4479  * evas_map_point_image_uv_set(m, 1, 120, 0);
4480  * evas_map_point_image_uv_set(m, 2, 120, 160);
4481  * evas_map_point_image_uv_set(m, 3, 0, 160);
4482  * evas_object_map_set(o2, m);
4483  * evas_object_map_enable_set(o2, EINA_TRUE);
4484  * @endcode
4485  *
4486  * To get
4487  *
4488  * @image html map-uv-mapping-3.png
4489  * @image rtf map-uv-mapping-3.png
4490  * @image latex map-uv-mapping-3.eps
4491  *
4492  * Maps can also be set to use part of an image only, or even map them inverted,
4493  * and combined with evas_object_image_source_set() it can be used to achieve
4494  * more interesting results.
4495  *
4496  * @code
4497  * evas_object_image_size_get(evas_object_image_source_get(o), &w, &h);
4498  * evas_map_point_image_uv_set(m, 0, 0, h);
4499  * evas_map_point_image_uv_set(m, 1, w, h);
4500  * evas_map_point_image_uv_set(m, 2, w, h / 3);
4501  * evas_map_point_image_uv_set(m, 3, 0, h / 3);
4502  * evas_object_map_set(o, m);
4503  * evas_object_map_enable_set(o, EINA_TRUE);
4504  * @endcode
4505  *
4506  * @image html map-uv-mapping-4.png
4507  * @image rtf map-uv-mapping-4.png
4508  * @image latex map-uv-mapping-4.eps
4509  *
4510  * Examples:
4511  * @li @ref Example_Evas_Map_Overview
4512  *
4513  * @ingroup Evas_Object_Group
4514  *
4515  * @{
4516  */
4517
4518 /**
4519  * Enable or disable the map that is set.
4520  *
4521  * Enable or disable the use of map for the object @p obj.
4522  * On enable, the object geometry will be saved, and the new geometry will
4523  * change (position and size) to reflect the map geometry set.
4524  *
4525  * If the object doesn't have a map set (with evas_object_map_set()), the
4526  * initial geometry will be undefined. It is advised to always set a map
4527  * to the object first, and then call this function to enable its use.
4528  *
4529  * @param obj object to enable the map on
4530  * @param enabled enabled state
4531  */
4532 EAPI void              evas_object_map_enable_set        (Evas_Object *obj, Eina_Bool enabled);
4533
4534 /**
4535  * Get the map enabled state
4536  *
4537  * This returns the currently enabled state of the map on the object indicated.
4538  * The default map enable state is off. You can enable and disable it with
4539  * evas_object_map_enable_set().
4540  *
4541  * @param obj object to get the map enabled state from
4542  * @return the map enabled state
4543  */
4544 EAPI Eina_Bool         evas_object_map_enable_get        (const Evas_Object *obj);
4545
4546 /**
4547  * Set the map source object
4548  *
4549  * This sets the object from which the map is taken - can be any object that
4550  * has map enabled on it.
4551  *
4552  * Currently not implemented. for future use.
4553  *
4554  * @param obj object to set the map source of
4555  * @param src the source object from which the map is taken
4556  */
4557 EAPI void              evas_object_map_source_set        (Evas_Object *obj, Evas_Object *src);
4558
4559 /**
4560  * Get the map source object
4561  *
4562  * @param obj object to set the map source of
4563  * @return the object set as the source
4564  *
4565  * @see evas_object_map_source_set()
4566  */
4567 EAPI Evas_Object      *evas_object_map_source_get        (const Evas_Object *obj);
4568
4569 /**
4570  * Set current object transformation map.
4571  *
4572  * This sets the map on a given object. It is copied from the @p map pointer,
4573  * so there is no need to keep the @p map object if you don't need it anymore.
4574  *
4575  * A map is a set of 4 points which have canvas x, y coordinates per point,
4576  * with an optional z point value as a hint for perspective correction, if it
4577  * is available. As well each point has u and v coordinates. These are like
4578  * "texture coordinates" in OpenGL in that they define a point in the source
4579  * image that is mapped to that map vertex/point. The u corresponds to the x
4580  * coordinate of this mapped point and v, the y coordinate. Note that these
4581  * coordinates describe a bounding region to sample. If you have a 200x100
4582  * source image and want to display it at 200x100 with proper pixel
4583  * precision, then do:
4584  *
4585  * @code
4586  * Evas_Map *m = evas_map_new(4);
4587  * evas_map_point_coord_set(m, 0,   0,   0, 0);
4588  * evas_map_point_coord_set(m, 1, 200,   0, 0);
4589  * evas_map_point_coord_set(m, 2, 200, 100, 0);
4590  * evas_map_point_coord_set(m, 3,   0, 100, 0);
4591  * evas_map_point_image_uv_set(m, 0,   0,   0);
4592  * evas_map_point_image_uv_set(m, 1, 200,   0);
4593  * evas_map_point_image_uv_set(m, 2, 200, 100);
4594  * evas_map_point_image_uv_set(m, 3,   0, 100);
4595  * evas_object_map_set(obj, m);
4596  * evas_map_free(m);
4597  * @endcode
4598  *
4599  * Note that the map points a uv coordinates match the image geometry. If
4600  * the @p map parameter is NULL, the stored map will be freed and geometry
4601  * prior to enabling/setting a map will be restored.
4602  *
4603  * @param obj object to change transformation map
4604  * @param map new map to use
4605  *
4606  * @see evas_map_new()
4607  */
4608 EAPI void              evas_object_map_set               (Evas_Object *obj, const Evas_Map *map);
4609
4610 /**
4611  * Get current object transformation map.
4612  *
4613  * This returns the current internal map set on the indicated object. It is
4614  * intended for read-only access and is only valid as long as the object is
4615  * not deleted or the map on the object is not changed. If you wish to modify
4616  * the map and set it back do the following:
4617  *
4618  * @code
4619  * const Evas_Map *m = evas_object_map_get(obj);
4620  * Evas_Map *m2 = evas_map_dup(m);
4621  * evas_map_util_rotate(m2, 30.0, 0, 0);
4622  * evas_object_map_set(obj);
4623  * evas_map_free(m2);
4624  * @endcode
4625  *
4626  * @param obj object to query transformation map.
4627  * @return map reference to map in use. This is an internal data structure, so
4628  * do not modify it.
4629  *
4630  * @see evas_object_map_set()
4631  */
4632 EAPI const Evas_Map   *evas_object_map_get               (const Evas_Object *obj);
4633
4634
4635 /**
4636  * Populate source and destination map points to match exactly object.
4637  *
4638  * Usually one initialize map of an object to match it's original
4639  * position and size, then transform these with evas_map_util_*
4640  * functions, such as evas_map_util_rotate() or
4641  * evas_map_util_3d_rotate(). The original set is done by this
4642  * function, avoiding code duplication all around.
4643  *
4644  * @param m map to change all 4 points (must be of size 4).
4645  * @param obj object to use unmapped geometry to populate map coordinates.
4646  * @param z Point Z Coordinate hint (pre-perspective transform). This value
4647  *        will be used for all four points.
4648  *
4649  * @see evas_map_util_points_populate_from_object()
4650  * @see evas_map_point_coord_set()
4651  * @see evas_map_point_image_uv_set()
4652  */
4653 EAPI void              evas_map_util_points_populate_from_object_full(Evas_Map *m, const Evas_Object *obj, Evas_Coord z);
4654
4655 /**
4656  * Populate source and destination map points to match exactly object.
4657  *
4658  * Usually one initialize map of an object to match it's original
4659  * position and size, then transform these with evas_map_util_*
4660  * functions, such as evas_map_util_rotate() or
4661  * evas_map_util_3d_rotate(). The original set is done by this
4662  * function, avoiding code duplication all around.
4663  *
4664  * Z Point coordinate is assumed as 0 (zero).
4665  *
4666  * @param m map to change all 4 points (must be of size 4).
4667  * @param obj object to use unmapped geometry to populate map coordinates.
4668  *
4669  * @see evas_map_util_points_populate_from_object_full()
4670  * @see evas_map_util_points_populate_from_geometry()
4671  * @see evas_map_point_coord_set()
4672  * @see evas_map_point_image_uv_set()
4673  */
4674 EAPI void              evas_map_util_points_populate_from_object     (Evas_Map *m, const Evas_Object *obj);
4675
4676 /**
4677  * Populate source and destination map points to match given geometry.
4678  *
4679  * Similar to evas_map_util_points_populate_from_object_full(), this
4680  * call takes raw values instead of querying object's unmapped
4681  * geometry. The given width will be used to calculate destination
4682  * points (evas_map_point_coord_set()) and set the image uv
4683  * (evas_map_point_image_uv_set()).
4684  *
4685  * @param m map to change all 4 points (must be of size 4).
4686  * @param x Point X Coordinate
4687  * @param y Point Y Coordinate
4688  * @param w width to use to calculate second and third points.
4689  * @param h height to use to calculate third and fourth points.
4690  * @param z Point Z Coordinate hint (pre-perspective transform). This value
4691  *        will be used for all four points.
4692  *
4693  * @see evas_map_util_points_populate_from_object()
4694  * @see evas_map_point_coord_set()
4695  * @see evas_map_point_image_uv_set()
4696  */
4697 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);
4698
4699 /**
4700  * Set color of all points to given color.
4701  *
4702  * This call is useful to reuse maps after they had 3d lightning or
4703  * any other colorization applied before.
4704  *
4705  * @param m map to change the color of.
4706  * @param r red (0 - 255)
4707  * @param g green (0 - 255)
4708  * @param b blue (0 - 255)
4709  * @param a alpha (0 - 255)
4710  *
4711  * @see evas_map_point_color_set()
4712  */
4713 EAPI void              evas_map_util_points_color_set                (Evas_Map *m, int r, int g, int b, int a);
4714
4715 /**
4716  * Change the map to apply the given rotation.
4717  *
4718  * This rotates the indicated map's coordinates around the center coordinate
4719  * given by @p cx and @p cy as the rotation center. The points will have their
4720  * X and Y coordinates rotated clockwise by @p degrees degrees (360.0 is a
4721  * full rotation). Negative values for degrees will rotate counter-clockwise
4722  * by that amount. All coordinates are canvas global coordinates.
4723  *
4724  * @param m map to change.
4725  * @param degrees amount of degrees from 0.0 to 360.0 to rotate.
4726  * @param cx rotation's center horizontal position.
4727  * @param cy rotation's center vertical position.
4728  *
4729  * @see evas_map_point_coord_set()
4730  * @see evas_map_util_zoom()
4731  */
4732 EAPI void              evas_map_util_rotate                          (Evas_Map *m, double degrees, Evas_Coord cx, Evas_Coord cy);
4733
4734 /**
4735  * Change the map to apply the given zooming.
4736  *
4737  * Like evas_map_util_rotate(), this zooms the points of the map from a center
4738  * point. That center is defined by @p cx and @p cy. The @p zoomx and @p zoomy
4739  * parameters specify how much to zoom in the X and Y direction respectively.
4740  * A value of 1.0 means "don't zoom". 2.0 means "double the size". 0.5 is
4741  * "half the size" etc. All coordinates are canvas global coordinates.
4742  *
4743  * @param m map to change.
4744  * @param zoomx horizontal zoom to use.
4745  * @param zoomy vertical zoom to use.
4746  * @param cx zooming center horizontal position.
4747  * @param cy zooming center vertical position.
4748  *
4749  * @see evas_map_point_coord_set()
4750  * @see evas_map_util_rotate()
4751  */
4752 EAPI void              evas_map_util_zoom                            (Evas_Map *m, double zoomx, double zoomy, Evas_Coord cx, Evas_Coord cy);
4753
4754 /**
4755  * Rotate the map around 3 axes in 3D
4756  *
4757  * This will rotate not just around the "Z" axis as in evas_map_util_rotate()
4758  * (which is a convenience call for those only wanting 2D). This will rotate
4759  * around the X, Y and Z axes. The Z axis points "into" the screen with low
4760  * values at the screen and higher values further away. The X axis runs from
4761  * left to right on the screen and the Y axis from top to bottom. Like with
4762  * evas_map_util_rotate() you provide a center point to rotate around (in 3D).
4763  *
4764  * @param m map to change.
4765  * @param dx amount of degrees from 0.0 to 360.0 to rotate around X axis.
4766  * @param dy amount of degrees from 0.0 to 360.0 to rotate around Y axis.
4767  * @param dz amount of degrees from 0.0 to 360.0 to rotate around Z axis.
4768  * @param cx rotation's center horizontal position.
4769  * @param cy rotation's center vertical position.
4770  * @param cz rotation's center vertical position.
4771  */
4772 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);
4773
4774 /**
4775  * Perform lighting calculations on the given Map
4776  *
4777  * This is used to apply lighting calculations (from a single light source)
4778  * to a given map. The R, G and B values of each vertex will be modified to
4779  * reflect the lighting based on the lixth point coordinates, the light
4780  * color and the ambient color, and at what angle the map is facing the
4781  * light source. A surface should have its points be declared in a
4782  * clockwise fashion if the face is "facing" towards you (as opposed to
4783  * away from you) as faces have a "logical" side for lighting.
4784  *
4785  * @image html map-light3.png
4786  * @image rtf map-light3.png
4787  * @image latex map-light3.eps
4788  * @note Grey object, no lighting used
4789  *
4790  * @image html map-light4.png
4791  * @image rtf map-light4.png
4792  * @image latex map-light4.eps
4793  * @note Lights out! Every color set to 0
4794  *
4795  * @image html map-light5.png
4796  * @image rtf map-light5.png
4797  * @image latex map-light5.eps
4798  * @note Ambient light to full black, red light coming from close at the
4799  * bottom-left vertex
4800  *
4801  * @image html map-light6.png
4802  * @image rtf map-light6.png
4803  * @image latex map-light6.eps
4804  * @note Same light as before, but not the light is set to 0 and ambient light
4805  * is cyan
4806  *
4807  * @image html map-light7.png
4808  * @image rtf map-light7.png
4809  * @image latex map-light7.eps
4810  * @note Both lights are on
4811  *
4812  * @image html map-light8.png
4813  * @image rtf map-light8.png
4814  * @image latex map-light8.eps
4815  * @note Both lights again, but this time both are the same color.
4816  *
4817  * @param m map to change.
4818  * @param lx X coordinate in space of light point
4819  * @param ly Y coordinate in space of light point
4820  * @param lz Z coordinate in space of light point
4821  * @param lr light red value (0 - 255)
4822  * @param lg light green value (0 - 255)
4823  * @param lb light blue value (0 - 255)
4824  * @param ar ambient color red value (0 - 255)
4825  * @param ag ambient color green value (0 - 255)
4826  * @param ab ambient color blue value (0 - 255)
4827  */
4828 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);
4829
4830 /**
4831  * Apply a perspective transform to the map
4832  *
4833  * This applies a given perspective (3D) to the map coordinates. X, Y and Z
4834  * values are used. The px and py points specify the "infinite distance" point
4835  * in the 3D conversion (where all lines converge to like when artists draw
4836  * 3D by hand). The @p z0 value specifies the z value at which there is a 1:1
4837  * mapping between spatial coordinates and screen coordinates. Any points
4838  * on this z value will not have their X and Y values modified in the transform.
4839  * Those further away (Z value higher) will shrink into the distance, and
4840  * those less than this value will expand and become bigger. The @p foc value
4841  * determines the "focal length" of the camera. This is in reality the distance
4842  * between the camera lens plane itself (at or closer than this rendering
4843  * results are undefined) and the "z0" z value. This allows for some "depth"
4844  * control and @p foc must be greater than 0.
4845  *
4846  * @param m map to change.
4847  * @param px The perspective distance X coordinate
4848  * @param py The perspective distance Y coordinate
4849  * @param z0 The "0" z plane value
4850  * @param foc The focal distance
4851  */
4852 EAPI void              evas_map_util_3d_perspective                  (Evas_Map *m, Evas_Coord px, Evas_Coord py, Evas_Coord z0, Evas_Coord foc);
4853
4854 /**
4855  * Get the clockwise state of a map
4856  *
4857  * This determines if the output points (X and Y. Z is not used) are
4858  * clockwise or anti-clockwise. This can be used for "back-face culling". This
4859  * is where you hide objects that "face away" from you. In this case objects
4860  * that are not clockwise.
4861  *
4862  * @param m map to query.
4863  * @return 1 if clockwise, 0 otherwise
4864  */
4865 EAPI Eina_Bool         evas_map_util_clockwise_get                   (Evas_Map *m);
4866
4867
4868 /**
4869  * Create map of transformation points to be later used with an Evas object.
4870  *
4871  * This creates a set of points (currently only 4 is supported. no other
4872  * number for @p count will work). That is empty and ready to be modified
4873  * with evas_map calls.
4874  *
4875  * @param count number of points in the map.
4876  * @return a newly allocated map or @c NULL on errors.
4877  *
4878  * @see evas_map_free()
4879  * @see evas_map_dup()
4880  * @see evas_map_point_coord_set()
4881  * @see evas_map_point_image_uv_set()
4882  * @see evas_map_util_points_populate_from_object_full()
4883  * @see evas_map_util_points_populate_from_object()
4884  *
4885  * @see evas_object_map_set()
4886  */
4887 EAPI Evas_Map         *evas_map_new                      (int count);
4888
4889 /**
4890  * Set the smoothing for map rendering
4891  *
4892  * This sets smoothing for map rendering. If the object is a type that has
4893  * its own smoothing settings, then both the smooth settings for this object
4894  * and the map must be turned off. By default smooth maps are enabled.
4895  *
4896  * @param m map to modify. Must not be NULL.
4897  * @param enabled enable or disable smooth map rendering
4898  */
4899 EAPI void              evas_map_smooth_set               (Evas_Map *m, Eina_Bool enabled);
4900
4901 /**
4902  * get the smoothing for map rendering
4903  *
4904  * This gets smoothing for map rendering.
4905  *
4906  * @param m map to get the smooth from. Must not be NULL.
4907  */
4908 EAPI Eina_Bool         evas_map_smooth_get               (const Evas_Map *m);
4909
4910 /**
4911  * Set the alpha flag for map rendering
4912  *
4913  * This sets alpha flag for map rendering. If the object is a type that has
4914  * its own alpha settings, then this will take precedence. Only image objects
4915  * have this currently.
4916  * Setting this off stops alpha blending of the map area, and is
4917  * useful if you know the object and/or all sub-objects is 100% solid.
4918  *
4919  * @param m map to modify. Must not be NULL.
4920  * @param enabled enable or disable alpha map rendering
4921  */
4922 EAPI void              evas_map_alpha_set                (Evas_Map *m, Eina_Bool enabled);
4923
4924 /**
4925  * get the alpha flag for map rendering
4926  *
4927  * This gets the alpha flag for map rendering.
4928  *
4929  * @param m map to get the alpha from. Must not be NULL.
4930  */
4931 EAPI Eina_Bool         evas_map_alpha_get                (const Evas_Map *m);
4932
4933 /**
4934  * Copy a previously allocated map.
4935  *
4936  * This makes a duplicate of the @p m object and returns it.
4937  *
4938  * @param m map to copy. Must not be NULL.
4939  * @return newly allocated map with the same count and contents as @p m.
4940  */
4941 EAPI Evas_Map         *evas_map_dup                      (const Evas_Map *m);
4942
4943 /**
4944  * Free a previously allocated map.
4945  *
4946  * This frees a givem map @p m and all memory associated with it. You must NOT
4947  * free a map returned by evas_object_map_get() as this is internal.
4948  *
4949  * @param m map to free.
4950  */
4951 EAPI void              evas_map_free                     (Evas_Map *m);
4952
4953 /**
4954  * Get a maps size.
4955  *
4956  * Returns the number of points in a map.  Should be at least 4.
4957  *
4958  * @param m map to get size.
4959  * @return -1 on error, points otherwise.
4960  */
4961 EAPI int               evas_map_count_get               (const Evas_Map *m) EINA_CONST;
4962
4963 /**
4964  * Change the map point's coordinate.
4965  *
4966  * This sets the fixed point's coordinate in the map. Note that points
4967  * describe the outline of a quadrangle and are ordered either clockwise
4968  * or anti-clock-wise. It is suggested to keep your quadrangles concave and
4969  * non-complex, though these polygon modes may work, they may not render
4970  * a desired set of output. The quadrangle will use points 0 and 1 , 1 and 2,
4971  * 2 and 3, and 3 and 0 to describe the edges of the quadrangle.
4972  *
4973  * The X and Y and Z coordinates are in canvas units. Z is optional and may
4974  * or may not be honored in drawing. Z is a hint and does not affect the
4975  * X and Y rendered coordinates. It may be used for calculating fills with
4976  * perspective correct rendering.
4977  *
4978  * Remember all coordinates are canvas global ones like with move and resize
4979  * in evas.
4980  *
4981  * @param m map to change point. Must not be @c NULL.
4982  * @param idx index of point to change. Must be smaller than map size.
4983  * @param x Point X Coordinate
4984  * @param y Point Y Coordinate
4985  * @param z Point Z Coordinate hint (pre-perspective transform)
4986  *
4987  * @see evas_map_util_rotate()
4988  * @see evas_map_util_zoom()
4989  * @see evas_map_util_points_populate_from_object_full()
4990  * @see evas_map_util_points_populate_from_object()
4991  */
4992 EAPI void              evas_map_point_coord_set          (Evas_Map *m, int idx, Evas_Coord x, Evas_Coord y, Evas_Coord z);
4993
4994 /**
4995  * Get the map point's coordinate.
4996  *
4997  * This returns the coordinates of the given point in the map.
4998  *
4999  * @param m map to query point.
5000  * @param idx index of point to query. Must be smaller than map size.
5001  * @param x where to return the X coordinate.
5002  * @param y where to return the Y coordinate.
5003  * @param z where to return the Z coordinate.
5004  */
5005 EAPI void              evas_map_point_coord_get          (const Evas_Map *m, int idx, Evas_Coord *x, Evas_Coord *y, Evas_Coord *z);
5006
5007 /**
5008  * Change the map point's U and V texture source point
5009  *
5010  * This sets the U and V coordinates for the point. This determines which
5011  * coordinate in the source image is mapped to the given point, much like
5012  * OpenGL and textures. Notes that these points do select the pixel, but
5013  * are double floating point values to allow for accuracy and sub-pixel
5014  * selection.
5015  *
5016  * @param m map to change the point of.
5017  * @param idx index of point to change. Must be smaller than map size.
5018  * @param u the X coordinate within the image/texture source
5019  * @param v the Y coordinate within the image/texture source
5020  *
5021  * @see evas_map_point_coord_set()
5022  * @see evas_object_map_set()
5023  * @see evas_map_util_points_populate_from_object_full()
5024  * @see evas_map_util_points_populate_from_object()
5025  */
5026 EAPI void              evas_map_point_image_uv_set       (Evas_Map *m, int idx, double u, double v);
5027
5028 /**
5029  * Get the map point's U and V texture source points
5030  *
5031  * This returns the texture points set by evas_map_point_image_uv_set().
5032  *
5033  * @param m map to query point.
5034  * @param idx index of point to query. Must be smaller than map size.
5035  * @param u where to write the X coordinate within the image/texture source
5036  * @param v where to write the Y coordinate within the image/texture source
5037  */
5038 EAPI void              evas_map_point_image_uv_get       (const Evas_Map *m, int idx, double *u, double *v);
5039
5040 /**
5041  * Set the color of a vertex in the map
5042  *
5043  * This sets the color of the vertex in the map. Colors will be linearly
5044  * interpolated between vertex points through the map. Color will multiply
5045  * the "texture" pixels (like GL_MODULATE in OpenGL). The default color of
5046  * a vertex in a map is white solid (255, 255, 255, 255) which means it will
5047  * have no affect on modifying the texture pixels.
5048  *
5049  * @param m map to change the color of.
5050  * @param idx index of point to change. Must be smaller than map size.
5051  * @param r red (0 - 255)
5052  * @param g green (0 - 255)
5053  * @param b blue (0 - 255)
5054  * @param a alpha (0 - 255)
5055  *
5056  * @see evas_map_util_points_color_set()
5057  * @see evas_map_point_coord_set()
5058  * @see evas_object_map_set()
5059  */
5060 EAPI void              evas_map_point_color_set          (Evas_Map *m, int idx, int r, int g, int b, int a);
5061
5062 /**
5063  * Get the color set on a vertex in the map
5064  *
5065  * This gets the color set by evas_map_point_color_set() on the given vertex
5066  * of the map.
5067  *
5068  * @param m map to get the color of the vertex from.
5069  * @param idx index of point get. Must be smaller than map size.
5070  * @param r pointer to red return
5071  * @param g pointer to green return
5072  * @param b pointer to blue return
5073  * @param a pointer to alpha return (0 - 255)
5074  *
5075  * @see evas_map_point_coord_set()
5076  * @see evas_object_map_set()
5077  */
5078 EAPI void              evas_map_point_color_get          (const Evas_Map *m, int idx, int *r, int *g, int *b, int *a);
5079 /**
5080  * @}
5081  */
5082
5083 /**
5084  * @defgroup Evas_Object_Group_Size_Hints Size Hints
5085  *
5086  * Objects may carry hints, so that another object that acts as a
5087  * manager (see @ref Evas_Smart_Object_Group) may know how to properly
5088  * position and resize its subordinate objects. The Size Hints provide
5089  * a common interface that is recommended as the protocol for such
5090  * information.
5091  *
5092  * For example, box objects use alignment hints to align its
5093  * lines/columns inside its container, padding hints to set the
5094  * padding between each individual child, etc.
5095  *
5096  * Examples on their usage:
5097  * - @ref Example_Evas_Size_Hints "evas-hints.c"
5098  * - @ref Example_Evas_Aspect_Hints "evas-aspect-hints.c"
5099  *
5100  * @ingroup Evas_Object_Group
5101  */
5102
5103 /**
5104  * @addtogroup Evas_Object_Group_Size_Hints
5105  * @{
5106  */
5107
5108 /**
5109  * Retrieves the hints for an object's minimum size.
5110  *
5111  * @param obj The given Evas object to query hints from.
5112  * @param w Pointer to an integer in which to store the minimum width.
5113  * @param h Pointer to an integer in which to store the minimum height.
5114  *
5115  * These are hints on the minimim sizes @p obj should have. This is
5116  * not a size enforcement in any way, it's just a hint that should be
5117  * used whenever appropriate.
5118  *
5119  * @note Use @c NULL pointers on the hint components you're not
5120  * interested in: they'll be ignored by the function.
5121  *
5122  * @see evas_object_size_hint_min_set() for an example
5123  */
5124 EAPI void              evas_object_size_hint_min_get     (const Evas_Object *obj, Evas_Coord *w, Evas_Coord *h) EINA_ARG_NONNULL(1);
5125
5126 /**
5127  * Sets the hints for an object's minimum size.
5128  *
5129  * @param obj The given Evas object to query hints from.
5130  * @param w Integer to use as the minimum width hint.
5131  * @param h Integer to use as the minimum height hint.
5132  *
5133  * This is not a size enforcement in any way, it's just a hint that
5134  * should be used whenever appropriate.
5135  *
5136  * Values @c 0 will be treated as unset hint components, when queried
5137  * by managers.
5138  *
5139  * Example:
5140  * @dontinclude evas-hints.c
5141  * @skip evas_object_size_hint_min_set
5142  * @until return
5143  *
5144  * In this example the minimum size hints change the behavior of an
5145  * Evas box when layouting its children. See the full @ref
5146  * Example_Evas_Size_Hints "example".
5147  *
5148  * @see evas_object_size_hint_min_get()
5149  */
5150 EAPI void              evas_object_size_hint_min_set     (Evas_Object *obj, Evas_Coord w, Evas_Coord h) EINA_ARG_NONNULL(1);
5151
5152 /**
5153  * Retrieves the hints for an object's maximum size.
5154  *
5155  * @param obj The given Evas object to query hints from.
5156  * @param w Pointer to an integer in which to store the maximum width.
5157  * @param h Pointer to an integer in which to store the maximum height.
5158  *
5159  * These are hints on the maximum sizes @p obj should have. This is
5160  * not a size enforcement in any way, it's just a hint that should be
5161  * used whenever appropriate.
5162  *
5163  * @note Use @c NULL pointers on the hint components you're not
5164  * interested in: they'll be ignored by the function.
5165  *
5166  * @see evas_object_size_hint_max_set()
5167  */
5168 EAPI void              evas_object_size_hint_max_get     (const Evas_Object *obj, Evas_Coord *w, Evas_Coord *h) EINA_ARG_NONNULL(1);
5169
5170 /**
5171  * Sets the hints for an object's maximum size.
5172  *
5173  * @param obj The given Evas object to query hints from.
5174  * @param w Integer to use as the maximum width hint.
5175  * @param h Integer to use as the maximum height hint.
5176  *
5177  * This is not a size enforcement in any way, it's just a hint that
5178  * should be used whenever appropriate.
5179  *
5180  * Values @c -1 will be treated as unset hint components, when queried
5181  * by managers.
5182  *
5183  * Example:
5184  * @dontinclude evas-hints.c
5185  * @skip evas_object_size_hint_max_set
5186  * @until return
5187  *
5188  * In this example the maximum size hints change the behavior of an
5189  * Evas box when layouting its children. See the full @ref
5190  * Example_Evas_Size_Hints "example".
5191  *
5192  * @see evas_object_size_hint_max_get()
5193  */
5194 EAPI void              evas_object_size_hint_max_set     (Evas_Object *obj, Evas_Coord w, Evas_Coord h) EINA_ARG_NONNULL(1);
5195
5196 /**
5197  * Retrieves the hints for an object's optimum size.
5198  *
5199  * @param obj The given Evas object to query hints from.
5200  * @param w Pointer to an integer in which to store the requested width.
5201  * @param h Pointer to an integer in which to store the requested height.
5202  *
5203  * These are hints on the optimum sizes @p obj should have. This is
5204  * not a size enforcement in any way, it's just a hint that should be
5205  * used whenever appropriate.
5206  *
5207  * @note Use @c NULL pointers on the hint components you're not
5208  * interested in: they'll be ignored by the function.
5209  *
5210  * @see evas_object_size_hint_request_set()
5211  */
5212 EAPI void              evas_object_size_hint_request_get (const Evas_Object *obj, Evas_Coord *w, Evas_Coord *h) EINA_ARG_NONNULL(1);
5213
5214 /**
5215  * Sets the hints for an object's optimum size.
5216  *
5217  * @param obj The given Evas object to query hints from.
5218  * @param w Integer to use as the preferred width hint.
5219  * @param h Integer to use as the preferred height hint.
5220  *
5221  * This is not a size enforcement in any way, it's just a hint that
5222  * should be used whenever appropriate.
5223  *
5224  * Values @c 0 will be treated as unset hint components, when queried
5225  * by managers.
5226  *
5227  * @see evas_object_size_hint_request_get()
5228  */
5229 EAPI void              evas_object_size_hint_request_set (Evas_Object *obj, Evas_Coord w, Evas_Coord h) EINA_ARG_NONNULL(1);
5230
5231 /**
5232  * Retrieves the hints for an object's aspect ratio.
5233  *
5234  * @param obj The given Evas object to query hints from.
5235  * @param aspect Returns the policy/type of aspect ratio applied to @p obj.
5236  * @param w Pointer to an integer in which to store the aspect's width
5237  * ratio term.
5238  * @param h Pointer to an integer in which to store the aspect's
5239  * height ratio term.
5240  *
5241  * The different aspect ratio policies are documented in the
5242  * #Evas_Aspect_Control type. A container respecting these size hints
5243  * would @b resize its children accordingly to those policies.
5244  *
5245  * For any policy, if any of the given aspect ratio terms are @c 0,
5246  * the object's container should ignore the aspect and scale @p obj to
5247  * occupy the whole available area. If they are both positive
5248  * integers, that proportion will be respected, under each scaling
5249  * policy.
5250  *
5251  * These images illustrate some of the #Evas_Aspect_Control policies:
5252  *
5253  * @image html any-policy.png
5254  * @image rtf any-policy.png
5255  * @image latex any-policy.eps
5256  *
5257  * @image html aspect-control-none-neither.png
5258  * @image rtf aspect-control-none-neither.png
5259  * @image latex aspect-control-none-neither.eps
5260  *
5261  * @image html aspect-control-both.png
5262  * @image rtf aspect-control-both.png
5263  * @image latex aspect-control-both.eps
5264  *
5265  * @image html aspect-control-horizontal.png
5266  * @image rtf aspect-control-horizontal.png
5267  * @image latex aspect-control-horizontal.eps
5268  *
5269  * This is not a size enforcement in any way, it's just a hint that
5270  * should be used whenever appropriate.
5271  *
5272  * @note Use @c NULL pointers on the hint components you're not
5273  * interested in: they'll be ignored by the function.
5274  *
5275  * Example:
5276  * @dontinclude evas-aspect-hints.c
5277  * @skip if (strcmp(ev->keyname, "c") == 0)
5278  * @until }
5279  *
5280  * See the full @ref Example_Evas_Aspect_Hints "example".
5281  *
5282  * @see evas_object_size_hint_aspect_set()
5283  */
5284 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);
5285
5286 /**
5287  * Sets the hints for an object's aspect ratio.
5288  *
5289  * @param obj The given Evas object to query hints from.
5290  * @param aspect The policy/type of aspect ratio to apply to @p obj.
5291  * @param w Integer to use as aspect width ratio term.
5292  * @param h Integer to use as aspect height ratio term.
5293  *
5294  * This is not a size enforcement in any way, it's just a hint that should
5295  * be used whenever appropriate.
5296  *
5297  * If any of the given aspect ratio terms are @c 0,
5298  * the object's container will ignore the aspect and scale @p obj to
5299  * occupy the whole available area, for any given policy.
5300  *
5301  * @see evas_object_size_hint_aspect_get() for more information.
5302  */
5303 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);
5304
5305 /**
5306  * Retrieves the hints for on object's alignment.
5307  *
5308  * @param obj The given Evas object to query hints from.
5309  * @param x Pointer to a double in which to store the horizontal
5310  * alignment hint.
5311  * @param y Pointer to a double in which to store the vertical
5312  * alignment hint.
5313  *
5314  * This is not a size enforcement in any way, it's just a hint that
5315  * should be used whenever appropriate.
5316  *
5317  * @note Use @c NULL pointers on the hint components you're not
5318  * interested in: they'll be ignored by the function.
5319  *
5320  * @see evas_object_size_hint_align_set() for more information
5321  */
5322 EAPI void              evas_object_size_hint_align_get   (const Evas_Object *obj, double *x, double *y) EINA_ARG_NONNULL(1);
5323
5324 /**
5325  * Sets the hints for an object's alignment.
5326  *
5327  * @param obj The given Evas object to query hints from.
5328  * @param x Double, ranging from @c 0.0 to @c 1.0 or with the
5329  * special value #EVAS_HINT_FILL, to use as horizontal alignment hint.
5330  * @param y Double, ranging from @c 0.0 to @c 1.0 or with the
5331  * special value #EVAS_HINT_FILL, to use as vertical alignment hint.
5332  *
5333  * These are hints on how to align an object <b>inside the boundaries
5334  * of a container/manager</b>. Accepted values are in the @c 0.0 to @c
5335  * 1.0 range, with the special value #EVAS_HINT_FILL used to specify
5336  * "justify" or "fill" by some users. In this case, maximum size hints
5337  * should be enforced with higher priority, if they are set. Also, any
5338  * padding hint set on objects should add up to the alignment space on
5339  * the final scene composition.
5340  *
5341  * See documentation of possible users: in Evas, they are the @ref
5342  * Evas_Object_Box "box" and @ref Evas_Object_Table "table" smart
5343  * objects.
5344  *
5345  * For the horizontal component, @c 0.0 means to the left, @c 1.0
5346  * means to the right. Analogously, for the vertical component, @c 0.0
5347  * to the top, @c 1.0 means to the bottom.
5348  *
5349  * See the following figure:
5350  *
5351  * @image html alignment-hints.png
5352  * @image rtf alignment-hints.png
5353  * @image latex alignment-hints.eps
5354  *
5355  * This is not a size enforcement in any way, it's just a hint that
5356  * should be used whenever appropriate.
5357  *
5358  * Example:
5359  * @dontinclude evas-hints.c
5360  * @skip evas_object_size_hint_align_set
5361  * @until return
5362  *
5363  * In this example the alignment hints change the behavior of an Evas
5364  * box when layouting its children. See the full @ref
5365  * Example_Evas_Size_Hints "example".
5366  *
5367  * @see evas_object_size_hint_align_get()
5368  * @see evas_object_size_hint_max_set()
5369  * @see evas_object_size_hint_padding_set()
5370  */
5371 EAPI void              evas_object_size_hint_align_set   (Evas_Object *obj, double x, double y) EINA_ARG_NONNULL(1);
5372
5373 /**
5374  * Retrieves the hints for an object's weight.
5375  *
5376  * @param obj The given Evas object to query hints from.
5377  * @param x Pointer to a double in which to store the horizontal weight.
5378  * @param y Pointer to a double in which to store the vertical weight.
5379  *
5380  * Accepted values are zero or positive values. Some users might use
5381  * this hint as a boolean, but some might consider it as a @b
5382  * proportion, see documentation of possible users, which in Evas are
5383  * the @ref Evas_Object_Box "box" and @ref Evas_Object_Table "table"
5384  * smart objects.
5385  *
5386  * This is not a size enforcement in any way, it's just a hint that
5387  * should be used whenever appropriate.
5388  *
5389  * @note Use @c NULL pointers on the hint components you're not
5390  * interested in: they'll be ignored by the function.
5391  *
5392  * @see evas_object_size_hint_weight_set() for an example
5393  */
5394 EAPI void              evas_object_size_hint_weight_get  (const Evas_Object *obj, double *x, double *y) EINA_ARG_NONNULL(1);
5395
5396 /**
5397  * Sets the hints for an object's weight.
5398  *
5399  * @param obj The given Evas object to query hints from.
5400  * @param x Nonnegative double value to use as horizontal weight hint.
5401  * @param y Nonnegative double value to use as vertical weight hint.
5402  *
5403  * This is not a size enforcement in any way, it's just a hint that
5404  * should be used whenever appropriate.
5405  *
5406  * This is a hint on how a container object should @b resize a given
5407  * child within its area. Containers may adhere to the simpler logic
5408  * of just expanding the child object's dimensions to fit its own (see
5409  * the #EVAS_HINT_EXPAND helper weight macro) or the complete one of
5410  * taking each child's weight hint as real @b weights to how much of
5411  * its size to allocate for them in each axis. A container is supposed
5412  * to, after @b normalizing the weights of its children (with weight
5413  * hints), distribute the space it has to layout them by those factors
5414  * -- most weighted children get larger in this process than the least
5415  * ones.
5416  *
5417  * Example:
5418  * @dontinclude evas-hints.c
5419  * @skip evas_object_size_hint_weight_set
5420  * @until return
5421  *
5422  * In this example the weight hints change the behavior of an Evas box
5423  * when layouting its children. See the full @ref
5424  * Example_Evas_Size_Hints "example".
5425  *
5426  * @see evas_object_size_hint_weight_get() for more information
5427  */
5428 EAPI void              evas_object_size_hint_weight_set  (Evas_Object *obj, double x, double y) EINA_ARG_NONNULL(1);
5429
5430 /**
5431  * Retrieves the hints for an object's padding space.
5432  *
5433  * @param obj The given Evas object to query hints from.
5434  * @param l Pointer to an integer in which to store left padding.
5435  * @param r Pointer to an integer in which to store right padding.
5436  * @param t Pointer to an integer in which to store top padding.
5437  * @param b Pointer to an integer in which to store bottom padding.
5438  *
5439  * Padding is extra space an object takes on each of its delimiting
5440  * rectangle sides, in canvas units. This space will be rendered
5441  * transparent, naturally, as in the following figure:
5442  *
5443  * @image html padding-hints.png
5444  * @image rtf padding-hints.png
5445  * @image latex padding-hints.eps
5446  *
5447  * This is not a size enforcement in any way, it's just a hint that
5448  * should be used whenever appropriate.
5449  *
5450  * @note Use @c NULL pointers on the hint components you're not
5451  * interested in: they'll be ignored by the function.
5452  *
5453  * Example:
5454  * @dontinclude evas-hints.c
5455  * @skip evas_object_size_hint_padding_set
5456  * @until return
5457  *
5458  * In this example the padding hints change the behavior of an Evas box
5459  * when layouting its children. See the full @ref
5460  * Example_Evas_Size_Hints "example".
5461  *
5462  * @see evas_object_size_hint_padding_set()
5463  */
5464 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);
5465
5466 /**
5467  * Sets the hints for an object's padding space.
5468  *
5469  * @param obj The given Evas object to query hints from.
5470  * @param l Integer to specify left padding.
5471  * @param r Integer to specify right padding.
5472  * @param t Integer to specify top padding.
5473  * @param b Integer to specify bottom padding.
5474  *
5475  * This is not a size enforcement in any way, it's just a hint that
5476  * should be used whenever appropriate.
5477  *
5478  * @see evas_object_size_hint_padding_get() for more information
5479  */
5480 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);
5481
5482 /**
5483  * @}
5484  */
5485
5486 /**
5487  * @defgroup Evas_Object_Group_Extras Extra Object Manipulation
5488  *
5489  * Miscellaneous functions that also apply to any object, but are less
5490  * used or not implemented by all objects.
5491  *
5492  * Examples on this group of functions can be found @ref
5493  * Example_Evas_Stacking "here" and @ref Example_Evas_Events "here".
5494  *
5495  * @ingroup Evas_Object_Group
5496  */
5497
5498 /**
5499  * @addtogroup Evas_Object_Group_Extras
5500  * @{
5501  */
5502
5503 /**
5504  * Set an attached data pointer to an object with a given string key.
5505  *
5506  * @param obj The object to attach the data pointer to
5507  * @param key The string key for the data to access it
5508  * @param data The pointer to the data to be attached
5509  *
5510  * This attaches the pointer @p data to the object @p obj, given the
5511  * access string @p key. This pointer will stay "hooked" to the object
5512  * until a new pointer with the same string key is attached with
5513  * evas_object_data_set() or it is deleted with
5514  * evas_object_data_del(). On deletion of the object @p obj, the
5515  * pointers will not be accessible from the object anymore.
5516  *
5517  * You can find the pointer attached under a string key using
5518  * evas_object_data_get(). It is the job of the calling application to
5519  * free any data pointed to by @p data when it is no longer required.
5520  *
5521  * If @p data is @c NULL, the old value stored at @p key will be
5522  * removed but no new value will be stored. This is synonymous with
5523  * calling evas_object_data_del() with @p obj and @p key.
5524  *
5525  * @note This function is very handy when you have data associated
5526  * specifically to an Evas object, being of use only when dealing with
5527  * it. Than you don't have the burden to a pointer to it elsewhere,
5528  * using this family of functions.
5529  *
5530  * Example:
5531  *
5532  * @code
5533  * int *my_data;
5534  * extern Evas_Object *obj;
5535  *
5536  * my_data = malloc(500);
5537  * evas_object_data_set(obj, "name_of_data", my_data);
5538  * printf("The data that was attached was %p\n", evas_object_data_get(obj, "name_of_data"));
5539  * @endcode
5540  */
5541 EAPI void                      evas_object_data_set             (Evas_Object *obj, const char *key, const void *data) EINA_ARG_NONNULL(1, 2);
5542
5543 /**
5544  * Return an attached data pointer on an Evas object by its given
5545  * string key.
5546  *
5547  * @param obj The object to which the data was attached
5548  * @param key The string key the data was stored under
5549  * @return The data pointer stored, or @c NULL if none was stored
5550  *
5551  * This function will return the data pointer attached to the object
5552  * @p obj, stored using the string key @p key. If the object is valid
5553  * and a data pointer was stored under the given key, that pointer
5554  * will be returned. If this is not the case, @c NULL will be
5555  * returned, signifying an invalid object or a non-existent key. It is
5556  * possible that a @c NULL pointer was stored given that key, but this
5557  * situation is non-sensical and thus can be considered an error as
5558  * well. @c NULL pointers are never stored as this is the return value
5559  * if an error occurs.
5560  *
5561  * Example:
5562  *
5563  * @code
5564  * int *my_data;
5565  * extern Evas_Object *obj;
5566  *
5567  * my_data = evas_object_data_get(obj, "name_of_my_data");
5568  * if (my_data) printf("Data stored was %p\n", my_data);
5569  * else printf("No data was stored on the object\n");
5570  * @endcode
5571  */
5572 EAPI void                     *evas_object_data_get             (const Evas_Object *obj, const char *key) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2);
5573
5574 /**
5575  * Delete an attached data pointer from an object.
5576  *
5577  * @param obj The object to delete the data pointer from
5578  * @param key The string key the data was stored under
5579  * @return The original data pointer stored at @p key on @p obj
5580  *
5581  * This will remove the stored data pointer from @p obj stored under
5582  * @p key and return this same pointer, if actually there was data
5583  * there, or @c NULL, if nothing was stored under that key.
5584  *
5585  * Example:
5586  *
5587  * @code
5588  * int *my_data;
5589  * extern Evas_Object *obj;
5590  *
5591  * my_data = evas_object_data_del(obj, "name_of_my_data");
5592  * @endcode
5593  */
5594 EAPI void                     *evas_object_data_del             (Evas_Object *obj, const char *key) EINA_ARG_NONNULL(1, 2);
5595
5596
5597 /**
5598  * Set pointer behavior.
5599  *
5600  * @param obj
5601  * @param setting desired behavior.
5602  *
5603  * This function has direct effect on event callbacks related to
5604  * mouse.
5605  *
5606  * If @p setting is EVAS_OBJECT_POINTER_MODE_AUTOGRAB, then when mouse
5607  * is down at this object, events will be restricted to it as source,
5608  * mouse moves, for example, will be emitted even if outside this
5609  * object area.
5610  *
5611  * If @p setting is EVAS_OBJECT_POINTER_MODE_NOGRAB, then events will
5612  * be emitted just when inside this object area.
5613  *
5614  * The default value is EVAS_OBJECT_POINTER_MODE_AUTOGRAB.
5615  *
5616  * @ingroup Evas_Object_Group_Extras
5617  */
5618 EAPI void                      evas_object_pointer_mode_set     (Evas_Object *obj, Evas_Object_Pointer_Mode setting) EINA_ARG_NONNULL(1);
5619
5620 /**
5621  * Determine how pointer will behave.
5622  * @param obj
5623  * @return pointer behavior.
5624  * @ingroup Evas_Object_Group_Extras
5625  */
5626 EAPI Evas_Object_Pointer_Mode  evas_object_pointer_mode_get     (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
5627
5628
5629 /**
5630  * Sets whether or not the given Evas object is to be drawn anti-aliased.
5631  *
5632  * @param   obj The given Evas object.
5633  * @param   antialias 1 if the object is to be anti_aliased, 0 otherwise.
5634  * @ingroup Evas_Object_Group_Extras
5635  */
5636 EAPI void                      evas_object_anti_alias_set       (Evas_Object *obj, Eina_Bool antialias) EINA_ARG_NONNULL(1);
5637
5638 /**
5639  * Retrieves whether or not the given Evas object is to be drawn anti_aliased.
5640  * @param   obj The given Evas object.
5641  * @return  @c 1 if the object is to be anti_aliased.  @c 0 otherwise.
5642  * @ingroup Evas_Object_Group_Extras
5643  */
5644 EAPI Eina_Bool                 evas_object_anti_alias_get       (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
5645
5646
5647 /**
5648  * Sets the scaling factor for an Evas object. Does not affect all
5649  * objects.
5650  *
5651  * @param obj The given Evas object.
5652  * @param scale The scaling factor. <c>1.0</c> means no scaling,
5653  *        default size.
5654  *
5655  * This will multiply the object's dimension by the given factor, thus
5656  * altering its geometry (width and height). Useful when you want
5657  * scalable UI elements, possibly at run time.
5658  *
5659  * @note Only text and textblock objects have scaling change
5660  * handlers. Other objects won't change visually on this call.
5661  *
5662  * @see evas_object_scale_get()
5663  *
5664  * @ingroup Evas_Object_Group_Extras
5665  */
5666 EAPI void                      evas_object_scale_set            (Evas_Object *obj, double scale) EINA_ARG_NONNULL(1);
5667
5668 /**
5669  * Retrieves the scaling factor for the given Evas object.
5670  *
5671  * @param   obj The given Evas object.
5672  * @return  The scaling factor.
5673  *
5674  * @ingroup Evas_Object_Group_Extras
5675  *
5676  * @see evas_object_scale_set()
5677  */
5678 EAPI double                    evas_object_scale_get            (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
5679
5680
5681 /**
5682  * Sets the render_op to be used for rendering the Evas object.
5683  * @param   obj The given Evas object.
5684  * @param   op one of the Evas_Render_Op values.
5685  * @ingroup Evas_Object_Group_Extras
5686  */
5687 EAPI void                      evas_object_render_op_set        (Evas_Object *obj, Evas_Render_Op op) EINA_ARG_NONNULL(1);
5688
5689 /**
5690  * Retrieves the current value of the operation used for rendering the Evas object.
5691  * @param   obj The given Evas object.
5692  * @return  one of the enumerated values in Evas_Render_Op.
5693  * @ingroup Evas_Object_Group_Extras
5694  */
5695 EAPI Evas_Render_Op            evas_object_render_op_get        (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
5696
5697 /**
5698  * Set whether to use precise (usually expensive) point collision
5699  * detection for a given Evas object.
5700  *
5701  * @param obj The given object.
5702  * @param precise whether to use precise point collision detection or
5703  * not The default value is false.
5704  *
5705  * Use this function to make Evas treat objects' transparent areas as
5706  * @b not belonging to it with regard to mouse pointer events. By
5707  * default, all of the object's boundary rectangle will be taken in
5708  * account for them.
5709  *
5710  * @warning By using precise point collision detection you'll be
5711  * making Evas more resource intensive.
5712  *
5713  * Example code follows.
5714  * @dontinclude evas-events.c
5715  * @skip if (strcmp(ev->keyname, "p") == 0)
5716  * @until }
5717  *
5718  * See the full example @ref Example_Evas_Events "here".
5719  *
5720  * @see evas_object_precise_is_inside_get()
5721  * @ingroup Evas_Object_Group_Extras
5722  */
5723    EAPI void                      evas_object_precise_is_inside_set(Evas_Object *obj, Eina_Bool precise) EINA_ARG_NONNULL(1);
5724
5725 /**
5726  * Determine whether an object is set to use precise point collision
5727  * detection.
5728  *
5729  * @param obj The given object.
5730  * @return whether @p obj is set to use precise point collision
5731  * detection or not The default value is false.
5732  *
5733  * @see evas_object_precise_is_inside_set() for an example
5734  *
5735  * @ingroup Evas_Object_Group_Extras
5736  */
5737    EAPI Eina_Bool                 evas_object_precise_is_inside_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
5738
5739 /**
5740  * Set a hint flag on the given Evas object that it's used as a "static
5741  * clipper".
5742  *
5743  * @param obj The given object.
5744  * @param is_static_clip @c EINA_TRUE if it's to be used as a static
5745  * clipper, @c EINA_FALSE otherwise
5746  *
5747  * This is a hint to Evas that this object is used as a big static
5748  * clipper and shouldn't be moved with children and otherwise
5749  * considered specially. The default value for new objects is @c
5750  * EINA_FALSE.
5751  *
5752  * @see evas_object_static_clip_get()
5753  *
5754  * @ingroup Evas_Object_Group_Extras
5755  */
5756    EAPI void                      evas_object_static_clip_set      (Evas_Object *obj, Eina_Bool is_static_clip) EINA_ARG_NONNULL(1);
5757
5758 /**
5759  * Get the "static clipper" hint flag for a given Evas object.
5760  *
5761  * @param obj The given object.
5762  * @return @c EINA_TRUE if it's set as a static clipper, @c
5763  * EINA_FALSE otherwise
5764  *
5765  * @see evas_object_static_clip_set() for more details
5766  *
5767  * @ingroup Evas_Object_Group_Extras
5768  */
5769    EAPI Eina_Bool                 evas_object_static_clip_get      (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
5770
5771 /**
5772  * @}
5773  */
5774
5775 /**
5776  * @defgroup Evas_Object_Group_Find Finding Objects
5777  *
5778  * Functions that allows finding objects by their position, name or
5779  * other properties.
5780  *
5781  * @ingroup Evas_Object_Group
5782  */
5783
5784 /**
5785  * @addtogroup Evas_Object_Group_Find
5786  * @{
5787  */
5788
5789 /**
5790  * Retrieve the object that currently has focus.
5791  *
5792  * @param e The Evas canvas to query for focused object on.
5793  * @return The object that has focus or @c NULL if there is not one.
5794  *
5795  * Evas can have (at most) one of its objects focused at a time.
5796  * Focused objects will be the ones having <b>key events</b> delivered
5797  * to, which the programmer can act upon by means of
5798  * evas_object_event_callback_add() usage.
5799  *
5800  * @note Most users wouldn't be dealing directly with Evas' focused
5801  * objects. Instead, they would be using a higher level library for
5802  * that (like a toolkit, as Elementary) to handle focus and who's
5803  * receiving input for them.
5804  *
5805  * This call returns the object that currently has focus on the canvas
5806  * @p e or @c NULL, if none.
5807  *
5808  * @see evas_object_focus_set
5809  * @see evas_object_focus_get
5810  * @see evas_object_key_grab
5811  * @see evas_object_key_ungrab
5812  *
5813  * Example:
5814  * @dontinclude evas-events.c
5815  * @skip evas_event_callback_add(d.canvas, EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_IN,
5816  * @until evas_object_focus_set(d.bg, EINA_TRUE);
5817  * @dontinclude evas-events.c
5818  * @skip called when our rectangle gets focus
5819  * @until }
5820  *
5821  * In this example the @c event_info is exactly a pointer to that
5822  * focused rectangle. See the full @ref Example_Evas_Events "example".
5823  *
5824  * @ingroup Evas_Object_Group_Find
5825  */
5826 EAPI Evas_Object      *evas_focus_get                    (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
5827
5828 /**
5829  * Retrieves the object on the given evas with the given name.
5830  * @param   e    The given evas.
5831  * @param   name The given name.
5832  * @return  If successful, the Evas object with the given name.  Otherwise,
5833  *          @c NULL.
5834  * 
5835  * This looks for the evas object given a name by evas_object_name_set(). If
5836  * the name is not unique canvas-wide, then which one of the many objects
5837  * with that name is returned is undefined, so only use this if you can ensure
5838  * the object name is unique.
5839  * 
5840  * @ingroup Evas_Object_Group_Find
5841  */
5842 EAPI Evas_Object      *evas_object_name_find             (const Evas *e, const char *name) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
5843
5844 /**
5845  * Retrieves the object from children of the given object with the given name.
5846  * @param   obj  The parent (smart) object whose children to search.
5847  * @param   name The given name.
5848  * @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.).
5849  * @return  If successful, the Evas object with the given name.  Otherwise,
5850  *          @c NULL.
5851  * 
5852  * This looks for the evas object given a name by evas_object_name_set(), but
5853  * it ONLY looks at the children of the object *p obj, and will only recurse
5854  * into those children if @p recurse is greater than 0. If the name is not
5855  * unique within immediate children (or the whole child tree) then it is not
5856  * defined which child object will be returned. If @p recurse is set to -1 then
5857  * it will recurse without limit.
5858  * 
5859  * @since 1.2
5860  * 
5861  * @ingroup Evas_Object_Group_Find
5862  */
5863 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);
5864
5865 /**
5866  * Retrieve the Evas object stacked at the top of a given position in
5867  * a canvas
5868  *
5869  * @param   e A handle to the canvas.
5870  * @param   x The horizontal coordinate of the position
5871  * @param   y The vertical coordinate of the position
5872  * @param   include_pass_events_objects Boolean flag to include or not
5873  * objects which pass events in this calculation
5874  * @param   include_hidden_objects Boolean flag to include or not hidden
5875  * objects in this calculation
5876  * @return  The Evas object that is over all other objects at the given
5877  * position.
5878  *
5879  * This function will traverse all the layers of the given canvas,
5880  * from top to bottom, querying for objects with areas covering the
5881  * given position. The user can remove from from the query
5882  * objects which are hidden and/or which are set to pass events.
5883  *
5884  * @warning This function will @b skip objects parented by smart
5885  * objects, acting only on the ones at the "top level", with regard to
5886  * object parenting.
5887  */
5888 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);
5889
5890 /**
5891  * Retrieve the Evas object stacked at the top at the position of the
5892  * mouse cursor, over a given canvas
5893  *
5894  * @param   e A handle to the canvas.
5895  * @return  The Evas object that is over all other objects at the mouse
5896  * pointer's position
5897  *
5898  * This function will traverse all the layers of the given canvas,
5899  * from top to bottom, querying for objects with areas covering the
5900  * mouse pointer's position, over @p e.
5901  *
5902  * @warning This function will @b skip objects parented by smart
5903  * objects, acting only on the ones at the "top level", with regard to
5904  * object parenting.
5905  */
5906 EAPI Evas_Object      *evas_object_top_at_pointer_get    (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
5907
5908 /**
5909  * Retrieve the Evas object stacked at the top of a given rectangular
5910  * region in a canvas
5911  *
5912  * @param   e A handle to the canvas.
5913  * @param   x The top left corner's horizontal coordinate for the
5914  * rectangular region
5915  * @param   y The top left corner's vertical coordinate for the
5916  * rectangular region
5917  * @param   w The width of the rectangular region
5918  * @param   h The height of the rectangular region
5919  * @param   include_pass_events_objects Boolean flag to include or not
5920  * objects which pass events in this calculation
5921  * @param   include_hidden_objects Boolean flag to include or not hidden
5922  * objects in this calculation
5923  * @return  The Evas object that is over all other objects at the given
5924  * rectangular region.
5925  *
5926  * This function will traverse all the layers of the given canvas,
5927  * from top to bottom, querying for objects with areas overlapping
5928  * with the given rectangular region inside @p e. The user can remove
5929  * from the query objects which are hidden and/or which are set to
5930  * pass events.
5931  *
5932  * @warning This function will @b skip objects parented by smart
5933  * objects, acting only on the ones at the "top level", with regard to
5934  * object parenting.
5935  */
5936 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);
5937
5938 /**
5939  * Retrieve a list of Evas objects lying over a given position in
5940  * a canvas
5941  *
5942  * @param   e A handle to the canvas.
5943  * @param   x The horizontal coordinate of the position
5944  * @param   y The vertical coordinate of the position
5945  * @param   include_pass_events_objects Boolean flag to include or not
5946  * objects which pass events in this calculation
5947  * @param   include_hidden_objects Boolean flag to include or not hidden
5948  * objects in this calculation
5949  * @return  The list of Evas objects that are over the given position
5950  * in @p e
5951  *
5952  * This function will traverse all the layers of the given canvas,
5953  * from top to bottom, querying for objects with areas covering the
5954  * given position. The user can remove from from the query
5955  * objects which are hidden and/or which are set to pass events.
5956  *
5957  * @warning This function will @b skip objects parented by smart
5958  * objects, acting only on the ones at the "top level", with regard to
5959  * object parenting.
5960  */
5961 EAPI 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);
5962    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);
5963
5964 /**
5965  * Get the lowest (stacked) Evas object on the canvas @p e.
5966  *
5967  * @param e a valid canvas pointer
5968  * @return a pointer to the lowest object on it, if any, or @c NULL,
5969  * otherwise
5970  *
5971  * This function will take all populated layers in the canvas into
5972  * account, getting the lowest object for the lowest layer, naturally.
5973  *
5974  * @see evas_object_layer_get()
5975  * @see evas_object_layer_set()
5976  * @see evas_object_below_get()
5977  * @see evas_object_above_get()
5978  *
5979  * @warning This function will @b skip objects parented by smart
5980  * objects, acting only on the ones at the "top level", with regard to
5981  * object parenting.
5982  */
5983 EAPI Evas_Object      *evas_object_bottom_get            (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
5984
5985 /**
5986  * Get the highest (stacked) Evas object on the canvas @p e.
5987  *
5988  * @param e a valid canvas pointer
5989  * @return a pointer to the highest object on it, if any, or @c NULL,
5990  * otherwise
5991  *
5992  * This function will take all populated layers in the canvas into
5993  * account, getting the highest object for the highest layer,
5994  * naturally.
5995  *
5996  * @see evas_object_layer_get()
5997  * @see evas_object_layer_set()
5998  * @see evas_object_below_get()
5999  * @see evas_object_above_get()
6000  *
6001  * @warning This function will @b skip objects parented by smart
6002  * objects, acting only on the ones at the "top level", with regard to
6003  * object parenting.
6004  */
6005 EAPI Evas_Object      *evas_object_top_get               (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
6006
6007 /**
6008  * @}
6009  */
6010
6011 /**
6012  * @defgroup Evas_Object_Group_Interceptors Object Method Interceptors
6013  *
6014  * Evas provides a way to intercept method calls. The interceptor
6015  * callback may opt to completely deny the call, or may check and
6016  * change the parameters before continuing. The continuation of an
6017  * intercepted call is done by calling the intercepted call again,
6018  * from inside the interceptor callback.
6019  *
6020  * @ingroup Evas_Object_Group
6021  */
6022
6023 /**
6024  * @addtogroup Evas_Object_Group_Interceptors
6025  * @{
6026  */
6027
6028 typedef void (*Evas_Object_Intercept_Show_Cb) (void *data, Evas_Object *obj);
6029 typedef void (*Evas_Object_Intercept_Hide_Cb) (void *data, Evas_Object *obj);
6030 typedef void (*Evas_Object_Intercept_Move_Cb) (void *data, Evas_Object *obj, Evas_Coord x, Evas_Coord y);
6031 typedef void (*Evas_Object_Intercept_Resize_Cb) (void *data, Evas_Object *obj, Evas_Coord w, Evas_Coord h);
6032 typedef void (*Evas_Object_Intercept_Raise_Cb) (void *data, Evas_Object *obj);
6033 typedef void (*Evas_Object_Intercept_Lower_Cb) (void *data, Evas_Object *obj);
6034 typedef void (*Evas_Object_Intercept_Stack_Above_Cb) (void *data, Evas_Object *obj, Evas_Object *above);
6035 typedef void (*Evas_Object_Intercept_Stack_Below_Cb) (void *data, Evas_Object *obj, Evas_Object *above);
6036 typedef void (*Evas_Object_Intercept_Layer_Set_Cb) (void *data, Evas_Object *obj, int l);
6037 typedef void (*Evas_Object_Intercept_Color_Set_Cb) (void *data, Evas_Object *obj, int r, int g, int b, int a);
6038 typedef void (*Evas_Object_Intercept_Clip_Set_Cb) (void *data, Evas_Object *obj, Evas_Object *clip);
6039 typedef void (*Evas_Object_Intercept_Clip_Unset_Cb) (void *data, Evas_Object *obj);
6040
6041 /**
6042  * Set the callback function that intercepts a show event of a object.
6043  *
6044  * @param obj The given canvas object pointer.
6045  * @param func The given function to be the callback function.
6046  * @param data The data passed to the callback function.
6047  *
6048  * This function sets a callback function to intercepts a show event
6049  * of a canvas object.
6050  *
6051  * @see evas_object_intercept_show_callback_del().
6052  *
6053  */
6054 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);
6055
6056 /**
6057  * Unset the callback function that intercepts a show event of a
6058  * object.
6059  *
6060  * @param obj The given canvas object pointer.
6061  * @param func The given callback function.
6062  *
6063  * This function sets a callback function to intercepts a show event
6064  * of a canvas object.
6065  *
6066  * @see evas_object_intercept_show_callback_add().
6067  *
6068  */
6069 EAPI void             *evas_object_intercept_show_callback_del        (Evas_Object *obj, Evas_Object_Intercept_Show_Cb func) EINA_ARG_NONNULL(1, 2);
6070
6071 /**
6072  * Set the callback function that intercepts a hide event of a object.
6073  *
6074  * @param obj The given canvas object pointer.
6075  * @param func The given function to be the callback function.
6076  * @param data The data passed to the callback function.
6077  *
6078  * This function sets a callback function to intercepts a hide event
6079  * of a canvas object.
6080  *
6081  * @see evas_object_intercept_hide_callback_del().
6082  *
6083  */
6084 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);
6085
6086 /**
6087  * Unset the callback function that intercepts a hide event of a
6088  * object.
6089  *
6090  * @param obj The given canvas object pointer.
6091  * @param func The given callback function.
6092  *
6093  * This function sets a callback function to intercepts a hide event
6094  * of a canvas object.
6095  *
6096  * @see evas_object_intercept_hide_callback_add().
6097  *
6098  */
6099 EAPI void             *evas_object_intercept_hide_callback_del        (Evas_Object *obj, Evas_Object_Intercept_Hide_Cb func) EINA_ARG_NONNULL(1, 2);
6100
6101 /**
6102  * Set the callback function that intercepts a move event of a object.
6103  *
6104  * @param obj The given canvas object pointer.
6105  * @param func The given function to be the callback function.
6106  * @param data The data passed to the callback function.
6107  *
6108  * This function sets a callback function to intercepts a move event
6109  * of a canvas object.
6110  *
6111  * @see evas_object_intercept_move_callback_del().
6112  *
6113  */
6114 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);
6115
6116 /**
6117  * Unset the callback function that intercepts a move event of a
6118  * object.
6119  *
6120  * @param obj The given canvas object pointer.
6121  * @param func The given callback function.
6122  *
6123  * This function sets a callback function to intercepts a move event
6124  * of a canvas object.
6125  *
6126  * @see evas_object_intercept_move_callback_add().
6127  *
6128  */
6129 EAPI void             *evas_object_intercept_move_callback_del        (Evas_Object *obj, Evas_Object_Intercept_Move_Cb func) EINA_ARG_NONNULL(1, 2);
6130
6131    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);
6132    EAPI void             *evas_object_intercept_resize_callback_del      (Evas_Object *obj, Evas_Object_Intercept_Resize_Cb func) EINA_ARG_NONNULL(1, 2);
6133    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);
6134    EAPI void             *evas_object_intercept_raise_callback_del       (Evas_Object *obj, Evas_Object_Intercept_Raise_Cb func) EINA_ARG_NONNULL(1, 2);
6135    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);
6136    EAPI void             *evas_object_intercept_lower_callback_del       (Evas_Object *obj, Evas_Object_Intercept_Lower_Cb func) EINA_ARG_NONNULL(1, 2);
6137    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);
6138    EAPI void             *evas_object_intercept_stack_above_callback_del (Evas_Object *obj, Evas_Object_Intercept_Stack_Above_Cb func) EINA_ARG_NONNULL(1, 2);
6139    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);
6140    EAPI void             *evas_object_intercept_stack_below_callback_del (Evas_Object *obj, Evas_Object_Intercept_Stack_Below_Cb func) EINA_ARG_NONNULL(1, 2);
6141    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);
6142    EAPI void             *evas_object_intercept_layer_set_callback_del   (Evas_Object *obj, Evas_Object_Intercept_Layer_Set_Cb func) EINA_ARG_NONNULL(1, 2);
6143    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);
6144    EAPI void             *evas_object_intercept_color_set_callback_del   (Evas_Object *obj, Evas_Object_Intercept_Color_Set_Cb func) EINA_ARG_NONNULL(1, 2);
6145    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);
6146    EAPI void             *evas_object_intercept_clip_set_callback_del    (Evas_Object *obj, Evas_Object_Intercept_Clip_Set_Cb func) EINA_ARG_NONNULL(1, 2);
6147    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);
6148    EAPI void             *evas_object_intercept_clip_unset_callback_del  (Evas_Object *obj, Evas_Object_Intercept_Clip_Unset_Cb func) EINA_ARG_NONNULL(1, 2);
6149
6150 /**
6151  * @}
6152  */
6153
6154 /**
6155  * @defgroup Evas_Object_Specific Specific Object Functions
6156  *
6157  * Functions that work on specific objects.
6158  *
6159  */
6160
6161 /**
6162  * @defgroup Evas_Object_Rectangle Rectangle Object Functions
6163  *
6164  * @brief Function to create evas rectangle objects.
6165  *
6166  * There is only one function to deal with rectangle objects, this may make this
6167  * function seem useless given there are no functions to manipulate the created
6168  * rectangle, however the rectangle is actually very useful and should be
6169  * manipulated using the generic @ref Evas_Object_Group "evas object functions".
6170  *
6171  * The evas rectangle server a number of key functions when working on evas
6172  * programs:
6173  * @li Background
6174  * @li Debugging
6175  * @li Clipper
6176  *
6177  * @section Background
6178  *
6179  * One extremely common requirement of evas programs is to have a solid color
6180  * background, this can be accomplished with the following very simple code:
6181  * @code
6182  * Evas_Object *bg = evas_object_rectangle_add(evas_canvas);
6183  * //Here we set the rectangles red, green, blue and opacity levels
6184  * evas_object_color_set(bg, 255, 255, 255, 255); // opaque white background
6185  * evas_object_resize(bg, WIDTH, HEIGHT); // covers full canvas
6186  * evas_object_show(bg);
6187  * @endcode
6188  *
6189  * This however will have issues if the @c evas_canvas is resized, however most
6190  * windows are created using ecore evas and that has a solution to using the
6191  * rectangle as a background:
6192  * @code
6193  * Evas_Object *bg = evas_object_rectangle_add(ecore_evas_get(ee));
6194  * //Here we set the rectangles red, green, blue and opacity levels
6195  * evas_object_color_set(bg, 255, 255, 255, 255); // opaque white background
6196  * evas_object_resize(bg, WIDTH, HEIGHT); // covers full canvas
6197  * evas_object_show(bg);
6198  * ecore_evas_object_associate(ee, bg, ECORE_EVAS_OBJECT_ASSOCIATE_BASE);
6199  * @endcode
6200  * So this gives us a white background to our window that will be resized
6201  * together with it.
6202  *
6203  * @section Debugging
6204  *
6205  * Debugging is a major part of any programmers task and when debugging visual
6206  * issues with evas programs the rectangle is an extremely useful tool. The
6207  * rectangle's simplicity means that it's easier to pinpoint issues with it than
6208  * with more complex objects. Therefore a common technique to use when writing
6209  * an evas program and not getting the desired visual result is to replace the
6210  * misbehaving object for a solid color rectangle and seeing how it interacts
6211  * with the other elements, this often allows us to notice clipping, parenting
6212  * or positioning issues. Once the issues have been identified and corrected the
6213  * rectangle can be replaced for the original part and in all likelihood any
6214  * remaining issues will be specific to that object's type.
6215  *
6216  * @section clipping Clipping
6217  *
6218  * Clipping serves two main functions:
6219  * @li Limiting visibility(i.e. hiding portions of an object).
6220  * @li Applying a layer of color to an object.
6221  *
6222  * @subsection hiding Limiting visibility
6223  *
6224  * It is often necessary to show only parts of an object, while it may be
6225  * possible to create an object that corresponds only to the part that must be
6226  * shown(and it isn't always possible) it's usually easier to use a a clipper. A
6227  * clipper is a rectangle that defines what's visible and what is not. The way
6228  * to do this is to create a solid white rectangle(which is the default, no need
6229  * to call evas_object_color_set()) and give it a position and size of what
6230  * should be visible. The following code exemplifies showing the center half of
6231  * @c my_evas_object:
6232  * @code
6233  * Evas_Object *clipper = evas_object_rectangle_add(evas_canvas);
6234  * evas_object_move(clipper, my_evas_object_x / 4, my_evas_object_y / 4);
6235  * evas_object_resize(clipper, my_evas_object_width / 2, my_evas_object_height / 2);
6236  * evas_object_clip_set(my_evas_object, clipper);
6237  * evas_object_show(clipper);
6238  * @endcode
6239  *
6240  * @subsection color Layer of color
6241  *
6242  * In the @ref clipping section we used a solid white clipper, which produced no
6243  * change in the color of the clipped object, it just hid what was outside the
6244  * clippers area. It is however sometimes desirable to change the of color an
6245  * object, this can be accomplished using a clipper that has a non-white color.
6246  * Clippers with color work by multiplying the colors of clipped object. The
6247  * following code will show how to remove all the red from an object:
6248  * @code
6249  * Evas_Object *clipper = evas_object_rectangle_add(evas);
6250  * evas_object_move(clipper, my_evas_object_x, my_evas_object_y);
6251  * evas_object_resize(clipper, my_evas_object_width, my_evas_object_height);
6252  * evas_object_color_set(clipper, 0, 255, 255, 255);
6253  * evas_object_clip_set(obj, clipper);
6254  * evas_object_show(clipper);
6255  * @endcode
6256  *
6257  * For an example that more fully exercise the use of an evas object rectangle
6258  * see @ref Example_Evas_Object_Manipulation.
6259  *
6260  * @ingroup Evas_Object_Specific
6261  */
6262
6263 /**
6264  * Adds a rectangle to the given evas.
6265  * @param   e The given evas.
6266  * @return  The new rectangle object.
6267  *
6268  * @ingroup Evas_Object_Rectangle
6269  */
6270 EAPI Evas_Object      *evas_object_rectangle_add         (Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
6271
6272 /**
6273  * @defgroup Evas_Object_Image Image Object Functions
6274  *
6275  * Here are grouped together functions used to create and manipulate
6276  * image objects. They are available to whichever occasion one needs
6277  * complex imagery on a GUI that could not be achieved by the other
6278  * Evas' primitive object types, or to make image manipulations.
6279  *
6280  * Evas will support whichever image file types it was compiled with
6281  * support to (its image loaders) -- check your software packager for
6282  * that information and see
6283  * evas_object_image_extension_can_load_get().
6284  *
6285  * @section Evas_Object_Image_Basics Image object basics
6286  *
6287  * The most common use of image objects -- to display an image on the
6288  * canvas -- is achieved by a common function triplet:
6289  * @code
6290  * img = evas_object_image_add(canvas);
6291  * evas_object_image_file_set(img, "path/to/img", NULL);
6292  * evas_object_image_fill_set(img, 0, 0, w, h);
6293  * @endcode
6294  * The first function, naturally, is creating the image object. Then,
6295  * one must set an source file on it, so that it knows where to fetch
6296  * image data from. Next, one must set <b>how to fill the image
6297  * object's area</b> with that given pixel data. One could use just a
6298  * sub-region of the original image or even have it tiled repeatedly
6299  * on the image object. For the common case of having the whole source
6300  * image to be displayed on the image object, stretched to the
6301  * destination's size, there's also a function helper, to be used
6302  * instead of evas_object_image_fill_set():
6303  * @code
6304  * evas_object_image_filled_set(img, EINA_TRUE);
6305  * @endcode
6306  * See those functions' documentation for more details.
6307  *
6308  * @section Evas_Object_Image_Scale Scale and resizing
6309  *
6310  * Resizing of image objects will scale their respective source images
6311  * to their areas, if they are set to "fill" the object's area
6312  * (evas_object_image_filled_set()). If the user wants any control on
6313  * the aspect ratio of an image for different sizes, he/she has to
6314  * take care of that themselves. There are functions to make images to
6315  * get loaded scaled (up or down) in memory, already, if the user is
6316  * going to use them at pre-determined sizes and wants to save
6317  * computations.
6318  *
6319  * Evas has even a scale cache, which will take care of caching scaled
6320  * versions of images with more often usage/hits. Finally, one can
6321  * have images being rescaled @b smoothly by Evas (more
6322  * computationally expensive) or not.
6323  *
6324  * @section Evas_Object_Image_Performance Performance hints
6325  *
6326  * When dealing with image objects, there are some tricks to boost the
6327  * performance of your application, if it does intense image loading
6328  * and/or manipulations, as in animations on a UI.
6329  *
6330  * @subsection Evas_Object_Image_Load Load hints
6331  *
6332  * In image viewer applications, for example, the user will be looking
6333  * at a given image, at full size, and will desire that the navigation
6334  * to the adjacent images on his/her album be fluid and fast. Thus,
6335  * while displaying a given image, the program can be on the
6336  * background loading the next and previous images already, so that
6337  * displaying them on the sequence is just a matter of repainting the
6338  * screen (and not decoding image data).
6339  *
6340  * Evas addresses this issue with <b>image pre-loading</b>. The code
6341  * for the situation above would be something like the following:
6342  * @code
6343  * prev = evas_object_image_filled_add(canvas);
6344  * evas_object_image_file_set(prev, "/path/to/prev", NULL);
6345  * evas_object_image_preload(prev, EINA_TRUE);
6346  *
6347  * next = evas_object_image_filled_add(canvas);
6348  * evas_object_image_file_set(next, "/path/to/next", NULL);
6349  * evas_object_image_preload(next, EINA_TRUE);
6350  * @endcode
6351  *
6352  * If you're loading images which are too big, consider setting
6353  * previously it's loading size to something smaller, in case you
6354  * won't expose them in real size. It may speed up the loading
6355  * considerably:
6356  * @code
6357  * //to load a scaled down version of the image in memory, if that's
6358  * //the size you'll be displaying it anyway
6359  * evas_object_image_load_scale_down_set(img, zoom);
6360  *
6361  * //optional: if you know you'll be showing a sub-set of the image's
6362  * //pixels, you can avoid loading the complementary data
6363  * evas_object_image_load_region_set(img, x, y, w, h);
6364  * @endcode
6365  * Refer to Elementary's Photocam widget for a high level (smart)
6366  * object which does lots of loading speed-ups for you.
6367  *
6368  * @subsection Evas_Object_Image_Animation Animation hints
6369  *
6370  * If you want to animate image objects on a UI (what you'd get by
6371  * concomitant usage of other libraries, like Ecore and Edje), there
6372  * are also some tips on how to boost the performance of your
6373  * application. If the animation involves resizing of an image (thus,
6374  * re-scaling), you'd better turn off smooth scaling on it @b during
6375  * the animation, turning it back on afterwards, for less
6376  * computations. Also, in this case you'd better flag the image object
6377  * in question not to cache scaled versions of it:
6378  * @code
6379  * evas_object_image_scale_hint_set(wd->img, EVAS_IMAGE_SCALE_HINT_DYNAMIC);
6380  *
6381  * // resizing takes place in between
6382  *
6383  * evas_object_image_scale_hint_set(wd->img, EVAS_IMAGE_SCALE_HINT_STATIC);
6384  * @endcode
6385  *
6386  * Finally, movement of opaque images through the canvas is less
6387  * expensive than of translucid ones, because of blending
6388  * computations.
6389  *
6390  * @section Evas_Object_Image_Borders Borders
6391  *
6392  * Evas provides facilities for one to specify an image's region to be
6393  * treated specially -- as "borders". This will make those regions be
6394  * treated specially on resizing scales, by keeping their aspect. This
6395  * makes setting frames around other objects on UIs easy.
6396  * See the following figures for a visual explanation:\n
6397  * @htmlonly
6398  * <img src="image-borders.png" style="max-width: 100%;" />
6399  * <a href="image-borders.png">Full-size</a>
6400  * @endhtmlonly
6401  * @image rtf image-borders.png
6402  * @image latex image-borders.eps width=\textwidth
6403  * @htmlonly
6404  * <img src="border-effect.png" style="max-width: 100%;" />
6405  * <a href="border-effect.png">Full-size</a>
6406  * @endhtmlonly
6407  * @image rtf border-effect.png
6408  * @image latex border-effect.eps width=\textwidth
6409  *
6410  * @section Evas_Object_Image_Manipulation Manipulating pixels
6411  *
6412  * Evas image objects can be used to manipulate raw pixels in many
6413  * ways.  The meaning of the data in the pixel arrays will depend on
6414  * the image's color space, be warned (see next section). You can set
6415  * your own data as an image's pixel data, fetch an image's pixel data
6416  * for saving/altering, convert images between different color spaces
6417  * and even advanced operations like setting a native surface as image
6418  * objects' data.
6419  *
6420  * @section Evas_Object_Image_Color_Spaces Color spaces
6421  *
6422  * Image objects may return or accept "image data" in multiple
6423  * formats. This is based on the color space of an object. Here is a
6424  * rundown on formats:
6425  *
6426  * - #EVAS_COLORSPACE_ARGB8888:
6427  *   .
6428  *   This pixel format is a linear block of pixels, starting at the
6429  *   top-left row by row until the bottom right of the image or pixel
6430  *   region. All pixels are 32-bit unsigned int's with the high-byte
6431  *   being alpha and the low byte being blue in the format ARGB. Alpha
6432  *   may or may not be used by evas depending on the alpha flag of the
6433  *   image, but if not used, should be set to 0xff anyway.
6434  *   \n\n
6435  *   This colorspace uses premultiplied alpha. That means that R, G
6436  *   and B cannot exceed A in value. The conversion from
6437  *   non-premultiplied colorspace is:
6438  *   \n\n
6439  *   R = (r * a) / 255; G = (g * a) / 255; B = (b * a) / 255;
6440  *   \n\n
6441  *   So 50% transparent blue will be: 0x80000080. This will not be
6442  *   "dark" - just 50% transparent. Values are 0 == black, 255 ==
6443  *   solid or full red, green or blue.
6444  *
6445  * - #EVAS_COLORSPACE_YCBCR422P601_PL:
6446  *   .
6447  *   This is a pointer-list indirected set of YUV (YCbCr) pixel
6448  *   data. This means that the data returned or set is not actual
6449  *   pixel data, but pointers TO lines of pixel data. The list of
6450  *   pointers will first be N rows of pointers to the Y plane -
6451  *   pointing to the first pixel at the start of each row in the Y
6452  *   plane. N is the height of the image data in pixels. Each pixel in
6453  *   the Y, U and V planes is 1 byte exactly, packed. The next N / 2
6454  *   pointers will point to rows in the U plane, and the next N / 2
6455  *   pointers will point to the V plane rows. U and V planes are half
6456  *   the horizontal and vertical resolution of the Y plane.
6457  *   \n\n
6458  *   Row order is top to bottom and row pixels are stored left to
6459  *   right.
6460  *   \n\n
6461  *   There is a limitation that these images MUST be a multiple of 2
6462  *   pixels in size horizontally or vertically. This is due to the U
6463  *   and V planes being half resolution. Also note that this assumes
6464  *   the itu601 YUV colorspace specification. This is defined for
6465  *   standard television and mpeg streams. HDTV may use the itu709
6466  *   specification.
6467  *   \n\n
6468  *   Values are 0 to 255, indicating full or no signal in that plane
6469  *   respectively.
6470  *
6471  * - #EVAS_COLORSPACE_YCBCR422P709_PL:
6472  *   .
6473  *   Not implemented yet.
6474  *
6475  * - #EVAS_COLORSPACE_RGB565_A5P:
6476  *   .
6477  *   In the process of being implemented in 1 engine only. This may
6478  *   change.
6479  *   \n\n
6480  *   This is a pointer to image data for 16-bit half-word pixel data
6481  *   in 16bpp RGB 565 format (5 bits red, 6 bits green, 5 bits blue),
6482  *   with the high-byte containing red and the low byte containing
6483  *   blue, per pixel. This data is packed row by row from the top-left
6484  *   to the bottom right.
6485  *   \n\n
6486  *   If the image has an alpha channel enabled there will be an extra
6487  *   alpha plane after the color pixel plane. If not, then this data
6488  *   will not exist and should not be accessed in any way. This plane
6489  *   is a set of pixels with 1 byte per pixel defining the alpha
6490  *   values of all pixels in the image from the top-left to the bottom
6491  *   right of the image, row by row. Even though the values of the
6492  *   alpha pixels can be 0 to 255, only values 0 through to 32 are
6493  *   used, 32 being solid and 0 being transparent.
6494  *   \n\n
6495  *   RGB values can be 0 to 31 for red and blue and 0 to 63 for green,
6496  *   with 0 being black and 31 or 63 being full red, green or blue
6497  *   respectively. This colorspace is also pre-multiplied like
6498  *   EVAS_COLORSPACE_ARGB8888 so:
6499  *   \n\n
6500  *   R = (r * a) / 32; G = (g * a) / 32; B = (b * a) / 32;
6501  *
6502  * - #EVAS_COLORSPACE_GRY8:
6503  *   .
6504  *   The image is just a alpha mask (8 bit's per pixel). This is used
6505  *   for alpha masking.
6506  *
6507  * Some examples on this group of functions can be found @ref
6508  * Example_Evas_Images "here".
6509  *
6510  * @ingroup Evas_Object_Specific
6511  */
6512
6513 /**
6514  * @addtogroup Evas_Object_Image
6515  * @{
6516  */
6517
6518 typedef void (*Evas_Object_Image_Pixels_Get_Cb) (void *data, Evas_Object *o);
6519
6520
6521 /**
6522  * Creates a new image object on the given Evas @p e canvas.
6523  *
6524  * @param e The given canvas.
6525  * @return The created image object handle.
6526  *
6527  * @note If you intend to @b display an image somehow in a GUI,
6528  * besides binding it to a real image file/source (with
6529  * evas_object_image_file_set(), for example), you'll have to tell
6530  * this image object how to fill its space with the pixels it can get
6531  * from the source. See evas_object_image_filled_add(), for a helper
6532  * on the common case of scaling up an image source to the whole area
6533  * of the image object.
6534  *
6535  * @see evas_object_image_fill_set()
6536  *
6537  * Example:
6538  * @code
6539  * img = evas_object_image_add(canvas);
6540  * evas_object_image_file_set(img, "/path/to/img", NULL);
6541  * @endcode
6542  */
6543 EAPI Evas_Object             *evas_object_image_add                    (Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
6544
6545 /**
6546  * Creates a new image object that @b automatically scales its bound
6547  * image to the object's area, on both axis.
6548  *
6549  * @param e The given canvas.
6550  * @return The created image object handle.
6551  *
6552  * This is a helper function around evas_object_image_add() and
6553  * evas_object_image_filled_set(). It has the same effect of applying
6554  * those functions in sequence, which is a very common use case.
6555  *
6556  * @note Whenever this object gets resized, the bound image will be
6557  * rescaled, too.
6558  *
6559  * @see evas_object_image_add()
6560  * @see evas_object_image_filled_set()
6561  * @see evas_object_image_fill_set()
6562  */
6563 EAPI Evas_Object             *evas_object_image_filled_add             (Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
6564
6565
6566 /**
6567  * Sets the data for an image from memory to be loaded
6568  *
6569  * This is the same as evas_object_image_file_set() but the file to be loaded
6570  * may exist at an address in memory (the data for the file, not the filename
6571  * itself). The @p data at the address is copied and stored for future use, so
6572  * no @p data needs to be kept after this call is made. It will be managed and
6573  * freed for you when no longer needed. The @p size is limited to 2 gigabytes
6574  * in size, and must be greater than 0. A NULL @p data pointer is also invalid.
6575  * Set the filename to NULL to reset to empty state and have the image file
6576  * data freed from memory using evas_object_image_file_set().
6577  *
6578  * The @p format is optional (pass NULL if you don't need/use it). It is used
6579  * to help Evas guess better which loader to use for the data. It may simply
6580  * be the "extension" of the file as it would normally be on disk such as
6581  * "jpg" or "png" or "gif" etc.
6582  *
6583  * @param obj The given image object.
6584  * @param data The image file data address
6585  * @param size The size of the image file data in bytes
6586  * @param format The format of the file (optional), or @c NULL if not needed
6587  * @param key The image key in file, or @c NULL.
6588  */
6589 EAPI void                     evas_object_image_memfile_set            (Evas_Object *obj, void *data, int size, char *format, char *key) EINA_ARG_NONNULL(1, 2);
6590
6591 /**
6592  * Set the source file from where an image object must fetch the real
6593  * image data (it may be an Eet file, besides pure image ones).
6594  *
6595  * @param obj The given image object.
6596  * @param file The image file path.
6597  * @param key The image key in @p file (if its an Eet one), or @c
6598  * NULL, otherwise.
6599  *
6600  * If the file supports multiple data stored in it (as Eet files do),
6601  * you can specify the key to be used as the index of the image in
6602  * this file.
6603  *
6604  * Example:
6605  * @code
6606  * img = evas_object_image_add(canvas);
6607  * evas_object_image_file_set(img, "/path/to/img", NULL);
6608  * err = evas_object_image_load_error_get(img);
6609  * if (err != EVAS_LOAD_ERROR_NONE)
6610  *   {
6611  *      fprintf(stderr, "could not load image '%s'. error string is \"%s\"\n",
6612  *              valid_path, evas_load_error_str(err));
6613  *   }
6614  * else
6615  *   {
6616  *      evas_object_image_fill_set(img, 0, 0, w, h);
6617  *      evas_object_resize(img, w, h);
6618  *      evas_object_show(img);
6619  *   }
6620  * @endcode
6621  */
6622 EAPI void                     evas_object_image_file_set               (Evas_Object *obj, const char *file, const char *key) EINA_ARG_NONNULL(1);
6623
6624 /**
6625  * Retrieve the source file from where an image object is to fetch the
6626  * real image data (it may be an Eet file, besides pure image ones).
6627  *
6628  * @param obj The given image object.
6629  * @param file Location to store the image file path.
6630  * @param key Location to store the image key (if @p file is an Eet
6631  * one).
6632  *
6633  * You must @b not modify the strings on the returned pointers.
6634  *
6635  * @note Use @c NULL pointers on the file components you're not
6636  * interested in: they'll be ignored by the function.
6637  */
6638 EAPI void                     evas_object_image_file_get               (const Evas_Object *obj, const char **file, const char **key) EINA_ARG_NONNULL(1, 2);
6639
6640 /**
6641  * Set the dimensions for an image object's border, a region which @b
6642  * won't ever be scaled together with its center.
6643  *
6644  * @param obj The given image object.
6645  * @param l The border's left width.
6646  * @param r The border's right width.
6647  * @param t The border's top width.
6648  * @param b The border's bottom width.
6649  *
6650  * When Evas is rendering, an image source may be scaled to fit the
6651  * size of its image object. This function sets an area from the
6652  * borders of the image inwards which is @b not to be scaled. This
6653  * function is useful for making frames and for widget theming, where,
6654  * for example, buttons may be of varying sizes, but their border size
6655  * must remain constant.
6656  *
6657  * The units used for @p l, @p r, @p t and @p b are canvas units.
6658  *
6659  * @note The border region itself @b may be scaled by the
6660  * evas_object_image_border_scale_set() function.
6661  *
6662  * @note By default, image objects have no borders set, i. e. @c l, @c
6663  * r, @c t and @c b start as @c 0.
6664  *
6665  * See the following figures for visual explanation:\n
6666  * @htmlonly
6667  * <img src="image-borders.png" style="max-width: 100%;" />
6668  * <a href="image-borders.png">Full-size</a>
6669  * @endhtmlonly
6670  * @image rtf image-borders.png
6671  * @image latex image-borders.eps width=\textwidth
6672  * @htmlonly
6673  * <img src="border-effect.png" style="max-width: 100%;" />
6674  * <a href="border-effect.png">Full-size</a>
6675  * @endhtmlonly
6676  * @image rtf border-effect.png
6677  * @image latex border-effect.eps width=\textwidth
6678  *
6679  * @see evas_object_image_border_get()
6680  * @see evas_object_image_border_center_fill_set()
6681  */
6682 EAPI void                     evas_object_image_border_set             (Evas_Object *obj, int l, int r, int t, int b) EINA_ARG_NONNULL(1);
6683
6684 /**
6685  * Retrieve the dimensions for an image object's border, a region
6686  * which @b won't ever be scaled together with its center.
6687  *
6688  * @param obj The given image object.
6689  * @param l Location to store the border's left width in.
6690  * @param r Location to store the border's right width in.
6691  * @param t Location to store the border's top width in.
6692  * @param b Location to store the border's bottom width in.
6693  *
6694  * @note Use @c NULL pointers on the border components you're not
6695  * interested in: they'll be ignored by the function.
6696  *
6697  * See @ref evas_object_image_border_set() for more details.
6698  */
6699 EAPI void                     evas_object_image_border_get             (const Evas_Object *obj, int *l, int *r, int *t, int *b) EINA_ARG_NONNULL(1);
6700
6701 /**
6702  * Sets @b how the center part of the given image object (not the
6703  * borders) should be drawn when Evas is rendering it.
6704  *
6705  * @param obj The given image object.
6706  * @param fill Fill mode of the center region of @p obj (a value in
6707  * #Evas_Border_Fill_Mode).
6708  *
6709  * This function sets how the center part of the image object's source
6710  * image is to be drawn, which must be one of the values in
6711  * #Evas_Border_Fill_Mode. By center we mean the complementary part of
6712  * that defined by evas_object_image_border_set(). This one is very
6713  * useful for making frames and decorations. You would most probably
6714  * also be using a filled image (as in evas_object_image_filled_set())
6715  * to use as a frame.
6716  *
6717  * @see evas_object_image_border_center_fill_get()
6718  */
6719 EAPI void                     evas_object_image_border_center_fill_set (Evas_Object *obj, Evas_Border_Fill_Mode fill) EINA_ARG_NONNULL(1);
6720
6721 /**
6722  * Retrieves @b how the center part of the given image object (not the
6723  * borders) is to be drawn when Evas is rendering it.
6724  *
6725  * @param obj The given image object.
6726  * @return fill Fill mode of the center region of @p obj (a value in
6727  * #Evas_Border_Fill_Mode).
6728  *
6729  * See @ref evas_object_image_fill_set() for more details.
6730  */
6731 EAPI Evas_Border_Fill_Mode    evas_object_image_border_center_fill_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
6732
6733 /**
6734  * Set whether the image object's fill property should track the
6735  * object's size.
6736  *
6737  * @param obj The given image object.
6738  * @param setting @c EINA_TRUE, to make the fill property follow
6739  *        object size or @c EINA_FALSE, otherwise
6740  *
6741  * If @p setting is @c EINA_TRUE, then every evas_object_resize() will
6742  * @b automatically trigger a call to evas_object_image_fill_set()
6743  * with the that new size (and @c 0, @c 0 as source image's origin),
6744  * so the bound image will fill the whole object's area.
6745  *
6746  * @see evas_object_image_filled_add()
6747  * @see evas_object_image_fill_get()
6748  */
6749 EAPI void                     evas_object_image_filled_set             (Evas_Object *obj, Eina_Bool setting) EINA_ARG_NONNULL(1);
6750
6751 /**
6752  * Retrieve whether the image object's fill property should track the
6753  * object's size.
6754  *
6755  * @param obj The given image object.
6756  * @return @c EINA_TRUE if it is tracking, @c EINA_FALSE, if not (and
6757  *         evas_object_fill_set() must be called manually).
6758  *
6759  * @see evas_object_image_filled_set() for more information
6760  */
6761 EAPI Eina_Bool                evas_object_image_filled_get             (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
6762
6763 /**
6764  * Sets the scaling factor (multiplier) for the borders of an image
6765  * object.
6766  *
6767  * @param obj The given image object.
6768  * @param scale The scale factor (default is @c 1.0 - i.e. no scaling)
6769  *
6770  * @see evas_object_image_border_set()
6771  * @see evas_object_image_border_scale_get()
6772  */
6773 EAPI void                     evas_object_image_border_scale_set       (Evas_Object *obj, double scale);
6774
6775 /**
6776  * Retrieves the scaling factor (multiplier) for the borders of an
6777  * image object.
6778  *
6779  * @param obj The given image object.
6780  * @return The scale factor set for its borders
6781  *
6782  * @see evas_object_image_border_set()
6783  * @see evas_object_image_border_scale_set()
6784  */
6785 EAPI double                   evas_object_image_border_scale_get       (const Evas_Object *obj);
6786
6787 /**
6788  * Set how to fill an image object's drawing rectangle given the
6789  * (real) image bound to it.
6790  *
6791  * @param obj The given image object to operate on.
6792  * @param x The x coordinate (from the top left corner of the bound
6793  *          image) to start drawing from.
6794  * @param y The y coordinate (from the top left corner of the bound
6795  *          image) to start drawing from.
6796  * @param w The width the bound image will be displayed at.
6797  * @param h The height the bound image will be displayed at.
6798  *
6799  * Note that if @p w or @p h are smaller than the dimensions of
6800  * @p obj, the displayed image will be @b tiled around the object's
6801  * area. To have only one copy of the bound image drawn, @p x and @p y
6802  * must be 0 and @p w and @p h need to be the exact width and height
6803  * of the image object itself, respectively.
6804  *
6805  * See the following image to better understand the effects of this
6806  * call. On this diagram, both image object and original image source
6807  * have @c a x @c a dimensions and the image itself is a circle, with
6808  * empty space around it:
6809  *
6810  * @image html image-fill.png
6811  * @image rtf image-fill.png
6812  * @image latex image-fill.eps
6813  *
6814  * @warning The default values for the fill parameters are @p x = 0,
6815  * @p y = 0, @p w = 0 and @p h = 0. Thus, if you're not using the
6816  * evas_object_image_filled_add() helper and want your image
6817  * displayed, you'll have to set valid values with this function on
6818  * your object.
6819  *
6820  * @note evas_object_image_filled_set() is a helper function which
6821  * will @b override the values set here automatically, for you, in a
6822  * given way.
6823  */
6824 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);
6825
6826 /**
6827  * Retrieve how an image object is to fill its drawing rectangle,
6828  * given the (real) image bound to it.
6829  *
6830  * @param obj The given image object.
6831  * @param x Location to store the x coordinate (from the top left
6832  *          corner of the bound image) to start drawing from.
6833  * @param y Location to store the y coordinate (from the top left
6834  *          corner of the bound image) to start drawing from.
6835  * @param w Location to store the width the bound image is to be
6836  *          displayed at.
6837  * @param h Location to store the height the bound image is to be
6838  *          displayed at.
6839  *
6840  * @note Use @c NULL pointers on the fill components you're not
6841  * interested in: they'll be ignored by the function.
6842  *
6843  * See @ref evas_object_image_fill_set() for more details.
6844  */
6845 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);
6846
6847 /**
6848  * Sets the tiling mode for the given evas image object's fill.
6849  * @param   obj   The given evas image object.
6850  * @param   spread One of EVAS_TEXTURE_REFLECT, EVAS_TEXTURE_REPEAT,
6851  * EVAS_TEXTURE_RESTRICT, or EVAS_TEXTURE_PAD.
6852  */
6853 EAPI void                     evas_object_image_fill_spread_set        (Evas_Object *obj, Evas_Fill_Spread spread) EINA_ARG_NONNULL(1);
6854
6855 /**
6856  * Retrieves the spread (tiling mode) for the given image object's
6857  * fill.
6858  *
6859  * @param   obj The given evas image object.
6860  * @return  The current spread mode of the image object.
6861  */
6862 EAPI Evas_Fill_Spread         evas_object_image_fill_spread_get        (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
6863
6864 /**
6865  * Sets the size of the given image object.
6866  *
6867  * @param obj The given image object.
6868  * @param w The new width of the image.
6869  * @param h The new height of the image.
6870  *
6871  * This function will scale down or crop the image so that it is
6872  * treated as if it were at the given size. If the size given is
6873  * smaller than the image, it will be cropped. If the size given is
6874  * larger, then the image will be treated as if it were in the upper
6875  * left hand corner of a larger image that is otherwise transparent.
6876  */
6877 EAPI void                     evas_object_image_size_set               (Evas_Object *obj, int w, int h) EINA_ARG_NONNULL(1);
6878
6879 /**
6880  * Retrieves the size of the given image object.
6881  *
6882  * @param obj The given image object.
6883  * @param w Location to store the width of the image in, or @c NULL.
6884  * @param h Location to store the height of the image in, or @c NULL.
6885  *
6886  * See @ref evas_object_image_size_set() for more details.
6887  */
6888 EAPI void                     evas_object_image_size_get               (const Evas_Object *obj, int *w, int *h) EINA_ARG_NONNULL(1);
6889
6890 /**
6891  * Retrieves the row stride of the given image object.
6892  *
6893  * @param obj The given image object.
6894  * @return The stride of the image (<b>in bytes</b>).
6895  *
6896  * The row stride is the number of bytes between the start of a row
6897  * and the start of the next row for image data.
6898  */
6899 EAPI int                      evas_object_image_stride_get             (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
6900
6901 /**
6902  * Retrieves a number representing any error that occurred during the
6903  * last loading of the given image object's source image.
6904  *
6905  * @param obj The given image object.
6906  * @return A value giving the last error that occurred. It should be
6907  *         one of the #Evas_Load_Error values. #EVAS_LOAD_ERROR_NONE
6908  *         is returned if there was no error.
6909  */
6910 EAPI Evas_Load_Error          evas_object_image_load_error_get         (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
6911
6912 /**
6913  * Sets the raw image data of the given image object.
6914  *
6915  * @param obj The given image object.
6916  * @param data The raw data, or @c NULL.
6917  *
6918  * Note that the raw data must be of the same size (see
6919  * evas_object_image_size_set(), which has to be called @b before this
6920  * one) and colorspace (see evas_object_image_colorspace_set()) of the
6921  * image. If data is @c NULL, the current image data will be
6922  * freed. Naturally, if one does not set an image object's data
6923  * manually, it will still have one, allocated by Evas.
6924  *
6925  * @see evas_object_image_data_get()
6926  */
6927 EAPI void                     evas_object_image_data_set               (Evas_Object *obj, void *data) EINA_ARG_NONNULL(1);
6928
6929 /**
6930  * Get a pointer to the raw image data of the given image object.
6931  *
6932  * @param obj The given image object.
6933  * @param for_writing Whether the data being retrieved will be
6934  *        modified (@c EINA_TRUE) or not (@c EINA_FALSE).
6935  * @return The raw image data.
6936  *
6937  * This function returns a pointer to an image object's internal pixel
6938  * buffer, for reading only or read/write. If you request it for
6939  * writing, the image will be marked dirty so that it gets redrawn at
6940  * the next update.
6941  *
6942  * Each time you call this function on an image object, its data
6943  * buffer will have an internal reference counter
6944  * incremented. Decrement it back by using
6945  * evas_object_image_data_set(). This is specially important for the
6946  * directfb Evas engine.
6947  *
6948  * This is best suited for when you want to modify an existing image,
6949  * without changing its dimensions.
6950  *
6951  * @note The contents' format returned by it depend on the color
6952  * space of the given image object.
6953  *
6954  * @note You may want to use evas_object_image_data_update_add() to
6955  * inform data changes, if you did any.
6956  *
6957  * @see evas_object_image_data_set()
6958  */
6959 EAPI void                    *evas_object_image_data_get               (const Evas_Object *obj, Eina_Bool for_writing) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
6960
6961 /**
6962  * Converts the raw image data of the given image object to the
6963  * specified colorspace.
6964  *
6965  * Note that this function does not modify the raw image data.  If the
6966  * requested colorspace is the same as the image colorspace nothing is
6967  * done and NULL is returned. You should use
6968  * evas_object_image_colorspace_get() to check the current image
6969  * colorspace.
6970  *
6971  * See @ref evas_object_image_colorspace_get.
6972  *
6973  * @param obj The given image object.
6974  * @param to_cspace The colorspace to which the image raw data will be converted.
6975  * @return data A newly allocated data in the format specified by to_cspace.
6976  */
6977 EAPI void                    *evas_object_image_data_convert           (Evas_Object *obj, Evas_Colorspace to_cspace) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
6978
6979 /**
6980  * Replaces the raw image data of the given image object.
6981  *
6982  * @param obj The given image object.
6983  * @param data The raw data to replace.
6984  *
6985  * This function lets the application replace an image object's
6986  * internal pixel buffer with an user-allocated one. For best results,
6987  * you should generally first call evas_object_image_size_set() with
6988  * the width and height for the new buffer.
6989  *
6990  * This call is best suited for when you will be using image data with
6991  * different dimensions than the existing image data, if any. If you
6992  * only need to modify the existing image in some fashion, then using
6993  * evas_object_image_data_get() is probably what you are after.
6994  *
6995  * Note that the caller is responsible for freeing the buffer when
6996  * finished with it, as user-set image data will not be automatically
6997  * freed when the image object is deleted.
6998  *
6999  * See @ref evas_object_image_data_get() for more details.
7000  *
7001  */
7002 EAPI void                     evas_object_image_data_copy_set          (Evas_Object *obj, void *data) EINA_ARG_NONNULL(1);
7003
7004 /**
7005  * Mark a sub-region of the given image object to be redrawn.
7006  *
7007  * @param obj The given image object.
7008  * @param x X-offset of the region to be updated.
7009  * @param y Y-offset of the region to be updated.
7010  * @param w Width of the region to be updated.
7011  * @param h Height of the region to be updated.
7012  *
7013  * This function schedules a particular rectangular region of an image
7014  * object to be updated (redrawn) at the next rendering cycle.
7015  */
7016 EAPI void                     evas_object_image_data_update_add        (Evas_Object *obj, int x, int y, int w, int h) EINA_ARG_NONNULL(1);
7017
7018 /**
7019  * Enable or disable alpha channel usage on the given image object.
7020  *
7021  * @param obj The given image object.
7022  * @param has_alpha Whether to use alpha channel (@c EINA_TRUE) data
7023  * or not (@c EINA_FALSE).
7024  *
7025  * This function sets a flag on an image object indicating whether or
7026  * not to use alpha channel data. A value of @c EINA_TRUE makes it use
7027  * alpha channel data, and @c EINA_FALSE makes it ignore that
7028  * data. Note that this has nothing to do with an object's color as
7029  * manipulated by evas_object_color_set().
7030  *
7031  * @see evas_object_image_alpha_get()
7032  */
7033 EAPI void                     evas_object_image_alpha_set              (Evas_Object *obj, Eina_Bool has_alpha) EINA_ARG_NONNULL(1);
7034
7035 /**
7036  * Retrieve whether alpha channel data is being used on the given
7037  * image object.
7038  *
7039  * @param obj The given image object.
7040  * @return Whether the alpha channel data is being used (@c EINA_TRUE)
7041  * or not (@c EINA_FALSE).
7042  *
7043  * This function returns @c EINA_TRUE if the image object's alpha
7044  * channel is being used, or @c EINA_FALSE otherwise.
7045  *
7046  * See @ref evas_object_image_alpha_set() for more details.
7047  */
7048 EAPI Eina_Bool                evas_object_image_alpha_get              (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
7049
7050 /**
7051  * Sets whether to use high-quality image scaling algorithm on the
7052  * given image object.
7053  *
7054  * @param obj The given image object.
7055  * @param smooth_scale Whether to use smooth scale or not.
7056  *
7057  * When enabled, a higher quality image scaling algorithm is used when
7058  * scaling images to sizes other than the source image's original
7059  * one. This gives better results but is more computationally
7060  * expensive.
7061  *
7062  * @note Image objects get created originally with smooth scaling @b
7063  * on.
7064  *
7065  * @see evas_object_image_smooth_scale_get()
7066  */
7067 EAPI void                     evas_object_image_smooth_scale_set       (Evas_Object *obj, Eina_Bool smooth_scale) EINA_ARG_NONNULL(1);
7068
7069 /**
7070  * Retrieves whether the given image object is using high-quality
7071  * image scaling algorithm.
7072  *
7073  * @param obj The given image object.
7074  * @return Whether smooth scale is being used.
7075  *
7076  * See @ref evas_object_image_smooth_scale_set() for more details.
7077  */
7078 EAPI Eina_Bool                evas_object_image_smooth_scale_get       (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
7079
7080 /**
7081  * Preload an image object's image data in the background
7082  *
7083  * @param obj The given image object.
7084  * @param cancel @c EINA_FALSE will add it the preloading work queue,
7085  *               @c EINA_TRUE will remove it (if it was issued before).
7086  *
7087  * This function requests the preload of the data image in the
7088  * background. The work is queued before being processed (because
7089  * there might be other pending requests of this type).
7090  *
7091  * Whenever the image data gets loaded, Evas will call
7092  * #EVAS_CALLBACK_IMAGE_PRELOADED registered callbacks on @p obj (what
7093  * may be immediately, if the data was already preloaded before).
7094  *
7095  * Use @c EINA_TRUE for @p cancel on scenarios where you don't need
7096  * the image data preloaded anymore.
7097  *
7098  * @note Any evas_object_show() call after evas_object_image_preload()
7099  * will make the latter to be @b cancelled, with the loading process
7100  * now taking place @b synchronously (and, thus, blocking the return
7101  * of the former until the image is loaded). It is highly advisable,
7102  * then, that the user preload an image with it being @b hidden, just
7103  * to be shown on the #EVAS_CALLBACK_IMAGE_PRELOADED event's callback.
7104  */
7105 EAPI void                     evas_object_image_preload                (Evas_Object *obj, Eina_Bool cancel) EINA_ARG_NONNULL(1);
7106
7107 /**
7108  * Reload an image object's image data.
7109  *
7110  * @param obj The given image object pointer.
7111  *
7112  * This function reloads the image data bound to image object @p obj.
7113  */
7114 EAPI void                     evas_object_image_reload                 (Evas_Object *obj) EINA_ARG_NONNULL(1);
7115
7116 /**
7117  * Save the given image object's contents to an (image) file.
7118  *
7119  * @param obj The given image object.
7120  * @param file The filename to be used to save the image (extension
7121  *        obligatory).
7122  * @param key The image key in the file (if an Eet one), or @c NULL,
7123  *        otherwise.
7124  * @param flags String containing the flags to be used (@c NULL for
7125  *        none).
7126  *
7127  * The extension suffix on @p file will determine which <b>saver
7128  * module</b> Evas is to use when saving, thus the final file's
7129  * format. If the file supports multiple data stored in it (Eet ones),
7130  * you can specify the key to be used as the index of the image in it.
7131  *
7132  * You can specify some flags when saving the image.  Currently
7133  * acceptable flags are @c quality and @c compress. Eg.: @c
7134  * "quality=100 compress=9"
7135  */
7136 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);
7137
7138 /**
7139  * Import pixels from given source to a given canvas image object.
7140  *
7141  * @param obj The given canvas object.
7142  * @param pixels The pixel's source to be imported.
7143  *
7144  * This function imports pixels from a given source to a given canvas image.
7145  *
7146  */
7147 EAPI Eina_Bool                evas_object_image_pixels_import          (Evas_Object *obj, Evas_Pixel_Import_Source *pixels) EINA_ARG_NONNULL(1, 2);
7148
7149 /**
7150  * Set the callback function to get pixels from a canvas' image.
7151  *
7152  * @param obj The given canvas pointer.
7153  * @param func The callback function.
7154  * @param data The data pointer to be passed to @a func.
7155  *
7156  * This functions sets a function to be the callback function that get
7157  * pixes from a image of the canvas.
7158  *
7159  */
7160 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);
7161
7162 /**
7163  * Mark whether the given image object is dirty (needs to be redrawn).
7164  *
7165  * @param obj The given image object.
7166  * @param dirty Whether the image is dirty.
7167  */
7168 EAPI void                     evas_object_image_pixels_dirty_set       (Evas_Object *obj, Eina_Bool dirty) EINA_ARG_NONNULL(1);
7169
7170 /**
7171  * Retrieves whether the given image object is dirty (needs to be redrawn).
7172  *
7173  * @param obj The given image object.
7174  * @return Whether the image is dirty.
7175  */
7176 EAPI Eina_Bool                evas_object_image_pixels_dirty_get       (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
7177
7178 /**
7179  * Set the DPI resolution of an image object's source image.
7180  *
7181  * @param obj The given canvas pointer.
7182  * @param dpi The new DPI resolution.
7183  *
7184  * This function sets the DPI resolution of a given loaded canvas
7185  * image. Most useful for the SVG image loader.
7186  *
7187  * @see evas_object_image_load_dpi_get()
7188  */
7189 EAPI void                     evas_object_image_load_dpi_set           (Evas_Object *obj, double dpi) EINA_ARG_NONNULL(1);
7190
7191 /**
7192  * Get the DPI resolution of a loaded image object in the canvas.
7193  *
7194  * @param obj The given canvas pointer.
7195  * @return The DPI resolution of the given canvas image.
7196  *
7197  * This function returns the DPI resolution of the given canvas image.
7198  *
7199  * @see evas_object_image_load_dpi_set() for more details
7200  */
7201 EAPI double                   evas_object_image_load_dpi_get           (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
7202
7203 /**
7204  * Set the size of a given image object's source image, when loading
7205  * it.
7206  *
7207  * @param obj The given canvas object.
7208  * @param w The new width of the image's load size.
7209  * @param h The new height of the image's load size.
7210  *
7211  * This function sets a new (loading) size for the given canvas
7212  * image.
7213  *
7214  * @see evas_object_image_load_size_get()
7215  */
7216 EAPI void                     evas_object_image_load_size_set          (Evas_Object *obj, int w, int h) EINA_ARG_NONNULL(1);
7217
7218 /**
7219  * Get the size of a given image object's source image, when loading
7220  * it.
7221  *
7222  * @param obj The given image object.
7223  * @param w Where to store the new width of the image's load size.
7224  * @param h Where to store the new height of the image's load size.
7225  *
7226  * @note Use @c NULL pointers on the size components you're not
7227  * interested in: they'll be ignored by the function.
7228  *
7229  * @see evas_object_image_load_size_set() for more details
7230  */
7231 EAPI void                     evas_object_image_load_size_get          (const Evas_Object *obj, int *w, int *h) EINA_ARG_NONNULL(1);
7232
7233 /**
7234  * Set the scale down factor of a given image object's source image,
7235  * when loading it.
7236  *
7237  * @param obj The given image object pointer.
7238  * @param scale_down The scale down factor.
7239  *
7240  * This function sets the scale down factor of a given canvas
7241  * image. Most useful for the SVG image loader.
7242  *
7243  * @see evas_object_image_load_scale_down_get()
7244  */
7245 EAPI void                     evas_object_image_load_scale_down_set    (Evas_Object *obj, int scale_down) EINA_ARG_NONNULL(1);
7246
7247 /**
7248  * get the scale down factor of a given image object's source image,
7249  * when loading it.
7250  *
7251  * @param obj The given image object pointer.
7252  *
7253  * @see evas_object_image_load_scale_down_set() for more details
7254  */
7255 EAPI int                      evas_object_image_load_scale_down_get    (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
7256
7257 /**
7258  * Inform a given image object to load a selective region of its
7259  * source image.
7260  *
7261  * @param obj The given image object pointer.
7262  * @param x X-offset of the region to be loaded.
7263  * @param y Y-offset of the region to be loaded.
7264  * @param w Width of the region to be loaded.
7265  * @param h Height of the region to be loaded.
7266  *
7267  * This function is useful when one is not showing all of an image's
7268  * area on its image object.
7269  *
7270  * @note The image loader for the image format in question has to
7271  * support selective region loading in order to this function to take
7272  * effect.
7273  *
7274  * @see evas_object_image_load_region_get()
7275  */
7276 EAPI void                     evas_object_image_load_region_set        (Evas_Object *obj, int x, int y, int w, int h) EINA_ARG_NONNULL(1);
7277
7278 /**
7279  * Retrieve the coordinates of a given image object's selective
7280  * (source image) load region.
7281  *
7282  * @param obj The given image object pointer.
7283  * @param x Where to store the X-offset of the region to be loaded.
7284  * @param y Where to store the Y-offset of the region to be loaded.
7285  * @param w Where to store the width of the region to be loaded.
7286  * @param h Where to store the height of the region to be loaded.
7287  *
7288  * @note Use @c NULL pointers on the coordinates you're not interested
7289  * in: they'll be ignored by the function.
7290  *
7291  * @see evas_object_image_load_region_get()
7292  */
7293 EAPI void                     evas_object_image_load_region_get        (const Evas_Object *obj, int *x, int *y, int *w, int *h) EINA_ARG_NONNULL(1);
7294
7295 /**
7296  * Define if the orientation information in the image file should be honored.
7297  *
7298  * @param obj The given image object pointer.
7299  * @param enable @p EINA_TRUE means that it should honor the orientation information
7300  * @since 1.1
7301  */
7302 EAPI void                     evas_object_image_load_orientation_set        (Evas_Object *obj, Eina_Bool enable) EINA_ARG_NONNULL(1);
7303
7304 /**
7305  * Get if the orientation information in the image file should be honored.
7306  *
7307  * @param obj The given image object pointer.
7308  * @since 1.1
7309  */
7310 EAPI Eina_Bool                evas_object_image_load_orientation_get        (const Evas_Object *obj) EINA_ARG_NONNULL(1);
7311
7312 /**
7313  * Set the colorspace of a given image of the canvas.
7314  *
7315  * @param obj The given image object pointer.
7316  * @param cspace The new color space.
7317  *
7318  * This function sets the colorspace of given canvas image.
7319  *
7320  */
7321 EAPI void                     evas_object_image_colorspace_set         (Evas_Object *obj, Evas_Colorspace cspace) EINA_ARG_NONNULL(1);
7322
7323 /**
7324  * Get the colorspace of a given image of the canvas.
7325  *
7326  * @param obj The given image object pointer.
7327  * @return The colorspace of the image.
7328  *
7329  * This function returns the colorspace of given canvas image.
7330  *
7331  */
7332 EAPI Evas_Colorspace          evas_object_image_colorspace_get         (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
7333
7334 /**
7335  * Get the support state of a given image
7336  *
7337  * @param obj The given image object pointer
7338  * @return The region support state
7339  * @since 1.2.0
7340  *
7341  * This function returns the state of the region support of given image
7342  */
7343 EAPI Eina_Bool          evas_object_image_region_support_get         (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
7344
7345 /**
7346  * Set the native surface of a given image of the canvas
7347  *
7348  * @param obj The given canvas pointer.
7349  * @param surf The new native surface.
7350  *
7351  * This function sets a native surface of a given canvas image.
7352  *
7353  */
7354 EAPI void                     evas_object_image_native_surface_set     (Evas_Object *obj, Evas_Native_Surface *surf) EINA_ARG_NONNULL(1, 2);
7355
7356 /**
7357  * Get the native surface of a given image of the canvas
7358  *
7359  * @param obj The given canvas pointer.
7360  * @return The native surface of the given canvas image.
7361  *
7362  * This function returns the native surface of a given canvas image.
7363  *
7364  */
7365 EAPI Evas_Native_Surface     *evas_object_image_native_surface_get     (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
7366
7367 /**
7368  * Set the video surface linked to a given image of the canvas
7369  *
7370  * @param obj The given canvas pointer.
7371  * @param surf The new video surface.
7372  * @since 1.1.0
7373  *
7374  * This function link a video surface to a given canvas image.
7375  *
7376  */
7377 EAPI void                     evas_object_image_video_surface_set      (Evas_Object *obj, Evas_Video_Surface *surf) EINA_ARG_NONNULL(1);
7378
7379 /**
7380  * Get the video surface linekd to a given image of the canvas
7381  *
7382  * @param obj The given canvas pointer.
7383  * @return The video surface of the given canvas image.
7384  * @since 1.1.0
7385  *
7386  * This function returns the video surface linked to a given canvas image.
7387  *
7388  */
7389 EAPI const Evas_Video_Surface *evas_object_image_video_surface_get      (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
7390
7391 /**
7392  * Set the scale hint of a given image of the canvas.
7393  *
7394  * @param obj The given image object pointer.
7395  * @param hint The scale hint, a value in
7396  * #Evas_Image_Scale_Hint.
7397  *
7398  * This function sets the scale hint value of the given image object
7399  * in the canvas, which will affect how Evas is to cache scaled
7400  * versions of its original source image.
7401  *
7402  * @see evas_object_image_scale_hint_get()
7403  */
7404 EAPI void                     evas_object_image_scale_hint_set         (Evas_Object *obj, Evas_Image_Scale_Hint hint) EINA_ARG_NONNULL(1);
7405
7406 /**
7407  * Get the scale hint of a given image of the canvas.
7408  *
7409  * @param obj The given image object pointer.
7410  * @return The scale hint value set on @p obj, a value in
7411  * #Evas_Image_Scale_Hint.
7412  *
7413  * This function returns the scale hint value of the given image
7414  * object of the canvas.
7415  *
7416  * @see evas_object_image_scale_hint_set() for more details.
7417  */
7418 EAPI Evas_Image_Scale_Hint    evas_object_image_scale_hint_get         (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
7419
7420 /**
7421  * Set the content hint setting of a given image object of the canvas.
7422  *
7423  * @param obj The given canvas pointer.
7424  * @param hint The content hint value, one of the
7425  * #Evas_Image_Content_Hint ones.
7426  *
7427  * This function sets the content hint value of the given image of the
7428  * canvas. For example, if you're on the GL engine and your driver
7429  * implementation supports it, setting this hint to
7430  * #EVAS_IMAGE_CONTENT_HINT_DYNAMIC will make it need @b zero copies
7431  * at texture upload time, which is an "expensive" operation.
7432  *
7433  * @see evas_object_image_content_hint_get()
7434  */
7435 EAPI void                     evas_object_image_content_hint_set       (Evas_Object *obj, Evas_Image_Content_Hint hint) EINA_ARG_NONNULL(1);
7436
7437 /**
7438  * Get the content hint setting of a given image object of the canvas.
7439  *
7440  * @param obj The given canvas pointer.
7441  * @return hint The content hint value set on it, one of the
7442  * #Evas_Image_Content_Hint ones (#EVAS_IMAGE_CONTENT_HINT_NONE means
7443  * an error).
7444  *
7445  * This function returns the content hint value of the given image of
7446  * the canvas.
7447  *
7448  * @see evas_object_image_content_hint_set()
7449  */
7450 EAPI Evas_Image_Content_Hint  evas_object_image_content_hint_get       (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
7451
7452
7453 /**
7454  * Enable an image to be used as an alpha mask.
7455  *
7456  * This will set any flags, and discard any excess image data not used as an
7457  * alpha mask.
7458  *
7459  * Note there is little point in using a image as alpha mask unless it has an
7460  * alpha channel.
7461  *
7462  * @param obj Object to use as an alpha mask.
7463  * @param ismask Use image as alphamask, must be true.
7464  */
7465 EAPI void                     evas_object_image_alpha_mask_set         (Evas_Object *obj, Eina_Bool ismask) EINA_ARG_NONNULL(1);
7466
7467 /**
7468  * Set the source object on an image object to used as a @b proxy.
7469  *
7470  * @param obj Proxy (image) object.
7471  * @param src Source object to use for the proxy.
7472  * @return @c EINA_TRUE on success, @c EINA_FALSE on error.
7473  *
7474  * If an image object is set to behave as a @b proxy, it will mirror
7475  * the rendering contents of a given @b source object in its drawing
7476  * region, without affecting that source in any way. The source must
7477  * be another valid Evas object. Other effects may be applied to the
7478  * proxy, such as a map (see evas_object_map_set()) to create a
7479  * reflection of the original object (for example).
7480  *
7481  * Any existing source object on @p obj will be removed after this
7482  * call. Setting @p src to @c NULL clears the proxy object (not in
7483  * "proxy state" anymore).
7484  *
7485  * @warning You cannot set a proxy as another proxy's source.
7486  *
7487  * @see evas_object_image_source_get()
7488  * @see evas_object_image_source_unset()
7489  */
7490 EAPI Eina_Bool                evas_object_image_source_set             (Evas_Object *obj, Evas_Object *src) EINA_ARG_NONNULL(1);
7491
7492 /**
7493  * Get the current source object of an image object.
7494  *
7495  * @param obj Image object
7496  * @return Source object (if any), or @c NULL, if not in "proxy mode"
7497  * (or on errors).
7498  *
7499  * @see evas_object_image_source_set() for more details
7500  */
7501 EAPI Evas_Object             *evas_object_image_source_get             (Evas_Object *obj) EINA_ARG_NONNULL(1);
7502
7503 /**
7504  * Clear the source object on a proxy image object.
7505  *
7506  * @param obj Image object to clear source of.
7507  * @return @c EINA_TRUE on success, @c EINA_FALSE on error.
7508  *
7509  * This is equivalent to calling evas_object_image_source_set() with a
7510  * @c NULL source.
7511  */
7512 EAPI Eina_Bool                evas_object_image_source_unset           (Evas_Object *obj) EINA_ARG_NONNULL(1);
7513
7514 /**
7515  * Check if a file extension may be supported by @ref Evas_Object_Image.
7516  *
7517  * @param file The file to check
7518  * @return EINA_TRUE if we may be able to opeen it, EINA_FALSE if it's unlikely.
7519  * @since 1.1.0
7520  *
7521  * If file is a Eina_Stringshare, use directly @ref evas_object_image_extension_can_load_fast_get.
7522  *
7523  * This functions is threadsafe.
7524  */
7525 EAPI Eina_Bool evas_object_image_extension_can_load_get(const char *file);
7526
7527 /**
7528  * Check if a file extension may be supported by @ref Evas_Object_Image.
7529  *
7530  * @param file The file to check, it should be an Eina_Stringshare.
7531  * @return EINA_TRUE if we may be able to open it, EINA_FALSE if it's unlikely.
7532  * @since 1.1.0
7533  *
7534  * This functions is threadsafe.
7535  */
7536 EAPI Eina_Bool evas_object_image_extension_can_load_fast_get(const char *file);
7537
7538 /**
7539  * Check if an image object can be animated (have multiple frames)
7540  *
7541  * @param obj Image object
7542  * @return whether obj support animation
7543  *
7544  * This returns if the image file of an image object is capable of animation
7545  * such as an animated gif file might. This is only useful to be called once
7546  * the image object file has been set.
7547  * 
7548  * Example:
7549  * @code
7550  * extern Evas_Object *obj;
7551  *
7552  * if (evas_object_image_animated_get(obj))
7553  *   {
7554  *     int frame_count;
7555  *     int loop_count;
7556  *     Evas_Image_Animated_Loop_Hint loop_type;
7557  *     double duration;
7558  *
7559  *     frame_count = evas_object_image_animated_frame_count_get(obj);
7560  *     printf("This image has %d frames\n",frame_count);
7561  *
7562  *     duration = evas_object_image_animated_frame_duration_get(obj,1,0); 
7563  *     printf("Frame 1's duration is %f. You had better set object's frame to 2 after this duration using timer\n");
7564  *     
7565  *     loop_count = evas_object_image_animated_loop_count_get(obj);
7566  *     printf("loop count is %d. You had better run loop %d times\n",loop_count,loop_count);
7567  *
7568  *     loop_type = evas_object_image_animated_loop_type_get(obj);
7569  *     if (loop_type == EVAS_IMAGE_ANIMATED_HINT_LOOP)
7570  *       printf("You had better set frame like 1->2->3->1->2->3...\n");
7571  *     else if (loop_type == EVAS_IMAGE_ANIMATED_HINT_PINGPONG)
7572  *       printf("You had better set frame like 1->2->3->2->1->2...\n");
7573  *     else
7574  *       printf("Unknown loop type\n");
7575  *
7576  *     evas_object_image_animated_frame_set(obj,1);
7577  *     printf("You set image object's frame to 1. You can see frame 1\n");
7578  *   }
7579  * @endcode
7580  * 
7581  * @see evas_object_image_animated_get()
7582  * @see evas_object_image_animated_frame_count_get() 
7583  * @see evas_object_image_animated_loop_type_get()
7584  * @see evas_object_image_animated_loop_count_get()
7585  * @see evas_object_image_animated_frame_duration_get()
7586  * @see evas_object_image_animated_frame_set()
7587  * @since 1.1.0
7588  */
7589 EAPI Eina_Bool evas_object_image_animated_get(const Evas_Object *obj);
7590
7591 /**
7592  * Get the total number of frames of the image object.
7593  *
7594  * @param obj Image object
7595  * @return The number of frames
7596  *
7597  * This returns total number of frames the image object supports (if animated)
7598  * 
7599  * @see evas_object_image_animated_get()
7600  * @see evas_object_image_animated_frame_count_get() 
7601  * @see evas_object_image_animated_loop_type_get()
7602  * @see evas_object_image_animated_loop_count_get()
7603  * @see evas_object_image_animated_frame_duration_get()
7604  * @see evas_object_image_animated_frame_set()
7605  * @since 1.1.0
7606  */
7607 EAPI int evas_object_image_animated_frame_count_get(const Evas_Object *obj);
7608
7609 /**
7610  * Get the kind of looping the image object does.
7611  *
7612  * @param obj Image object
7613  * @return Loop type of the image object
7614  *
7615  * This returns the kind of looping the image object wants to do.
7616  * 
7617  * If it returns EVAS_IMAGE_ANIMATED_HINT_LOOP, you should display frames in a sequence like:
7618  * 1->2->3->1->2->3->1...
7619  * If it returns EVAS_IMAGE_ANIMATED_HINT_PINGPONG, it is better to
7620  * display frames in a sequence like: 1->2->3->2->1->2->3->1...
7621  * 
7622  * The default type is EVAS_IMAGE_ANIMATED_HINT_LOOP.
7623  *
7624  * @see evas_object_image_animated_get()
7625  * @see evas_object_image_animated_frame_count_get() 
7626  * @see evas_object_image_animated_loop_type_get()
7627  * @see evas_object_image_animated_loop_count_get()
7628  * @see evas_object_image_animated_frame_duration_get()
7629  * @see evas_object_image_animated_frame_set()
7630  * @since 1.1.0
7631  */
7632 EAPI Evas_Image_Animated_Loop_Hint evas_object_image_animated_loop_type_get(const Evas_Object *obj);
7633
7634 /**
7635  * Get the number times the animation of the object loops.
7636  *
7637  * @param obj Image object
7638  * @return The number of loop of an animated image object
7639  *
7640  * This returns loop count of image. The loop count is the number of times
7641  * the animation will play fully from first to last frame until the animation
7642  * should stop (at the final frame).
7643  * 
7644  * If 0 is returned, then looping should happen indefinitely (no limit to
7645  * the number of times it loops).
7646  *
7647  * @see evas_object_image_animated_get()
7648  * @see evas_object_image_animated_frame_count_get() 
7649  * @see evas_object_image_animated_loop_type_get()
7650  * @see evas_object_image_animated_loop_count_get()
7651  * @see evas_object_image_animated_frame_duration_get()
7652  * @see evas_object_image_animated_frame_set()
7653  * @since 1.1.0
7654  */
7655 EAPI int evas_object_image_animated_loop_count_get(const Evas_Object *obj);
7656
7657 /**
7658  * Get the duration of a sequence of frames.
7659  *
7660  * @param obj Image object
7661  * @param start_frame The first frame
7662  * @param fram_num Number of frames in the sequence
7663  *
7664  * This returns total duration that the specified sequence of frames should
7665  * take in seconds.
7666  * 
7667  * If you set start_frame to 1 and frame_num 0, you get frame 1's duration
7668  * If you set start_frame to 1 and frame_num 1, you get frame 1's duration + 
7669  * frame2's duration
7670  *
7671  * @see evas_object_image_animated_get()
7672  * @see evas_object_image_animated_frame_count_get() 
7673  * @see evas_object_image_animated_loop_type_get()
7674  * @see evas_object_image_animated_loop_count_get()
7675  * @see evas_object_image_animated_frame_duration_get()
7676  * @see evas_object_image_animated_frame_set()
7677  * @since 1.1.0
7678  */
7679 EAPI double evas_object_image_animated_frame_duration_get(const Evas_Object *obj, int start_frame, int fram_num);
7680
7681 /**
7682  * Set the frame to current frame of an image object
7683  *
7684  * @param obj The given image object.
7685  * @param frame_num The index of current frame
7686  *
7687  * This set image object's current frame to frame_num with 1 being the first
7688  * frame.
7689  *
7690  * @see evas_object_image_animated_get()
7691  * @see evas_object_image_animated_frame_count_get() 
7692  * @see evas_object_image_animated_loop_type_get()
7693  * @see evas_object_image_animated_loop_count_get()
7694  * @see evas_object_image_animated_frame_duration_get()
7695  * @see evas_object_image_animated_frame_set()
7696  * @since 1.1.0
7697  */
7698 EAPI void evas_object_image_animated_frame_set(Evas_Object *obj, int frame_num);
7699 /**
7700  * @}
7701  */
7702
7703 /**
7704  * @defgroup Evas_Object_Text Text Object Functions
7705  *
7706  * Functions that operate on single line, single style text objects.
7707  *
7708  * For multiline and multiple style text, see @ref Evas_Object_Textblock.
7709  *
7710  * See some @ref Example_Evas_Text "examples" on this group of functions.
7711  *
7712  * @ingroup Evas_Object_Specific
7713  */
7714
7715 /**
7716  * @addtogroup Evas_Object_Text
7717  * @{
7718  */
7719
7720 /* basic styles (4 bits allocated use 0->10 now, 5 left) */
7721 #define EVAS_TEXT_STYLE_MASK_BASIC 0xf
7722
7723 /**
7724  * Text style type creation macro. Use style types on the 's'
7725  * arguments, being 'x' your style variable.
7726  */
7727 #define EVAS_TEXT_STYLE_BASIC_SET(x, s) \
7728    do { x = ((x) & ~EVAS_TEXT_STYLE_MASK_BASIC) | (s); } while (0)
7729
7730 #define EVAS_TEXT_STYLE_MASK_SHADOW_DIRECTION (0x7 << 4)
7731
7732 /**
7733  * Text style type creation macro. This one will impose shadow
7734  * directions on the style type variable -- use the @c
7735  * EVAS_TEXT_STYLE_SHADOW_DIRECTION_* values on 's', incrementally.
7736  */
7737 #define EVAS_TEXT_STYLE_SHADOW_DIRECTION_SET(x, s) \
7738    do { x = ((x) & ~EVAS_TEXT_STYLE_MASK_SHADOW_DIRECTION) | (s); } while (0)
7739
7740    typedef enum _Evas_Text_Style_Type
7741      {
7742         EVAS_TEXT_STYLE_PLAIN, /**< plain, standard text */
7743         EVAS_TEXT_STYLE_SHADOW, /**< text with shadow underneath */
7744         EVAS_TEXT_STYLE_OUTLINE, /**< text with an outline */
7745         EVAS_TEXT_STYLE_SOFT_OUTLINE, /**< text with a soft outline */
7746         EVAS_TEXT_STYLE_GLOW, /**< text with a glow effect */
7747         EVAS_TEXT_STYLE_OUTLINE_SHADOW, /**< text with both outline and shadow effects */
7748         EVAS_TEXT_STYLE_FAR_SHADOW, /**< text with (far) shadow underneath */
7749         EVAS_TEXT_STYLE_OUTLINE_SOFT_SHADOW, /**< text with outline and soft shadow effects combined */
7750         EVAS_TEXT_STYLE_SOFT_SHADOW, /**< text with (soft) shadow underneath */
7751         EVAS_TEXT_STYLE_FAR_SOFT_SHADOW, /**< text with (far soft) shadow underneath */
7752
7753         /* OR these to modify shadow direction (3 bits needed) */
7754         EVAS_TEXT_STYLE_SHADOW_DIRECTION_BOTTOM_RIGHT = (0x0 << 4), /**< shadow growing to bottom right */
7755         EVAS_TEXT_STYLE_SHADOW_DIRECTION_BOTTOM       = (0x1 << 4), /**< shadow growing to the bottom */
7756         EVAS_TEXT_STYLE_SHADOW_DIRECTION_BOTTOM_LEFT  = (0x2 << 4), /**< shadow growing to bottom left */
7757         EVAS_TEXT_STYLE_SHADOW_DIRECTION_LEFT         = (0x3 << 4), /**< shadow growing to the left */
7758         EVAS_TEXT_STYLE_SHADOW_DIRECTION_TOP_LEFT     = (0x4 << 4), /**< shadow growing to top left */
7759         EVAS_TEXT_STYLE_SHADOW_DIRECTION_TOP          = (0x5 << 4), /**< shadow growing to the top */
7760         EVAS_TEXT_STYLE_SHADOW_DIRECTION_TOP_RIGHT    = (0x6 << 4), /**< shadow growing to top right */
7761         EVAS_TEXT_STYLE_SHADOW_DIRECTION_RIGHT        = (0x7 << 4) /**< shadow growing to the right */
7762      } 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 */
7763
7764 /**
7765  * Creates a new text object on the provided canvas.
7766  *
7767  * @param e The canvas to create the text object on.
7768  * @return @c NULL on error, a pointer to a new text object on
7769  * success.
7770  *
7771  * Text objects are for simple, single line text elements. If you want
7772  * more elaborated text blocks, see @ref Evas_Object_Textblock.
7773  *
7774  * @see evas_object_text_font_source_set()
7775  * @see evas_object_text_font_set()
7776  * @see evas_object_text_text_set()
7777  */
7778 EAPI Evas_Object      *evas_object_text_add              (Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
7779
7780 /**
7781  * Set the font (source) file to be used on a given text object.
7782  *
7783  * @param obj The text object to set font for.
7784  * @param font The font file's path.
7785  *
7786  * This function allows the font file to be explicitly set for a given
7787  * text object, overriding system lookup, which will first occur in
7788  * the given file's contents.
7789  *
7790  * @see evas_object_text_font_get()
7791  */
7792 EAPI void              evas_object_text_font_source_set  (Evas_Object *obj, const char *font) EINA_ARG_NONNULL(1);
7793
7794 /**
7795  * Get the font file's path which is being used on a given text
7796  * object.
7797  *
7798  * @param obj The text object to set font for.
7799  * @return The font file's path.
7800  *
7801  * @see evas_object_text_font_get() for more details
7802  */
7803 EAPI const char       *evas_object_text_font_source_get  (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
7804
7805 /**
7806  * Set the font family and size on a given text object.
7807  *
7808  * @param obj The text object to set font for.
7809  * @param font The font (family) name.
7810  * @param size The font size, in points.
7811  *
7812  * This function allows the font name and size of a text object to be
7813  * set. The @p font string has to follow fontconfig's convention on
7814  * naming fonts, as it's the underlying library used to query system
7815  * fonts by Evas (see the @c fc-list command's output, on your system,
7816  * to get an idea).
7817  *
7818  * @see evas_object_text_font_get()
7819  * @see evas_object_text_font_source_set()
7820  */
7821    EAPI void              evas_object_text_font_set         (Evas_Object *obj, const char *font, Evas_Font_Size size) EINA_ARG_NONNULL(1);
7822
7823 /**
7824  * Retrieve the font family and size in use on a given text object.
7825  *
7826  * @param obj The evas text object to query for font information.
7827  * @param font A pointer to the location to store the font name in.
7828  * @param size A pointer to the location to store the font size in.
7829  *
7830  * This function allows the font name and size of a text object to be
7831  * queried. Be aware that the font name string is still owned by Evas
7832  * and should @b not have free() called on it by the caller of the
7833  * function.
7834  *
7835  * @see evas_object_text_font_set()
7836  */
7837 EAPI void              evas_object_text_font_get         (const Evas_Object *obj, const char **font, Evas_Font_Size *size) EINA_ARG_NONNULL(1);
7838
7839 /**
7840  * Sets the text string to be displayed by the given text object.
7841  *
7842  * @param obj The text object to set text string on.
7843  * @param text Text string to display on it.
7844  *
7845  * @see evas_object_text_text_get()
7846  */
7847 EAPI void              evas_object_text_text_set         (Evas_Object *obj, const char *text) EINA_ARG_NONNULL(1);
7848
7849 /**
7850  * Retrieves the text string currently being displayed by the given
7851  * text object.
7852  *
7853  * @param  obj The given text object.
7854  * @return The text string currently being displayed on it.
7855  *
7856  * @note Do not free() the return value.
7857  *
7858  * @see evas_object_text_text_set()
7859  */
7860 EAPI const char       *evas_object_text_text_get         (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
7861
7862 /**
7863  * @brief Sets the BiDi delimiters used in the textblock.
7864  *
7865  * BiDi delimiters are use for in-paragraph separation of bidi segments. This
7866  * is useful for example in recipients fields of e-mail clients where bidi
7867  * oddities can occur when mixing rtl and ltr.
7868  *
7869  * @param obj The given text object.
7870  * @param delim A null terminated string of delimiters, e.g ",|".
7871  * @since 1.1.0
7872  */
7873 EAPI void              evas_object_text_bidi_delimiters_set(Evas_Object *obj, const char *delim);
7874
7875 /**
7876  * @brief Gets the BiDi delimiters used in the textblock.
7877  *
7878  * BiDi delimiters are use for in-paragraph separation of bidi segments. This
7879  * is useful for example in recipients fields of e-mail clients where bidi
7880  * oddities can occur when mixing rtl and ltr.
7881  *
7882  * @param obj The given text object.
7883  * @return A null terminated string of delimiters, e.g ",|". If empty, returns NULL.
7884  * @since 1.1.0
7885  */
7886 EAPI const char       *evas_object_text_bidi_delimiters_get(const Evas_Object *obj);
7887
7888    EAPI Evas_Coord        evas_object_text_ascent_get       (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
7889    EAPI Evas_Coord        evas_object_text_descent_get      (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
7890    EAPI Evas_Coord        evas_object_text_max_ascent_get   (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
7891    EAPI Evas_Coord        evas_object_text_max_descent_get  (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
7892    EAPI Evas_Coord        evas_object_text_horiz_advance_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
7893    EAPI Evas_Coord        evas_object_text_vert_advance_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
7894    EAPI Evas_Coord        evas_object_text_inset_get        (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
7895
7896 /**
7897  * Retrieve position and dimension information of a character within a text @c Evas_Object.
7898  *
7899  * This function is used to obtain the X, Y, width and height of a the character
7900  * located at @p pos within the @c Evas_Object @p obj. @p obj must be a text object
7901  * as created with evas_object_text_add(). Any of the @c Evas_Coord parameters (@p cx,
7902  * @p cy, @p cw, @p ch) may be NULL in which case no value will be assigned to that
7903  * parameter.
7904  *
7905  * @param obj   The text object to retrieve position information for.
7906  * @param pos   The character position to request co-ordinates for.
7907  * @param cx    A pointer to an @c Evas_Coord to store the X value in (can be NULL).
7908  * @param cy    A pointer to an @c Evas_Coord to store the Y value in (can be NULL).
7909  * @param cw    A pointer to an @c Evas_Coord to store the Width value in (can be NULL).
7910  * @param ch    A pointer to an @c Evas_Coord to store the Height value in (can be NULL).
7911  *
7912  * @returns EINA_FALSE on success, EINA_TRUE on error.
7913  */
7914 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);
7915    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);
7916
7917 /**
7918  * Returns the logical position of the last char in the text
7919  * up to the pos given. this is NOT the position of the last char
7920  * because of the possibility of RTL in the text.
7921  */
7922 EAPI int               evas_object_text_last_up_to_pos   (const Evas_Object *obj, Evas_Coord x, Evas_Coord y) EINA_ARG_NONNULL(1);
7923
7924 /**
7925  * Retrieves the style on use on the given text object.
7926  *
7927  * @param obj the given text object to set style on.
7928  * @return the style type in use.
7929  *
7930  * @see evas_object_text_style_set() for more details.
7931  */
7932 EAPI Evas_Text_Style_Type evas_object_text_style_get     (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
7933
7934 /**
7935  * Sets the style to apply on the given text object.
7936  *
7937  * @param obj the given text object to set style on.
7938  * @param type a style type.
7939  *
7940  * Text object styles are one of the values in
7941  * #Evas_Text_Style_Type. Some of those values are combinations of
7942  * more than one style, and some account for the direction of the
7943  * rendering of shadow effects.
7944  *
7945  * @note One may use the helper macros #EVAS_TEXT_STYLE_BASIC_SET and
7946  * #EVAS_TEXT_STYLE_SHADOW_DIRECTION_SET to assemble a style value.
7947  *
7948  * The following figure illustrates the text styles:
7949  *
7950  * @image html text-styles.png
7951  * @image rtf text-styles.png
7952  * @image latex text-styles.eps
7953  *
7954  * @see evas_object_text_style_get()
7955  * @see evas_object_text_shadow_color_set()
7956  * @see evas_object_text_outline_color_set()
7957  * @see evas_object_text_glow_color_set()
7958  * @see evas_object_text_glow2_color_set()
7959  */
7960 EAPI void              evas_object_text_style_set        (Evas_Object *obj, Evas_Text_Style_Type type) EINA_ARG_NONNULL(1);
7961
7962 /**
7963  * Sets the shadow color for the given text object.
7964  *
7965  * @param obj The given Evas text object.
7966  * @param r The red component of the given color.
7967  * @param g The green component of the given color.
7968  * @param b The blue component of the given color.
7969  * @param a The alpha component of the given color.
7970  *
7971  * Shadow effects, which are fading colors decorating the text
7972  * underneath it, will just be shown if the object is set to one of
7973  * the following styles:
7974  *
7975  * - #EVAS_TEXT_STYLE_SHADOW
7976  * - #EVAS_TEXT_STYLE_OUTLINE_SHADOW
7977  * - #EVAS_TEXT_STYLE_FAR_SHADOW
7978  * - #EVAS_TEXT_STYLE_OUTLINE_SOFT_SHADOW
7979  * - #EVAS_TEXT_STYLE_SOFT_SHADOW
7980  * - #EVAS_TEXT_STYLE_FAR_SOFT_SHADOW
7981  *
7982  * One can also change the direction where the shadow grows to, with
7983  * evas_object_text_style_set().
7984  *
7985  * @see evas_object_text_shadow_color_get()
7986  */
7987 EAPI void              evas_object_text_shadow_color_set (Evas_Object *obj, int r, int g, int b, int a) EINA_ARG_NONNULL(1);
7988
7989 /**
7990  * Retrieves the shadow color for the given text object.
7991  *
7992  * @param obj The given Evas text object.
7993  * @param r Pointer to variable to hold the red component of the given
7994  * color.
7995  * @param g Pointer to variable to hold the green component of the
7996  * given color.
7997  * @param b Pointer to variable to hold the blue component of the
7998  * given color.
7999  * @param a Pointer to variable to hold the alpha component of the
8000  * given color.
8001  *
8002  * @note Use @c NULL pointers on the color components you're not
8003  * interested in: they'll be ignored by the function.
8004  *
8005  * @see evas_object_text_shadow_color_set() for more details.
8006  */
8007 EAPI void              evas_object_text_shadow_color_get (const Evas_Object *obj, int *r, int *g, int *b, int *a) EINA_ARG_NONNULL(1);
8008
8009 /**
8010  * Sets the glow color for the given text object.
8011  *
8012  * @param obj The given Evas text object.
8013  * @param r The red component of the given color.
8014  * @param g The green component of the given color.
8015  * @param b The blue component of the given color.
8016  * @param a The alpha component of the given color.
8017  *
8018  * Glow effects, which are glowing colors decorating the text's
8019  * surroundings, will just be shown if the object is set to the
8020  * #EVAS_TEXT_STYLE_GLOW style.
8021  *
8022  * @note Glow effects are placed from a short distance of the text
8023  * itself, but no touching it. For glowing effects right on the
8024  * borders of the glyphs, see 'glow 2' effects
8025  * (evas_object_text_glow2_color_set()).
8026  *
8027  * @see evas_object_text_glow_color_get()
8028  */
8029 EAPI void              evas_object_text_glow_color_set   (Evas_Object *obj, int r, int g, int b, int a) EINA_ARG_NONNULL(1);
8030
8031 /**
8032  * Retrieves the glow color for the given text object.
8033  *
8034  * @param obj The given Evas text object.
8035  * @param r Pointer to variable to hold the red component of the given
8036  * color.
8037  * @param g Pointer to variable to hold the green component of the
8038  * given color.
8039  * @param b Pointer to variable to hold the blue component of the
8040  * given color.
8041  * @param a Pointer to variable to hold the alpha component of the
8042  * given color.
8043  *
8044  * @note Use @c NULL pointers on the color components you're not
8045  * interested in: they'll be ignored by the function.
8046  *
8047  * @see evas_object_text_glow_color_set() for more details.
8048  */
8049 EAPI void              evas_object_text_glow_color_get   (const Evas_Object *obj, int *r, int *g, int *b, int *a) EINA_ARG_NONNULL(1);
8050
8051 /**
8052  * Sets the 'glow 2' color for the given text object.
8053  *
8054  * @param obj The given Evas text object.
8055  * @param r The red component of the given color.
8056  * @param g The green component of the given color.
8057  * @param b The blue component of the given color.
8058  * @param a The alpha component of the given color.
8059  *
8060  * 'Glow 2' effects, which are glowing colors decorating the text's
8061  * (immediate) surroundings, will just be shown if the object is set
8062  * to the #EVAS_TEXT_STYLE_GLOW style. See also
8063  * evas_object_text_glow_color_set().
8064  *
8065  * @see evas_object_text_glow2_color_get()
8066  */
8067 EAPI void              evas_object_text_glow2_color_set  (Evas_Object *obj, int r, int g, int b, int a) EINA_ARG_NONNULL(1);
8068
8069 /**
8070  * Retrieves the 'glow 2' color for the given text object.
8071  *
8072  * @param obj The given Evas text object.
8073  * @param r Pointer to variable to hold the red component of the given
8074  * color.
8075  * @param g Pointer to variable to hold the green component of the
8076  * given color.
8077  * @param b Pointer to variable to hold the blue component of the
8078  * given color.
8079  * @param a Pointer to variable to hold the alpha component of the
8080  * given color.
8081  *
8082  * @note Use @c NULL pointers on the color components you're not
8083  * interested in: they'll be ignored by the function.
8084  *
8085  * @see evas_object_text_glow2_color_set() for more details.
8086  */
8087 EAPI void              evas_object_text_glow2_color_get  (const Evas_Object *obj, int *r, int *g, int *b, int *a) EINA_ARG_NONNULL(1);
8088
8089 /**
8090  * Sets the outline color for the given text object.
8091  *
8092  * @param obj The given Evas text object.
8093  * @param r The red component of the given color.
8094  * @param g The green component of the given color.
8095  * @param b The blue component of the given color.
8096  * @param a The alpha component of the given color.
8097  *
8098  * Outline effects (colored lines around text glyphs) will just be
8099  * shown if the object is set to one of the following styles:
8100  * - #EVAS_TEXT_STYLE_OUTLINE
8101  * - #EVAS_TEXT_STYLE_SOFT_OUTLINE
8102  * - #EVAS_TEXT_STYLE_OUTLINE_SHADOW
8103  * - #EVAS_TEXT_STYLE_OUTLINE_SOFT_SHADOW
8104  *
8105  * @see evas_object_text_outline_color_get()
8106  */
8107 EAPI void              evas_object_text_outline_color_set(Evas_Object *obj, int r, int g, int b, int a) EINA_ARG_NONNULL(1);
8108
8109 /**
8110  * Retrieves the outline color for the given text object.
8111  *
8112  * @param obj The given Evas text object.
8113  * @param r Pointer to variable to hold the red component of the given
8114  * color.
8115  * @param g Pointer to variable to hold the green component of the
8116  * given color.
8117  * @param b Pointer to variable to hold the blue component of the
8118  * given color.
8119  * @param a Pointer to variable to hold the alpha component of the
8120  * given color.
8121  *
8122  * @note Use @c NULL pointers on the color components you're not
8123  * interested in: they'll be ignored by the function.
8124  *
8125  * @see evas_object_text_outline_color_set() for more details.
8126  */
8127 EAPI void              evas_object_text_outline_color_get(const Evas_Object *obj, int *r, int *g, int *b, int *a) EINA_ARG_NONNULL(1);
8128
8129 /**
8130  * Gets the text style pad of a text object.
8131  *
8132  * @param obj The given text object.
8133  * @param l The left pad (or @c NULL).
8134  * @param r The right pad (or @c NULL).
8135  * @param t The top pad (or @c NULL).
8136  * @param b The bottom pad (or @c NULL).
8137  *
8138  */
8139 EAPI void              evas_object_text_style_pad_get    (const Evas_Object *obj, int *l, int *r, int *t, int *b) EINA_ARG_NONNULL(1);
8140
8141 /**
8142  * Retrieves the direction of the text currently being displayed in the
8143  * text object.
8144  * @param  obj The given evas text object.
8145  * @return the direction of the text
8146  */
8147 EAPI Evas_BiDi_Direction evas_object_text_direction_get  (const Evas_Object *obj) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
8148
8149 /**
8150  * @}
8151  */
8152
8153 /**
8154  * @defgroup Evas_Object_Textblock Textblock Object Functions
8155  *
8156  * Functions used to create and manipulate textblock objects. Unlike
8157  * @ref Evas_Object_Text, these handle complex text, doing multiple
8158  * styles and multiline text based on HTML-like tags. Of these extra
8159  * features will be heavier on memory and processing cost.
8160  *
8161  * @section Evas_Object_Textblock_Tutorial Textblock Object Tutorial
8162  *
8163  * This part explains about the textblock object's API and proper usage.
8164  * If you want to develop textblock, you should also refer to @ref Evas_Object_Textblock_Internal.
8165  * The main user of the textblock object is the edje entry object in Edje, so
8166  * that's a good place to learn from, but I think this document is more than
8167  * enough, if it's not, please contact me and I'll update it.
8168  *
8169  * @subsection textblock_intro Introduction
8170  * The textblock objects is, as implied, an object that can show big chunks of
8171  * text. Textblock supports many features including: Text formatting, automatic
8172  * and manual text alignment, embedding items (for example icons) and more.
8173  * Textblock has three important parts, the text paragraphs, the format nodes
8174  * and the cursors.
8175  *
8176  * You can use markup to format text, for example: "<font_size=50>Big!</font_size>".
8177  * You can also put more than one style directive in one tag:
8178  * "<font_size=50 color=#F00>Big and Red!</font_size>".
8179  * Please notice that we used "</font_size>" although the format also included
8180  * color, this is because the first format determines the matching closing tag's
8181  * name. You can also use anonymous tags, like: "<font_size=30>Big</>" which
8182  * just pop any type of format, but it's advised to use the named alternatives
8183  * instead.
8184  *
8185  * @subsection textblock_cursors Textblock Object Cursors
8186  * A textblock Cursor @ref Evas_Textblock_Cursor is data type that represents
8187  * a position in a textblock. Each cursor contains information about the
8188  * paragraph it points to, the position in that paragraph and the object itself.
8189  * Cursors register to textblock objects upon creation, this means that once
8190  * you created a cursor, it belongs to a specific obj and you can't for example
8191  * copy a cursor "into" a cursor of a different object. Registered cursors
8192  * also have the added benefit of updating automatically upon textblock changes,
8193  * this means that if you have a cursor pointing to a specific character, it'll
8194  * still point to it even after you change the whole object completely (as long
8195  * as the char was not deleted), this is not possible without updating, because
8196  * as mentioned, each cursor holds a character position. There are many
8197  * functions that handle cursors, just check out the evas_textblock_cursor*
8198  * functions. For creation and deletion of cursors check out:
8199  * @see evas_object_textblock_cursor_new()
8200  * @see evas_textblock_cursor_free()
8201  * @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).
8202  *
8203  * @subsection textblock_paragraphs Textblock Object Paragraphs
8204  * The textblock object is made out of text splitted to paragraphs (delimited
8205  * by the paragraph separation character). Each paragraph has many (or none)
8206  * format nodes associated with it which are responsible for the formatting
8207  * of that paragraph.
8208  *
8209  * @subsection textblock_format_nodes Textblock Object Format Nodes
8210  * As explained in @ref textblock_paragraphs each one of the format nodes
8211  * is associated with a paragraph.
8212  * There are two types of format nodes, visible and invisible:
8213  * Visible: formats that a cursor can point to, i.e formats that
8214  * occupy space, for example: newlines, tabs, items and etc. Some visible items
8215  * are made of two parts, in this case, only the opening tag is visible.
8216  * A closing tag (i.e a \</tag\> tag) should NEVER be visible.
8217  * Invisible: formats that don't occupy space, for example: bold and underline.
8218  * Being able to access format nodes is very important for some uses. For
8219  * example, edje uses the "<a>" format to create links in the text (and pop
8220  * popups above them when clicked). For the textblock object a is just a
8221  * formatting instruction (how to color the text), but edje utilizes the access
8222  * to the format nodes to make it do more.
8223  * For more information, take a look at all the evas_textblock_node_format_*
8224  * functions.
8225  * The translation of "<tag>" tags to actual format is done according to the
8226  * tags defined in the style, see @ref evas_textblock_style_set
8227  *
8228  * @subsection textblock_special_formats Special Formats
8229  * Textblock supports various format directives that can be used either in
8230  * markup, or by calling @ref evas_object_textblock_format_append or
8231  * @ref evas_object_textblock_format_prepend. In addition to the mentioned
8232  * format directives, textblock allows creating additional format directives
8233  * using "tags" that can be set in the style see @ref evas_textblock_style_set .
8234  *
8235  * Textblock supports the following formats:
8236  * @li font - Font description in fontconfig like format, e.g: "Sans:style=Italic:lang=hi". or "Serif:style=Bold".
8237  * @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".
8238  * @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".
8239  * @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".
8240  * @li lang - Overrides the language defined in "font". E.g: "lang=he" is the same as "font=:lang=he".
8241  * @li font_fallbacks - A comma delimited list of fonts to try if finding the main font fails.
8242  * @li font_size - The font size in points.
8243  * @li font_source - The source of the font, e.g an eet file.
8244  * @li color - Text color in one of the following formats: "#RRGGBB", "#RRGGBBAA", "#RGB", and "#RGBA".
8245  * @li underline_color - color in one of the following formats: "#RRGGBB", "#RRGGBBAA", "#RGB", and "#RGBA".
8246  * @li underline2_color - color in one of the following formats: "#RRGGBB", "#RRGGBBAA", "#RGB", and "#RGBA".
8247  * @li outline_color - color in one of the following formats: "#RRGGBB", "#RRGGBBAA", "#RGB", and "#RGBA".
8248  * @li shadow_color - color in one of the following formats: "#RRGGBB", "#RRGGBBAA", "#RGB", and "#RGBA".
8249  * @li glow_color - color in one of the following formats: "#RRGGBB", "#RRGGBBAA", "#RGB", and "#RGBA".
8250  * @li glow2_color - color in one of the following formats: "#RRGGBB", "#RRGGBBAA", "#RGB", and "#RGBA".
8251  * @li backing_color - color in one of the following formats: "#RRGGBB", "#RRGGBBAA", "#RGB", and "#RGBA".
8252  * @li strikethrough_color - color in one of the following formats: "#RRGGBB", "#RRGGBBAA", "#RGB", and "#RGBA".
8253  * @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%.
8254  * @li valign - Either "top", "bottom", "middle", "center", "baseline", "base", a value between 0.0 and 1.0, or a value between 0% to 100%.
8255  * @li wrap - "word", "char", "mixed", or "none".
8256  * @li left_margin - Either "reset", or a pixel value indicating the margin.
8257  * @li right_margin - Either "reset", or a pixel value indicating the margin.
8258  * @li underline - "on", "off", "single", or "double".
8259  * @li strikethrough - "on" or "off"
8260  * @li backing - "on" or "off"
8261  * @li style - Either "off", "none", "plain", "shadow", "outline", "soft_outline", "outline_shadow", "outline_soft_shadow", "glow", "far_shadow", "soft_shadow", or "far_soft_shadow".
8262  * @li tabstops - Pixel value for tab width.
8263  * @li linesize - Force a line size in pixels.
8264  * @li linerelsize - Either a floating point value or a percentage indicating the wanted size of the line relative to the calculated size.
8265  * @li linegap - Force a line gap in pixels.
8266  * @li linerelgap - Either a floating point value or a percentage indicating the wanted size of the line relative to the calculated size.
8267  * @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.
8268  * @li linefill - Either a float value or percentage indicating how much to fill the line.
8269  * @li ellipsis - Value between 0.0-1.0 to indicate the type of ellipsis, or -1.0 to indicate ellipsis isn't wanted.
8270  * @li password - "on" or "off". This is used to specifically turn replacing chars with the replacement char (i.e password mode) on and off.
8271  *
8272  *
8273  * @todo put here some usage examples
8274  *
8275  * @ingroup Evas_Object_Specific
8276  *
8277  * @{
8278  */
8279
8280    typedef struct _Evas_Textblock_Style                 Evas_Textblock_Style;
8281    typedef struct _Evas_Textblock_Cursor                Evas_Textblock_Cursor;
8282    /**
8283     * @typedef Evas_Object_Textblock_Node_Format
8284     * A format node.
8285     */
8286    typedef struct _Evas_Object_Textblock_Node_Format    Evas_Object_Textblock_Node_Format;
8287    typedef struct _Evas_Textblock_Rectangle             Evas_Textblock_Rectangle;
8288
8289    struct _Evas_Textblock_Rectangle
8290      {
8291         Evas_Coord x, y, w, h;
8292      };
8293
8294    typedef enum _Evas_Textblock_Text_Type
8295      {
8296         EVAS_TEXTBLOCK_TEXT_RAW,
8297         EVAS_TEXTBLOCK_TEXT_PLAIN,
8298         EVAS_TEXTBLOCK_TEXT_MARKUP
8299      } Evas_Textblock_Text_Type;
8300
8301    typedef enum _Evas_Textblock_Cursor_Type
8302      {
8303         EVAS_TEXTBLOCK_CURSOR_UNDER,
8304         EVAS_TEXTBLOCK_CURSOR_BEFORE
8305      } Evas_Textblock_Cursor_Type;
8306
8307
8308 /**
8309  * Adds a textblock to the given evas.
8310  * @param   e The given evas.
8311  * @return  The new textblock object.
8312  */
8313 EAPI Evas_Object                 *evas_object_textblock_add(Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
8314
8315
8316 /**
8317  * Returns the unescaped version of escape.
8318  * @param escape the string to be escaped
8319  * @return the unescaped version of escape
8320  */
8321 EAPI const char                  *evas_textblock_escape_string_get(const char *escape) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
8322
8323 /**
8324  * Returns the escaped version of the string.
8325  * @param string to escape
8326  * @param len_ret the len of the part of the string that was used.
8327  * @return the escaped string.
8328  */
8329 EAPI const char                  *evas_textblock_string_escape_get(const char *string, int *len_ret) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
8330
8331 /**
8332  * Return the unescaped version of the string between start and end.
8333  *
8334  * @param escape_start the start of the string.
8335  * @param escape_end the end of the string.
8336  * @return the unescaped version of the range
8337  */
8338 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);
8339
8340 /**
8341  * Return the plain version of the markup.
8342  *
8343  * Works as if you set the markup to a textblock and then retrieve the plain
8344  * version of the text. i.e: <br> and <\n> will be replaced with \n, &...; with
8345  * the actual char and etc.
8346  *
8347  * @param obj the textblock object to work with. (if NULL, tries the default)
8348  * @param text the markup text (if NULL, return NULL)
8349  * @return an allocated plain text version of the markup
8350  * @since 1.2.0
8351  */
8352 EAPI char                        *evas_textblock_text_markup_to_utf8(const Evas_Object *obj, const char *text) EINA_WARN_UNUSED_RESULT EINA_MALLOC;
8353
8354 /**
8355  * Return the markup version of the plain text.
8356  *
8357  * Replaces \\n -\> \<br/\> \\t -\> \<tab/\> and etc. Generally needed before you pass
8358  * plain text to be set in a textblock.
8359  *
8360  * @param obj the textblock object to work with (if NULL, it just does the
8361  * default behaviour, i.e with no extra object information).
8362  * @param text the markup text (if NULL, return NULL)
8363  * @return an allocated plain text version of the markup
8364  * @since 1.2.0
8365  */
8366 EAPI char                        *evas_textblock_text_utf8_to_markup(const Evas_Object *obj, const char *text) EINA_WARN_UNUSED_RESULT EINA_MALLOC;
8367
8368 /**
8369  * Creates a new textblock style.
8370  * @return  The new textblock style.
8371  */
8372 EAPI Evas_Textblock_Style        *evas_textblock_style_new(void) EINA_WARN_UNUSED_RESULT EINA_MALLOC;
8373
8374 /**
8375  * Destroys a textblock style.
8376  * @param ts The textblock style to free.
8377  */
8378 EAPI void                         evas_textblock_style_free(Evas_Textblock_Style *ts) EINA_ARG_NONNULL(1);
8379
8380 /**
8381  * Sets the style ts to the style passed as text by text.
8382  * Expected a string consisting of many (or none) tag='format' pairs.
8383  *
8384  * @param ts  the style to set.
8385  * @param text the text to parse - NOT NULL.
8386  * @return Returns no value.
8387  */
8388 EAPI void                         evas_textblock_style_set(Evas_Textblock_Style *ts, const char *text) EINA_ARG_NONNULL(1);
8389
8390 /**
8391  * Return the text of the style ts.
8392  * @param ts  the style to get it's text.
8393  * @return the text of the style or null on error.
8394  */
8395 EAPI const char                  *evas_textblock_style_get(const Evas_Textblock_Style *ts) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
8396
8397
8398 /**
8399  * Set the objects style to ts.
8400  * @param obj the Evas object to set the style to.
8401  * @param ts  the style to set.
8402  * @return Returns no value.
8403  */
8404 EAPI void                         evas_object_textblock_style_set(Evas_Object *obj, Evas_Textblock_Style *ts) EINA_ARG_NONNULL(1);
8405
8406 /**
8407  * Return the style of an object.
8408  * @param obj  the object to get the style from.
8409  * @return the style of the object.
8410  */
8411 EAPI const Evas_Textblock_Style  *evas_object_textblock_style_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
8412
8413 /**
8414  * Push ts to the top of the user style stack.
8415  *
8416  * FIXME: API is solid but currently only supports 1 style in the stack.
8417  *
8418  * The user style overrides the corresponding elements of the regular style.
8419  * This is the proper way to do theme overrides in code.
8420  * @param obj the Evas object to set the style to.
8421  * @param ts  the style to set.
8422  * @return Returns no value.
8423  * @see evas_object_textblock_style_set
8424  * @since 1.2.0
8425  */
8426 EAPI void                         evas_object_textblock_style_user_push(Evas_Object *obj, Evas_Textblock_Style *ts) EINA_ARG_NONNULL(1);
8427
8428 /**
8429  * Del the from the top of the user style stack.
8430  *
8431  * @param obj  the object to get the style from.
8432  * @see evas_object_textblock_style_get
8433  * @since 1.2.0
8434  */
8435 EAPI void                        evas_object_textblock_style_user_pop(Evas_Object *obj) EINA_ARG_NONNULL(1);
8436
8437 /**
8438  * Get (don't remove) the style at the top of the user style stack.
8439  *
8440  * @param obj  the object to get the style from.
8441  * @return the style of the object.
8442  * @see evas_object_textblock_style_get
8443  * @since 1.2.0
8444  */
8445 EAPI const Evas_Textblock_Style  *evas_object_textblock_style_user_peek(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
8446
8447 /**
8448  * @brief Set the "replacement character" to use for the given textblock object.
8449  *
8450  * @param obj The given textblock object.
8451  * @param ch The charset name.
8452  */
8453 EAPI void                         evas_object_textblock_replace_char_set(Evas_Object *obj, const char *ch) EINA_ARG_NONNULL(1);
8454
8455 /**
8456  * @brief Get the "replacement character" for given textblock object. Returns
8457  * NULL if no replacement character is in use.
8458  *
8459  * @param obj The given textblock object
8460  * @return replacement character or @c NULL
8461  */
8462 EAPI const char                  *evas_object_textblock_replace_char_get(Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
8463
8464 /**
8465  * @brief Sets the vertical alignment of text within the textblock object
8466  * as a whole.
8467  *
8468  * Normally alignment is 0.0 (top of object). Values given should be
8469  * between 0.0 and 1.0 (1.0 bottom of object, 0.5 being vertically centered
8470  * etc.).
8471  *
8472  * @param obj The given textblock object.
8473  * @param align A value between 0.0 and 1.0
8474  * @since 1.1.0
8475  */
8476 EAPI void                         evas_object_textblock_valign_set(Evas_Object *obj, double align);
8477
8478 /**
8479  * @brief Gets the vertical alignment of a textblock
8480  *
8481  * @param obj The given textblock object.
8482  * @return The alignment set for the object
8483  * @since 1.1.0
8484  */
8485 EAPI double                       evas_object_textblock_valign_get(const Evas_Object *obj);
8486
8487 /**
8488  * @brief Sets the BiDi delimiters used in the textblock.
8489  *
8490  * BiDi delimiters are use for in-paragraph separation of bidi segments. This
8491  * is useful for example in recipients fields of e-mail clients where bidi
8492  * oddities can occur when mixing rtl and ltr.
8493  *
8494  * @param obj The given textblock object.
8495  * @param delim A null terminated string of delimiters, e.g ",|".
8496  * @since 1.1.0
8497  */
8498 EAPI void                         evas_object_textblock_bidi_delimiters_set(Evas_Object *obj, const char *delim);
8499
8500 /**
8501  * @brief Gets the BiDi delimiters used in the textblock.
8502  *
8503  * BiDi delimiters are use for in-paragraph separation of bidi segments. This
8504  * is useful for example in recipients fields of e-mail clients where bidi
8505  * oddities can occur when mixing rtl and ltr.
8506  *
8507  * @param obj The given textblock object.
8508  * @return A null terminated string of delimiters, e.g ",|". If empty, returns NULL.
8509  * @since 1.1.0
8510  */
8511 EAPI const char                  *evas_object_textblock_bidi_delimiters_get(const Evas_Object *obj);
8512
8513 /**
8514  * @brief Sets newline mode. When true, newline character will behave
8515  * as a paragraph separator.
8516  *
8517  * @param obj The given textblock object.
8518  * @param mode EINA_TRUE for legacy mode, EINA_FALSE otherwise.
8519  * @since 1.1.0
8520  */
8521 EAPI void                         evas_object_textblock_legacy_newline_set(Evas_Object *obj, Eina_Bool mode) EINA_ARG_NONNULL(1);
8522
8523 /**
8524  * @brief Gets newline mode. When true, newline character behaves
8525  * as a paragraph separator.
8526  *
8527  * @param obj The given textblock object.
8528  * @return EINA_TRUE if in legacy mode, EINA_FALSE otherwise.
8529  * @since 1.1.0
8530  */
8531 EAPI Eina_Bool                    evas_object_textblock_legacy_newline_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
8532
8533
8534 /**
8535  * Sets the tetxblock's text to the markup text.
8536  *
8537  * @note assumes text does not include the unicode object replacement char (0xFFFC)
8538  *
8539  * @param obj  the textblock object.
8540  * @param text the markup text to use.
8541  * @return Return no value.
8542  */
8543 EAPI void                         evas_object_textblock_text_markup_set(Evas_Object *obj, const char *text) EINA_ARG_NONNULL(1);
8544
8545 /**
8546  * Prepends markup to the cursor cur.
8547  *
8548  * @note assumes text does not include the unicode object replacement char (0xFFFC)
8549  *
8550  * @param cur  the cursor to prepend to.
8551  * @param text the markup text to prepend.
8552  * @return Return no value.
8553  */
8554 EAPI void                         evas_object_textblock_text_markup_prepend(Evas_Textblock_Cursor *cur, const char *text) EINA_ARG_NONNULL(1, 2);
8555
8556 /**
8557  * Return the markup of the object.
8558  *
8559  * @param obj the Evas object.
8560  * @return the markup text of the object.
8561  */
8562 EAPI const char                  *evas_object_textblock_text_markup_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
8563
8564
8565 /**
8566  * Return the object's main cursor.
8567  *
8568  * @param obj the object.
8569  * @return the obj's main cursor.
8570  */
8571 EAPI Evas_Textblock_Cursor *evas_object_textblock_cursor_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
8572
8573 /**
8574  * Create a new cursor, associate it to the obj and init it to point
8575  * to the start of the textblock. Association to the object means the cursor
8576  * will be updated when the object will change.
8577  *
8578  * @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).
8579  *
8580  * @param obj the object to associate to.
8581  * @return the new cursor.
8582  */
8583 EAPI Evas_Textblock_Cursor       *evas_object_textblock_cursor_new(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
8584
8585
8586 /**
8587  * Free the cursor and unassociate it from the object.
8588  * @note do not use it to free unassociated cursors.
8589  *
8590  * @param cur the cursor to free.
8591  * @return Returns no value.
8592  */
8593 EAPI void                         evas_textblock_cursor_free(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8594
8595
8596 /**
8597  * Sets the cursor to the start of the first text node.
8598  *
8599  * @param cur the cursor to update.
8600  * @return Returns no value.
8601  */
8602 EAPI void                         evas_textblock_cursor_paragraph_first(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8603
8604 /**
8605  * sets the cursor to the end of the last text node.
8606  *
8607  * @param cur the cursor to set.
8608  * @return Returns no value.
8609  */
8610 EAPI void                         evas_textblock_cursor_paragraph_last(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8611
8612 /**
8613  * Advances to the start of the next text node
8614  *
8615  * @param cur the cursor to update
8616  * @return #EINA_TRUE if it managed to advance a paragraph, #EINA_FALSE otherwise.
8617  */
8618 EAPI Eina_Bool                    evas_textblock_cursor_paragraph_next(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8619
8620 /**
8621  * Advances to the end of the previous text node
8622  *
8623  * @param cur the cursor to update
8624  * @return #EINA_TRUE if it managed to advance a paragraph, #EINA_FALSE otherwise.
8625  */
8626 EAPI Eina_Bool                    evas_textblock_cursor_paragraph_prev(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8627
8628 /**
8629  * Returns the
8630  *
8631  * @param obj The evas, must not be NULL.
8632  * @param anchor the anchor name to get
8633  * @return Returns the list format node corresponding to the anchor, may be null if there are none.
8634  */
8635 EAPI const Eina_List             *evas_textblock_node_format_list_get(const Evas_Object *obj, const char *anchor) EINA_ARG_NONNULL(1, 2);
8636
8637 /**
8638  * Returns the first format node.
8639  *
8640  * @param obj The evas, must not be NULL.
8641  * @return Returns the first format node, may be null if there are none.
8642  */
8643 EAPI const Evas_Object_Textblock_Node_Format *evas_textblock_node_format_first_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
8644
8645 /**
8646  * Returns the last format node.
8647  *
8648  * @param obj The evas textblock, must not be NULL.
8649  * @return Returns the first format node, may be null if there are none.
8650  */
8651 EAPI const Evas_Object_Textblock_Node_Format *evas_textblock_node_format_last_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
8652
8653 /**
8654  * Returns the next format node (after n)
8655  *
8656  * @param n the current format node - not null.
8657  * @return Returns the next format node, may be null.
8658  */
8659 EAPI const Evas_Object_Textblock_Node_Format *evas_textblock_node_format_next_get(const Evas_Object_Textblock_Node_Format *n) EINA_ARG_NONNULL(1);
8660
8661 /**
8662  * Returns the prev format node (after n)
8663  *
8664  * @param n the current format node - not null.
8665  * @return Returns the prev format node, may be null.
8666  */
8667 EAPI const Evas_Object_Textblock_Node_Format *evas_textblock_node_format_prev_get(const Evas_Object_Textblock_Node_Format *n) EINA_ARG_NONNULL(1);
8668
8669 /**
8670  * Remove a format node and it's match. i.e, removes a \<tag\> \</tag\> pair.
8671  * Assumes the node is the first part of \<tag\> i.e, this won't work if
8672  * n is a closing tag.
8673  *
8674  * @param obj the Evas object of the textblock - not null.
8675  * @param n the current format node - not null.
8676  */
8677 EAPI void                         evas_textblock_node_format_remove_pair(Evas_Object *obj, Evas_Object_Textblock_Node_Format *n) EINA_ARG_NONNULL(1, 2);
8678
8679 /**
8680  * Sets the cursor to point to the place where format points to.
8681  *
8682  * @param cur the cursor to update.
8683  * @param n the format node to update according.
8684  * @deprecated duplicate of evas_textblock_cursor_at_format_set
8685  */
8686 EAPI void                         evas_textblock_cursor_set_at_format(Evas_Textblock_Cursor *cur, const Evas_Object_Textblock_Node_Format *n) EINA_ARG_NONNULL(1, 2);
8687
8688 /**
8689  * Return the format node at the position pointed by cur.
8690  *
8691  * @param cur the position to look at.
8692  * @return the format node if found, NULL otherwise.
8693  * @see evas_textblock_cursor_format_is_visible_get()
8694  */
8695 EAPI const Evas_Object_Textblock_Node_Format *evas_textblock_cursor_format_get(const Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8696
8697 /**
8698  * Get the text format representation of the format node.
8699  *
8700  * @param fnode the format node.
8701  * @return the textual format of the format node.
8702  */
8703 EAPI const char                  *evas_textblock_node_format_text_get(const Evas_Object_Textblock_Node_Format *fnode) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
8704
8705 /**
8706  * Set the cursor to point to the position of fmt.
8707  *
8708  * @param cur the cursor to update
8709  * @param fmt the format to update according to.
8710  */
8711 EAPI void                         evas_textblock_cursor_at_format_set(Evas_Textblock_Cursor *cur, const Evas_Object_Textblock_Node_Format *fmt) EINA_ARG_NONNULL(1, 2);
8712
8713 /**
8714  * Check if the current cursor position is a visible format. This way is more
8715  * efficient than evas_textblock_cursor_format_get() to check for the existence
8716  * of a visible format.
8717  *
8718  * @param cur the cursor to look at.
8719  * @return #EINA_TRUE if the cursor points to a visible format, #EINA_FALSE otherwise.
8720  * @see evas_textblock_cursor_format_get()
8721  */
8722 EAPI Eina_Bool                    evas_textblock_cursor_format_is_visible_get(const Evas_Textblock_Cursor *cur) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
8723
8724 /**
8725  * Advances to the next format node
8726  *
8727  * @param cur the cursor to be updated.
8728  * @return #EINA_TRUE on success #EINA_FALSE otherwise.
8729  */
8730 EAPI Eina_Bool                    evas_textblock_cursor_format_next(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8731
8732 /**
8733  * Advances to the previous format node.
8734  *
8735  * @param cur the cursor to update.
8736  * @return #EINA_TRUE on success #EINA_FALSE otherwise.
8737  */
8738 EAPI Eina_Bool                    evas_textblock_cursor_format_prev(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8739
8740 /**
8741  * Returns true if the cursor points to a format.
8742  *
8743  * @param cur the cursor to check.
8744  * @return Returns #EINA_TRUE if a cursor points to a format #EINA_FALSE otherwise.
8745  */
8746 EAPI Eina_Bool                    evas_textblock_cursor_is_format(const Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8747
8748 /**
8749  * Advances 1 char forward.
8750  *
8751  * @param cur the cursor to advance.
8752  * @return #EINA_TRUE on success #EINA_FALSE otherwise.
8753  */
8754 EAPI Eina_Bool                    evas_textblock_cursor_char_next(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8755
8756 /**
8757  * Advances 1 char backward.
8758  *
8759  * @param cur the cursor to advance.
8760  * @return #EINA_TRUE on success #EINA_FALSE otherwise.
8761  */
8762 EAPI Eina_Bool                    evas_textblock_cursor_char_prev(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8763
8764 /**
8765  * Moves the cursor to the start of the word under the cursor.
8766  *
8767  * @param cur the cursor to move.
8768  * @return #EINA_TRUE on success #EINA_FALSE otherwise.
8769  * @since 1.2.0
8770  */
8771 EAPI Eina_Bool                    evas_textblock_cursor_word_start(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8772
8773 /**
8774  * Moves the cursor to the end of the word under the cursor.
8775  *
8776  * @param cur the cursor to move.
8777  * @return #EINA_TRUE on success #EINA_FALSE otherwise.
8778  * @since 1.2.0
8779  */
8780 EAPI Eina_Bool                    evas_textblock_cursor_word_end(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8781
8782 /**
8783  * Go to the first char in the node the cursor is pointing on.
8784  *
8785  * @param cur the cursor to update.
8786  * @return Returns no value.
8787  */
8788 EAPI void                         evas_textblock_cursor_paragraph_char_first(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8789
8790 /**
8791  * Go to the last char in a text node.
8792  *
8793  * @param cur the cursor to update.
8794  * @return Returns no value.
8795  */
8796 EAPI void                         evas_textblock_cursor_paragraph_char_last(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8797
8798 /**
8799  * Go to the start of the current line
8800  *
8801  * @param cur the cursor to update.
8802  * @return Returns no value.
8803  */
8804 EAPI void                         evas_textblock_cursor_line_char_first(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8805
8806 /**
8807  * Go to the end of the current line.
8808  *
8809  * @param cur the cursor to update.
8810  * @return Returns no value.
8811  */
8812 EAPI void                         evas_textblock_cursor_line_char_last(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8813
8814 /**
8815  * Return the current cursor pos.
8816  *
8817  * @param cur the cursor to take the position from.
8818  * @return the position or -1 on error
8819  */
8820 EAPI int                          evas_textblock_cursor_pos_get(const Evas_Textblock_Cursor *cur) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
8821
8822 /**
8823  * Set the cursor pos.
8824  *
8825  * @param cur the cursor to be set.
8826  * @param pos the pos to set.
8827  */
8828 EAPI void                         evas_textblock_cursor_pos_set(Evas_Textblock_Cursor *cur, int pos) EINA_ARG_NONNULL(1);
8829
8830 /**
8831  * Go to the start of the line passed
8832  *
8833  * @param cur cursor to update.
8834  * @param line numer to set.
8835  * @return #EINA_TRUE on success, #EINA_FALSE on error.
8836  */
8837 EAPI Eina_Bool                    evas_textblock_cursor_line_set(Evas_Textblock_Cursor *cur, int line) EINA_ARG_NONNULL(1);
8838
8839 /**
8840  * Compare two cursors.
8841  *
8842  * @param cur1 the first cursor.
8843  * @param cur2 the second cursor.
8844  * @return -1 if cur1 < cur2, 0 if cur1 == cur2 and 1 otherwise.
8845  */
8846 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);
8847
8848 /**
8849  * Make cur_dest point to the same place as cur. Does not work if they don't
8850  * point to the same object.
8851  *
8852  * @param cur the source cursor.
8853  * @param cur_dest destination cursor.
8854  * @return Returns no value.
8855  */
8856 EAPI void                         evas_textblock_cursor_copy(const Evas_Textblock_Cursor *cur, Evas_Textblock_Cursor *cur_dest) EINA_ARG_NONNULL(1, 2);
8857
8858
8859 /**
8860  * Adds text to the current cursor position and set the cursor to *before*
8861  * the start of the text just added.
8862  *
8863  * @param cur the cursor to where to add text at.
8864  * @param text the text to add.
8865  * @return Returns the len of the text added.
8866  * @see evas_textblock_cursor_text_prepend()
8867  */
8868 EAPI int                          evas_textblock_cursor_text_append(Evas_Textblock_Cursor *cur, const char *text) EINA_ARG_NONNULL(1, 2);
8869
8870 /**
8871  * Adds text to the current cursor position and set the cursor to *after*
8872  * the start of the text just added.
8873  *
8874  * @param cur the cursor to where to add text at.
8875  * @param text the text to add.
8876  * @return Returns the len of the text added.
8877  * @see evas_textblock_cursor_text_append()
8878  */
8879 EAPI int                          evas_textblock_cursor_text_prepend(Evas_Textblock_Cursor *cur, const char *text) EINA_ARG_NONNULL(1, 2);
8880
8881
8882 /**
8883  * Adds format to the current cursor position. If the format being added is a
8884  * visible format, add it *before* the cursor position, otherwise, add it after.
8885  * This behavior is because visible formats are like characters and invisible
8886  * should be stacked in a way that the last one is added last.
8887  *
8888  * This function works with native formats, that means that style defined
8889  * tags like <br> won't work here. For those kind of things use markup prepend.
8890  *
8891  * @param cur the cursor to where to add format at.
8892  * @param format the format to add.
8893  * @return Returns true if a visible format was added, false otherwise.
8894  * @see evas_textblock_cursor_format_prepend()
8895  */
8896
8897 /**
8898  * Check if the current cursor position points to the terminating null of the
8899  * last paragraph. (shouldn't be allowed to point to the terminating null of
8900  * any previous paragraph anyway.
8901  *
8902  * @param cur the cursor to look at.
8903  * @return #EINA_TRUE if the cursor points to the terminating null, #EINA_FALSE otherwise.
8904  */
8905 EAPI Eina_Bool                    evas_textblock_cursor_format_append(Evas_Textblock_Cursor *cur, const char *format) EINA_ARG_NONNULL(1, 2);
8906
8907 /**
8908  * Adds format to the current cursor position. If the format being added is a
8909  * visible format, add it *before* the cursor position, otherwise, add it after.
8910  * This behavior is because visible formats are like characters and invisible
8911  * should be stacked in a way that the last one is added last.
8912  * If the format is visible the cursor is advanced after it.
8913  *
8914  * This function works with native formats, that means that style defined
8915  * tags like <br> won't work here. For those kind of things use markup prepend.
8916  *
8917  * @param cur the cursor to where to add format at.
8918  * @param format the format to add.
8919  * @return Returns true if a visible format was added, false otherwise.
8920  * @see evas_textblock_cursor_format_prepend()
8921  */
8922 EAPI Eina_Bool                    evas_textblock_cursor_format_prepend(Evas_Textblock_Cursor *cur, const char *format) EINA_ARG_NONNULL(1, 2);
8923
8924 /**
8925  * Delete the character at the location of the cursor. If there's a format
8926  * pointing to this position, delete it as well.
8927  *
8928  * @param cur the cursor pointing to the current location.
8929  * @return Returns no value.
8930  */
8931 EAPI void                         evas_textblock_cursor_char_delete(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8932
8933 /**
8934  * Delete the range between cur1 and cur2.
8935  *
8936  * @param cur1 one side of the range.
8937  * @param cur2 the second side of the range
8938  * @return Returns no value.
8939  */
8940 EAPI void                         evas_textblock_cursor_range_delete(Evas_Textblock_Cursor *cur1, Evas_Textblock_Cursor *cur2) EINA_ARG_NONNULL(1, 2);
8941
8942
8943 /**
8944  * Return the text of the paragraph cur points to - returns the text in markup..
8945  *
8946  * @param cur the cursor pointing to the paragraph.
8947  * @return the text on success, NULL otherwise.
8948  */
8949 EAPI const char                  *evas_textblock_cursor_paragraph_text_get(const Evas_Textblock_Cursor *cur) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
8950
8951 /**
8952  * Return the length of the paragraph, cheaper the eina_unicode_strlen()
8953  *
8954  * @param cur the position of the paragraph.
8955  * @return the length of the paragraph on success, -1 otehrwise.
8956  */
8957 EAPI int                          evas_textblock_cursor_paragraph_text_length_get(const Evas_Textblock_Cursor *cur) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
8958
8959 /**
8960  * Return the currently visible range.
8961  *
8962  * @param start the start of the range.
8963  * @param end the end of the range.
8964  * @return EINA_TRUE on success. EINA_FALSE otherwise.
8965  * @since 1.1.0
8966  */
8967 EAPI Eina_Bool                         evas_textblock_cursor_visible_range_get(Evas_Textblock_Cursor *start, Evas_Textblock_Cursor *end) EINA_ARG_NONNULL(1, 2);
8968
8969 /**
8970  * Return the format nodes in the range between cur1 and cur2.
8971  *
8972  * @param cur1 one side of the range.
8973  * @param cur2 the other side of the range
8974  * @return the foramt nodes in the range. You have to free it.
8975  * @since 1.1.0
8976  */
8977 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);
8978
8979 /**
8980  * Return the text in the range between cur1 and cur2
8981  *
8982  * @param cur1 one side of the range.
8983  * @param cur2 the other side of the range
8984  * @param format The form on which to return the text. Markup - in textblock markup. Plain - UTF8.
8985  * @return the text in the range
8986  * @see elm_entry_markup_to_utf8()
8987  */
8988 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);
8989
8990 /**
8991  * Return the content of the cursor.
8992  *
8993  * Free the returned string pointer when done (if it is not NULL).
8994  * 
8995  * @param cur the cursor
8996  * @return the text in the range, terminated by a nul byte (may be utf8).
8997  */
8998 EAPI char                        *evas_textblock_cursor_content_get(const Evas_Textblock_Cursor *cur) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
8999
9000
9001 /**
9002  * Returns the geometry of the cursor. Depends on the type of cursor requested.
9003  * This should be used instead of char_geometry_get because there are weird
9004  * special cases with BiDi text.
9005  * in '_' cursor mode (i.e a line below the char) it's the same as char_geometry
9006  * get, except for the case of the last char of a line which depends on the
9007  * paragraph direction.
9008  *
9009  * in '|' cursor mode (i.e a line between two chars) it is very variable.
9010  * For example consider the following visual string:
9011  * "abcCBA" (ABC are rtl chars), a cursor pointing on A should actually draw
9012  * a '|' between the c and the C.
9013  *
9014  * @param cur the cursor.
9015  * @param cx the x of the cursor
9016  * @param cy the y of the cursor
9017  * @param cw the width of the cursor
9018  * @param ch the height of the cursor
9019  * @param dir the direction of the cursor, can be NULL.
9020  * @param ctype the type of the cursor.
9021  * @return line number of the char on success, -1 on error.
9022  */
9023 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);
9024
9025 /**
9026  * Returns the geometry of the char at cur.
9027  *
9028  * @param cur the position of the char.
9029  * @param cx the x of the char.
9030  * @param cy the y of the char.
9031  * @param cw the w of the char.
9032  * @param ch the h of the char.
9033  * @return line number of the char on success, -1 on error.
9034  */
9035 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);
9036
9037 /**
9038  * Returns the geometry of the pen at cur.
9039  *
9040  * @param cur the position of the char.
9041  * @param cpen_x the pen_x of the char.
9042  * @param cy the y of the char.
9043  * @param cadv the adv of the char.
9044  * @param ch the h of the char.
9045  * @return line number of the char on success, -1 on error.
9046  */
9047 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);
9048
9049 /**
9050  * Returns the geometry of the line at cur.
9051  *
9052  * @param cur the position of the line.
9053  * @param cx the x of the line.
9054  * @param cy the y of the line.
9055  * @param cw the width of the line.
9056  * @param ch the height of the line.
9057  * @return line number of the line on success, -1 on error.
9058  */
9059 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);
9060
9061 /**
9062  * Set the position of the cursor according to the X and Y coordinates.
9063  *
9064  * @param cur the cursor to set.
9065  * @param x coord to set by.
9066  * @param y coord to set by.
9067  * @return #EINA_TRUE on success, #EINA_FALSE otherwise.
9068  */
9069 EAPI Eina_Bool                    evas_textblock_cursor_char_coord_set(Evas_Textblock_Cursor *cur, Evas_Coord x, Evas_Coord y) EINA_ARG_NONNULL(1);
9070
9071 /**
9072  * Set the cursor position according to the y coord.
9073  *
9074  * @param cur the cur to be set.
9075  * @param y the coord to set by.
9076  * @return the line number found, -1 on error.
9077  */
9078 EAPI int                          evas_textblock_cursor_line_coord_set(Evas_Textblock_Cursor *cur, Evas_Coord y) EINA_ARG_NONNULL(1);
9079
9080 /**
9081  * Get the geometry of a range.
9082  *
9083  * @param cur1 one side of the range.
9084  * @param cur2 other side of the range.
9085  * @return a list of Rectangles representing the geometry of the range.
9086  */
9087 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);
9088    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);
9089
9090
9091 /**
9092  * Checks if the cursor points to the end of the line.
9093  *
9094  * @param cur the cursor to check.
9095  * @return #EINA_TRUE if true, #EINA_FALSE otherwise.
9096  */
9097 EAPI Eina_Bool                    evas_textblock_cursor_eol_get(const Evas_Textblock_Cursor *cur) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
9098
9099
9100 /**
9101  * Get the geometry of a line number.
9102  *
9103  * @param obj the object.
9104  * @param line the line number.
9105  * @param cx x coord of the line.
9106  * @param cy y coord of the line.
9107  * @param cw w coord of the line.
9108  * @param ch h coord of the line.
9109  * @return #EINA_TRUE on success, #EINA_FALSE otherwise.
9110  */
9111 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);
9112
9113 /**
9114  * Clear the textblock object.
9115  * @note Does *NOT* free the Evas object itself.
9116  *
9117  * @param obj the object to clear.
9118  * @return nothing.
9119  */
9120 EAPI void                         evas_object_textblock_clear(Evas_Object *obj) EINA_ARG_NONNULL(1);
9121
9122 /**
9123  * Get the formatted width and height. This calculates the actual size after restricting
9124  * the textblock to the current size of the object.
9125  * The main difference between this and @ref evas_object_textblock_size_native_get
9126  * is that the "native" function does not wrapping into account
9127  * it just calculates the real width of the object if it was placed on an
9128  * infinite canvas, while this function gives the size after wrapping
9129  * according to the size restrictions of the object.
9130  *
9131  * For example for a textblock containing the text: "You shall not pass!"
9132  * with no margins or padding and assuming a monospace font and a size of
9133  * 7x10 char widths (for simplicity) has a native size of 19x1
9134  * and a formatted size of 5x4.
9135  *
9136  *
9137  * @param obj the Evas object.
9138  * @param w the width of the object.
9139  * @param h the height of the object
9140  * @return Returns no value.
9141  * @see evas_object_textblock_size_native_get
9142  */
9143 EAPI void                         evas_object_textblock_size_formatted_get(const Evas_Object *obj, Evas_Coord *w, Evas_Coord *h) EINA_ARG_NONNULL(1);
9144
9145 /**
9146  * Get the native width and height. This calculates the actual size without taking account
9147  * the current size of the object.
9148  * The main difference between this and @ref evas_object_textblock_size_formatted_get
9149  * is that the "native" function does not take wrapping into account
9150  * it just calculates the real width of the object if it was placed on an
9151  * infinite canvas, while the "formatted" function gives the size after
9152  * wrapping text according to the size restrictions of the object.
9153  *
9154  * For example for a textblock containing the text: "You shall not pass!"
9155  * with no margins or padding and assuming a monospace font and a size of
9156  * 7x10 char widths (for simplicity) has a native size of 19x1
9157  * and a formatted size of 5x4.
9158  *
9159  * @param obj the Evas object of the textblock
9160  * @param w the width returned
9161  * @param h the height returned
9162  * @return Returns no value.
9163  */
9164 EAPI void                         evas_object_textblock_size_native_get(const Evas_Object *obj, Evas_Coord *w, Evas_Coord *h) EINA_ARG_NONNULL(1);
9165    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);
9166 /**
9167  * @}
9168  */
9169
9170 /**
9171  * @defgroup Evas_Line_Group Line Object Functions
9172  *
9173  * Functions used to deal with evas line objects.
9174  *
9175  * @ingroup Evas_Object_Specific
9176  *
9177  * @{
9178  */
9179
9180 /**
9181  * Adds a new evas line object to the given evas.
9182  * @param   e The given evas.
9183  * @return  The new evas line object.
9184  */
9185 EAPI Evas_Object      *evas_object_line_add              (Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
9186
9187 /**
9188  * Sets the coordinates of the end points of the given evas line object.
9189  * @param   obj The given evas line object.
9190  * @param   x1  The X coordinate of the first point.
9191  * @param   y1  The Y coordinate of the first point.
9192  * @param   x2  The X coordinate of the second point.
9193  * @param   y2  The Y coordinate of the second point.
9194  */
9195 EAPI void              evas_object_line_xy_set           (Evas_Object *obj, Evas_Coord x1, Evas_Coord y1, Evas_Coord x2, Evas_Coord y2);
9196
9197 /**
9198  * Retrieves the coordinates of the end points of the given evas line object.
9199  * @param obj The given line object.
9200  * @param x1  Pointer to an integer in which to store the X coordinate of the
9201  *            first end point.
9202  * @param y1  Pointer to an integer in which to store the Y coordinate of the
9203  *            first end point.
9204  * @param x2  Pointer to an integer in which to store the X coordinate of the
9205  *            second end point.
9206  * @param y2  Pointer to an integer in which to store the Y coordinate of the
9207  *            second end point.
9208  */
9209 EAPI void              evas_object_line_xy_get           (const Evas_Object *obj, Evas_Coord *x1, Evas_Coord *y1, Evas_Coord *x2, Evas_Coord *y2);
9210 /**
9211  * @}
9212  */
9213
9214 /**
9215  * @defgroup Evas_Object_Polygon Polygon Object Functions
9216  *
9217  * Functions that operate on evas polygon objects.
9218  *
9219  * Hint: as evas does not provide ellipse, smooth paths or circle, one
9220  * can calculate points and convert these to a polygon.
9221  *
9222  * @ingroup Evas_Object_Specific
9223  *
9224  * @{
9225  */
9226
9227 /**
9228  * Adds a new evas polygon object to the given evas.
9229  * @param   e The given evas.
9230  * @return  A new evas polygon object.
9231  */
9232 EAPI Evas_Object      *evas_object_polygon_add           (Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
9233
9234 /**
9235  * Adds the given point to the given evas polygon object.
9236  * @param obj The given evas polygon object.
9237  * @param x   The X coordinate of the given point.
9238  * @param y   The Y coordinate of the given point.
9239  * @ingroup Evas_Polygon_Group
9240  */
9241 EAPI void              evas_object_polygon_point_add     (Evas_Object *obj, Evas_Coord x, Evas_Coord y) EINA_ARG_NONNULL(1);
9242
9243 /**
9244  * Removes all of the points from the given evas polygon object.
9245  * @param   obj The given polygon object.
9246  */
9247 EAPI void              evas_object_polygon_points_clear  (Evas_Object *obj) EINA_ARG_NONNULL(1);
9248 /**
9249  * @}
9250  */
9251
9252 /* @since 1.2.0 */
9253 EAPI void              evas_object_is_frame_object_set(Evas_Object *obj, Eina_Bool is_frame);
9254
9255 /* @since 1.2.0 */
9256 EAPI Eina_Bool         evas_object_is_frame_object_get(Evas_Object *obj);
9257
9258 /**
9259  * @defgroup Evas_Smart_Group Smart Functions
9260  *
9261  * Functions that deal with #Evas_Smart structs, creating definition
9262  * (classes) of objects that will have customized behavior for methods
9263  * like evas_object_move(), evas_object_resize(),
9264  * evas_object_clip_set() and others.
9265  *
9266  * These objects will accept the generic methods defined in @ref
9267  * Evas_Object_Group and the extensions defined in @ref
9268  * Evas_Smart_Object_Group. There are a couple of existent smart
9269  * objects in Evas itself (see @ref Evas_Object_Box, @ref
9270  * Evas_Object_Table and @ref Evas_Smart_Object_Clipped).
9271  *
9272  * See also some @ref Example_Evas_Smart_Objects "examples" of this
9273  * group of functions.
9274  */
9275
9276 /**
9277  * @addtogroup Evas_Smart_Group
9278  * @{
9279  */
9280
9281 /**
9282  * @def EVAS_SMART_CLASS_VERSION
9283  *
9284  * The version you have to put into the version field in the
9285  * #Evas_Smart_Class struct. Used to safeguard from binaries with old
9286  * smart object intefaces running with newer ones.
9287  *
9288  * @ingroup Evas_Smart_Group
9289  */
9290 #define EVAS_SMART_CLASS_VERSION 4
9291 /**
9292  * @struct _Evas_Smart_Class
9293  *
9294  * A smart object's @b base class definition
9295  *
9296  * @ingroup Evas_Smart_Group
9297  */
9298 struct _Evas_Smart_Class
9299 {
9300    const char *name; /**< the name string of the class */
9301    int         version;
9302    void  (*add)         (Evas_Object *o); /**< code to be run when adding object to a canvas */
9303    void  (*del)         (Evas_Object *o); /**< code to be run when removing object to a canvas */
9304    void  (*move)        (Evas_Object *o, Evas_Coord x, Evas_Coord y); /**< code to be run when moving object on a canvas */
9305    void  (*resize)      (Evas_Object *o, Evas_Coord w, Evas_Coord h); /**< code to be run when resizing object on a canvas */
9306    void  (*show)        (Evas_Object *o); /**< code to be run when showing object on a canvas */
9307    void  (*hide)        (Evas_Object *o); /**< code to be run when hiding object on a canvas */
9308    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 */
9309    void  (*clip_set)    (Evas_Object *o, Evas_Object *clip); /**< code to be run when setting clipper of object on a canvas */
9310    void  (*clip_unset)  (Evas_Object *o); /**< code to be run when unsetting clipper of object on a canvas */
9311    void  (*calculate)   (Evas_Object *o); /**< code to be run when object has rendering updates on a canvas */
9312    void  (*member_add)  (Evas_Object *o, Evas_Object *child); /**< code to be run when child member is added to object */
9313    void  (*member_del)  (Evas_Object *o, Evas_Object *child); /**< code to be run when child member is removed from object */
9314
9315    const Evas_Smart_Class          *parent; /**< this class inherits from this parent */
9316    const Evas_Smart_Cb_Description *callbacks; /**< callbacks at this level, @c NULL terminated */
9317    void                            *interfaces; /**< to be used in a future near you */
9318    const void                      *data;
9319 };
9320
9321 /**
9322  * @struct _Evas_Smart_Cb_Description
9323  *
9324  * Describes a callback issued by a smart object
9325  * (evas_object_smart_callback_call()), as defined in its smart object
9326  * class. This is particularly useful to explain to end users and
9327  * their code (i.e., introspection) what the parameter @c event_info
9328  * will point to.
9329  *
9330  * @ingroup Evas_Smart_Group
9331  */
9332 struct _Evas_Smart_Cb_Description
9333 {
9334    const char *name; /**< callback name ("changed", for example) */
9335
9336    /**
9337     * @brief Hint on the type of @c event_info parameter's contents on
9338     * a #Evas_Smart_Cb callback.
9339     *
9340     * The type string uses the pattern similar to
9341     * http://dbus.freedesktop.org/doc/dbus-specification.html#message-protocol-signatures,
9342     * but extended to optionally include variable names within
9343     * brackets preceding types. Example:
9344     *
9345     * @li Structure with two integers:
9346     *     @c "(ii)"
9347     *
9348     * @li Structure called 'x' with two integers named 'a' and 'b':
9349     *     @c "[x]([a]i[b]i)"
9350     *
9351     * @li Array of integers:
9352     *     @c "ai"
9353     *
9354     * @li Array called 'x' of struct with two integers:
9355     *     @c "[x]a(ii)"
9356     *
9357     * @note This type string is used as a hint and is @b not validated
9358     *       or enforced in any way. Implementors should make the best
9359     *       use of it to help bindings, documentation and other users
9360     *       of introspection features.
9361     */
9362    const char *type;
9363 };
9364
9365 /**
9366  * @def EVAS_SMART_CLASS_INIT_NULL
9367  * Initializer to zero a whole Evas_Smart_Class structure.
9368  *
9369  * @see EVAS_SMART_CLASS_INIT_VERSION
9370  * @see EVAS_SMART_CLASS_INIT_NAME_VERSION
9371  * @see EVAS_SMART_CLASS_INIT_NAME_VERSION_PARENT
9372  * @see EVAS_SMART_CLASS_INIT_NAME_VERSION_PARENT_CALLBACKS
9373  * @ingroup Evas_Smart_Group
9374  */
9375 #define EVAS_SMART_CLASS_INIT_NULL {NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL}
9376
9377 /**
9378  * @def EVAS_SMART_CLASS_INIT_VERSION
9379  * Initializer to zero a whole Evas_Smart_Class structure and set version.
9380  *
9381  * Similar to EVAS_SMART_CLASS_INIT_NULL, but will set version field to
9382  * latest EVAS_SMART_CLASS_VERSION.
9383  *
9384  * @see EVAS_SMART_CLASS_INIT_NULL
9385  * @see EVAS_SMART_CLASS_INIT_NAME_VERSION
9386  * @see EVAS_SMART_CLASS_INIT_NAME_VERSION_PARENT
9387  * @see EVAS_SMART_CLASS_INIT_NAME_VERSION_PARENT_CALLBACKS
9388  * @ingroup Evas_Smart_Group
9389  */
9390 #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}
9391
9392 /**
9393  * @def EVAS_SMART_CLASS_INIT_NAME_VERSION
9394  * Initializer to zero a whole Evas_Smart_Class structure and set name
9395  * and version.
9396  *
9397  * Similar to EVAS_SMART_CLASS_INIT_NULL, but will set version field to
9398  * latest EVAS_SMART_CLASS_VERSION and name to the specified value.
9399  *
9400  * It will keep a reference to name field as a "const char *", that is,
9401  * name must be available while the structure is used (hint: static or global!)
9402  * and will not be modified.
9403  *
9404  * @see EVAS_SMART_CLASS_INIT_NULL
9405  * @see EVAS_SMART_CLASS_INIT_VERSION
9406  * @see EVAS_SMART_CLASS_INIT_NAME_VERSION_PARENT
9407  * @see EVAS_SMART_CLASS_INIT_NAME_VERSION_PARENT_CALLBACKS
9408  * @ingroup Evas_Smart_Group
9409  */
9410 #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}
9411
9412 /**
9413  * @def EVAS_SMART_CLASS_INIT_NAME_VERSION_PARENT
9414  * Initializer to zero a whole Evas_Smart_Class structure and set name,
9415  * version and parent class.
9416  *
9417  * Similar to EVAS_SMART_CLASS_INIT_NULL, but will set version field to
9418  * latest EVAS_SMART_CLASS_VERSION, name to the specified value and
9419  * parent class.
9420  *
9421  * It will keep a reference to name field as a "const char *", that is,
9422  * name must be available while the structure is used (hint: static or global!)
9423  * and will not be modified. Similarly, parent reference will be kept.
9424  *
9425  * @see EVAS_SMART_CLASS_INIT_NULL
9426  * @see EVAS_SMART_CLASS_INIT_VERSION
9427  * @see EVAS_SMART_CLASS_INIT_NAME_VERSION
9428  * @see EVAS_SMART_CLASS_INIT_NAME_VERSION_PARENT_CALLBACKS
9429  * @ingroup Evas_Smart_Group
9430  */
9431 #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}
9432
9433 /**
9434  * @def EVAS_SMART_CLASS_INIT_NAME_VERSION_PARENT_CALLBACKS
9435  * Initializer to zero a whole Evas_Smart_Class structure and set name,
9436  * version, parent class and callbacks definition.
9437  *
9438  * Similar to EVAS_SMART_CLASS_INIT_NULL, but will set version field to
9439  * latest EVAS_SMART_CLASS_VERSION, name to the specified value, parent
9440  * class and callbacks at this level.
9441  *
9442  * It will keep a reference to name field as a "const char *", that is,
9443  * name must be available while the structure is used (hint: static or global!)
9444  * and will not be modified. Similarly, parent and callbacks reference
9445  * will be kept.
9446  *
9447  * @see EVAS_SMART_CLASS_INIT_NULL
9448  * @see EVAS_SMART_CLASS_INIT_VERSION
9449  * @see EVAS_SMART_CLASS_INIT_NAME_VERSION
9450  * @see EVAS_SMART_CLASS_INIT_NAME_VERSION_PARENT
9451  * @ingroup Evas_Smart_Group
9452  */
9453 #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}
9454
9455 /**
9456  * @def EVAS_SMART_SUBCLASS_NEW
9457  *
9458  * Convenience macro to subclass a given Evas smart class.
9459  *
9460  * @param smart_name The name used for the smart class. e.g:
9461  * @c "Evas_Object_Box".
9462  * @param prefix Prefix used for all variables and functions defined
9463  * and referenced by this macro.
9464  * @param api_type Type of the structure used as API for the smart
9465  * class. Either #Evas_Smart_Class or something derived from it.
9466  * @param parent_type Type of the parent class API.
9467  * @param parent_func Function that gets the parent class. e.g:
9468  * evas_object_box_smart_class_get().
9469  * @param cb_desc Array of callback descriptions for this smart class.
9470  *
9471  * This macro saves some typing when writing a smart class derived
9472  * from another one. In order to work, the user @b must provide some
9473  * functions adhering to the following guidelines:
9474  *  - @<prefix@>_smart_set_user(): the @b internal @c _smart_set
9475  *    function (defined by this macro) will call this one, provided by
9476  *    the user, after inheriting everything from the parent, which
9477  *    should <b>take care of setting the right member functions for
9478  *    the class</b>, both overrides and extensions, if any.
9479  *  - If this new class should be subclassable as well, a @b public
9480  *    @c _smart_set() function is desirable to fill in the class used as
9481  *    parent by the children. It's up to the user to provide this
9482  *    interface, which will most likely call @<prefix@>_smart_set() to
9483  *    get the job done.
9484  *
9485  * After the macro's usage, the following will be defined for use:
9486  *  - @<prefix@>_parent_sc: A pointer to the @b parent smart
9487  *    class. When calling parent functions from overloaded ones, use
9488  *    this global variable.
9489  *  - @<prefix@>_smart_class_new(): this function returns the
9490  *    #Evas_Smart needed to create smart objects with this class,
9491  *    which should be passed to evas_object_smart_add().
9492  *
9493  * @warning @p smart_name has to be a pointer to a globally available
9494  * string! The smart class created here will just have a pointer set
9495  * to that, and all object instances will depend on it for smart class
9496  * name lookup.
9497  *
9498  * @ingroup Evas_Smart_Group
9499  */
9500 #define EVAS_SMART_SUBCLASS_NEW(smart_name, prefix, api_type, parent_type, parent_func, cb_desc) \
9501   static const parent_type * prefix##_parent_sc = NULL;                 \
9502   static void prefix##_smart_set_user(api_type *api);                   \
9503   static void prefix##_smart_set(api_type *api)                         \
9504   {                                                                     \
9505      Evas_Smart_Class *sc;                                              \
9506      if (!(sc = (Evas_Smart_Class *)api))                               \
9507        return;                                                          \
9508      if (!prefix##_parent_sc)                                           \
9509        prefix##_parent_sc = parent_func();                              \
9510      evas_smart_class_inherit(sc, prefix##_parent_sc);                  \
9511      prefix##_smart_set_user(api);                                      \
9512   }                                                                     \
9513   static Evas_Smart * prefix##_smart_class_new(void)                    \
9514   {                                                                     \
9515      static Evas_Smart *smart = NULL;                                   \
9516      static api_type api;                                               \
9517      if (!smart)                                                        \
9518        {                                                                \
9519           Evas_Smart_Class *sc = (Evas_Smart_Class *)&api;              \
9520           memset(&api, 0, sizeof(api_type));                            \
9521           sc->version = EVAS_SMART_CLASS_VERSION;                       \
9522           sc->name = smart_name;                                        \
9523           sc->callbacks = cb_desc;                                      \
9524           prefix##_smart_set(&api);                                     \
9525           smart = evas_smart_class_new(sc);                             \
9526        }                                                                \
9527      return smart;                                                      \
9528   }
9529
9530 /**
9531  * @def EVAS_SMART_DATA_ALLOC
9532  *
9533  * Convenience macro to allocate smart data only if needed.
9534  *
9535  * When writing a subclassable smart object, the @c .add() function
9536  * will need to check if the smart private data was already allocated
9537  * by some child object or not. This macro makes it easier to do it.
9538  *
9539  * @note This is an idiom used when one calls the parent's @c. add()
9540  * after the specialized code. Naturally, the parent's base smart data
9541  * has to be contemplated as the specialized one's first member, for
9542  * things to work.
9543  *
9544  * @param o Evas object passed to the @c .add() function
9545  * @param priv_type The type of the data to allocate
9546  *
9547  * @ingroup Evas_Smart_Group
9548  */
9549 #define EVAS_SMART_DATA_ALLOC(o, priv_type) \
9550    priv_type *priv; \
9551    priv = evas_object_smart_data_get(o); \
9552    if (!priv) { \
9553       priv = (priv_type *)calloc(1, sizeof(priv_type)); \
9554       if (!priv) return; \
9555       evas_object_smart_data_set(o, priv); \
9556    }
9557
9558
9559 /**
9560  * Free an #Evas_Smart struct
9561  *
9562  * @param s the #Evas_Smart struct to free
9563  *
9564  * @warning If this smart handle was created using
9565  * evas_smart_class_new(), the associated #Evas_Smart_Class will not
9566  * be freed.
9567  *
9568  * @note If you're using the #EVAS_SMART_SUBCLASS_NEW schema to create your
9569  * smart object, note that an #Evas_Smart handle will be shared amongst all
9570  * instances of the given smart class, through a static variable.
9571  * Evas will internally count references on #Evas_Smart handles and free them
9572  * when they are not referenced anymore. Thus, this function is of no use
9573  * for Evas users, most probably.
9574  */
9575 EAPI void                             evas_smart_free                     (Evas_Smart *s) EINA_ARG_NONNULL(1);
9576
9577 /**
9578  * Creates a new #Evas_Smart from a given #Evas_Smart_Class struct
9579  *
9580  * @param sc the smart class definition
9581  * @return a new #Evas_Smart pointer
9582  *
9583  * #Evas_Smart handles are necessary to create new @b instances of
9584  * smart objects belonging to the class described by @p sc. That
9585  * handle will contain, besides the smart class interface definition,
9586  * all its smart callbacks infrastructure set, too.
9587  *
9588  * @note If you are willing to subclass a given smart class to
9589  * construct yours, consider using the #EVAS_SMART_SUBCLASS_NEW macro,
9590  * which will make use of this function automatically for you.
9591  */
9592 EAPI Evas_Smart                      *evas_smart_class_new                (const Evas_Smart_Class *sc) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
9593
9594 /**
9595  * Get the #Evas_Smart_Class handle of an #Evas_Smart struct
9596  *
9597  * @param s a valid #Evas_Smart pointer
9598  * @return the #Evas_Smart_Class in it
9599  */
9600 EAPI const Evas_Smart_Class          *evas_smart_class_get                (const Evas_Smart *s) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
9601
9602
9603 /**
9604  * @brief Get the data pointer set on an #Evas_Smart struct
9605  *
9606  * @param s a valid #Evas_Smart handle
9607  *
9608  * This data pointer is set as the data field in the #Evas_Smart_Class
9609  * passed in to evas_smart_class_new().
9610  */
9611 EAPI void                            *evas_smart_data_get                 (const Evas_Smart *s) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
9612
9613 /**
9614  * Get the smart callbacks known by this #Evas_Smart handle's smart
9615  * class hierarchy.
9616  *
9617  * @param s A valid #Evas_Smart handle.
9618  * @param[out] count Returns the number of elements in the returned
9619  * array.
9620  * @return The array with callback descriptions known by this smart
9621  *         class, with its size returned in @a count parameter. It
9622  *         should not be modified in any way. If no callbacks are
9623  *         known, @c NULL is returned. The array is sorted by event
9624  *         names and elements refer to the original values given to
9625  *         evas_smart_class_new()'s #Evas_Smart_Class::callbacks
9626  *         (pointer to them).
9627  *
9628  * This is likely different from
9629  * evas_object_smart_callbacks_descriptions_get() as it will contain
9630  * the callbacks of @b all this class hierarchy sorted, while the
9631  * direct smart class member refers only to that specific class and
9632  * should not include parent's.
9633  *
9634  * If no callbacks are known, this function returns @c NULL.
9635  *
9636  * The array elements and thus their contents will be @b references to
9637  * original values given to evas_smart_class_new() as
9638  * Evas_Smart_Class::callbacks.
9639  *
9640  * The array is sorted by Evas_Smart_Cb_Description::name. The last
9641  * array element is a @c NULL pointer and is not accounted for in @a
9642  * count. Loop iterations can check any of these size indicators.
9643  *
9644  * @note objects may provide per-instance callbacks, use
9645  *       evas_object_smart_callbacks_descriptions_get() to get those
9646  *       as well.
9647  * @see evas_object_smart_callbacks_descriptions_get()
9648  */
9649 EAPI const Evas_Smart_Cb_Description **evas_smart_callbacks_descriptions_get(const Evas_Smart *s, unsigned int *count) EINA_ARG_NONNULL(1, 1);
9650
9651
9652 /**
9653  * Find a callback description for the callback named @a name.
9654  *
9655  * @param s The #Evas_Smart where to search for class registered smart
9656  * event callbacks.
9657  * @param name Name of the desired callback, which must @b not be @c
9658  *        NULL. The search has a special case for @a name being the
9659  *        same pointer as registered with #Evas_Smart_Cb_Description.
9660  *        One can use it to avoid excessive use of strcmp().
9661  * @return A reference to the description if found, or @c NULL, otherwise
9662  *
9663  * @see evas_smart_callbacks_descriptions_get()
9664  */
9665 EAPI const Evas_Smart_Cb_Description *evas_smart_callback_description_find(const Evas_Smart *s, const char *name) EINA_ARG_NONNULL(1, 2);
9666
9667
9668 /**
9669  * Sets one class to inherit from the other.
9670  *
9671  * Copy all function pointers, set @c parent to @a parent_sc and copy
9672  * everything after sizeof(Evas_Smart_Class) present in @a parent_sc,
9673  * using @a parent_sc_size as reference.
9674  *
9675  * This is recommended instead of a single memcpy() since it will take
9676  * care to not modify @a sc name, version, callbacks and possible
9677  * other members.
9678  *
9679  * @param sc child class.
9680  * @param parent_sc parent class, will provide attributes.
9681  * @param parent_sc_size size of parent_sc structure, child should be at least
9682  *        this size. Everything after @c Evas_Smart_Class size is copied
9683  *        using regular memcpy().
9684  */
9685 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);
9686
9687 /**
9688  * Get the number of users of the smart instance
9689  *
9690  * @param s The Evas_Smart to get the usage count of
9691  * @return The number of uses of the smart instance
9692  *
9693  * This function tells you how many more uses of the smart instance are in
9694  * existence. This should be used before freeing/clearing any of the
9695  * Evas_Smart_Class that was used to create the smart instance. The smart
9696  * instance will refer to data in the Evas_Smart_Class used to create it and
9697  * thus you cannot remove the original data until all users of it are gone.
9698  * When the usage count goes to 0, you can evas_smart_free() the smart
9699  * instance @p s and remove from memory any of the Evas_Smart_Class that
9700  * was used to create the smart instance, if you desire. Removing it from
9701  * memory without doing this will cause problems (crashes, undefined
9702  * behavior etc. etc.), so either never remove the original
9703  * Evas_Smart_Class data from memory (have it be a constant structure and
9704  * data), or use this API call and be very careful.
9705  */
9706 EAPI int                              evas_smart_usage_get(const Evas_Smart *s);
9707
9708   /**
9709    * @def evas_smart_class_inherit
9710    * Easy to use version of evas_smart_class_inherit_full().
9711    *
9712    * This version will use sizeof(parent_sc), copying everything.
9713    *
9714    * @param sc child class, will have methods copied from @a parent_sc
9715    * @param parent_sc parent class, will provide contents to be copied.
9716    * @return 1 on success, 0 on failure.
9717    * @ingroup Evas_Smart_Group
9718    */
9719 #define evas_smart_class_inherit(sc, parent_sc) evas_smart_class_inherit_full(sc, (Evas_Smart_Class *)parent_sc, sizeof(*parent_sc))
9720
9721 /**
9722  * @}
9723  */
9724
9725 /**
9726  * @defgroup Evas_Smart_Object_Group Smart Object Functions
9727  *
9728  * Functions dealing with Evas smart objects (instances).
9729  *
9730  * Smart objects are groupings of primitive Evas objects that behave
9731  * as a cohesive group. For instance, a file manager icon may be a
9732  * smart object composed of an image object, a text label and two
9733  * rectangles that appear behind the image and text when the icon is
9734  * selected. As a smart object, the normal Evas object API could be
9735  * used on the icon object.
9736  *
9737  * Besides that, generally smart objects implement a <b>specific
9738  * API</b>, so that users interact with its own custom features. The
9739  * API takes form of explicit exported functions one may call and
9740  * <b>smart callbacks</b>.
9741  *
9742  * @section Evas_Smart_Object_Group_Callbacks Smart events and callbacks
9743  *
9744  * Smart objects can elect events (smart events, from now on) occurring
9745  * inside of them to be reported back to their users via callback
9746  * functions (smart callbacks). This way, you can extend Evas' own
9747  * object events. They are defined by an <b>event string</b>, which
9748  * identifies them uniquely. There's also a function prototype
9749  * definition for the callback functions: #Evas_Smart_Cb.
9750  *
9751  * When defining an #Evas_Smart_Class, smart object implementors are
9752  * strongly encouraged to properly set the Evas_Smart_Class::callbacks
9753  * callbacks description array, so that the users of the smart object
9754  * can have introspection on its events API <b>at run time</b>.
9755  *
9756  * See some @ref Example_Evas_Smart_Objects "examples" of this group
9757  * of functions.
9758  *
9759  * @see @ref Evas_Smart_Group for class definitions.
9760  */
9761
9762 /**
9763  * @addtogroup Evas_Smart_Object_Group
9764  * @{
9765  */
9766
9767 /**
9768  * Instantiates a new smart object described by @p s.
9769  *
9770  * @param e the canvas on which to add the object
9771  * @param s the #Evas_Smart describing the smart object
9772  * @return a new #Evas_Object handle
9773  *
9774  * This is the function one should use when defining the public
9775  * function @b adding an instance of the new smart object to a given
9776  * canvas. It will take care of setting all of its internals to work
9777  * as they should, if the user set things properly, as seem on the
9778  * #EVAS_SMART_SUBCLASS_NEW, for example.
9779  *
9780  * @ingroup Evas_Smart_Object_Group
9781  */
9782 EAPI Evas_Object      *evas_object_smart_add             (Evas *e, Evas_Smart *s) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2) EINA_MALLOC;
9783
9784 /**
9785  * Set an Evas object as a member of a given smart object.
9786  *
9787  * @param obj The member object
9788  * @param smart_obj The smart object
9789  *
9790  * Members will automatically be stacked and layered together with the
9791  * smart object. The various stacking functions will operate on
9792  * members relative to the other members instead of the entire canvas,
9793  * since they now live on an exclusive layer (see
9794  * evas_object_stack_above(), for more details).
9795  *
9796  * Any @p smart_obj object's specific implementation of the @c
9797  * member_add() smart function will take place too, naturally.
9798  *
9799  * @see evas_object_smart_member_del()
9800  * @see evas_object_smart_members_get()
9801  *
9802  * @ingroup Evas_Smart_Object_Group
9803  */
9804 EAPI void              evas_object_smart_member_add      (Evas_Object *obj, Evas_Object *smart_obj) EINA_ARG_NONNULL(1, 2);
9805
9806 /**
9807  * Removes a member object from a given smart object.
9808  *
9809  * @param obj the member object
9810  * @ingroup Evas_Smart_Object_Group
9811  *
9812  * This removes a member object from a smart object, if it was added
9813  * to any. The object will still be on the canvas, but no longer
9814  * associated with whichever smart object it was associated with.
9815  *
9816  * @see evas_object_smart_member_add() for more details
9817  * @see evas_object_smart_members_get()
9818  */
9819 EAPI void              evas_object_smart_member_del      (Evas_Object *obj) EINA_ARG_NONNULL(1);
9820
9821 /**
9822  * Retrieves the list of the member objects of a given Evas smart
9823  * object
9824  *
9825  * @param obj the smart object to get members from
9826  * @return Returns the list of the member objects of @p obj.
9827  *
9828  * The returned list should be freed with @c eina_list_free() when you
9829  * no longer need it.
9830  *
9831  * @see evas_object_smart_member_add()
9832  * @see evas_object_smart_member_del()
9833 */
9834 EAPI Eina_List        *evas_object_smart_members_get     (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
9835
9836 /**
9837  * Gets the parent smart object of a given Evas object, if it has one.
9838  *
9839  * @param obj the Evas object you want to get the parent smart object
9840  * from
9841  * @return Returns the parent smart object of @a obj or @c NULL, if @a
9842  * obj is not a smart member of any
9843  *
9844  * @ingroup Evas_Smart_Object_Group
9845  */
9846 EAPI Evas_Object      *evas_object_smart_parent_get      (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
9847
9848 /**
9849  * Checks whether a given smart object or any of its smart object
9850  * parents is of a given smart class.
9851  *
9852  * @param obj An Evas smart object to check the type of
9853  * @param type The @b name (type) of the smart class to check for
9854  * @return @c EINA_TRUE, if @a obj or any of its parents is of type @a
9855  * type, @c EINA_FALSE otherwise
9856  *
9857  * If @p obj is not a smart object, this call will fail
9858  * immediately. Otherwise, make sure evas_smart_class_inherit() or its
9859  * sibling functions were used correctly when creating the smart
9860  * object's class, so it has a valid @b parent smart class pointer
9861  * set.
9862  *
9863  * The checks use smart classes names and <b>string
9864  * comparison</b>. There is a version of this same check using
9865  * <b>pointer comparison</b>, since a smart class' name is a single
9866  * string in Evas.
9867  *
9868  * @see evas_object_smart_type_check_ptr()
9869  * @see #EVAS_SMART_SUBCLASS_NEW
9870  *
9871  * @ingroup Evas_Smart_Object_Group
9872  */
9873 EAPI Eina_Bool         evas_object_smart_type_check      (const Evas_Object *obj, const char *type) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2);
9874
9875 /**
9876  * Checks whether a given smart object or any of its smart object
9877  * parents is of a given smart class, <b>using pointer comparison</b>.
9878  *
9879  * @param obj An Evas smart object to check the type of
9880  * @param type The type (name string) to check for. Must be the name
9881  * @return @c EINA_TRUE, if @a obj or any of its parents is of type @a
9882  * type, @c EINA_FALSE otherwise
9883  *
9884  * @see evas_object_smart_type_check() for more details
9885  *
9886  * @ingroup Evas_Smart_Object_Group
9887  */
9888 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);
9889
9890 /**
9891  * Get the #Evas_Smart from which @p obj smart object was created.
9892  *
9893  * @param obj a smart object
9894  * @return the #Evas_Smart handle or @c NULL, on errors
9895  *
9896  * @ingroup Evas_Smart_Object_Group
9897  */
9898 EAPI Evas_Smart       *evas_object_smart_smart_get       (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
9899
9900 /**
9901  * Retrieve user data stored on a given smart object.
9902  *
9903  * @param obj The smart object's handle
9904  * @return A pointer to data stored using
9905  *         evas_object_smart_data_set(), or @c NULL, if none has been
9906  *         set.
9907  *
9908  * @see evas_object_smart_data_set()
9909  *
9910  * @ingroup Evas_Smart_Object_Group
9911  */
9912 EAPI void             *evas_object_smart_data_get        (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
9913
9914 /**
9915  * Store a pointer to user data for a given smart object.
9916  *
9917  * @param obj The smart object's handle
9918  * @param data A pointer to user data
9919  *
9920  * This data is stored @b independently of the one set by
9921  * evas_object_data_set(), naturally.
9922  *
9923  * @see evas_object_smart_data_get()
9924  *
9925  * @ingroup Evas_Smart_Object_Group
9926  */
9927 EAPI void              evas_object_smart_data_set        (Evas_Object *obj, void *data) EINA_ARG_NONNULL(1);
9928
9929 /**
9930  * Add (register) a callback function to the smart event specified by
9931  * @p event on the smart object @p obj.
9932  *
9933  * @param obj a smart object
9934  * @param event the event's name string
9935  * @param func the callback function
9936  * @param data user data to be passed to the callback function
9937  *
9938  * Smart callbacks look very similar to Evas callbacks, but are
9939  * implemented as smart object's custom ones.
9940  *
9941  * This function adds a function callback to an smart object when the
9942  * event named @p event occurs in it. The function is @p func.
9943  *
9944  * In the event of a memory allocation error during addition of the
9945  * callback to the object, evas_alloc_error() should be used to
9946  * determine the nature of the error, if any, and the program should
9947  * sensibly try and recover.
9948  *
9949  * A smart callback function must have the ::Evas_Smart_Cb prototype
9950  * definition. The first parameter (@p data) in this definition will
9951  * have the same value passed to evas_object_smart_callback_add() as
9952  * the @p data parameter, at runtime. The second parameter @p obj is a
9953  * handle to the object on which the event occurred. The third
9954  * parameter, @p event_info, is a pointer to data which is totally
9955  * dependent on the smart object's implementation and semantic for the
9956  * given event.
9957  *
9958  * There is an infrastructure for introspection on smart objects'
9959  * events (see evas_smart_callbacks_descriptions_get()), but no
9960  * internal smart objects on Evas implement them yet.
9961  *
9962  * @see @ref Evas_Smart_Object_Group_Callbacks for more details.
9963  *
9964  * @see evas_object_smart_callback_del()
9965  * @ingroup Evas_Smart_Object_Group
9966  */
9967 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);
9968
9969 /**
9970  * Add (register) a callback function to the smart event specified by
9971  * @p event on the smart object @p obj. Except for the priority field,
9972  * it's exactly the same as @ref evas_object_smart_callback_add
9973  *
9974  * @param obj a smart object
9975  * @param event the event's name string
9976  * @param priority The priority of the callback, lower values called first.
9977  * @param func the callback function
9978  * @param data user data to be passed to the callback function
9979  *
9980  * @see evas_object_smart_callback_add
9981  * @since 1.1.0
9982  * @ingroup Evas_Smart_Object_Group
9983  */
9984 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);
9985
9986 /**
9987  * Delete (unregister) a callback function from the smart event
9988  * specified by @p event on the smart object @p obj.
9989  *
9990  * @param obj a smart object
9991  * @param event the event's name string
9992  * @param func the callback function
9993  * @return the data pointer
9994  *
9995  * This function removes <b>the first</b> added smart callback on the
9996  * object @p obj matching the event name @p event and the registered
9997  * function pointer @p func. If the removal is successful it will also
9998  * return the data pointer that was passed to
9999  * evas_object_smart_callback_add() (that will be the same as the
10000  * parameter) when the callback(s) was(were) added to the canvas. If
10001  * not successful @c NULL will be returned.
10002  *
10003  * @see evas_object_smart_callback_add() for more details.
10004  *
10005  * @ingroup Evas_Smart_Object_Group
10006  */
10007 EAPI void             *evas_object_smart_callback_del    (Evas_Object *obj, const char *event, Evas_Smart_Cb func) EINA_ARG_NONNULL(1, 2, 3);
10008
10009 /**
10010  * Delete (unregister) a callback function from the smart event
10011  * specified by @p event on the smart object @p obj.
10012  *
10013  * @param obj a smart object
10014  * @param event the event's name string
10015  * @param func the callback function
10016  * @param data the data pointer that was passed to the callback
10017  * @return the data pointer
10018  *
10019  * This function removes <b>the first</b> added smart callback on the
10020  * object @p obj matching the event name @p event, the registered
10021  * function pointer @p func and the callback data pointer @p data. If
10022  * the removal is successful it will also return the data pointer that
10023  * was passed to evas_object_smart_callback_add() (that will be the same
10024  * as the parameter) when the callback(s) was(were) added to the canvas.
10025  * If not successful @c NULL will be returned. A common use would be to
10026  * remove an exact match of a callback
10027  *
10028  * @see evas_object_smart_callback_add() for more details.
10029  * @since 1.2.0
10030  * @ingroup Evas_Smart_Object_Group
10031  *
10032  * @note To delete all smart event callbacks which match @p type and @p func,
10033  * use evas_object_smart_callback_del().
10034  */
10035 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);
10036
10037 /**
10038  * Call a given smart callback on the smart object @p obj.
10039  *
10040  * @param obj the smart object
10041  * @param event the event's name string
10042  * @param event_info pointer to an event specific struct or information to
10043  * pass to the callback functions registered on this smart event
10044  *
10045  * This should be called @b internally, from the smart object's own
10046  * code, when some specific event has occurred and the implementor
10047  * wants is to pertain to the object's events API (see @ref
10048  * Evas_Smart_Object_Group_Callbacks). The documentation for the smart
10049  * object should include a list of possible events and what type of @p
10050  * event_info to expect for each of them. Also, when defining an
10051  * #Evas_Smart_Class, smart object implementors are strongly
10052  * encouraged to properly set the Evas_Smart_Class::callbacks
10053  * callbacks description array, so that the users of the smart object
10054  * can have introspection on its events API <b>at run time</b>.
10055  *
10056  * @ingroup Evas_Smart_Object_Group
10057  */
10058 EAPI void              evas_object_smart_callback_call   (Evas_Object *obj, const char *event, void *event_info) EINA_ARG_NONNULL(1, 2);
10059
10060
10061 /**
10062  * Set an smart object @b instance's smart callbacks descriptions.
10063  *
10064  * @param obj A smart object
10065  * @param descriptions @c NULL terminated array with
10066  * #Evas_Smart_Cb_Description descriptions. Array elements won't be
10067  * modified at run time, but references to them and their contents
10068  * will be made, so this array should be kept alive during the whole
10069  * object's lifetime.
10070  * @return @c EINA_TRUE on success, @c EINA_FALSE on failure.
10071  *
10072  * These descriptions are hints to be used by introspection and are
10073  * not enforced in any way.
10074  *
10075  * It will not be checked if instance callbacks descriptions have the
10076  * same name as respective possibly registered in the smart object
10077  * @b class. Both are kept in different arrays and users of
10078  * evas_object_smart_callbacks_descriptions_get() should handle this
10079  * case as they wish.
10080  *
10081  * @note Becase @p descriptions must be @c NULL terminated, and
10082  *        because a @c NULL name makes little sense, too,
10083  *        Evas_Smart_Cb_Description::name must @b not be @c NULL.
10084  *
10085  * @note While instance callbacks descriptions are possible, they are
10086  *       @b not recommended. Use @b class callbacks descriptions
10087  *       instead as they make you smart object user's life simpler and
10088  *       will use less memory, as descriptions and arrays will be
10089  *       shared among all instances.
10090  *
10091  * @ingroup Evas_Smart_Object_Group
10092  */
10093 EAPI Eina_Bool         evas_object_smart_callbacks_descriptions_set(Evas_Object *obj, const Evas_Smart_Cb_Description *descriptions) EINA_ARG_NONNULL(1);
10094
10095 /**
10096  * Retrieve an smart object's know smart callback descriptions (both
10097  * instance and class ones).
10098  *
10099  * @param obj The smart object to get callback descriptions from.
10100  * @param class_descriptions Where to store class callbacks
10101  *        descriptions array, if any is known. If no descriptions are
10102  *        known, @c NULL is returned
10103  * @param class_count Returns how many class callbacks descriptions
10104  *        are known.
10105  * @param instance_descriptions Where to store instance callbacks
10106  *        descriptions array, if any is known. If no descriptions are
10107  *        known, @c NULL is returned.
10108  * @param instance_count Returns how many instance callbacks
10109  *        descriptions are known.
10110  *
10111  * This call searches for registered callback descriptions for both
10112  * instance and class of the given smart object. These arrays will be
10113  * sorted by Evas_Smart_Cb_Description::name and also @c NULL
10114  * terminated, so both @a class_count and @a instance_count can be
10115  * ignored, if the caller wishes so. The terminator @c NULL is not
10116  * counted in these values.
10117  *
10118  * @note If just class descriptions are of interest, try
10119  *       evas_smart_callbacks_descriptions_get() instead.
10120  *
10121  * @note Use @c NULL pointers on the descriptions/counters you're not
10122  * interested in: they'll be ignored by the function.
10123  *
10124  * @see evas_smart_callbacks_descriptions_get()
10125  *
10126  * @ingroup Evas_Smart_Object_Group
10127  */
10128 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);
10129
10130 /**
10131  * Find callback description for callback called @a name.
10132  *
10133  * @param obj the smart object.
10134  * @param name name of desired callback, must @b not be @c NULL.  The
10135  *        search have a special case for @a name being the same
10136  *        pointer as registered with Evas_Smart_Cb_Description, one
10137  *        can use it to avoid excessive use of strcmp().
10138  * @param class_description pointer to return class description or @c
10139  *        NULL if not found. If parameter is @c NULL, no search will
10140  *        be done on class descriptions.
10141  * @param instance_description pointer to return instance description
10142  *        or @c NULL if not found. If parameter is @c NULL, no search
10143  *        will be done on instance descriptions.
10144  * @return reference to description if found, @c NULL if not found.
10145  */
10146 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);
10147
10148
10149 /**
10150  * Mark smart object as changed, dirty.
10151  *
10152  * @param obj The given Evas smart object
10153  *
10154  * This will flag the given object as needing recalculation,
10155  * forcefully. As an effect, on the next rendering cycle it's @b
10156  * calculate() (see #Evas_Smart_Class) smart function will be called.
10157  *
10158  * @see evas_object_smart_need_recalculate_set().
10159  * @see evas_object_smart_calculate().
10160  *
10161  * @ingroup Evas_Smart_Object_Group
10162  */
10163 EAPI void              evas_object_smart_changed         (Evas_Object *obj) EINA_ARG_NONNULL(1);
10164
10165 /**
10166  * Set or unset the flag signalling that a given smart object needs to
10167  * get recalculated.
10168  *
10169  * @param obj the smart object
10170  * @param value whether one wants to set (@c EINA_TRUE) or to unset
10171  * (@c EINA_FALSE) the flag.
10172  *
10173  * If this flag is set, then the @c calculate() smart function of @p
10174  * obj will be called, if one is provided, during rendering phase of
10175  * Evas (see evas_render()), after which this flag will be
10176  * automatically unset.
10177  *
10178  * If that smart function is not provided for the given object, this
10179  * flag will be left unchanged.
10180  *
10181  * @note just setting this flag will not make the canvas' whole scene
10182  *       dirty, by itself, and evas_render() will have no effect. To
10183  *       force that, use evas_object_smart_changed(), that will also
10184  *       automatically call this function automatically, with @c
10185  *       EINA_TRUE as parameter.
10186  *
10187  * @see evas_object_smart_need_recalculate_get()
10188  * @see evas_object_smart_calculate()
10189  * @see evas_smart_objects_calculate()
10190  *
10191  * @ingroup Evas_Smart_Object_Group
10192  */
10193 EAPI void              evas_object_smart_need_recalculate_set(Evas_Object *obj, Eina_Bool value) EINA_ARG_NONNULL(1);
10194
10195 /**
10196  * Get the value of the flag signalling that a given smart object needs to
10197  * get recalculated.
10198  *
10199  * @param obj the smart object
10200  * @return if flag is set or not.
10201  *
10202  * @note this flag will be unset during the rendering phase, when the
10203  *       @c calculate() smart function is called, if one is provided.
10204  *       If it's not provided, then the flag will be left unchanged
10205  *       after the rendering phase.
10206  *
10207  * @see evas_object_smart_need_recalculate_set(), for more details
10208  *
10209  * @ingroup Evas_Smart_Object_Group
10210  */
10211 EAPI Eina_Bool         evas_object_smart_need_recalculate_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
10212
10213 /**
10214  * Call the @b calculate() smart function immediately on a given smart
10215  * object.
10216  *
10217  * @param obj the smart object's handle
10218  *
10219  * This will force immediate calculations (see #Evas_Smart_Class)
10220  * needed for renderization of this object and, besides, unset the
10221  * flag on it telling it needs recalculation for the next rendering
10222  * phase.
10223  *
10224  * @see evas_object_smart_need_recalculate_set()
10225  *
10226  * @ingroup Evas_Smart_Object_Group
10227  */
10228 EAPI void              evas_object_smart_calculate       (Evas_Object *obj) EINA_ARG_NONNULL(1);
10229
10230 /**
10231  * Call user-provided @c calculate() smart functions and unset the
10232  * flag signalling that the object needs to get recalculated to @b all
10233  * smart objects in the canvas.
10234  *
10235  * @param e The canvas to calculate all smart objects in
10236  *
10237  * @see evas_object_smart_need_recalculate_set()
10238  *
10239  * @ingroup Evas_Smart_Object_Group
10240  */
10241 EAPI void              evas_smart_objects_calculate      (Evas *e);
10242
10243 /**
10244  * This gets the internal counter that counts the number of smart calculations
10245  * 
10246  * @param e The canvas to get the calculate counter from
10247  * 
10248  * Whenever evas performs smart object calculations on the whole canvas
10249  * it increments a counter by 1. This is the smart object calculate counter
10250  * that this function returns the value of. It starts at the value of 0 and
10251  * will increase (and eventually wrap around to negative values and so on) by
10252  * 1 every time objects are calculated. You can use this counter to ensure
10253  * you don't re-do calculations withint the same calculation generation/run
10254  * if the calculations maybe cause self-feeding effects.
10255  * 
10256  * @ingroup Evas_Smart_Object_Group
10257  * @since 1.1
10258  */
10259 EAPI int               evas_smart_objects_calculate_count_get (const Evas *e);
10260    
10261 /**
10262  * Moves all children objects of a given smart object relative to a
10263  * given offset.
10264  *
10265  * @param obj the smart object.
10266  * @param dx horizontal offset (delta).
10267  * @param dy vertical offset (delta).
10268  *
10269  * This will make each of @p obj object's children to move, from where
10270  * they before, with those delta values (offsets) on both directions.
10271  *
10272  * @note This is most useful on custom smart @c move() functions.
10273  *
10274  * @note Clipped smart objects already make use of this function on
10275  * their @c move() smart function definition.
10276  */
10277 EAPI void                    evas_object_smart_move_children_relative(Evas_Object *obj, Evas_Coord dx, Evas_Coord dy) EINA_ARG_NONNULL(1);
10278
10279 /**
10280  * @}
10281  */
10282
10283 /**
10284  * @defgroup Evas_Smart_Object_Clipped Clipped Smart Object
10285  *
10286  * Clipped smart object is a base to construct other smart objects
10287  * based on the concept of having an internal clipper that is applied
10288  * to all children objects. This clipper will control the visibility,
10289  * clipping and color of sibling objects (remember that the clipping
10290  * is recursive, and clipper color modulates the color of its
10291  * clippees). By default, this base will also move children relatively
10292  * to the parent, and delete them when parent is deleted. In other
10293  * words, it is the base for simple object grouping.
10294  *
10295  * See some @ref Example_Evas_Smart_Objects "examples" of this group
10296  * of functions.
10297  *
10298  * @see evas_object_smart_clipped_smart_set()
10299  *
10300  * @ingroup Evas_Smart_Object_Group
10301  */
10302
10303 /**
10304  * @addtogroup Evas_Smart_Object_Clipped
10305  * @{
10306  */
10307
10308 /**
10309  * Every subclass should provide this at the beginning of their own
10310  * data set with evas_object_smart_data_set().
10311  */
10312   typedef struct _Evas_Object_Smart_Clipped_Data Evas_Object_Smart_Clipped_Data;
10313   struct _Evas_Object_Smart_Clipped_Data
10314   {
10315      Evas_Object *clipper;
10316      Evas        *evas;
10317   };
10318
10319
10320 /**
10321  * Get the clipper object for the given clipped smart object.
10322  *
10323  * @param obj the clipped smart object to retrieve associated clipper
10324  * from.
10325  * @return the clipper object.
10326  *
10327  * Use this function if you want to change any of this clipper's
10328  * properties, like colors.
10329  *
10330  * @see evas_object_smart_clipped_smart_add()
10331  */
10332 EAPI Evas_Object            *evas_object_smart_clipped_clipper_get   (Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
10333
10334 /**
10335  * Set a given smart class' callbacks so it implements the <b>clipped smart
10336  * object"</b>'s interface.
10337  *
10338  * @param sc The smart class handle to operate on
10339  *
10340  * This call will assign all the required methods of the @p sc
10341  * #Evas_Smart_Class instance to the implementations set for clipped
10342  * smart objects. If one wants to "subclass" it, call this function
10343  * and then override desired values. If one wants to call any original
10344  * method, save it somewhere. Example:
10345  *
10346  * @code
10347  * static Evas_Smart_Class parent_sc = EVAS_SMART_CLASS_INIT_NULL;
10348  *
10349  * static void my_class_smart_add(Evas_Object *o)
10350  * {
10351  *    parent_sc.add(o);
10352  *    evas_object_color_set(evas_object_smart_clipped_clipper_get(o),
10353  *                          255, 0, 0, 255);
10354  * }
10355  *
10356  * Evas_Smart_Class *my_class_new(void)
10357  * {
10358  *    static Evas_Smart_Class sc = EVAS_SMART_CLASS_INIT_NAME_VERSION("MyClass");
10359  *    if (!parent_sc.name)
10360  *      {
10361  *         evas_object_smart_clipped_smart_set(&sc);
10362  *         parent_sc = sc;
10363  *         sc.add = my_class_smart_add;
10364  *      }
10365  *    return &sc;
10366  * }
10367  * @endcode
10368  *
10369  * Default behavior for each of #Evas_Smart_Class functions on a
10370  * clipped smart object are:
10371  * - @c add: creates a hidden clipper with "infinite" size, to clip
10372  *    any incoming members;
10373  *  - @c del: delete all children objects;
10374  *  - @c move: move all objects relative relatively;
10375  *  - @c resize: <b>not defined</b>;
10376  *  - @c show: if there are children objects, show clipper;
10377  *  - @c hide: hides clipper;
10378  *  - @c color_set: set the color of clipper;
10379  *  - @c clip_set: set clipper of clipper;
10380  *  - @c clip_unset: unset the clipper of clipper;
10381  *
10382  * @note There are other means of assigning parent smart classes to
10383  * child ones, like the #EVAS_SMART_SUBCLASS_NEW macro or the
10384  * evas_smart_class_inherit_full() function.
10385  */
10386 EAPI void                    evas_object_smart_clipped_smart_set     (Evas_Smart_Class *sc) EINA_ARG_NONNULL(1);
10387
10388 /**
10389  * Get a pointer to the <b>clipped smart object's</b> class, to use
10390  * for proper inheritance
10391  *
10392  * @see #Evas_Smart_Object_Clipped for more information on this smart
10393  * class
10394  */
10395 EAPI const Evas_Smart_Class *evas_object_smart_clipped_class_get     (void) EINA_CONST;
10396
10397 /**
10398  * @}
10399  */
10400
10401 /**
10402  * @defgroup Evas_Object_Box Box Smart Object
10403  *
10404  * A box is a convenience smart object that packs children inside it
10405  * in @b sequence, using a layouting function specified by the
10406  * user. There are a couple of pre-made layouting functions <b>built-in
10407  * in Evas</b>, all of them using children size hints to define their
10408  * size and alignment inside their cell space.
10409  *
10410  * Examples on this smart object's usage:
10411  * - @ref Example_Evas_Box
10412  * - @ref Example_Evas_Size_Hints
10413  *
10414  * @see @ref Evas_Object_Group_Size_Hints
10415  *
10416  * @ingroup Evas_Smart_Object_Group
10417  */
10418
10419 /**
10420  * @addtogroup Evas_Object_Box
10421  * @{
10422  */
10423
10424 /**
10425  * @typedef Evas_Object_Box_Api
10426  *
10427  * Smart class extension, providing extra box object requirements.
10428  *
10429  * @ingroup Evas_Object_Box
10430  */
10431    typedef struct _Evas_Object_Box_Api        Evas_Object_Box_Api;
10432
10433 /**
10434  * @typedef Evas_Object_Box_Data
10435  *
10436  * Smart object instance data, providing box object requirements.
10437  *
10438  * @ingroup Evas_Object_Box
10439  */
10440    typedef struct _Evas_Object_Box_Data       Evas_Object_Box_Data;
10441
10442 /**
10443  * @typedef Evas_Object_Box_Option
10444  *
10445  * The base structure for a box option. Box options are a way of
10446  * extending box items properties, which will be taken into account
10447  * for layouting decisions. The box layouting functions provided by
10448  * Evas will only rely on objects' canonical size hints to layout
10449  * them, so the basic box option has @b no (custom) property set.
10450  *
10451  * Users creating their own layouts, but not depending on extra child
10452  * items' properties, would be fine just using
10453  * evas_object_box_layout_set(). But if one desires a layout depending
10454  * on extra child properties, he/she has to @b subclass the box smart
10455  * object. Thus, by using evas_object_box_smart_class_get() and
10456  * evas_object_box_smart_set(), the @c option_new() and @c
10457  * option_free() smart class functions should be properly
10458  * redefined/extended.
10459  *
10460  * Object properties are bound to an integer identifier and must have
10461  * a name string. Their values are open to any data. See the API on
10462  * option properties for more details.
10463  *
10464  * @ingroup Evas_Object_Box
10465  */
10466    typedef struct _Evas_Object_Box_Option     Evas_Object_Box_Option;
10467
10468 /**
10469  * @typedef Evas_Object_Box_Layout
10470  *
10471  * Function signature for an Evas box object layouting routine. By
10472  * @a o it will be passed the box object in question, by @a priv it will
10473  * be passed the box's internal data and, by @a user_data, it will be
10474  * passed any custom data one could have set to a given box layouting
10475  * function, with evas_object_box_layout_set().
10476  *
10477  * @ingroup Evas_Object_Box
10478  */
10479    typedef void (*Evas_Object_Box_Layout) (Evas_Object *o, Evas_Object_Box_Data *priv, void *user_data);
10480
10481 /**
10482  * @def EVAS_OBJECT_BOX_API_VERSION
10483  *
10484  * Current version for Evas box object smart class, a value which goes
10485  * to _Evas_Object_Box_Api::version.
10486  *
10487  * @ingroup Evas_Object_Box
10488  */
10489 #define EVAS_OBJECT_BOX_API_VERSION 1
10490
10491 /**
10492  * @struct _Evas_Object_Box_Api
10493  *
10494  * This structure should be used by any smart class inheriting from
10495  * the box's one, to provide custom box behavior which could not be
10496  * achieved only by providing a layout function, with
10497  * evas_object_box_layout_set().
10498  *
10499  * @extends Evas_Smart_Class
10500  * @ingroup Evas_Object_Box
10501  */
10502    struct _Evas_Object_Box_Api
10503    {
10504       Evas_Smart_Class          base; /**< Base smart class struct, need for all smart objects */
10505       int                       version; /**< Version of this smart class definition */
10506       Evas_Object_Box_Option *(*append)           (Evas_Object *o, Evas_Object_Box_Data *priv, Evas_Object *child); /**< Smart function to append child elements in boxes */
10507       Evas_Object_Box_Option *(*prepend)          (Evas_Object *o, Evas_Object_Box_Data *priv, Evas_Object *child); /**< Smart function to prepend child elements in boxes */
10508       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 */
10509       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 */
10510       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 */
10511       Evas_Object            *(*remove)           (Evas_Object *o, Evas_Object_Box_Data *priv, Evas_Object *child); /**< Smart function to remove a child element from boxes */
10512       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 */
10513       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 */
10514       Eina_Bool               (*property_get)     (Evas_Object *o, Evas_Object_Box_Option *opt, int property, va_list args); /**< Smart function to retrieve a custom property from a box child */
10515       const char             *(*property_name_get)(Evas_Object *o, int property); /**< Smart function to get the name of a custom property of box children */
10516       int                     (*property_id_get)  (Evas_Object *o, const char *name); /**< Smart function to get the numerical ID of a custom property of box children */
10517       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 */
10518       void                    (*option_free)      (Evas_Object *o, Evas_Object_Box_Data *priv, Evas_Object_Box_Option *opt); /**< Smart function to delete a box option struct */
10519    };
10520
10521 /**
10522  * @def EVAS_OBJECT_BOX_API_INIT
10523  *
10524  * Initializer for a whole #Evas_Object_Box_Api structure, with
10525  * @c NULL values on its specific fields.
10526  *
10527  * @param smart_class_init initializer to use for the "base" field
10528  * (#Evas_Smart_Class).
10529  *
10530  * @see EVAS_SMART_CLASS_INIT_NULL
10531  * @see EVAS_SMART_CLASS_INIT_VERSION
10532  * @see EVAS_SMART_CLASS_INIT_NAME_VERSION
10533  * @see EVAS_OBJECT_BOX_API_INIT_NULL
10534  * @see EVAS_OBJECT_BOX_API_INIT_VERSION
10535  * @see EVAS_OBJECT_BOX_API_INIT_NAME_VERSION
10536  * @ingroup Evas_Object_Box
10537  */
10538 #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}
10539
10540 /**
10541  * @def EVAS_OBJECT_BOX_API_INIT_NULL
10542  *
10543  * Initializer to zero out a whole #Evas_Object_Box_Api structure.
10544  *
10545  * @see EVAS_OBJECT_BOX_API_INIT_VERSION
10546  * @see EVAS_OBJECT_BOX_API_INIT_NAME_VERSION
10547  * @see EVAS_OBJECT_BOX_API_INIT
10548  * @ingroup Evas_Object_Box
10549  */
10550 #define EVAS_OBJECT_BOX_API_INIT_NULL EVAS_OBJECT_BOX_API_INIT(EVAS_SMART_CLASS_INIT_NULL)
10551
10552 /**
10553  * @def EVAS_OBJECT_BOX_API_INIT_VERSION
10554  *
10555  * Initializer to zero out a whole #Evas_Object_Box_Api structure and
10556  * set a specific version on it.
10557  *
10558  * This is similar to #EVAS_OBJECT_BOX_API_INIT_NULL, but it will set
10559  * the version field of #Evas_Smart_Class (base field) to the latest
10560  * #EVAS_SMART_CLASS_VERSION.
10561  *
10562  * @see EVAS_OBJECT_BOX_API_INIT_NULL
10563  * @see EVAS_OBJECT_BOX_API_INIT_NAME_VERSION
10564  * @see EVAS_OBJECT_BOX_API_INIT
10565  * @ingroup Evas_Object_Box
10566  */
10567 #define EVAS_OBJECT_BOX_API_INIT_VERSION EVAS_OBJECT_BOX_API_INIT(EVAS_SMART_CLASS_INIT_VERSION)
10568
10569 /**
10570  * @def EVAS_OBJECT_BOX_API_INIT_NAME_VERSION
10571  *
10572  * Initializer to zero out a whole #Evas_Object_Box_Api structure and
10573  * set its name and version.
10574  *
10575  * This is similar to #EVAS_OBJECT_BOX_API_INIT_NULL, but it will also
10576  * set the version field of #Evas_Smart_Class (base field) to the
10577  * latest #EVAS_SMART_CLASS_VERSION and name it to the specific value.
10578  *
10579  * It will keep a reference to the name field as a <c>"const char *"</c>,
10580  * i.e., the name must be available while the structure is
10581  * used (hint: static or global variable!) and must not be modified.
10582  *
10583  * @see EVAS_OBJECT_BOX_API_INIT_NULL
10584  * @see EVAS_OBJECT_BOX_API_INIT_VERSION
10585  * @see EVAS_OBJECT_BOX_API_INIT
10586  * @ingroup Evas_Object_Box
10587  */
10588 #define EVAS_OBJECT_BOX_API_INIT_NAME_VERSION(name) EVAS_OBJECT_BOX_API_INIT(EVAS_SMART_CLASS_INIT_NAME_VERSION(name))
10589
10590 /**
10591  * @struct _Evas_Object_Box_Data
10592  *
10593  * This structure augments clipped smart object's instance data,
10594  * providing extra members required by generic box implementation. If
10595  * a subclass inherits from #Evas_Object_Box_Api, then it may augment
10596  * #Evas_Object_Box_Data to fit its own needs.
10597  *
10598  * @extends Evas_Object_Smart_Clipped_Data
10599  * @ingroup Evas_Object_Box
10600  */
10601    struct _Evas_Object_Box_Data
10602    {
10603       Evas_Object_Smart_Clipped_Data   base;
10604       const Evas_Object_Box_Api       *api;
10605       struct {
10606          double                        h, v;
10607       } align;
10608       struct {
10609          Evas_Coord                    h, v;
10610       } pad;
10611       Eina_List                       *children;
10612       struct {
10613          Evas_Object_Box_Layout        cb;
10614          void                         *data;
10615          void                        (*free_data)(void *data);
10616       } layout;
10617       Eina_Bool                        layouting : 1;
10618       Eina_Bool                        children_changed : 1;
10619    };
10620
10621    struct _Evas_Object_Box_Option
10622    {
10623       Evas_Object *obj; /**< Pointer to the box child object, itself */
10624       Eina_Bool    max_reached:1;
10625       Eina_Bool    min_reached:1;
10626       Evas_Coord   alloc_size;
10627    }; /**< #Evas_Object_Box_Option struct fields */
10628
10629 /**
10630  * Set the default box @a api struct (Evas_Object_Box_Api)
10631  * with the default values. May be used to extend that API.
10632  *
10633  * @param api The box API struct to set back, most probably with
10634  * overridden fields (on class extensions scenarios)
10635  */
10636 EAPI void                       evas_object_box_smart_set                             (Evas_Object_Box_Api *api) EINA_ARG_NONNULL(1);
10637
10638 /**
10639  * Get the Evas box smart class, for inheritance purposes.
10640  *
10641  * @return the (canonical) Evas box smart class.
10642  *
10643  * The returned value is @b not to be modified, just use it as your
10644  * parent class.
10645  */
10646 EAPI const Evas_Object_Box_Api *evas_object_box_smart_class_get                       (void) EINA_CONST;
10647
10648 /**
10649  * Set a new layouting function to a given box object
10650  *
10651  * @param o The box object to operate on.
10652  * @param cb The new layout function to set on @p o.
10653  * @param data Data pointer to be passed to @p cb.
10654  * @param free_data Function to free @p data, if need be.
10655  *
10656  * A box layout function affects how a box object displays child
10657  * elements within its area. The list of pre-defined box layouts
10658  * available in Evas is:
10659  * - evas_object_box_layout_horizontal()
10660  * - evas_object_box_layout_vertical()
10661  * - evas_object_box_layout_homogeneous_horizontal()
10662  * - evas_object_box_layout_homogeneous_vertical()
10663  * - evas_object_box_layout_homogeneous_max_size_horizontal()
10664  * - evas_object_box_layout_homogeneous_max_size_vertical()
10665  * - evas_object_box_layout_flow_horizontal()
10666  * - evas_object_box_layout_flow_vertical()
10667  * - evas_object_box_layout_stack()
10668  *
10669  * Refer to each of their documentation texts for details on them.
10670  *
10671  * @note A box layouting function will be triggered by the @c
10672  * 'calculate' smart callback of the box's smart class.
10673  */
10674 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);
10675
10676 /**
10677  * Add a new box object on the provided canvas.
10678  *
10679  * @param evas The canvas to create the box object on.
10680  * @return @c NULL on error, a pointer to a new box object on
10681  * success.
10682  *
10683  * After instantiation, if a box object hasn't its layout function
10684  * set, via evas_object_box_layout_set(), it will have it by default
10685  * set to evas_object_box_layout_horizontal(). The remaining
10686  * properties of the box must be set/retrieved via
10687  * <c>evas_object_box_{h,v}_{align,padding}_{get,set)()</c>.
10688  */
10689 EAPI Evas_Object               *evas_object_box_add                                   (Evas *evas) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
10690
10691 /**
10692  * Add a new box as a @b child of a given smart object.
10693  *
10694  * @param parent The parent smart object to put the new box in.
10695  * @return @c NULL on error, a pointer to a new box object on
10696  * success.
10697  *
10698  * This is a helper function that has the same effect of putting a new
10699  * box object into @p parent by use of evas_object_smart_member_add().
10700  *
10701  * @see evas_object_box_add()
10702  */
10703 EAPI Evas_Object               *evas_object_box_add_to                                (Evas_Object *parent) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
10704
10705 /**
10706  * Layout function which sets the box @a o to a (basic) horizontal box
10707  *
10708  * @param o The box object in question
10709  * @param priv The smart data of the @p o
10710  * @param data The data pointer passed on
10711  * evas_object_box_layout_set(), if any
10712  *
10713  * In this layout, the box object's overall behavior is controlled by
10714  * its padding/alignment properties, which are set by the
10715  * <c>evas_object_box_{h,v}_{align,padding}_set()</c> family of
10716  * functions. The size hints of the elements in the box -- set by the
10717  * <c>evas_object_size_hint_{align,padding,weight}_set()</c> functions
10718  * -- also control the way this function works.
10719  *
10720  * \par Box's properties:
10721  * @c align_h controls the horizontal alignment of the child objects
10722  * relative to the containing box. When set to @c 0.0, children are
10723  * aligned to the left. A value of @c 1.0 makes them aligned to the
10724  * right border. Values in between align them proportionally. Note
10725  * that if the size required by the children, which is given by their
10726  * widths and the @c padding_h property of the box, is bigger than the
10727  * their container's width, the children will be displayed out of the
10728  * box's bounds. A negative value of @c align_h makes the box to
10729  * @b justify its children. The padding between them, in this case, is
10730  * corrected so that the leftmost one touches the left border and the
10731  * rightmost one touches the right border (even if they must
10732  * overlap). The @c align_v and @c padding_v properties of the box
10733  * @b don't contribute to its behaviour when this layout is chosen.
10734  *
10735  * \par Child element's properties:
10736  * @c align_x does @b not influence the box's behavior. @c padding_l
10737  * and @c padding_r sum up to the container's horizontal padding
10738  * between elements. The child's @c padding_t, @c padding_b and
10739  * @c align_y properties apply for padding/alignment relative to the
10740  * overall height of the box. Finally, there is the @c weight_x
10741  * property, which, if set to a non-zero value, tells the container
10742  * that the child width is @b not pre-defined. If the container can't
10743  * accommodate all its children, it sets the widths of the ones
10744  * <b>with weights</b> to sizes as small as they can all fit into
10745  * it. If the size required by the children is less than the
10746  * available, the box increases its childrens' (which have weights)
10747  * widths as to fit the remaining space. The @c weight_x property,
10748  * besides telling the element is resizable, gives a @b weight for the
10749  * resizing process.  The parent box will try to distribute (or take
10750  * off) widths accordingly to the @b normalized list of weigths: most
10751  * weighted children remain/get larger in this process than the least
10752  * ones. @c weight_y does not influence the layout.
10753  *
10754  * If one desires that, besides having weights, child elements must be
10755  * resized bounded to a minimum or maximum size, those size hints must
10756  * be set, by the <c>evas_object_size_hint_{min,max}_set()</c>
10757  * functions.
10758  */
10759 EAPI void                       evas_object_box_layout_horizontal                     (Evas_Object *o, Evas_Object_Box_Data *priv, void *data) EINA_ARG_NONNULL(1, 2);
10760
10761 /**
10762  * Layout function which sets the box @a o to a (basic) vertical box
10763  *
10764  * This function behaves analogously to
10765  * evas_object_box_layout_horizontal(). The description of its
10766  * behaviour can be derived from that function's documentation.
10767  */
10768 EAPI void                       evas_object_box_layout_vertical                       (Evas_Object *o, Evas_Object_Box_Data *priv, void *data) EINA_ARG_NONNULL(1, 2);
10769
10770 /**
10771  * Layout function which sets the box @a o to a @b homogeneous
10772  * vertical box
10773  *
10774  * This function behaves analogously to
10775  * evas_object_box_layout_homogeneous_horizontal().  The description
10776  * of its behaviour can be derived from that function's documentation.
10777  */
10778 EAPI void                       evas_object_box_layout_homogeneous_vertical           (Evas_Object *o, Evas_Object_Box_Data *priv, void *data) EINA_ARG_NONNULL(1, 2);
10779
10780 /**
10781  * Layout function which sets the box @a o to a @b homogeneous
10782  * horizontal box
10783  *
10784  * @param o The box object in question
10785  * @param priv The smart data of the @p o
10786  * @param data The data pointer passed on
10787  * evas_object_box_layout_set(), if any
10788  *
10789  * In a homogeneous horizontal box, its width is divided @b equally
10790  * between the contained objects. The box's overall behavior is
10791  * controlled by its padding/alignment properties, which are set by
10792  * the <c>evas_object_box_{h,v}_{align,padding}_set()</c> family of
10793  * functions.  The size hints the elements in the box -- set by the
10794  * <c>evas_object_size_hint_{align,padding,weight}_set()</c> functions
10795  * -- also control the way this function works.
10796  *
10797  * \par Box's properties:
10798  * @c align_h has no influence on the box for this layout.
10799  * @c padding_h tells the box to draw empty spaces of that size, in
10800  * pixels, between the (equal) child objects's cells. The @c align_v
10801  * and @c padding_v properties of the box don't contribute to its
10802  * behaviour when this layout is chosen.
10803  *
10804  * \par Child element's properties:
10805  * @c padding_l and @c padding_r sum up to the required width of the
10806  * child element. The @c align_x property tells the relative position
10807  * of this overall child width in its allocated cell (@c 0.0 to
10808  * extreme left, @c 1.0 to extreme right). A value of @c -1.0 to
10809  * @c align_x makes the box try to resize this child element to the exact
10810  * width of its cell (respecting the minimum and maximum size hints on
10811  * the child's width and accounting for its horizontal padding
10812  * hints). The child's @c padding_t, @c padding_b and @c align_y
10813  * properties apply for padding/alignment relative to the overall
10814  * height of the box. A value of @c -1.0 to @c align_y makes the box
10815  * try to resize this child element to the exact height of its parent
10816  * (respecting the maximum size hint on the child's height).
10817  */
10818 EAPI void                       evas_object_box_layout_homogeneous_horizontal         (Evas_Object *o, Evas_Object_Box_Data *priv, void *data) EINA_ARG_NONNULL(1, 2);
10819
10820 /**
10821  * Layout function which sets the box @a o to a <b>maximum size,
10822  * homogeneous</b> horizontal box
10823  *
10824  * @param o The box object in question
10825  * @param priv The smart data of the @p o
10826  * @param data The data pointer passed on
10827  * evas_object_box_layout_set(), if any
10828  *
10829  * In a maximum size, homogeneous horizontal box, besides having cells
10830  * of <b>equal size</b> reserved for the child objects, this size will
10831  * be defined by the size of the @b largest child in the box (in
10832  * width). The box's overall behavior is controlled by its properties,
10833  * which are set by the
10834  * <c>evas_object_box_{h,v}_{align,padding}_set()</c> family of
10835  * functions.  The size hints of the elements in the box -- set by the
10836  * <c>evas_object_size_hint_{align,padding,weight}_set()</c> functions
10837  * -- also control the way this function works.
10838  *
10839  * \par Box's properties:
10840  * @c padding_h tells the box to draw empty spaces of that size, in
10841  * pixels, between the child objects's cells. @c align_h controls the
10842  * horizontal alignment of the child objects, relative to the
10843  * containing box. When set to @c 0.0, children are aligned to the
10844  * left. A value of @c 1.0 lets them aligned to the right
10845  * border. Values in between align them proportionally. A negative
10846  * value of @c align_h makes the box to @b justify its children
10847  * cells. The padding between them, in this case, is corrected so that
10848  * the leftmost one touches the left border and the rightmost one
10849  * touches the right border (even if they must overlap). The
10850  * @c align_v and @c padding_v properties of the box don't contribute to
10851  * its behaviour when this layout is chosen.
10852  *
10853  * \par Child element's properties:
10854  * @c padding_l and @c padding_r sum up to the required width of the
10855  * child element. The @c align_x property tells the relative position
10856  * of this overall child width in its allocated cell (@c 0.0 to
10857  * extreme left, @c 1.0 to extreme right). A value of @c -1.0 to
10858  * @c align_x makes the box try to resize this child element to the exact
10859  * width of its cell (respecting the minimum and maximum size hints on
10860  * the child's width and accounting for its horizontal padding
10861  * hints). The child's @c padding_t, @c padding_b and @c align_y
10862  * properties apply for padding/alignment relative to the overall
10863  * height of the box. A value of @c -1.0 to @c align_y makes the box
10864  * try to resize this child element to the exact height of its parent
10865  * (respecting the max hint on the child's height).
10866  */
10867 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);
10868
10869 /**
10870  * Layout function which sets the box @a o to a <b>maximum size,
10871  * homogeneous</b> vertical box
10872  *
10873  * This function behaves analogously to
10874  * evas_object_box_layout_homogeneous_max_size_horizontal(). The
10875  * description of its behaviour can be derived from that function's
10876  * documentation.
10877  */
10878 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);
10879
10880 /**
10881  * Layout function which sets the box @a o to a @b flow horizontal
10882  * box.
10883  *
10884  * @param o The box object in question
10885  * @param priv The smart data of the @p o
10886  * @param data The data pointer passed on
10887  * evas_object_box_layout_set(), if any
10888  *
10889  * In a flow horizontal box, the box's child elements are placed in
10890  * @b rows (think of text as an analogy). A row has as much elements as
10891  * can fit into the box's width. The box's overall behavior is
10892  * controlled by its properties, which are set by the
10893  * <c>evas_object_box_{h,v}_{align,padding}_set()</c> family of
10894  * functions.  The size hints of the elements in the box -- set by the
10895  * <c>evas_object_size_hint_{align,padding,weight}_set()</c> functions
10896  * -- also control the way this function works.
10897  *
10898  * \par Box's properties:
10899  * @c padding_h tells the box to draw empty spaces of that size, in
10900  * pixels, between the child objects's cells. @c align_h dictates the
10901  * horizontal alignment of the rows (@c 0.0 to left align them, @c 1.0
10902  * to right align). A value of @c -1.0 to @c align_h lets the rows
10903  * @b justified horizontally. @c align_v controls the vertical alignment
10904  * of the entire set of rows (@c 0.0 to top, @c 1.0 to bottom). A
10905  * value of @c -1.0 to @c align_v makes the box to @b justify the rows
10906  * vertically. The padding between them, in this case, is corrected so
10907  * that the first row touches the top border and the last one touches
10908  * the bottom border (even if they must overlap). @c padding_v has no
10909  * influence on the layout.
10910  *
10911  * \par Child element's properties:
10912  * @c padding_l and @c padding_r sum up to the required width of the
10913  * child element. The @c align_x property has no influence on the
10914  * layout. The child's @c padding_t and @c padding_b sum up to the
10915  * required height of the child element and is the only means (besides
10916  * row justifying) of setting space between rows. Note, however, that
10917  * @c align_y dictates positioning relative to the <b>largest
10918  * height</b> required by a child object in the actual row.
10919  */
10920 EAPI void                       evas_object_box_layout_flow_horizontal                (Evas_Object *o, Evas_Object_Box_Data *priv, void *data) EINA_ARG_NONNULL(1, 2);
10921
10922 /**
10923  * Layout function which sets the box @a o to a @b flow vertical box.
10924  *
10925  * This function behaves analogously to
10926  * evas_object_box_layout_flow_horizontal(). The description of its
10927  * behaviour can be derived from that function's documentation.
10928  */
10929 EAPI void                       evas_object_box_layout_flow_vertical                  (Evas_Object *o, Evas_Object_Box_Data *priv, void *data) EINA_ARG_NONNULL(1, 2);
10930
10931 /**
10932  * Layout function which sets the box @a o to a @b stacking box
10933  *
10934  * @param o The box object in question
10935  * @param priv The smart data of the @p o
10936  * @param data The data pointer passed on
10937  * evas_object_box_layout_set(), if any
10938  *
10939  * In a stacking box, all children will be given the same size -- the
10940  * box's own size -- and they will be stacked one above the other, so
10941  * that the first object in @p o's internal list of child elements
10942  * will be the bottommost in the stack.
10943  *
10944  * \par Box's properties:
10945  * No box properties are used.
10946  *
10947  * \par Child element's properties:
10948  * @c padding_l and @c padding_r sum up to the required width of the
10949  * child element. The @c align_x property tells the relative position
10950  * of this overall child width in its allocated cell (@c 0.0 to
10951  * extreme left, @c 1.0 to extreme right). A value of @c -1.0 to @c
10952  * align_x makes the box try to resize this child element to the exact
10953  * width of its cell (respecting the min and max hints on the child's
10954  * width and accounting for its horizontal padding properties). The
10955  * same applies to the vertical axis.
10956  */
10957 EAPI void                       evas_object_box_layout_stack                          (Evas_Object *o, Evas_Object_Box_Data *priv, void *data) EINA_ARG_NONNULL(1, 2);
10958
10959 /**
10960  * Set the alignment of the whole bounding box of contents, for a
10961  * given box object.
10962  *
10963  * @param o The given box object to set alignment from
10964  * @param horizontal The horizontal alignment, in pixels
10965  * @param vertical the vertical alignment, in pixels
10966  *
10967  * This will influence how a box object is to align its bounding box
10968  * of contents within its own area. The values @b must be in the range
10969  * @c 0.0 - @c 1.0, or undefined behavior is expected. For horizontal
10970  * alignment, @c 0.0 means to the left, with @c 1.0 meaning to the
10971  * right. For vertical alignment, @c 0.0 means to the top, with @c 1.0
10972  * meaning to the bottom.
10973  *
10974  * @note The default values for both alignments is @c 0.5.
10975  *
10976  * @see evas_object_box_align_get()
10977  */
10978 EAPI void                       evas_object_box_align_set                             (Evas_Object *o, double horizontal, double vertical) EINA_ARG_NONNULL(1);
10979
10980 /**
10981  * Get the alignment of the whole bounding box of contents, for a
10982  * given box object.
10983  *
10984  * @param o The given box object to get alignment from
10985  * @param horizontal Pointer to a variable where to store the
10986  * horizontal alignment
10987  * @param vertical Pointer to a variable where to store the vertical
10988  * alignment
10989  *
10990  * @see evas_object_box_align_set() for more information
10991  */
10992 EAPI void                       evas_object_box_align_get                             (const Evas_Object *o, double *horizontal, double *vertical) EINA_ARG_NONNULL(1);
10993
10994 /**
10995  * Set the (space) padding between cells set for a given box object.
10996  *
10997  * @param o The given box object to set padding from
10998  * @param horizontal The horizontal padding, in pixels
10999  * @param vertical the vertical padding, in pixels
11000  *
11001  * @note The default values for both padding components is @c 0.
11002  *
11003  * @see evas_object_box_padding_get()
11004  */
11005 EAPI void                       evas_object_box_padding_set                           (Evas_Object *o, Evas_Coord horizontal, Evas_Coord vertical) EINA_ARG_NONNULL(1);
11006
11007 /**
11008  * Get the (space) padding between cells set for a given box object.
11009  *
11010  * @param o The given box object to get padding from
11011  * @param horizontal Pointer to a variable where to store the
11012  * horizontal padding
11013  * @param vertical Pointer to a variable where to store the vertical
11014  * padding
11015  *
11016  * @see evas_object_box_padding_set()
11017  */
11018 EAPI void                       evas_object_box_padding_get                           (const Evas_Object *o, Evas_Coord *horizontal, Evas_Coord *vertical) EINA_ARG_NONNULL(1);
11019
11020 /**
11021  * Append a new @a child object to the given box object @a o.
11022  *
11023  * @param o The given box object
11024  * @param child A child Evas object to be made a member of @p o
11025  * @return A box option bound to the recently added box item or @c
11026  * NULL, on errors
11027  *
11028  * On success, the @c "child,added" smart event will take place.
11029  *
11030  * @note The actual placing of the item relative to @p o's area will
11031  * depend on the layout set to it. For example, on horizontal layouts
11032  * an item in the end of the box's list of children will appear on its
11033  * right.
11034  *
11035  * @note This call will trigger the box's _Evas_Object_Box_Api::append
11036  * smart function.
11037  */
11038 EAPI Evas_Object_Box_Option    *evas_object_box_append                                (Evas_Object *o, Evas_Object *child) EINA_ARG_NONNULL(1, 2);
11039
11040 /**
11041  * Prepend a new @a child object to the given box object @a o.
11042  *
11043  * @param o The given box object
11044  * @param child A child Evas object to be made a member of @p o
11045  * @return A box option bound to the recently added box item or @c
11046  * NULL, on errors
11047  *
11048  * On success, the @c "child,added" smart event will take place.
11049  *
11050  * @note The actual placing of the item relative to @p o's area will
11051  * depend on the layout set to it. For example, on horizontal layouts
11052  * an item in the beginning of the box's list of children will appear
11053  * on its left.
11054  *
11055  * @note This call will trigger the box's
11056  * _Evas_Object_Box_Api::prepend smart function.
11057  */
11058 EAPI Evas_Object_Box_Option    *evas_object_box_prepend                               (Evas_Object *o, Evas_Object *child) EINA_ARG_NONNULL(1, 2);
11059
11060 /**
11061  * Insert a new @a child object <b>before another existing one</b>, in
11062  * a given box object @a o.
11063  *
11064  * @param o The given box object
11065  * @param child A child Evas object to be made a member of @p o
11066  * @param reference The child object to place this new one before
11067  * @return A box option bound to the recently added box item or @c
11068  * NULL, on errors
11069  *
11070  * On success, the @c "child,added" smart event will take place.
11071  *
11072  * @note This function will fail if @p reference is not a member of @p
11073  * o.
11074  *
11075  * @note The actual placing of the item relative to @p o's area will
11076  * depend on the layout set to it.
11077  *
11078  * @note This call will trigger the box's
11079  * _Evas_Object_Box_Api::insert_before smart function.
11080  */
11081 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);
11082
11083 /**
11084  * Insert a new @a child object <b>after another existing one</b>, in
11085  * a given box object @a o.
11086  *
11087  * @param o The given box object
11088  * @param child A child Evas object to be made a member of @p o
11089  * @param reference The child object to place this new one after
11090  * @return A box option bound to the recently added box item or @c
11091  * NULL, on errors
11092  *
11093  * On success, the @c "child,added" smart event will take place.
11094  *
11095  * @note This function will fail if @p reference is not a member of @p
11096  * o.
11097  *
11098  * @note The actual placing of the item relative to @p o's area will
11099  * depend on the layout set to it.
11100  *
11101  * @note This call will trigger the box's
11102  * _Evas_Object_Box_Api::insert_after smart function.
11103  */
11104 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);
11105
11106 /**
11107  * Insert a new @a child object <b>at a given position</b>, in a given
11108  * box object @a o.
11109  *
11110  * @param o The given box object
11111  * @param child A child Evas object to be made a member of @p o
11112  * @param pos The numeric position (starting from @c 0) to place the
11113  * new child object at
11114  * @return A box option bound to the recently added box item or @c
11115  * NULL, on errors
11116  *
11117  * On success, the @c "child,added" smart event will take place.
11118  *
11119  * @note This function will fail if the given position is invalid,
11120  * given @p o's internal list of elements.
11121  *
11122  * @note The actual placing of the item relative to @p o's area will
11123  * depend on the layout set to it.
11124  *
11125  * @note This call will trigger the box's
11126  * _Evas_Object_Box_Api::insert_at smart function.
11127  */
11128 EAPI Evas_Object_Box_Option    *evas_object_box_insert_at                             (Evas_Object *o, Evas_Object *child, unsigned int pos) EINA_ARG_NONNULL(1, 2);
11129
11130 /**
11131  * Remove a given object from a box object, unparenting it again.
11132  *
11133  * @param o The box object to remove a child object from
11134  * @param child The handle to the child object to be removed
11135  * @return @c EINA_TRUE, on success, @c EINA_FALSE otherwise
11136  *
11137  * On removal, you'll get an unparented object again, just as it was
11138  * before you inserted it in the box. The
11139  * _Evas_Object_Box_Api::option_free box smart callback will be called
11140  * automatically for you and, also, the @c "child,removed" smart event
11141  * will take place.
11142  *
11143  * @note This call will trigger the box's _Evas_Object_Box_Api::remove
11144  * smart function.
11145  */
11146 EAPI Eina_Bool                  evas_object_box_remove                                (Evas_Object *o, Evas_Object *child) EINA_ARG_NONNULL(1, 2);
11147
11148 /**
11149  * Remove an object, <b>bound to a given position</b> in a box object,
11150  * unparenting it again.
11151  *
11152  * @param o The box object to remove a child object from
11153  * @param in The numeric position (starting from @c 0) of the child
11154  * object to be removed
11155  * @return @c EINA_TRUE, on success, @c EINA_FALSE otherwise
11156  *
11157  * On removal, you'll get an unparented object again, just as it was
11158  * before you inserted it in the box. The @c option_free() box smart
11159  * callback will be called automatically for you and, also, the
11160  * @c "child,removed" smart event will take place.
11161  *
11162  * @note This function will fail if the given position is invalid,
11163  * given @p o's internal list of elements.
11164  *
11165  * @note This call will trigger the box's
11166  * _Evas_Object_Box_Api::remove_at smart function.
11167  */
11168 EAPI Eina_Bool                  evas_object_box_remove_at                             (Evas_Object *o, unsigned int pos) EINA_ARG_NONNULL(1);
11169
11170 /**
11171  * Remove @b all child objects from a box object, unparenting them
11172  * again.
11173  *
11174  * @param o The box object to remove a child object from
11175  * @param child The handle to the child object to be removed
11176  * @return @c EINA_TRUE, on success, @c EINA_FALSE otherwise
11177  *
11178  * This has the same effect of calling evas_object_box_remove() on
11179  * each of @p o's child objects, in sequence. If, and only if, all
11180  * those calls succeed, so does this one.
11181  */
11182 EAPI Eina_Bool                  evas_object_box_remove_all                            (Evas_Object *o, Eina_Bool clear) EINA_ARG_NONNULL(1);
11183
11184 /**
11185  * Get an iterator to walk the list of children of a given box object.
11186  *
11187  * @param o The box to retrieve an items iterator from
11188  * @return An iterator on @p o's child objects, on success, or @c NULL,
11189  * on errors
11190  *
11191  * @note Do @b not remove or delete objects while walking the list.
11192  */
11193 EAPI Eina_Iterator             *evas_object_box_iterator_new                          (const Evas_Object *o) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
11194
11195 /**
11196  * Get an accessor (a structure providing random items access) to the
11197  * list of children of a given box object.
11198  *
11199  * @param o The box to retrieve an items iterator from
11200  * @return An accessor on @p o's child objects, on success, or @c NULL,
11201  * on errors
11202  *
11203  * @note Do not remove or delete objects while walking the list.
11204  */
11205 EAPI Eina_Accessor             *evas_object_box_accessor_new                          (const Evas_Object *o) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
11206
11207 /**
11208  * Get the list of children objects in a given box object.
11209  *
11210  * @param o The box to retrieve an items list from
11211  * @return A list of @p o's child objects, on success, or @c NULL,
11212  * on errors (or if it has no child objects)
11213  *
11214  * The returned list should be freed with @c eina_list_free() when you
11215  * no longer need it.
11216  *
11217  * @note This is a duplicate of the list kept by the box internally.
11218  *       It's up to the user to destroy it when it no longer needs it.
11219  *       It's possible to remove objects from the box when walking
11220  *       this list, but these removals won't be reflected on it.
11221  */
11222 EAPI Eina_List                 *evas_object_box_children_get                          (const Evas_Object *o) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
11223
11224 /**
11225  * Get the name of the property of the child elements of the box @a o
11226  * which have @a id as identifier
11227  *
11228  * @param o The box to search child options from
11229  * @param id The numerical identifier of the option being searched, for
11230  * its name
11231  * @return The name of the given property or @c NULL, on errors.
11232  *
11233  * @note This call won't do anything for a canonical Evas box. Only
11234  * users which have @b subclassed it, setting custom box items options
11235  * (see #Evas_Object_Box_Option) on it, would benefit from this
11236  * function. They'd have to implement it and set it to be the
11237  * _Evas_Object_Box_Api::property_name_get smart class function of the
11238  * box, which is originally set to @c NULL.
11239  */
11240 EAPI const char                *evas_object_box_option_property_name_get              (Evas_Object *o, int property) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
11241
11242 /**
11243  * Get the numerical identifier of the property of the child elements
11244  * of the box @a o which have @a name as name string
11245  *
11246  * @param o The box to search child options from
11247  * @param name The name string of the option being searched, for
11248  * its ID
11249  * @return The numerical ID of the given property or @c -1, on
11250  * errors.
11251  *
11252  * @note This call won't do anything for a canonical Evas box. Only
11253  * users which have @b subclassed it, setting custom box items options
11254  * (see #Evas_Object_Box_Option) on it, would benefit from this
11255  * function. They'd have to implement it and set it to be the
11256  * _Evas_Object_Box_Api::property_id_get smart class function of the
11257  * box, which is originally set to @c NULL.
11258  */
11259 EAPI int                        evas_object_box_option_property_id_get                (Evas_Object *o, const char *name) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2);
11260
11261 /**
11262  * Set a property value (by its given numerical identifier), on a
11263  * given box child element
11264  *
11265  * @param o The box parenting the child element
11266  * @param opt The box option structure bound to the child box element
11267  * to set a property on
11268  * @param id The numerical ID of the given property
11269  * @param ... (List of) actual value(s) to be set for this
11270  * property. It (they) @b must be of the same type the user has
11271  * defined for it (them).
11272  * @return @c EINA_TRUE on success, @c EINA_FALSE on failure.
11273  *
11274  * @note This call won't do anything for a canonical Evas box. Only
11275  * users which have @b subclassed it, setting custom box items options
11276  * (see #Evas_Object_Box_Option) on it, would benefit from this
11277  * function. They'd have to implement it and set it to be the
11278  * _Evas_Object_Box_Api::property_set smart class function of the box,
11279  * which is originally set to @c NULL.
11280  *
11281  * @note This function will internally create a variable argument
11282  * list, with the values passed after @p property, and call
11283  * evas_object_box_option_property_vset() with this list and the same
11284  * previous arguments.
11285  */
11286 EAPI Eina_Bool                  evas_object_box_option_property_set                   (Evas_Object *o, Evas_Object_Box_Option *opt, int property, ...) EINA_ARG_NONNULL(1, 2);
11287
11288 /**
11289  * Set a property value (by its given numerical identifier), on a
11290  * given box child element -- by a variable argument list
11291  *
11292  * @param o The box parenting the child element
11293  * @param opt The box option structure bound to the child box element
11294  * to set a property on
11295  * @param id The numerical ID of the given property
11296  * @param va_list The variable argument list implementing the value to
11297  * be set for this property. It @b must be of the same type the user has
11298  * defined for it.
11299  * @return @c EINA_TRUE on success, @c EINA_FALSE on failure.
11300  *
11301  * This is a variable argument list variant of the
11302  * evas_object_box_option_property_set(). See its documentation for
11303  * more details.
11304  */
11305 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);
11306
11307 /**
11308  * Get a property's value (by its given numerical identifier), on a
11309  * given box child element
11310  *
11311  * @param o The box parenting the child element
11312  * @param opt The box option structure bound to the child box element
11313  * to get a property from
11314  * @param property The numerical ID of the given property
11315  * @param ... (List of) pointer(s) where to store the value(s) set for
11316  * this property. It (they) @b must point to variable(s) of the same
11317  * type the user has defined for it (them).
11318  * @return @c EINA_TRUE on success, @c EINA_FALSE on failure.
11319  *
11320  * @note This call won't do anything for a canonical Evas box. Only
11321  * users which have @b subclassed it, getting custom box items options
11322  * (see #Evas_Object_Box_Option) on it, would benefit from this
11323  * function. They'd have to implement it and get it to be the
11324  * _Evas_Object_Box_Api::property_get smart class function of the
11325  * box, which is originally get to @c NULL.
11326  *
11327  * @note This function will internally create a variable argument
11328  * list, with the values passed after @p property, and call
11329  * evas_object_box_option_property_vget() with this list and the same
11330  * previous arguments.
11331  */
11332 EAPI Eina_Bool                  evas_object_box_option_property_get                   (Evas_Object *o, Evas_Object_Box_Option *opt, int property, ...) EINA_ARG_NONNULL(1, 2);
11333
11334 /**
11335  * Get a property's value (by its given numerical identifier), on a
11336  * given box child element -- by a variable argument list
11337  *
11338  * @param o The box parenting the child element
11339  * @param opt The box option structure bound to the child box element
11340  * to get a property from
11341  * @param id The numerical ID of the given property
11342  * @param va_list The variable argument list with pointers to where to
11343  * store the values of this property. They @b must point to variables
11344  * of the same type the user has defined for them.
11345  * @return @c EINA_TRUE on success, @c EINA_FALSE on failure.
11346  *
11347  * This is a variable argument list variant of the
11348  * evas_object_box_option_property_get(). See its documentation for
11349  * more details.
11350  */
11351 EAPI Eina_Bool                  evas_object_box_option_property_vget                  (Evas_Object *o, Evas_Object_Box_Option *opt, int property, va_list args) EINA_ARG_NONNULL(1, 2);
11352
11353 /**
11354  * @}
11355  */
11356
11357 /**
11358  * @defgroup Evas_Object_Table Table Smart Object.
11359  *
11360  * Convenience smart object that packs children using a tabular
11361  * layout using children size hints to define their size and
11362  * alignment inside their cell space.
11363  *
11364  * @ref tutorial_table shows how to use this Evas_Object.
11365  *
11366  * @see @ref Evas_Object_Group_Size_Hints
11367  *
11368  * @ingroup Evas_Smart_Object_Group
11369  *
11370  * @{
11371  */
11372
11373 /**
11374  * @brief Create a new table.
11375  *
11376  * @param evas Canvas in which table will be added.
11377  */
11378 EAPI Evas_Object                        *evas_object_table_add             (Evas *evas) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
11379
11380 /**
11381  * @brief Create a table that is child of a given element @a parent.
11382  *
11383  * @see evas_object_table_add()
11384  */
11385 EAPI Evas_Object                        *evas_object_table_add_to          (Evas_Object *parent) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
11386
11387 /**
11388  * @brief Set how this table should layout children.
11389  *
11390  * @todo consider aspect hint and respect it.
11391  *
11392  * @par EVAS_OBJECT_TABLE_HOMOGENEOUS_NONE
11393  * If table does not use homogeneous mode then columns and rows will
11394  * be calculated based on hints of individual cells. This operation
11395  * mode is more flexible, but more complex and heavy to calculate as
11396  * well. @b Weight properties are handled as a boolean expand. Negative
11397  * alignment will be considered as 0.5. This is the default.
11398  *
11399  * @todo @c EVAS_OBJECT_TABLE_HOMOGENEOUS_NONE should balance weight.
11400  *
11401  * @par EVAS_OBJECT_TABLE_HOMOGENEOUS_TABLE
11402  * When homogeneous is relative to table the own table size is divided
11403  * equally among children, filling the whole table area. That is, if
11404  * table has @c WIDTH and @c COLUMNS, each cell will get <tt>WIDTH /
11405  * COLUMNS</tt> pixels. If children have minimum size that is larger
11406  * than this amount (including padding), then it will overflow and be
11407  * aligned respecting the alignment hint, possible overlapping sibling
11408  * cells. @b Weight hint is used as a boolean, if greater than zero it
11409  * will make the child expand in that axis, taking as much space as
11410  * possible (bounded to maximum size hint). Negative alignment will be
11411  * considered as 0.5.
11412  *
11413  * @par EVAS_OBJECT_TABLE_HOMOGENEOUS_ITEM
11414  * When homogeneous is relative to item it means the greatest minimum
11415  * cell size will be used. That is, if no element is set to expand,
11416  * the table will have its contents to a minimum size, the bounding
11417  * box of all these children will be aligned relatively to the table
11418  * object using evas_object_table_align_get(). If the table area is
11419  * too small to hold this minimum bounding box, then the objects will
11420  * keep their size and the bounding box will overflow the box area,
11421  * still respecting the alignment. @b Weight hint is used as a
11422  * boolean, if greater than zero it will make that cell expand in that
11423  * axis, toggling the <b>expand mode</b>, which makes the table behave
11424  * much like @b EVAS_OBJECT_TABLE_HOMOGENEOUS_TABLE, except that the
11425  * bounding box will overflow and items will not overlap siblings. If
11426  * no minimum size is provided at all then the table will fallback to
11427  * expand mode as well.
11428  */
11429 EAPI void                                evas_object_table_homogeneous_set (Evas_Object *o, Evas_Object_Table_Homogeneous_Mode homogeneous) EINA_ARG_NONNULL(1);
11430
11431 /**
11432  * Get the current layout homogeneous mode.
11433  *
11434  * @see evas_object_table_homogeneous_set()
11435  */
11436 EAPI Evas_Object_Table_Homogeneous_Mode  evas_object_table_homogeneous_get (const Evas_Object *o) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
11437
11438 /**
11439  * Set padding between cells.
11440  */
11441 EAPI void                                evas_object_table_padding_set     (Evas_Object *o, Evas_Coord horizontal, Evas_Coord vertical) EINA_ARG_NONNULL(1);
11442
11443 /**
11444  * Get padding between cells.
11445  */
11446 EAPI void                                evas_object_table_padding_get     (const Evas_Object *o, Evas_Coord *horizontal, Evas_Coord *vertical) EINA_ARG_NONNULL(1);
11447
11448 /**
11449  * Set the alignment of the whole bounding box of contents.
11450  */
11451 EAPI void                                evas_object_table_align_set       (Evas_Object *o, double horizontal, double vertical) EINA_ARG_NONNULL(1);
11452
11453 /**
11454  * Get alignment of the whole bounding box of contents.
11455  */
11456 EAPI void                                evas_object_table_align_get       (const Evas_Object *o, double *horizontal, double *vertical) EINA_ARG_NONNULL(1);
11457
11458 /**
11459  * Sets the mirrored mode of the table. In mirrored mode the table items go
11460  * from right to left instead of left to right. That is, 1,1 is top right, not
11461  * top left.
11462  *
11463  * @param obj The table object.
11464  * @param mirrored the mirrored mode to set
11465  * @since 1.1.0
11466  */
11467 EAPI void                                evas_object_table_mirrored_set    (Evas_Object *o, Eina_Bool mirrored) EINA_ARG_NONNULL(1);
11468
11469 /**
11470  * Gets the mirrored mode of the table.
11471  *
11472  * @param obj The table object.
11473  * @return EINA_TRUE if it's a mirrored table, EINA_FALSE otherwise.
11474  * @since 1.1.0
11475  * @see evas_object_table_mirrored_set()
11476  */
11477 EAPI Eina_Bool                           evas_object_table_mirrored_get    (const Evas_Object *o) EINA_ARG_NONNULL(1);
11478
11479 /**
11480  * Get packing location of a child of table
11481  *
11482  * @param o The given table object.
11483  * @param child The child object to add.
11484  * @param col pointer to store relative-horizontal position to place child.
11485  * @param row pointer to store relative-vertical position to place child.
11486  * @param colspan pointer to store how many relative-horizontal position to use for this child.
11487  * @param rowspan pointer to store how many relative-vertical position to use for this child.
11488  *
11489  * @return 1 on success, 0 on failure.
11490  * @since 1.1.0
11491  */
11492 EAPI Eina_Bool                           evas_object_table_pack_get(Evas_Object *o, Evas_Object *child, unsigned short *col, unsigned short *row, unsigned short *colspan, unsigned short *rowspan);
11493
11494 /**
11495  * Add a new child to a table object or set its current packing.
11496  *
11497  * @param o The given table object.
11498  * @param child The child object to add.
11499  * @param col relative-horizontal position to place child.
11500  * @param row relative-vertical position to place child.
11501  * @param colspan how many relative-horizontal position to use for this child.
11502  * @param rowspan how many relative-vertical position to use for this child.
11503  *
11504  * @return 1 on success, 0 on failure.
11505  */
11506 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);
11507
11508 /**
11509  * Remove child from table.
11510  *
11511  * @note removing a child will immediately call a walk over children in order
11512  *       to recalculate numbers of columns and rows. If you plan to remove
11513  *       all children, use evas_object_table_clear() instead.
11514  *
11515  * @return 1 on success, 0 on failure.
11516  */
11517 EAPI Eina_Bool                           evas_object_table_unpack          (Evas_Object *o, Evas_Object *child) EINA_ARG_NONNULL(1, 2);
11518
11519 /**
11520  * Faster way to remove all child objects from a table object.
11521  *
11522  * @param o The given table object.
11523  * @param clear if true, it will delete just removed children.
11524  */
11525 EAPI void                                evas_object_table_clear           (Evas_Object *o, Eina_Bool clear) EINA_ARG_NONNULL(1);
11526
11527 /**
11528  * Get the number of columns and rows this table takes.
11529  *
11530  * @note columns and rows are virtual entities, one can specify a table
11531  *       with a single object that takes 4 columns and 5 rows. The only
11532  *       difference for a single cell table is that paddings will be
11533  *       accounted proportionally.
11534  */
11535 EAPI void                                evas_object_table_col_row_size_get(const Evas_Object *o, int *cols, int *rows) EINA_ARG_NONNULL(1);
11536
11537 /**
11538  * Get an iterator to walk the list of children for the table.
11539  *
11540  * @note Do not remove or delete objects while walking the list.
11541  */
11542 EAPI Eina_Iterator                      *evas_object_table_iterator_new    (const Evas_Object *o) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
11543
11544 /**
11545  * Get an accessor to get random access to the list of children for the table.
11546  *
11547  * @note Do not remove or delete objects while walking the list.
11548  */
11549 EAPI Eina_Accessor                      *evas_object_table_accessor_new    (const Evas_Object *o) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
11550
11551 /**
11552  * Get the list of children for the table.
11553  *
11554  * @note This is a duplicate of the list kept by the table internally.
11555  *       It's up to the user to destroy it when it no longer needs it.
11556  *       It's possible to remove objects from the table when walking this
11557  *       list, but these removals won't be reflected on it.
11558  */
11559 EAPI Eina_List                          *evas_object_table_children_get    (const Evas_Object *o) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
11560
11561 /**
11562  * Get the child of the table at the given coordinates
11563  *
11564  * @note This does not take into account col/row spanning
11565  */
11566 EAPI Evas_Object                        *evas_object_table_child_get       (const Evas_Object *o, unsigned short col, unsigned short row) EINA_ARG_NONNULL(1);
11567 /**
11568  * @}
11569  */
11570
11571 /**
11572  * @defgroup Evas_Object_Grid Grid Smart Object.
11573  *
11574  * Convenience smart object that packs children under a regular grid
11575  * layout, using their virtual grid location and size to determine
11576  * children's positions inside the grid object's area.
11577  *
11578  * @ingroup Evas_Smart_Object_Group
11579  * @since 1.1.0
11580  */
11581
11582 /**
11583  * @addtogroup Evas_Object_Grid
11584  * @{
11585  */
11586
11587 /**
11588  * Create a new grid.
11589  *
11590  * It's set to a virtual size of 1x1 by default and add children with
11591  * evas_object_grid_pack().
11592  * @since 1.1.0
11593  */
11594 EAPI Evas_Object                        *evas_object_grid_add             (Evas *evas) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
11595
11596 /**
11597  * Create a grid that is child of a given element @a parent.
11598  *
11599  * @see evas_object_grid_add()
11600  * @since 1.1.0
11601  */
11602 EAPI Evas_Object                        *evas_object_grid_add_to          (Evas_Object *parent) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
11603
11604 /**
11605  * Set the virtual resolution for the grid
11606  *
11607  * @param o The grid object to modify
11608  * @param w The virtual horizontal size (resolution) in integer units
11609  * @param h The virtual vertical size (resolution) in integer units
11610  * @since 1.1.0
11611  */
11612 EAPI void                                evas_object_grid_size_set        (Evas_Object *o, int w, int h) EINA_ARG_NONNULL(1);
11613
11614 /**
11615  * Get the current virtual resolution
11616  *
11617  * @param o The grid object to query
11618  * @param w A pointer to an integer to store the virtual width
11619  * @param h A pointer to an integer to store the virtual height
11620  * @see evas_object_grid_size_set()
11621  * @since 1.1.0
11622  */
11623 EAPI void                                evas_object_grid_size_get        (const Evas_Object *o, int *w, int *h) EINA_ARG_NONNULL(1);
11624
11625 /**
11626  * Sets the mirrored mode of the grid. In mirrored mode the grid items go
11627  * from right to left instead of left to right. That is, 0,0 is top right, not
11628  * to left.
11629  *
11630  * @param obj The grid object.
11631  * @param mirrored the mirrored mode to set
11632  * @since 1.1.0
11633  */
11634 EAPI void                                evas_object_grid_mirrored_set    (Evas_Object *o, Eina_Bool mirrored) EINA_ARG_NONNULL(1);
11635
11636 /**
11637  * Gets the mirrored mode of the grid.
11638  *
11639  * @param obj The grid object.
11640  * @return EINA_TRUE if it's a mirrored grid, EINA_FALSE otherwise.
11641  * @see evas_object_grid_mirrored_set()
11642  * @since 1.1.0
11643  */
11644 EAPI Eina_Bool                           evas_object_grid_mirrored_get    (const Evas_Object *o) EINA_ARG_NONNULL(1);
11645
11646 /**
11647  * Add a new child to a grid object.
11648  *
11649  * @param o The given grid object.
11650  * @param child The child object to add.
11651  * @param x The virtual x coordinate of the child
11652  * @param y The virtual y coordinate of the child
11653  * @param w The virtual width of the child
11654  * @param h The virtual height of the child
11655  * @return 1 on success, 0 on failure.
11656  * @since 1.1.0
11657  */
11658 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);
11659
11660 /**
11661  * Remove child from grid.
11662  *
11663  * @note removing a child will immediately call a walk over children in order
11664  *       to recalculate numbers of columns and rows. If you plan to remove
11665  *       all children, use evas_object_grid_clear() instead.
11666  *
11667  * @return 1 on success, 0 on failure.
11668  * @since 1.1.0
11669  */
11670 EAPI Eina_Bool                           evas_object_grid_unpack          (Evas_Object *o, Evas_Object *child) EINA_ARG_NONNULL(1, 2);
11671
11672 /**
11673  * Faster way to remove all child objects from a grid object.
11674  *
11675  * @param o The given grid object.
11676  * @param clear if true, it will delete just removed children.
11677  * @since 1.1.0
11678  */
11679 EAPI void                                evas_object_grid_clear           (Evas_Object *o, Eina_Bool clear) EINA_ARG_NONNULL(1);
11680
11681 /**
11682  * Get the pack options for a grid child
11683  *
11684  * Get the pack x, y, width and height in virtual coordinates set by
11685  * evas_object_grid_pack()
11686  * @param o The grid object
11687  * @param child The grid child to query for coordinates
11688  * @param x The pointer to where the x coordinate will be returned
11689  * @param y The pointer to where the y coordinate will be returned
11690  * @param w The pointer to where the width will be returned
11691  * @param h The pointer to where the height will be returned
11692  * @return 1 on success, 0 on failure.
11693  * @since 1.1.0
11694  */
11695 EAPI Eina_Bool                           evas_object_grid_pack_get        (Evas_Object *o, Evas_Object *child, int *x, int *y, int *w, int *h);
11696
11697 /**
11698  * Get an iterator to walk the list of children for the grid.
11699  *
11700  * @note Do not remove or delete objects while walking the list.
11701  * @since 1.1.0
11702  */
11703 EAPI Eina_Iterator                      *evas_object_grid_iterator_new    (const Evas_Object *o) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
11704
11705 /**
11706  * Get an accessor to get random access to the list of children for the grid.
11707  *
11708  * @note Do not remove or delete objects while walking the list.
11709  * @since 1.1.0
11710  */
11711 EAPI Eina_Accessor                      *evas_object_grid_accessor_new    (const Evas_Object *o) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
11712
11713 /**
11714  * Get the list of children for the grid.
11715  *
11716  * @note This is a duplicate of the list kept by the grid internally.
11717  *       It's up to the user to destroy it when it no longer needs it.
11718  *       It's possible to remove objects from the grid when walking this
11719  *       list, but these removals won't be reflected on it.
11720  * @since 1.1.0
11721  */
11722 EAPI Eina_List                          *evas_object_grid_children_get    (const Evas_Object *o) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
11723
11724 /**
11725  * @}
11726  */
11727
11728 /**
11729  * @defgroup Evas_Cserve Shared Image Cache Server
11730  *
11731  * Evas has an (optional) module which provides client-server
11732  * infrastructure to <b>share bitmaps across multiple processes</b>,
11733  * saving data and processing power.
11734  *
11735  * Be warned that it @b doesn't work when <b>threaded image
11736  * preloading</b> is enabled for Evas, though.
11737  */
11738    typedef struct _Evas_Cserve_Stats       Evas_Cserve_Stats;
11739    typedef struct _Evas_Cserve_Image_Cache Evas_Cserve_Image_Cache;
11740    typedef struct _Evas_Cserve_Image       Evas_Cserve_Image;
11741    typedef struct _Evas_Cserve_Config      Evas_Cserve_Config;
11742
11743 /**
11744  * Statistics about the server that shares cached bitmaps.
11745  * @ingroup Evas_Cserve
11746  */
11747    struct _Evas_Cserve_Stats
11748      {
11749         int    saved_memory; /**< current amount of saved memory, in bytes */
11750         int    wasted_memory; /**< current amount of wasted memory, in bytes */
11751         int    saved_memory_peak; /**< peak amount of saved memory, in bytes */
11752         int    wasted_memory_peak; /**< peak amount of wasted memory, in bytes */
11753         double saved_time_image_header_load; /**< time, in seconds, saved in header loads by sharing cached loads instead */
11754         double saved_time_image_data_load; /**< time, in seconds, saved in data loads by sharing cached loads instead */
11755      };
11756
11757 /**
11758  * A handle of a cache of images shared by a server.
11759  * @ingroup Evas_Cserve
11760  */
11761    struct _Evas_Cserve_Image_Cache
11762      {
11763         struct {
11764            int     mem_total;
11765            int     count;
11766         } active, cached;
11767         Eina_List *images;
11768      };
11769
11770 /**
11771  * A handle to an image shared by a server.
11772  * @ingroup Evas_Cserve
11773  */
11774    struct _Evas_Cserve_Image
11775      {
11776         const char *file, *key;
11777         int         w, h;
11778         time_t      file_mod_time;
11779         time_t      file_checked_time;
11780         time_t      cached_time;
11781         int         refcount;
11782         int         data_refcount;
11783         int         memory_footprint;
11784         double      head_load_time;
11785         double      data_load_time;
11786         Eina_Bool   alpha : 1;
11787         Eina_Bool   data_loaded : 1;
11788         Eina_Bool   active : 1;
11789         Eina_Bool   dead : 1;
11790         Eina_Bool   useless : 1;
11791      };
11792
11793 /**
11794  * Configuration that controls the server that shares cached bitmaps.
11795  * @ingroup Evas_Cserve
11796  */
11797     struct _Evas_Cserve_Config
11798      {
11799         int cache_max_usage;
11800         int cache_item_timeout;
11801         int cache_item_timeout_check;
11802      };
11803
11804
11805 /**
11806  * Retrieves if the system wants to share bitmaps using the server.
11807  * @return @c EINA_TRUE if it wants, @c EINA_FALSE otherwise.
11808  * @ingroup Evas_Cserve
11809  */
11810 EAPI Eina_Bool         evas_cserve_want_get                   (void) EINA_WARN_UNUSED_RESULT;
11811
11812 /**
11813  * Retrieves if the system is connected to the server used to share
11814  * bitmaps.
11815  *
11816  * @return @c EINA_TRUE if it's connected, @c EINA_FALSE otherwise.
11817  * @ingroup Evas_Cserve
11818  */
11819 EAPI Eina_Bool         evas_cserve_connected_get              (void) EINA_WARN_UNUSED_RESULT;
11820
11821 /**
11822  * Retrieves statistics from a running bitmap sharing server.
11823  * @param stats pointer to structure to fill with statistics about the
11824  *        bitmap cache server.
11825  *
11826  * @return @c EINA_TRUE if @p stats were filled with data,
11827  *         @c EINA_FALSE otherwise (when @p stats is untouched)
11828  * @ingroup Evas_Cserve
11829  */
11830 EAPI Eina_Bool         evas_cserve_stats_get                  (Evas_Cserve_Stats *stats) EINA_WARN_UNUSED_RESULT;
11831
11832 /**
11833  * Completely discard/clean a given images cache, thus re-setting it.
11834  *
11835  * @param cache A handle to the given images cache.
11836  */
11837 EAPI void              evas_cserve_image_cache_contents_clean (Evas_Cserve_Image_Cache *cache);
11838
11839 /**
11840  * Retrieves the current configuration of the Evas image caching
11841  * server.
11842  *
11843  * @param config where to store current image caching server's
11844  * configuration.
11845  *
11846  * @return @c EINA_TRUE if @p config was filled with data,
11847  *         @c EINA_FALSE otherwise (when @p config is untouched)
11848  *
11849  * The fields of @p config will be altered to reflect the current
11850  * configuration's values.
11851  *
11852  * @see evas_cserve_config_set()
11853  *
11854  * @ingroup Evas_Cserve
11855  */
11856 EAPI Eina_Bool         evas_cserve_config_get                 (Evas_Cserve_Config *config) EINA_WARN_UNUSED_RESULT;
11857
11858 /**
11859  * Changes the configurations of the Evas image caching server.
11860  *
11861  * @param config A bitmap cache configuration handle with fields set
11862  * to desired configuration values.
11863  * @return @c EINA_TRUE if @p config was successfully applied,
11864  *         @c EINA_FALSE otherwise.
11865  *
11866  * @see evas_cserve_config_get()
11867  *
11868  * @ingroup Evas_Cserve
11869  */
11870 EAPI Eina_Bool         evas_cserve_config_set                 (const Evas_Cserve_Config *config) EINA_WARN_UNUSED_RESULT;
11871
11872 /**
11873  * Force the system to disconnect from the bitmap caching server.
11874  *
11875  * @ingroup Evas_Cserve
11876  */
11877 EAPI void              evas_cserve_disconnect                 (void);
11878
11879 /**
11880  * @defgroup Evas_Utils General Utilities
11881  *
11882  * Some functions that are handy but are not specific of canvas or
11883  * objects.
11884  */
11885
11886 /**
11887  * Converts the given Evas image load error code into a string
11888  * describing it in english.
11889  *
11890  * @param error the error code, a value in ::Evas_Load_Error.
11891  * @return Always returns a valid string. If the given @p error is not
11892  *         supported, <code>"Unknown error"</code> is returned.
11893  *
11894  * Mostly evas_object_image_file_set() would be the function setting
11895  * that error value afterwards, but also evas_object_image_load(),
11896  * evas_object_image_save(), evas_object_image_data_get(),
11897  * evas_object_image_data_convert(), evas_object_image_pixels_import()
11898  * and evas_object_image_is_inside(). This function is meant to be
11899  * used in conjunction with evas_object_image_load_error_get(), as in:
11900  *
11901  * Example code:
11902  * @dontinclude evas-load-error-str.c
11903  * @skip img1 =
11904  * @until ecore_main_loop_begin(
11905  *
11906  * Here, being @c valid_path the path to a valid image and @c
11907  * bogus_path a path to a file which does not exist, the two outputs
11908  * of evas_load_error_str() would be (if no other errors occur):
11909  * <code>"No error on load"</code> and <code>"File (or file path) does
11910  * not exist"</code>, respectively. See the full @ref
11911  * Example_Evas_Images "example".
11912  *
11913  * @ingroup Evas_Utils
11914  */
11915 EAPI const char       *evas_load_error_str               (Evas_Load_Error error);
11916
11917 /* Evas utility routines for color space conversions */
11918 /* hsv color space has h in the range 0.0 to 360.0, and s,v in the range 0.0 to 1.0 */
11919 /* rgb color space has r,g,b in the range 0 to 255 */
11920
11921 /**
11922  * Convert a given color from HSV to RGB format.
11923  *
11924  * @param h The Hue component of the color.
11925  * @param s The Saturation component of the color.
11926  * @param v The Value component of the color.
11927  * @param r The Red component of the color.
11928  * @param g The Green component of the color.
11929  * @param b The Blue component of the color.
11930  *
11931  * This function converts a given color in HSV color format to RGB
11932  * color format.
11933  *
11934  * @ingroup Evas_Utils
11935  **/
11936 EAPI void              evas_color_hsv_to_rgb             (float h, float s, float v, int *r, int *g, int *b);
11937
11938 /**
11939  * Convert a given color from RGB to HSV format.
11940  *
11941  * @param r The Red component of the color.
11942  * @param g The Green component of the color.
11943  * @param b The Blue component of the color.
11944  * @param h The Hue component of the color.
11945  * @param s The Saturation component of the color.
11946  * @param v The Value component of the color.
11947  *
11948  * This function converts a given color in RGB color format to HSV
11949  * color format.
11950  *
11951  * @ingroup Evas_Utils
11952  **/
11953 EAPI void              evas_color_rgb_to_hsv             (int r, int g, int b, float *h, float *s, float *v);
11954
11955 /* argb color space has a,r,g,b in the range 0 to 255 */
11956
11957 /**
11958  * Pre-multiplies a rgb triplet by an alpha factor.
11959  *
11960  * @param a The alpha factor.
11961  * @param r The Red component of the color.
11962  * @param g The Green component of the color.
11963  * @param b The Blue component of the color.
11964  *
11965  * This function pre-multiplies a given rgb triplet by an alpha
11966  * factor. Alpha factor is used to define transparency.
11967  *
11968  * @ingroup Evas_Utils
11969  **/
11970 EAPI void              evas_color_argb_premul            (int a, int *r, int *g, int *b);
11971
11972 /**
11973  * Undo pre-multiplication of a rgb triplet by an alpha factor.
11974  *
11975  * @param a The alpha factor.
11976  * @param r The Red component of the color.
11977  * @param g The Green component of the color.
11978  * @param b The Blue component of the color.
11979  *
11980  * This function undoes pre-multiplication a given rbg triplet by an
11981  * alpha factor. Alpha factor is used to define transparency.
11982  *
11983  * @see evas_color_argb_premul().
11984  *
11985  * @ingroup Evas_Utils
11986  **/
11987 EAPI void              evas_color_argb_unpremul          (int a, int *r, int *g, int *b);
11988
11989
11990 /**
11991  * Pre-multiplies data by an alpha factor.
11992  *
11993  * @param data The data value.
11994  * @param len  The length value.
11995  *
11996  * This function pre-multiplies a given data by an alpha
11997  * factor. Alpha factor is used to define transparency.
11998  *
11999  * @ingroup Evas_Utils
12000  **/
12001 EAPI void              evas_data_argb_premul             (unsigned int *data, unsigned int len);
12002
12003 /**
12004  * Undo pre-multiplication data by an alpha factor.
12005  *
12006  * @param data The data value.
12007  * @param len  The length value.
12008  *
12009  * This function undoes pre-multiplication of a given data by an alpha
12010  * factor. Alpha factor is used to define transparency.
12011  *
12012  * @ingroup Evas_Utils
12013  **/
12014 EAPI void              evas_data_argb_unpremul           (unsigned int *data, unsigned int len);
12015
12016 /* string and font handling */
12017
12018 /**
12019  * Gets the next character in the string
12020  *
12021  * Given the UTF-8 string in @p str, and starting byte position in @p pos,
12022  * this function will place in @p decoded the decoded code point at @p pos
12023  * and return the byte index for the next character in the string.
12024  *
12025  * The only boundary check done is that @p pos must be >= 0. Other than that,
12026  * no checks are performed, so passing an index value that's not within the
12027  * length of the string will result in undefined behavior.
12028  *
12029  * @param str The UTF-8 string
12030  * @param pos The byte index where to start
12031  * @param decoded Address where to store the decoded code point. Optional.
12032  *
12033  * @return The byte index of the next character
12034  *
12035  * @ingroup Evas_Utils
12036  */
12037 EAPI int               evas_string_char_next_get         (const char *str, int pos, int *decoded) EINA_ARG_NONNULL(1);
12038
12039 /**
12040  * Gets the previous character in the string
12041  *
12042  * Given the UTF-8 string in @p str, and starting byte position in @p pos,
12043  * this function will place in @p decoded the decoded code point at @p pos
12044  * and return the byte index for the previous character in the string.
12045  *
12046  * The only boundary check done is that @p pos must be >= 1. Other than that,
12047  * no checks are performed, so passing an index value that's not within the
12048  * length of the string will result in undefined behavior.
12049  *
12050  * @param str The UTF-8 string
12051  * @param pos The byte index where to start
12052  * @param decoded Address where to store the decoded code point. Optional.
12053  *
12054  * @return The byte index of the previous character
12055  *
12056  * @ingroup Evas_Utils
12057  */
12058 EAPI int               evas_string_char_prev_get         (const char *str, int pos, int *decoded) EINA_ARG_NONNULL(1);
12059
12060 /**
12061  * Get the length in characters of the string.
12062  * @param  str The string to get the length of.
12063  * @return The length in characters (not bytes)
12064  * @ingroup Evas_Utils
12065  */
12066 EAPI int               evas_string_char_len_get          (const char *str) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
12067
12068 /**
12069  * @defgroup Evas_Keys Key Input Functions
12070  *
12071  * Functions which feed key events to the canvas.
12072  *
12073  * As explained in @ref intro_not_evas, Evas is @b not aware of input
12074  * systems at all. Then, the user, if using it crudely (evas_new()),
12075  * will have to feed it with input events, so that it can react
12076  * somehow. If, however, the user creates a canvas by means of the
12077  * Ecore_Evas wrapper, it will automatically bind the chosen display
12078  * engine's input events to the canvas, for you.
12079  *
12080  * This group presents the functions dealing with the feeding of key
12081  * events to the canvas. On most of them, one has to reference a given
12082  * key by a name (<code>keyname</code> argument). Those are
12083  * <b>platform dependent</b> symbolic names for the keys. Sometimes
12084  * you'll get the right <code>keyname</code> by simply using an ASCII
12085  * value of the key name, but it won't be like that always.
12086  *
12087  * Typical platforms are Linux frame buffer (Ecore_FB) and X server
12088  * (Ecore_X) when using Evas with Ecore and Ecore_Evas. Please refer
12089  * to your display engine's documentation when using evas through an
12090  * Ecore helper wrapper when you need the <code>keyname</code>s.
12091  *
12092  * Example:
12093  * @dontinclude evas-events.c
12094  * @skip mods = evas_key_modifier_get(evas);
12095  * @until {
12096  *
12097  * All the other @c evas_key functions behave on the same manner. See
12098  * the full @ref Example_Evas_Events "example".
12099  *
12100  * @ingroup Evas_Canvas
12101  */
12102
12103 /**
12104  * @addtogroup Evas_Keys
12105  * @{
12106  */
12107
12108 /**
12109  * Returns a handle to the list of modifier keys registered in the
12110  * canvas @p e. This is required to check for which modifiers are set
12111  * at a given time with the evas_key_modifier_is_set() function.
12112  *
12113  * @param e The pointer to the Evas canvas
12114  *
12115  * @see evas_key_modifier_add
12116  * @see evas_key_modifier_del
12117  * @see evas_key_modifier_on
12118  * @see evas_key_modifier_off
12119  * @see evas_key_modifier_is_set
12120  *
12121  * @return An ::Evas_Modifier handle to query Evas' keys subsystem
12122  *      with evas_key_modifier_is_set(), or @c NULL on error.
12123  */
12124 EAPI const Evas_Modifier *evas_key_modifier_get          (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
12125
12126 /**
12127  * Returns a handle to the list of lock keys registered in the canvas
12128  * @p e. This is required to check for which locks are set at a given
12129  * time with the evas_key_lock_is_set() function.
12130  *
12131  * @param e The pointer to the Evas canvas
12132  *
12133  * @see evas_key_lock_add
12134  * @see evas_key_lock_del
12135  * @see evas_key_lock_on
12136  * @see evas_key_lock_off
12137  * @see evas_key_lock_is_set
12138  *
12139  * @return An ::Evas_Lock handle to query Evas' keys subsystem with
12140  *      evas_key_lock_is_set(), or @c NULL on error.
12141  */
12142 EAPI const Evas_Lock     *evas_key_lock_get              (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
12143
12144
12145 /**
12146  * Checks the state of a given modifier key, at the time of the
12147  * call. If the modifier is set, such as shift being pressed, this
12148  * function returns @c Eina_True.
12149  *
12150  * @param m The current modifiers set, as returned by
12151  *        evas_key_modifier_get().
12152  * @param keyname The name of the modifier key to check status for.
12153  *
12154  * @return @c Eina_True if the modifier key named @p keyname is on, @c
12155  *         Eina_False otherwise.
12156  *
12157  * @see evas_key_modifier_add
12158  * @see evas_key_modifier_del
12159  * @see evas_key_modifier_get
12160  * @see evas_key_modifier_on
12161  * @see evas_key_modifier_off
12162  */
12163 EAPI Eina_Bool            evas_key_modifier_is_set       (const Evas_Modifier *m, const char *keyname) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2);
12164
12165
12166 /**
12167  * Checks the state of a given lock key, at the time of the call. If
12168  * the lock is set, such as caps lock, this function returns @c
12169  * Eina_True.
12170  *
12171  * @param l The current locks set, as returned by evas_key_lock_get().
12172  * @param keyname The name of the lock key to check status for.
12173  *
12174  * @return @c Eina_True if the @p keyname lock key is set, @c
12175  *        Eina_False otherwise.
12176  *
12177  * @see evas_key_lock_get
12178  * @see evas_key_lock_add
12179  * @see evas_key_lock_del
12180  * @see evas_key_lock_on
12181  * @see evas_key_lock_off
12182  */
12183 EAPI Eina_Bool            evas_key_lock_is_set           (const Evas_Lock *l, const char *keyname) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2);
12184
12185
12186 /**
12187  * Adds the @p keyname key to the current list of modifier keys.
12188  *
12189  * @param e The pointer to the Evas canvas
12190  * @param keyname The name of the modifier key to add to the list of
12191  *        Evas modifiers.
12192  *
12193  * Modifiers are keys like shift, alt and ctrl, i.e., keys which are
12194  * meant to be pressed together with others, altering the behavior of
12195  * the secondly pressed keys somehow. Evas is so that these keys can
12196  * be user defined.
12197  *
12198  * This call allows custom modifiers to be added to the Evas system at
12199  * run time. It is then possible to set and unset modifier keys
12200  * programmatically for other parts of the program to check and act
12201  * on. Programmers using Evas would check for modifier keys on key
12202  * event callbacks using evas_key_modifier_is_set().
12203  *
12204  * @see evas_key_modifier_del
12205  * @see evas_key_modifier_get
12206  * @see evas_key_modifier_on
12207  * @see evas_key_modifier_off
12208  * @see evas_key_modifier_is_set
12209  *
12210  * @note If the programmer instantiates the canvas by means of the
12211  *       ecore_evas_new() family of helper functions, Ecore will take
12212  *       care of registering on it all standard modifiers: "Shift",
12213  *       "Control", "Alt", "Meta", "Hyper", "Super".
12214  */
12215 EAPI void                 evas_key_modifier_add          (Evas *e, const char *keyname) EINA_ARG_NONNULL(1, 2);
12216
12217 /**
12218  * Removes the @p keyname key from the current list of modifier keys
12219  * on canvas @p e.
12220  *
12221  * @param e The pointer to the Evas canvas
12222  * @param keyname The name of the key to remove from the modifiers list.
12223  *
12224  * @see evas_key_modifier_add
12225  * @see evas_key_modifier_get
12226  * @see evas_key_modifier_on
12227  * @see evas_key_modifier_off
12228  * @see evas_key_modifier_is_set
12229  */
12230 EAPI void                 evas_key_modifier_del          (Evas *e, const char *keyname) EINA_ARG_NONNULL(1, 2);
12231
12232 /**
12233  * Adds the @p keyname key to the current list of lock keys.
12234  *
12235  * @param e The pointer to the Evas canvas
12236  * @param keyname The name of the key to add to the locks list.
12237  *
12238  * Locks are keys like caps lock, num lock or scroll lock, i.e., keys
12239  * which are meant to be pressed once -- toggling a binary state which
12240  * is bound to it -- and thus altering the behavior of all
12241  * subsequently pressed keys somehow, depending on its state. Evas is
12242  * so that these keys can be defined by the user.
12243  *
12244  * This allows custom locks to be added to the evas system at run
12245  * time. It is then possible to set and unset lock keys
12246  * programmatically for other parts of the program to check and act
12247  * on. Programmers using Evas would check for lock keys on key event
12248  * callbacks using evas_key_lock_is_set().
12249  *
12250  * @see evas_key_lock_get
12251  * @see evas_key_lock_del
12252  * @see evas_key_lock_on
12253  * @see evas_key_lock_off
12254  * @see evas_key_lock_is_set
12255  *
12256  * @note If the programmer instantiates the canvas by means of the
12257  *       ecore_evas_new() family of helper functions, Ecore will take
12258  *       care of registering on it all standard lock keys: "Caps_Lock",
12259  *       "Num_Lock", "Scroll_Lock".
12260  */
12261 EAPI void                 evas_key_lock_add              (Evas *e, const char *keyname) EINA_ARG_NONNULL(1, 2);
12262
12263 /**
12264  * Removes the @p keyname key from the current list of lock keys on
12265  * canvas @p e.
12266  *
12267  * @param e The pointer to the Evas canvas
12268  * @param keyname The name of the key to remove from the locks list.
12269  *
12270  * @see evas_key_lock_get
12271  * @see evas_key_lock_add
12272  * @see evas_key_lock_on
12273  * @see evas_key_lock_off
12274  */
12275 EAPI void                 evas_key_lock_del              (Evas *e, const char *keyname) EINA_ARG_NONNULL(1, 2);
12276
12277
12278 /**
12279  * Enables or turns on programmatically the modifier key with name @p
12280  * keyname.
12281  *
12282  * @param e The pointer to the Evas canvas
12283  * @param keyname The name of the modifier to enable.
12284  *
12285  * The effect will be as if the key was pressed for the whole time
12286  * between this call and a matching evas_key_modifier_off().
12287  *
12288  * @see evas_key_modifier_add
12289  * @see evas_key_modifier_get
12290  * @see evas_key_modifier_off
12291  * @see evas_key_modifier_is_set
12292  */
12293 EAPI void                 evas_key_modifier_on           (Evas *e, const char *keyname) EINA_ARG_NONNULL(1, 2);
12294
12295 /**
12296  * Disables or turns off programmatically the modifier key with name
12297  * @p keyname.
12298  *
12299  * @param e The pointer to the Evas canvas
12300  * @param keyname The name of the modifier to disable.
12301  *
12302  * @see evas_key_modifier_add
12303  * @see evas_key_modifier_get
12304  * @see evas_key_modifier_on
12305  * @see evas_key_modifier_is_set
12306  */
12307 EAPI void                 evas_key_modifier_off          (Evas *e, const char *keyname) EINA_ARG_NONNULL(1, 2);
12308
12309 /**
12310  * Enables or turns on programmatically the lock key with name @p
12311  * keyname.
12312  *
12313  * @param e The pointer to the Evas canvas
12314  * @param keyname The name of the lock to enable.
12315  *
12316  * The effect will be as if the key was put on its active state after
12317  * this call.
12318  *
12319  * @see evas_key_lock_get
12320  * @see evas_key_lock_add
12321  * @see evas_key_lock_del
12322  * @see evas_key_lock_off
12323  */
12324 EAPI void                 evas_key_lock_on               (Evas *e, const char *keyname) EINA_ARG_NONNULL(1, 2);
12325
12326 /**
12327  * Disables or turns off programmatically the lock key with name @p
12328  * keyname.
12329  *
12330  * @param e The pointer to the Evas canvas
12331  * @param keyname The name of the lock to disable.
12332  *
12333  * The effect will be as if the key was put on its inactive state
12334  * after this call.
12335  *
12336  * @see evas_key_lock_get
12337  * @see evas_key_lock_add
12338  * @see evas_key_lock_del
12339  * @see evas_key_lock_on
12340  */
12341 EAPI void                 evas_key_lock_off              (Evas *e, const char *keyname) EINA_ARG_NONNULL(1, 2);
12342
12343
12344 /**
12345  * Creates a bit mask from the @p keyname @b modifier key. Values
12346  * returned from different calls to it may be ORed together,
12347  * naturally.
12348  *
12349  * @param e The canvas whom to query the bit mask from.
12350  * @param keyname The name of the modifier key to create the mask for.
12351  *
12352  * @returns the bit mask or 0 if the @p keyname key wasn't registered as a
12353  *          modifier for canvas @p e.
12354  *
12355  * This function is meant to be using in conjunction with
12356  * evas_object_key_grab()/evas_object_key_ungrab(). Go check their
12357  * documentation for more information.
12358  *
12359  * @see evas_key_modifier_add
12360  * @see evas_key_modifier_get
12361  * @see evas_key_modifier_on
12362  * @see evas_key_modifier_off
12363  * @see evas_key_modifier_is_set
12364  * @see evas_object_key_grab
12365  * @see evas_object_key_ungrab
12366  */
12367 EAPI Evas_Modifier_Mask   evas_key_modifier_mask_get     (const Evas *e, const char *keyname) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2);
12368
12369
12370 /**
12371  * Requests @p keyname key events be directed to @p obj.
12372  *
12373  * @param obj the object to direct @p keyname events to.
12374  * @param keyname the key to request events for.
12375  * @param modifiers a mask of modifiers that must be present to
12376  * trigger the event.
12377  * @param not_modifiers a mask of modifiers that must @b not be present
12378  * to trigger the event.
12379  * @param exclusive request that the @p obj is the only object
12380  * receiving the @p keyname events.
12381  * @return @c EINA_TRUE, if the call succeeded, @c EINA_FALSE otherwise.
12382  *
12383  * Key grabs allow one or more objects to receive key events for
12384  * specific key strokes even if other objects have focus. Whenever a
12385  * key is grabbed, only the objects grabbing it will get the events
12386  * for the given keys.
12387  *
12388  * @p keyname is a platform dependent symbolic name for the key
12389  * pressed (see @ref Evas_Keys for more information).
12390  *
12391  * @p modifiers and @p not_modifiers are bit masks of all the
12392  * modifiers that must and mustn't, respectively, be pressed along
12393  * with @p keyname key in order to trigger this new key
12394  * grab. Modifiers can be things such as Shift and Ctrl as well as
12395  * user defined types via evas_key_modifier_add(). Retrieve them with
12396  * evas_key_modifier_mask_get() or use @c 0 for empty masks.
12397  *
12398  * @p exclusive will make the given object the only one permitted to
12399  * grab the given key. If given @c EINA_TRUE, subsequent calls on this
12400  * function with different @p obj arguments will fail, unless the key
12401  * is ungrabbed again.
12402  *
12403  * Example code follows.
12404  * @dontinclude evas-events.c
12405  * @skip if (d.focus)
12406  * @until else
12407  *
12408  * See the full example @ref Example_Evas_Events "here".
12409  *
12410  * @see evas_object_key_ungrab
12411  * @see evas_object_focus_set
12412  * @see evas_object_focus_get
12413  * @see evas_focus_get
12414  * @see evas_key_modifier_add
12415  */
12416 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);
12417
12418 /**
12419  * Removes the grab on @p keyname key events by @p obj.
12420  *
12421  * @param obj the object that has an existing key grab.
12422  * @param keyname the key the grab is set for.
12423  * @param modifiers a mask of modifiers that must be present to
12424  * trigger the event.
12425  * @param not_modifiers a mask of modifiers that must not not be
12426  * present to trigger the event.
12427  *
12428  * Removes a key grab on @p obj if @p keyname, @p modifiers, and @p
12429  * not_modifiers match.
12430  *
12431  * Example code follows.
12432  * @dontinclude evas-events.c
12433  * @skip got here by key grabs
12434  * @until }
12435  *
12436  * See the full example @ref Example_Evas_Events "here".
12437  *
12438  * @see evas_object_key_grab
12439  * @see evas_object_focus_set
12440  * @see evas_object_focus_get
12441  * @see evas_focus_get
12442  */
12443 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);
12444
12445 /**
12446  * @}
12447  */
12448
12449 /**
12450  * @defgroup Evas_Touch_Point_List Touch Point List Functions
12451  *
12452  * Functions to get information of touched points in the Evas.
12453  *
12454  * Evas maintains list of touched points on the canvas. Each point has
12455  * its co-ordinates, id and state. You can get the number of touched
12456  * points and information of each point using evas_touch_point_list
12457  * functions.
12458  *
12459  * @ingroup Evas_Canvas
12460  */
12461
12462 /**
12463  * @addtogroup Evas_Touch_Point_List
12464  * @{
12465  */
12466
12467 /**
12468  * Get the number of touched point in the evas.
12469  *
12470  * @param e The pointer to the Evas canvas.
12471  * @return The number of touched point on the evas.
12472  *
12473  * New touched point is added to the list whenever touching the evas
12474  * and point is removed whenever removing touched point from the evas.
12475  *
12476  * Example:
12477  * @code
12478  * extern Evas *evas;
12479  * int count;
12480  *
12481  * count = evas_touch_point_list_count(evas);
12482  * printf("The count of touch points: %i\n", count);
12483  * @endcode
12484  *
12485  * @see evas_touch_point_list_nth_xy_get()
12486  * @see evas_touch_point_list_nth_id_get()
12487  * @see evas_touch_point_list_nth_state_get()
12488  */
12489 EAPI unsigned int           evas_touch_point_list_count(Evas *e) EINA_ARG_NONNULL(1);
12490
12491 /**
12492  * This function returns the nth touch point's co-ordinates.
12493  *
12494  * @param e The pointer to the Evas canvas.
12495  * @param n The number of the touched point (0 being the first).
12496  * @param x The pointer to a Evas_Coord to be filled in.
12497  * @param y The pointer to a Evas_Coord to be filled in.
12498  *
12499  * Touch point's co-ordinates is updated whenever moving that point
12500  * on the canvas.
12501  *
12502  * Example:
12503  * @code
12504  * extern Evas *evas;
12505  * Evas_Coord x, y;
12506  *
12507  * if (evas_touch_point_list_count(evas))
12508  *   {
12509  *      evas_touch_point_nth_xy_get(evas, 0, &x, &y);
12510  *      printf("The first touch point's co-ordinate: (%i, %i)\n", x, y);
12511  *   }
12512  * @endcode
12513  *
12514  * @see evas_touch_point_list_count()
12515  * @see evas_touch_point_list_nth_id_get()
12516  * @see evas_touch_point_list_nth_state_get()
12517  */
12518 EAPI void                   evas_touch_point_list_nth_xy_get(Evas *e, unsigned int n, Evas_Coord *x, Evas_Coord *y) EINA_ARG_NONNULL(1);
12519
12520 /**
12521  * This function returns the @p id of nth touch point.
12522  *
12523  * @param e The pointer to the Evas canvas.
12524  * @param n The number of the touched point (0 being the first).
12525  * @return id of nth touch point, if the call succeeded, -1 otherwise.
12526  *
12527  * The point which comes from Mouse Event has @p id 0 and The point
12528  * which comes from Multi Event has @p id that is same as Multi
12529  * Event's device id.
12530  *
12531  * Example:
12532  * @code
12533  * extern Evas *evas;
12534  * int id;
12535  *
12536  * if (evas_touch_point_list_count(evas))
12537  *   {
12538  *      id = evas_touch_point_nth_id_get(evas, 0);
12539  *      printf("The first touch point's id: %i\n", id);
12540  *   }
12541  * @endcode
12542  *
12543  * @see evas_touch_point_list_count()
12544  * @see evas_touch_point_list_nth_xy_get()
12545  * @see evas_touch_point_list_nth_state_get()
12546  */
12547 EAPI int                    evas_touch_point_list_nth_id_get(Evas *e, unsigned int n) EINA_ARG_NONNULL(1);
12548
12549 /**
12550  * This function returns the @p state of nth touch point.
12551  *
12552  * @param e The pointer to the Evas canvas.
12553  * @param n The number of the touched point (0 being the first).
12554  * @return @p state of nth touch point, if the call succeeded,
12555  *         EVAS_TOUCH_POINT_CANCEL otherwise.
12556  *
12557  * The point's @p state is EVAS_TOUCH_POINT_DOWN when pressed,
12558  * EVAS_TOUCH_POINT_STILL when the point is not moved after pressed,
12559  * EVAS_TOUCH_POINT_MOVE when moved at least once after pressed and
12560  * EVAS_TOUCH_POINT_UP when released.
12561  *
12562  * Example:
12563  * @code
12564  * extern Evas *evas;
12565  * Evas_Touch_Point_State state;
12566  *
12567  * if (evas_touch_point_list_count(evas))
12568  *   {
12569  *      state = evas_touch_point_nth_state_get(evas, 0);
12570  *      printf("The first touch point's state: %i\n", state);
12571  *   }
12572  * @endcode
12573  *
12574  * @see evas_touch_point_list_count()
12575  * @see evas_touch_point_list_nth_xy_get()
12576  * @see evas_touch_point_list_nth_id_get()
12577  */
12578 EAPI Evas_Touch_Point_State evas_touch_point_list_nth_state_get(Evas *e, unsigned int n) EINA_ARG_NONNULL(1);
12579
12580 /**
12581  * @}
12582  */
12583
12584 #ifdef __cplusplus
12585 }
12586 #endif
12587
12588 #endif