7 Please see the @ref authors page for contact details.
9 @section toc Table of Contents
16 @li @ref intro_example
19 @section intro What is Evas?
21 Evas is a clean display canvas API for several target display systems
22 that can draw anti-aliased text, smooth super and sub-sampled scaled
23 images, alpha-blend objects and much more.
25 It abstracts any need to know much about what the characteristics of
26 your display system are or what graphics calls are used to draw them
27 and how. It deals on an object level where all you do is create and
28 manipulate objects in a canvas, set their properties, and the rest is
31 Evas optimises the rendering pipeline to minimise effort in redrawing
32 changes made to the canvas and so takes this work out of the
33 programmers hand, saving a lot of time and energy.
35 It's small and lean, designed to work on embedded systems all the way
36 to large and powerful multi-cpu workstations. It can be compiled to
37 only have the features you need for your target platform if you so
38 wish, thus keeping it small and lean. It has several display
39 back-ends, letting it display on several display systems, making it
40 portable for cross-device and cross-platform development.
42 @subsection intro_not_evas What Evas is not?
44 Evas is not a widget set or widget toolkit, however it is their
45 base. See Elementary (http://docs.enlightenment.org/auto/elementary/)
46 for a toolkit based on Evas, Edje, Ecore and other Enlightenment
49 It is not dependent or aware of main loops, input or output
50 systems. Input should be polled from various sources and fed to
51 Evas. Similarly, it will not create windows or report windows updates
52 to your system, rather just drawing the pixels and reporting to the
53 user the areas that were changed. Of course these operations are quite
54 common and thus they are ready to use in Ecore, particularly in
55 Ecore_Evas (http://docs.enlightenment.org/auto/ecore/).
58 @section work How does Evas work?
60 Evas is a canvas display library. This is markedly different from most
61 display and windowing systems as a canvas is structural and is also a
62 state engine, whereas most display and windowing systems are immediate
63 mode display targets. Evas handles the logic between a structural
64 display via its state engine, and controls the target windowing system
65 in order to produce rendered results of the current canvas' state on
68 Immediate mode display systems retain very little, or no state. A
69 program will execute a series of commands, as in the pseudo code:
72 draw line from position (0, 0) to position (100, 200);
74 draw rectangle from position (10, 30) to position (50, 500);
76 bitmap_handle = create_bitmap();
77 scale bitmap_handle to size 100 x 100;
78 draw image bitmap_handle at position (10, 30);
81 The series of commands is executed by the windowing system and the
82 results are displayed on the screen (normally). Once the commands are
83 executed the display system has little or no idea of how to reproduce
84 this image again, and so has to be instructed by the application how
85 to redraw sections of the screen whenever needed. Each successive
86 command will be executed as instructed by the application and either
87 emulated by software or sent to the graphics hardware on the device to
90 The advantage of such a system is that it is simple, and gives a
91 program tight control over how something looks and is drawn. Given the
92 increasing complexity of displays and demands by users to have better
93 looking interfaces, more and more work is needing to be done at this
94 level by the internals of widget sets, custom display widgets and
95 other programs. This means more and more logic and display rendering
96 code needs to be written time and time again, each time the
97 application needs to figure out how to minimise redraws so that
98 display is fast and interactive, and keep track of redraw logic. The
99 power comes at a high-price, lots of extra code and work. Programmers
100 not very familiar with graphics programming will often make mistakes
101 at this level and produce code that is sub optimal. Those familiar
102 with this kind of programming will simply get bored by writing the
103 same code again and again.
105 For example, if in the above scene, the windowing system requires the
106 application to redraw the area from 0, 0 to 50, 50 (also referred as
107 "expose event"), then the programmer must calculate manually the
108 updates and repaint it again:
111 Redraw from position (0, 0) to position (50, 50):
113 // what was in area (0, 0, 50, 50)?
115 // 1. intersection part of line (0, 0) to (100, 200)?
116 draw line from position (0, 0) to position (25, 50);
118 // 2. intersection part of rectangle (10, 30) to (50, 500)?
119 draw rectangle from position (10, 30) to position (50, 50)
121 // 3. intersection part of image at (10, 30), size 100 x 100?
122 bitmap_subimage = subregion from position (0, 0) to position (40, 20)
123 draw image bitmap_subimage at position (10, 30);
126 The clever reader might have noticed that, if all elements in the
127 above scene are opaque, then the system is doing useless paints: part
128 of the line is behind the rectangle, and part of the rectangle is
129 behind the image. These useless paints tend to be very costly, as
130 pixels tend to be 4 bytes in size, thus an overlapping region of 100 x
131 100 pixels is around 40000 useless writes! The developer could write
132 code to calculate the overlapping areas and avoid painting then, but
133 then it should be mixed with the "expose event" handling mentioned
134 above and quickly one realizes the initially simpler method became
137 Evas is a structural system in which the programmer creates and
138 manages display objects and their properties, and as a result of this
139 higher level state management, the canvas is able to redraw the set of
140 objects when needed to represent the current state of the canvas.
142 For example, the pseudo code:
145 line_handle = create_line();
146 set line_handle from position (0, 0) to position (100, 200);
149 rectangle_handle = create_rectangle();
150 move rectangle_handle to position (10, 30);
151 resize rectangle_handle to size 40 x 470;
152 show rectangle_handle;
154 bitmap_handle = create_bitmap();
155 scale bitmap_handle to size 100 x 100;
156 move bitmap_handle to position (10, 30);
162 This may look longer, but when the display needs to be refreshed or
163 updated, the programmer only moves, resizes, shows, hides etc. the
164 objects that need to change. The programmer simply thinks at the
165 object logic level, and the canvas software does the rest of the work
166 for them, figuring out what actually changed in the canvas since it
167 was last drawn, how to most efficiently redraw the canvas and its
168 contents to reflect the current state, and then it can go off and do
169 the actual drawing of the canvas.
171 This lets the programmer think in a more natural way when dealing with
172 a display, and saves time and effort of working out how to load and
173 display images, render given the current display system etc. Since
174 Evas also is portable across different display systems, this also
175 gives the programmer the ability to have their code ported and
176 displayed on different display systems with very little work.
178 Evas can be seen as a display system that stands somewhere between a
179 widget set and an immediate mode display system. It retains basic
180 display logic, but does very little high-level logic such as
181 scrollbars, sliders, push buttons etc.
184 @section compiling How to compile using Evas ?
186 Evas is a library your application links to. The procedure for this is
187 very simple. You simply have to compile your application with the
188 appropriate compiler flags that the @c pkg-config script outputs. For
191 Compiling C or C++ files into object files:
194 gcc -c -o main.o main.c `pkg-config --cflags evas`
197 Linking object files into a binary executable:
200 gcc -o my_application main.o `pkg-config --libs evas`
203 You simply have to make sure that @c pkg-config is in your shell's @c
204 PATH (see the manual page for your appropriate shell) and @c evas.pc
205 in @c /usr/lib/pkgconfig or its path in the @c PKG_CONFIG_PATH
206 environment variable. It's that simple to link and use Evas once you
207 have written your code to use it.
209 Since the program is linked to Evas, it is now able to use any
210 advertised API calls to display graphics in a canvas managed by it, as
211 well as use the API calls provided to manage data.
213 You should make sure you add any extra compile and link flags to your
214 compile commands that your application may need as well. The above
215 example is only guaranteed to make Evas add it's own requirements.
218 @section install How is it installed?
230 @section next_steps Next Steps
232 After you understood what Evas is and installed it in your system you
233 should proceed understanding the programming interface for all
234 objects, then see the specific for the most used elements. We'd
235 recommend you to take a while to learn Ecore
236 (http://docs.enlightenment.org/auto/ecore/) and Edje
237 (http://docs.enlightenment.org/auto/edje/) as they will likely save
238 you tons of work compared to using just Evas directly.
242 @li @ref Evas_Object_Group, where you'll get how to basically
243 manipulate generic objects lying on an Evas canvas, handle canvas
244 and object events, etc.
245 @li @ref Evas_Object_Rectangle, to learn about the most basic object
246 type on Evas -- the rectangle.
247 @li @ref Evas_Object_Polygon, to learn how to create polygon elements
249 @li @ref Evas_Line_Group, to learn how to create line elements on the
251 @li @ref Evas_Object_Image, to learn about image objects, over which
252 Evas can do a plethora of operations.
253 @li @ref Evas_Object_Text, to learn how to create textual elements on
255 @li @ref Evas_Object_Textblock, to learn how to create multiline
256 textual elements on the canvas.
257 @li @ref Evas_Smart_Object_Group and @ref Evas_Smart_Group, to define
258 new objects that provide @b custom functions to handle clipping,
259 hiding, moving, resizing, color setting and more. These could
260 be as simple as a group of objects that move together (see @ref
261 Evas_Smart_Object_Clipped) up to implementations of what
262 ends to be a widget, providing some intelligence (thus the name)
263 to Evas objects -- like a button or check box, for example.
265 @section intro_example Introductory Example
267 @include evas-buffer-simple.c
271 @page authors Authors
272 @author Carsten Haitzler <raster@@rasterman.com>
273 @author Till Adam <till@@adam-lilienthal.de>
274 @author Steve Ireland <sireland@@pobox.com>
275 @author Brett Nash <nash@@nash.id.au>
276 @author Tilman Sauerbeck <tilman@@code-monkey.de>
277 @author Corey Donohoe <atmos@@atmos.org>
278 @author Yuri Hudobin <glassy_ape@@users.sourceforge.net>
279 @author Nathan Ingersoll <ningerso@@d.umn.edu>
280 @author Willem Monsuwe <willem@@stack.nl>
281 @author Jose O Gonzalez <jose_ogp@@juno.com>
282 @author Bernhard Nemec <Bernhard.Nemec@@viasyshc.com>
283 @author Jorge Luis Zapata Muga <jorgeluis.zapata@@gmail.com>
284 @author Cedric Bail <cedric.bail@@free.fr>
285 @author Gustavo Sverzut Barbieri <barbieri@@profusion.mobi>
286 @author Vincent Torri <vtorri@@univ-evry.fr>
287 @author Tim Horton <hortont424@@gmail.com>
288 @author Tom Hacohen <tom@@stosb.com>
289 @author Mathieu Taillefumier <mathieu.taillefumier@@free.fr>
290 @author Iván Briano <ivan@@profusion.mobi>
291 @author Gustavo Lima Chaves <glima@@profusion.mobi>
292 @author Samsung Electronics <tbd>
293 @author Samsung SAIT <tbd>
294 @author Sung W. Park <sungwoo@@gmail.com>
295 @author Jiyoun Park <jy0703.park@@samsung.com>
296 @author Myoungwoon Roy Kim(roy_kim) <myoungwoon.kim@@samsung.com> <myoungwoon@@gmail.com>
297 @author Thierry el Borgi <thierry@@substantiel.fr>
298 @author ChunEon Park <hermet@@hermet.pe.kr>
300 Please contact <enlightenment-devel@lists.sourceforge.net> to get in
301 contact with the developers and maintainers.
316 # ifdef EFL_EVAS_BUILD
318 # define EAPI __declspec(dllexport)
321 # endif /* ! DLL_EXPORT */
323 # define EAPI __declspec(dllimport)
324 # endif /* ! EFL_EVAS_BUILD */
328 # define EAPI __attribute__ ((visibility("default")))
335 #endif /* ! _WIN32 */
341 #define EVAS_VERSION_MAJOR 1
342 #define EVAS_VERSION_MINOR 0
344 typedef struct _Evas_Version
352 EAPI extern Evas_Version *evas_version;
356 * @brief These routines are used for Evas library interaction.
358 * @todo check boolean return values and convert to Eina_Bool
359 * @todo change all api to use EINA_SAFETY_*
360 * @todo finish api documentation
363 /* BiDi exposed stuff */
365 typedef enum _Evas_BiDi_Direction
367 EVAS_BIDI_DIRECTION_NATURAL,
368 EVAS_BIDI_DIRECTION_NEUTRAL = EVAS_BIDI_DIRECTION_NATURAL,
369 EVAS_BIDI_DIRECTION_LTR,
370 EVAS_BIDI_DIRECTION_RTL
371 } Evas_BiDi_Direction;
374 * Identifier of callbacks to be set for Evas canvases or Evas
377 * The following figure illustrates some Evas callbacks:
379 * @image html evas-callbacks.png
380 * @image rtf evas-callbacks.png
381 * @image latex evas-callbacks.eps
383 * @see evas_object_event_callback_add()
384 * @see evas_event_callback_add()
386 typedef enum _Evas_Callback_Type
389 * The following events are only for use with Evas objects, with
390 * evas_object_event_callback_add():
392 EVAS_CALLBACK_MOUSE_IN, /**< Mouse In Event */
393 EVAS_CALLBACK_MOUSE_OUT, /**< Mouse Out Event */
394 EVAS_CALLBACK_MOUSE_DOWN, /**< Mouse Button Down Event */
395 EVAS_CALLBACK_MOUSE_UP, /**< Mouse Button Up Event */
396 EVAS_CALLBACK_MOUSE_MOVE, /**< Mouse Move Event */
397 EVAS_CALLBACK_MOUSE_WHEEL, /**< Mouse Wheel Event */
398 EVAS_CALLBACK_MULTI_DOWN, /**< Multi-touch Down Event */
399 EVAS_CALLBACK_MULTI_UP, /**< Multi-touch Up Event */
400 EVAS_CALLBACK_MULTI_MOVE, /**< Multi-touch Move Event */
401 EVAS_CALLBACK_FREE, /**< Object Being Freed (Called after Del) */
402 EVAS_CALLBACK_KEY_DOWN, /**< Key Press Event */
403 EVAS_CALLBACK_KEY_UP, /**< Key Release Event */
404 EVAS_CALLBACK_FOCUS_IN, /**< Focus In Event */
405 EVAS_CALLBACK_FOCUS_OUT, /**< Focus Out Event */
406 EVAS_CALLBACK_SHOW, /**< Show Event */
407 EVAS_CALLBACK_HIDE, /**< Hide Event */
408 EVAS_CALLBACK_MOVE, /**< Move Event */
409 EVAS_CALLBACK_RESIZE, /**< Resize Event */
410 EVAS_CALLBACK_RESTACK, /**< Restack Event */
411 EVAS_CALLBACK_DEL, /**< Object Being Deleted (called before Free) */
412 EVAS_CALLBACK_HOLD, /**< Events go on/off hold */
413 EVAS_CALLBACK_CHANGED_SIZE_HINTS, /**< Size hints changed event */
414 EVAS_CALLBACK_IMAGE_PRELOADED, /**< Image has been preloaded */
417 * The following events are only for use with Evas canvases, with
418 * evas_event_callback_add():
420 EVAS_CALLBACK_CANVAS_FOCUS_IN, /**< Canvas got focus as a whole */
421 EVAS_CALLBACK_CANVAS_FOCUS_OUT, /**< Canvas lost focus as a whole */
422 EVAS_CALLBACK_RENDER_FLUSH_PRE, /**< Called just before rendering is updated on the canvas target */
423 EVAS_CALLBACK_RENDER_FLUSH_POST, /**< Called just after rendering is updated on the canvas target */
424 EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_IN, /**< Canvas object got focus */
425 EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_OUT, /**< Canvas object lost focus */
428 * More Evas object event types - see evas_object_event_callback_add():
430 EVAS_CALLBACK_IMAGE_UNLOADED, /**< Image data has been unloaded (by some mechanims in Evas that throw out original image data) */
432 EVAS_CALLBACK_LAST /**< kept as last element/sentinel -- not really an event */
433 } Evas_Callback_Type; /**< The types of events triggering a callback */
436 * @def EVAS_CALLBACK_PRIORITY_BEFORE
437 * Slightly more prioritized than default.
440 #define EVAS_CALLBACK_PRIORITY_BEFORE -100
442 * @def EVAS_CALLBACK_PRIORITY_DEFAULT
443 * Default callback priority level
446 #define EVAS_CALLBACK_PRIORITY_DEFAULT 0
448 * @def EVAS_CALLBACK_PRIORITY_AFTER
449 * Slightly less prioritized than default.
452 #define EVAS_CALLBACK_PRIORITY_AFTER 100
455 * @typedef Evas_Callback_Priority
457 * Callback priority value. Range is -32k - 32k. The lower the number, the
458 * bigger the priority.
460 * @see EVAS_CALLBACK_PRIORITY_AFTER
461 * @see EVAS_CALLBACK_PRIORITY_BEFORE
462 * @see EVAS_CALLBACK_PRIORITY_DEFAULT
466 typedef short Evas_Callback_Priority;
469 * Flags for Mouse Button events
471 typedef enum _Evas_Button_Flags
473 EVAS_BUTTON_NONE = 0, /**< No extra mouse button data */
474 EVAS_BUTTON_DOUBLE_CLICK = (1 << 0), /**< This mouse button press was the 2nd press of a double click */
475 EVAS_BUTTON_TRIPLE_CLICK = (1 << 1) /**< This mouse button press was the 3rd press of a triple click */
476 } Evas_Button_Flags; /**< Flags for Mouse Button events */
481 typedef enum _Evas_Event_Flags
483 EVAS_EVENT_FLAG_NONE = 0, /**< No fancy flags set */
484 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 */
485 EVAS_EVENT_FLAG_ON_SCROLL = (1 << 1) /**< This event flag indicates the event occurs while scrolling; for exameple, DOWN event occurs during scrolling; the event should be used for informational purposes and maybe some indications visually, but not actually perform anything */
486 } Evas_Event_Flags; /**< Flags for Events */
489 * Flags for Font Hinting
490 * @ingroup Evas_Font_Group
492 typedef enum _Evas_Font_Hinting_Flags
494 EVAS_FONT_HINTING_NONE, /**< No font hinting */
495 EVAS_FONT_HINTING_AUTO, /**< Automatic font hinting */
496 EVAS_FONT_HINTING_BYTECODE /**< Bytecode font hinting */
497 } Evas_Font_Hinting_Flags; /**< Flags for Font Hinting */
500 * Colorspaces for pixel data supported by Evas
501 * @ingroup Evas_Object_Image
503 typedef enum _Evas_Colorspace
505 EVAS_COLORSPACE_ARGB8888, /**< ARGB 32 bits per pixel, high-byte is Alpha, accessed 1 32bit word at a time */
506 /* these are not currently supported - but planned for the future */
507 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 */
508 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 */
509 EVAS_COLORSPACE_RGB565_A5P, /**< 16bit rgb565 + Alpha plane at end - 5 bits of the 8 being used per alpha byte */
510 EVAS_COLORSPACE_GRY8, /**< 8bit grayscale */
511 EVAS_COLORSPACE_YCBCR422601_PL /**< YCbCr 4:2:2, ITU.BT-601 specifications. The data poitned to is just an array of row pointer, pointing to line of Y,Cb,Y,Cr bytes */
512 } Evas_Colorspace; /**< Colorspaces for pixel data supported by Evas */
515 * How to pack items into cells in a table.
516 * @ingroup Evas_Object_Table
518 * @see evas_object_table_homogeneous_set() for an explanation of the funcion of
521 typedef enum _Evas_Object_Table_Homogeneous_Mode
523 EVAS_OBJECT_TABLE_HOMOGENEOUS_NONE = 0,
524 EVAS_OBJECT_TABLE_HOMOGENEOUS_TABLE = 1,
525 EVAS_OBJECT_TABLE_HOMOGENEOUS_ITEM = 2
526 } Evas_Object_Table_Homogeneous_Mode; /**< Table cell pack mode. */
528 typedef struct _Evas_Coord_Rectangle Evas_Coord_Rectangle; /**< A generic rectangle handle */
529 typedef struct _Evas_Point Evas_Point; /**< integer point */
531 typedef struct _Evas_Coord_Point Evas_Coord_Point; /**< Evas_Coord point */
532 typedef struct _Evas_Coord_Precision_Point Evas_Coord_Precision_Point; /**< Evas_Coord point with sub-pixel precision */
534 typedef struct _Evas_Position Evas_Position; /**< associates given point in Canvas and Output */
535 typedef struct _Evas_Precision_Position Evas_Precision_Position; /**< associates given point in Canvas and Output, with sub-pixel precision */
538 * @typedef Evas_Smart_Class
540 * A smart object's @b base class definition
542 * @ingroup Evas_Smart_Group
544 typedef struct _Evas_Smart_Class Evas_Smart_Class;
547 * @typedef Evas_Smart_Cb_Description
549 * A smart object callback description, used to provide introspection
551 * @ingroup Evas_Smart_Group
553 typedef struct _Evas_Smart_Cb_Description Evas_Smart_Cb_Description;
558 * An opaque handle to map points
560 * @see evas_map_new()
561 * @see evas_map_free()
562 * @see evas_map_dup()
564 * @ingroup Evas_Object_Group_Map
566 typedef struct _Evas_Map Evas_Map;
571 * An opaque handle to an Evas canvas.
576 * @ingroup Evas_Canvas
578 typedef struct _Evas Evas;
581 * @typedef Evas_Object
582 * An Evas Object handle.
583 * @ingroup Evas_Object_Group
585 typedef struct _Evas_Object Evas_Object;
587 typedef void Evas_Performance; /**< An Evas Performance handle */
588 typedef struct _Evas_Modifier Evas_Modifier; /**< An opaque type containing information on which modifier keys are registered in an Evas canvas */
589 typedef struct _Evas_Lock Evas_Lock; /**< An opaque type containing information on which lock keys are registered in an Evas canvas */
590 typedef struct _Evas_Smart Evas_Smart; /**< An Evas Smart Object handle */
591 typedef struct _Evas_Native_Surface Evas_Native_Surface; /**< A generic datatype for engine specific native surface information */
592 typedef unsigned long long Evas_Modifier_Mask; /**< An Evas modifier mask type */
594 typedef int Evas_Coord;
595 typedef int Evas_Font_Size;
596 typedef int Evas_Angle;
598 struct _Evas_Coord_Rectangle /**< A rectangle in Evas_Coord */
600 Evas_Coord x; /**< top-left x co-ordinate of rectangle */
601 Evas_Coord y; /**< top-left y co-ordinate of rectangle */
602 Evas_Coord w; /**< width of rectangle */
603 Evas_Coord h; /**< height of rectangle */
611 struct _Evas_Coord_Point
616 struct _Evas_Coord_Precision_Point
622 struct _Evas_Position
625 Evas_Coord_Point canvas;
628 struct _Evas_Precision_Position
631 Evas_Coord_Precision_Point canvas;
634 typedef enum _Evas_Aspect_Control
636 EVAS_ASPECT_CONTROL_NONE = 0, /**< Preference on scaling unset */
637 EVAS_ASPECT_CONTROL_NEITHER = 1, /**< Same effect as unset preference on scaling */
638 EVAS_ASPECT_CONTROL_HORIZONTAL = 2, /**< Use all horizontal container space to place an object, using the given aspect */
639 EVAS_ASPECT_CONTROL_VERTICAL = 3, /**< Use all vertical container space to place an object, using the given aspect */
640 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 */
641 } Evas_Aspect_Control; /**< Aspect types/policies for scaling size hints, used for evas_object_size_hint_aspect_set() */
643 typedef struct _Evas_Pixel_Import_Source Evas_Pixel_Import_Source; /**< A source description of pixels for importing pixels */
644 typedef struct _Evas_Engine_Info Evas_Engine_Info; /**< A generic Evas Engine information structure */
645 typedef struct _Evas_Device Evas_Device; /**< A source device handle - where the event came from */
646 typedef struct _Evas_Event_Mouse_Down Evas_Event_Mouse_Down; /**< Event structure for #EVAS_CALLBACK_MOUSE_DOWN event callbacks */
647 typedef struct _Evas_Event_Mouse_Up Evas_Event_Mouse_Up; /**< Event structure for #EVAS_CALLBACK_MOUSE_UP event callbacks */
648 typedef struct _Evas_Event_Mouse_In Evas_Event_Mouse_In; /**< Event structure for #EVAS_CALLBACK_MOUSE_IN event callbacks */
649 typedef struct _Evas_Event_Mouse_Out Evas_Event_Mouse_Out; /**< Event structure for #EVAS_CALLBACK_MOUSE_OUT event callbacks */
650 typedef struct _Evas_Event_Mouse_Move Evas_Event_Mouse_Move; /**< Event structure for #EVAS_CALLBACK_MOUSE_MOVE event callbacks */
651 typedef struct _Evas_Event_Mouse_Wheel Evas_Event_Mouse_Wheel; /**< Event structure for #EVAS_CALLBACK_MOUSE_WHEEL event callbacks */
652 typedef struct _Evas_Event_Multi_Down Evas_Event_Multi_Down; /**< Event structure for #EVAS_CALLBACK_MULTI_DOWN event callbacks */
653 typedef struct _Evas_Event_Multi_Up Evas_Event_Multi_Up; /**< Event structure for #EVAS_CALLBACK_MULTI_UP event callbacks */
654 typedef struct _Evas_Event_Multi_Move Evas_Event_Multi_Move; /**< Event structure for #EVAS_CALLBACK_MULTI_MOVE event callbacks */
655 typedef struct _Evas_Event_Key_Down Evas_Event_Key_Down; /**< Event structure for #EVAS_CALLBACK_KEY_DOWN event callbacks */
656 typedef struct _Evas_Event_Key_Up Evas_Event_Key_Up; /**< Event structure for #EVAS_CALLBACK_KEY_UP event callbacks */
657 typedef struct _Evas_Event_Hold Evas_Event_Hold; /**< Event structure for #EVAS_CALLBACK_HOLD event callbacks */
659 typedef enum _Evas_Load_Error
661 EVAS_LOAD_ERROR_NONE = 0, /**< No error on load */
662 EVAS_LOAD_ERROR_GENERIC = 1, /**< A non-specific error occurred */
663 EVAS_LOAD_ERROR_DOES_NOT_EXIST = 2, /**< File (or file path) does not exist */
664 EVAS_LOAD_ERROR_PERMISSION_DENIED = 3, /**< Permission deinied to an existing file (or path) */
665 EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED = 4, /**< Allocation of resources failure prevented load */
666 EVAS_LOAD_ERROR_CORRUPT_FILE = 5, /**< File corrupt (but was detected as a known format) */
667 EVAS_LOAD_ERROR_UNKNOWN_FORMAT = 6 /**< File is not a known format */
668 } Evas_Load_Error; /**< Evas image load error codes one can get - see evas_load_error_str() too. */
671 typedef enum _Evas_Alloc_Error
673 EVAS_ALLOC_ERROR_NONE = 0, /**< No allocation error */
674 EVAS_ALLOC_ERROR_FATAL = 1, /**< Allocation failed despite attempts to free up memory */
675 EVAS_ALLOC_ERROR_RECOVERED = 2 /**< Allocation succeeded, but extra memory had to be found by freeing up speculative resources */
676 } Evas_Alloc_Error; /**< Possible allocation errors returned by evas_alloc_error() */
678 typedef enum _Evas_Fill_Spread
680 EVAS_TEXTURE_REFLECT = 0, /**< image fill tiling mode - tiling reflects */
681 EVAS_TEXTURE_REPEAT = 1, /**< tiling repeats */
682 EVAS_TEXTURE_RESTRICT = 2, /**< tiling clamps - range offset ignored */
683 EVAS_TEXTURE_RESTRICT_REFLECT = 3, /**< tiling clamps and any range offset reflects */
684 EVAS_TEXTURE_RESTRICT_REPEAT = 4, /**< tiling clamps and any range offset repeats */
685 EVAS_TEXTURE_PAD = 5 /**< tiling extends with end values */
686 } Evas_Fill_Spread; /**< Fill types used for evas_object_image_fill_spread_set() */
688 typedef enum _Evas_Pixel_Import_Pixel_Format
690 EVAS_PIXEL_FORMAT_NONE = 0, /**< No pixel format */
691 EVAS_PIXEL_FORMAT_ARGB32 = 1, /**< ARGB 32bit pixel format with A in the high byte per 32bit pixel word */
692 EVAS_PIXEL_FORMAT_YUV420P_601 = 2 /**< YUV 420 Planar format with CCIR 601 color encoding wuth contiguous planes in the order Y, U and V */
693 } Evas_Pixel_Import_Pixel_Format; /**< Pixel format for import call. See evas_object_image_pixels_import() */
695 struct _Evas_Pixel_Import_Source
697 Evas_Pixel_Import_Pixel_Format format; /**< pixel format type ie ARGB32, YUV420P_601 etc. */
698 int w, h; /**< width and height of source in pixels */
699 void **rows; /**< an array of pointers (size depends on format) pointing to left edge of each scanline */
702 /* magic version number to know what the native surf struct looks like */
703 #define EVAS_NATIVE_SURFACE_VERSION 2
705 typedef enum _Evas_Native_Surface_Type
707 EVAS_NATIVE_SURFACE_NONE,
708 EVAS_NATIVE_SURFACE_X11,
709 EVAS_NATIVE_SURFACE_OPENGL
710 } Evas_Native_Surface_Type;
712 struct _Evas_Native_Surface
715 Evas_Native_Surface_Type type;
718 void *visual; /**< visual of the pixmap to use (Visual) */
719 unsigned long pixmap; /**< pixmap id to use (Pixmap) */
722 unsigned int texture_id; /**< opengl texture id to use from glGenTextures() */
723 unsigned int framebuffer_id; /**< 0 if not a FBO, FBO id otherwise from glGenFramebuffers() */
724 unsigned int internal_format; /**< same as 'internalFormat' for glTexImage2D() */
725 unsigned int format; /**< same as 'format' for glTexImage2D() */
726 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) */
731 #define EVAS_LAYER_MIN -32768 /**< bottom-most layer number */
732 #define EVAS_LAYER_MAX 32767 /**< top-most layer number */
734 #define EVAS_COLOR_SPACE_ARGB 0 /**< Not used for anything */
735 #define EVAS_COLOR_SPACE_AHSV 1 /**< Not used for anything */
736 #define EVAS_TEXT_INVALID -1 /**< Not used for anything */
737 #define EVAS_TEXT_SPECIAL -2 /**< Not used for anything */
739 #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() */
740 #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() */
741 #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) */
742 #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) */
743 #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 */
744 #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 */
747 * How the object should be rendered to output.
748 * @ingroup Evas_Object_Group_Extras
750 typedef enum _Evas_Render_Op
752 EVAS_RENDER_BLEND = 0, /**< default op: d = d*(1-sa) + s */
753 EVAS_RENDER_BLEND_REL = 1, /**< d = d*(1 - sa) + s*da */
754 EVAS_RENDER_COPY = 2, /**< d = s */
755 EVAS_RENDER_COPY_REL = 3, /**< d = s*da */
756 EVAS_RENDER_ADD = 4, /**< d = d + s */
757 EVAS_RENDER_ADD_REL = 5, /**< d = d + s*da */
758 EVAS_RENDER_SUB = 6, /**< d = d - s */
759 EVAS_RENDER_SUB_REL = 7, /**< d = d - s*da */
760 EVAS_RENDER_TINT = 8, /**< d = d*s + d*(1 - sa) + s*(1 - da) */
761 EVAS_RENDER_TINT_REL = 9, /**< d = d*(1 - sa + s) */
762 EVAS_RENDER_MASK = 10, /**< d = d*sa */
763 EVAS_RENDER_MUL = 11 /**< d = d*s */
764 } Evas_Render_Op; /**< How the object should be rendered to output. */
766 typedef enum _Evas_Border_Fill_Mode
768 EVAS_BORDER_FILL_NONE = 0, /**< Image's center region is @b not to be rendered */
769 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 */
770 EVAS_BORDER_FILL_SOLID = 2 /**< Image's center region is to be made solid, even if it has transparency on it */
771 } Evas_Border_Fill_Mode; /**< How an image's center region (the complement to the border region) should be rendered by Evas */
773 typedef enum _Evas_Image_Scale_Hint
775 EVAS_IMAGE_SCALE_HINT_NONE = 0, /**< No scale hint at all */
776 EVAS_IMAGE_SCALE_HINT_DYNAMIC = 1, /**< Image is being re-scaled over time, thus turning scaling cache @b off for its data */
777 EVAS_IMAGE_SCALE_HINT_STATIC = 2 /**< Image is not being re-scaled over time, thus turning scaling cache @b on for its data */
778 } Evas_Image_Scale_Hint; /**< How an image's data is to be treated by Evas, with regard to scaling cache */
780 typedef enum _Evas_Image_Animated_Loop_Hint
782 EVAS_IMAGE_ANIMATED_HINT_NONE = 0,
783 EVAS_IMAGE_ANIMATED_HINT_LOOP = 1, /**< Image's animation mode is loop like 1->2->3->1->2->3 */
784 EVAS_IMAGE_ANIMATED_HINT_PINGPONG = 2 /**< Image's animation mode is pingpong like 1->2->3->2->1-> ... */
785 } Evas_Image_Animated_Loop_Hint;
787 typedef enum _Evas_Engine_Render_Mode
789 EVAS_RENDER_MODE_BLOCKING = 0,
790 EVAS_RENDER_MODE_NONBLOCKING = 1,
791 } Evas_Engine_Render_Mode;
793 typedef enum _Evas_Image_Content_Hint
795 EVAS_IMAGE_CONTENT_HINT_NONE = 0, /**< No hint at all */
796 EVAS_IMAGE_CONTENT_HINT_DYNAMIC = 1, /**< The contents will change over time */
797 EVAS_IMAGE_CONTENT_HINT_STATIC = 2 /**< The contents won't change over time */
798 } Evas_Image_Content_Hint; /**< How an image's data is to be treated by Evas, for optimization */
800 struct _Evas_Engine_Info /** Generic engine information. Generic info is useless */
802 int magic; /**< Magic number */
805 struct _Evas_Event_Mouse_Down /** Mouse button press event */
807 int button; /**< Mouse button number that went down (1 - 32) */
809 Evas_Point output; /**< The X/Y location of the cursor */
810 Evas_Coord_Point canvas; /**< The X/Y location of the cursor */
813 Evas_Modifier *modifiers; /**< modifier keys pressed during the event */
816 Evas_Button_Flags flags; /**< button flags set during the event */
817 unsigned int timestamp;
818 Evas_Event_Flags event_flags;
822 struct _Evas_Event_Mouse_Up /** Mouse button release event */
824 int button; /**< Mouse button number that was raised (1 - 32) */
827 Evas_Coord_Point canvas;
830 Evas_Modifier *modifiers;
833 Evas_Button_Flags flags;
834 unsigned int timestamp;
835 Evas_Event_Flags event_flags;
839 struct _Evas_Event_Mouse_In /** Mouse enter event */
841 int buttons; /**< Button pressed mask, Bits set to 1 are buttons currently pressed (bit 0 = mouse button 1, bit 1 = mouse button 2 etc.) */
844 Evas_Coord_Point canvas;
847 Evas_Modifier *modifiers;
849 unsigned int timestamp;
850 Evas_Event_Flags event_flags;
854 struct _Evas_Event_Mouse_Out /** Mouse leave event */
856 int buttons; /**< Button pressed mask, Bits set to 1 are buttons currently pressed (bit 0 = mouse button 1, bit 1 = mouse button 2 etc.) */
860 Evas_Coord_Point canvas;
863 Evas_Modifier *modifiers;
865 unsigned int timestamp;
866 Evas_Event_Flags event_flags;
870 struct _Evas_Event_Mouse_Move /** Mouse button down event */
872 int buttons; /**< Button pressed mask, Bits set to 1 are buttons currently pressed (bit 0 = mouse button 1, bit 1 = mouse button 2 etc.) */
874 Evas_Position cur, prev;
877 Evas_Modifier *modifiers;
879 unsigned int timestamp;
880 Evas_Event_Flags event_flags;
884 struct _Evas_Event_Mouse_Wheel /** Wheel event */
886 int direction; /* 0 = default up/down wheel FIXME: more wheel types */
887 int z; /* ...,-2,-1 = down, 1,2,... = up */
890 Evas_Coord_Point canvas;
893 Evas_Modifier *modifiers;
895 unsigned int timestamp;
896 Evas_Event_Flags event_flags;
900 struct _Evas_Event_Multi_Down /** Multi button press event */
902 int device; /**< Multi device number that went down (1 or more for extra touches) */
903 double radius, radius_x, radius_y;
904 double pressure, angle;
907 Evas_Coord_Precision_Point canvas;
910 Evas_Modifier *modifiers;
913 Evas_Button_Flags flags;
914 unsigned int timestamp;
915 Evas_Event_Flags event_flags;
919 struct _Evas_Event_Multi_Up /** Multi button release event */
921 int device; /**< Multi device number that went up (1 or more for extra touches) */
922 double radius, radius_x, radius_y;
923 double pressure, angle;
926 Evas_Coord_Precision_Point canvas;
929 Evas_Modifier *modifiers;
932 Evas_Button_Flags flags;
933 unsigned int timestamp;
934 Evas_Event_Flags event_flags;
938 struct _Evas_Event_Multi_Move /** Multi button down event */
940 int device; /**< Multi device number that moved (1 or more for extra touches) */
941 double radius, radius_x, radius_y;
942 double pressure, angle;
944 Evas_Precision_Position cur;
947 Evas_Modifier *modifiers;
949 unsigned int timestamp;
950 Evas_Event_Flags event_flags;
954 struct _Evas_Event_Key_Down /** Key press event */
956 char *keyname; /**< the name string of the key pressed */
958 Evas_Modifier *modifiers;
961 const char *key; /**< The logical key : (eg shift+1 == exclamation) */
962 const char *string; /**< A UTF8 string if this keystroke has produced a visible string to be ADDED */
963 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 */
964 unsigned int timestamp;
965 Evas_Event_Flags event_flags;
969 struct _Evas_Event_Key_Up /** Key release event */
971 char *keyname; /**< the name string of the key released */
973 Evas_Modifier *modifiers;
976 const char *key; /**< The logical key : (eg shift+1 == exclamation) */
977 const char *string; /**< A UTF8 string if this keystroke has produced a visible string to be ADDED */
978 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 */
979 unsigned int timestamp;
980 Evas_Event_Flags event_flags;
984 struct _Evas_Event_Hold /** Hold change event */
986 int hold; /**< The hold flag */
989 unsigned int timestamp;
990 Evas_Event_Flags event_flags;
995 * How the mouse pointer should be handled by Evas.
997 * In the mode #EVAS_OBJECT_POINTER_MODE_AUTOGRAB, when a mouse button
998 * is pressed down over an object and held, with the mouse pointer
999 * being moved outside of it, the pointer still behaves as being bound
1000 * to that object, albeit out of its drawing region. When the button
1001 * is released, the event will be fed to the object, that may check if
1002 * the final position is over it or not and do something about it.
1004 * In the mode #EVAS_OBJECT_POINTER_MODE_NOGRAB, the pointer will
1005 * always be bound to the object right below it.
1007 * @ingroup Evas_Object_Group_Extras
1009 typedef enum _Evas_Object_Pointer_Mode
1011 EVAS_OBJECT_POINTER_MODE_AUTOGRAB, /**< default, X11-like */
1012 EVAS_OBJECT_POINTER_MODE_NOGRAB /**< pointer always bound to the object right below it */
1013 } Evas_Object_Pointer_Mode; /**< How the mouse pointer should be handled by Evas. */
1015 typedef void (*Evas_Smart_Cb) (void *data, Evas_Object *obj, void *event_info); /**< Evas smart objects' "smart callback" function signature */
1016 typedef void (*Evas_Event_Cb) (void *data, Evas *e, void *event_info); /**< Evas event callback function signature */
1017 typedef Eina_Bool (*Evas_Object_Event_Post_Cb) (void *data, Evas *e);
1018 typedef void (*Evas_Object_Event_Cb) (void *data, Evas *e, Evas_Object *obj, void *event_info); /**< Evas object event callback function signature */
1019 typedef void (*Evas_Async_Events_Put_Cb)(void *target, Evas_Callback_Type type, void *event_info);
1022 * @defgroup Evas_Group Top Level Functions
1024 * Functions that affect Evas as a whole.
1030 * @return The init counter value.
1032 * This function initializes Evas and increments a counter of the
1033 * number of calls to it. It returs the new counter's value.
1035 * @see evas_shutdown().
1037 * Most EFL users wouldn't be using this function directly, because
1038 * they wouldn't access Evas directly by themselves. Instead, they
1039 * would be using higher level helpers, like @c ecore_evas_init().
1040 * See http://docs.enlightenment.org/auto/ecore/.
1042 * You should be using this if your use is something like the
1043 * following. The buffer engine is just one of the many ones Evas
1046 * @dontinclude evas-buffer-simple.c
1049 * And being the canvas creation something like:
1050 * @skip static Evas *create_canvas
1051 * @until evas_output_viewport_set(canvas,
1053 * Note that this is code creating an Evas canvas with no usage of
1054 * Ecore helpers at all -- no linkage with Ecore on this scenario,
1055 * thus. Again, this wouldn't be on Evas common usage for most
1056 * developers. See the full @ref Example_Evas_Buffer_Simple "example".
1058 * @ingroup Evas_Group
1060 EAPI int evas_init (void);
1065 * @return Evas' init counter value.
1067 * This function finalizes Evas, decrementing the counter of the
1068 * number of calls to the function evas_init(). This new value for the
1069 * counter is returned.
1073 * If you were the sole user of Evas, by means of evas_init(), you can
1074 * check if it's being properly shut down by expecting a return value
1077 * Example code follows.
1078 * @dontinclude evas-buffer-simple.c
1079 * @skip // NOTE: use ecore_evas_buffer_new
1080 * @until evas_shutdown
1081 * Where that function would contain:
1082 * @skip evas_free(canvas)
1083 * @until evas_free(canvas)
1085 * Most users would be using ecore_evas_shutdown() instead, like told
1086 * in evas_init(). See the full @ref Example_Evas_Buffer_Simple
1089 * @ingroup Evas_Group
1091 EAPI int evas_shutdown (void);
1095 * Return if any allocation errors have occurred during the prior function
1096 * @return The allocation error flag
1098 * This function will return if any memory allocation errors occurred during,
1099 * and what kind they were. The return value will be one of
1100 * EVAS_ALLOC_ERROR_NONE, EVAS_ALLOC_ERROR_FATAL or EVAS_ALLOC_ERROR_RECOVERED
1101 * with each meaning something different.
1103 * EVAS_ALLOC_ERROR_NONE means that no errors occurred at all and the function
1104 * worked as expected.
1106 * EVAS_ALLOC_ERROR_FATAL means the function was completely unable to perform
1107 * its job and will have exited as cleanly as possible. The programmer
1108 * should consider this as a sign of very low memory and should try and safely
1109 * recover from the prior functions failure (or try free up memory elsewhere
1110 * and try again after more memory is freed).
1112 * EVAS_ALLOC_ERROR_RECOVERED means that an allocation error occurred, but was
1113 * recovered from by evas finding memory of its own it has allocated and
1114 * freeing what it sees as not really usefully allocated memory. What is freed
1115 * may vary. Evas may reduce the resolution of images, free cached images or
1116 * fonts, trhow out pre-rendered data, reduce the complexity of change lists
1117 * etc. Evas and the program will function as per normal after this, but this
1118 * is a sign of low memory, and it is suggested that the program try and
1119 * identify memory it doesn't need, and free it.
1123 * extern Evas_Object *object;
1124 * void callback (void *data, Evas *e, Evas_Object *obj, void *event_info);
1126 * evas_object_event_callback_add(object, EVAS_CALLBACK_MOUSE_DOWN, callback, NULL);
1127 * if (evas_alloc_error() == EVAS_ALLOC_ERROR_FATAL)
1129 * fprintf(stderr, "ERROR: Completely unable to attach callback. Must\n");
1130 * fprintf(stderr, " destroy object now as it cannot be used.\n");
1131 * evas_object_del(object);
1133 * fprintf(stderr, "WARNING: Memory is really low. Cleaning out RAM.\n");
1134 * my_memory_cleanup();
1136 * if (evas_alloc_error() == EVAS_ALLOC_ERROR_RECOVERED)
1138 * fprintf(stderr, "WARNING: Memory is really low. Cleaning out RAM.\n");
1139 * my_memory_cleanup();
1143 * @ingroup Evas_Group
1145 EAPI Evas_Alloc_Error evas_alloc_error (void);
1149 * @brief Get evas' internal asynchronous events read file descriptor.
1151 * @return The canvas' asynchronous events read file descriptor.
1153 * Evas' asynchronous events are meant to be dealt with internally,
1154 * i. e., when building stuff to be glued together into the EFL
1155 * infrastructure -- a module, for example. The context which demands
1156 * its use is when calculations need to be done out of the main
1157 * thread, asynchronously, and some action must be performed after
1160 * An example of actual use of this API is for image asynchronous
1161 * preload inside evas. If the canvas was instantiated through
1162 * ecore-evas usage, ecore itself will take care of calling those
1163 * events' processing.
1165 * This function returns the read file descriptor where to get the
1166 * asynchronous events of the canvas. Naturally, other mainloops,
1167 * apart from ecore, may make use of it.
1169 * @ingroup Evas_Group
1171 EAPI int evas_async_events_fd_get (void) EINA_WARN_UNUSED_RESULT EINA_PURE;
1174 * @brief Trigger the processing of all events waiting on the file
1175 * descriptor returned by evas_async_events_fd_get().
1177 * @return The number of events processed.
1179 * All asynchronous events queued up by evas_async_events_put() are
1180 * processed here. More precisely, the callback functions, informed
1181 * together with other event parameters, when queued, get called (with
1182 * those parameters), in that order.
1184 * @ingroup Evas_Group
1186 EAPI int evas_async_events_process (void);
1189 * Insert asynchronous events on the canvas.
1191 * @param target The target to be affected by the events.
1192 * @param type The type of callback function.
1193 * @param event_info Information about the event.
1194 * @param func The callback function pointer.
1196 * This is the way, for a routine running outside evas' main thread,
1197 * to report an asynchronous event. A callback function is informed,
1198 * whose call is to happen after evas_async_events_process() is
1201 * @ingroup Evas_Group
1203 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);
1206 * @defgroup Evas_Canvas Canvas Functions
1208 * Low level Evas canvas functions. Sub groups will present more high
1209 * level ones, though.
1211 * Most of these functions deal with low level Evas actions, like:
1212 * @li create/destroy raw canvases, not bound to any displaying engine
1213 * @li tell a canvas i got focused (in a windowing context, for example)
1214 * @li tell a canvas a region should not be calculated anymore in rendering
1215 * @li tell a canvas to render its contents, immediately
1217 * Most users will be using Evas by means of the @c Ecore_Evas
1218 * wrapper, which deals with all the above mentioned issues
1219 * automatically for them. Thus, you'll be looking at this section
1220 * only if you're building low level stuff.
1222 * The groups within present you functions that deal with the canvas
1223 * directly, too, and not yet with its @b objects. They are the
1224 * functions you need to use at a minimum to get a working canvas.
1226 * Some of the funcions in this group are exemplified @ref
1227 * Example_Evas_Events "here".
1231 * Creates a new empty evas.
1233 * Note that before you can use the evas, you will to at a minimum:
1234 * @li Set its render method with @ref evas_output_method_set .
1235 * @li Set its viewport size with @ref evas_output_viewport_set .
1236 * @li Set its size of the canvas with @ref evas_output_size_set .
1237 * @li Ensure that the render engine is given the correct settings
1238 * with @ref evas_engine_info_set .
1240 * This function should only fail if the memory allocation fails
1242 * @note this function is very low level. Instead of using it
1243 * directly, consider using the high level functions in
1244 * Ecore_Evas such as @c ecore_evas_new(). See
1245 * http://docs.enlightenment.org/auto/ecore/.
1247 * @attention it is recommended that one calls evas_init() before
1248 * creating new canvas.
1250 * @return A new uninitialised Evas canvas on success. Otherwise, @c
1252 * @ingroup Evas_Canvas
1254 EAPI Evas *evas_new (void) EINA_WARN_UNUSED_RESULT EINA_MALLOC;
1257 * Frees the given evas and any objects created on it.
1259 * Any objects with 'free' callbacks will have those callbacks called
1262 * @param e The given evas.
1264 * @ingroup Evas_Canvas
1266 EAPI void evas_free (Evas *e) EINA_ARG_NONNULL(1);
1269 * Inform to the evas that it got the focus.
1271 * @param e The evas to change information.
1272 * @ingroup Evas_Canvas
1274 EAPI void evas_focus_in (Evas *e);
1277 * Inform to the evas that it lost the focus.
1279 * @param e The evas to change information.
1280 * @ingroup Evas_Canvas
1282 EAPI void evas_focus_out (Evas *e);
1285 * Get the focus state known by the given evas
1287 * @param e The evas to query information.
1288 * @ingroup Evas_Canvas
1290 EAPI Eina_Bool evas_focus_state_get (const Evas *e) EINA_PURE;
1293 * Push the nochange flag up 1
1295 * This tells evas, that while the nochange flag is greater than 0, do not
1296 * mark objects as "changed" when making changes.
1298 * @param e The evas to change information.
1299 * @ingroup Evas_Canvas
1301 EAPI void evas_nochange_push (Evas *e);
1304 * Pop the nochange flag down 1
1306 * This tells evas, that while the nochange flag is greater than 0, do not
1307 * mark objects as "changed" when making changes.
1309 * @param e The evas to change information.
1310 * @ingroup Evas_Canvas
1312 EAPI void evas_nochange_pop (Evas *e);
1316 * Attaches a specific pointer to the evas for fetching later
1318 * @param e The canvas to attach the pointer to
1319 * @param data The pointer to attach
1320 * @ingroup Evas_Canvas
1322 EAPI void evas_data_attach_set (Evas *e, void *data) EINA_ARG_NONNULL(1);
1325 * Returns the pointer attached by evas_data_attach_set()
1327 * @param e The canvas to attach the pointer to
1328 * @return The pointer attached
1329 * @ingroup Evas_Canvas
1331 EAPI void *evas_data_attach_get (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
1335 * Add a damage rectangle.
1337 * @param e The given canvas pointer.
1338 * @param x The rectangle's left position.
1339 * @param y The rectangle's top position.
1340 * @param w The rectangle's width.
1341 * @param h The rectangle's height.
1343 * This is the function by which one tells evas that a part of the
1344 * canvas has to be repainted.
1346 * @ingroup Evas_Canvas
1348 EAPI void evas_damage_rectangle_add (Evas *e, int x, int y, int w, int h) EINA_ARG_NONNULL(1);
1351 * Add an "obscured region" to an Evas canvas.
1353 * @param e The given canvas pointer.
1354 * @param x The rectangle's top left corner's horizontal coordinate.
1355 * @param y The rectangle's top left corner's vertical coordinate
1356 * @param w The rectangle's width.
1357 * @param h The rectangle's height.
1359 * This is the function by which one tells an Evas canvas that a part
1360 * of it <b>must not</b> be repainted. The region must be
1361 * rectangular and its coordinates inside the canvas viewport are
1362 * passed in the call. After this call, the region specified won't
1363 * participate in any form in Evas' calculations and actions during
1364 * its rendering updates, having its displaying content frozen as it
1365 * was just after this function took place.
1367 * We call it "obscured region" because the most common use case for
1368 * this rendering (partial) freeze is something else (most problaby
1369 * other canvas) being on top of the specified rectangular region,
1370 * thus shading it completely from the user's final scene in a
1371 * display. To avoid unnecessary processing, one should indicate to the
1372 * obscured canvas not to bother about the non-important area.
1374 * The majority of users won't have to worry about this funcion, as
1375 * they'll be using just one canvas in their applications, with
1376 * nothing inset or on top of it in any form.
1378 * To make this region one that @b has to be repainted again, call the
1379 * function evas_obscured_clear().
1381 * @note This is a <b>very low level function</b>, which most of
1382 * Evas' users wouldn't care about.
1384 * @note This function does @b not flag the canvas as having its state
1385 * changed. If you want to re-render it afterwards expecting new
1386 * contents, you have to add "damage" regions yourself (see
1387 * evas_damage_rectangle_add()).
1389 * @see evas_obscured_clear()
1390 * @see evas_render_updates()
1392 * Example code follows.
1393 * @dontinclude evas-events.c
1394 * @skip add an obscured
1395 * @until evas_obscured_clear(evas);
1397 * In that example, pressing the "Ctrl" and "o" keys will impose or
1398 * remove an obscured region in the middle of the canvas. You'll get
1399 * the same contents at the time the key was pressed, if toggling it
1400 * on, until you toggle it off again (make sure the animation is
1401 * running on to get the idea better). See the full @ref
1402 * Example_Evas_Events "example".
1404 * @ingroup Evas_Canvas
1406 EAPI void evas_obscured_rectangle_add (Evas *e, int x, int y, int w, int h) EINA_ARG_NONNULL(1);
1409 * Remove all "obscured regions" from an Evas canvas.
1411 * @param e The given canvas pointer.
1413 * This function removes all the rectangles from the obscured regions
1414 * list of the canvas @p e. It takes obscured areas added with
1415 * evas_obscured_rectangle_add() and make them again a regions that @b
1416 * have to be repainted on rendering updates.
1418 * @note This is a <b>very low level function</b>, which most of
1419 * Evas' users wouldn't care about.
1421 * @note This function does @b not flag the canvas as having its state
1422 * changed. If you want to re-render it afterwards expecting new
1423 * contents, you have to add "damage" regions yourself (see
1424 * evas_damage_rectangle_add()).
1426 * @see evas_obscured_rectangle_add() for an example
1427 * @see evas_render_updates()
1429 * @ingroup Evas_Canvas
1431 EAPI void evas_obscured_clear (Evas *e) EINA_ARG_NONNULL(1);
1434 * Force immediate renderization of the given Evas canvas.
1436 * @param e The given canvas pointer.
1437 * @return A newly allocated list of updated rectangles of the canvas
1438 * (@c Eina_Rectangle structs). Free this list with
1439 * evas_render_updates_free().
1441 * This function forces an immediate renderization update of the given
1444 * @note This is a <b>very low level function</b>, which most of
1445 * Evas' users wouldn't care about. One would use it, for example, to
1446 * grab an Evas' canvas update regions and paint them back, using the
1447 * canvas' pixmap, on a displaying system working below Evas.
1449 * @note Evas is a stateful canvas. If no operations changing its
1450 * state took place since the last rendering action, you won't see no
1451 * changes and this call will be a no-op.
1453 * Example code follows.
1454 * @dontinclude evas-events.c
1455 * @skip add an obscured
1456 * @until d.obscured = !d.obscured;
1458 * See the full @ref Example_Evas_Events "example".
1460 * @ingroup Evas_Canvas
1462 EAPI Eina_List *evas_render_updates (Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
1465 * Free the rectangles returned by evas_render_updates().
1467 * @param updates The list of updated rectangles of the canvas.
1469 * This function removes the region from the render updates list. It
1470 * makes the region doesn't be render updated anymore.
1472 * @see evas_render_updates() for an example
1474 * @ingroup Evas_Canvas
1476 EAPI void evas_render_updates_free (Eina_List *updates);
1479 * Force renderization of the given canvas.
1481 * @param e The given canvas pointer.
1483 * @ingroup Evas_Canvas
1485 EAPI void evas_render (Evas *e) EINA_ARG_NONNULL(1);
1488 * Update the canvas internal objects but not triggering immediate
1491 * @param e The given canvas pointer.
1493 * This function updates the canvas internal objects not triggering
1494 * renderization. To force renderization function evas_render() should
1499 * @ingroup Evas_Canvas
1501 EAPI void evas_norender (Evas *e) EINA_ARG_NONNULL(1);
1504 * Make the canvas discard internally cached data used for rendering.
1506 * @param e The given canvas pointer.
1508 * This function flushes the arrays of delete, active and render objects.
1509 * Other things it may also discard are: shared memory segments,
1510 * temporary scratch buffers, cached data to avoid re-compute of that data etc.
1512 * @ingroup Evas_Canvas
1514 EAPI void evas_render_idle_flush (Evas *e) EINA_ARG_NONNULL(1);
1517 * Make the canvas discard as much data as possible used by the engine at
1520 * @param e The given canvas pointer.
1522 * This function will unload images, delete textures and much more, where
1523 * possible. You may also want to call evas_render_idle_flush() immediately
1524 * prior to this to perhaps discard a little more, though evas_render_dump()
1525 * should implicitly delete most of what evas_render_idle_flush() might
1528 * @ingroup Evas_Canvas
1530 EAPI void evas_render_dump (Evas *e) EINA_ARG_NONNULL(1);
1533 * @defgroup Evas_Output_Method Render Engine Functions
1535 * Functions that are used to set the render engine for a given
1536 * function, and then get that engine working.
1538 * The following code snippet shows how they can be used to
1539 * initialise an evas that uses the X11 software engine:
1542 * Evas_Engine_Info_Software_X11 *einfo;
1543 * extern Display *display;
1544 * extern Window win;
1548 * evas = evas_new();
1549 * evas_output_method_set(evas, evas_render_method_lookup("software_x11"));
1550 * evas_output_size_set(evas, 640, 480);
1551 * evas_output_viewport_set(evas, 0, 0, 640, 480);
1552 * einfo = (Evas_Engine_Info_Software_X11 *)evas_engine_info_get(evas);
1553 * einfo->info.display = display;
1554 * einfo->info.visual = DefaultVisual(display, DefaultScreen(display));
1555 * einfo->info.colormap = DefaultColormap(display, DefaultScreen(display));
1556 * einfo->info.drawable = win;
1557 * einfo->info.depth = DefaultDepth(display, DefaultScreen(display));
1558 * evas_engine_info_set(evas, (Evas_Engine_Info *)einfo);
1561 * @ingroup Evas_Canvas
1565 * Look up a numeric ID from a string name of a rendering engine.
1567 * @param name the name string of an engine
1568 * @return A numeric (opaque) ID for the rendering engine
1569 * @ingroup Evas_Output_Method
1571 * This function looks up a numeric return value for the named engine
1572 * in the string @p name. This is a normal C string, NUL byte
1573 * terminated. The name is case sensitive. If the rendering engine is
1574 * available, a numeric ID for that engine is returned that is not
1575 * 0. If the engine is not available, 0 is returned, indicating an
1578 * The programmer should NEVER rely on the numeric ID of an engine
1579 * unless it is returned by this function. Programs should NOT be
1580 * written accessing render method ID's directly, without first
1581 * obtaining it from this function.
1583 * @attention it is mandatory that one calls evas_init() before
1584 * looking up the render method.
1593 * evas = evas_new();
1596 * fprintf(stderr, "ERROR: Canvas creation failed. Fatal error.\n");
1599 * engine_id = evas_render_method_lookup("software_x11");
1602 * fprintf(stderr, "ERROR: Requested rendering engine is absent.\n");
1605 * evas_output_method_set(evas, engine_id);
1608 EAPI int evas_render_method_lookup (const char *name) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
1611 * List all the rendering engines compiled into the copy of the Evas library
1613 * @return A linked list whose data members are C strings of engine names
1614 * @ingroup Evas_Output_Method
1616 * Calling this will return a handle (pointer) to an Evas linked
1617 * list. Each node in the linked list will have the data pointer be a
1618 * (char *) pointer to the name string of the rendering engine
1619 * available. The strings should never be modified, neither should the
1620 * list be modified. This list should be cleaned up as soon as the
1621 * program no longer needs it using evas_render_method_list_free(). If
1622 * no engines are available from Evas, NULL will be returned.
1626 * Eina_List *engine_list, *l;
1627 * char *engine_name;
1629 * engine_list = evas_render_method_list();
1632 * fprintf(stderr, "ERROR: Evas supports no engines! Exit.\n");
1635 * printf("Available Evas Engines:\n");
1636 * EINA_LIST_FOREACH(engine_list, l, engine_name)
1637 * printf("%s\n", engine_name);
1638 * evas_render_method_list_free(engine_list);
1641 EAPI Eina_List *evas_render_method_list (void) EINA_WARN_UNUSED_RESULT;
1644 * This function should be called to free a list of engine names
1646 * @param list The Eina_List base pointer for the engine list to be freed
1647 * @ingroup Evas_Output_Method
1649 * When this function is called it will free the engine list passed in
1650 * as @p list. The list should only be a list of engines generated by
1651 * calling evas_render_method_list(). If @p list is NULL, nothing will
1656 * Eina_List *engine_list, *l;
1657 * char *engine_name;
1659 * engine_list = evas_render_method_list();
1662 * fprintf(stderr, "ERROR: Evas supports no engines! Exit.\n");
1665 * printf("Available Evas Engines:\n");
1666 * EINA_LIST_FOREACH(engine_list, l, engine_name)
1667 * printf("%s\n", engine_name);
1668 * evas_render_method_list_free(engine_list);
1671 EAPI void evas_render_method_list_free (Eina_List *list);
1675 * Sets the output engine for the given evas.
1677 * Once the output engine for an evas is set, any attempt to change it
1678 * will be ignored. The value for @p render_method can be found using
1679 * @ref evas_render_method_lookup .
1681 * @param e The given evas.
1682 * @param render_method The numeric engine value to use.
1684 * @attention it is mandatory that one calls evas_init() before
1685 * setting the output method.
1687 * @ingroup Evas_Output_Method
1689 EAPI void evas_output_method_set (Evas *e, int render_method) EINA_ARG_NONNULL(1);
1692 * Retrieves the number of the output engine used for the given evas.
1693 * @param e The given evas.
1694 * @return The ID number of the output engine being used. @c 0 is
1695 * returned if there is an error.
1696 * @ingroup Evas_Output_Method
1698 EAPI int evas_output_method_get (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
1702 * Retrieves the current render engine info struct from the given evas.
1704 * The returned structure is publicly modifiable. The contents are
1705 * valid until either @ref evas_engine_info_set or @ref evas_render
1708 * This structure does not need to be freed by the caller.
1710 * @param e The given evas.
1711 * @return A pointer to the Engine Info structure. @c NULL is returned if
1712 * an engine has not yet been assigned.
1713 * @ingroup Evas_Output_Method
1715 EAPI Evas_Engine_Info *evas_engine_info_get (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
1718 * Applies the engine settings for the given evas from the given @c
1719 * Evas_Engine_Info structure.
1721 * To get the Evas_Engine_Info structure to use, call @ref
1722 * evas_engine_info_get . Do not try to obtain a pointer to an
1723 * @c Evas_Engine_Info structure in any other way.
1725 * You will need to call this function at least once before you can
1726 * create objects on an evas or render that evas. Some engines allow
1727 * their settings to be changed more than once.
1729 * Once called, the @p info pointer should be considered invalid.
1731 * @param e The pointer to the Evas Canvas
1732 * @param info The pointer to the Engine Info to use
1733 * @return 1 if no error occurred, 0 otherwise
1734 * @ingroup Evas_Output_Method
1736 EAPI Eina_Bool evas_engine_info_set (Evas *e, Evas_Engine_Info *info) EINA_ARG_NONNULL(1);
1739 * @defgroup Evas_Output_Size Output and Viewport Resizing Functions
1741 * Functions that set and retrieve the output and viewport size of an
1744 * @ingroup Evas_Canvas
1748 * Sets the output size of the render engine of the given evas.
1750 * The evas will render to a rectangle of the given size once this
1751 * function is called. The output size is independent of the viewport
1752 * size. The viewport will be stretched to fill the given rectangle.
1754 * The units used for @p w and @p h depend on the engine used by the
1757 * @param e The given evas.
1758 * @param w The width in output units, usually pixels.
1759 * @param h The height in output units, usually pixels.
1760 * @ingroup Evas_Output_Size
1762 EAPI void evas_output_size_set (Evas *e, int w, int h) EINA_ARG_NONNULL(1);
1765 * Retrieve the output size of the render engine of the given evas.
1767 * The output size is given in whatever the output units are for the
1770 * If either @p w or @p h is @c NULL, then it is ignored. If @p e is
1771 * invalid, the returned results are undefined.
1773 * @param e The given evas.
1774 * @param w The pointer to an integer to store the width in.
1775 * @param h The pointer to an integer to store the height in.
1776 * @ingroup Evas_Output_Size
1778 EAPI void evas_output_size_get (const Evas *e, int *w, int *h) EINA_ARG_NONNULL(1);
1781 * Sets the output viewport of the given evas in evas units.
1783 * The output viewport is the area of the evas that will be visible to
1784 * the viewer. The viewport will be stretched to fit the output
1785 * target of the evas when rendering is performed.
1787 * @note The coordinate values do not have to map 1-to-1 with the output
1788 * target. However, it is generally advised that it is done for ease
1791 * @param e The given evas.
1792 * @param x The top-left corner x value of the viewport.
1793 * @param y The top-left corner y value of the viewport.
1794 * @param w The width of the viewport. Must be greater than 0.
1795 * @param h The height of the viewport. Must be greater than 0.
1796 * @ingroup Evas_Output_Size
1798 EAPI void evas_output_viewport_set (Evas *e, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h) EINA_ARG_NONNULL(1);
1801 * Get the render engine's output viewport co-ordinates in canvas units.
1802 * @param e The pointer to the Evas Canvas
1803 * @param x The pointer to a x variable to be filled in
1804 * @param y The pointer to a y variable to be filled in
1805 * @param w The pointer to a width variable to be filled in
1806 * @param h The pointer to a height variable to be filled in
1807 * @ingroup Evas_Output_Size
1809 * Calling this function writes the current canvas output viewport
1810 * size and location values into the variables pointed to by @p x, @p
1811 * y, @p w and @p h. On success the variables have the output
1812 * location and size values written to them in canvas units. Any of @p
1813 * x, @p y, @p w or @p h that are NULL will not be written to. If @p e
1814 * is invalid, the results are undefined.
1818 * extern Evas *evas;
1819 * Evas_Coord x, y, width, height;
1821 * evas_output_viewport_get(evas, &x, &y, &w, &h);
1824 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);
1827 * @defgroup Evas_Coord_Mapping_Group Coordinate Mapping Functions
1829 * Functions that are used to map coordinates from the canvas to the
1830 * screen or the screen to the canvas.
1832 * @ingroup Evas_Canvas
1836 * Convert/scale an ouput screen co-ordinate into canvas co-ordinates
1838 * @param e The pointer to the Evas Canvas
1839 * @param x The screen/output x co-ordinate
1840 * @return The screen co-ordinate translated to canvas unit co-ordinates
1841 * @ingroup Evas_Coord_Mapping_Group
1843 * This function takes in a horizontal co-ordinate as the @p x
1844 * parameter and converts it into canvas units, accounting for output
1845 * size, viewport size and location, returning it as the function
1846 * return value. If @p e is invalid, the results are undefined.
1850 * extern Evas *evas;
1851 * extern int screen_x;
1852 * Evas_Coord canvas_x;
1854 * canvas_x = evas_coord_screen_x_to_world(evas, screen_x);
1857 EAPI Evas_Coord evas_coord_screen_x_to_world (const Evas *e, int x) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
1860 * Convert/scale an ouput screen co-ordinate into canvas co-ordinates
1862 * @param e The pointer to the Evas Canvas
1863 * @param y The screen/output y co-ordinate
1864 * @return The screen co-ordinate translated to canvas unit co-ordinates
1865 * @ingroup Evas_Coord_Mapping_Group
1867 * This function takes in a vertical co-ordinate as the @p y parameter
1868 * and converts it into canvas units, accounting for output size,
1869 * viewport size and location, returning it as the function return
1870 * value. If @p e is invalid, the results are undefined.
1874 * extern Evas *evas;
1875 * extern int screen_y;
1876 * Evas_Coord canvas_y;
1878 * canvas_y = evas_coord_screen_y_to_world(evas, screen_y);
1881 EAPI Evas_Coord evas_coord_screen_y_to_world (const Evas *e, int y) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
1884 * Convert/scale a canvas co-ordinate into output screen co-ordinates
1886 * @param e The pointer to the Evas Canvas
1887 * @param x The canvas x co-ordinate
1888 * @return The output/screen co-ordinate translated to output co-ordinates
1889 * @ingroup Evas_Coord_Mapping_Group
1891 * This function takes in a horizontal co-ordinate as the @p x
1892 * parameter and converts it into output units, accounting for output
1893 * size, viewport size and location, returning it as the function
1894 * return value. If @p e is invalid, the results are undefined.
1898 * extern Evas *evas;
1900 * extern Evas_Coord canvas_x;
1902 * screen_x = evas_coord_world_x_to_screen(evas, canvas_x);
1905 EAPI int evas_coord_world_x_to_screen (const Evas *e, Evas_Coord x) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
1908 * Convert/scale a canvas co-ordinate into output screen co-ordinates
1910 * @param e The pointer to the Evas Canvas
1911 * @param y The canvas y co-ordinate
1912 * @return The output/screen co-ordinate translated to output co-ordinates
1913 * @ingroup Evas_Coord_Mapping_Group
1915 * This function takes in a vertical co-ordinate as the @p x parameter
1916 * and converts it into output units, accounting for output size,
1917 * viewport size and location, returning it as the function return
1918 * value. If @p e is invalid, the results are undefined.
1922 * extern Evas *evas;
1924 * extern Evas_Coord canvas_y;
1926 * screen_y = evas_coord_world_y_to_screen(evas, canvas_y);
1929 EAPI int evas_coord_world_y_to_screen (const Evas *e, Evas_Coord y) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
1932 * @defgroup Evas_Pointer_Group Pointer (Mouse) Functions
1934 * Functions that deal with the status of the pointer (mouse cursor).
1936 * @ingroup Evas_Canvas
1940 * This function returns the current known pointer co-ordinates
1942 * @param e The pointer to the Evas Canvas
1943 * @param x The pointer to an integer to be filled in
1944 * @param y The pointer to an integer to be filled in
1945 * @ingroup Evas_Pointer_Group
1947 * This function returns the current known screen/output co-ordinates
1948 * of the mouse pointer and sets the contents of the integers pointed
1949 * to by @p x and @p y to contain these co-ordinates. If @p e is not a
1950 * valid canvas the results of this function are undefined.
1954 * extern Evas *evas;
1955 * int mouse_x, mouse_y;
1957 * evas_pointer_output_xy_get(evas, &mouse_x, &mouse_y);
1958 * printf("Mouse is at screen position %i, %i\n", mouse_x, mouse_y);
1961 EAPI void evas_pointer_output_xy_get (const Evas *e, int *x, int *y) EINA_ARG_NONNULL(1);
1964 * This function returns the current known pointer co-ordinates
1966 * @param e The pointer to the Evas Canvas
1967 * @param x The pointer to a Evas_Coord to be filled in
1968 * @param y The pointer to a Evas_Coord to be filled in
1969 * @ingroup Evas_Pointer_Group
1971 * This function returns the current known canvas unit co-ordinates of
1972 * the mouse pointer and sets the contents of the Evas_Coords pointed
1973 * to by @p x and @p y to contain these co-ordinates. If @p e is not a
1974 * valid canvas the results of this function are undefined.
1978 * extern Evas *evas;
1979 * Evas_Coord mouse_x, mouse_y;
1981 * evas_pointer_output_xy_get(evas, &mouse_x, &mouse_y);
1982 * printf("Mouse is at canvas position %f, %f\n", mouse_x, mouse_y);
1985 EAPI void evas_pointer_canvas_xy_get (const Evas *e, Evas_Coord *x, Evas_Coord *y) EINA_ARG_NONNULL(1);
1988 * Returns a bitmask with the mouse buttons currently pressed, set to 1
1990 * @param e The pointer to the Evas Canvas
1991 * @return A bitmask of the currently depressed buttons on the cavas
1992 * @ingroup Evas_Pointer_Group
1994 * Calling this function will return a 32-bit integer with the
1995 * appropriate bits set to 1 that correspond to a mouse button being
1996 * depressed. This limits Evas to a mouse devices with a maximum of 32
1997 * buttons, but that is generally in excess of any host system's
1998 * pointing device abilities.
2000 * A canvas by default begins with no mouse buttons being pressed and
2001 * only calls to evas_event_feed_mouse_down(),
2002 * evas_event_feed_mouse_down_data(), evas_event_feed_mouse_up() and
2003 * evas_event_feed_mouse_up_data() will alter that.
2005 * The least significant bit corresponds to the first mouse button
2006 * (button 1) and the most significant bit corresponds to the last
2007 * mouse button (button 32).
2009 * If @p e is not a valid canvas, the return value is undefined.
2013 * extern Evas *evas;
2014 * int button_mask, i;
2016 * button_mask = evas_pointer_button_down_mask_get(evas);
2017 * printf("Buttons currently pressed:\n");
2018 * for (i = 0; i < 32; i++)
2020 * if ((button_mask & (1 << i)) != 0) printf("Button %i\n", i + 1);
2024 EAPI int evas_pointer_button_down_mask_get (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
2027 * Returns whether the mouse pointer is logically inside the canvas
2029 * @param e The pointer to the Evas Canvas
2030 * @return An integer that is 1 if the mouse is inside the canvas, 0 otherwise
2031 * @ingroup Evas_Pointer_Group
2033 * When this function is called it will return a value of either 0 or
2034 * 1, depending on if evas_event_feed_mouse_in(),
2035 * evas_event_feed_mouse_in_data(), or evas_event_feed_mouse_out(),
2036 * evas_event_feed_mouse_out_data() have been called to feed in a
2037 * mouse enter event into the canvas.
2039 * A return value of 1 indicates the mouse is logically inside the
2040 * canvas, and 0 implies it is logically outside the canvas.
2042 * A canvas begins with the mouse being assumed outside (0).
2044 * If @p e is not a valid canvas, the return value is undefined.
2048 * extern Evas *evas;
2050 * if (evas_pointer_inside_get(evas)) printf("Mouse is in!\n");
2051 * else printf("Mouse is out!\n");
2054 EAPI Eina_Bool evas_pointer_inside_get (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
2055 EAPI void evas_sync(Evas *e) EINA_ARG_NONNULL(1);
2058 * @defgroup Evas_Canvas_Events Canvas Events
2060 * Functions relating to canvas events, which are mainly reports on
2061 * its internal states changing (an object got focused, the rendering
2064 * Some of the funcions in this group are exemplified @ref
2065 * Example_Evas_Events "here".
2067 * @ingroup Evas_Canvas
2071 * @addtogroup Evas_Canvas_Events
2076 * Add (register) a callback function to a given canvas event.
2078 * @param e Canvas to attach a callback to
2079 * @param type The type of event that will trigger the callback
2080 * @param func The (callback) function to be called when the event is
2082 * @param data The data pointer to be passed to @p func
2084 * This function adds a function callback to the canvas @p e when the
2085 * event of type @p type occurs on it. The function pointer is @p
2088 * In the event of a memory allocation error during the addition of
2089 * the callback to the canvas, evas_alloc_error() should be used to
2090 * determine the nature of the error, if any, and the program should
2091 * sensibly try and recover.
2093 * A callback function must have the ::Evas_Event_Cb prototype
2094 * definition. The first parameter (@p data) in this definition will
2095 * have the same value passed to evas_event_callback_add() as the @p
2096 * data parameter, at runtime. The second parameter @p e is the canvas
2097 * pointer on which the event occurred. The third parameter @p
2098 * event_info is a pointer to a data structure that may or may not be
2099 * passed to the callback, depending on the event type that triggered
2100 * the callback. This is so because some events don't carry extra
2101 * context with them, but others do.
2103 * The event type @p type to trigger the function may be one of
2104 * #EVAS_CALLBACK_RENDER_FLUSH_PRE, #EVAS_CALLBACK_RENDER_FLUSH_POST,
2105 * #EVAS_CALLBACK_CANVAS_FOCUS_IN, #EVAS_CALLBACK_CANVAS_FOCUS_OUT,
2106 * #EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_IN and
2107 * #EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_OUT. This determines the kind of
2108 * event that will trigger the callback to be called. Only the last
2109 * two of the event types listed here provide useful event information
2110 * data -- a pointer to the recently focused Evas object. For the
2111 * others the @p event_info pointer is going to be @c NULL.
2114 * @dontinclude evas-events.c
2115 * @skip evas_event_callback_add(d.canvas, EVAS_CALLBACK_RENDER_FLUSH_PRE
2116 * @until two canvas event callbacks
2118 * Looking to the callbacks registered above,
2119 * @dontinclude evas-events.c
2120 * @skip called when our rectangle gets focus
2121 * @until let's have our events back
2123 * we see that the canvas flushes its rendering pipeline
2124 * (#EVAS_CALLBACK_RENDER_FLUSH_PRE) whenever the @c _resize_cb
2125 * routine takes place: it has to redraw that image at a different
2126 * size. Also, the callback on an object being focused comes just
2127 * after we focus it explicitly, on code.
2129 * See the full @ref Example_Evas_Events "example".
2131 * @note Be careful not to add the same callback multiple times, if
2132 * that's not what you want, because Evas won't check if a callback
2133 * existed before exactly as the one being registered (and thus, call
2134 * it more than once on the event, in this case). This would make
2135 * sense if you passed different functions and/or callback data, only.
2137 EAPI void evas_event_callback_add (Evas *e, Evas_Callback_Type type, Evas_Event_Cb func, const void *data) EINA_ARG_NONNULL(1, 3);
2140 * Add (register) a callback function to a given canvas event with a
2141 * non-default priority set. Except for the priority field, it's exactly the
2142 * same as @ref evas_event_callback_add
2144 * @param e Canvas to attach a callback to
2145 * @param type The type of event that will trigger the callback
2146 * @param priority The priority of the callback, lower values called first.
2147 * @param func The (callback) function to be called when the event is
2149 * @param data The data pointer to be passed to @p func
2151 * @see evas_event_callback_add
2154 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);
2157 * Delete a callback function from the canvas.
2159 * @param e Canvas to remove a callback from
2160 * @param type The type of event that was triggering the callback
2161 * @param func The function that was to be called when the event was triggered
2162 * @return The data pointer that was to be passed to the callback
2164 * This function removes the most recently added callback from the
2165 * canvas @p e which was triggered by the event type @p type and was
2166 * calling the function @p func when triggered. If the removal is
2167 * successful it will also return the data pointer that was passed to
2168 * evas_event_callback_add() when the callback was added to the
2169 * canvas. If not successful NULL will be returned.
2175 * void focus_in_callback(void *data, Evas *e, void *event_info);
2177 * my_data = evas_event_callback_del(ebject, EVAS_CALLBACK_CANVAS_FOCUS_IN, focus_in_callback);
2180 EAPI void *evas_event_callback_del (Evas *e, Evas_Callback_Type type, Evas_Event_Cb func) EINA_ARG_NONNULL(1, 3);
2183 * Delete (unregister) a callback function registered to a given
2186 * @param e Canvas to remove an event callback from
2187 * @param type The type of event that was triggering the callback
2188 * @param func The function that was to be called when the event was
2190 * @param data The data pointer that was to be passed to the callback
2191 * @return The data pointer that was to be passed to the callback
2193 * This function removes <b>the first</b> added callback from the
2194 * canvas @p e matching the event type @p type, the registered
2195 * function pointer @p func and the callback data pointer @p data. If
2196 * the removal is successful it will also return the data pointer that
2197 * was passed to evas_event_callback_add() (that will be the same as
2198 * the parameter) when the callback(s) was(were) added to the
2199 * canvas. If not successful @c NULL will be returned. A common use
2200 * would be to remove an exact match of a callback.
2203 * @dontinclude evas-events.c
2204 * @skip evas_event_callback_del_full(evas, EVAS_CALLBACK_RENDER_FLUSH_PRE,
2205 * @until _object_focus_in_cb, NULL);
2207 * See the full @ref Example_Evas_Events "example".
2209 * @note For deletion of canvas events callbacks filtering by just
2210 * type and function pointer, user evas_event_callback_del().
2212 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);
2215 * Push a callback on the post-event callback stack
2217 * @param e Canvas to push the callback on
2218 * @param func The function that to be called when the stack is unwound
2219 * @param data The data pointer to be passed to the callback
2221 * Evas has a stack of callbacks that get called after all the callbacks for
2222 * an event have triggered (all the objects it triggers on and al the callbacks
2223 * in each object triggered). When all these have been called, the stack is
2224 * unwond from most recently to least recently pushed item and removed from the
2225 * stack calling the callback set for it.
2227 * This is intended for doing reverse logic-like processing, example - when a
2228 * child object that happens to get the event later is meant to be able to
2229 * "steal" functions from a parent and thus on unwind of this stack hav its
2230 * function called first, thus being able to set flags, or return 0 from the
2231 * post-callback that stops all other post-callbacks in the current stack from
2232 * being called (thus basically allowing a child to take control, if the event
2233 * callback prepares information ready for taking action, but the post callback
2234 * actually does the action).
2237 EAPI void evas_post_event_callback_push (Evas *e, Evas_Object_Event_Post_Cb func, const void *data);
2240 * Remove a callback from the post-event callback stack
2242 * @param e Canvas to push the callback on
2243 * @param func The function that to be called when the stack is unwound
2245 * This removes a callback from the stack added with
2246 * evas_post_event_callback_push(). The first instance of the function in
2247 * the callback stack is removed from being executed when the stack is
2248 * unwound. Further instances may still be run on unwind.
2250 EAPI void evas_post_event_callback_remove (Evas *e, Evas_Object_Event_Post_Cb func);
2253 * Remove a callback from the post-event callback stack
2255 * @param e Canvas to push the callback on
2256 * @param func The function that to be called when the stack is unwound
2257 * @param data The data pointer to be passed to the callback
2259 * This removes a callback from the stack added with
2260 * evas_post_event_callback_push(). The first instance of the function and data
2261 * in the callback stack is removed from being executed when the stack is
2262 * unwound. Further instances may still be run on unwind.
2264 EAPI void evas_post_event_callback_remove_full (Evas *e, Evas_Object_Event_Post_Cb func, const void *data);
2267 * @defgroup Evas_Event_Freezing_Group Input Events Freezing Functions
2269 * Functions that deal with the freezing of input event processing of
2272 * There might be scenarios during a graphical user interface
2273 * program's use when the developer whishes the users wouldn't be able
2274 * to deliver input events to this application. It may, for example,
2275 * be the time for it to populate a view or to change some
2276 * layout. Assuming proper behavior with user interaction during this
2277 * exact time would be hard, as things are in a changing state. The
2278 * programmer can then tell the canvas to ignore input events,
2279 * bringing it back to normal behavior when he/she wants.
2281 * Some of the funcions in this group are exemplified @ref
2282 * Example_Evas_Events "here".
2284 * @ingroup Evas_Canvas_Events
2288 * @addtogroup Evas_Event_Freezing_Group
2293 * Freeze all input events processing.
2295 * @param e The canvas to freeze input events processing on.
2297 * This function will indicate to Evas that the canvas @p e is to have
2298 * all input event processing frozen until a matching
2299 * evas_event_thaw() function is called on the same canvas. All events
2300 * of this kind during the freeze will get @b discarded. Every freeze
2301 * call must be matched by a thaw call in order to completely thaw out
2302 * a canvas (i.e. these calls may be nested). The most common use is
2303 * when you don't want the user to interect with your user interface
2304 * when you're populating a view or changing the layout.
2307 * @dontinclude evas-events.c
2308 * @skip freeze input for 3 seconds
2310 * @dontinclude evas-events.c
2311 * @skip let's have our events back
2314 * See the full @ref Example_Evas_Events "example".
2316 * If you run that example, you'll see the canvas ignoring all input
2317 * events for 3 seconds, when the "f" key is pressed. In a more
2318 * realistic code we would be freezing while a toolkit or Edje was
2319 * doing some UI changes, thawing it back afterwards.
2321 EAPI void evas_event_freeze (Evas *e) EINA_ARG_NONNULL(1);
2324 * Thaw a canvas out after freezing (for input events).
2326 * @param e The canvas to thaw out.
2328 * This will thaw out a canvas after a matching evas_event_freeze()
2329 * call. If this call completely thaws out a canvas, i.e., there's no
2330 * other unbalanced call to evas_event_freeze(), events will start to
2331 * be processed again, but any "missed" events will @b not be
2334 * See evas_event_freeze() for an example.
2336 EAPI void evas_event_thaw (Evas *e) EINA_ARG_NONNULL(1);
2339 * Return the freeze count on input events of a given canvas.
2341 * @param e The canvas to fetch the freeze count from.
2343 * This returns the number of times the canvas has been told to freeze
2344 * input events. It is possible to call evas_event_freeze() multiple
2345 * times, and these must be matched by evas_event_thaw() calls. This
2346 * call allows the program to discover just how many times things have
2347 * been frozen in case it may want to break out of a deep freeze state
2348 * where the count is high.
2352 * extern Evas *evas;
2354 * while (evas_event_freeze_get(evas) > 0) evas_event_thaw(evas);
2358 EAPI int evas_event_freeze_get (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
2361 * After thaw of a canvas, re-evaluate the state of objects and call callbacks
2363 * @param e The canvas to evaluate after a thaw
2365 * This is normally called after evas_event_thaw() to re-evaluate mouse
2366 * containment and other states and thus also call callbacks for mouse in and
2367 * out on new objects if the state change demands it.
2369 EAPI void evas_event_thaw_eval (Evas *e) EINA_ARG_NONNULL(1);
2376 * @defgroup Evas_Event_Feeding_Group Input Events Feeding Functions
2378 * Functions to tell Evas that input events happened and should be
2381 * As explained in @ref intro_not_evas, Evas does not know how to poll
2382 * for input events, so the developer should do it and then feed such
2383 * events to the canvas to be processed. This is only required if
2384 * operating Evas directly. Modules such as Ecore_Evas do that for
2387 * Some of the funcions in this group are exemplified @ref
2388 * Example_Evas_Events "here".
2390 * @ingroup Evas_Canvas_Events
2394 * @addtogroup Evas_Event_Feeding_Group
2399 * Mouse down event feed.
2401 * @param e The given canvas pointer.
2402 * @param b The button number.
2403 * @param flags The evas button flags.
2404 * @param timestamp The timestamp of the mouse down event.
2405 * @param data The data for canvas.
2407 * This function will set some evas properties that is necessary when
2408 * the mouse button is pressed. It prepares information to be treated
2409 * by the callback function.
2412 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);
2415 * Mouse up event feed.
2417 * @param e The given canvas pointer.
2418 * @param b The button number.
2419 * @param flags evas button flags.
2420 * @param timestamp The timestamp of the mouse up event.
2421 * @param data The data for canvas.
2423 * This function will set some evas properties that is necessary when
2424 * the mouse button is released. It prepares information to be treated
2425 * by the callback function.
2428 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);
2431 * Mouse move event feed.
2433 * @param e The given canvas pointer.
2434 * @param x The horizontal position of the mouse pointer.
2435 * @param y The vertical position of the mouse pointer.
2436 * @param timestamp The timestamp of the mouse up event.
2437 * @param data The data for canvas.
2439 * This function will set some evas properties that is necessary when
2440 * the mouse is moved from its last position. It prepares information
2441 * to be treated by the callback function.
2444 EAPI void evas_event_feed_mouse_move (Evas *e, int x, int y, unsigned int timestamp, const void *data) EINA_ARG_NONNULL(1);
2447 * Mouse in event feed.
2449 * @param e The given canvas pointer.
2450 * @param timestamp The timestamp of the mouse up event.
2451 * @param data The data for canvas.
2453 * This function will set some evas properties that is necessary when
2454 * the mouse in event happens. It prepares information to be treated
2455 * by the callback function.
2458 EAPI void evas_event_feed_mouse_in (Evas *e, unsigned int timestamp, const void *data) EINA_ARG_NONNULL(1);
2461 * Mouse out event feed.
2463 * @param e The given canvas pointer.
2464 * @param timestamp Timestamp of the mouse up event.
2465 * @param data The data for canvas.
2467 * This function will set some evas properties that is necessary when
2468 * the mouse out event happens. It prepares information to be treated
2469 * by the callback function.
2472 EAPI void evas_event_feed_mouse_out (Evas *e, unsigned int timestamp, const void *data) EINA_ARG_NONNULL(1);
2473 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);
2474 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);
2475 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);
2478 * Mouse cancel event feed.
2480 * @param e The given canvas pointer.
2481 * @param timestamp The timestamp of the mouse up event.
2482 * @param data The data for canvas.
2484 * This function will call evas_event_feed_mouse_up() when a
2485 * mouse cancel event happens.
2488 EAPI void evas_event_feed_mouse_cancel (Evas *e, unsigned int timestamp, const void *data) EINA_ARG_NONNULL(1);
2491 * Mouse wheel event feed.
2493 * @param e The given canvas pointer.
2494 * @param direction The wheel mouse direction.
2495 * @param z How much mouse wheel was scrolled up or down.
2496 * @param timestamp The timestamp of the mouse up event.
2497 * @param data The data for canvas.
2499 * This function will set some evas properties that is necessary when
2500 * the mouse wheel is scrolled up or down. It prepares information to
2501 * be treated by the callback function.
2504 EAPI void evas_event_feed_mouse_wheel (Evas *e, int direction, int z, unsigned int timestamp, const void *data) EINA_ARG_NONNULL(1);
2507 * Key down event feed
2509 * @param e The canvas to thaw out
2510 * @param keyname Name of the key
2511 * @param key The key pressed.
2512 * @param string A String
2513 * @param compose The compose string
2514 * @param timestamp Timestamp of the mouse up event
2515 * @param data Data for canvas.
2517 * This function will set some evas properties that is necessary when
2518 * a key is pressed. It prepares information to be treated by the
2519 * callback function.
2522 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);
2527 * @param e The canvas to thaw out
2528 * @param keyname Name of the key
2529 * @param key The key released.
2530 * @param string string
2531 * @param compose compose
2532 * @param timestamp Timestamp of the mouse up event
2533 * @param data Data for canvas.
2535 * This function will set some evas properties that is necessary when
2536 * a key is released. It prepares information to be treated by the
2537 * callback function.
2540 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);
2545 * @param e The given canvas pointer.
2546 * @param hold The hold.
2547 * @param timestamp The timestamp of the mouse up event.
2548 * @param data The data for canvas.
2550 * This function makes the object to stop sending events.
2553 EAPI void evas_event_feed_hold (Evas *e, int hold, unsigned int timestamp, const void *data) EINA_ARG_NONNULL(1);
2558 * @param e The given canvas pointer.
2559 * @param event_copy the event to refeed
2560 * @param event_type Event type
2562 * This function re-feeds the event pointed by event_copy
2564 * This function call evas_event_feed_* functions, so it can
2565 * cause havoc if not used wisely. Please use it responsibly.
2567 EAPI void evas_event_refeed_event (Evas *e, void *event_copy, Evas_Callback_Type event_type); EINA_ARG_NONNULL(1);
2579 * @defgroup Evas_Image_Group Image Functions
2581 * Functions that deals with images at canvas level.
2583 * @ingroup Evas_Canvas
2587 * @addtogroup Evas_Image_Group
2592 * Flush the image cache of the canvas.
2594 * @param e The given evas pointer.
2596 * This function flushes image cache of canvas.
2599 EAPI void evas_image_cache_flush (Evas *e) EINA_ARG_NONNULL(1);
2602 * Reload the image cache
2604 * @param e The given evas pointer.
2606 * This function reloads the image cache of canvas.
2609 EAPI void evas_image_cache_reload (Evas *e) EINA_ARG_NONNULL(1);
2612 * Set the image cache.
2614 * @param e The given evas pointer.
2615 * @param size The cache size.
2617 * This function sets the image cache of canvas.
2620 EAPI void evas_image_cache_set (Evas *e, int size) EINA_ARG_NONNULL(1);
2623 * Set the image cache
2625 * @param e The given evas pointer.
2627 * This function returns the image cache of canvas.
2630 EAPI int evas_image_cache_get (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
2637 * @defgroup Evas_Font_Group Font Functions
2639 * Functions that deals with fonts.
2641 * @ingroup Evas_Canvas
2645 * Changes the font hinting for the given evas.
2647 * @param e The given evas.
2648 * @param hinting The hinting to use, one of #EVAS_FONT_HINTING_NONE,
2649 * #EVAS_FONT_HINTING_AUTO, #EVAS_FONT_HINTING_BYTECODE.
2650 * @ingroup Evas_Font_Group
2652 EAPI void evas_font_hinting_set (Evas *e, Evas_Font_Hinting_Flags hinting) EINA_ARG_NONNULL(1);
2655 * Retrieves the font hinting used by the given evas.
2657 * @param e The given evas to query.
2658 * @return The hinting in use, one of #EVAS_FONT_HINTING_NONE,
2659 * #EVAS_FONT_HINTING_AUTO, #EVAS_FONT_HINTING_BYTECODE.
2660 * @ingroup Evas_Font_Group
2662 EAPI Evas_Font_Hinting_Flags evas_font_hinting_get (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
2665 * Checks if the font hinting is supported by the given evas.
2667 * @param e The given evas to query.
2668 * @param hinting The hinting to use, one of #EVAS_FONT_HINTING_NONE,
2669 * #EVAS_FONT_HINTING_AUTO, #EVAS_FONT_HINTING_BYTECODE.
2670 * @return @c EINA_TRUE if it is supported, @c EINA_FALSE otherwise.
2671 * @ingroup Evas_Font_Group
2673 EAPI Eina_Bool evas_font_hinting_can_hint (const Evas *e, Evas_Font_Hinting_Flags hinting) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
2677 * Force the given evas and associated engine to flush its font cache.
2679 * @param e The given evas to flush font cache.
2680 * @ingroup Evas_Font_Group
2682 EAPI void evas_font_cache_flush (Evas *e) EINA_ARG_NONNULL(1);
2685 * Changes the size of font cache of the given evas.
2687 * @param e The given evas to flush font cache.
2688 * @param size The size, in bytes.
2690 * @ingroup Evas_Font_Group
2692 EAPI void evas_font_cache_set (Evas *e, int size) EINA_ARG_NONNULL(1);
2695 * Changes the size of font cache of the given evas.
2697 * @param e The given evas to flush font cache.
2698 * @return The size, in bytes.
2700 * @ingroup Evas_Font_Group
2702 EAPI int evas_font_cache_get (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
2706 * List of available font descriptions known or found by this evas.
2708 * The list depends on Evas compile time configuration, such as
2709 * fontconfig support, and the paths provided at runtime as explained
2710 * in @ref Evas_Font_Path_Group.
2712 * @param e The evas instance to query.
2713 * @return a newly allocated list of strings. Do not change the
2714 * strings. Be sure to call evas_font_available_list_free()
2715 * after you're done.
2717 * @ingroup Evas_Font_Group
2719 EAPI Eina_List *evas_font_available_list (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
2722 * Free list of font descriptions returned by evas_font_dir_available_list().
2724 * @param e The evas instance that returned such list.
2725 * @param available the list returned by evas_font_dir_available_list().
2727 * @ingroup Evas_Font_Group
2729 EAPI void evas_font_available_list_free(Evas *e, Eina_List *available) EINA_ARG_NONNULL(1);
2732 * @defgroup Evas_Font_Path_Group Font Path Functions
2734 * Functions that edit the paths being used to load fonts.
2736 * @ingroup Evas_Font_Group
2740 * Removes all font paths loaded into memory for the given evas.
2741 * @param e The given evas.
2742 * @ingroup Evas_Font_Path_Group
2744 EAPI void evas_font_path_clear (Evas *e) EINA_ARG_NONNULL(1);
2747 * Appends a font path to the list of font paths used by the given evas.
2748 * @param e The given evas.
2749 * @param path The new font path.
2750 * @ingroup Evas_Font_Path_Group
2752 EAPI void evas_font_path_append (Evas *e, const char *path) EINA_ARG_NONNULL(1, 2);
2755 * Prepends a font path to the list of font paths used by the given evas.
2756 * @param e The given evas.
2757 * @param path The new font path.
2758 * @ingroup Evas_Font_Path_Group
2760 EAPI void evas_font_path_prepend (Evas *e, const char *path) EINA_ARG_NONNULL(1, 2);
2763 * Retrieves the list of font paths used by the given evas.
2764 * @param e The given evas.
2765 * @return The list of font paths used.
2766 * @ingroup Evas_Font_Path_Group
2768 EAPI const Eina_List *evas_font_path_list (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
2771 * @defgroup Evas_Object_Group Generic Object Functions
2773 * Functions that manipulate generic Evas objects.
2775 * All Evas displaying units are Evas objects. One handles them all by
2776 * means of the handle ::Evas_Object. Besides Evas treats their
2777 * objects equally, they have @b types, which define their specific
2778 * behavior (and individual API).
2780 * Evas comes with a set of built-in object types:
2788 * These functions apply to @b any Evas object, whichever type thay
2791 * @note The built-in types which are most used are rectangles, text
2792 * and images. In fact, with these ones one can create 2D interfaces
2793 * of arbitrary complexity and EFL makes it easy.
2797 * @defgroup Evas_Object_Group_Basic Basic Object Manipulation
2799 * Methods that are broadly used, like those that change the color,
2800 * clippers and geometry of an Evas object.
2802 * An example on the most used functions in this group can be seen @ref
2803 * Example_Evas_Object_Manipulation "here".
2805 * For function dealing with stacking, the examples are gathered @ref
2806 * Example_Evas_Stacking "here".
2808 * @ingroup Evas_Object_Group
2812 * @addtogroup Evas_Object_Group_Basic
2817 * Clip one object to another.
2819 * @param obj The object to be clipped
2820 * @param clip The object to clip @p obj by
2822 * This function will clip the object @p obj to the area occupied by
2823 * the object @p clip. This means the object @p obj will only be
2824 * visible within the area occupied by the clipping object (@p clip).
2826 * The color of the object being clipped will be multiplied by the
2827 * color of the clipping one, so the resulting color for the former
2828 * will be <code>RESULT = (OBJ * CLIP) / (255 * 255)</code>, per color
2829 * element (red, green, blue and alpha).
2831 * Clipping is recursive, so clipping objects may be clipped by
2832 * others, and their color will in term be multiplied. You may @b not
2833 * set up circular clipping lists (i.e. object 1 clips object 2, which
2834 * clips object 1): the behavior of Evas is undefined in this case.
2836 * Objects which do not clip others are visible in the canvas as
2837 * normal; <b>those that clip one or more objects become invisible
2838 * themselves</b>, only affecting what they clip. If an object ceases
2839 * to have other objects being clipped by it, it will become visible
2842 * The visibility of an object affects the objects that are clipped by
2843 * it, so if the object clipping others is not shown (as in
2844 * evas_object_show()), the objects clipped by it will not be shown
2847 * If @p obj was being clipped by another object when this function is
2848 * called, it gets implicitly removed from the old clipper's domain
2849 * and is made now to be clipped by its new clipper.
2851 * The following figure illustrates some clipping in Evas:
2853 * @image html clipping.png
2854 * @image rtf clipping.png
2855 * @image latex clipping.eps
2857 * @note At the moment the <b>only objects that can validly be used to
2858 * clip other objects are rectangle objects</b>. All other object
2859 * types are invalid and the result of using them is undefined. The
2860 * clip object @p clip must be a valid object, but can also be @c
2861 * NULL, in which case the effect of this function is the same as
2862 * calling evas_object_clip_unset() on the @p obj object.
2865 * @dontinclude evas-object-manipulation.c
2866 * @skip solid white clipper (note that it's the default color for a
2867 * @until evas_object_show(d.clipper);
2869 * See the full @ref Example_Evas_Object_Manipulation "example".
2871 EAPI void evas_object_clip_set (Evas_Object *obj, Evas_Object *clip) EINA_ARG_NONNULL(1, 2);
2874 * Get the object clipping @p obj (if any).
2876 * @param obj The object to get the clipper from
2878 * This function returns the object clipping @p obj. If @p obj is
2879 * not being clipped at all, @c NULL is returned. The object @p obj
2880 * must be a valid ::Evas_Object.
2882 * See also evas_object_clip_set(), evas_object_clip_unset() and
2883 * evas_object_clipees_get().
2886 * @dontinclude evas-object-manipulation.c
2887 * @skip if (evas_object_clip_get(d.img) == d.clipper)
2890 * See the full @ref Example_Evas_Object_Manipulation "example".
2892 EAPI Evas_Object *evas_object_clip_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
2895 * Disable/cease clipping on a clipped @p obj object.
2897 * @param obj The object to cease clipping on
2899 * This function disables clipping for the object @p obj, if it was
2900 * already clipped, i.e., its visibility and color get detached from
2901 * the previous clipper. If it wasn't, this has no effect. The object
2902 * @p obj must be a valid ::Evas_Object.
2904 * See also evas_object_clip_set() (for an example),
2905 * evas_object_clipees_get() and evas_object_clip_get().
2908 EAPI void evas_object_clip_unset (Evas_Object *obj);
2911 * Return a list of objects currently clipped by @p obj.
2913 * @param obj The object to get a list of clippees from
2914 * @return a list of objects being clipped by @p obj
2916 * This returns the internal list handle that contains all objects
2917 * clipped by the object @p obj. If none are clipped by it, the call
2918 * returns @c NULL. This list is only valid until the clip list is
2919 * changed and should be fetched again with another call to
2920 * evas_object_clipees_get() if any objects being clipped by this
2921 * object are unclipped, clipped by a new object, deleted or get the
2922 * clipper deleted. These operations will invalidate the list
2923 * returned, so it should not be used anymore after that point. Any
2924 * use of the list after this may have undefined results, possibly
2925 * leading to crashes. The object @p obj must be a valid
2928 * See also evas_object_clip_set(), evas_object_clip_unset() and
2929 * evas_object_clip_get().
2933 * extern Evas_Object *obj;
2934 * Evas_Object *clipper;
2936 * clipper = evas_object_clip_get(obj);
2939 * Eina_List *clippees, *l;
2940 * Evas_Object *obj_tmp;
2942 * clippees = evas_object_clipees_get(clipper);
2943 * printf("Clipper clips %i objects\n", eina_list_count(clippees));
2944 * EINA_LIST_FOREACH(clippees, l, obj_tmp)
2945 * evas_object_show(obj_tmp);
2949 EAPI const Eina_List *evas_object_clipees_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
2953 * Sets or unsets a given object as the currently focused one on its
2956 * @param obj The object to be focused or unfocused.
2957 * @param focus @c EINA_TRUE, to set it as focused or @c EINA_FALSE,
2958 * to take away the focus from it.
2960 * Changing focus only affects where (key) input events go. There can
2961 * be only one object focused at any time. If @p focus is @c
2962 * EINA_TRUE, @p obj will be set as the currently focused object and
2963 * it will receive all keyboard events that are not exclusive key
2964 * grabs on other objects.
2967 * @dontinclude evas-events.c
2968 * @skip evas_object_focus_set
2969 * @until evas_object_focus_set
2971 * See the full example @ref Example_Evas_Events "here".
2973 * @see evas_object_focus_get
2974 * @see evas_focus_get
2975 * @see evas_object_key_grab
2976 * @see evas_object_key_ungrab
2978 EAPI void evas_object_focus_set (Evas_Object *obj, Eina_Bool focus) EINA_ARG_NONNULL(1);
2981 * Retrieve whether an object has the focus.
2983 * @param obj The object to retrieve focus information from.
2984 * @return @c EINA_TRUE if the object has the focus, @c EINA_FALSE
2987 * If the passed object is the currently focused one, @c EINA_TRUE is
2988 * returned. @c EINA_FALSE is returned, otherwise.
2991 * @dontinclude evas-events.c
2993 * @until something is bad
2995 * See the full example @ref Example_Evas_Events "here".
2997 * @see evas_object_focus_set
2998 * @see evas_focus_get
2999 * @see evas_object_key_grab
3000 * @see evas_object_key_ungrab
3002 EAPI Eina_Bool evas_object_focus_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
3006 * Sets the layer of the its canvas that the given object will be part
3009 * @param obj The given Evas object.
3010 * @param l The number of the layer to place the object on.
3011 * Must be between #EVAS_LAYER_MIN and #EVAS_LAYER_MAX.
3013 * If you don't use this function, you'll be dealing with an @b unique
3014 * layer of objects, the default one. Additional layers are handy when
3015 * you don't want a set of objects to interfere with another set with
3016 * regard to @b stacking. Two layers are completely disjoint in that
3019 * This is a low-level function, which you'd be using when something
3020 * should be always on top, for example.
3022 * @warning Be careful, it doesn't make sense to change the layer of
3023 * smart objects' children. Smart objects have a layer of their own,
3024 * which should contain all their children objects.
3026 * @see evas_object_layer_get()
3028 EAPI void evas_object_layer_set (Evas_Object *obj, short l) EINA_ARG_NONNULL(1);
3031 * Retrieves the layer of its canvas that the given object is part of.
3033 * @param obj The given Evas object to query layer from
3034 * @return Number of the its layer
3036 * @see evas_object_layer_set()
3038 EAPI short evas_object_layer_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
3042 * Sets the name of the given Evas object to the given name.
3044 * @param obj The given object.
3045 * @param name The given name.
3047 * There might be occasions where one would like to name his/her
3051 * @dontinclude evas-events.c
3052 * @skip d.bg = evas_object_rectangle_add(d.canvas);
3053 * @until evas_object_name_set(d.bg, "our dear rectangle");
3055 * See the full @ref Example_Evas_Events "example".
3057 EAPI void evas_object_name_set (Evas_Object *obj, const char *name) EINA_ARG_NONNULL(1);
3060 * Retrieves the name of the given Evas object.
3062 * @param obj The given object.
3063 * @return The name of the object or @c NULL, if no name has been given
3067 * @dontinclude evas-events.c
3068 * @skip fprintf(stdout, "An object got focused: %s\n",
3069 * @until evas_focus_get
3071 * See the full @ref Example_Evas_Events "example".
3073 EAPI const char *evas_object_name_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
3077 * Increments object reference count to defer its deletion.
3079 * @param obj The given Evas object to reference
3081 * This increments the reference count of an object, which if greater
3082 * than 0 will defer deletion by evas_object_del() until all
3083 * references are released back (counter back to 0). References cannot
3084 * go below 0 and unreferencing past that will result in the reference
3085 * count being limited to 0. References are limited to <c>2^32 - 1</c>
3086 * for an object. Referencing it more than this will result in it
3087 * being limited to this value.
3089 * @see evas_object_unref()
3090 * @see evas_object_del()
3092 * @note This is a <b>very simple<b> reference counting mechanism! For
3093 * instance, Evas is not ready to check for pending references on a
3094 * canvas deletion, or things like that. This is useful on scenarios
3095 * where, inside a code block, callbacks exist which would possibly
3096 * delete an object we are operating on afterwards. Then, one would
3097 * evas_object_ref() it on the beginning of the block and
3098 * evas_object_unref() it on the end. It would then be deleted at this
3099 * point, if it should be.
3103 * evas_object_ref(obj);
3106 * evas_object_smart_callback_call(obj, SIG_SELECTED, NULL);
3107 * // more action here...
3108 * evas_object_unref(obj);
3111 * @ingroup Evas_Object_Group_Basic
3114 EAPI void evas_object_ref (Evas_Object *obj);
3117 * Decrements object reference count.
3119 * @param obj The given Evas object to unreference
3121 * This decrements the reference count of an object. If the object has
3122 * had evas_object_del() called on it while references were more than
3123 * 0, it will be deleted at the time this function is called and puts
3124 * the counter back to 0. See evas_object_ref() for more information.
3126 * @see evas_object_ref() (for an example)
3127 * @see evas_object_del()
3129 * @ingroup Evas_Object_Group_Basic
3132 EAPI void evas_object_unref (Evas_Object *obj);
3136 * Marks the given Evas object for deletion (when Evas will free its
3139 * @param obj The given Evas object.
3141 * This call will mark @p obj for deletion, which will take place
3142 * whenever it has no more references to it (see evas_object_ref() and
3143 * evas_object_unref()).
3145 * At actual deletion time, which may or may not be just after this
3146 * call, ::EVAS_CALLBACK_DEL and ::EVAS_CALLBACK_FREE callbacks will
3147 * be called. If the object currently had the focus, its
3148 * ::EVAS_CALLBACK_FOCUS_OUT callback will also be called.
3150 * @see evas_object_ref()
3151 * @see evas_object_unref()
3153 * @ingroup Evas_Object_Group_Basic
3155 EAPI void evas_object_del (Evas_Object *obj) EINA_ARG_NONNULL(1);
3158 * Move the given Evas object to the given location inside its
3161 * @param obj The given Evas object.
3162 * @param x X position to move the object to, in canvas units.
3163 * @param y Y position to move the object to, in canvas units.
3165 * Besides being moved, the object's ::EVAS_CALLBACK_MOVE callback
3168 * @note Naturally, newly created objects are placed at the canvas'
3169 * origin: <code>0, 0</code>.
3172 * @dontinclude evas-object-manipulation.c
3173 * @skip evas_object_image_border_set(d.clipper_border, 3, 3, 3, 3);
3174 * @until evas_object_show
3176 * See the full @ref Example_Evas_Object_Manipulation "example".
3178 * @ingroup Evas_Object_Group_Basic
3180 EAPI void evas_object_move (Evas_Object *obj, Evas_Coord x, Evas_Coord y) EINA_ARG_NONNULL(1);
3183 * Changes the size of the given Evas object.
3185 * @param obj The given Evas object.
3186 * @param w The new width of the Evas object.
3187 * @param h The new height of the Evas object.
3189 * Besides being resized, the object's ::EVAS_CALLBACK_RESIZE callback
3192 * @note Newly created objects have zeroed dimensions. Then, you most
3193 * probably want to use evas_object_resize() on them after they are
3196 * @note Be aware that resizing an object changes its drawing area,
3197 * but that does imply the object is rescaled! For instance, images
3198 * are filled inside their drawing area using the specifications of
3199 * evas_object_image_fill_set(). Thus to scale the image to match
3200 * exactly your drawing area, you need to change the
3201 * evas_object_image_fill_set() as well.
3203 * @note This is more evident in images, but text, textblock, lines
3204 * and polygons will behave similarly. Check their specific APIs to
3205 * know how to achieve your desired behavior. Consider the following
3209 * // rescale image to fill exactly its area without tiling:
3210 * evas_object_resize(img, w, h);
3211 * evas_object_image_fill_set(img, 0, 0, w, h);
3214 * @ingroup Evas_Object_Group_Basic
3216 EAPI void evas_object_resize (Evas_Object *obj, Evas_Coord w, Evas_Coord h) EINA_ARG_NONNULL(1);
3219 * Retrieves the position and (rectangular) size of the given Evas
3222 * @param obj The given Evas object.
3223 * @param x Pointer to an integer in which to store the X coordinate
3225 * @param y Pointer to an integer in which to store the Y coordinate
3227 * @param w Pointer to an integer in which to store the width of the
3229 * @param h Pointer to an integer in which to store the height of the
3232 * The position, naturally, will be relative to the top left corner of
3233 * the canvas' viewport.
3235 * @note Use @c NULL pointers on the geometry components you're not
3236 * interested in: they'll be ignored by the function.
3239 * @dontinclude evas-events.c
3240 * @skip int w, h, cw, ch;
3243 * See the full @ref Example_Evas_Events "example".
3245 * @ingroup Evas_Object_Group_Basic
3247 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);
3251 * Makes the given Evas object visible.
3253 * @param obj The given Evas object.
3255 * Besides becoming visible, the object's ::EVAS_CALLBACK_SHOW
3256 * callback will be called.
3258 * @see evas_object_hide() for more on object visibility.
3259 * @see evas_object_visible_get()
3261 * @ingroup Evas_Object_Group_Basic
3263 EAPI void evas_object_show (Evas_Object *obj) EINA_ARG_NONNULL(1);
3266 * Makes the given Evas object invisible.
3268 * @param obj The given Evas object.
3270 * Hidden objects, besides not being shown at all in your canvas,
3271 * won't be checked for changes on the canvas rendering
3272 * process. Furthermore, they will not catch input events. Thus, they
3273 * are much ligher (in processing needs) than an object that is
3274 * invisible due to indirect causes, such as being clipped or out of
3275 * the canvas' viewport.
3277 * Besides becoming hidden, @p obj object's ::EVAS_CALLBACK_SHOW
3278 * callback will be called.
3280 * @note All objects are created in the hidden state! If you want them
3281 * shown, use evas_object_show() after their creation.
3283 * @see evas_object_show()
3284 * @see evas_object_visible_get()
3287 * @dontinclude evas-object-manipulation.c
3288 * @skip if (evas_object_visible_get(d.clipper))
3291 * See the full @ref Example_Evas_Object_Manipulation "example".
3293 * @ingroup Evas_Object_Group_Basic
3295 EAPI void evas_object_hide (Evas_Object *obj) EINA_ARG_NONNULL(1);
3298 * Retrieves whether or not the given Evas object is visible.
3300 * @param obj The given Evas object.
3301 * @return @c EINA_TRUE if the object is visible, @c EINA_FALSE
3304 * This retrieves an object's visibily as the one enforced by
3305 * evas_object_show() and evas_object_hide().
3307 * @note The value returned isn't, by any means, influenced by
3308 * clippers covering @obj, it being out of its canvas' viewport or
3309 * stacked below other object.
3311 * @see evas_object_show()
3312 * @see evas_object_hide() (for an example)
3314 * @ingroup Evas_Object_Group_Basic
3316 EAPI Eina_Bool evas_object_visible_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
3320 * Sets the general/main color of the given Evas object to the given
3323 * @param obj The given Evas object.
3324 * @param r The red component of the given color.
3325 * @param g The green component of the given color.
3326 * @param b The blue component of the given color.
3327 * @param a The alpha component of the given color.
3329 * @see evas_object_color_get() (for an example)
3331 * @ingroup Evas_Object_Group_Basic
3333 EAPI void evas_object_color_set (Evas_Object *obj, int r, int g, int b, int a) EINA_ARG_NONNULL(1);
3336 * Retrieves the general/main color of the given Evas object.
3338 * @param obj The given Evas object to retrieve color from.
3339 * @param r Pointer to an integer in which to store the red component
3341 * @param g Pointer to an integer in which to store the green
3342 * component of the color.
3343 * @param b Pointer to an integer in which to store the blue component
3345 * @param a Pointer to an integer in which to store the alpha
3346 * component of the color.
3348 * Retrieves the “main” color's RGB component (and alpha channel)
3349 * values, <b>which range from 0 to 255</b>. For the alpha channel,
3350 * which defines the object's transparency level, the former value
3351 * means totally trasparent, while the latter means opaque.
3353 * Usually you’ll use this attribute for text and rectangle objects,
3354 * where the “main” color is their unique one. If set for objects
3355 * which themselves have colors, like the images one, those colors get
3356 * modulated by this one.
3358 * @note All newly created Evas rectangles get the default color
3359 * values of <code>255 255 255 255</code> (opaque white).
3361 * @note Use @c NULL pointers on the components you're not interested
3362 * in: they'll be ignored by the function.
3365 * @dontinclude evas-object-manipulation.c
3366 * @skip int alpha, r, g, b;
3369 * See the full @ref Example_Evas_Object_Manipulation "example".
3371 * @ingroup Evas_Object_Group_Basic
3373 EAPI void evas_object_color_get (const Evas_Object *obj, int *r, int *g, int *b, int *a) EINA_ARG_NONNULL(1);
3377 * Retrieves the Evas canvas that the given object lives on.
3379 * @param obj The given Evas object.
3380 * @return A pointer to the canvas where the object is on.
3382 * This function is most useful at code contexts where you need to
3383 * operate on the canvas but have only the object pointer.
3385 * @ingroup Evas_Object_Group_Basic
3387 EAPI Evas *evas_object_evas_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
3390 * Retrieves the type of the given Evas object.
3392 * @param obj The given object.
3393 * @return The type of the object.
3395 * For Evas' builtin types, the return strings will be one of:
3396 * - <c>"rectangle"</c>,
3398 * - <c>"polygon"</c>,
3400 * - <c>"textblock"</c> and
3403 * For Evas smart objects (see @ref Evas_Smart_Group), the name of the
3404 * smart class itself is returned on this call. For the built-in smart
3405 * objects, these names are:
3406 * - <c>"EvasObjectSmartClipped"</c>, for the clipped smart object
3407 * - <c>"Evas_Object_Box"</c>, for the box object and
3408 * - <c>"Evas_Object_Table"</c>, for the table object.
3411 * @dontinclude evas-object-manipulation.c
3412 * @skip d.img = evas_object_image_filled_add(d.canvas);
3413 * @until border on the
3415 * See the full @ref Example_Evas_Object_Manipulation "example".
3417 EAPI const char *evas_object_type_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
3420 * Raise @p obj to the bottom of its layer.
3422 * @param obj the object to raise
3424 * @p obj will, then, be the highest one in the layer it belongs
3425 * to. Object on other layers won't get touched.
3427 * @see evas_object_stack_above()
3428 * @see evas_object_stack_below()
3429 * @see evas_object_lower()
3431 EAPI void evas_object_raise (Evas_Object *obj) EINA_ARG_NONNULL(1);
3434 * Lower @p obj to the bottom of its layer.
3436 * @param obj the object to lower
3438 * @p obj will, then, be the lowest one in the layer it belongs
3439 * to. Objects on other layers won't get touched.
3441 * @see evas_object_stack_above()
3442 * @see evas_object_stack_below()
3443 * @see evas_object_raise()
3445 EAPI void evas_object_lower (Evas_Object *obj) EINA_ARG_NONNULL(1);
3448 * Stack @p obj immediately above @p above
3450 * @param obj the object to stack
3451 * @param above the object above which to stack
3453 * Objects, in a given canvas, are stacked in the order they get added
3454 * to it. This means that, if they overlap, the highest ones will
3455 * cover the lowest ones, in that order. This function is a way to
3456 * change the stacking order for the objects.
3458 * This function is intended to be used with <b>objects belonging to
3459 * the same layer</b> in a given canvas, otherwise it will fail (and
3460 * accomplish nothing).
3462 * If you have smart objects on your canvas and @p obj is a member of
3463 * one of them, then @p above must also be a member of the same
3466 * Similarly, if @p obj is not a member of a smart object, @p above
3467 * must not be either.
3469 * @see evas_object_layer_get()
3470 * @see evas_object_layer_set()
3471 * @see evas_object_stack_below()
3473 EAPI void evas_object_stack_above (Evas_Object *obj, Evas_Object *above) EINA_ARG_NONNULL(1, 2);
3476 * Stack @p obj immediately below @p below
3478 * @param obj the object to stack
3479 * @param below the object below which to stack
3481 * Objects, in a given canvas, are stacked in the order they get added
3482 * to it. This means that, if they overlap, the highest ones will
3483 * cover the lowest ones, in that order. This function is a way to
3484 * change the stacking order for the objects.
3486 * This function is intended to be used with <b>objects belonging to
3487 * the same layer</b> in a given canvas, otherwise it will fail (and
3488 * accomplish nothing).
3490 * If you have smart objects on your canvas and @p obj is a member of
3491 * one of them, then @p below must also be a member of the same
3494 * Similarly, if @p obj is not a member of a smart object, @p below
3495 * must not be either.
3497 * @see evas_object_layer_get()
3498 * @see evas_object_layer_set()
3499 * @see evas_object_stack_below()
3501 EAPI void evas_object_stack_below (Evas_Object *obj, Evas_Object *below) EINA_ARG_NONNULL(1, 2);
3504 * Get the Evas object stacked right above @p obj
3506 * @param obj an #Evas_Object
3507 * @return the #Evas_Object directly above @p obj, if any, or @c NULL,
3510 * This function will traverse layers in its search, if there are
3511 * objects on layers above the one @p obj is placed at.
3513 * @see evas_object_layer_get()
3514 * @see evas_object_layer_set()
3515 * @see evas_object_below_get()
3518 EAPI Evas_Object *evas_object_above_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
3521 * Get the Evas object stacked right below @p obj
3523 * @param obj an #Evas_Object
3524 * @return the #Evas_Object directly below @p obj, if any, or @c NULL,
3527 * This function will traverse layers in its search, if there are
3528 * objects on layers below the one @p obj is placed at.
3530 * @see evas_object_layer_get()
3531 * @see evas_object_layer_set()
3532 * @see evas_object_below_get()
3534 EAPI Evas_Object *evas_object_below_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
3541 * @defgroup Evas_Object_Group_Events Object Events
3543 * Objects generate events when they are moved, resized, when their
3544 * visibility change, when they are deleted and so on. These methods
3545 * allow one to be notified about and to handle such events.
3547 * Objects also generate events on input (keyboard and mouse), if they
3548 * accept them (are visible, focused, etc).
3550 * For each of those events, Evas provides a way for one to register
3551 * callback functions to be issued just after they happen.
3553 * The following figure illustrates some Evas (event) callbacks:
3555 * @image html evas-callbacks.png
3556 * @image rtf evas-callbacks.png
3557 * @image latex evas-callbacks.eps
3559 * Thees events have their values in the #Evas_Callback_Type
3560 * enumeration, which has also ones happening on the canvas level (se
3561 * #Evas_Canvas_Events).
3563 * Examples on this group of functions can be found @ref
3564 * Example_Evas_Stacking "here" and @ref Example_Evas_Events "here".
3566 * @ingroup Evas_Object_Group
3570 * @addtogroup Evas_Object_Group_Events
3575 * Add (register) a callback function to a given Evas object event.
3577 * @param obj Object to attach a callback to
3578 * @param type The type of event that will trigger the callback
3579 * @param func The function to be called when the event is triggered
3580 * @param data The data pointer to be passed to @p func
3582 * This function adds a function callback to an object when the event
3583 * of type @p type occurs on object @p obj. The function is @p func.
3585 * In the event of a memory allocation error during addition of the
3586 * callback to the object, evas_alloc_error() should be used to
3587 * determine the nature of the error, if any, and the program should
3588 * sensibly try and recover.
3590 * A callback function must have the ::Evas_Object_Event_Cb prototype
3591 * definition. The first parameter (@p data) in this definition will
3592 * have the same value passed to evas_object_event_callback_add() as
3593 * the @p data parameter, at runtime. The second parameter @p e is the
3594 * canvas pointer on which the event occurred. The third parameter is
3595 * a pointer to the object on which event occurred. Finally, the
3596 * fourth parameter @p event_info is a pointer to a data structure
3597 * that may or may not be passed to the callback, depending on the
3598 * event type that triggered the callback. This is so because some
3599 * events don't carry extra context with them, but others do.
3601 * The event type @p type to trigger the function may be one of
3602 * #EVAS_CALLBACK_MOUSE_IN, #EVAS_CALLBACK_MOUSE_OUT,
3603 * #EVAS_CALLBACK_MOUSE_DOWN, #EVAS_CALLBACK_MOUSE_UP,
3604 * #EVAS_CALLBACK_MOUSE_MOVE, #EVAS_CALLBACK_MOUSE_WHEEL,
3605 * #EVAS_CALLBACK_MULTI_DOWN, #EVAS_CALLBACK_MULTI_UP,
3606 * #EVAS_CALLBACK_MULTI_MOVE, #EVAS_CALLBACK_FREE,
3607 * #EVAS_CALLBACK_KEY_DOWN, #EVAS_CALLBACK_KEY_UP,
3608 * #EVAS_CALLBACK_FOCUS_IN, #EVAS_CALLBACK_FOCUS_OUT,
3609 * #EVAS_CALLBACK_SHOW, #EVAS_CALLBACK_HIDE, #EVAS_CALLBACK_MOVE,
3610 * #EVAS_CALLBACK_RESIZE, #EVAS_CALLBACK_RESTACK, #EVAS_CALLBACK_DEL,
3611 * #EVAS_CALLBACK_HOLD, #EVAS_CALLBACK_CHANGED_SIZE_HINTS,
3612 * #EVAS_CALLBACK_IMAGE_PRELOADED or #EVAS_CALLBACK_IMAGE_UNLOADED.
3614 * This determines the kind of event that will trigger the callback.
3615 * What follows is a list explaining better the nature of each type of
3616 * event, along with their associated @p event_info pointers:
3618 * - #EVAS_CALLBACK_MOUSE_IN: @p event_info is a pointer to an
3619 * #Evas_Event_Mouse_In struct\n\n
3620 * This event is triggered when the mouse pointer enters the area
3621 * (not shaded by other objects) of the object @p obj. This may
3622 * occur by the mouse pointer being moved by
3623 * evas_event_feed_mouse_move() calls, or by the object being shown,
3624 * raised, moved, resized, or other objects being moved out of the
3625 * way, hidden or lowered, whatever may cause the mouse pointer to
3626 * get on top of @p obj, having been on top of another object
3629 * - #EVAS_CALLBACK_MOUSE_OUT: @p event_info is a pointer to an
3630 * #Evas_Event_Mouse_Out struct\n\n
3631 * This event is triggered exactly like #EVAS_CALLBACK_MOUSE_IN is,
3632 * but it occurs when the mouse pointer exits an object's area. Note
3633 * that no mouse out events will be reported if the mouse pointer is
3634 * implicitly grabbed to an object (mouse buttons are down, having
3635 * been pressed while the pointer was over that object). In these
3636 * cases, mouse out events will be reported once all buttons are
3637 * released, if the mouse pointer has left the object's area. The
3638 * indirect ways of taking off the mouse pointer from an object,
3639 * like cited above, for #EVAS_CALLBACK_MOUSE_IN, also apply here,
3642 * - #EVAS_CALLBACK_MOUSE_DOWN: @p event_info is a pointer to an
3643 * #Evas_Event_Mouse_Down struct\n\n
3644 * This event is triggered by a mouse button being pressed while the
3645 * mouse pointer is over an object. If the pointer mode for Evas is
3646 * #EVAS_OBJECT_POINTER_MODE_AUTOGRAB (default), this causes this
3647 * object to <b>passively grab the mouse</b> until all mouse buttons
3648 * have been released: all future mouse events will be reported to
3649 * only this object until no buttons are down. That includes mouse
3650 * move events, mouse in and mouse out events, and further button
3651 * presses. When all buttons are released, event propagation will
3652 * occur as normal (see #Evas_Object_Pointer_Mode).
3654 * - #EVAS_CALLBACK_MOUSE_UP: @p event_info is a pointer to an
3655 * #Evas_Event_Mouse_Up struct\n\n
3656 * This event is triggered by a mouse button being released while
3657 * the mouse pointer is over an object's area (or when passively
3658 * grabbed to an object).
3660 * - #EVAS_CALLBACK_MOUSE_MOVE: @p event_info is a pointer to an
3661 * #Evas_Event_Mouse_Move struct\n\n
3662 * This event is triggered by the mouse pointer being moved while
3663 * over an object's area (or while passively grabbed to an object).
3665 * - #EVAS_CALLBACK_MOUSE_WHEEL: @p event_info is a pointer to an
3666 * #Evas_Event_Mouse_Wheel struct\n\n
3667 * This event is triggered by the mouse wheel being rolled while the
3668 * mouse pointer is over an object (or passively grabbed to an
3671 * - #EVAS_CALLBACK_MULTI_DOWN: @p event_info is a pointer to an
3672 * #Evas_Event_Multi_Down struct
3674 * - #EVAS_CALLBACK_MULTI_UP: @p event_info is a pointer to an
3675 * #Evas_Event_Multi_Up struct
3677 * - #EVAS_CALLBACK_MULTI_MOVE: @p event_info is a pointer to an
3678 * #Evas_Event_Multi_Move struct
3680 * - #EVAS_CALLBACK_FREE: @p event_info is @c NULL \n\n
3681 * This event is triggered just before Evas is about to free all
3682 * memory used by an object and remove all references to it. This is
3683 * useful for programs to use if they attached data to an object and
3684 * want to free it when the object is deleted. The object is still
3685 * valid when this callback is called, but after it returns, there
3686 * is no guarantee on the object's validity.
3688 * - #EVAS_CALLBACK_KEY_DOWN: @p event_info is a pointer to an
3689 * #Evas_Event_Key_Down struct\n\n
3690 * This callback is called when a key is pressed and the focus is on
3691 * the object, or a key has been grabbed to a particular object
3692 * which wants to intercept the key press regardless of what object
3695 * - #EVAS_CALLBACK_KEY_UP: @p event_info is a pointer to an
3696 * #Evas_Event_Key_Up struct \n\n
3697 * This callback is called when a key is released and the focus is
3698 * on the object, or a key has been grabbed to a particular object
3699 * which wants to intercept the key release regardless of what
3700 * object has the focus.
3702 * - #EVAS_CALLBACK_FOCUS_IN: @p event_info is @c NULL \n\n
3703 * This event is called when an object gains the focus. When it is
3704 * called the object has already gained the focus.
3706 * - #EVAS_CALLBACK_FOCUS_OUT: @p event_info is @c NULL \n\n
3707 * This event is triggered when an object loses the focus. When it
3708 * is called the object has already lost the focus.
3710 * - #EVAS_CALLBACK_SHOW: @p event_info is @c NULL \n\n
3711 * This event is triggered by the object being shown by
3712 * evas_object_show().
3714 * - #EVAS_CALLBACK_HIDE: @p event_info is @c NULL \n\n
3715 * This event is triggered by an object being hidden by
3716 * evas_object_hide().
3718 * - #EVAS_CALLBACK_MOVE: @p event_info is @c NULL \n\n
3719 * This event is triggered by an object being
3720 * moved. evas_object_move() can trigger this, as can any
3721 * object-specific manipulations that would mean the object's origin
3724 * - #EVAS_CALLBACK_RESIZE: @p event_info is @c NULL \n\n
3725 * This event is triggered by an object being resized. Resizes can
3726 * be triggered by evas_object_resize() or by any object-specific
3727 * calls that may cause the object to resize.
3729 * - #EVAS_CALLBACK_RESTACK: @p event_info is @c NULL \n\n
3730 * This event is triggered by an object being re-stacked. Stacking
3731 * changes can be triggered by
3732 * evas_object_stack_below()/evas_object_stack_above() and others.
3734 * - #EVAS_CALLBACK_DEL: @p event_info is @c NULL.
3736 * - #EVAS_CALLBACK_HOLD: @p event_info is a pointer to an
3737 * #Evas_Event_Hold struct
3739 * - #EVAS_CALLBACK_CHANGED_SIZE_HINTS: @p event_info is @c NULL.
3741 * - #EVAS_CALLBACK_IMAGE_PRELOADED: @p event_info is @c NULL.
3743 * - #EVAS_CALLBACK_IMAGE_UNLOADED: @p event_info is @c NULL.
3745 * @note Be careful not to add the same callback multiple times, if
3746 * that's not what you want, because Evas won't check if a callback
3747 * existed before exactly as the one being registered (and thus, call
3748 * it more than once on the event, in this case). This would make
3749 * sense if you passed different functions and/or callback data, only.
3752 * @dontinclude evas-events.c
3753 * @skip evas_object_event_callback_add(
3756 * See the full example @ref Example_Evas_Events "here".
3759 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);
3762 * Add (register) a callback function to a given Evas object event with a
3763 * non-default priority set. Except for the priority field, it's exactly the
3764 * same as @ref evas_object_event_callback_add
3766 * @param obj Object to attach a callback to
3767 * @param type The type of event that will trigger the callback
3768 * @param priority The priority of the callback, lower values called first.
3769 * @param func The function to be called when the event is triggered
3770 * @param data The data pointer to be passed to @p func
3772 * @see evas_object_event_callback_add
3775 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);
3778 * Delete a callback function from an object
3780 * @param obj Object to remove a callback from
3781 * @param type The type of event that was triggering the callback
3782 * @param func The function that was to be called when the event was triggered
3783 * @return The data pointer that was to be passed to the callback
3785 * This function removes the most recently added callback from the
3786 * object @p obj which was triggered by the event type @p type and was
3787 * calling the function @p func when triggered. If the removal is
3788 * successful it will also return the data pointer that was passed to
3789 * evas_object_event_callback_add() when the callback was added to the
3790 * object. If not successful NULL will be returned.
3794 * extern Evas_Object *object;
3796 * void up_callback(void *data, Evas *e, Evas_Object *obj, void *event_info);
3798 * my_data = evas_object_event_callback_del(object, EVAS_CALLBACK_MOUSE_UP, up_callback);
3801 EAPI void *evas_object_event_callback_del (Evas_Object *obj, Evas_Callback_Type type, Evas_Object_Event_Cb func) EINA_ARG_NONNULL(1, 3);
3804 * Delete (unregister) a callback function registered to a given
3805 * Evas object event.
3807 * @param obj Object to remove a callback from
3808 * @param type The type of event that was triggering the callback
3809 * @param func The function that was to be called when the event was
3811 * @param data The data pointer that was to be passed to the callback
3812 * @return The data pointer that was to be passed to the callback
3814 * This function removes the most recently added callback from the
3815 * object @p obj, which was triggered by the event type @p type and was
3816 * calling the function @p func with data @p data, when triggered. If
3817 * the removal is successful it will also return the data pointer that
3818 * was passed to evas_object_event_callback_add() (that will be the
3819 * same as the parameter) when the callback was added to the
3820 * object. In errors, @c NULL will be returned.
3822 * @note For deletion of Evas object events callbacks filtering by
3823 * just type and function pointer, user
3824 * evas_object_event_callback_del().
3828 * extern Evas_Object *object;
3830 * void up_callback(void *data, Evas *e, Evas_Object *obj, void *event_info);
3832 * my_data = evas_object_event_callback_del_full(object, EVAS_CALLBACK_MOUSE_UP, up_callback, data);
3835 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);
3839 * Set whether an Evas object is to pass (ignore) events.
3841 * @param obj the Evas object to operate on
3842 * @param pass whether @p obj is to pass events (@c EINA_TRUE) or not
3845 * If @p pass is @c EINA_TRUE, it will make events on @p obj to be @b
3846 * ignored. They will be triggered on the @b next lower object (that
3847 * is not set to pass events), instead (see evas_object_below_get()).
3849 * If @p pass is @c EINA_FALSE, events will be processed on that
3852 * @see evas_object_pass_events_get() for an example
3853 * @see evas_object_repeat_events_set()
3854 * @see evas_object_propagate_events_set()
3856 EAPI void evas_object_pass_events_set (Evas_Object *obj, Eina_Bool pass) EINA_ARG_NONNULL(1);
3859 * Determine whether an object is set to pass (ignore) events.
3861 * @param obj the Evas object to get information from.
3862 * @return pass whether @p obj is set to pass events (@c EINA_TRUE) or not
3866 * @dontinclude evas-stacking.c
3867 * @skip if (strcmp(ev->keyname, "p") == 0)
3870 * See the full @ref Example_Evas_Stacking "example".
3872 * @see evas_object_pass_events_set()
3873 * @see evas_object_repeat_events_get()
3874 * @see evas_object_propagate_events_get()
3876 EAPI Eina_Bool evas_object_pass_events_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
3879 * Set whether an Evas object is to repeat events.
3881 * @param obj the Evas object to operate on
3882 * @param repeat whether @p obj is to repeat events (@c EINA_TRUE) or not
3885 * If @p repeat is @c EINA_TRUE, it will make events on @p obj to also
3886 * be repeated for the @b next lower object in the objects' stack (see
3887 * see evas_object_below_get()).
3889 * If @p repeat is @c EINA_FALSE, events occurring on @p obj will be
3890 * processed only on it.
3893 * @dontinclude evas-stacking.c
3894 * @skip if (strcmp(ev->keyname, "r") == 0)
3897 * See the full @ref Example_Evas_Stacking "example".
3899 * @see evas_object_repeat_events_get()
3900 * @see evas_object_pass_events_get()
3901 * @see evas_object_propagate_events_get()
3903 EAPI void evas_object_repeat_events_set (Evas_Object *obj, Eina_Bool repeat) EINA_ARG_NONNULL(1);
3906 * Determine whether an object is set to repeat events.
3908 * @param obj the given Evas object pointer
3909 * @retrieve whether @p obj is set to repeat events (@c EINA_TRUE)
3910 * or not (@c EINA_FALSE)
3912 * @see evas_object_repeat_events_set() for an example
3913 * @see evas_object_pass_events_set()
3914 * @see evas_object_propagate_events_set()
3916 EAPI Eina_Bool evas_object_repeat_events_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
3919 * Set whether events on a smart object's member should get propagated
3922 * @param obj the smart object's child to operate on
3923 * @param prop whether to propagate events (@c EINA_TRUE) or not (@c
3926 * This function has @b no effect if @p obj is not a member of a smart
3929 * If @p prop is @c EINA_TRUE, events occurring on this object will be
3930 * propagated on to the smart object of which @p obj is a member. If
3931 * @p prop is @c EINA_FALSE, events occurring on this object will @b
3932 * not be propagated on to the smart object of which @p obj is a
3933 * member. The default value is @c EINA_TRUE.
3935 * @see evas_object_event_callback_add()
3936 * @see evas_object_propagate_events_get()
3937 * @see evas_object_repeat_events_get()
3938 * @see evas_object_pass_events_get()
3940 EAPI void evas_object_propagate_events_set (Evas_Object *obj, Eina_Bool prop) EINA_ARG_NONNULL(1);
3943 * Retrieve whether an Evas object is set to propagate events.
3945 * @param obj the given Evas object pointer
3946 * @return whether @p obj is set to propagate events (@c EINA_TRUE)
3947 * or not (@c EINA_FALSE)
3949 * @see evas_object_event_callback_add()
3950 * @see evas_object_propagate_events_set()
3951 * @see evas_object_repeat_events_set()
3952 * @see evas_object_pass_events_set()
3954 EAPI Eina_Bool evas_object_propagate_events_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
3961 * @defgroup Evas_Object_Group_Map UV Mapping (Rotation, Perspective, 3D...)
3963 * Evas allows different transformations to be applied to all kinds of
3964 * objects. These are applied by means of UV mapping.
3966 * With UV mapping, one maps points in the source object to a 3D space
3967 * positioning at target. This allows rotation, perspective, scale and
3968 * lots of other effects, depending on the map that is used.
3970 * Each map point may carry a multiplier color. If properly
3971 * calculated, these can do shading effects on the object, producing
3974 * As usual, Evas provides both the raw and easy to use methods. The
3975 * raw methods allow developer to create its maps somewhere else,
3976 * maybe load them from some file format. The easy to use methods,
3977 * calculate the points given some high-level parameters, such as
3978 * rotation angle, ambient light and so on.
3980 * @note applying mapping will reduce performance, so use with
3981 * care. The impact on performance depends on engine in
3982 * use. Software is quite optimized, but not as fast as OpenGL.
3984 * @section sec-map-points Map points
3985 * @subsection subsec-rotation Rotation
3987 * A map consists of a set of points, currently only four are supported. Each
3988 * of these points contains a set of canvas coordinates @c x and @c y that
3989 * can be used to alter the geometry of the mapped object, and a @c z
3990 * coordinate that indicates the depth of that point. This last coordinate
3991 * does not normally affect the map, but it's used by several of the utility
3992 * functions to calculate the right position of the point given other
3995 * The coordinates for each point are set with evas_map_point_coord_set().
3996 * The following image shows a map set to match the geometry of an existing
3999 * @image html map-set-map-points-1.png
4000 * @image rtf map-set-map-points-1.png
4001 * @image latex map-set-map-points-1.eps
4003 * This is a common practice, so there are a few functions that help make it
4006 * evas_map_util_points_populate_from_geometry() sets the coordinates of each
4007 * point in the given map to match the rectangle defined by the function
4010 * evas_map_util_points_populate_from_object() and
4011 * evas_map_util_points_populate_from_object_full() both take an object and
4012 * set the map points to match its geometry. The difference between the two
4013 * is that the first function sets the @c z value of all points to 0, while
4014 * the latter receives the value to set in said coordinate as a parameter.
4016 * The following lines of code all produce the same result as in the image
4019 * evas_map_util_points_populate_from_geometry(m, 100, 100, 200, 200, 0);
4020 * // Assuming o is our original object
4021 * evas_object_move(o, 100, 100);
4022 * evas_object_resize(o, 200, 200);
4023 * evas_map_util_points_populate_from_object(m, o);
4024 * evas_map_util_points_populate_from_object_full(m, o, 0);
4027 * Several effects can be applied to an object by simply setting each point
4028 * of the map to the right coordinates. For example, a simulated perspective
4029 * could be achieve as follows.
4031 * @image html map-set-map-points-2.png
4032 * @image rtf map-set-map-points-2.png
4033 * @image latex map-set-map-points-2.eps
4035 * As said before, the @c z coordinate is unused here so when setting points
4036 * by hand, its value is of no importance.
4038 * @image html map-set-map-points-3.png
4039 * @image rtf map-set-map-points-3.png
4040 * @image latex map-set-map-points-3.eps
4042 * In all three cases above, setting the map to be used by the object is the
4045 * evas_object_map_set(o, m);
4046 * evas_object_map_enable_set(o, EINA_TRUE);
4049 * Doing things this way, however, is a lot of work that can be avoided by
4050 * using the provided utility functions, as described in the next section.
4052 * @section map-utils Utility functions
4054 * Utility functions take an already set up map and alter it to produce a
4055 * specific effect. For example, to rotate an object around its own center
4056 * you would need to take the rotation angle, the coordinates of each corner
4057 * of the object and do all the math to get the new set of coordinates that
4058 * need to tbe set in the map.
4060 * Or you can use this code:
4062 * evas_object_geometry_get(o, &x, &y, &w, &h);
4063 * m = evas_map_new(4);
4064 * evas_map_util_points_populate_from_object(m, o);
4065 * evas_map_util_rotate(m, 45, x + (w / 2), y + (h / 2));
4066 * evas_object_map_set(o, m);
4067 * evas_object_map_enable_set(o, EINA_TRUE);
4071 * Which will rotate the object around its center point in a 45 degree angle
4072 * in the clockwise direction, taking it from this
4074 * @image html map-rotation-2d-1.png
4075 * @image rtf map-rotation-2d-1.png
4076 * @image latex map-rotation-2d-1.eps
4080 * @image html map-rotation-2d-2.png
4081 * @image rtf map-rotation-2d-2.png
4082 * @image latex map-rotation-2d-2.eps
4084 * Objects may be rotated around any other point just by setting the last two
4085 * paramaters of the evas_map_util_rotate() function to the right values. A
4086 * circle of roughly the diameter of the object overlaid on each image shows
4087 * where the center of rotation is set for each example.
4089 * For example, this code
4091 * evas_object_geometry_get(o, &x, &y, &w, &h);
4092 * m = evas_map_new(4);
4093 * evas_map_util_points_populate_from_object(m, o);
4094 * evas_map_util_rotate(m, 45, x + w - 20, y + h - 20);
4095 * evas_object_map_set(o, m);
4096 * evas_object_map_enable_set(o, EINA_TRUE);
4100 * produces something like
4102 * @image html map-rotation-2d-3.png
4103 * @image rtf map-rotation-2d-3.png
4104 * @image latex map-rotation-2d-3.eps
4108 * evas_output_size_get(evas, &w, &h);
4109 * m = evas_map_new(4);
4110 * evas_map_util_points_populate_from_object(m, o);
4111 * evas_map_util_rotate(m, 45, w, h);
4112 * evas_object_map_set(o, m);
4113 * evas_object_map_enable_set(o, EINA_TRUE);
4117 * rotates the object around the center of the window
4119 * @image html map-rotation-2d-4.png
4120 * @image rtf map-rotation-2d-4.png
4121 * @image latex map-rotation-2d-4.eps
4123 * @subsection subsec-3d 3D Maps
4125 * Maps can also be used to achieve the effect of 3-dimensionality. When doing
4126 * this, the @c z coordinate of each point counts, with higher values meaning
4127 * the point is further into the screen, and smaller values (negative, usually)
4128 * meaning the point is closwer towards the user.
4130 * Thinking in 3D also introduces the concept of back-face of an object. An
4131 * object is said to be facing the user when all its points are placed in a
4132 * clockwise fashion. The next image shows this, with each point showing the
4133 * with which is identified within the map.
4135 * @image html map-point-order-face.png
4136 * @image rtf map-point-order-face.png
4137 * @image latex map-point-order-face.eps
4139 * Rotating this map around the @c Y axis would leave the order of the points
4140 * in a counter-clockwise fashion, as seen in the following image.
4142 * @image html map-point-order-back.png
4143 * @image rtf map-point-order-back.png
4144 * @image latex map-point-order-back.eps
4146 * This way we can say that we are looking at the back face of the object.
4147 * This will have stronger implications later when we talk about lighting.
4149 * To know if a map is facing towards the user or not it's enough to use
4150 * the evas_map_util_clockwise_get() function, but this is normally done
4151 * after all the other operations are applied on the map.
4153 * @subsection subsec-3d-rot 3D rotation and perspective
4155 * Much like evas_map_util_rotate(), there's the function
4156 * evas_map_util_3d_rotate() that transforms the map to apply a 3D rotation
4157 * to an object. As in its 2D counterpart, the rotation can be applied around
4158 * any point in the canvas, this time with a @c z coordinate too. The rotation
4159 * can also be around any of the 3 axis.
4161 * Starting from this simple setup
4163 * @image html map-3d-basic-1.png
4164 * @image rtf map-3d-basic-1.png
4165 * @image latex map-3d-basic-1.eps
4167 * and setting maps so that the blue square to rotate on all axis around a
4168 * sphere that uses the object as its center, and the red square to rotate
4169 * around the @c Y axis, we get the following. A simple overlay over the image
4170 * shows the original geometry of each object and the axis around which they
4171 * are being rotated, with the @c Z one not appearing due to being orthogonal
4174 * @image html map-3d-basic-2.png
4175 * @image rtf map-3d-basic-2.png
4176 * @image latex map-3d-basic-2.eps
4178 * which doesn't look very real. This can be helped by adding perspective
4179 * to the transformation, which can be simply done by calling
4180 * evas_map_util_3d_perspective() on the map after its position has been set.
4181 * The result in this case, making the vanishing point the center of each
4184 * @image html map-3d-basic-3.png
4185 * @image rtf map-3d-basic-3.png
4186 * @image latex map-3d-basic-3.eps
4188 * @section sec-color Color and lighting
4190 * Each point in a map can be set to a color, which will be multiplied with
4191 * the objects own color and linearly interpolated in between adjacent points.
4192 * This is done with evas_map_point_color_set() for each point of the map,
4193 * or evas_map_util_points_color_set() to set every point to the same color.
4195 * When using 3D effects, colors can be used to improve the looks of them by
4196 * simulating a light source. The evas_map_util_3d_lighting() function makes
4197 * this task easier by taking the coordinates of the light source and its
4198 * color, along with the color of the ambient light. Evas then sets the color
4199 * of each point based on the distance to the light source, the angle with
4200 * which the object is facing the light and the ambient light. Here, the
4201 * orientation of each point as explained before, becomes more important.
4202 * If the map is defined counter-clockwise, the object will be facing away
4203 * from the user and thus become obscured, since no light would be reflecting
4206 * @image html map-light.png
4207 * @image rtf map-light.png
4208 * @image latex map-light.eps
4209 * @note Object facing the light source
4211 * @image html map-light2.png
4212 * @image rtf map-light2.png
4213 * @image latex map-light2.eps
4214 * @note Same object facing away from the user
4216 * @section Image mapping
4218 * @image html map-uv-mapping-1.png
4219 * @image rtf map-uv-mapping-1.png
4220 * @image latex map-uv-mapping-1.eps
4222 * Images need some special handlign when mapped. Evas can easily take care
4223 * of objects and do almost anything with them, but it's completely oblivious
4224 * to the content of images, so each point in the map needs to be told to what
4225 * pixel in the source image it belongs. Failing to do may sometimes result
4226 * in the expected behavior, or it may look like a partial work.
4228 * The next image illustrates one possibility of a map being set to an image
4229 * object, without setting the right UV mapping for each point. The objects
4230 * themselves are mapped properly to their new geometry, but the image content
4231 * may not be displayed correctly within the mapped object.
4233 * @image html map-uv-mapping-2.png
4234 * @image rtf map-uv-mapping-2.png
4235 * @image latex map-uv-mapping-2.eps
4237 * Once Evas knows how to handle the source image within the map, it will
4238 * transform it as needed. This is done with evas_map_point_image_uv_set(),
4239 * which tells the map to which pixel in image it maps.
4241 * To match our example images to the maps above all we need is the size of
4242 * each image, which can always be found with evas_object_image_size_get().
4245 * evas_map_point_image_uv_set(m, 0, 0, 0);
4246 * evas_map_point_image_uv_set(m, 1, 150, 0);
4247 * evas_map_point_image_uv_set(m, 2, 150, 200);
4248 * evas_map_point_image_uv_set(m, 3, 0, 200);
4249 * evas_object_map_set(o, m);
4250 * evas_object_map_enable_set(o, EINA_TRUE);
4252 * evas_map_point_image_uv_set(m, 0, 0, 0);
4253 * evas_map_point_image_uv_set(m, 1, 120, 0);
4254 * evas_map_point_image_uv_set(m, 2, 120, 160);
4255 * evas_map_point_image_uv_set(m, 3, 0, 160);
4256 * evas_object_map_set(o2, m);
4257 * evas_object_map_enable_set(o2, EINA_TRUE);
4262 * @image html map-uv-mapping-3.png
4263 * @image rtf map-uv-mapping-3.png
4264 * @image latex map-uv-mapping-3.eps
4266 * Maps can also be set to use part of an image only, or even map them inverted,
4267 * and combined with evas_object_image_source_set() it can be used to achieve
4268 * more interesting results.
4271 * evas_object_image_size_get(evas_object_image_source_get(o), &w, &h);
4272 * evas_map_point_image_uv_set(m, 0, 0, h);
4273 * evas_map_point_image_uv_set(m, 1, w, h);
4274 * evas_map_point_image_uv_set(m, 2, w, h / 3);
4275 * evas_map_point_image_uv_set(m, 3, 0, h / 3);
4276 * evas_object_map_set(o, m);
4277 * evas_object_map_enable_set(o, EINA_TRUE);
4280 * @image html map-uv-mapping-4.png
4281 * @image rtf map-uv-mapping-4.png
4282 * @image latex map-uv-mapping-4.eps
4285 * @li @ref Example_Evas_Map_Overview
4287 * @ingroup Evas_Object_Group
4293 * Enable or disable the map that is set.
4295 * Enable or disable the use of map for the object @p obj.
4296 * On enable, the object geometry will be saved, and the new geometry will
4297 * change (position and size) to reflect the map geometry set.
4299 * If the object doesn't have a map set (with evas_object_map_set()), the
4300 * initial geometry will be undefined. It is advised to always set a map
4301 * to the object first, and then call this function to enable its use.
4303 * @param obj object to enable the map on
4304 * @param enabled enabled state
4306 EAPI void evas_object_map_enable_set (Evas_Object *obj, Eina_Bool enabled);
4309 * Get the map enabled state
4311 * This returns the currently enabled state of the map on the object indicated.
4312 * The default map enable state is off. You can enable and disable it with
4313 * evas_object_map_enable_set().
4315 * @param obj object to get the map enabled state from
4316 * @return the map enabled state
4318 EAPI Eina_Bool evas_object_map_enable_get (const Evas_Object *obj);
4321 * Set the map source object
4323 * This sets the object from which the map is taken - can be any object that
4324 * has map enabled on it.
4326 * Currently not implemented. for future use.
4328 * @param obj object to set the map source of
4329 * @param src the source object from which the map is taken
4331 EAPI void evas_object_map_source_set (Evas_Object *obj, Evas_Object *src);
4334 * Get the map source object
4336 * @param obj object to set the map source of
4337 * @return the object set as the source
4339 * @see evas_object_map_source_set()
4341 EAPI Evas_Object *evas_object_map_source_get (const Evas_Object *obj);
4344 * Set current object transformation map.
4346 * This sets the map on a given object. It is copied from the @p map pointer,
4347 * so there is no need to keep the @p map object if you don't need it anymore.
4349 * A map is a set of 4 points which have canvas x, y coordinates per point,
4350 * with an optional z point value as a hint for perspective correction, if it
4351 * is available. As well each point has u and v coordinates. These are like
4352 * "texture coordinates" in OpenGL in that they define a point in the source
4353 * image that is mapped to that map vertex/point. The u corresponds to the x
4354 * coordinate of this mapped point and v, the y coordinate. Note that these
4355 * coordinates describe a bounding region to sample. If you have a 200x100
4356 * source image and want to display it at 200x100 with proper pixel
4357 * precision, then do:
4360 * Evas_Map *m = evas_map_new(4);
4361 * evas_map_point_coord_set(m, 0, 0, 0, 0);
4362 * evas_map_point_coord_set(m, 1, 200, 0, 0);
4363 * evas_map_point_coord_set(m, 2, 200, 100, 0);
4364 * evas_map_point_coord_set(m, 3, 0, 100, 0);
4365 * evas_map_point_image_uv_set(m, 0, 0, 0);
4366 * evas_map_point_image_uv_set(m, 1, 200, 0);
4367 * evas_map_point_image_uv_set(m, 2, 200, 100);
4368 * evas_map_point_image_uv_set(m, 3, 0, 100);
4369 * evas_object_map_set(obj, m);
4373 * Note that the map points a uv coordinates match the image geometry. If
4374 * the @p map parameter is NULL, the stored map will be freed and geometry
4375 * prior to enabling/setting a map will be restored.
4377 * @param obj object to change transformation map
4378 * @param map new map to use
4380 * @see evas_map_new()
4382 EAPI void evas_object_map_set (Evas_Object *obj, const Evas_Map *map);
4385 * Get current object transformation map.
4387 * This returns the current internal map set on the indicated object. It is
4388 * intended for read-only acces and is only valid as long as the object is
4389 * not deleted or the map on the object is not changed. If you wish to modify
4390 * the map and set it back do the following:
4393 * const Evas_Map *m = evas_object_map_get(obj);
4394 * Evas_Map *m2 = evas_map_dup(m);
4395 * evas_map_util_rotate(m2, 30.0, 0, 0);
4396 * evas_object_map_set(obj);
4397 * evas_map_free(m2);
4400 * @param obj object to query transformation map.
4401 * @return map reference to map in use. This is an internal data structure, so
4404 * @see evas_object_map_set()
4406 EAPI const Evas_Map *evas_object_map_get (const Evas_Object *obj);
4410 * Populate source and destination map points to match exactly object.
4412 * Usually one initialize map of an object to match it's original
4413 * position and size, then transform these with evas_map_util_*
4414 * functions, such as evas_map_util_rotate() or
4415 * evas_map_util_3d_rotate(). The original set is done by this
4416 * function, avoiding code duplication all around.
4418 * @param m map to change all 4 points (must be of size 4).
4419 * @param obj object to use unmapped geometry to populate map coordinates.
4420 * @param z Point Z Coordinate hint (pre-perspective transform). This value
4421 * will be used for all four points.
4423 * @see evas_map_util_points_populate_from_object()
4424 * @see evas_map_point_coord_set()
4425 * @see evas_map_point_image_uv_set()
4427 EAPI void evas_map_util_points_populate_from_object_full(Evas_Map *m, const Evas_Object *obj, Evas_Coord z);
4430 * Populate source and destination map points to match exactly object.
4432 * Usually one initialize map of an object to match it's original
4433 * position and size, then transform these with evas_map_util_*
4434 * functions, such as evas_map_util_rotate() or
4435 * evas_map_util_3d_rotate(). The original set is done by this
4436 * function, avoiding code duplication all around.
4438 * Z Point coordinate is assumed as 0 (zero).
4440 * @param m map to change all 4 points (must be of size 4).
4441 * @param obj object to use unmapped geometry to populate map coordinates.
4443 * @see evas_map_util_points_populate_from_object_full()
4444 * @see evas_map_util_points_populate_from_geometry()
4445 * @see evas_map_point_coord_set()
4446 * @see evas_map_point_image_uv_set()
4448 EAPI void evas_map_util_points_populate_from_object (Evas_Map *m, const Evas_Object *obj);
4451 * Populate source and destination map points to match given geometry.
4453 * Similar to evas_map_util_points_populate_from_object_full(), this
4454 * call takes raw values instead of querying object's unmapped
4455 * geometry. The given width will be used to calculate destination
4456 * points (evas_map_point_coord_set()) and set the image uv
4457 * (evas_map_point_image_uv_set()).
4459 * @param m map to change all 4 points (must be of size 4).
4460 * @param x Point X Coordinate
4461 * @param y Point Y Coordinate
4462 * @param w width to use to calculate second and third points.
4463 * @param h height to use to calculate third and fourth points.
4464 * @param z Point Z Coordinate hint (pre-perspective transform). This value
4465 * will be used for all four points.
4467 * @see evas_map_util_points_populate_from_object()
4468 * @see evas_map_point_coord_set()
4469 * @see evas_map_point_image_uv_set()
4471 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);
4474 * Set color of all points to given color.
4476 * This call is useful to reuse maps after they had 3d lightning or
4477 * any other colorization applied before.
4479 * @param m map to change the color of.
4480 * @param r red (0 - 255)
4481 * @param g green (0 - 255)
4482 * @param b blue (0 - 255)
4483 * @param a alpha (0 - 255)
4485 * @see evas_map_point_color_set()
4487 EAPI void evas_map_util_points_color_set (Evas_Map *m, int r, int g, int b, int a);
4490 * Change the map to apply the given rotation.
4492 * This rotates the indicated map's coordinates around the center coordinate
4493 * given by @p cx and @p cy as the rotation center. The points will have their
4494 * X and Y coordinates rotated clockwise by @p degrees degress (360.0 is a
4495 * full rotation). Negative values for degrees will rotate counter-clockwise
4496 * by that amount. All coordinates are canvas global coordinates.
4498 * @param m map to change.
4499 * @param degrees amount of degrees from 0.0 to 360.0 to rotate.
4500 * @param cx rotation's center horizontal position.
4501 * @param cy rotation's center vertical position.
4503 * @see evas_map_point_coord_set()
4504 * @see evas_map_util_zoom()
4506 EAPI void evas_map_util_rotate (Evas_Map *m, double degrees, Evas_Coord cx, Evas_Coord cy);
4509 * Change the map to apply the given zooming.
4511 * Like evas_map_util_rotate(), this zooms the points of the map from a center
4512 * point. That center is defined by @p cx and @p cy. The @p zoomx and @p zoomy
4513 * parameters specify how much to zoom in the X and Y direction respectively.
4514 * A value of 1.0 means "don't zoom". 2.0 means "dobule the size". 0.5 is
4515 * "half the size" etc. All coordinates are canvas global coordinates.
4517 * @param m map to change.
4518 * @param zoomx horizontal zoom to use.
4519 * @param zoomy vertical zoom to use.
4520 * @param cx zooming center horizontal position.
4521 * @param cy zooming center vertical position.
4523 * @see evas_map_point_coord_set()
4524 * @see evas_map_util_rotate()
4526 EAPI void evas_map_util_zoom (Evas_Map *m, double zoomx, double zoomy, Evas_Coord cx, Evas_Coord cy);
4529 * Rotate the map around 3 axes in 3D
4531 * This will rotate not just around the "Z" axis as in evas_map_util_rotate()
4532 * (which is a convenience call for those only wanting 2D). This will rotate
4533 * around the X, Y and Z axes. The Z axis points "into" the screen with low
4534 * values at the screen and higher values further away. The X axis runs from
4535 * left to right on the screen and the Y axis from top to bottom. Like with
4536 * evas_map_util_rotate() you provide a center point to rotate around (in 3D).
4538 * @param m map to change.
4539 * @param dx amount of degrees from 0.0 to 360.0 to rotate arount X axis.
4540 * @param dy amount of degrees from 0.0 to 360.0 to rotate arount Y axis.
4541 * @param dz amount of degrees from 0.0 to 360.0 to rotate arount Z axis.
4542 * @param cx rotation's center horizontal position.
4543 * @param cy rotation's center vertical position.
4544 * @param cz rotation's center vertical position.
4546 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);
4549 * Perform lighting calculations on the given Map
4551 * This is used to apply lighting calculations (from a single light source)
4552 * to a given map. The R, G and B values of each vertex will be modified to
4553 * reflect the lighting based on the lixth point coordinates, the light
4554 * color and the ambient color, and at what angle the map is facing the
4555 * light source. A surface should have its points be declared in a
4556 * clockwise fashion if the face is "facing" towards you (as opposed to
4557 * away from you) as faces have a "logical" side for lighting.
4559 * @image html map-light3.png
4560 * @image rtf map-light3.png
4561 * @image latex map-light3.eps
4562 * @note Grey object, no lighting used
4564 * @image html map-light4.png
4565 * @image rtf map-light4.png
4566 * @image latex map-light4.eps
4567 * @note Lights out! Every color set to 0
4569 * @image html map-light5.png
4570 * @image rtf map-light5.png
4571 * @image latex map-light5.eps
4572 * @note Ambient light to full black, red light coming from close at the
4573 * bottom-left vertex
4575 * @image html map-light6.png
4576 * @image rtf map-light6.png
4577 * @image latex map-light6.eps
4578 * @note Same light as before, but not the light is set to 0 and ambient light
4581 * @image html map-light7.png
4582 * @image rtf map-light7.png
4583 * @image latex map-light7.eps
4584 * @note Both lights are on
4586 * @image html map-light8.png
4587 * @image rtf map-light8.png
4588 * @image latex map-light8.eps
4589 * @note Both lights again, but this time both are the same color.
4591 * @param m map to change.
4592 * @param lx X coordinate in space of light point
4593 * @param ly Y coordinate in space of light point
4594 * @param lz Z coordinate in space of light point
4595 * @param lr light red value (0 - 255)
4596 * @param lg light green value (0 - 255)
4597 * @param lb light blue value (0 - 255)
4598 * @param ar ambient color red value (0 - 255)
4599 * @param ag ambient color green value (0 - 255)
4600 * @param ab ambient color blue value (0 - 255)
4602 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);
4605 * Apply a perspective transform to the map
4607 * This applies a given perspective (3D) to the map coordinates. X, Y and Z
4608 * values are used. The px and py points specify the "infinite distance" point
4609 * in the 3D conversion (where all lines converge to like when artists draw
4610 * 3D by hand). The @p z0 value specifis the z value at which there is a 1:1
4611 * mapping between spatial coorinates and screen coordinates. Any points
4612 * on this z value will not have their X and Y values modified in the transform.
4613 * Those further away (Z value higher) will shrink into the distance, and
4614 * those less than this value will expand and become bigger. The @p foc value
4615 * determines the "focal length" of the camera. This is in reality the distance
4616 * between the camera lens plane itself (at or closer than this rendering
4617 * results are undefined) and the "z0" z value. This allows for some "depth"
4618 * control and @p foc must be greater than 0.
4620 * @param m map to change.
4621 * @param px The pespective distance X coordinate
4622 * @param py The pespective distance Y coordinate
4623 * @param z0 The "0" z plane value
4624 * @param foc The focal distance
4626 EAPI void evas_map_util_3d_perspective (Evas_Map *m, Evas_Coord px, Evas_Coord py, Evas_Coord z0, Evas_Coord foc);
4629 * Get the clockwise state of a map
4631 * This determines if the output points (X and Y. Z is not used) are
4632 * clockwise or anti-clockwise. This can be used for "back-face culling". This
4633 * is where you hide objects that "face away" from you. In this case objects
4634 * that are not clockwise.
4636 * @param m map to query.
4637 * @return 1 if clockwise, 0 otherwise
4639 EAPI Eina_Bool evas_map_util_clockwise_get (Evas_Map *m);
4643 * Create map of transformation points to be later used with an Evas object.
4645 * This creates a set of points (currently only 4 is supported. no other
4646 * number for @p count will work). That is empty and ready to be modified
4647 * with evas_map calls.
4649 * @param count number of points in the map.
4650 * @return a newly allocated map or @c NULL on errors.
4652 * @see evas_map_free()
4653 * @see evas_map_dup()
4654 * @see evas_map_point_coord_set()
4655 * @see evas_map_point_image_uv_set()
4656 * @see evas_map_util_points_populate_from_object_full()
4657 * @see evas_map_util_points_populate_from_object()
4659 * @see evas_object_map_set()
4661 EAPI Evas_Map *evas_map_new (int count);
4664 * Set the smoothing for map rendering
4666 * This sets smoothing for map rendering. If the object is a type that has
4667 * its own smoothing settings, then both the smooth settings for this object
4668 * and the map must be turned off. By default smooth maps are enabled.
4670 * @param m map to modify. Must not be NULL.
4671 * @param enabled enable or disable smooth map rendering
4673 EAPI void evas_map_smooth_set (Evas_Map *m, Eina_Bool enabled);
4676 * get the smoothing for map rendering
4678 * This gets smoothing for map rendering.
4680 * @param m map to get the smooth from. Must not be NULL.
4682 EAPI Eina_Bool evas_map_smooth_get (const Evas_Map *m);
4685 * Set the alpha flag for map rendering
4687 * This sets alpha flag for map rendering. If the object is a type that has
4688 * its own alpha settings, then this will take precedence. Only image objects
4689 * have this currently.
4690 * Setting this off stops alpha blending of the map area, and is
4691 * useful if you know the object and/or all sub-objects is 100% solid.
4693 * @param m map to modify. Must not be NULL.
4694 * @param enabled enable or disable alpha map rendering
4696 EAPI void evas_map_alpha_set (Evas_Map *m, Eina_Bool enabled);
4699 * get the alpha flag for map rendering
4701 * This gets the alph flag for map rendering.
4703 * @param m map to get the alpha from. Must not be NULL.
4705 EAPI Eina_Bool evas_map_alpha_get (const Evas_Map *m);
4708 * Copy a previously allocated map.
4710 * This makes a duplicate of the @p m object and returns it.
4712 * @param m map to copy. Must not be NULL.
4713 * @return newly allocated map with the same count and contents as @p m.
4715 EAPI Evas_Map *evas_map_dup (const Evas_Map *m);
4718 * Free a previously allocated map.
4720 * This frees a givem map @p m and all memory associated with it. You must NOT
4721 * free a map returned by evas_object_map_get() as this is internal.
4723 * @param m map to free.
4725 EAPI void evas_map_free (Evas_Map *m);
4730 * Returns the number of points in a map. Should be at least 4.
4732 * @param m map to get size.
4733 * @return -1 on error, points otherwise.
4735 EAPI int evas_map_count_get (const Evas_Map *m) EINA_CONST;
4738 * Change the map point's coordinate.
4740 * This sets the fixed point's coordinate in the map. Note that points
4741 * describe the outline of a quadrangle and are ordered either clockwise
4742 * or anit-clock-wise. It is suggested to keep your quadrangles concave and
4743 * non-complex, though these polygon modes may work, they may not render
4744 * a desired set of output. The quadrangle will use points 0 and 1 , 1 and 2,
4745 * 2 and 3, and 3 and 0 to describe the edges of the quandrangle.
4747 * The X and Y and Z coordinates are in canvas units. Z is optional and may
4748 * or may not be honored in drawing. Z is a hint and does not affect the
4749 * X and Y rendered coordinates. It may be used for calculating fills with
4750 * perspective correct rendering.
4752 * Remember all coordinates are canvas global ones like with move and reize
4755 * @param m map to change point. Must not be @c NULL.
4756 * @param idx index of point to change. Must be smaller than map size.
4757 * @param x Point X Coordinate
4758 * @param y Point Y Coordinate
4759 * @param z Point Z Coordinate hint (pre-perspective transform)
4761 * @see evas_map_util_rotate()
4762 * @see evas_map_util_zoom()
4763 * @see evas_map_util_points_populate_from_object_full()
4764 * @see evas_map_util_points_populate_from_object()
4766 EAPI void evas_map_point_coord_set (Evas_Map *m, int idx, Evas_Coord x, Evas_Coord y, Evas_Coord z);
4769 * Get the map point's coordinate.
4771 * This returns the coordinates of the given point in the map.
4773 * @param m map to query point.
4774 * @param idx index of point to query. Must be smaller than map size.
4775 * @param x where to return the X coordinate.
4776 * @param y where to return the Y coordinate.
4777 * @param z where to return the Z coordinate.
4779 EAPI void evas_map_point_coord_get (const Evas_Map *m, int idx, Evas_Coord *x, Evas_Coord *y, Evas_Coord *z);
4782 * Change the map point's U and V texture source point
4784 * This sets the U and V coordinates for the point. This determines which
4785 * coordinate in the source image is mapped to the given point, much like
4786 * OpenGL and textures. Notes that these points do select the pixel, but
4787 * are double floating point values to allow for accuracy and sub-pixel
4790 * @param m map to change the point of.
4791 * @param idx index of point to change. Must be smaller than map size.
4792 * @param u the X coordinate within the image/texture source
4793 * @param v the Y coordinate within the image/texture source
4795 * @see evas_map_point_coord_set()
4796 * @see evas_object_map_set()
4797 * @see evas_map_util_points_populate_from_object_full()
4798 * @see evas_map_util_points_populate_from_object()
4800 EAPI void evas_map_point_image_uv_set (Evas_Map *m, int idx, double u, double v);
4803 * Get the map point's U and V texture source points
4805 * This returns the texture points set by evas_map_point_image_uv_set().
4807 * @param m map to query point.
4808 * @param idx index of point to query. Must be smaller than map size.
4809 * @param u where to write the X coordinate within the image/texture source
4810 * @param v where to write the Y coordinate within the image/texture source
4812 EAPI void evas_map_point_image_uv_get (const Evas_Map *m, int idx, double *u, double *v);
4815 * Set the color of a vertex in the map
4817 * This sets the color of the vertex in the map. Colors will be linearly
4818 * interpolated between vertex points through the map. Color will multiply
4819 * the "texture" pixels (like GL_MODULATE in OpenGL). The default color of
4820 * a vertex in a map is white solid (255, 255, 255, 255) which means it will
4821 * have no affect on modifying the texture pixels.
4823 * @param m map to change the color of.
4824 * @param idx index of point to change. Must be smaller than map size.
4825 * @param r red (0 - 255)
4826 * @param g green (0 - 255)
4827 * @param b blue (0 - 255)
4828 * @param a alpha (0 - 255)
4830 * @see evas_map_util_points_color_set()
4831 * @see evas_map_point_coord_set()
4832 * @see evas_object_map_set()
4834 EAPI void evas_map_point_color_set (Evas_Map *m, int idx, int r, int g, int b, int a);
4837 * Get the color set on a vertex in the map
4839 * This gets the color set by evas_map_point_color_set() on the given vertex
4842 * @param m map to get the color of the vertex from.
4843 * @param idx index of point get. Must be smaller than map size.
4844 * @param r pointer to red return
4845 * @param g pointer to green return
4846 * @param b pointer to blue return
4847 * @param a pointer to alpha return (0 - 255)
4849 * @see evas_map_point_coord_set()
4850 * @see evas_object_map_set()
4852 EAPI void evas_map_point_color_get (const Evas_Map *m, int idx, int *r, int *g, int *b, int *a);
4858 * @defgroup Evas_Object_Group_Size_Hints Size Hints
4860 * Objects may carry hints, so that another object that acts as a
4861 * manager (see @ref Evas_Smart_Object_Group) may know how to properly
4862 * position and resize its subordinate objects. The Size Hints provide
4863 * a common interface that is recommended as the protocol for such
4866 * For example, box objects use alignment hints to align its
4867 * lines/columns inside its container, padding hints to set the
4868 * padding between each individual child, etc.
4870 * Examples on their usage:
4871 * - @ref Example_Evas_Size_Hints "evas-hints.c"
4872 * - @ref Example_Evas_Aspect_Hints "evas-aspect-hints.c"
4874 * @ingroup Evas_Object_Group
4878 * @addtogroup Evas_Object_Group_Size_Hints
4883 * Retrieves the hints for an object's minimum size.
4885 * @param obj The given Evas object to query hints from.
4886 * @param w Pointer to an integer in which to store the minimum width.
4887 * @param h Pointer to an integer in which to store the minimum height.
4889 * These are hints on the minimim sizes @p obj should have. This is
4890 * not a size enforcement in any way, it's just a hint that should be
4891 * used whenever appropriate.
4893 * @note Use @c NULL pointers on the hint components you're not
4894 * interested in: they'll be ignored by the function.
4896 * @see evas_object_size_hint_min_set() for an example
4898 EAPI void evas_object_size_hint_min_get (const Evas_Object *obj, Evas_Coord *w, Evas_Coord *h) EINA_ARG_NONNULL(1);
4901 * Sets the hints for an object's minimum size.
4903 * @param obj The given Evas object to query hints from.
4904 * @param w Integer to use as the minimum width hint.
4905 * @param h Integer to use as the minimum height hint.
4907 * This is not a size enforcement in any way, it's just a hint that
4908 * should be used whenever appropriate.
4910 * Values @c 0 will be treated as unset hint components, when queried
4914 * @dontinclude evas-hints.c
4915 * @skip evas_object_size_hint_min_set
4918 * In this example the minimum size hints change de behavior of an
4919 * Evas box when layouting its children. See the full @ref
4920 * Example_Evas_Size_Hints "example".
4922 * @see evas_object_size_hint_min_get()
4924 EAPI void evas_object_size_hint_min_set (Evas_Object *obj, Evas_Coord w, Evas_Coord h) EINA_ARG_NONNULL(1);
4927 * Retrieves the hints for an object's maximum size.
4929 * @param obj The given Evas object to query hints from.
4930 * @param w Pointer to an integer in which to store the maximum width.
4931 * @param h Pointer to an integer in which to store the maximum height.
4933 * These are hints on the maximum sizes @p obj should have. This is
4934 * not a size enforcement in any way, it's just a hint that should be
4935 * used whenever appropriate.
4937 * @note Use @c NULL pointers on the hint components you're not
4938 * interested in: they'll be ignored by the function.
4940 * @see evas_object_size_hint_max_set()
4942 EAPI void evas_object_size_hint_max_get (const Evas_Object *obj, Evas_Coord *w, Evas_Coord *h) EINA_ARG_NONNULL(1);
4945 * Sets the hints for an object's maximum size.
4947 * @param obj The given Evas object to query hints from.
4948 * @param w Integer to use as the maximum width hint.
4949 * @param h Integer to use as the maximum height hint.
4951 * This is not a size enforcement in any way, it's just a hint that
4952 * should be used whenever appropriate.
4954 * Values @c -1 will be treated as unset hint components, when queried
4958 * @dontinclude evas-hints.c
4959 * @skip evas_object_size_hint_max_set
4962 * In this example the maximum size hints change de behavior of an
4963 * Evas box when layouting its children. See the full @ref
4964 * Example_Evas_Size_Hints "example".
4966 * @see evas_object_size_hint_max_get()
4968 EAPI void evas_object_size_hint_max_set (Evas_Object *obj, Evas_Coord w, Evas_Coord h) EINA_ARG_NONNULL(1);
4971 * Retrieves the hints for an object's optimum size.
4973 * @param obj The given Evas object to query hints from.
4974 * @param w Pointer to an integer in which to store the requested width.
4975 * @param h Pointer to an integer in which to store the requested height.
4977 * These are hints on the optimum sizes @p obj should have. This is
4978 * not a size enforcement in any way, it's just a hint that should be
4979 * used whenever appropriate.
4981 * @note Use @c NULL pointers on the hint components you're not
4982 * interested in: they'll be ignored by the function.
4984 * @see evas_object_size_hint_request_set()
4986 EAPI void evas_object_size_hint_request_get (const Evas_Object *obj, Evas_Coord *w, Evas_Coord *h) EINA_ARG_NONNULL(1);
4989 * Sets the hints for an object's optimum size.
4991 * @param obj The given Evas object to query hints from.
4992 * @param w Integer to use as the preferred width hint.
4993 * @param h Integer to use as the preferred height hint.
4995 * This is not a size enforcement in any way, it's just a hint that
4996 * should be used whenever appropriate.
4998 * Values @c 0 will be treated as unset hint components, when queried
5001 * @see evas_object_size_hint_request_get()
5003 EAPI void evas_object_size_hint_request_set (Evas_Object *obj, Evas_Coord w, Evas_Coord h) EINA_ARG_NONNULL(1);
5006 * Retrieves the hints for an object's aspect ratio.
5008 * @param obj The given Evas object to query hints from.
5009 * @param aspect Returns the policy/type of aspect ratio applied to @p obj.
5010 * @param w Pointer to an integer in which to store the aspect's width
5012 * @param h Pointer to an integer in which to store the aspect's
5013 * height ratio term.
5015 * The different aspect ratio policies are documented in the
5016 * #Evas_Aspect_Control type. A container respecting these size hints
5017 * would @b resize its children accordingly to those policies.
5019 * For any policy, if any of the given aspect ratio terms are @c 0,
5020 * the object's container should ignore the aspect and scale @p obj to
5021 * occupy the whole available area. If they are both positive
5022 * integers, that proportion will be respected, under each scaling
5025 * These images illustrate some of the #Evas_Aspect_Control policies:
5027 * @image html any-policy.png
5028 * @image rtf any-policy.png
5029 * @image latex any-policy.eps
5031 * @image html aspect-control-none-neither.png
5032 * @image rtf aspect-control-none-neither.png
5033 * @image latex aspect-control-none-neither.eps
5035 * @image html aspect-control-both.png
5036 * @image rtf aspect-control-both.png
5037 * @image latex aspect-control-both.eps
5039 * @image html aspect-control-horizontal.png
5040 * @image rtf aspect-control-horizontal.png
5041 * @image latex aspect-control-horizontal.eps
5043 * This is not a size enforcement in any way, it's just a hint that
5044 * should be used whenever appropriate.
5046 * @note Use @c NULL pointers on the hint components you're not
5047 * interested in: they'll be ignored by the function.
5050 * @dontinclude evas-aspect-hints.c
5051 * @skip if (strcmp(ev->keyname, "c") == 0)
5054 * See the full @ref Example_Evas_Aspect_Hints "example".
5056 * @see evas_object_size_hint_aspect_set()
5058 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);
5061 * Sets the hints for an object's aspect ratio.
5063 * @param obj The given Evas object to query hints from.
5064 * @param aspect The policy/type of aspect ratio to apply to @p obj.
5065 * @param w Integer to use as aspect width ratio term.
5066 * @param h Integer to use as aspect height ratio term.
5068 * This is not a size enforcement in any way, it's just a hint that should
5069 * be used whenever appropriate.
5071 * If any of the given aspect ratio terms are @c 0,
5072 * the object's container will ignore the aspect and scale @p obj to
5073 * occupy the whole available area, for any given policy.
5075 * @see evas_object_size_hint_aspect_get() for more information.
5077 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);
5080 * Retrieves the hints for on object's alignment.
5082 * @param obj The given Evas object to query hints from.
5083 * @param x Pointer to a double in which to store the horizontal
5085 * @param y Pointer to a double in which to store the vertical
5088 * This is not a size enforcement in any way, it's just a hint that
5089 * should be used whenever appropriate.
5091 * @note Use @c NULL pointers on the hint components you're not
5092 * interested in: they'll be ignored by the function.
5094 * @see evas_object_size_hint_align_set() for more information
5096 EAPI void evas_object_size_hint_align_get (const Evas_Object *obj, double *x, double *y) EINA_ARG_NONNULL(1);
5099 * Sets the hints for an object's alignment.
5101 * @param obj The given Evas object to query hints from.
5102 * @param x Double, ranging from @c 0.0 to @c 1.0 or with the
5103 * special value #EVAS_HINT_FILL, to use as horizontal alignment hint.
5104 * @param y Double, ranging from @c 0.0 to @c 1.0 or with the
5105 * special value #EVAS_HINT_FILL, to use as vertical alignment hint.
5107 * These are hints on how to align an object <b>inside the boundaries
5108 * of a container/manager</b>. Accepted values are in the @c 0.0 to @c
5109 * 1.0 range, with the special value #EVAS_HINT_FILL used to specify
5110 * "justify" or "fill" by some users. In this case, maximum size hints
5111 * should be enforced with higher priority, if they are set. Also, any
5112 * padding hint set on objects should add up to the alignment space on
5113 * the final scene composition.
5115 * See documentation of possible users: in Evas, they are the @ref
5116 * Evas_Object_Box "box" and @ref Evas_Object_Table "table" smart
5119 * For the horizontal component, @c 0.0 means to the left, @c 1.0
5120 * means to the right. Analogously, for the vertical component, @c 0.0
5121 * to the top, @c 1.0 means to the bottom.
5123 * See the following figure:
5125 * @image html alignment-hints.png
5126 * @image rtf alignment-hints.png
5127 * @image latex alignment-hints.eps
5129 * This is not a size enforcement in any way, it's just a hint that
5130 * should be used whenever appropriate.
5133 * @dontinclude evas-hints.c
5134 * @skip evas_object_size_hint_align_set
5137 * In this example the alignment hints change de behavior of an Evas
5138 * box when layouting its children. See the full @ref
5139 * Example_Evas_Size_Hints "example".
5141 * @see evas_object_size_hint_align_get()
5142 * @see evas_object_size_hint_max_set()
5143 * @see evas_object_size_hint_padding_set()
5145 EAPI void evas_object_size_hint_align_set (Evas_Object *obj, double x, double y) EINA_ARG_NONNULL(1);
5148 * Retrieves the hints for an object's weight.
5150 * @param obj The given Evas object to query hints from.
5151 * @param x Pointer to a double in which to store the horizontal weight.
5152 * @param y Pointer to a double in which to store the vertical weight.
5154 * Accepted values are zero or positive values. Some users might use
5155 * this hint as a boolean, but some might consider it as a @b
5156 * proportion, see documentation of possible users, which in Evas are
5157 * the @ref Evas_Object_Box "box" and @ref Evas_Object_Table "table"
5160 * This is not a size enforcement in any way, it's just a hint that
5161 * should be used whenever appropriate.
5163 * @note Use @c NULL pointers on the hint components you're not
5164 * interested in: they'll be ignored by the function.
5166 * @see evas_object_size_hint_weight_set() for an example
5168 EAPI void evas_object_size_hint_weight_get (const Evas_Object *obj, double *x, double *y) EINA_ARG_NONNULL(1);
5171 * Sets the hints for an object's weight.
5173 * @param obj The given Evas object to query hints from.
5174 * @param x Nonnegative double value to use as horizontal weight hint.
5175 * @param y Nonnegative double value to use as vertical weight hint.
5177 * This is not a size enforcement in any way, it's just a hint that
5178 * should be used whenever appropriate.
5180 * This is a hint on how a container object should @b resize a given
5181 * child within its area. Containers may adhere to the simpler logic
5182 * of just expanding the child object's dimensions to fit its own (see
5183 * the #EVAS_HINT_EXPAND helper weight macro) or the complete one of
5184 * taking each child's weight hint as real @b weights to how much of
5185 * its size to allocate for them in each axis. A container is supposed
5186 * to, after @b normalizing the weights of its children (with weight
5187 * hints), distribute the space it has to layout them by those factors
5188 * -- most weighted children get larger in this process than the least
5192 * @dontinclude evas-hints.c
5193 * @skip evas_object_size_hint_weight_set
5196 * In this example the weight hints change de behavior of an Evas box
5197 * when layouting its children. See the full @ref
5198 * Example_Evas_Size_Hints "example".
5200 * @see evas_object_size_hint_weight_get() for more information
5202 EAPI void evas_object_size_hint_weight_set (Evas_Object *obj, double x, double y) EINA_ARG_NONNULL(1);
5205 * Retrieves the hints for an object's padding space.
5207 * @param obj The given Evas object to query hints from.
5208 * @param l Pointer to an integer in which to store left padding.
5209 * @param r Pointer to an integer in which to store right padding.
5210 * @param t Pointer to an integer in which to store top padding.
5211 * @param b Pointer to an integer in which to store bottom padding.
5213 * Padding is extra space an object takes on each of its delimiting
5214 * rectangle sides, in canvas units. This space will be rendered
5215 * transparent, naturally, as in the following figure:
5217 * @image html padding-hints.png
5218 * @image rtf padding-hints.png
5219 * @image latex padding-hints.eps
5221 * This is not a size enforcement in any way, it's just a hint that
5222 * should be used whenever appropriate.
5224 * @note Use @c NULL pointers on the hint components you're not
5225 * interested in: they'll be ignored by the function.
5228 * @dontinclude evas-hints.c
5229 * @skip evas_object_size_hint_padding_set
5232 * In this example the padding hints change de behavior of an Evas box
5233 * when layouting its children. See the full @ref
5234 * Example_Evas_Size_Hints "example".
5236 * @see evas_object_size_hint_padding_set()
5238 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);
5241 * Sets the hints for an object's padding space.
5243 * @param obj The given Evas object to query hints from.
5244 * @param l Integer to specify left padding.
5245 * @param r Integer to specify right padding.
5246 * @param t Integer to specify top padding.
5247 * @param b Integer to specify bottom padding.
5249 * This is not a size enforcement in any way, it's just a hint that
5250 * should be used whenever appropriate.
5252 * @see evas_object_size_hint_padding_get() for more information
5254 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);
5261 * @defgroup Evas_Object_Group_Extras Extra Object Manipulation
5263 * Miscellaneous functions that also apply to any object, but are less
5264 * used or not implemented by all objects.
5266 * Examples on this group of functions can be found @ref
5267 * Example_Evas_Stacking "here" and @ref Example_Evas_Events "here".
5269 * @ingroup Evas_Object_Group
5273 * @addtogroup Evas_Object_Group_Extras
5278 * Set an attached data pointer to an object with a given string key.
5280 * @param obj The object to attach the data pointer to
5281 * @param key The string key for the data to access it
5282 * @param data The ponter to the data to be attached
5284 * This attaches the pointer @p data to the object @p obj, given the
5285 * access string @p key. This pointer will stay "hooked" to the object
5286 * until a new pointer with the same string key is attached with
5287 * evas_object_data_set() or it is deleted with
5288 * evas_object_data_del(). On deletion of the object @p obj, the
5289 * pointers will not be accessible from the object anymore.
5291 * You can find the pointer attached under a string key using
5292 * evas_object_data_get(). It is the job of the calling application to
5293 * free any data pointed to by @p data when it is no longer required.
5295 * If @p data is @c NULL, the old value stored at @p key will be
5296 * removed but no new value will be stored. This is synonymous with
5297 * calling evas_object_data_del() with @p obj and @p key.
5299 * @note This function is very handy when you have data associated
5300 * specifically to an Evas object, being of use only when dealing with
5301 * it. Than you don't have the burden to a pointer to it elsewhere,
5302 * using this family of functions.
5308 * extern Evas_Object *obj;
5310 * my_data = malloc(500);
5311 * evas_object_data_set(obj, "name_of_data", my_data);
5312 * printf("The data that was attached was %p\n", evas_object_data_get(obj, "name_of_data"));
5315 EAPI void evas_object_data_set (Evas_Object *obj, const char *key, const void *data) EINA_ARG_NONNULL(1, 2);
5318 * Return an attached data pointer on an Evas object by its given
5321 * @param obj The object to which the data was attached
5322 * @param key The string key the data was stored under
5323 * @return The data pointer stored, or @c NULL if none was stored
5325 * This function will return the data pointer attached to the object
5326 * @p obj, stored using the string key @p key. If the object is valid
5327 * and a data pointer was stored under the given key, that pointer
5328 * will be returned. If this is not the case, @c NULL will be
5329 * returned, signifying an invalid object or a non-existent key. It is
5330 * possible that a @c NULL pointer was stored given that key, but this
5331 * situation is non-sensical and thus can be considered an error as
5332 * well. @c NULL pointers are never stored as this is the return value
5333 * if an error occurs.
5339 * extern Evas_Object *obj;
5341 * my_data = evas_object_data_get(obj, "name_of_my_data");
5342 * if (my_data) printf("Data stored was %p\n", my_data);
5343 * else printf("No data was stored on the object\n");
5346 EAPI void *evas_object_data_get (const Evas_Object *obj, const char *key) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2) EINA_PURE;
5349 * Delete an attached data pointer from an object.
5351 * @param obj The object to delete the data pointer from
5352 * @param key The string key the data was stored under
5353 * @return The original data pointer stored at @p key on @p obj
5355 * This will remove the stored data pointer from @p obj stored under
5356 * @p key and return this same pointer, if actually there was data
5357 * there, or @c NULL, if nothing was stored under that key.
5363 * extern Evas_Object *obj;
5365 * my_data = evas_object_data_del(obj, "name_of_my_data");
5368 EAPI void *evas_object_data_del (Evas_Object *obj, const char *key) EINA_ARG_NONNULL(1, 2);
5372 * Set pointer behavior.
5375 * @param setting desired behavior.
5377 * This function has direct effect on event callbacks related to
5380 * If @p setting is EVAS_OBJECT_POINTER_MODE_AUTOGRAB, then when mouse
5381 * is down at this object, events will be restricted to it as source,
5382 * mouse moves, for example, will be emitted even if outside this
5385 * If @p setting is EVAS_OBJECT_POINTER_MODE_NOGRAB, then events will
5386 * be emitted just when inside this object area.
5388 * The default value is EVAS_OBJECT_POINTER_MODE_AUTOGRAB.
5390 * @ingroup Evas_Object_Group_Extras
5392 EAPI void evas_object_pointer_mode_set (Evas_Object *obj, Evas_Object_Pointer_Mode setting) EINA_ARG_NONNULL(1);
5395 * Determine how pointer will behave.
5397 * @return pointer behavior.
5398 * @ingroup Evas_Object_Group_Extras
5400 EAPI Evas_Object_Pointer_Mode evas_object_pointer_mode_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
5404 * Sets whether or not the given Evas object is to be drawn anti-aliased.
5406 * @param obj The given Evas object.
5407 * @param anti_alias 1 if the object is to be anti_aliased, 0 otherwise.
5408 * @ingroup Evas_Object_Group_Extras
5410 EAPI void evas_object_anti_alias_set (Evas_Object *obj, Eina_Bool antialias) EINA_ARG_NONNULL(1);
5413 * Retrieves whether or not the given Evas object is to be drawn anti_aliased.
5414 * @param obj The given Evas object.
5415 * @return @c 1 if the object is to be anti_aliased. @c 0 otherwise.
5416 * @ingroup Evas_Object_Group_Extras
5418 EAPI Eina_Bool evas_object_anti_alias_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
5422 * Sets the scaling factor for an Evas object. Does not affect all
5425 * @param obj The given Evas object.
5426 * @param scale The scaling factor. <c>1.0</c> means no scaling,
5429 * This will multiply the object's dimension by the given factor, thus
5430 * altering its geometry (width and height). Useful when you want
5431 * scalable UI elements, possibly at run time.
5433 * @note Only text and textblock objects have scaling change
5434 * handlers. Other objects won't change visually on this call.
5436 * @see evas_object_scale_get()
5438 * @ingroup Evas_Object_Group_Extras
5440 EAPI void evas_object_scale_set (Evas_Object *obj, double scale) EINA_ARG_NONNULL(1);
5443 * Retrieves the scaling factor for the given Evas object.
5445 * @param obj The given Evas object.
5446 * @return The scaling factor.
5448 * @ingroup Evas_Object_Group_Extras
5450 * @see evas_object_scale_set()
5452 EAPI double evas_object_scale_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
5456 * Sets the render_op to be used for rendering the Evas object.
5457 * @param obj The given Evas object.
5458 * @param render_op one of the Evas_Render_Op values.
5459 * @ingroup Evas_Object_Group_Extras
5461 EAPI void evas_object_render_op_set (Evas_Object *obj, Evas_Render_Op op) EINA_ARG_NONNULL(1);
5464 * Retrieves the current value of the operation used for rendering the Evas object.
5465 * @param obj The given Evas object.
5466 * @return one of the enumerated values in Evas_Render_Op.
5467 * @ingroup Evas_Object_Group_Extras
5469 EAPI Evas_Render_Op evas_object_render_op_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
5472 * Set whether to use precise (usually expensive) point collision
5473 * detection for a given Evas object.
5475 * @param obj The given object.
5476 * @param precise whether to use precise point collision detection or
5477 * not The default value is false.
5479 * Use this function to make Evas treat objects' transparent areas as
5480 * @b not belonging to it with regard to mouse pointer events. By
5481 * default, all of the object's boundary rectangle will be taken in
5484 * @warning By using precise point collision detection you'll be
5485 * making Evas more resource intensive.
5487 * Example code follows.
5488 * @dontinclude evas-events.c
5489 * @skip if (strcmp(ev->keyname, "p") == 0)
5492 * See the full example @ref Example_Evas_Events "here".
5494 * @see evas_object_precise_is_inside_get()
5495 * @ingroup Evas_Object_Group_Extras
5497 EAPI void evas_object_precise_is_inside_set(Evas_Object *obj, Eina_Bool precise) EINA_ARG_NONNULL(1);
5500 * Determine whether an object is set to use precise point collision
5503 * @param obj The given object.
5504 * @return whether @p obj is set to use precise point collision
5505 * detection or not The default value is false.
5507 * @see evas_object_precise_is_inside_set() for an example
5509 * @ingroup Evas_Object_Group_Extras
5511 EAPI Eina_Bool evas_object_precise_is_inside_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
5514 * Set a hint flag on the given Evas object that it's used as a "static
5517 * @param obj The given object.
5518 * @param is_static_clip @c EINA_TRUE if it's to be used as a static
5519 * clipper, @c EINA_FALSE otherwise
5521 * This is a hint to Evas that this object is used as a big static
5522 * clipper and shouldn't be moved with children and otherwise
5523 * considered specially. The default value for new objects is @c
5526 * @see evas_object_static_clip_get()
5528 * @ingroup Evas_Object_Group_Extras
5530 EAPI void evas_object_static_clip_set (Evas_Object *obj, Eina_Bool is_static_clip) EINA_ARG_NONNULL(1);
5533 * Get the "static clipper" hint flag for a given Evas object.
5535 * @param obj The given object.
5536 * @returrn @c EINA_TRUE if it's set as a static clipper, @c
5537 * EINA_FALSE otherwise
5539 * @see evas_object_static_clip_set() for more details
5541 * @ingroup Evas_Object_Group_Extras
5543 EAPI Eina_Bool evas_object_static_clip_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
5550 * @defgroup Evas_Object_Group_Find Finding Objects
5552 * Functions that allows finding objects by their position, name or
5555 * @ingroup Evas_Object_Group
5559 * @addtogroup Evas_Object_Group_Find
5564 * Retrieve the object that currently has focus.
5566 * @param e The Evas canvas to query for focused object on.
5567 * @return The object that has focus or @c NULL if there is not one.
5569 * Evas can have (at most) one of its objects focused at a time.
5570 * Focused objects will be the ones having <b>key events</b> delivered
5571 * to, which the programmer can act upon by means of
5572 * evas_object_event_callback_add() usage.
5574 * @note Most users wouldn't be dealing directly with Evas' focused
5575 * objects. Instead, they would be using a higher level library for
5576 * that (like a toolkit, as Elementary) to handle focus and who's
5577 * receiving input for them.
5579 * This call returns the object that currently has focus on the canvas
5580 * @p e or @c NULL, if none.
5582 * @see evas_object_focus_set
5583 * @see evas_object_focus_get
5584 * @see evas_object_key_grab
5585 * @see evas_object_key_ungrab
5588 * @dontinclude evas-events.c
5589 * @skip evas_event_callback_add(d.canvas, EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_IN,
5590 * @until evas_object_focus_set(d.bg, EINA_TRUE);
5591 * @dontinclude evas-events.c
5592 * @skip called when our rectangle gets focus
5595 * In this example the @c event_info is exactly a pointer to that
5596 * focused rectangle. See the full @ref Example_Evas_Events "example".
5598 * @ingroup Evas_Object_Group_Find
5600 EAPI Evas_Object *evas_focus_get (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
5603 * Retrieves the object on the given evas with the given name.
5604 * @param e The given evas.
5605 * @param name The given name.
5606 * @return If successful, the Evas object with the given name. Otherwise,
5608 * @ingroup Evas_Object_Group_Find
5610 EAPI Evas_Object *evas_object_name_find (const Evas *e, const char *name) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
5613 * Retrieve the Evas object stacked at the top of a given position in
5616 * @param e A handle to the canvas.
5617 * @param x The horizontal coordinate of the position
5618 * @param y The vertical coordinate of the position
5619 * @param include_pass_events_objects Boolean flag to include or not
5620 * objects which pass events in this calculation
5621 * @param include_hidden_objects Boolean flag to include or not hidden
5622 * objects in this calculation
5623 * @return The Evas object that is over all other objects at the given
5626 * This function will traverse all the layers of the given canvas,
5627 * from top to bottom, querying for objects with areas covering the
5628 * given position. The user can remove from from the query
5629 * objects which are hidden and/or which are set to pass events.
5631 * @warning This function will @b skip objects parented by smart
5632 * objects, acting only on the ones at the "top level", with regard to
5635 EAPI Evas_Object *evas_object_top_at_xy_get (const Evas *e, Evas_Coord x, Evas_Coord y, Eina_Bool include_pass_events_objects, Eina_Bool include_hidden_objects) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
5638 * Retrieve the Evas object stacked at the top at the position of the
5639 * mouse cursor, over a given canvas
5641 * @param e A handle to the canvas.
5642 * @return The Evas object that is over all other objects at the mouse
5643 * pointer's position
5645 * This function will traverse all the layers of the given canvas,
5646 * from top to bottom, querying for objects with areas covering the
5647 * mouse pointer's position, over @p e.
5649 * @warning This function will @b skip objects parented by smart
5650 * objects, acting only on the ones at the "top level", with regard to
5653 EAPI Evas_Object *evas_object_top_at_pointer_get (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
5656 * Retrieve the Evas object stacked at the top of a given rectangular
5657 * region in a canvas
5659 * @param e A handle to the canvas.
5660 * @param x The top left corner's horizontal coordinate for the
5661 * rectangular region
5662 * @param y The top left corner's vertical coordinate for the
5663 * rectangular region
5664 * @param w The width of the rectangular region
5665 * @param h The height of the rectangular region
5666 * @param include_pass_events_objects Boolean flag to include or not
5667 * objects which pass events in this calculation
5668 * @param include_hidden_objects Boolean flag to include or not hidden
5669 * objects in this calculation
5670 * @return The Evas object that is over all other objects at the given
5671 * rectangular region.
5673 * This function will traverse all the layers of the given canvas,
5674 * from top to bottom, querying for objects with areas overlapping
5675 * with the given rectangular region inside @p e. The user can remove
5676 * from the query objects which are hidden and/or which are set to
5679 * @warning This function will @b skip objects parented by smart
5680 * objects, acting only on the ones at the "top level", with regard to
5683 EAPI Evas_Object *evas_object_top_in_rectangle_get (const Evas *e, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h, Eina_Bool include_pass_events_objects, Eina_Bool include_hidden_objects) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
5686 * Retrieve a list of Evas objects lying over a given position in
5689 * @param e A handle to the canvas.
5690 * @param x The horizontal coordinate of the position
5691 * @param y The vertical coordinate of the position
5692 * @param include_pass_events_objects Boolean flag to include or not
5693 * objects which pass events in this calculation
5694 * @param include_hidden_objects Boolean flag to include or not hidden
5695 * objects in this calculation
5696 * @return The list of Evas objects that are over the given position
5699 * This function will traverse all the layers of the given canvas,
5700 * from top to bottom, querying for objects with areas covering the
5701 * given position. The user can remove from from the query
5702 * objects which are hidden and/or which are set to pass events.
5704 * @warning This function will @b skip objects parented by smart
5705 * objects, acting only on the ones at the "top level", with regard to
5708 EAPI Eina_List *evas_objects_at_xy_get (const Evas *e, Evas_Coord x, Evas_Coord y, Eina_Bool include_pass_events_objects, Eina_Bool include_hidden_objects) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
5709 EAPI Eina_List *evas_objects_in_rectangle_get (const Evas *e, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h, Eina_Bool include_pass_events_objects, Eina_Bool include_hidden_objects) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
5712 * Get the lowest (stacked) Evas object on the canvas @p
5714 * @param e a valid canvas pointer
5715 * @return a pointer to the lowest object on it, if any, or @c NULL,
5718 * This function will take all populated layers in the canvas into
5719 * account, getting the lowest object for the lowest layer, naturally.
5721 * @see evas_object_layer_get()
5722 * @see evas_object_layer_set()
5723 * @see evas_object_below_get()
5724 * @see evas_object_above_get()
5726 * @warning This function will @b skip objects parented by smart
5727 * objects, acting only on the ones at the "top level", with regard to
5730 EAPI Evas_Object *evas_object_bottom_get (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
5733 * Get the highest (stacked) Evas object on the canvas @p
5735 * @param e a valid canvas pointer
5736 * @return a pointer to the highest object on it, if any, or @c NULL,
5739 * This function will take all populated layers in the canvas into
5740 * account, getting the highest object for the highest layer,
5743 * @see evas_object_layer_get()
5744 * @see evas_object_layer_set()
5745 * @see evas_object_below_get()
5746 * @see evas_object_above_get()
5748 * @warning This function will @b skip objects parented by smart
5749 * objects, acting only on the ones at the "top level", with regard to
5752 EAPI Evas_Object *evas_object_top_get (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
5759 * @defgroup Evas_Object_Group_Interceptors Object Method Interceptors
5761 * Evas provides a way to intercept method calls. The interceptor
5762 * callback may opt to completely deny the call, or may check and
5763 * change the parameters before continuing. The continuation of an
5764 * intercepted call is done by calling the intercepted call again,
5765 * from inside the interceptor callback.
5767 * @ingroup Evas_Object_Group
5771 * @addtogroup Evas_Object_Group_Interceptors
5775 typedef void (*Evas_Object_Intercept_Show_Cb) (void *data, Evas_Object *obj);
5776 typedef void (*Evas_Object_Intercept_Hide_Cb) (void *data, Evas_Object *obj);
5777 typedef void (*Evas_Object_Intercept_Move_Cb) (void *data, Evas_Object *obj, Evas_Coord x, Evas_Coord y);
5778 typedef void (*Evas_Object_Intercept_Resize_Cb) (void *data, Evas_Object *obj, Evas_Coord w, Evas_Coord h);
5779 typedef void (*Evas_Object_Intercept_Raise_Cb) (void *data, Evas_Object *obj);
5780 typedef void (*Evas_Object_Intercept_Lower_Cb) (void *data, Evas_Object *obj);
5781 typedef void (*Evas_Object_Intercept_Stack_Above_Cb) (void *data, Evas_Object *obj, Evas_Object *above);
5782 typedef void (*Evas_Object_Intercept_Stack_Below_Cb) (void *data, Evas_Object *obj, Evas_Object *above);
5783 typedef void (*Evas_Object_Intercept_Layer_Set_Cb) (void *data, Evas_Object *obj, int l);
5784 typedef void (*Evas_Object_Intercept_Color_Set_Cb) (void *data, Evas_Object *obj, int r, int g, int b, int a);
5785 typedef void (*Evas_Object_Intercept_Clip_Set_Cb) (void *data, Evas_Object *obj, Evas_Object *clip);
5786 typedef void (*Evas_Object_Intercept_Clip_Unset_Cb) (void *data, Evas_Object *obj);
5789 * Set the callback function that intercepts a show event of a object.
5791 * @param obj The given canvas object pointer.
5792 * @param func The given function to be the callback function.
5793 * @param data The data passed to the callback function.
5795 * This function sets a callback function to intercepts a show event
5796 * of a canvas object.
5798 * @see evas_object_intercept_show_callback_del().
5801 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);
5804 * Unset the callback function that intercepts a show event of a
5807 * @param obj The given canvas object pointer.
5808 * @param func The given callback function.
5810 * This function sets a callback function to intercepts a show event
5811 * of a canvas object.
5813 * @see evas_object_intercept_show_callback_add().
5816 EAPI void *evas_object_intercept_show_callback_del (Evas_Object *obj, Evas_Object_Intercept_Show_Cb func) EINA_ARG_NONNULL(1, 2);
5819 * Set the callback function that intercepts a hide event of a object.
5821 * @param obj The given canvas object pointer.
5822 * @param func The given function to be the callback function.
5823 * @param data The data passed to the callback function.
5825 * This function sets a callback function to intercepts a hide event
5826 * of a canvas object.
5828 * @see evas_object_intercept_hide_callback_del().
5831 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);
5834 * Unset the callback function that intercepts a hide event of a
5837 * @param obj The given canvas object pointer.
5838 * @param func The given callback function.
5840 * This function sets a callback function to intercepts a hide event
5841 * of a canvas object.
5843 * @see evas_object_intercept_hide_callback_add().
5846 EAPI void *evas_object_intercept_hide_callback_del (Evas_Object *obj, Evas_Object_Intercept_Hide_Cb func) EINA_ARG_NONNULL(1, 2);
5849 * Set the callback function that intercepts a move event of a object.
5851 * @param obj The given canvas object pointer.
5852 * @param func The given function to be the callback function.
5853 * @param data The data passed to the callback function.
5855 * This function sets a callback function to intercepts a move event
5856 * of a canvas object.
5858 * @see evas_object_intercept_move_callback_del().
5861 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);
5864 * Unset the callback function that intercepts a move event of a
5867 * @param obj The given canvas object pointer.
5868 * @param func The given callback function.
5870 * This function sets a callback function to intercepts a move event
5871 * of a canvas object.
5873 * @see evas_object_intercept_move_callback_add().
5876 EAPI void *evas_object_intercept_move_callback_del (Evas_Object *obj, Evas_Object_Intercept_Move_Cb func) EINA_ARG_NONNULL(1, 2);
5878 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);
5879 EAPI void *evas_object_intercept_resize_callback_del (Evas_Object *obj, Evas_Object_Intercept_Resize_Cb func) EINA_ARG_NONNULL(1, 2);
5880 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);
5881 EAPI void *evas_object_intercept_raise_callback_del (Evas_Object *obj, Evas_Object_Intercept_Raise_Cb func) EINA_ARG_NONNULL(1, 2);
5882 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);
5883 EAPI void *evas_object_intercept_lower_callback_del (Evas_Object *obj, Evas_Object_Intercept_Lower_Cb func) EINA_ARG_NONNULL(1, 2);
5884 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);
5885 EAPI void *evas_object_intercept_stack_above_callback_del (Evas_Object *obj, Evas_Object_Intercept_Stack_Above_Cb func) EINA_ARG_NONNULL(1, 2);
5886 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);
5887 EAPI void *evas_object_intercept_stack_below_callback_del (Evas_Object *obj, Evas_Object_Intercept_Stack_Below_Cb func) EINA_ARG_NONNULL(1, 2);
5888 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);
5889 EAPI void *evas_object_intercept_layer_set_callback_del (Evas_Object *obj, Evas_Object_Intercept_Layer_Set_Cb func) EINA_ARG_NONNULL(1, 2);
5890 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);
5891 EAPI void *evas_object_intercept_color_set_callback_del (Evas_Object *obj, Evas_Object_Intercept_Color_Set_Cb func) EINA_ARG_NONNULL(1, 2);
5892 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);
5893 EAPI void *evas_object_intercept_clip_set_callback_del (Evas_Object *obj, Evas_Object_Intercept_Clip_Set_Cb func) EINA_ARG_NONNULL(1, 2);
5894 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);
5895 EAPI void *evas_object_intercept_clip_unset_callback_del (Evas_Object *obj, Evas_Object_Intercept_Clip_Unset_Cb func) EINA_ARG_NONNULL(1, 2);
5902 * @defgroup Evas_Object_Specific Specific Object Functions
5904 * Functions that work on specific objects.
5909 * @defgroup Evas_Object_Rectangle Rectangle Object Functions
5911 * @brief Function to create evas rectangle objects.
5913 * This function may seem useless given there are no functions to manipulate
5914 * the created rectangle, however the rectangle is actually very useful and can
5915 * be manipulate using the generic @ref Evas_Object_Group
5916 * "evas object functions".
5918 * For an example of use of an evas_object_rectangle see @ref
5919 * Example_Evas_Object_Manipulation "here".
5921 * @ingroup Evas_Object_Specific
5925 * Adds a rectangle to the given evas.
5926 * @param e The given evas.
5927 * @return The new rectangle object.
5929 * @ingroup Evas_Object_Rectangle
5931 EAPI Evas_Object *evas_object_rectangle_add (Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
5934 * @defgroup Evas_Object_Image Image Object Functions
5936 * Here are grouped together functions used to create and manipulate
5937 * image objects. They are available to whichever occasion one needs
5938 * complex imagery on a GUI that could not be achieved by the other
5939 * Evas' primitive object types, or to make image manipulations.
5941 * Evas will support whichever image file types it was compiled with
5942 * support to (its image loaders) -- check your software packager for
5943 * that information and see
5944 * evas_object_image_extension_can_load_get().
5946 * @section Evas_Object_Image_Basics Image object basics
5948 * The most common use of image objects -- to display an image on the
5949 * canvas -- is achieved by a common function triplet:
5951 * img = evas_object_image_add(canvas);
5952 * evas_object_image_file_set(img, "path/to/img", NULL);
5953 * evas_object_image_fill_set(img, 0, 0, w, h);
5955 * The first function, naturally, is creating the image object. Then,
5956 * one must set an source file on it, so that it knows where to fetch
5957 * image data from. Next, one must set <b>how to fill the image
5958 * object's area</b> with that given pixel data. One could use just a
5959 * sub-region of the original image or even have it tiled repeatedly
5960 * on the image object. For the common case of having the whole source
5961 * image to be displayed on the image object, streched to the
5962 * destination's size, there's also a function helper, to be used
5963 * instead of evas_object_image_fill_set():
5965 * evas_object_image_filled_set(img, EINA_TRUE);
5967 * See those functions' documentation for more details.
5969 * @section Evas_Object_Image_Scale Scale and resizing
5971 * Resizing of image objects will scale their respective source images
5972 * to their areas, if they are set to "fill" the object's area
5973 * (evas_object_image_filled_set()). If the user wants any control on
5974 * the aspect ratio of an image for different sizes, he/she has to
5975 * take care of that themselves. There are functions to make images to
5976 * get loaded scaled (up or down) in memory, already, if the user is
5977 * going to use them at pre-determined sizes and wants to save
5980 * Evas has even a scale cache, which will take care of caching scaled
5981 * versions of images with more often usage/hits. Finally, one can
5982 * have images being rescaled @b smoothly by Evas (more
5983 * computationally expensive) or not.
5985 * @section Evas_Object_Image_Performance Performance hints
5987 * When dealing with image objects, there are some tricks to boost the
5988 * performance of your application, if it does intense image loading
5989 * and/or manipulations, as in animations on a UI.
5991 * @subsection Evas_Object_Image_Load Load hints
5993 * In image viewer applications, for example, the user will be looking
5994 * at a given image, at full size, and will desire that the navigation
5995 * to the adjacent images on his/her album be fluid and fast. Thus,
5996 * while displaying a given image, the program can be on the
5997 * background loading the next and previous imagens already, so that
5998 * displaying them on the sequence is just a matter of repainting the
5999 * screen (and not decoding image data).
6001 * Evas addresses this issue with <b>image pre-loading</b>. The code
6002 * for the situation above would be something like the following:
6004 * prev = evas_object_image_filled_add(canvas);
6005 * evas_object_image_file_set(prev, "/path/to/prev", NULL);
6006 * evas_object_image_preload(prev, EINA_TRUE);
6008 * next = evas_object_image_filled_add(canvas);
6009 * evas_object_image_file_set(next, "/path/to/next", NULL);
6010 * evas_object_image_preload(next, EINA_TRUE);
6013 * If you're loading images which are too big, consider setting
6014 * previously it's loading size to something smaller, in case you
6015 * won't expose them in real size. It may speed up the loading
6018 * //to load a scaled down version of the image in memory, if that's
6019 * //the size you'll be displaying it anyway
6020 * evas_object_image_load_scale_down_set(img, zoom);
6022 * //optional: if you know you'll be showing a sub-set of the image's
6023 * //pixels, you can avoid loading the complementary data
6024 * evas_object_image_load_region_set(img, x, y, w, h);
6026 * Refer to Elementary's Photocam widget for a high level (smart)
6027 * object which does lots of loading speed-ups for you.
6029 * @subsection Evas_Object_Image_Animation Animation hints
6031 * If you want to animate image objects on a UI (what you'd get by
6032 * concomitant usage of other libraries, like Ecore and Edje), there
6033 * are also some tips on how to boost the performance of your
6034 * application. If the animation involves resizing of an image (thus,
6035 * re-scaling), you'd better turn off smooth scaling on it @b during
6036 * the animation, turning it back on afterwrads, for less
6037 * computations. Also, in this case you'd better flag the image object
6038 * in question not to cache scaled versions of it:
6040 * evas_object_image_scale_hint_set(wd->img, EVAS_IMAGE_SCALE_HINT_DYNAMIC);
6042 * // resizing takes place in between
6044 * evas_object_image_scale_hint_set(wd->img, EVAS_IMAGE_SCALE_HINT_STATIC);
6047 * Finally, movement of opaque images through the canvas is less
6048 * expensive than of translucid ones, because of blending
6051 * @section Evas_Object_Image_Borders Borders
6053 * Evas provides facilities for one to specify an image's region to be
6054 * treated specially -- as "borders". This will make those regions be
6055 * treated specially on resizing scales, by keeping their aspect. This
6056 * makes setting frames around other objects on UIs easy.
6057 * See the following figures for a visual explanation:\n
6059 * <img src="image-borders.png" style="max-width: 100%;" />
6060 * <a href="image-borders.png">Full-size</a>
6062 * @image rtf image-borders.png
6063 * @image latex image-borders.eps width=\textwidth
6065 * <img src="border-effect.png" style="max-width: 100%;" />
6066 * <a href="border-effect.png">Full-size</a>
6068 * @image rtf border-effect.png
6069 * @image latex border-effect.eps width=\textwidth
6071 * @section Evas_Object_Image_Manipulation Manipulating pixels
6073 * Evas image objects can be used to manipulate raw pixels in many
6074 * ways. The meaning of the data in the pixel arrays will depend on
6075 * the image's color space, be warned (see next section). You can set
6076 * your own data as an image's pixel data, fetch an image's pixel data
6077 * for saving/altering, convert images between different color spaces
6078 * and even advanced operations like setting a native surface as image
6081 * @section Evas_Object_Image_Color_Spaces Color spaces
6083 * Image objects may return or accept "image data" in multiple
6084 * formats. This is based on the color space of an object. Here is a
6085 * rundown on formats:
6087 * - #EVAS_COLORSPACE_ARGB8888:
6089 * This pixel format is a linear block of pixels, starting at the
6090 * top-left row by row until the bottom right of the image or pixel
6091 * region. All pixels are 32-bit unsigned int's with the high-byte
6092 * being alpha and the low byte being blue in the format ARGB. Alpha
6093 * may or may not be used by evas depending on the alpha flag of the
6094 * image, but if not used, should be set to 0xff anyway.
6096 * This colorspace uses premultiplied alpha. That means that R, G
6097 * and B cannot exceed A in value. The conversion from
6098 * non-premultiplied colorspace is:
6100 * R = (r * a) / 255; G = (g * a) / 255; B = (b * a) / 255;
6102 * So 50% transparent blue will be: 0x80000080. This will not be
6103 * "dark" - just 50% transparent. Values are 0 == black, 255 ==
6104 * solid or full red, green or blue.
6106 * - #EVAS_COLORSPACE_YCBCR422P601_PL:
6108 * This is a pointer-list indirected set of YUV (YCbCr) pixel
6109 * data. This means that the data returned or set is not actual
6110 * pixel data, but pointers TO lines of pixel data. The list of
6111 * pointers will first be N rows of pointers to the Y plane -
6112 * pointing to the first pixel at the start of each row in the Y
6113 * plane. N is the height of the image data in pixels. Each pixel in
6114 * the Y, U and V planes is 1 byte exactly, packed. The next N / 2
6115 * pointers will point to rows in the U plane, and the next N / 2
6116 * pointers will point to the V plane rows. U and V planes are half
6117 * the horizontal and vertical resolution of the Y plane.
6119 * Row order is top to bottom and row pixels are stored left to
6122 * There is a limitation that these images MUST be a multiple of 2
6123 * pixels in size horizontally or vertically. This is due to the U
6124 * and V planes being half resolution. Also note that this assumes
6125 * the itu601 YUV colorspace specification. This is defined for
6126 * standard television and mpeg streams. HDTV may use the itu709
6129 * Values are 0 to 255, indicating full or no signal in that plane
6132 * - #EVAS_COLORSPACE_YCBCR422P709_PL:
6134 * Not implemented yet.
6136 * - #EVAS_COLORSPACE_RGB565_A5P:
6138 * In the process of being implemented in 1 engine only. This may
6141 * This is a pointer to image data for 16-bit half-word pixel data
6142 * in 16bpp RGB 565 format (5 bits red, 6 bits green, 5 bits blue),
6143 * with the high-byte containing red and the low byte containing
6144 * blue, per pixel. This data is packed row by row from the top-left
6145 * to the bottom right.
6147 * If the image has an alpha channel enabled there will be an extra
6148 * alpha plane after the color pixel plane. If not, then this data
6149 * will not exist and should not be accessed in any way. This plane
6150 * is a set of pixels with 1 byte per pixel defining the alpha
6151 * values of all pixels in the image from the top-left to the bottom
6152 * right of the image, row by row. Even though the values of the
6153 * alpha pixels can be 0 to 255, only values 0 through to 32 are
6154 * used, 32 being solid and 0 being transparent.
6156 * RGB values can be 0 to 31 for red and blue and 0 to 63 for green,
6157 * with 0 being black and 31 or 63 being full red, green or blue
6158 * respectively. This colorspace is also pre-multiplied like
6159 * EVAS_COLORSPACE_ARGB8888 so:
6161 * R = (r * a) / 32; G = (g * a) / 32; B = (b * a) / 32;
6163 * - #EVAS_COLORSPACE_GRY8:
6165 * The image is just a alpha mask (8 bit's per pixel). This is used
6166 * for alpha masking.
6168 * Some examples on this group of functions can be found @ref
6169 * Example_Evas_Images "here".
6171 * @ingroup Evas_Object_Specific
6175 * @addtogroup Evas_Object_Image
6179 typedef void (*Evas_Object_Image_Pixels_Get_Cb) (void *data, Evas_Object *o);
6183 * Creates a new image object on the given Evas @p e canvas.
6185 * @param e The given canvas.
6186 * @return The created image object handle.
6188 * @note If you intend to @b display an image somehow in a GUI,
6189 * besides binding it to a real image file/source (with
6190 * evas_object_image_file_set(), for example), you'll have to tell
6191 * this image object how to fill its space with the pixels it can get
6192 * from the source. See evas_object_image_filled_add(), for a helper
6193 * on the common case of scaling up an image source to the whole area
6194 * of the image object.
6196 * @see evas_object_image_fill_set()
6200 * img = evas_object_image_add(canvas);
6201 * evas_object_image_file_set(img, "/path/to/img", NULL);
6204 EAPI Evas_Object *evas_object_image_add (Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
6207 * Creates a new image object that @b automatically scales its bound
6208 * image to the object's area, on both axis.
6210 * @param e The given canvas.
6211 * @return The created image object handle.
6213 * This is a helper function around evas_object_image_add() and
6214 * evas_object_image_filled_set(). It has the same effect of applying
6215 * those functions in sequence, which is a very common use case.
6217 * @note Whenever this object gets resized, the bound image will be
6220 * @see evas_object_image_add()
6221 * @see evas_object_image_filled_set()
6222 * @see evas_object_image_fill_set()
6224 EAPI Evas_Object *evas_object_image_filled_add (Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
6228 * Sets the data for an image from memory to be loaded
6230 * This is the same as evas_object_image_file_set() but the file to be loaded
6231 * may exist at an address in memory (the data for the file, not the filename
6232 * itself). The @p data at the address is copied and stored for future use, so
6233 * no @p data needs to be kept after this call is made. It will be managed and
6234 * freed for you when no longer needed. The @p size is limited to 2 gigabytes
6235 * in size, and must be greater than 0. A NULL @p data pointer is also invalid.
6236 * Set the filename to NULL to reset to empty state and have the image file
6237 * data freed from memory using evas_object_image_file_set().
6239 * The @p format is optional (pass NULL if you don't need/use it). It is used
6240 * to help Evas guess better which loader to use for the data. It may simply
6241 * be the "extension" of the file as it would normally be on disk such as
6242 * "jpg" or "png" or "gif" etc.
6244 * @param obj The given image object.
6245 * @param data The image file data address
6246 * @param size The size of the image file data in bytes
6247 * @param format The format of the file (optional), or @c NULL if not needed
6248 * @param key The image key in file, or @c NULL.
6250 EAPI void evas_object_image_memfile_set (Evas_Object *obj, void *data, int size, char *format, char *key) EINA_ARG_NONNULL(1, 2);
6253 * Set the source file from where an image object must fetch the real
6254 * image data (it may be an Eet file, besides pure image ones).
6256 * @param obj The given image object.
6257 * @param file The image file path.
6258 * @param key The image key in @p file (if its an Eet one), or @c
6261 * If the file supports multiple data stored in it (as Eet files do),
6262 * you can specify the key to be used as the index of the image in
6267 * img = evas_object_image_add(canvas);
6268 * evas_object_image_file_set(img, "/path/to/img", NULL);
6269 * err = evas_object_image_load_error_get(img);
6270 * if (err != EVAS_LOAD_ERROR_NONE)
6272 * fprintf(stderr, "could not load image '%s'. error string is \"%s\"\n",
6273 * valid_path, evas_load_error_str(err));
6277 * evas_object_image_fill_set(img, 0, 0, w, h);
6278 * evas_object_resize(img, w, h);
6279 * evas_object_show(img);
6283 EAPI void evas_object_image_file_set (Evas_Object *obj, const char *file, const char *key) EINA_ARG_NONNULL(1);
6286 * Retrieve the source file from where an image object is to fetch the
6287 * real image data (it may be an Eet file, besides pure image ones).
6289 * @param obj The given image object.
6290 * @param file Location to store the image file path.
6291 * @param key Location to store the image key (if @p file is an Eet
6294 * You must @b not modify the strings on the returned pointers.
6296 * @note Use @c NULL pointers on the file components you're not
6297 * interested in: they'll be ignored by the function.
6299 EAPI void evas_object_image_file_get (const Evas_Object *obj, const char **file, const char **key) EINA_ARG_NONNULL(1, 2);
6302 * Set the dimensions for an image object's border, a region which @b
6303 * won't ever be scaled together with its center.
6305 * @param obj The given image object.
6306 * @param l The border's left width.
6307 * @param r The border's right width.
6308 * @param t The border's top width.
6309 * @param b The border's bottom width.
6311 * When Evas is rendering, an image source may be scaled to fit the
6312 * size of its image object. This function sets an area from the
6313 * borders of the image inwards which is @b not to be scaled. This
6314 * function is useful for making frames and for widget theming, where,
6315 * for example, buttons may be of varying sizes, but their border size
6316 * must remain constant.
6318 * The units used for @p l, @p r, @p t and @p b are canvas units.
6320 * @note The border region itself @b may be scaled by the
6321 * evas_object_image_border_scale_set() function.
6323 * @note By default, image objects have no borders set, i. e. @c l, @c
6324 * r, @c t and @c b start as @c 0.
6326 * See the following figures for visual explanation:\n
6328 * <img src="image-borders.png" style="max-width: 100%;" />
6329 * <a href="image-borders.png">Full-size</a>
6331 * @image rtf image-borders.png
6332 * @image latex image-borders.eps width=\textwidth
6334 * <img src="border-effect.png" style="max-width: 100%;" />
6335 * <a href="border-effect.png">Full-size</a>
6337 * @image rtf border-effect.png
6338 * @image latex border-effect.eps width=\textwidth
6340 * @see evas_object_image_border_get()
6341 * @see evas_object_image_border_center_fill_set()
6343 EAPI void evas_object_image_border_set (Evas_Object *obj, int l, int r, int t, int b) EINA_ARG_NONNULL(1);
6346 * Retrieve the dimensions for an image object's border, a region
6347 * which @b won't ever be scaled together with its center.
6349 * @param obj The given image object.
6350 * @param l Location to store the border's left width in.
6351 * @param r Location to store the border's right width in.
6352 * @param t Location to store the border's top width in.
6353 * @param b Location to store the border's bottom width in.
6355 * @note Use @c NULL pointers on the border components you're not
6356 * interested in: they'll be ignored by the function.
6358 * See @ref evas_object_image_border_set() for more details.
6360 EAPI void evas_object_image_border_get (const Evas_Object *obj, int *l, int *r, int *t, int *b) EINA_ARG_NONNULL(1);
6363 * Sets @b how the center part of the given image object (not the
6364 * borders) should be drawn when Evas is rendering it.
6366 * @param obj The given image object.
6367 * @param fill Fill mode of the center region of @p obj (a value in
6368 * #Evas_Border_Fill_Mode).
6370 * This function sets how the center part of the image object's source
6371 * image is to be drawn, which must be one of the values in
6372 * #Evas_Border_Fill_Mode. By center we mean the complementary part of
6373 * that defined by evas_object_image_border_set(). This one is very
6374 * useful for making frames and decorations. You would most probably
6375 * also be using a filled image (as in evas_object_image_filled_set())
6376 * to use as a frame.
6378 * @see evas_object_image_border_center_fill_get()
6380 EAPI void evas_object_image_border_center_fill_set (Evas_Object *obj, Evas_Border_Fill_Mode fill) EINA_ARG_NONNULL(1);
6383 * Retrieves @b how the center part of the given image object (not the
6384 * borders) is to be drawn when Evas is rendering it.
6386 * @param obj The given image object.
6387 * @return fill Fill mode of the center region of @p obj (a value in
6388 * #Evas_Border_Fill_Mode).
6390 * See @ref evas_object_image_fill_set() for more details.
6392 EAPI Evas_Border_Fill_Mode evas_object_image_border_center_fill_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
6395 * Set whether the image object's fill property should track the
6398 * @param obj The given image object.
6399 * @param setting @c EINA_TRUE, to make the fill property follow
6400 * object size or @c EINA_FALSE, otherwise
6402 * If @p setting is @c EINA_TRUE, then every evas_object_resize() will
6403 * @b automatically trigger a call to evas_object_image_fill_set()
6404 * with the that new size (and @c 0, @c 0 as source image's origin),
6405 * so the bound image will fill the whole object's area.
6407 * @see evas_object_image_filled_add()
6408 * @see evas_object_image_fill_get()
6410 EAPI void evas_object_image_filled_set (Evas_Object *obj, Eina_Bool setting) EINA_ARG_NONNULL(1);
6413 * Retrieve whether the image object's fill property should track the
6416 * @param obj The given image object.
6417 * @return @c EINA_TRUE if it is tracking, @c EINA_FALSE, if not (and
6418 * evas_object_fill_set() must be called manually).
6420 * @see evas_object_image_filled_set() for more information
6422 EAPI Eina_Bool evas_object_image_filled_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
6425 * Sets the scaling factor (multiplier) for the borders of an image
6428 * @param obj The given image object.
6429 * @param scale The scale factor (default is @c 1.0 - i.e. no scaling)
6431 * @see evas_object_image_border_set()
6432 * @see evas_object_image_border_scale_get()
6434 EAPI void evas_object_image_border_scale_set (Evas_Object *obj, double scale);
6437 * Retrieves the scaling factor (multiplier) for the borders of an
6440 * @param obj The given image object.
6441 * @return The scale factor set for its borders
6443 * @see evas_object_image_border_set()
6444 * @see evas_object_image_border_scale_set()
6446 EAPI double evas_object_image_border_scale_get (const Evas_Object *obj);
6449 * Set how to fill an image object's drawing rectangle given the
6450 * (real) image bound to it.
6452 * @param obj The given image object to operate on.
6453 * @param x The x coordinate (from the top left corner of the bound
6454 * image) to start drawing from.
6455 * @param y The y coordinate (from the top left corner of the bound
6456 * image) to start drawing from.
6457 * @param w The width the bound image will be displayed at.
6458 * @param h The height the bound image will be displayed at.
6460 * Note that if @p w or @p h are smaller than the dimensions of
6461 * @p obj, the displayed image will be @b tiled around the object's
6462 * area. To have only one copy of the bound image drawn, @p x and @p y
6463 * must be 0 and @p w and @p h need to be the exact width and height
6464 * of the image object itself, respectively.
6466 * See the following image to better understand the effects of this
6467 * call. On this diagram, both image object and original image source
6468 * have @c a x @c a dimentions and the image itself is a circle, with
6469 * empty space around it:
6471 * @image html image-fill.png
6472 * @image rtf image-fill.png
6473 * @image latex image-fill.eps
6475 * @warning The default values for the fill parameters are @p x = 0,
6476 * @p y = 0, @p w = 0 and @p h = 0. Thus, if you're not using the
6477 * evas_object_image_filled_add() helper and want your image
6478 * displayed, you'll have to set valid values with this fuction on
6481 * @note evas_object_image_filled_set() is a helper function which
6482 * will @b override the values set here automatically, for you, in a
6485 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);
6488 * Retrieve how an image object is to fill its drawing rectangle,
6489 * given the (real) image bound to it.
6491 * @param obj The given image object.
6492 * @param x Location to store the x coordinate (from the top left
6493 * corner of the bound image) to start drawing from.
6494 * @param y Location to store the y coordinate (from the top left
6495 * corner of the bound image) to start drawing from.
6496 * @param w Location to store the width the bound image is to be
6498 * @param h Location to store the height the bound image is to be
6501 * @note Use @c NULL pointers on the fill components you're not
6502 * interested in: they'll be ignored by the function.
6504 * See @ref evas_object_image_fill_set() for more details.
6506 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);
6509 * Sets the tiling mode for the given evas image object's fill.
6510 * @param obj The given evas image object.
6511 * @param spread One of EVAS_TEXTURE_REFLECT, EVAS_TEXTURE_REPEAT,
6512 * EVAS_TEXTURE_RESTRICT, or EVAS_TEXTURE_PAD.
6514 EAPI void evas_object_image_fill_spread_set (Evas_Object *obj, Evas_Fill_Spread spread) EINA_ARG_NONNULL(1);
6517 * Retrieves the spread (tiling mode) for the given image object's
6520 * @param obj The given evas image object.
6521 * @return The current spread mode of the image object.
6523 EAPI Evas_Fill_Spread evas_object_image_fill_spread_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
6526 * Sets the size of the given image object.
6528 * @param obj The given image object.
6529 * @param w The new width of the image.
6530 * @param h The new height of the image.
6532 * This function will scale down or crop the image so that it is
6533 * treated as if it were at the given size. If the size given is
6534 * smaller than the image, it will be cropped. If the size given is
6535 * larger, then the image will be treated as if it were in the upper
6536 * left hand corner of a larger image that is otherwise transparent.
6538 EAPI void evas_object_image_size_set (Evas_Object *obj, int w, int h) EINA_ARG_NONNULL(1);
6541 * Retrieves the size of the given image object.
6543 * @param obj The given image object.
6544 * @param w Location to store the width of the image in, or @c NULL.
6545 * @param h Location to store the height of the image in, or @c NULL.
6547 * See @ref evas_object_image_size_set() for more details.
6549 EAPI void evas_object_image_size_get (const Evas_Object *obj, int *w, int *h) EINA_ARG_NONNULL(1);
6552 * Retrieves the row stride of the given image object.
6554 * @param obj The given image object.
6555 * @return The stride of the image (<b>in bytes</b>).
6557 * The row stride is the number of bytes between the start of a row
6558 * and the start of the next row for image data.
6560 EAPI int evas_object_image_stride_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
6563 * Retrieves a number representing any error that occurred during the
6564 * last loading of the given image object's source image.
6566 * @param obj The given image object.
6567 * @return A value giving the last error that occurred. It should be
6568 * one of the #Evas_Load_Error values. #EVAS_LOAD_ERROR_NONE
6569 * is returned if there was no error.
6571 EAPI Evas_Load_Error evas_object_image_load_error_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
6574 * Sets the raw image data of the given image object.
6576 * @param obj The given image object.
6577 * @param data The raw data, or @c NULL.
6579 * Note that the raw data must be of the same size (see
6580 * evas_object_image_size_set(), which has to be called @b before this
6581 * one) and colorspace (see evas_object_image_colorspace_set()) of the
6582 * image. If data is @c NULL, the current image data will be
6583 * freed. Naturally, if one does not set an image object's data
6584 * manually, it will still have one, allocated by Evas.
6586 * @see evas_object_image_data_get()
6588 EAPI void evas_object_image_data_set (Evas_Object *obj, void *data) EINA_ARG_NONNULL(1);
6591 * Get a pointer to the raw image data of the given image object.
6593 * @param obj The given image object.
6594 * @param for_writing Whether the data being retrieved will be
6595 * modified (@c EINA_TRUE) or not (@c EINA_FALSE).
6596 * @return The raw image data.
6598 * This function returns a pointer to an image object's internal pixel
6599 * buffer, for reading only or read/write. If you request it for
6600 * writing, the image will be marked dirty so that it gets redrawn at
6603 * Each time you call this function on an image object, its data
6604 * buffer will have an internal reference counter
6605 * incremented. Decrement it back by using
6606 * evas_object_image_data_set(). This is specially important for the
6607 * directfb Evas engine.
6609 * This is best suited for when you want to modify an existing image,
6610 * without changing its dimensions.
6612 * @note The contents' formart returned by it depend on the color
6613 * space of the given image object.
6615 * @note You may want to use evas_object_image_data_update_add() to
6616 * inform data changes, if you did any.
6618 * @see evas_object_image_data_set()
6620 EAPI void *evas_object_image_data_get (const Evas_Object *obj, Eina_Bool for_writing) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
6623 * Converts the raw image data of the given image object to the
6624 * specified colorspace.
6626 * Note that this function does not modify the raw image data. If the
6627 * requested colorspace is the same as the image colorspace nothing is
6628 * done and NULL is returned. You should use
6629 * evas_object_image_colorspace_get() to check the current image
6632 * See @ref evas_object_image_colorspace_get.
6634 * @param obj The given image object.
6635 * @param to_cspace The colorspace to which the image raw data will be converted.
6636 * @return data A newly allocated data in the format specified by to_cspace.
6638 EAPI void *evas_object_image_data_convert (Evas_Object *obj, Evas_Colorspace to_cspace) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
6641 * Replaces the raw image data of the given image object.
6643 * @param obj The given image object.
6644 * @param data The raw data to replace.
6646 * This function lets the application replace an image object's
6647 * internal pixel buffer with an user-allocated one. For best results,
6648 * you should generally first call evas_object_image_size_set() with
6649 * the width and height for the new buffer.
6651 * This call is best suited for when you will be using image data with
6652 * different dimensions than the existing image data, if any. If you
6653 * only need to modify the existing image in some fashion, then using
6654 * evas_object_image_data_get() is probably what you are after.
6656 * Note that the caller is responsible for freeing the buffer when
6657 * finished with it, as user-set image data will not be automatically
6658 * freed when the image object is deleted.
6660 * See @ref evas_object_image_data_get() for more details.
6663 EAPI void evas_object_image_data_copy_set (Evas_Object *obj, void *data) EINA_ARG_NONNULL(1);
6666 * Mark a sub-region of the given image object to be redrawn.
6668 * @param obj The given image object.
6669 * @param x X-offset of the region to be updated.
6670 * @param y Y-offset of the region to be updated.
6671 * @param w Width of the region to be updated.
6672 * @param h Height of the region to be updated.
6674 * This function schedules a particular rectangular region of an image
6675 * object to be updated (redrawn) at the next rendering cycle.
6677 EAPI void evas_object_image_data_update_add (Evas_Object *obj, int x, int y, int w, int h) EINA_ARG_NONNULL(1);
6680 * Enable or disable alpha channel usage on the given image object.
6682 * @param obj The given image object.
6683 * @param has_alpha Whether to use alpha channel (@c EINA_TRUE) data
6684 * or not (@c EINA_FALSE).
6686 * This function sets a flag on an image object indicating whether or
6687 * not to use alpha channel data. A value of @c EINA_TRUE makes it use
6688 * alpha channel data, and @c EINA_FALSE makes it ignore that
6689 * data. Note that this has nothing to do with an object's color as
6690 * manipulated by evas_object_color_set().
6692 * @see evas_object_image_alpha_get()
6694 EAPI void evas_object_image_alpha_set (Evas_Object *obj, Eina_Bool has_alpha) EINA_ARG_NONNULL(1);
6697 * Retrieve whether alpha channel data is being used on the given
6700 * @param obj The given image object.
6701 * @return Whether the alpha channel data is being used (@c EINA_TRUE)
6702 * or not (@c EINA_FALSE).
6704 * This function returns @c EINA_TRUE if the image object's alpha
6705 * channel is being used, or @c EINA_FALSE otherwise.
6707 * See @ref evas_object_image_alpha_set() for more details.
6709 EAPI Eina_Bool evas_object_image_alpha_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
6712 * Sets whether to use high-quality image scaling algorithm on the
6713 * given image object.
6715 * @param obj The given image object.
6716 * @param smooth_scale Whether to use smooth scale or not.
6718 * When enabled, a higher quality image scaling algorithm is used when
6719 * scaling images to sizes other than the source image's original
6720 * one. This gives better results but is more computationally
6723 * @note Image objects get created originally with smooth scaling @b
6726 * @see evas_object_image_smooth_scale_get()
6728 EAPI void evas_object_image_smooth_scale_set (Evas_Object *obj, Eina_Bool smooth_scale) EINA_ARG_NONNULL(1);
6731 * Retrieves whether the given image object is using high-quality
6732 * image scaling algorithm.
6734 * @param obj The given image object.
6735 * @return Whether smooth scale is being used.
6737 * See @ref evas_object_image_smooth_scale_set() for more details.
6739 EAPI Eina_Bool evas_object_image_smooth_scale_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
6742 * Preload an image object's image data in the background
6744 * @param obj The given image object.
6745 * @param cancel @c EINA_FALSE will add it the preloading work queue,
6746 * @c EINA_TRUE will remove it (if it was issued before).
6748 * This function requests the preload of the data image in the
6749 * background. The work is queued before being processed (because
6750 * there might be other pending requests of this type).
6752 * Whenever the image data gets loaded, Evas will call
6753 * #EVAS_CALLBACK_IMAGE_PRELOADED registered callbacks on @p obj (what
6754 * may be immediately, if the data was already preloaded before).
6756 * Use @c EINA_TRUE for @p cancel on scenarios where you don't need
6757 * the image data preloaded anymore.
6759 * @note Any evas_object_show() call after evas_object_image_preload()
6760 * will make the latter to be @b cancelled, with the loading process
6761 * now taking place @b synchronously (and, thus, blocking the return
6762 * of the former until the image is loaded). It is highly advisable,
6763 * then, that the user preload an image with it being @b hidden, just
6764 * to be shown on the #EVAS_CALLBACK_IMAGE_PRELOADED event's callback.
6766 EAPI void evas_object_image_preload (Evas_Object *obj, Eina_Bool cancel) EINA_ARG_NONNULL(1);
6769 * Reload an image object's image data.
6771 * @param obj The given image object pointer.
6773 * This function reloads the image data bound to image object @p obj.
6775 EAPI void evas_object_image_reload (Evas_Object *obj) EINA_ARG_NONNULL(1);
6778 * Save the given image object's contents to an (image) file.
6780 * @param obj The given image object.
6781 * @param file The filename to be used to save the image (extension
6783 * @param key The image key in the file (if an Eet one), or @c NULL,
6785 * @param flags String containing the flags to be used (@c NULL for
6788 * The extension suffix on @p file will determine which <b>saver
6789 * module</b> Evas is to use when saving, thus the final file's
6790 * format. If the file supports multiple data stored in it (Eet ones),
6791 * you can specify the key to be used as the index of the image in it.
6793 * You can specify some flags when saving the image. Currently
6794 * acceptable flags are @c quality and @c compress. Eg.: @c
6795 * "quality=100 compress=9"
6797 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);
6800 * Import pixels from given source to a given canvas image object.
6802 * @param obj The given canvas object.
6803 * @param pixels The pixel's source to be imported.
6805 * This function imports pixels from a given source to a given canvas image.
6808 EAPI Eina_Bool evas_object_image_pixels_import (Evas_Object *obj, Evas_Pixel_Import_Source *pixels) EINA_ARG_NONNULL(1, 2);
6811 * Set the callback function to get pixels from a canva's image.
6813 * @param obj The given canvas pointer.
6814 * @param func The callback function.
6815 * @param data The data pointer to be passed to @a func.
6817 * This functions sets a function to be the callback function that get
6818 * pixes from a image of the canvas.
6821 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);
6824 * Mark whether the given image object is dirty (needs to be redrawn).
6826 * @param obj The given image object.
6827 * @param dirty Whether the image is dirty.
6829 EAPI void evas_object_image_pixels_dirty_set (Evas_Object *obj, Eina_Bool dirty) EINA_ARG_NONNULL(1);
6832 * Retrieves whether the given image object is dirty (needs to be redrawn).
6834 * @param obj The given image object.
6835 * @return Whether the image is dirty.
6837 EAPI Eina_Bool evas_object_image_pixels_dirty_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
6840 * Set the DPI resolution of an image object's source image.
6842 * @param obj The given canvas pointer.
6843 * @param dpi The new DPI resolution.
6845 * This function sets the DPI resolution of a given loaded canvas
6846 * image. Most useful for the SVG image loader.
6848 * @see evas_object_image_load_dpi_get()
6850 EAPI void evas_object_image_load_dpi_set (Evas_Object *obj, double dpi) EINA_ARG_NONNULL(1);
6853 * Get the DPI resolution of a loaded image object in the canvas.
6855 * @param obj The given canvas pointer.
6856 * @return The DPI resolution of the given canvas image.
6858 * This function returns the DPI resolution of the given canvas image.
6860 * @see evas_object_image_load_dpi_set() for more details
6862 EAPI double evas_object_image_load_dpi_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
6865 * Set the size of a given image object's source image, when loading
6868 * @param obj The given canvas object.
6869 * @param w The new width of the image's load size.
6870 * @param h The new height of the image's load size.
6872 * This function sets a new (loading) size for the given canvas
6875 * @see evas_object_image_load_size_get()
6877 EAPI void evas_object_image_load_size_set (Evas_Object *obj, int w, int h) EINA_ARG_NONNULL(1);
6880 * Get the size of a given image object's source image, when loading
6883 * @param obj The given image object.
6884 * @param w Where to store the new width of the image's load size.
6885 * @param h Where to store the new height of the image's load size.
6887 * @note Use @c NULL pointers on the size components you're not
6888 * interested in: they'll be ignored by the function.
6890 * @see evas_object_image_load_size_set() for more details
6892 EAPI void evas_object_image_load_size_get (const Evas_Object *obj, int *w, int *h) EINA_ARG_NONNULL(1);
6895 * Set the scale down factor of a given image object's source image,
6898 * @param obj The given image object pointer.
6899 * @param scale_down The scale down factor.
6901 * This function sets the scale down factor of a given canvas
6902 * image. Most useful for the SVG image loader.
6904 * @see evas_object_image_load_scale_down_get()
6906 EAPI void evas_object_image_load_scale_down_set (Evas_Object *obj, int scale_down) EINA_ARG_NONNULL(1);
6909 * get the scale down factor of a given image object's source image,
6912 * @param obj The given image object pointer.
6914 * @see evas_object_image_load_scale_down_set() for more details
6916 EAPI int evas_object_image_load_scale_down_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
6919 * Inform a given image object to load a selective region of its
6922 * @param obj The given image object pointer.
6923 * @param x X-offset of the region to be loaded.
6924 * @param y Y-offset of the region to be loaded.
6925 * @param w Width of the region to be loaded.
6926 * @param h Height of the region to be loaded.
6928 * This function is useful when one is not showing all of an image's
6929 * area on its image object.
6931 * @note The image loader for the image format in question has to
6932 * support selective region loading in order to this function to take
6935 * @see evas_object_image_load_region_get()
6937 EAPI void evas_object_image_load_region_set (Evas_Object *obj, int x, int y, int w, int h) EINA_ARG_NONNULL(1);
6940 * Retrieve the coordinates of a given image object's selective
6941 * (source image) load region.
6943 * @param obj The given image object pointer.
6944 * @param x Where to store the X-offset of the region to be loaded.
6945 * @param y Where to store the Y-offset of the region to be loaded.
6946 * @param w Where to store the width of the region to be loaded.
6947 * @param h Where to store the height of the region to be loaded.
6949 * @note Use @c NULL pointers on the coordinates you're not interested
6950 * in: they'll be ignored by the function.
6952 * @see evas_object_image_load_region_get()
6954 EAPI void evas_object_image_load_region_get (const Evas_Object *obj, int *x, int *y, int *w, int *h) EINA_ARG_NONNULL(1);
6957 * Define if the orientation information in the image file should be honored.
6959 * @param obj The given image object pointer.
6960 * @param enable @p EINA_TRUE means that it should honor the orientation information
6963 EAPI void evas_object_image_load_orientation_set (Evas_Object *obj, Eina_Bool enable) EINA_ARG_NONNULL(1);
6966 * Get if the orientation information in the image file should be honored.
6968 * @param obj The given image object pointer.
6971 EAPI Eina_Bool evas_object_image_load_orientation_get (const Evas_Object *obj) EINA_ARG_NONNULL(1);
6974 * Set the colorspace of a given image of the canvas.
6976 * @param obj The given image object pointer.
6977 * @param cspace The new color space.
6979 * This function sets the colorspace of given canvas image.
6982 EAPI void evas_object_image_colorspace_set (Evas_Object *obj, Evas_Colorspace cspace) EINA_ARG_NONNULL(1);
6985 * Get the colorspace of a given image of the canvas.
6987 * @param obj The given image object pointer.
6988 * @return The colorspace of the image.
6990 * This function returns the colorspace of given canvas image.
6993 EAPI Evas_Colorspace evas_object_image_colorspace_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
6996 * Set the native surface of a given image of the canvas
6998 * @param obj The given canvas pointer.
6999 * @param surf The new native surface.
7001 * This function sets a native surface of a given canvas image.
7004 EAPI void evas_object_image_native_surface_set (Evas_Object *obj, Evas_Native_Surface *surf) EINA_ARG_NONNULL(1, 2);
7007 * Get the native surface of a given image of the canvas
7009 * @param obj The given canvas pointer.
7010 * @return The native surface of the given canvas image.
7012 * This function returns the native surface of a given canvas image.
7015 EAPI Evas_Native_Surface *evas_object_image_native_surface_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
7018 * Set the scale hint of a given image of the canvas.
7020 * @param obj The given image object pointer.
7021 * @param hint The scale hint, a value in
7022 * #Evas_Image_Scale_Hint.
7024 * This function sets the scale hint value of the given image object
7025 * in the canvas, which will affect how Evas is to cache scaled
7026 * versions of its original source image.
7028 * @see evas_object_image_scale_hint_get()
7030 EAPI void evas_object_image_scale_hint_set (Evas_Object *obj, Evas_Image_Scale_Hint hint) EINA_ARG_NONNULL(1);
7033 * Get the scale hint of a given image of the canvas.
7035 * @param obj The given image object pointer.
7036 * @return The scale hint value set on @p obj, a value in
7037 * #Evas_Image_Scale_Hint.
7039 * This function returns the scale hint value of the given image
7040 * object of the canvas.
7042 * @see evas_object_image_scale_hint_set() for more details.
7044 EAPI Evas_Image_Scale_Hint evas_object_image_scale_hint_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
7047 * Set the content hint setting of a given image object of the canvas.
7049 * @param obj The given canvas pointer.
7050 * @param hint The content hint value, one of the
7051 * #Evas_Image_Content_Hint ones.
7053 * This function sets the content hint value of the given image of the
7054 * canvas. For example, if you're on the GL engine and your driver
7055 * implementation supports it, setting this hint to
7056 * #EVAS_IMAGE_CONTENT_HINT_DYNAMIC will make it need @b zero copies
7057 * at texture upload time, which is an "expensive" operation.
7059 * @see evas_object_image_content_hint_get()
7061 EAPI void evas_object_image_content_hint_set (Evas_Object *obj, Evas_Image_Content_Hint hint) EINA_ARG_NONNULL(1);
7064 * Get the content hint setting of a given image object of the canvas.
7066 * @param obj The given canvas pointer.
7067 * @return hint The content hint value set on it, one of the
7068 * #Evas_Image_Content_Hint ones (#EVAS_IMAGE_CONTENT_HINT_NONE means
7071 * This function returns the content hint value of the given image of
7074 * @see evas_object_image_content_hint_set()
7076 EAPI Evas_Image_Content_Hint evas_object_image_content_hint_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
7080 * Enable an image to be used as an alpha mask.
7082 * This will set any flags, and discard any excess image data not used as an
7085 * Note there is little point in using a image as alpha mask unless it has an
7088 * @param obj Object to use as an alpha mask.
7089 * @param ismask Use image as alphamask, must be true.
7091 EAPI void evas_object_image_alpha_mask_set (Evas_Object *obj, Eina_Bool ismask) EINA_ARG_NONNULL(1);
7094 * Set the source object on an image object to used as a @b proxy.
7096 * @param obj Proxy (image) object.
7097 * @param src Source object to use for the proxy.
7098 * @return @c EINA_TRUE on success, @c EINA_FALSE on error.
7100 * If an image object is set to behave as a @b proxy, it will mirror
7101 * the rendering contents of a given @b source object in its drawing
7102 * region, without affecting that source in any way. The source must
7103 * be another valid Evas object. Other effects may be applied to the
7104 * proxy, such as a map (see evas_object_map_set()) to create a
7105 * reflection of the original object (for example).
7107 * Any existing source object on @p obj will be removed after this
7108 * call. Setting @p src to @c NULL clears the proxy object (not in
7109 * "proxy state" anymore).
7111 * @warning You cannot set a proxy as another proxy's source.
7113 * @see evas_object_image_source_get()
7114 * @see evas_object_image_source_unset()
7116 EAPI Eina_Bool evas_object_image_source_set (Evas_Object *obj, Evas_Object *src) EINA_ARG_NONNULL(1);
7119 * Get the current source object of an image object.
7121 * @param obj Image object
7122 * @return Source object (if any), or @c NULL, if not in "proxy mode"
7125 * @see evas_object_image_source_set() for more details
7127 EAPI Evas_Object *evas_object_image_source_get (Evas_Object *obj) EINA_ARG_NONNULL(1);
7130 * Clear the source object on a proxy image object.
7132 * @param obj Image object to clear source of.
7133 * @return @c EINA_TRUE on success, @c EINA_FALSE on error.
7135 * This is equivalent to calling evas_object_image_source_set() with a
7138 EAPI Eina_Bool evas_object_image_source_unset (Evas_Object *obj) EINA_ARG_NONNULL(1);
7141 * Check if a file extension may be supported by @ref Evas_Object_Image.
7143 * @param file The file to check
7144 * @return EINA_TRUE if we may be able to opeen it, EINA_FALSE if it's unlikely.
7147 * If file is a Eina_Stringshare, use directly @ref evas_object_image_extension_can_load_fast_get.
7149 * This functions is threadsafe.
7151 EAPI Eina_Bool evas_object_image_extension_can_load_get(const char *file);
7154 * Check if a file extension may be supported by @ref Evas_Object_Image.
7156 * @param file The file to check, it should be an Eina_Stringshare.
7157 * @return EINA_TRUE if we may be able to opeen it, EINA_FALSE if it's unlikely.
7160 * This functions is threadsafe.
7162 EAPI Eina_Bool evas_object_image_extension_can_load_fast_get(const char *file);
7165 * Check if an image object can be animated (have multiple frames)
7167 * @param obj Image object
7168 * @return whether obj support animation
7170 * This returns if the image file of an image object is capable of animation
7171 * such as an animated gif file might. This is only useful to be called once
7172 * the image object file has been set.
7176 * extern Evas_Object *obj;
7178 * if (evas_object_image_animated_get(obj))
7182 * Evas_Image_Animated_Loop_Hint loop_type;
7185 * frame_count = evas_object_image_animated_frame_count_get(obj);
7186 * printf("This image has %d frames\n",frame_count);
7188 * duration = evas_object_image_animated_frame_duration_get(obj,1,0);
7189 * printf("Frame 1's duration is %f. You had better set object's frame to 2 after this duration using timer\n");
7191 * loop_count = evas_object_image_animated_loop_count_get(obj);
7192 * printf("loop count is %d. You had better run loop %d times\n",loop_count,loop_count);
7194 * loop_type = evas_object_image_animated_loop_type_get(obj);
7195 * if (loop_type == EVAS_IMAGE_ANIMATED_HINT_LOOP)
7196 * printf("You had better set frame like 1->2->3->1->2->3...\n");
7197 * else if (loop_type == EVAS_IMAGE_ANIMATED_HINT_PINGPONG)
7198 * printf("You had better set frame like 1->2->3->2->1->2...\n");
7200 * printf("Unknown loop type\n");
7202 * evas_object_image_animated_frame_set(obj,1);
7203 * printf("You set image object's frame to 1. You can see frame 1\n");
7207 * @see evas_object_image_animated_get()
7208 * @see evas_object_image_animated_frame_num_get()
7209 * @see evas_object_image_animated_loop_type_get()
7210 * @see evas_object_image_animated_loop_count_get()
7211 * @see evas_object_image_animated_frame_duration_get()
7212 * @see evas_object_image_animated_frame_set()
7215 EAPI Eina_Bool evas_object_image_animated_get(const Evas_Object *obj);
7218 * Get the total number of frames of the image object.
7220 * @param obj Image object
7221 * @return The number of frames
7223 * This returns total number of frames the image object supports (if animated)
7225 * @see evas_object_image_animated_get()
7226 * @see evas_object_image_animated_frame_num_get()
7227 * @see evas_object_image_animated_loop_type_get()
7228 * @see evas_object_image_animated_loop_count_get()
7229 * @see evas_object_image_animated_frame_duration_get()
7230 * @see evas_object_image_animated_frame_set()
7233 EAPI int evas_object_image_animated_frame_count_get(const Evas_Object *obj);
7234 EINA_DEPRECATED EAPI int evas_object_image_animated_frame_num_get(const Evas_Object *obj);
7237 * Get the kind of looping the image object does.
7239 * @param obj Image object
7240 * @return Loop type of the image object
7242 * This returns the kind of looping the image object wants to do.
7244 * If it returns EVAS_IMAGE_ANIMATED_HINT_LOOP, you should display frames in a sequence like:
7245 * 1->2->3->1->2->3->1...
7246 * If it returns EVAS_IMAGE_ANIMATED_HINT_PINGPONG, it is better to
7247 * display frames in a sequence like: 1->2->3->2->1->2->3->1...
7249 * The default type is EVAS_IMAGE_ANIMATED_HINT_LOOP.
7251 * @see evas_object_image_animated_get()
7252 * @see evas_object_image_animated_frame_num_get()
7253 * @see evas_object_image_animated_loop_type_get()
7254 * @see evas_object_image_animated_loop_count_get()
7255 * @see evas_object_image_animated_frame_duration_get()
7256 * @see evas_object_image_animated_frame_set()
7259 EAPI Evas_Image_Animated_Loop_Hint evas_object_image_animated_loop_type_get(const Evas_Object *obj);
7262 * Get the number times the animation of the object loops.
7264 * @param obj Image object
7265 * @return The number of loop of an animated image object
7267 * This returns loop count of image. The loop count is the number of times
7268 * the animation will play fully from first to last frame until the animation
7269 * should stop (at the final frame).
7271 * If 0 is returned, then looping should happen indefinitely (no limit to
7272 * the number of times it loops).
7274 * @see evas_object_image_animated_get()
7275 * @see evas_object_image_animated_frame_num_get()
7276 * @see evas_object_image_animated_loop_type_get()
7277 * @see evas_object_image_animated_loop_count_get()
7278 * @see evas_object_image_animated_frame_duration_get()
7279 * @see evas_object_image_animated_frame_set()
7282 EAPI int evas_object_image_animated_loop_count_get(const Evas_Object *obj);
7285 * Get the duration of a sequence of frames.
7287 * @param obj Image object
7288 * @param start_frame The first frame
7289 * @param fram_num Number of frames in the sequence
7291 * This returns total duration that the specified sequence of frames should
7294 * If you set start_frame to 1 and frame_num 0, you get frame 1's duration
7295 * If you set start_frame to 1 and frame_num 1, you get frame 1's duration +
7298 * @see evas_object_image_animated_get()
7299 * @see evas_object_image_animated_frame_num_get()
7300 * @see evas_object_image_animated_loop_type_get()
7301 * @see evas_object_image_animated_loop_count_get()
7302 * @see evas_object_image_animated_frame_duration_get()
7303 * @see evas_object_image_animated_frame_set()
7306 EAPI double evas_object_image_animated_frame_duration_get(const Evas_Object *obj, int start_frame, int fram_num);
7309 * Set the frame to current frame of an image object
7311 * @param obj The given image object.
7312 * @param frame_num The index of current frame
7314 * This set image object's current frame to frame_num with 1 being the first
7317 * @see evas_object_image_animated_get()
7318 * @see evas_object_image_animated_frame_num_get()
7319 * @see evas_object_image_animated_loop_type_get()
7320 * @see evas_object_image_animated_loop_count_get()
7321 * @see evas_object_image_animated_frame_duration_get()
7322 * @see evas_object_image_animated_frame_set()
7325 EAPI void evas_object_image_animated_frame_set(Evas_Object *obj, int frame_num);
7331 * @defgroup Evas_Object_Text Text Object Functions
7333 * Functions that operate on single line, single style text objects.
7335 * For multiline and multiple style text, see @ref Evas_Object_Textblock.
7337 * See some @ref Example_Evas_Text "examples" on this group of functions.
7339 * @ingroup Evas_Object_Specific
7343 * @addtogroup Evas_Object_Text
7347 /* basic styles (4 bits allocated use 0->10 now, 5 left) */
7348 #define EVAS_TEXT_STYLE_MASK_BASIC 0xf
7351 * Text style type creation macro. Use style types on the 's'
7352 * arguments, being 'x' your style variable.
7354 #define EVAS_TEXT_STYLE_BASIC_SET(x, s) \
7355 do { x = ((x) & ~EVAS_TEXT_STYLE_MASK_BASIC) | (s); } while (0)
7357 #define EVAS_TEXT_STYLE_MASK_SHADOW_DIRECTION (0x7 << 4)
7360 * Text style type creation macro. This one will impose shadow
7361 * directions on the style type variable -- use the @c
7362 * EVAS_TEXT_STYLE_SHADOW_DIRECTION_* values on 's', incremmentally.
7364 #define EVAS_TEXT_STYLE_SHADOW_DIRECTION_SET(x, s) \
7365 do { x = ((x) & ~EVAS_TEXT_STYLE_MASK_SHADOW_DIRECTION) | (s); } while (0)
7367 typedef enum _Evas_Text_Style_Type
7369 EVAS_TEXT_STYLE_PLAIN, /**< plain, standard text */
7370 EVAS_TEXT_STYLE_SHADOW, /**< text with shadow underneath */
7371 EVAS_TEXT_STYLE_OUTLINE, /**< text with an outline */
7372 EVAS_TEXT_STYLE_SOFT_OUTLINE, /**< text with a soft outline */
7373 EVAS_TEXT_STYLE_GLOW, /**< text with a glow effect */
7374 EVAS_TEXT_STYLE_OUTLINE_SHADOW, /**< text with both outline and shadow effects */
7375 EVAS_TEXT_STYLE_FAR_SHADOW, /**< text with (far) shadow underneath */
7376 EVAS_TEXT_STYLE_OUTLINE_SOFT_SHADOW, /**< text with outline and soft shadow effects combined */
7377 EVAS_TEXT_STYLE_SOFT_SHADOW, /**< text with (soft) shadow underneath */
7378 EVAS_TEXT_STYLE_FAR_SOFT_SHADOW, /**< text with (far soft) shadow underneath */
7380 /* OR these to modify shadow direction (3 bits needed) */
7381 EVAS_TEXT_STYLE_SHADOW_DIRECTION_BOTTOM_RIGHT = (0x0 << 4), /**< shadow growing to bottom right */
7382 EVAS_TEXT_STYLE_SHADOW_DIRECTION_BOTTOM = (0x1 << 4), /**< shadow growing to the bottom */
7383 EVAS_TEXT_STYLE_SHADOW_DIRECTION_BOTTOM_LEFT = (0x2 << 4), /**< shadow growing to bottom left */
7384 EVAS_TEXT_STYLE_SHADOW_DIRECTION_LEFT = (0x3 << 4), /**< shadow growing to the left */
7385 EVAS_TEXT_STYLE_SHADOW_DIRECTION_TOP_LEFT = (0x4 << 4), /**< shadow growing to top left */
7386 EVAS_TEXT_STYLE_SHADOW_DIRECTION_TOP = (0x5 << 4), /**< shadow growing to the top */
7387 EVAS_TEXT_STYLE_SHADOW_DIRECTION_TOP_RIGHT = (0x6 << 4), /**< shadow growing to top right */
7388 EVAS_TEXT_STYLE_SHADOW_DIRECTION_RIGHT = (0x7 << 4) /**< shadow growing to the right */
7389 } 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 */
7392 * Creates a new text object on the provided canvas.
7394 * @param e The canvas to create the text object on.
7395 * @return @c NULL on error, a pointer to a new text object on
7398 * Text objects are for simple, single line text elements. If you want
7399 * more elaborated text blocks, see @ref Evas_Object_Textblock.
7401 * @see evas_object_text_font_source_set()
7402 * @see evas_object_text_font_set()
7403 * @see evas_object_text_text_set()
7405 EAPI Evas_Object *evas_object_text_add (Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
7408 * Set the font (source) file to be used on a given text object.
7410 * @param obj The text object to set font for.
7411 * @param font The font file's path.
7413 * This function allows the font file to be explicitly set for a given
7414 * text object, overriding system lookup, which will first occur in
7415 * the given file's contents.
7417 * @see evas_object_text_font_get()
7419 EAPI void evas_object_text_font_source_set (Evas_Object *obj, const char *font) EINA_ARG_NONNULL(1);
7422 * Get the font file's path which is being used on a given text
7425 * @param obj The text object to set font for.
7426 * @param font The font file's path.
7428 * @see evas_object_text_font_get() for more details
7430 EAPI const char *evas_object_text_font_source_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
7433 * Set the font family and size on a given text object.
7435 * @param obj The text object to set font for.
7436 * @param font The font (family) name.
7437 * @param size The font size, in points.
7439 * This function allows the font name and size of a text object to be
7440 * set. The @p font string has to follow fontconfig's convention on
7441 * naming fonts, as it's the underlying lybrary used to query system
7442 * fonts by Evas (see the @c fc-list command's output, on your system,
7445 * @see evas_object_text_font_get()
7446 * @see evas_object_text_font_source_set()
7448 EAPI void evas_object_text_font_set (Evas_Object *obj, const char *font, Evas_Font_Size size) EINA_ARG_NONNULL(1);
7451 * Retrieve the font family and size in use on a given text object.
7453 * @param obj The evas text object to query for font information.
7454 * @param font A pointer to the location to store the font name in.
7455 * @param size A pointer to the location to store the font size in.
7457 * This function allows the font name and size of a text object to be
7458 * queried. Be aware that the font name string is still owned by Evas
7459 * and should @b not have free() called on it by the caller of the
7462 * @see evas_object_text_font_set()
7464 EAPI void evas_object_text_font_get (const Evas_Object *obj, const char **font, Evas_Font_Size *size) EINA_ARG_NONNULL(1, 2);
7467 * Sets the text string to be displayed by the given text object.
7469 * @param obj The text object to set text string on.
7470 * @param text Text string to display on it.
7472 * @see evas_object_text_text_get()
7474 EAPI void evas_object_text_text_set (Evas_Object *obj, const char *text) EINA_ARG_NONNULL(1);
7477 * Retrieves the text string currently being displayed by the given
7480 * @param obj The given text object.
7481 * @return The text string currently being displayed on it.
7483 * @note Do not free() the return value.
7485 * @see evas_object_text_text_set()
7487 EAPI const char *evas_object_text_text_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
7490 * @brief Sets the BiDi delimiters used in the textblock.
7492 * BiDi delimiters are use for in-paragraph separation of bidi segments. This
7493 * is useful for example in recipients fields of e-mail clients where bidi
7494 * oddities can occur when mixing rtl and ltr.
7496 * @param obj The given text object.
7497 * @param delim A null terminated string of delimiters, e.g ",|".
7500 EAPI void evas_object_text_bidi_delimiters_set(Evas_Object *obj, const char *delim);
7503 * @brief Gets the BiDi delimiters used in the textblock.
7505 * BiDi delimiters are use for in-paragraph separation of bidi segments. This
7506 * is useful for example in recipients fields of e-mail clients where bidi
7507 * oddities can occur when mixing rtl and ltr.
7509 * @param obj The given text object.
7510 * @return A null terminated string of delimiters, e.g ",|". If empty, returns NULL.
7513 EAPI const char *evas_object_text_bidi_delimiters_get(const Evas_Object *obj);
7515 EAPI Evas_Coord evas_object_text_ascent_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
7516 EAPI Evas_Coord evas_object_text_descent_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
7517 EAPI Evas_Coord evas_object_text_max_ascent_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
7518 EAPI Evas_Coord evas_object_text_max_descent_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
7519 EAPI Evas_Coord evas_object_text_horiz_advance_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
7520 EAPI Evas_Coord evas_object_text_vert_advance_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
7521 EAPI Evas_Coord evas_object_text_inset_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
7524 * Retrieve position and dimension information of a character within a text @c Evas_Object.
7526 * This function is used to obtain the X, Y, width and height of a the character
7527 * located at @p pos within the @c Evas_Object @p obj. @p obj must be a text object
7528 * as created with evas_object_text_add(). Any of the @c Evas_Coord parameters (@p cx,
7529 * @p cy, @p cw, @p ch) may be NULL in which case no value will be assigned to that
7532 * @param obj The text object to retrieve position information for.
7533 * @param pos The character position to request co-ordinates for.
7534 * @param cx A pointer to an @c Evas_Coord to store the X value in (can be NULL).
7535 * @param cy A pointer to an @c Evas_Coord to store the Y value in (can be NULL).
7536 * @param cw A pointer to an @c Evas_Coord to store the Width value in (can be NULL).
7537 * @param ch A pointer to an @c Evas_Coord to store the Height value in (can be NULL).
7539 * @returns EINA_FALSE on success, EINA_TRUE on error.
7541 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);
7542 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);
7545 * Returns the logical position of the last char in the text
7546 * up to the pos given. this is NOT the position of the last char
7547 * because of the possibility of RTL in the text.
7549 EAPI int evas_object_text_last_up_to_pos (const Evas_Object *obj, Evas_Coord x, Evas_Coord y) EINA_ARG_NONNULL(1);
7552 * Retrieves the style on use on the given text object.
7554 * @param obj the given text object to set style on.
7555 * @return the style type in use.
7557 * @see evas_object_text_style_set() for more details.
7559 EAPI Evas_Text_Style_Type evas_object_text_style_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
7562 * Sets the style to apply on the given text object.
7564 * @param obj the given text object to set style on.
7565 * @param type a style type.
7567 * Text object styles are one of the values in
7568 * #Evas_Text_Style_Type. Some of those values are combinations of
7569 * more than one style, and some account for the direction of the
7570 * rendering of shadow effects.
7572 * @note One may use the helper macros #EVAS_TEXT_STYLE_BASIC_SET and
7573 * #EVAS_TEXT_STYLE_SHADOW_DIRECTION_SET to assemble a style value.
7575 * The following figure illustrates the text styles:
7577 * @image html text-styles.png
7578 * @image rtf text-styles.png
7579 * @image latex text-styles.eps
7581 * @see evas_object_text_style_get()
7582 * @see evas_object_text_shadow_color_set()
7583 * @see evas_object_text_outline_color_set()
7584 * @see evas_object_text_glow_color_set()
7585 * @see evas_object_text_glow2_color_set()
7587 EAPI void evas_object_text_style_set (Evas_Object *obj, Evas_Text_Style_Type type) EINA_ARG_NONNULL(1);
7590 * Sets the shadow color for the given text object.
7592 * @param obj The given Evas text object.
7593 * @param r The red component of the given color.
7594 * @param g The green component of the given color.
7595 * @param b The blue component of the given color.
7596 * @param a The alpha component of the given color.
7598 * Shadow effects, which are fading colors decorating the text
7599 * underneath it, will just be shown if the object is set to one of
7600 * the following styles:
7602 * - #EVAS_TEXT_STYLE_SHADOW
7603 * - #EVAS_TEXT_STYLE_OUTLINE_SHADOW
7604 * - #EVAS_TEXT_STYLE_FAR_SHADOW
7605 * - #EVAS_TEXT_STYLE_OUTLINE_SOFT_SHADOW
7606 * - #EVAS_TEXT_STYLE_SOFT_SHADOW
7607 * - #EVAS_TEXT_STYLE_FAR_SOFT_SHADOW
7609 * One can also change de direction the shadow grows to, with
7610 * evas_object_text_style_set().
7612 * @see evas_object_text_shadow_color_get()
7614 EAPI void evas_object_text_shadow_color_set (Evas_Object *obj, int r, int g, int b, int a) EINA_ARG_NONNULL(1);
7617 * Retrieves the shadow color for the given text object.
7619 * @param obj The given Evas text object.
7620 * @param r Pointer to variable to hold the red component of the given
7622 * @param g Pointer to variable to hold the green component of the
7624 * @param b Pointer to variable to hold the blue component of the
7626 * @param a Pointer to variable to hold the alpha component of the
7629 * @note Use @c NULL pointers on the color components you're not
7630 * interested in: they'll be ignored by the function.
7632 * @see evas_object_text_shadow_color_set() for more details.
7634 EAPI void evas_object_text_shadow_color_get (const Evas_Object *obj, int *r, int *g, int *b, int *a) EINA_ARG_NONNULL(1);
7637 * Sets the glow color for the given text object.
7639 * @param obj The given Evas text object.
7640 * @param r The red component of the given color.
7641 * @param g The green component of the given color.
7642 * @param b The blue component of the given color.
7643 * @param a The alpha component of the given color.
7645 * Glow effects, which are glowing colors decorating the text's
7646 * surroundings, will just be shown if the object is set to the
7647 * #EVAS_TEXT_STYLE_GLOW style.
7649 * @note Glow effects are placed from a short distance of the text
7650 * itself, but no touching it. For glowing effects right on the
7651 * borders of the glyphs, see 'glow 2' effects
7652 * (evas_object_text_glow2_color_set()).
7654 * @see evas_object_text_glow_color_get()
7656 EAPI void evas_object_text_glow_color_set (Evas_Object *obj, int r, int g, int b, int a) EINA_ARG_NONNULL(1);
7659 * Retrieves the glow color for the given text object.
7661 * @param obj The given Evas text object.
7662 * @param r Pointer to variable to hold the red component of the given
7664 * @param g Pointer to variable to hold the green component of the
7666 * @param b Pointer to variable to hold the blue component of the
7668 * @param a Pointer to variable to hold the alpha component of the
7671 * @note Use @c NULL pointers on the color components you're not
7672 * interested in: they'll be ignored by the function.
7674 * @see evas_object_text_glow_color_set() for more details.
7676 EAPI void evas_object_text_glow_color_get (const Evas_Object *obj, int *r, int *g, int *b, int *a) EINA_ARG_NONNULL(1);
7679 * Sets the 'glow 2' color for the given text object.
7681 * @param obj The given Evas text object.
7682 * @param r The red component of the given color.
7683 * @param g The green component of the given color.
7684 * @param b The blue component of the given color.
7685 * @param a The alpha component of the given color.
7687 * 'Glow 2' effects, which are glowing colors decorating the text's
7688 * (immediate) surroundings, will just be shown if the object is set
7689 * to the #EVAS_TEXT_STYLE_GLOW style. See also
7690 * evas_object_text_glow_color_set().
7692 * @see evas_object_text_glow2_color_get()
7694 EAPI void evas_object_text_glow2_color_set (Evas_Object *obj, int r, int g, int b, int a) EINA_ARG_NONNULL(1);
7697 * Retrieves the 'glow 2' color for the given text object.
7699 * @param obj The given Evas text object.
7700 * @param r Pointer to variable to hold the red component of the given
7702 * @param g Pointer to variable to hold the green component of the
7704 * @param b Pointer to variable to hold the blue component of the
7706 * @param a Pointer to variable to hold the alpha component of the
7709 * @note Use @c NULL pointers on the color components you're not
7710 * interested in: they'll be ignored by the function.
7712 * @see evas_object_text_glow2_color_set() for more details.
7714 EAPI void evas_object_text_glow2_color_get (const Evas_Object *obj, int *r, int *g, int *b, int *a) EINA_ARG_NONNULL(1);
7717 * Sets the outline color for the given text object.
7719 * @param obj The given Evas text object.
7720 * @param r The red component of the given color.
7721 * @param g The green component of the given color.
7722 * @param b The blue component of the given color.
7723 * @param a The alpha component of the given color.
7725 * Outline effects (colored lines around text glyphs) will just be
7726 * shown if the object is set to one of the following styles:
7727 * - #EVAS_TEXT_STYLE_OUTLINE
7728 * - #EVAS_TEXT_STYLE_SOFT_OUTLINE
7729 * - #EVAS_TEXT_STYLE_OUTLINE_SHADOW
7730 * - #EVAS_TEXT_STYLE_OUTLINE_SOFT_SHADOW
7732 * @see evas_object_text_outline_color_get()
7734 EAPI void evas_object_text_outline_color_set(Evas_Object *obj, int r, int g, int b, int a) EINA_ARG_NONNULL(1);
7737 * Retrieves the outline color for the given text object.
7739 * @param obj The given Evas text object.
7740 * @param r Pointer to variable to hold the red component of the given
7742 * @param g Pointer to variable to hold the green component of the
7744 * @param b Pointer to variable to hold the blue component of the
7746 * @param a Pointer to variable to hold the alpha component of the
7749 * @note Use @c NULL pointers on the color components you're not
7750 * interested in: they'll be ignored by the function.
7752 * @see evas_object_text_outline_color_set() for more details.
7754 EAPI void evas_object_text_outline_color_get(const Evas_Object *obj, int *r, int *g, int *b, int *a) EINA_ARG_NONNULL(1);
7757 * Gets the text style pad of a text object.
7759 * @param obj The given text object.
7760 * @param l The left pad (or @c NULL).
7761 * @param r The right pad (or @c NULL).
7762 * @param t The top pad (or @c NULL).
7763 * @param b The bottom pad (or @c NULL).
7766 EAPI void evas_object_text_style_pad_get (const Evas_Object *obj, int *l, int *r, int *t, int *b) EINA_ARG_NONNULL(1);
7769 * Retrieves the direction of the text currently being displayed in the
7771 * @param obj The given evas text object.
7772 * @return the direction of the text
7774 EAPI Evas_BiDi_Direction evas_object_text_direction_get (const Evas_Object *obj) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
7781 * @defgroup Evas_Object_Textblock Textblock Object Functions
7783 * Functions used to create and manipulate textblock objects. Unlike
7784 * @ref Evas_Object_Text, these handle complex text, doing multiple
7785 * styles and multiline text based on HTML-like tags. Of these extra
7786 * features will be heavier on memory and processing cost.
7788 * @section Evas_Object_Textblock_Tutorial Textblock Object Tutorial
7790 * This part explains about the textblock object's API and proper usage.
7791 * If you want to develop textblock, you should also refer to @ref Evas_Object_Textblock_Internal.
7792 * The main user of the textblock object is the edje entry object in Edje, so
7793 * that's a good place to learn from, but I think this document is more than
7794 * enough, if it's not, please contact me and I'll update it.
7796 * @subsection textblock_intro Introduction
7797 * The textblock objects is, as implied, an object that can show big chunks of
7798 * text. Textblock supports many features including: Text formatting, automatic
7799 * and manual text alignment, embedding items (for example icons) and more.
7800 * Textblock has three important parts, the text paragraphs, the format nodes
7803 * You can use markup to format text, for example: "<font_size=50>Big!</font_size>".
7804 * You can also put more than one style directive in one tag:
7805 * "<font_size=50 color=#F00>Big and Red!</font_size>".
7806 * Please notice that we used "</font_size>" although the format also included
7807 * color, this is because the first format determines the matching closing tag's
7808 * name. You can also use anonymous tags, like: "<font_size=30>Big</>" which
7809 * just pop any type of format, but it's advised to use the named alternatives
7812 * @subsection textblock_cursors Textblock Object Cursors
7813 * A textblock Cursor @ref Evas_Textblock_Cursor is data type that represents
7814 * a position in a textblock. Each cursor contains information about the
7815 * paragraph it points to, the position in that paragraph and the object itself.
7816 * Cursors register to textblock objects upon creation, this means that once
7817 * you created a cursor, it belongs to a specific obj and you can't for example
7818 * copy a cursor "into" a cursor of a different object. Registered cursors
7819 * also have the added benefit of updating automatically upon textblock changes,
7820 * this means that if you have a cursor pointing to a specific character, it'll
7821 * still point to it even after you change the whole object completely (as long
7822 * as the char was not deleted), this is not possible without updating, because
7823 * as mentioned, each cursor holds a character position. There are many
7824 * functions that handle cursors, just check out the evas_textblock_cursor*
7825 * functions. For creation and deletion of cursors check out:
7826 * @see evas_object_textblock_cursor_new()
7827 * @see evas_textblock_cursor_free()
7828 * @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).
7830 * @subsection textblock_paragraphs Textblock Object Paragraphs
7831 * The textblock object is made out of text splitted to paragraphs (delimited
7832 * by the paragraph separation character). Each paragraph has many (or none)
7833 * format nodes associated with it which are responsible for the formatting
7834 * of that paragraph.
7836 * @subsection textblock_format_nodes Textblock Object Format Nodes
7837 * As explained in @ref textblock_paragraphs each one of the format nodes
7838 * is associated with a paragraph.
7839 * There are two types of format nodes, visible and invisible:
7840 * Visible: formats that a cursor can point to, i.e formats that
7841 * occupy space, for example: newlines, tabs, items and etc. Some visible items
7842 * are made of two parts, in this case, only the opening tag is visible.
7843 * A closing tag (i.e a </tag> tag) should NEVER be visible.
7844 * Invisible: formats that don't occupy space, for example: bold and underline.
7845 * Being able to access format nodes is very important for some uses. For
7846 * example, edje uses the "<a>" format to create links in the text (and pop
7847 * popups above them when clicked). For the textblock object a is just a
7848 * formatting instruction (how to color the text), but edje utilizes the access
7849 * to the format nodes to make it do more.
7850 * For more information, take a look at all the evas_textblock_node_format_*
7852 * The translation of "<tag>" tags to actual format is done according to the
7853 * tags defined in the style, see @ref evas_textblock_style_set
7855 * @subsection textblock_special_formats Special Formats
7856 * Textblock supports various format directives that can be used either in
7857 * markup, or by calling @ref evas_object_textblock_format_append or
7858 * @ref evas_object_textblock_format_prepend. In addition to the mentioned
7859 * format directives, textblock allows creating additional format directives
7860 * using "tags" that can be set in the style see @ref evas_textblock_style_set .
7862 * Textblock supports the following formats:
7863 * @li font - Font description in fontconfig like format, e.g: "Sans:style=Italic:lang=hi". or "Serif:style=Bold".
7864 * @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".
7865 * @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".
7866 * @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".
7867 * @li lang - Overrides the language defined in "font". E.g: "lang=he" is the same as "font=:lang=he".
7868 * @li font_fallbacks - A comma delimited list of fonts to try if finding the main font fails.
7869 * @li font_size - The font size in points.
7870 * @li font_source - The source of the font, e.g an eet file.
7871 * @li color - Text color in one of the following formats: "#RRGGBB", "#RRGGBBAA", "#RGB", and "#RGBA".
7872 * @li underline_color - color in one of the following formats: "#RRGGBB", "#RRGGBBAA", "#RGB", and "#RGBA".
7873 * @li underline2_color - color in one of the following formats: "#RRGGBB", "#RRGGBBAA", "#RGB", and "#RGBA".
7874 * @li outline_color - color in one of the following formats: "#RRGGBB", "#RRGGBBAA", "#RGB", and "#RGBA".
7875 * @li shadow_color - color in one of the following formats: "#RRGGBB", "#RRGGBBAA", "#RGB", and "#RGBA".
7876 * @li glow_color - color in one of the following formats: "#RRGGBB", "#RRGGBBAA", "#RGB", and "#RGBA".
7877 * @li glow2_color - color in one of the following formats: "#RRGGBB", "#RRGGBBAA", "#RGB", and "#RGBA".
7878 * @li backing_color - color in one of the following formats: "#RRGGBB", "#RRGGBBAA", "#RGB", and "#RGBA".
7879 * @li strikethrough_color - color in one of the following formats: "#RRGGBB", "#RRGGBBAA", "#RGB", and "#RGBA".
7880 * @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%.
7881 * @li valign - Either "top", "bottom", "middle", "center", "baseline", "base", a value between 0.0 and 1.0, or a value between 0% to 100%.
7882 * @li wrap - "word", "char", "mixed", or "none".
7883 * @li left_margin - Either "reset", or a pixel value indicating the margin.
7884 * @li right_margin - Either "reset", or a pixel value indicating the margin.
7885 * @li underline - "on", "off", "single", or "double".
7886 * @li strikethrough - "on" or "off"
7887 * @li backing - "on" or "off"
7888 * @li style - Either "off", "none", "plain", "shadow", "outline", "soft_outline", "outline_shadow", "outline_soft_shadow", "glow", "far_shadow", "soft_shadow", or "far_soft_shadow".
7889 * @li tabstops - Pixel value for tab width.
7890 * @li linesize - Force a line size in pixels.
7891 * @li linerelsize - Either a floating point value or a percentage indicating the wanted size of the line relative to the calculated size.
7892 * @li linegap - Force a line gap in pixels.
7893 * @li linerelgap - Either a floating point value or a percentage indicating the wanted size of the line relative to the calculated size.
7894 * @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.
7895 * @li linefill - Either a float value or percentage indicating how much to fill the line.
7896 * @li ellipsis - Value between 0.0-1.0 to indicate the type of ellipsis, or -1.0 to indicate ellipsis isn't wanted.
7897 * @li password - "on" or "off". This is used to specifically turn replacing chars with the replacement char (i.e password mode) on and off.
7900 * @todo put here some usage examples
7902 * @ingroup Evas_Object_Specific
7907 typedef struct _Evas_Textblock_Style Evas_Textblock_Style;
7908 typedef struct _Evas_Textblock_Cursor Evas_Textblock_Cursor;
7910 * @typedef Evas_Object_Textblock_Node_Format
7913 typedef struct _Evas_Object_Textblock_Node_Format Evas_Object_Textblock_Node_Format;
7914 typedef struct _Evas_Textblock_Rectangle Evas_Textblock_Rectangle;
7916 struct _Evas_Textblock_Rectangle
7918 Evas_Coord x, y, w, h;
7921 typedef enum _Evas_Textblock_Text_Type
7923 EVAS_TEXTBLOCK_TEXT_RAW,
7924 EVAS_TEXTBLOCK_TEXT_PLAIN,
7925 EVAS_TEXTBLOCK_TEXT_MARKUP
7926 } Evas_Textblock_Text_Type;
7928 typedef enum _Evas_Textblock_Cursor_Type
7930 EVAS_TEXTBLOCK_CURSOR_UNDER,
7931 EVAS_TEXTBLOCK_CURSOR_BEFORE
7932 } Evas_Textblock_Cursor_Type;
7936 * Adds a textblock to the given evas.
7937 * @param e The given evas.
7938 * @return The new textblock object.
7940 EAPI Evas_Object *evas_object_textblock_add(Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
7944 * Returns the unescaped version of escape.
7945 * @param escape the string to be escaped
7946 * @return the unescaped version of escape
7948 EAPI const char *evas_textblock_escape_string_get(const char *escape) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
7951 * Returns the escaped version of the string.
7952 * @param string to escape
7953 * @param len_ret the len of the part of the string that was used.
7954 * @return the escaped string.
7956 EAPI const char *evas_textblock_string_escape_get(const char *string, int *len_ret) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
7959 * Return the unescaped version of the string between start and end.
7961 * @param escape_start the start of the string.
7962 * @param escape_end the end of the string.
7963 * @return the unescaped version of the range
7965 EAPI const char *evas_textblock_escape_string_range_get(const char *escape_start, const char *escape_end) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2) EINA_PURE;
7969 * Creates a new textblock style.
7970 * @return The new textblock style.
7972 EAPI Evas_Textblock_Style *evas_textblock_style_new(void) EINA_WARN_UNUSED_RESULT EINA_MALLOC;
7975 * Destroys a textblock style.
7976 * @param ts The textblock style to free.
7978 EAPI void evas_textblock_style_free(Evas_Textblock_Style *ts) EINA_ARG_NONNULL(1);
7981 * Sets the style ts to the style passed as text by text.
7982 * Expected a string consisting of many (or none) tag='format' pairs.
7984 * @param ts the style to set.
7985 * @param text the text to parse - NOT NULL.
7986 * @return Returns no value.
7988 EAPI void evas_textblock_style_set(Evas_Textblock_Style *ts, const char *text) EINA_ARG_NONNULL(1);
7991 * Return the text of the style ts.
7992 * @param ts the style to get it's text.
7993 * @return the text of the style or null on error.
7995 EAPI const char *evas_textblock_style_get(const Evas_Textblock_Style *ts) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
7999 * Set the objects style to ts.
8000 * @param obj the Evas object to set the style to.
8001 * @param ts the style to set.
8002 * @return Returns no value.
8004 EAPI void evas_object_textblock_style_set(Evas_Object *obj, Evas_Textblock_Style *ts) EINA_ARG_NONNULL(1);
8007 * Return the style of an object.
8008 * @param obj the object to get the style from.
8009 * @return the style of the object.
8011 EAPI const Evas_Textblock_Style *evas_object_textblock_style_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
8014 * @brief Set the "replacement character" to use for the given textblock object.
8016 * @param obj The given textblock object.
8017 * @param ch The charset name.
8019 EAPI void evas_object_textblock_replace_char_set(Evas_Object *obj, const char *ch) EINA_ARG_NONNULL(1);
8022 * @brief Get the "replacement character" for given textblock object. Returns
8023 * NULL if no replacement character is in use.
8025 * @param obj The given textblock object
8026 * @return replacement character or @c NULL
8028 EAPI const char *evas_object_textblock_replace_char_get(Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
8031 * @brief Sets the vertical alignment of text within the textblock object
8034 * Normally alignment is 0.0 (top of object). Values given should be
8035 * between 0.0 and 1.0 (1.0 bottom of object, 0.5 being vertically centered
8038 * @param obj The given textblock object.
8039 * @param align A value between 0.0 and 1.0
8042 EAPI void evas_object_textblock_valign_set(Evas_Object *obj, double align);
8045 * @brief Gets the vertical alignment of a textblock
8047 * @param obj The given textblock object.
8048 * @return The elignment set for the object
8051 EAPI double evas_object_textblock_valign_get(const Evas_Object *obj);
8054 * @brief Sets the BiDi delimiters used in the textblock.
8056 * BiDi delimiters are use for in-paragraph separation of bidi segments. This
8057 * is useful for example in recipients fields of e-mail clients where bidi
8058 * oddities can occur when mixing rtl and ltr.
8060 * @param obj The given textblock object.
8061 * @param delim A null terminated string of delimiters, e.g ",|".
8064 EAPI void evas_object_textblock_bidi_delimiters_set(Evas_Object *obj, const char *delim);
8067 * @brief Gets the BiDi delimiters used in the textblock.
8069 * BiDi delimiters are use for in-paragraph separation of bidi segments. This
8070 * is useful for example in recipients fields of e-mail clients where bidi
8071 * oddities can occur when mixing rtl and ltr.
8073 * @param obj The given textblock object.
8074 * @return A null terminated string of delimiters, e.g ",|". If empty, returns NULL.
8077 EAPI const char *evas_object_textblock_bidi_delimiters_get(const Evas_Object *obj);
8080 * @brief Sets newline mode. When true, newline character will behave
8081 * as a paragraph separator.
8083 * @param obj The given textblock object.
8084 * @param mode EINA_TRUE for legacy mode, EINA_FALSE otherwise.
8087 EAPI void evas_object_textblock_legacy_newline_set(Evas_Object *obj, Eina_Bool mode) EINA_ARG_NONNULL(1);
8090 * @brief Gets newline mode. When true, newline character behaves
8091 * as a paragraph separator.
8093 * @param obj The given textblock object.
8094 * @return EINA_TRUE if in legacy mode, EINA_FALSE otherwise.
8097 EAPI Eina_Bool evas_object_textblock_legacy_newline_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
8101 * Sets the tetxblock's text to the markup text.
8103 * @note assumes text does not include the unicode object replacement char (0xFFFC)
8105 * @param obj the textblock object.
8106 * @param text the markup text to use.
8107 * @return Return no value.
8109 EAPI void evas_object_textblock_text_markup_set(Evas_Object *obj, const char *text) EINA_ARG_NONNULL(1);
8112 * Prepends markup to the cursor cur.
8114 * @note assumes text does not include the unicode object replacement char (0xFFFC)
8116 * @param cur the cursor to prepend to.
8117 * @param text the markup text to prepend.
8118 * @return Return no value.
8120 EAPI void evas_object_textblock_text_markup_prepend(Evas_Textblock_Cursor *cur, const char *text) EINA_ARG_NONNULL(1, 2);
8123 * Return the markup of the object.
8125 * @param obj the Evas object.
8126 * @return the markup text of the object.
8128 EAPI const char *evas_object_textblock_text_markup_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
8132 * Return the object's main cursor.
8134 * @param obj the object.
8135 * @return the obj's main cursor.
8137 EAPI Evas_Textblock_Cursor *evas_object_textblock_cursor_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
8140 * Create a new cursor, associate it to the obj and init it to point
8141 * to the start of the textblock. Association to the object means the cursor
8142 * will be updated when the object will change.
8144 * @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).
8146 * @param obj the object to associate to.
8147 * @return the new cursor.
8149 EAPI Evas_Textblock_Cursor *evas_object_textblock_cursor_new(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
8153 * Free the cursor and unassociate it from the object.
8154 * @note do not use it to free unassociated cursors.
8156 * @param cur the cursor to free.
8157 * @return Returns no value.
8159 EAPI void evas_textblock_cursor_free(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8163 * Sets the cursor to the start of the first text node.
8165 * @param cur the cursor to update.
8166 * @return Returns no value.
8168 EAPI void evas_textblock_cursor_paragraph_first(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8171 * sets the cursor to the end of the last text node.
8173 * @param cur the cursor to set.
8174 * @return Returns no value.
8176 EAPI void evas_textblock_cursor_paragraph_last(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8179 * Advances to the start of the next text node
8181 * @param cur the cursor to update
8182 * @return #EINA_TRUE if it managed to advance a paragraph, #EINA_FALSE otherwise.
8184 EAPI Eina_Bool evas_textblock_cursor_paragraph_next(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8187 * Advances to the end of the previous text node
8189 * @param cur the cursor to update
8190 * @return #EINA_TRUE if it managed to advance a paragraph, #EINA_FALSE otherwise.
8192 EAPI Eina_Bool evas_textblock_cursor_paragraph_prev(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8197 * @param obj The evas, must not be NULL.
8198 * @param anchor the anchor name to get
8199 * @return Returns the list format node corresponding to the anchor, may be null if there are none.
8201 EAPI const Eina_List *evas_textblock_node_format_list_get(const Evas_Object *obj, const char *anchor) EINA_ARG_NONNULL(1, 2);
8204 * Returns the first format node.
8206 * @param obj The evas, must not be NULL.
8207 * @return Returns the first format node, may be null if there are none.
8209 EAPI const Evas_Object_Textblock_Node_Format *evas_textblock_node_format_first_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
8212 * Returns the last format node.
8214 * @param obj The evas textblock, must not be NULL.
8215 * @return Returns the first format node, may be null if there are none.
8217 EAPI const Evas_Object_Textblock_Node_Format *evas_textblock_node_format_last_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
8220 * Returns the next format node (after n)
8222 * @param n the current format node - not null.
8223 * @return Returns the next format node, may be null.
8225 EAPI const Evas_Object_Textblock_Node_Format *evas_textblock_node_format_next_get(const Evas_Object_Textblock_Node_Format *n) EINA_ARG_NONNULL(1);
8228 * Returns the prev format node (after n)
8230 * @param n the current format node - not null.
8231 * @return Returns the prev format node, may be null.
8233 EAPI const Evas_Object_Textblock_Node_Format *evas_textblock_node_format_prev_get(const Evas_Object_Textblock_Node_Format *n) EINA_ARG_NONNULL(1);
8236 * Remove a format node and it's match. i.e, removes a <tag> </tag> pair.
8237 * Assumes the node is the first part of <tag> i.e, this won't work if
8238 * n is a closing tag.
8240 * @param obj the Evas object of the textblock - not null.
8241 * @param n the current format node - not null.
8243 EAPI void evas_textblock_node_format_remove_pair(Evas_Object *obj, Evas_Object_Textblock_Node_Format *n) EINA_ARG_NONNULL(1, 2);
8246 * Sets the cursor to point to the place where format points to.
8248 * @param cur the cursor to update.
8249 * @param n the format node to update according.
8250 * @deprecated duplicate of evas_textblock_cursor_at_format_set
8252 EINA_DEPRECATED EAPI void evas_textblock_cursor_set_at_format(Evas_Textblock_Cursor *cur, const Evas_Object_Textblock_Node_Format *n) EINA_ARG_NONNULL(1, 2);
8255 * Return the format node at the position pointed by cur.
8257 * @param cur the position to look at.
8258 * @return the format node if found, NULL otherwise.
8259 * @see evas_textblock_cursor_format_is_visible_get()
8261 EAPI const Evas_Object_Textblock_Node_Format *evas_textblock_cursor_format_get(const Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8264 * Get the text format representation of the format node.
8266 * @param fmt the format node.
8267 * @return the textual format of the format node.
8269 EAPI const char *evas_textblock_node_format_text_get(const Evas_Object_Textblock_Node_Format *fnode) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
8272 * Set the cursor to point to the position of fmt.
8274 * @param cur the cursor to update
8275 * @param fmt the format to update according to.
8277 EAPI void evas_textblock_cursor_at_format_set(Evas_Textblock_Cursor *cur, const Evas_Object_Textblock_Node_Format *fmt) EINA_ARG_NONNULL(1, 2);
8280 * Check if the current cursor position is a visible format. This way is more
8281 * efficient than evas_textblock_cursor_format_get() to check for the existence
8282 * of a visible format.
8284 * @param cur the cursor to look at.
8285 * @return #EINA_TRUE if the cursor points to a visible format, #EINA_FALSE otherwise.
8286 * @see evas_textblock_cursor_format_get()
8288 EAPI Eina_Bool evas_textblock_cursor_format_is_visible_get(const Evas_Textblock_Cursor *cur) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
8291 * Advances to the next format node
8293 * @param cur the cursor to be updated.
8294 * @return #EINA_TRUE on success #EINA_FALSE otherwise.
8296 EAPI Eina_Bool evas_textblock_cursor_format_next(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8299 * Advances to the previous format node.
8301 * @param cur the cursor to update.
8302 * @return #EINA_TRUE on success #EINA_FALSE otherwise.
8304 EAPI Eina_Bool evas_textblock_cursor_format_prev(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8307 * Returns true if the cursor points to a format.
8309 * @param cur the cursor to check.
8310 * @return Returns #EINA_TRUE if a cursor points to a format #EINA_FALSE otherwise.
8312 EAPI Eina_Bool evas_textblock_cursor_is_format(const Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8315 * Advances 1 char forward.
8317 * @param cur the cursor to advance.
8318 * @return #EINA_TRUE on success #EINA_FALSE otherwise.
8320 EAPI Eina_Bool evas_textblock_cursor_char_next(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8323 * Advances 1 char backward.
8325 * @param cur the cursor to advance.
8326 * @return #EINA_TRUE on success #EINA_FALSE otherwise.
8328 EAPI Eina_Bool evas_textblock_cursor_char_prev(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8331 * Go to the first char in the node the cursor is pointing on.
8333 * @param cur the cursor to update.
8334 * @return Returns no value.
8336 EAPI void evas_textblock_cursor_paragraph_char_first(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8339 * Go to the last char in a text node.
8341 * @param cur the cursor to update.
8342 * @return Returns no value.
8344 EAPI void evas_textblock_cursor_paragraph_char_last(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8347 * Go to the start of the current line
8349 * @param cur the cursor to update.
8350 * @return Returns no value.
8352 EAPI void evas_textblock_cursor_line_char_first(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8355 * Go to the end of the current line.
8357 * @param cur the cursor to update.
8358 * @return Returns no value.
8360 EAPI void evas_textblock_cursor_line_char_last(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8363 * Return the current cursor pos.
8365 * @param cur the cursor to take the position from.
8366 * @return the position or -1 on error
8368 EAPI int evas_textblock_cursor_pos_get(const Evas_Textblock_Cursor *cur) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
8371 * Set the cursor pos.
8373 * @param cur the cursor to be set.
8374 * @param pos the pos to set.
8376 EAPI void evas_textblock_cursor_pos_set(Evas_Textblock_Cursor *cur, int pos) EINA_ARG_NONNULL(1);
8379 * Go to the start of the line passed
8381 * @param cur cursor to update.
8382 * @param line numer to set.
8383 * @return #EINA_TRUE on success, #EINA_FALSE on error.
8385 EAPI Eina_Bool evas_textblock_cursor_line_set(Evas_Textblock_Cursor *cur, int line) EINA_ARG_NONNULL(1);
8388 * Compare two cursors.
8390 * @param cur1 the first cursor.
8391 * @param cur2 the second cursor.
8392 * @return -1 if cur1 < cur2, 0 if cur1 == cur2 and 1 otherwise.
8394 EAPI int evas_textblock_cursor_compare(const Evas_Textblock_Cursor *cur1, const Evas_Textblock_Cursor *cur2) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2) EINA_PURE;
8397 * Make cur_dest point to the same place as cur. Does not work if they don't
8398 * point to the same object.
8400 * @param cur the source cursor.
8401 * @param cur_dest destination cursor.
8402 * @return Returns no value.
8404 EAPI void evas_textblock_cursor_copy(const Evas_Textblock_Cursor *cur, Evas_Textblock_Cursor *cur_dest) EINA_ARG_NONNULL(1, 2);
8408 * Adds text to the current cursor position and set the cursor to *before*
8409 * the start of the text just added.
8411 * @param cur the cursor to where to add text at.
8412 * @param _text the text to add.
8413 * @return Returns the len of the text added.
8414 * @see evas_textblock_cursor_text_prepend()
8416 EAPI int evas_textblock_cursor_text_append(Evas_Textblock_Cursor *cur, const char *text) EINA_ARG_NONNULL(1, 2);
8419 * Adds text to the current cursor position and set the cursor to *after*
8420 * the start of the text just added.
8422 * @param cur the cursor to where to add text at.
8423 * @param _text the text to add.
8424 * @return Returns the len of the text added.
8425 * @see evas_textblock_cursor_text_append()
8427 EAPI int evas_textblock_cursor_text_prepend(Evas_Textblock_Cursor *cur, const char *text) EINA_ARG_NONNULL(1, 2);
8431 * Adds format to the current cursor position. If the format being added is a
8432 * visible format, add it *before* the cursor position, otherwise, add it after.
8433 * This behavior is because visible formats are like characters and invisible
8434 * should be stacked in a way that the last one is added last.
8436 * This function works with native formats, that means that style defined
8437 * tags like <br> won't work here. For those kind of things use markup prepend.
8439 * @param cur the cursor to where to add format at.
8440 * @param format the format to add.
8441 * @return Returns true if a visible format was added, false otherwise.
8442 * @see evas_textblock_cursor_format_prepend()
8446 * Check if the current cursor position points to the terminating null of the
8447 * last paragraph. (shouldn't be allowed to point to the terminating null of
8448 * any previous paragraph anyway.
8450 * @param cur the cursor to look at.
8451 * @return #EINA_TRUE if the cursor points to the terminating null, #EINA_FALSE otherwise.
8453 EAPI Eina_Bool evas_textblock_cursor_format_append(Evas_Textblock_Cursor *cur, const char *format) EINA_ARG_NONNULL(1, 2);
8456 * Adds format to the current cursor position. If the format being added is a
8457 * visible format, add it *before* the cursor position, otherwise, add it after.
8458 * This behavior is because visible formats are like characters and invisible
8459 * should be stacked in a way that the last one is added last.
8460 * If the format is visible the cursor is advanced after it.
8462 * This function works with native formats, that means that style defined
8463 * tags like <br> won't work here. For those kind of things use markup prepend.
8465 * @param cur the cursor to where to add format at.
8466 * @param format the format to add.
8467 * @return Returns true if a visible format was added, false otherwise.
8468 * @see evas_textblock_cursor_format_prepend()
8470 EAPI Eina_Bool evas_textblock_cursor_format_prepend(Evas_Textblock_Cursor *cur, const char *format) EINA_ARG_NONNULL(1, 2);
8473 * Delete the character at the location of the cursor. If there's a format
8474 * pointing to this position, delete it as well.
8476 * @param cur the cursor pointing to the current location.
8477 * @return Returns no value.
8479 EAPI void evas_textblock_cursor_char_delete(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8482 * Delete the range between cur1 and cur2.
8484 * @param cur1 one side of the range.
8485 * @param cur2 the second side of the range
8486 * @return Returns no value.
8488 EAPI void evas_textblock_cursor_range_delete(Evas_Textblock_Cursor *cur1, Evas_Textblock_Cursor *cur2) EINA_ARG_NONNULL(1, 2);
8492 * Return the text of the paragraph cur points to - returns the text in markup..
8494 * @param cur the cursor pointing to the paragraph.
8495 * @return the text on success, NULL otherwise.
8497 EAPI const char *evas_textblock_cursor_paragraph_text_get(const Evas_Textblock_Cursor *cur) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
8500 * Return the length of the paragraph, cheaper the eina_unicode_strlen()
8502 * @param cur the position of the paragraph.
8503 * @return the length of the paragraph on success, -1 otehrwise.
8505 EAPI int evas_textblock_cursor_paragraph_text_length_get(const Evas_Textblock_Cursor *cur) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
8508 * Return the currently visible range.
8510 * @param start the start of the range.
8511 * @param end the end of the range.
8512 * @return EINA_TRUE on success. EINA_FALSE otherwise.
8515 Eina_Bool evas_textblock_cursor_visible_range_get(Evas_Textblock_Cursor *start, Evas_Textblock_Cursor *end) EINA_ARG_NONNULL(1, 2);
8518 * Return the format nodes in the range between cur1 and cur2.
8520 * @param cur1 one side of the range.
8521 * @param cur2 the other side of the range
8522 * @return the foramt nodes in the range. You have to free it.
8525 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) EINA_PURE;
8528 * Return the text in the range between cur1 and cur2
8530 * @param cur1 one side of the range.
8531 * @param cur2 the other side of the range
8532 * @param format The form on which to return the text. Markup - in textblock markup. Plain - UTF8.
8533 * @return the text in the range
8534 * @see elm_entry_markup_to_utf8()
8536 EAPI char *evas_textblock_cursor_range_text_get(const Evas_Textblock_Cursor *cur1, const Evas_Textblock_Cursor *cur2, Evas_Textblock_Text_Type format) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2) EINA_PURE;
8539 * Return the content of the cursor.
8541 * @param cur the cursor
8542 * @return the text in the range
8544 EAPI char *evas_textblock_cursor_content_get(const Evas_Textblock_Cursor *cur) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
8548 * Returns the geometry of the cursor. Depends on the type of cursor requested.
8549 * This should be used instead of char_geometry_get because there are weird
8550 * special cases with BiDi text.
8551 * in '_' cursor mode (i.e a line below the char) it's the same as char_geometry
8552 * get, except for the case of the last char of a line which depends on the
8553 * paragraph direction.
8555 * in '|' cursor mode (i.e a line between two chars) it is very varyable.
8556 * For example consider the following visual string:
8557 * "abcCBA" (ABC are rtl chars), a cursor pointing on A should actually draw
8558 * a '|' between the c and the C.
8560 * @param cur the cursor.
8561 * @param cx the x of the cursor
8562 * @param cy the y of the cursor
8563 * @param cw the width of the cursor
8564 * @param ch the height of the cursor
8565 * @param dir the direction of the cursor, can be NULL.
8566 * @param ctype the type of the cursor.
8567 * @return line number of the char on success, -1 on error.
8569 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);
8572 * Returns the geometry of the char at cur.
8574 * @param cur the position of the char.
8575 * @param cx the x of the char.
8576 * @param cy the y of the char.
8577 * @param cw the w of the char.
8578 * @param ch the h of the char.
8579 * @return line number of the char on success, -1 on error.
8581 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);
8584 * Returns the geometry of the pen at cur.
8586 * @param cur the position of the char.
8587 * @param cpen_x the pen_x of the char.
8588 * @param cy the y of the char.
8589 * @param cadv the adv of the char.
8590 * @param ch the h of the char.
8591 * @return line number of the char on success, -1 on error.
8593 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);
8596 * Returns the geometry of the line at cur.
8598 * @param cur the position of the line.
8599 * @param cx the x of the line.
8600 * @param cy the y of the line.
8601 * @param cw the width of the line.
8602 * @param ch the height of the line.
8603 * @return line number of the line on success, -1 on error.
8605 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);
8608 * Set the position of the cursor according to the X and Y coordinates.
8610 * @param cur the cursor to set.
8611 * @param x coord to set by.
8612 * @param y coord to set by.
8613 * @return #EINA_TRUE on success, #EINA_FALSE otherwise.
8615 EAPI Eina_Bool evas_textblock_cursor_char_coord_set(Evas_Textblock_Cursor *cur, Evas_Coord x, Evas_Coord y) EINA_ARG_NONNULL(1);
8618 * Set the cursor position according to the y coord.
8620 * @param cur the cur to be set.
8621 * @param y the coord to set by.
8622 * @return the line number found, -1 on error.
8624 EAPI int evas_textblock_cursor_line_coord_set(Evas_Textblock_Cursor *cur, Evas_Coord y) EINA_ARG_NONNULL(1);
8627 * Get the geometry of a range.
8629 * @param cur1 one side of the range.
8630 * @param cur2 other side of the range.
8631 * @return a list of Rectangles representing the geometry of the range.
8633 EAPI Eina_List *evas_textblock_cursor_range_geometry_get(const Evas_Textblock_Cursor *cur1, const Evas_Textblock_Cursor *cur2) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2) EINA_PURE;
8634 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);
8638 * Checks if the cursor points to the end of the line.
8640 * @param cur the cursor to check.
8641 * @return #EINA_TRUE if true, #EINA_FALSE otherwise.
8643 EAPI Eina_Bool evas_textblock_cursor_eol_get(const Evas_Textblock_Cursor *cur) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
8647 * Get the geometry of a line number.
8649 * @param obj the object.
8650 * @param line the line number.
8651 * @param cx x coord of the line.
8652 * @param cy y coord of the line.
8653 * @param cw w coord of the line.
8654 * @param ch h coord of the line.
8655 * @return #EINA_TRUE on success, #EINA_FALSE otherwise.
8657 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);
8660 * Clear the textblock object.
8661 * @note Does *NOT* free the Evas object itself.
8663 * @param obj the object to clear.
8666 EAPI void evas_object_textblock_clear(Evas_Object *obj) EINA_ARG_NONNULL(1);
8669 * Get the formatted width and height. This calculates the actual size after restricting
8670 * the textblock to the current size of the object.
8671 * The main difference between this and @ref evas_object_textblock_size_native_get
8672 * is that the "native" function does not wrapping into account
8673 * it just calculates the real width of the object if it was placed on an
8674 * infinite canvas, while this function gives the size after wrapping
8675 * according to the size restrictions of the object.
8677 * For example for a textblock containing the text: "You shall not pass!"
8678 * with no margins or padding and assuming a monospace font and a size of
8679 * 7x10 char widths (for simplicity) has a native size of 19x1
8680 * and a formatted size of 5x4.
8683 * @param obj the Evas object.
8684 * @param w[out] the width of the object.
8685 * @param h[out] the height of the object
8686 * @return Returns no value.
8687 * @see evas_object_textblock_size_native_get
8689 EAPI void evas_object_textblock_size_formatted_get(const Evas_Object *obj, Evas_Coord *w, Evas_Coord *h) EINA_ARG_NONNULL(1);
8692 * Get the native width and height. This calculates the actual size without taking account
8693 * the current size of the object.
8694 * The main difference between this and @ref evas_object_textblock_size_formatted_get
8695 * is that the "native" function does not take wrapping into account
8696 * it just calculates the real width of the object if it was placed on an
8697 * infinite canvas, while the "formatted" function gives the size after
8698 * wrapping text according to the size restrictions of the object.
8700 * For example for a textblock containing the text: "You shall not pass!"
8701 * with no margins or padding and assuming a monospace font and a size of
8702 * 7x10 char widths (for simplicity) has a native size of 19x1
8703 * and a formatted size of 5x4.
8705 * @param obj the Evas object of the textblock
8706 * @param w[out] the width returned
8707 * @param h[out] the height returned
8708 * @return Returns no value.
8710 EAPI void evas_object_textblock_size_native_get(const Evas_Object *obj, Evas_Coord *w, Evas_Coord *h) EINA_ARG_NONNULL(1);
8711 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);
8717 * @defgroup Evas_Line_Group Line Object Functions
8719 * Functions used to deal with evas line objects.
8721 * @ingroup Evas_Object_Specific
8727 * Adds a new evas line object to the given evas.
8728 * @param e The given evas.
8729 * @return The new evas line object.
8731 EAPI Evas_Object *evas_object_line_add (Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
8734 * Sets the coordinates of the end points of the given evas line object.
8735 * @param obj The given evas line object.
8736 * @param x1 The X coordinate of the first point.
8737 * @param y1 The Y coordinate of the first point.
8738 * @param x2 The X coordinate of the second point.
8739 * @param y2 The Y coordinate of the second point.
8741 EAPI void evas_object_line_xy_set (Evas_Object *obj, Evas_Coord x1, Evas_Coord y1, Evas_Coord x2, Evas_Coord y2);
8744 * Retrieves the coordinates of the end points of the given evas line object.
8745 * @param obj The given line object.
8746 * @param x1 Pointer to an integer in which to store the X coordinate of the
8748 * @param y1 Pointer to an integer in which to store the Y coordinate of the
8750 * @param x2 Pointer to an integer in which to store the X coordinate of the
8752 * @param y2 Pointer to an integer in which to store the Y coordinate of the
8755 EAPI void evas_object_line_xy_get (const Evas_Object *obj, Evas_Coord *x1, Evas_Coord *y1, Evas_Coord *x2, Evas_Coord *y2);
8761 * @defgroup Evas_Object_Polygon Polygon Object Functions
8763 * Functions that operate on evas polygon objects.
8765 * Hint: as evas does not provide ellipse, smooth paths or circle, one
8766 * can calculate points and convert these to a polygon.
8768 * @ingroup Evas_Object_Specific
8774 * Adds a new evas polygon object to the given evas.
8775 * @param e The given evas.
8776 * @return A new evas polygon object.
8778 EAPI Evas_Object *evas_object_polygon_add (Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
8781 * Adds the given point to the given evas polygon object.
8782 * @param obj The given evas polygon object.
8783 * @param x The X coordinate of the given point.
8784 * @param y The Y coordinate of the given point.
8785 * @ingroup Evas_Polygon_Group
8787 EAPI void evas_object_polygon_point_add (Evas_Object *obj, Evas_Coord x, Evas_Coord y) EINA_ARG_NONNULL(1);
8790 * Removes all of the points from the given evas polygon object.
8791 * @param obj The given polygon object.
8793 EAPI void evas_object_polygon_points_clear (Evas_Object *obj) EINA_ARG_NONNULL(1);
8799 * @defgroup Evas_Smart_Group Smart Functions
8801 * Functions that deal with #Evas_Smart structs, creating definition
8802 * (classes) of objects that will have customized behavior for methods
8803 * like evas_object_move(), evas_object_resize(),
8804 * evas_object_clip_set() and others.
8806 * These objects will accept the generic methods defined in @ref
8807 * Evas_Object_Group and the extensions defined in @ref
8808 * Evas_Smart_Object_Group. There are a couple of existent smart
8809 * objects in Evas itself (see @ref Evas_Object_Box, @ref
8810 * Evas_Object_Table and @ref Evas_Smart_Object_Clipped).
8812 * See also some @ref Example_Evas_Smart_Objects "examples" of this
8813 * group of functions.
8817 * @addtogroup Evas_Smart_Group
8822 * @def EVAS_SMART_CLASS_VERSION
8824 * The version you have to put into the version field in the
8825 * #Evas_Smart_Class struct. Used to safeguard from binaries with old
8826 * smart object intefaces running with newer ones.
8828 * @ingroup Evas_Smart_Group
8830 #define EVAS_SMART_CLASS_VERSION 4
8832 * @struct _Evas_Smart_Class
8834 * A smart object's @b base class definition
8836 * @ingroup Evas_Smart_Group
8838 struct _Evas_Smart_Class
8840 const char *name; /**< the name string of the class */
8842 void (*add) (Evas_Object *o); /**< code to be run when adding object to a canvas */
8843 void (*del) (Evas_Object *o); /**< code to be run when removing object to a canvas */
8844 void (*move) (Evas_Object *o, Evas_Coord x, Evas_Coord y); /**< code to be run when moving object on a canvas */
8845 void (*resize) (Evas_Object *o, Evas_Coord w, Evas_Coord h); /**< code to be run when resizing object on a canvas */
8846 void (*show) (Evas_Object *o); /**< code to be run when showing object on a canvas */
8847 void (*hide) (Evas_Object *o); /**< code to be run when hiding object on a canvas */
8848 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 */
8849 void (*clip_set) (Evas_Object *o, Evas_Object *clip); /**< code to be run when setting clipper of object on a canvas */
8850 void (*clip_unset) (Evas_Object *o); /**< code to be run when unsetting clipper of object on a canvas */
8851 void (*calculate) (Evas_Object *o); /**< code to be run when object has rendering updates on a canvas */
8852 void (*member_add) (Evas_Object *o, Evas_Object *child); /**< code to be run when child member is added to object */
8853 void (*member_del) (Evas_Object *o, Evas_Object *child); /**< code to be run when child member is removed from object */
8855 const Evas_Smart_Class *parent; /**< this class inherits from this parent */
8856 const Evas_Smart_Cb_Description *callbacks; /**< callbacks at this level, @c NULL terminated */
8857 void *interfaces; /**< to be used in a future near you */
8862 * @struct _Evas_Smart_Cb_Description
8864 * Describes a callback issued by a smart object
8865 * (evas_object_smart_callback_call()), as defined in its smart object
8866 * class. This is particularly useful to explain to end users and
8867 * their code (i.e., introspection) what the parameter @c event_info
8870 * @ingroup Evas_Smart_Group
8872 struct _Evas_Smart_Cb_Description
8874 const char *name; /**< callback name ("changed", for example) */
8877 * @brief Hint on the type of @c event_info parameter's contents on
8878 * a #Evas_Smart_Cb callback.
8880 * The type string uses the pattern similar to
8881 * http://dbus.freedesktop.org/doc/dbus-specification.html#message-protocol-signatures,
8882 * but extended to optionally include variable names within
8883 * brackets preceding types. Example:
8885 * @li Structure with two integers:
8888 * @li Structure called 'x' with two integers named 'a' and 'b':
8889 * @c "[x]([a]i[b]i)"
8891 * @li Array of integers:
8894 * @li Array called 'x' of struct with two integers:
8897 * @note This type string is used as a hint and is @b not validated
8898 * or enforced in any way. Implementors should make the best
8899 * use of it to help bindings, documentation and other users
8900 * of introspection features.
8906 * @def EVAS_SMART_CLASS_INIT_NULL
8907 * Initializer to zero a whole Evas_Smart_Class structure.
8909 * @see EVAS_SMART_CLASS_INIT_VERSION
8910 * @see EVAS_SMART_CLASS_INIT_NAME_VERSION
8911 * @see EVAS_SMART_CLASS_INIT_NAME_VERSION_PARENT
8912 * @see EVAS_SMART_CLASS_INIT_NAME_VERSION_PARENT_CALLBACKS
8913 * @ingroup Evas_Smart_Group
8915 #define EVAS_SMART_CLASS_INIT_NULL {NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL}
8918 * @def EVAS_SMART_CLASS_INIT_VERSION
8919 * Initializer to zero a whole Evas_Smart_Class structure and set version.
8921 * Similar to EVAS_SMART_CLASS_INIT_NULL, but will set version field to
8922 * latest EVAS_SMART_CLASS_VERSION.
8924 * @see EVAS_SMART_CLASS_INIT_NULL
8925 * @see EVAS_SMART_CLASS_INIT_NAME_VERSION
8926 * @see EVAS_SMART_CLASS_INIT_NAME_VERSION_PARENT
8927 * @see EVAS_SMART_CLASS_INIT_NAME_VERSION_PARENT_CALLBACKS
8928 * @ingroup Evas_Smart_Group
8930 #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}
8933 * @def EVAS_SMART_CLASS_INIT_NAME_VERSION
8934 * Initializer to zero a whole Evas_Smart_Class structure and set name
8937 * Similar to EVAS_SMART_CLASS_INIT_NULL, but will set version field to
8938 * latest EVAS_SMART_CLASS_VERSION and name to the specified value.
8940 * It will keep a reference to name field as a "const char *", that is,
8941 * name must be available while the structure is used (hint: static or global!)
8942 * and will not be modified.
8944 * @see EVAS_SMART_CLASS_INIT_NULL
8945 * @see EVAS_SMART_CLASS_INIT_VERSION
8946 * @see EVAS_SMART_CLASS_INIT_NAME_VERSION_PARENT
8947 * @see EVAS_SMART_CLASS_INIT_NAME_VERSION_PARENT_CALLBACKS
8948 * @ingroup Evas_Smart_Group
8950 #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}
8953 * @def EVAS_SMART_CLASS_INIT_NAME_VERSION_PARENT
8954 * Initializer to zero a whole Evas_Smart_Class structure and set name,
8955 * version and parent class.
8957 * Similar to EVAS_SMART_CLASS_INIT_NULL, but will set version field to
8958 * latest EVAS_SMART_CLASS_VERSION, name to the specified value and
8961 * It will keep a reference to name field as a "const char *", that is,
8962 * name must be available while the structure is used (hint: static or global!)
8963 * and will not be modified. Similarly, parent reference will be kept.
8965 * @see EVAS_SMART_CLASS_INIT_NULL
8966 * @see EVAS_SMART_CLASS_INIT_VERSION
8967 * @see EVAS_SMART_CLASS_INIT_NAME_VERSION
8968 * @see EVAS_SMART_CLASS_INIT_NAME_VERSION_PARENT_CALLBACKS
8969 * @ingroup Evas_Smart_Group
8971 #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}
8974 * @def EVAS_SMART_CLASS_INIT_NAME_VERSION_PARENT_CALLBACKS
8975 * Initializer to zero a whole Evas_Smart_Class structure and set name,
8976 * version, parent class and callbacks definition.
8978 * Similar to EVAS_SMART_CLASS_INIT_NULL, but will set version field to
8979 * latest EVAS_SMART_CLASS_VERSION, name to the specified value, parent
8980 * class and callbacks at this level.
8982 * It will keep a reference to name field as a "const char *", that is,
8983 * name must be available while the structure is used (hint: static or global!)
8984 * and will not be modified. Similarly, parent and callbacks reference
8987 * @see EVAS_SMART_CLASS_INIT_NULL
8988 * @see EVAS_SMART_CLASS_INIT_VERSION
8989 * @see EVAS_SMART_CLASS_INIT_NAME_VERSION
8990 * @see EVAS_SMART_CLASS_INIT_NAME_VERSION_PARENT
8991 * @ingroup Evas_Smart_Group
8993 #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}
8996 * @def EVAS_SMART_SUBCLASS_NEW
8998 * Convenience macro to subclass a given Evas smart class.
9000 * @param smart_name The name used for the smart class. e.g:
9001 * @c "Evas_Object_Box".
9002 * @param prefix Prefix used for all variables and functions defined
9003 * and referenced by this macro.
9004 * @param api_type Type of the structure used as API for the smart
9005 * class. Either #Evas_Smart_Class or something derived from it.
9006 * @param parent_type Type of the parent class API.
9007 * @param parent_func Function that gets the parent class. e.g:
9008 * evas_object_box_smart_class_get().
9009 * @param cb_desc Array of callback descriptions for this smart class.
9011 * This macro saves some typing when writing a smart class derived
9012 * from another one. In order to work, the user @b must provide some
9013 * functions adhering to the following guidelines:
9014 * - @<prefix@>_smart_set_user(): the @b internal @c _smart_set
9015 * function (defined by this macro) will call this one, provided by
9016 * the user, after inheriting everything from the parent, which
9017 * should <b>take care of setting the right member functions for
9018 * the class</b>, both overrides and extensions, if any.
9019 * - If this new class should be subclassable as well, a @b public @c
9020 * _smart_set() function is desirable to fill in the class used as
9021 * parent by the children. It's up to the user to provide this
9022 * interface, which will most likely call @<prefix@>_smart_set() to
9025 * After the macro's usage, the following will be defined for use:
9026 * - @<prefix@>_parent_sc: A pointer to the @b parent smart
9027 * class. When calling parent functions from overloaded ones, use
9028 * this global variable.
9029 * - @<prefix@>_smart_class_new(): this function returns the
9030 * #Evas_Smart needed to create smart objects with this class,
9031 * which should be passed to evas_object_smart_add().
9033 * @warning @p smart_name has to be a pointer to a globally available
9034 * string! The smart class created here will just have a pointer set
9035 * to that, and all object instances will depend on it for smart class
9038 * @ingroup Evas_Smart_Group
9040 #define EVAS_SMART_SUBCLASS_NEW(smart_name, prefix, api_type, parent_type, parent_func, cb_desc) \
9041 static const parent_type * prefix##_parent_sc = NULL; \
9042 static void prefix##_smart_set_user(api_type *api); \
9043 static void prefix##_smart_set(api_type *api) \
9045 Evas_Smart_Class *sc; \
9046 if (!(sc = (Evas_Smart_Class *)api)) \
9048 if (!prefix##_parent_sc) \
9049 prefix##_parent_sc = parent_func(); \
9050 evas_smart_class_inherit(sc, (const Evas_Smart_Class *)prefix##_parent_sc); \
9051 prefix##_smart_set_user(api); \
9053 static Evas_Smart * prefix##_smart_class_new(void) \
9055 static Evas_Smart *smart = NULL; \
9056 static api_type api; \
9059 Evas_Smart_Class *sc = (Evas_Smart_Class *)&api; \
9060 memset(&api, 0, sizeof(api_type)); \
9061 sc->version = EVAS_SMART_CLASS_VERSION; \
9062 sc->name = smart_name; \
9063 sc->callbacks = cb_desc; \
9064 prefix##_smart_set(&api); \
9065 smart = evas_smart_class_new(sc); \
9071 * @def EVAS_SMART_DATA_ALLOC
9073 * Convenience macro to allocate smart data only if needed.
9075 * When writing a subclassable smart object, the @c .add() function
9076 * will need to check if the smart private data was already allocated
9077 * by some child object or not. This macro makes it easier to do it.
9079 * @note This is an idiom used when one calls the parent's @c. add()
9080 * after the specialized code. Naturally, the parent's base smart data
9081 * has to be contemplated as the specialized one's first member, for
9084 * @param o Evas object passed to the @c .add() function
9085 * @param priv_type The type of the data to allocate
9087 * @ingroup Evas_Smart_Group
9089 #define EVAS_SMART_DATA_ALLOC(o, priv_type) \
9091 priv = evas_object_smart_data_get(o); \
9093 priv = (priv_type *)calloc(1, sizeof(priv_type)); \
9094 if (!priv) return; \
9095 evas_object_smart_data_set(o, priv); \
9100 * Free an #Evas_Smart struct
9102 * @param s the #Evas_Smart struct to free
9104 * @warning If this smart handle was created using
9105 * evas_smart_class_new(), the associated #Evas_Smart_Class will not
9108 * @note If you're using the #EVAS_SMART_SUBCLASS_NEW schema to create your
9109 * smart object, note that an #Evas_Smart handle will be shared amongst all
9110 * instances of the given smart class, through a static variable.
9111 * Evas will internally count references on #Evas_Smart handles and free them
9112 * when they are not referenced anymore. Thus, this function is of no use
9113 * for Evas users, most probably.
9115 EAPI void evas_smart_free (Evas_Smart *s) EINA_ARG_NONNULL(1);
9118 * Creates a new #Evas_Smart from a given #Evas_Smart_Class struct
9120 * @param sc the smart class definition
9121 * @return a new #Evas_Smart pointer
9123 * #Evas_Smart handles are necessary to create new @b instances of
9124 * smart objects belonging to the class described by @p sc. That
9125 * handle will contain, besides the smart class interface definition,
9126 * all its smart callbacks infrastructure set, too.
9128 * @note If you are willing to subclass a given smart class to
9129 * construct yours, consider using the #EVAS_SMART_SUBCLASS_NEW macro,
9130 * which will make use of this function automatically for you.
9132 EAPI Evas_Smart *evas_smart_class_new (const Evas_Smart_Class *sc) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
9135 * Get the #Evas_Smart_Class handle of an #Evas_Smart struct
9137 * @param s a valid #Evas_Smart pointer
9138 * @return the #Evas_Smart_Class in it
9140 EAPI const Evas_Smart_Class *evas_smart_class_get (const Evas_Smart *s) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
9144 * @brief Get the data pointer set on an #Evas_Smart struct
9146 * @param s a valid #Evas_Smart handle
9148 * This data pointer is set as the data field in the #Evas_Smart_Class
9149 * passed in to evas_smart_class_new().
9151 EAPI void *evas_smart_data_get (const Evas_Smart *s) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
9154 * Get the smart callbacks known by this #Evas_Smart handle's smart
9157 * @param s A valid #Evas_Smart handle.
9158 * @param[out] count Returns the number of elements in the returned
9160 * @return The array with callback descriptions known by this smart
9161 * class, with its size returned in @a count parameter. It
9162 * should not be modified in any way. If no callbacks are
9163 * known, @c NULL is returned. The array is sorted by event
9164 * names and elements refer to the original values given to
9165 * evas_smart_class_new()'s #Evas_Smart_Class::callbacks
9166 * (pointer to them).
9168 * This is likely different from
9169 * evas_object_smart_callbacks_descriptions_get() as it will contain
9170 * the callbacks of @b all this class hierarchy sorted, while the
9171 * direct smart class member refers only to that specific class and
9172 * should not include parent's.
9174 * If no callbacks are known, this function returns @c NULL.
9176 * The array elements and thus their contents will be @b references to
9177 * original values given to evas_smart_class_new() as
9178 * Evas_Smart_Class::callbacks.
9180 * The array is sorted by Evas_Smart_Cb_Description::name. The last
9181 * array element is a @c NULL pointer and is not accounted for in @a
9182 * count. Loop iterations can check any of these size indicators.
9184 * @note objects may provide per-instance callbacks, use
9185 * evas_object_smart_callbacks_descriptions_get() to get those
9187 * @see evas_object_smart_callbacks_descriptions_get()
9189 EAPI const Evas_Smart_Cb_Description **evas_smart_callbacks_descriptions_get(const Evas_Smart *s, unsigned int *count) EINA_ARG_NONNULL(1, 1);
9193 * Find a callback description for the callback named @a name.
9195 * @param s The #Evas_Smart where to search for class registered smart
9197 * @param name Name of the desired callback, which must @b not be @c
9198 * NULL. The search has a special case for @a name being the
9199 * same pointer as registered with #Evas_Smart_Cb_Description.
9200 * One can use it to avoid excessive use of strcmp().
9201 * @return A reference to the description if found, or @c NULL, otherwise
9203 * @see evas_smart_callbacks_descriptions_get()
9205 EAPI const Evas_Smart_Cb_Description *evas_smart_callback_description_find(const Evas_Smart *s, const char *name) EINA_ARG_NONNULL(1, 2) EINA_PURE;
9209 * Sets one class to inherit from the other.
9211 * Copy all function pointers, set @c parent to @a parent_sc and copy
9212 * everything after sizeof(Evas_Smart_Class) present in @a parent_sc,
9213 * using @a parent_sc_size as reference.
9215 * This is recommended instead of a single memcpy() since it will take
9216 * care to not modify @a sc name, version, callbacks and possible
9219 * @param sc child class.
9220 * @param parent_sc parent class, will provide attributes.
9221 * @param parent_sc_size size of parent_sc structure, child should be at least
9222 * this size. Everything after @c Evas_Smart_Class size is copied
9223 * using regular memcpy().
9225 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);
9228 * Get the number of users of the smart instance
9230 * @param s The Evas_Smart to get the usage count of
9231 * @return The number of uses of the smart instance
9233 * This function tells you how many more uses of the smart instance are in
9234 * existence. This should be used before freeing/clearing any of the
9235 * Evas_Smart_Class that was used to create the smart instance. The smart
9236 * instance will refer to data in the Evas_Smart_Class used to create it and
9237 * thus you cannot remove the original data until all users of it are gone.
9238 * When the usage count goes to 0, you can evas_smart_free() the smart
9239 * instance @p s and remove from memory any of the Evas_Smart_Class that
9240 * was used to create the smart instance, if you desire. Removing it from
9241 * memory without doing this will cause problems (crashes, undefined
9242 * behavior etc. etc.), so either never remove the original
9243 * Evas_Smart_Class data from memory (have it be a constant structure and
9244 * data), or use this API call and be very careful.
9246 EAPI int evas_smart_usage_get(const Evas_Smart *s);
9249 * @def evas_smart_class_inherit
9250 * Easy to use version of evas_smart_class_inherit_full().
9252 * This version will use sizeof(parent_sc), copying everything.
9254 * @param sc child class, will have methods copied from @a parent_sc
9255 * @param parent_sc parent class, will provide contents to be copied.
9256 * @return 1 on success, 0 on failure.
9257 * @ingroup Evas_Smart_Group
9259 #define evas_smart_class_inherit(sc, parent_sc) evas_smart_class_inherit_full(sc, parent_sc, sizeof(*parent_sc))
9266 * @defgroup Evas_Smart_Object_Group Smart Object Functions
9268 * Functions dealing with Evas smart objects (instances).
9270 * Smart objects are groupings of primitive Evas objects that behave
9271 * as a cohesive group. For instance, a file manager icon may be a
9272 * smart object composed of an image object, a text label and two
9273 * rectangles that appear behind the image and text when the icon is
9274 * selected. As a smart object, the normal Evas object API could be
9275 * used on the icon object.
9277 * Besides that, generally smart objects implement a <b>specific
9278 * API</b>, so that users interect with its own custom features. The
9279 * API takes form of explicit exported functions one may call and
9280 * <b>smart callbacks</b>.
9282 * @section Evas_Smart_Object_Group_Callbacks Smart events and callbacks
9284 * Smart objects can elect events (smart events, from now on) ocurring
9285 * inside of them to be reported back to their users via callback
9286 * functions (smart callbacks). This way, you can extend Evas' own
9287 * object events. They are defined by an <b>event string</b>, which
9288 * identifies them uniquely. There's also a function prototype
9289 * definition for the callback functions: #Evas_Smart_Cb.
9291 * When defining an #Evas_Smart_Class, smart object implementors are
9292 * strongly encorauged to properly set the Evas_Smart_Class::callbacks
9293 * callbacks description array, so that the users of the smart object
9294 * can have introspection on its events API <b>at run time</b>.
9296 * See some @ref Example_Evas_Smart_Objects "examples" of this group
9299 * @see @ref Evas_Smart_Group for class definitions.
9303 * @addtogroup Evas_Smart_Object_Group
9308 * Instantiates a new smart object described by @p s.
9310 * @param e the canvas on which to add the object
9311 * @param s the #Evas_Smart describing the smart object
9312 * @return a new #Evas_Object handle
9314 * This is the function one should use when defining the public
9315 * function @b adding an instance of the new smart object to a given
9316 * canvas. It will take care of setting all of its internals to work
9317 * as they should, if the user set things properly, as seem on the
9318 * #EVAS_SMART_SUBCLASS_NEW, for example.
9320 * @ingroup Evas_Smart_Object_Group
9322 EAPI Evas_Object *evas_object_smart_add (Evas *e, Evas_Smart *s) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2) EINA_MALLOC;
9325 * Set an Evas object as a member of a given smart object.
9327 * @param obj The member object
9328 * @param smart_obj The smart object
9330 * Members will automatically be stacked and layered together with the
9331 * smart object. The various stacking functions will operate on
9332 * members relative to the other members instead of the entire canvas,
9333 * since they now live on an exclusive layer (see
9334 * evas_object_stack_above(), for more details).
9336 * Any @p smart_obj object's specific implementation of the @c
9337 * member_add() smart function will take place too, naturally.
9339 * @see evas_object_smart_member_del()
9340 * @see evas_object_smart_members_get()
9342 * @ingroup Evas_Smart_Object_Group
9344 EAPI void evas_object_smart_member_add (Evas_Object *obj, Evas_Object *smart_obj) EINA_ARG_NONNULL(1, 2);
9347 * Removes a member object from a given smart object.
9349 * @param obj the member object
9350 * @ingroup Evas_Smart_Object_Group
9352 * This removes a member object from a smart object, if it was added
9353 * to any. The object will still be on the canvas, but no longer
9354 * associated with whichever smart object it was associated with.
9356 * @see evas_object_smart_member_add() for more details
9357 * @see evas_object_smart_members_get()
9359 EAPI void evas_object_smart_member_del (Evas_Object *obj) EINA_ARG_NONNULL(1);
9362 * Retrieves the list of the member objects of a given Evas smart
9365 * @param obj the smart object to get members from
9366 * @return Returns the list of the member objects of @p obj.
9368 * The returned list should be freed with @c eina_list_free() when you
9369 * no longer need it.
9371 * @see evas_object_smart_member_add()
9372 * @see evas_object_smart_member_del()
9374 EAPI Eina_List *evas_object_smart_members_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
9377 * Gets the parent smart object of a given Evas object, if it has one.
9379 * @param obj the Evas object you want to get the parent smart object
9381 * @return Returns the parent smart object of @a obj or @c NULL, if @a
9382 * obj is not a smart member of any
9384 * @ingroup Evas_Smart_Object_Group
9386 EAPI Evas_Object *evas_object_smart_parent_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
9389 * Checks whether a given smart object or any of its smart object
9390 * parents is of a given smart class.
9392 * @param obj An Evas smart object to check the type of
9393 * @param type The @b name (type) of the smart class to check for
9394 * @return @c EINA_TRUE, if @a obj or any of its parents is of type @a
9395 * type, @c EINA_FALSE otherwise
9397 * If @p obj is not a smart object, this call will fail
9398 * immediately. Otherwise, make sure evas_smart_class_inherit() or its
9399 * sibling functions were used correctly when creating the smart
9400 * object's class, so it has a valid @b parent smart class pointer
9403 * The checks use smart classes names and <b>string
9404 * comparison</b>. There is a version of this same check using
9405 * <b>pointer comparison</b>, since a smart class' name is a single
9408 * @see evas_object_smart_type_check_ptr()
9409 * @see #EVAS_SMART_SUBCLASS_NEW
9411 * @ingroup Evas_Smart_Object_Group
9413 EAPI Eina_Bool evas_object_smart_type_check (const Evas_Object *obj, const char *type) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2) EINA_PURE;
9416 * Checks whether a given smart object or any of its smart object
9417 * parents is of a given smart class, <b>using pointer comparison</b>.
9419 * @param obj An Evas smart object to check the type of
9420 * @param type The type (name string) to check for. Must be the name
9421 * @return @c EINA_TRUE, if @a obj or any of its parents is of type @a
9422 * type, @c EINA_FALSE otherwise
9424 * @see evas_object_smart_type_check() for more details
9426 * @ingroup Evas_Smart_Object_Group
9428 EAPI Eina_Bool evas_object_smart_type_check_ptr (const Evas_Object *obj, const char *type) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2) EINA_PURE;
9431 * Get the #Evas_Smart from which @p obj smart object was created.
9433 * @param obj a smart object
9434 * @return the #Evas_Smart handle or @c NULL, on errors
9436 * @ingroup Evas_Smart_Object_Group
9438 EAPI Evas_Smart *evas_object_smart_smart_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
9441 * Retrieve user data stored on a given smart object.
9443 * @param obj The smart object's handle
9444 * @return A pointer to data stored using
9445 * evas_object_smart_data_set(), or @c NULL, if none has been
9448 * @see evas_object_smart_data_set()
9450 * @ingroup Evas_Smart_Object_Group
9452 EAPI void *evas_object_smart_data_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
9455 * Store a pointer to user data for a given smart object.
9457 * @param obj The smart object's handle
9458 * @param data A pointer to user data
9460 * This data is stored @b independently of the one set by
9461 * evas_object_data_set(), naturally.
9463 * @see evas_object_smart_data_get()
9465 * @ingroup Evas_Smart_Object_Group
9467 EAPI void evas_object_smart_data_set (Evas_Object *obj, void *data) EINA_ARG_NONNULL(1);
9470 * Add (register) a callback function to the smart event specified by
9471 * @p event on the smart object @p obj.
9473 * @param obj a smart object
9474 * @param event the event's name string
9475 * @param func the callback function
9476 * @param data user data to be passed to the callback function
9478 * Smart callbacks look very similar to Evas callbacks, but are
9479 * implemented as smart object's custom ones.
9481 * This function adds a function callback to an smart object when the
9482 * event named @p event occurs in it. The function is @p func.
9484 * In the event of a memory allocation error during addition of the
9485 * callback to the object, evas_alloc_error() should be used to
9486 * determine the nature of the error, if any, and the program should
9487 * sensibly try and recover.
9489 * A smart callback function must have the ::Evas_Smart_Cb prototype
9490 * definition. The first parameter (@p data) in this definition will
9491 * have the same value passed to evas_object_smart_callback_add() as
9492 * the @p data parameter, at runtime. The second parameter @p obj is a
9493 * handle to the object on which the event occurred. The third
9494 * parameter, @p event_info, is a pointer to data which is totally
9495 * dependent on the smart object's implementation and semantic for the
9498 * There is an infrastructure for introspection on smart objects'
9499 * events (see evas_smart_callbacks_descriptions_get()), but no
9500 * internal smart objects on Evas implement them yet.
9502 * @see @ref Evas_Smart_Object_Group_Callbacks for more details.
9504 * @see evas_object_smart_callback_del()
9505 * @ingroup Evas_Smart_Object_Group
9507 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);
9510 * Add (register) a callback function to the smart event specified by
9511 * @p event on the smart object @p obj. Except for the priority field,
9512 * it's exactly the same as @ref evas_object_smart_callback_add
9514 * @param obj a smart object
9515 * @param event the event's name string
9516 * @param priority The priority of the callback, lower values called first.
9517 * @param func the callback function
9518 * @param data user data to be passed to the callback function
9520 * @see evas_object_smart_callback_add
9522 * @ingroup Evas_Smart_Object_Group
9524 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);
9527 * Delete (unregister) a callback function from the smart event
9528 * specified by @p event on the smart object @p obj.
9530 * @param obj a smart object
9531 * @param event the event's name string
9532 * @param func the callback function
9533 * @return the data pointer
9535 * This function removes <b>the first</b> added smart callback on the
9536 * object @p obj matching the event name @p event and the registered
9537 * function pointer @p func. If the removal is successful it will also
9538 * return the data pointer that was passed to
9539 * evas_object_smart_callback_add() (that will be the same as the
9540 * parameter) when the callback(s) was(were) added to the canvas. If
9541 * not successful @c NULL will be returned.
9543 * @see evas_object_smart_callback_add() for more details.
9545 * @ingroup Evas_Smart_Object_Group
9547 EAPI void *evas_object_smart_callback_del (Evas_Object *obj, const char *event, Evas_Smart_Cb func) EINA_ARG_NONNULL(1, 2, 3);
9550 * Call a given smart callback on the smart object @p obj.
9552 * @param obj the smart object
9553 * @param event the event's name string
9554 * @param event_info pointer to an event specific struct or information to
9555 * pass to the callback functions registered on this smart event
9557 * This should be called @b internally, from the smart object's own
9558 * code, when some specific event has occurred and the implementor
9559 * wants is to pertain to the object's events API (see @ref
9560 * Evas_Smart_Object_Group_Callbacks). The documentation for the smart
9561 * object should include a list of possible events and what type of @p
9562 * event_info to expect for each of them. Also, when defining an
9563 * #Evas_Smart_Class, smart object implementors are strongly
9564 * encorauged to properly set the Evas_Smart_Class::callbacks
9565 * callbacks description array, so that the users of the smart object
9566 * can have introspection on its events API <b>at run time</b>.
9568 * @ingroup Evas_Smart_Object_Group
9570 EAPI void evas_object_smart_callback_call (Evas_Object *obj, const char *event, void *event_info) EINA_ARG_NONNULL(1, 2);
9574 * Set an smart object @b instance's smart callbacks descriptions.
9576 * @param obj A smart object
9577 * @param descriptions @c NULL terminated array with
9578 * #Evas_Smart_Cb_Description descriptions. Array elements won't be
9579 * modified at run time, but references to them and their contents
9580 * will be made, so this array should be kept alive during the whole
9581 * object's lifetime.
9582 * @return @c EINA_TRUE on success, @c EINA_FALSE on failure.
9584 * These descriptions are hints to be used by introspection and are
9585 * not enforced in any way.
9587 * It will not be checked if instance callbacks descriptions have the
9588 * same name as respective possibly registered in the smart object
9589 * @b class. Both are kept in different arrays and users of
9590 * evas_object_smart_callbacks_descriptions_get() should handle this
9591 * case as they wish.
9593 * @note Becase @p descriptions must be @c NULL terminated, and
9594 * because a @c NULL name makes little sense, too,
9595 * Evas_Smart_Cb_Description::name must @b not be @c NULL.
9597 * @note While instance callbacks descriptions are possible, they are
9598 * @b not recommended. Use @b class callbacks descriptions
9599 * instead as they make you smart object user's life simpler and
9600 * will use less memory, as descriptions and arrays will be
9601 * shared among all instances.
9603 * @ingroup Evas_Smart_Object_Group
9605 EAPI Eina_Bool evas_object_smart_callbacks_descriptions_set(Evas_Object *obj, const Evas_Smart_Cb_Description *descriptions) EINA_ARG_NONNULL(1);
9608 * Retrieve an smart object's know smart callback descriptions (both
9609 * instance and class ones).
9611 * @param obj The smart object to get callback descriptions from.
9612 * @param class_descriptions Where to store class callbacks
9613 * descriptions array, if any is known. If no descriptions are
9614 * known, @c NULL is returned
9615 * @param class_count Returns how many class callbacks descriptions
9617 * @param instance_descriptions Where to store instance callbacks
9618 * descriptions array, if any is known. If no descriptions are
9619 * known, @c NULL is returned.
9620 * @param instance_count Returns how many instance callbacks
9621 * descriptions are known.
9623 * This call searchs for registered callback descriptions for both
9624 * instance and class of the given smart object. These arrays will be
9625 * sorted by Evas_Smart_Cb_Description::name and also @c NULL
9626 * terminated, so both @a class_count and @a instance_count can be
9627 * ignored, if the caller wishes so. The terminator @c NULL is not
9628 * counted in these values.
9630 * @note If just class descriptions are of interest, try
9631 * evas_smart_callbacks_descriptions_get() instead.
9633 * @note Use @c NULL pointers on the descriptions/counters you're not
9634 * interested in: they'll be ignored by the function.
9636 * @see evas_smart_callbacks_descriptions_get()
9638 * @ingroup Evas_Smart_Object_Group
9640 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);
9643 * Find callback description for callback called @a name.
9645 * @param obj the smart object.
9646 * @param name name of desired callback, must @b not be @c NULL. The
9647 * search have a special case for @a name being the same
9648 * pointer as registered with Evas_Smart_Cb_Description, one
9649 * can use it to avoid excessive use of strcmp().
9650 * @param class_description pointer to return class description or @c
9651 * NULL if not found. If parameter is @c NULL, no search will
9652 * be done on class descriptions.
9653 * @param instance_description pointer to return instance description
9654 * or @c NULL if not found. If parameter is @c NULL, no search
9655 * will be done on instance descriptions.
9656 * @return reference to description if found, @c NULL if not found.
9658 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);
9662 * Mark smart object as changed, dirty.
9664 * @param obj The given Evas smart object
9666 * This will flag the given object as needing recalculation,
9667 * forcefully. As an effect, on the next rendering cycle it's @b
9668 * calculate() (see #Evas_Smart_Class) smart function will be called.
9670 * @see evas_object_smart_need_recalculate_set().
9671 * @see evas_object_smart_calculate().
9673 * @ingroup Evas_Smart_Object_Group
9675 EAPI void evas_object_smart_changed (Evas_Object *obj) EINA_ARG_NONNULL(1);
9678 * Set or unset the flag signalling that a given smart object needs to
9681 * @param obj the smart object
9682 * @param value whether one wants to set (@c EINA_TRUE) or to unset
9683 * (@c EINA_FALSE) the flag.
9685 * If this flag is set, then the @c calculate() smart function of @p
9686 * obj will be called, if one is provided, during rendering phase of
9687 * Evas (see evas_render()), after which this flag will be
9688 * automatically unset.
9690 * If that smart function is not provided for the given object, this
9691 * flag will be left unchanged.
9693 * @note just setting this flag will not make the canvas' whole scene
9694 * dirty, by itself, and evas_render() will have no effect. To
9695 * force that, use evas_object_smart_changed(), that will also
9696 * automatically call this function automatically, with @c
9697 * EINA_TRUE as parameter.
9699 * @see evas_object_smart_need_recalculate_get()
9700 * @see evas_object_smart_calculate()
9701 * @see evas_smart_objects_calculate()
9703 * @ingroup Evas_Smart_Object_Group
9705 EAPI void evas_object_smart_need_recalculate_set(Evas_Object *obj, Eina_Bool value) EINA_ARG_NONNULL(1);
9708 * Get the value of the flag signalling that a given smart object needs to
9711 * @param obj the smart object
9712 * @return if flag is set or not.
9714 * @note this flag will be unset during the rendering phase, when the
9715 * @c calculate() smart function is called, if one is provided.
9716 * If it's not provided, then the flag will be left unchanged
9717 * after the rendering phase.
9719 * @see evas_object_smart_need_recalculate_set(), for more details
9721 * @ingroup Evas_Smart_Object_Group
9723 EAPI Eina_Bool evas_object_smart_need_recalculate_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
9726 * Call the @b calculate() smart function immediataly on a given smart
9729 * @param obj the smart object's handle
9731 * This will force immediate calculations (see #Evas_Smart_Class)
9732 * needed for renderization of this object and, besides, unset the
9733 * flag on it telling it needs recalculation for the next rendering
9736 * @see evas_object_smart_need_recalculate_set()
9738 * @ingroup Evas_Smart_Object_Group
9740 EAPI void evas_object_smart_calculate (Evas_Object *obj) EINA_ARG_NONNULL(1);
9743 * Call user-provided @c calculate() smart functions and unset the
9744 * flag signalling that the object needs to get recalculated to @b all
9745 * smart objects in the canvas.
9747 * @param e The canvas to calculate all smart objects in
9749 * @see evas_object_smart_need_recalculate_set()
9751 * @ingroup Evas_Smart_Object_Group
9753 EAPI void evas_smart_objects_calculate (Evas *e);
9756 * Moves all children objects of a given smart object relative to a
9759 * @param obj the smart object.
9760 * @param dx horizontal offset (delta).
9761 * @param dy vertical offset (delta).
9763 * This will make each of @p obj object's children to move, from where
9764 * they before, with those delta values (offsets) on both directions.
9766 * @note This is most useful on custom smart @c move() functions.
9768 * @note Clipped smart objects already make use of this function on
9769 * their @c move() smart function definition.
9771 EAPI void evas_object_smart_move_children_relative(Evas_Object *obj, Evas_Coord dx, Evas_Coord dy) EINA_ARG_NONNULL(1);
9778 * @defgroup Evas_Smart_Object_Clipped Clipped Smart Object
9780 * Clipped smart object is a base to construct other smart objects
9781 * based on the concept of having an internal clipper that is applied
9782 * to all children objects. This clipper will control the visibility,
9783 * clipping and color of sibling objects (remember that the clipping
9784 * is recursive, and clipper color modulates the color of its
9785 * clippees). By default, this base will also move children relatively
9786 * to the parent, and delete them when parent is deleted. In other
9787 * words, it is the base for simple object grouping.
9789 * See some @ref Example_Evas_Smart_Objects "examples" of this group
9792 * @see evas_object_smart_clipped_smart_set()
9794 * @ingroup Evas_Smart_Object_Group
9798 * @addtogroup Evas_Smart_Object_Clipped
9803 * Every subclass should provide this at the beginning of their own
9804 * data set with evas_object_smart_data_set().
9806 typedef struct _Evas_Object_Smart_Clipped_Data Evas_Object_Smart_Clipped_Data;
9807 struct _Evas_Object_Smart_Clipped_Data
9809 Evas_Object *clipper;
9815 * Get the clipper object for the given clipped smart object.
9817 * @param obj the clipped smart object to retrieve associated clipper
9819 * @return the clipper object.
9821 * Use this function if you want to change any of this clipper's
9822 * properties, like colors.
9824 * @see evas_object_smart_clipped_smart_add()
9826 EAPI Evas_Object *evas_object_smart_clipped_clipper_get (Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
9829 * Set a given smart class' callbacks so it implements the <b>clipped smart
9830 * object"</b>'s interface.
9832 * @param sc The smart class handle to operate on
9834 * This call will assign all the required methods of the @p sc
9835 * #Evas_Smart_Class instance to the implementations set for clipped
9836 * smart objects. If one wants to "subclass" it, call this function
9837 * and then override desired values. If one wants to call any original
9838 * method, save it somewhere. Example:
9841 * static Evas_Smart_Class parent_sc = EVAS_SMART_CLASS_INIT_NULL;
9843 * static void my_class_smart_add(Evas_Object *o)
9846 * evas_object_color_set(evas_object_smart_clipped_clipper_get(o),
9850 * Evas_Smart_Class *my_class_new(void)
9852 * static Evas_Smart_Class sc = EVAS_SMART_CLASS_INIT_NAME_VERSION("MyClass");
9853 * if (!parent_sc.name)
9855 * evas_object_smart_clipped_smart_set(&sc);
9857 * sc.add = my_class_smart_add;
9863 * Default behavior for each of #Evas_Smart_Class functions on a
9864 * clipped smart object are:
9865 * - @c add: creates a hidden clipper with "infinite" size, to clip
9866 * any incoming members;
9867 * - @c del: delete all children objects;
9868 * - @c move: move all objects relative relatively;
9869 * - @c resize: <b>not defined</b>;
9870 * - @c show: if there are children objects, show clipper;
9871 * - @c hide: hides clipper;
9872 * - @c color_set: set the color of clipper;
9873 * - @c clip_set: set clipper of clipper;
9874 * - @c clip_unset: unset the clipper of clipper;
9876 * @note There are other means of assigning parent smart classes to
9877 * child ones, like the #EVAS_SMART_SUBCLASS_NEW macro or the
9878 * evas_smart_class_inherit_full() function.
9880 EAPI void evas_object_smart_clipped_smart_set (Evas_Smart_Class *sc) EINA_ARG_NONNULL(1);
9883 * Get a pointer to the <b>clipped smart object's</b> class, to use
9884 * for proper inheritance
9886 * @see #Evas_Smart_Object_Clipped for more information on this smart
9889 EAPI const Evas_Smart_Class *evas_object_smart_clipped_class_get (void) EINA_CONST;
9896 * @defgroup Evas_Object_Box Box Smart Object
9898 * A box is a convenience smart object that packs children inside it
9899 * in @b sequence, using a layouting function specified by the
9900 * user. There are a couple of pre-made layouting functions <b>built-in
9901 * in Evas</b>, all of them using children size hints to define their
9902 * size and alignment inside their cell space.
9904 * Examples on this smart object's usage:
9905 * - @ref Example_Evas_Box
9906 * - @ref Example_Evas_Size_Hints
9908 * @see @ref Evas_Object_Group_Size_Hints
9910 * @ingroup Evas_Smart_Object_Group
9914 * @addtogroup Evas_Object_Box
9919 * @typedef Evas_Object_Box_Api
9921 * Smart class extension, providing extra box object requirements.
9923 * @ingroup Evas_Object_Box
9925 typedef struct _Evas_Object_Box_Api Evas_Object_Box_Api;
9928 * @typedef Evas_Object_Box_Data
9930 * Smart object instance data, providing box object requirements.
9932 * @ingroup Evas_Object_Box
9934 typedef struct _Evas_Object_Box_Data Evas_Object_Box_Data;
9937 * @typedef Evas_Object_Box_Option
9939 * The base structure for a box option. Box options are a way of
9940 * extending box items properties, which will be taken into account
9941 * for layouting decisions. The box layouting functions provided by
9942 * Evas will only rely on objects' canonical size hints to layout
9943 * them, so the basic box option has @b no (custom) property set.
9945 * Users creating their own layouts, but not depending on extra child
9946 * items' properties, would be fine just using
9947 * evas_object_box_layout_set(). But if one desires a layout depending
9948 * on extra child properties, he/she has to @b subclass the box smart
9949 * object. Thus, by using evas_object_box_smart_class_get() and
9950 * evas_object_box_smart_set(), the @c option_new() and @c
9951 * option_free() smart class functions should be properly
9952 * redefined/extended.
9954 * Object properties are bound to an integer identifier and must have
9955 * a name string. Their values are open to any data. See the API on
9956 * option properties for more details.
9958 * @ingroup Evas_Object_Box
9960 typedef struct _Evas_Object_Box_Option Evas_Object_Box_Option;
9963 * @typedef Evas_Object_Box_Layout
9965 * Function signature for an Evas box object layouting routine. By
9966 * @a o it will be passed the box object in question, by @a priv it will
9967 * be passed the box's internal data and, by @a user_data, it will be
9968 * passed any custom data one could have set to a given box layouting
9969 * function, with evas_object_box_layout_set().
9971 * @ingroup Evas_Object_Box
9973 typedef void (*Evas_Object_Box_Layout) (Evas_Object *o, Evas_Object_Box_Data *priv, void *user_data);
9976 * @def EVAS_OBJECT_BOX_API_VERSION
9978 * Current version for Evas box object smart class, a value which goes
9979 * to _Evas_Object_Box_Api::version.
9981 * @ingroup Evas_Object_Box
9983 #define EVAS_OBJECT_BOX_API_VERSION 1
9986 * @struct _Evas_Object_Box_Api
9988 * This structure should be used by any smart class inheriting from
9989 * the box's one, to provide custom box behavior which could not be
9990 * achieved only by providing a layout function, with
9991 * evas_object_box_layout_set().
9993 * @extends Evas_Smart_Class
9994 * @ingroup Evas_Object_Box
9996 struct _Evas_Object_Box_Api
9998 Evas_Smart_Class base; /**< Base smart class struct, need for all smart objects */
9999 int version; /**< Version of this smart class definition */
10000 Evas_Object_Box_Option *(*append) (Evas_Object *o, Evas_Object_Box_Data *priv, Evas_Object *child); /**< Smart function to append child elements in boxes */
10001 Evas_Object_Box_Option *(*prepend) (Evas_Object *o, Evas_Object_Box_Data *priv, Evas_Object *child); /**< Smart function to prepend child elements in boxes */
10002 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 */
10003 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 */
10004 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 positon on boxes */
10005 Evas_Object *(*remove) (Evas_Object *o, Evas_Object_Box_Data *priv, Evas_Object *child); /**< Smart function to remove a child element from boxes */
10006 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 */
10007 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 */
10008 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 */
10009 const char *(*property_name_get)(Evas_Object *o, int property); /**< Smart function to get the name of a custom property of box children */
10010 int (*property_id_get) (Evas_Object *o, const char *name); /**< Smart function to get the numerical ID of a custom property of box children */
10011 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 */
10012 void (*option_free) (Evas_Object *o, Evas_Object_Box_Data *priv, Evas_Object_Box_Option *opt); /**< Smart function to delete a box option struct */
10016 * @def EVAS_OBJECT_BOX_API_INIT
10018 * Initializer for a whole #Evas_Object_Box_Api structure, with
10019 * @c NULL values on its specific fields.
10021 * @param smart_class_init initializer to use for the "base" field
10022 * (#Evas_Smart_Class).
10024 * @see EVAS_SMART_CLASS_INIT_NULL
10025 * @see EVAS_SMART_CLASS_INIT_VERSION
10026 * @see EVAS_SMART_CLASS_INIT_NAME_VERSION
10027 * @see EVAS_OBJECT_BOX_API_INIT_NULL
10028 * @see EVAS_OBJECT_BOX_API_INIT_VERSION
10029 * @see EVAS_OBJECT_BOX_API_INIT_NAME_VERSION
10030 * @ingroup Evas_Object_Box
10032 #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}
10035 * @def EVAS_OBJECT_BOX_API_INIT_NULL
10037 * Initializer to zero out a whole #Evas_Object_Box_Api structure.
10039 * @see EVAS_OBJECT_BOX_API_INIT_VERSION
10040 * @see EVAS_OBJECT_BOX_API_INIT_NAME_VERSION
10041 * @see EVAS_OBJECT_BOX_API_INIT
10042 * @ingroup Evas_Object_Box
10044 #define EVAS_OBJECT_BOX_API_INIT_NULL EVAS_OBJECT_BOX_API_INIT(EVAS_SMART_CLASS_INIT_NULL)
10047 * @def EVAS_OBJECT_BOX_API_INIT_VERSION
10049 * Initializer to zero out a whole #Evas_Object_Box_Api structure and
10050 * set a specific version on it.
10052 * This is similar to #EVAS_OBJECT_BOX_API_INIT_NULL, but it will set
10053 * the version field of #Evas_Smart_Class (base field) to the latest
10054 * #EVAS_SMART_CLASS_VERSION.
10056 * @see EVAS_OBJECT_BOX_API_INIT_NULL
10057 * @see EVAS_OBJECT_BOX_API_INIT_NAME_VERSION
10058 * @see EVAS_OBJECT_BOX_API_INIT
10059 * @ingroup Evas_Object_Box
10061 #define EVAS_OBJECT_BOX_API_INIT_VERSION EVAS_OBJECT_BOX_API_INIT(EVAS_SMART_CLASS_INIT_VERSION)
10064 * @def EVAS_OBJECT_BOX_API_INIT_NAME_VERSION
10066 * Initializer to zero out a whole #Evas_Object_Box_Api structure and
10067 * set its name and version.
10069 * This is similar to #EVAS_OBJECT_BOX_API_INIT_NULL, but it will also
10070 * set the version field of #Evas_Smart_Class (base field) to the
10071 * latest #EVAS_SMART_CLASS_VERSION and name it to the specific value.
10073 * It will keep a reference to the name field as a <c>"const char *"</c>,
10074 * i.e., the name must be available while the structure is
10075 * used (hint: static or global variable!) and must not be modified.
10077 * @see EVAS_OBJECT_BOX_API_INIT_NULL
10078 * @see EVAS_OBJECT_BOX_API_INIT_VERSION
10079 * @see EVAS_OBJECT_BOX_API_INIT
10080 * @ingroup Evas_Object_Box
10082 #define EVAS_OBJECT_BOX_API_INIT_NAME_VERSION(name) EVAS_OBJECT_BOX_API_INIT(EVAS_SMART_CLASS_INIT_NAME_VERSION(name))
10085 * @struct _Evas_Object_Box_Data
10087 * This structure augments clipped smart object's instance data,
10088 * providing extra members required by generic box implementation. If
10089 * a subclass inherits from #Evas_Object_Box_Api, then it may augment
10090 * #Evas_Object_Box_Data to fit its own needs.
10092 * @extends Evas_Object_Smart_Clipped_Data
10093 * @ingroup Evas_Object_Box
10095 struct _Evas_Object_Box_Data
10097 Evas_Object_Smart_Clipped_Data base;
10098 const Evas_Object_Box_Api *api;
10105 Eina_List *children;
10107 Evas_Object_Box_Layout cb;
10109 void (*free_data)(void *data);
10111 Eina_Bool layouting : 1;
10112 Eina_Bool children_changed : 1;
10115 struct _Evas_Object_Box_Option
10117 Evas_Object *obj; /**< Pointer to the box child object, itself */
10118 Eina_Bool max_reached:1;
10119 Eina_Bool min_reached:1;
10120 Evas_Coord alloc_size;
10121 }; /**< #Evas_Object_Box_Option struct fields */
10124 * Set the default box @a api struct (Evas_Object_Box_Api)
10125 * with the default values. May be used to extend that API.
10127 * @param api The box API struct to set back, most probably with
10128 * overriden fields (on class extensions scenarios)
10130 EAPI void evas_object_box_smart_set (Evas_Object_Box_Api *api) EINA_ARG_NONNULL(1);
10133 * Get the Evas box smart class, for inheritance purposes.
10135 * @return the (canonical) Evas box smart class.
10137 * The returned value is @b not to be modified, just use it as your
10140 EAPI const Evas_Object_Box_Api *evas_object_box_smart_class_get (void) EINA_CONST;
10143 * Set a new layouting function to a given box object
10145 * @param o The box object to operate on.
10146 * @param cb The new layout function to set on @p o.
10147 * @param data Data pointer to be passed to @p cb.
10148 * @param free_data Function to free @p data, if need be.
10150 * A box layout function affects how a box object displays child
10151 * elements within its area. The list of pre-defined box layouts
10152 * available in Evas is:
10153 * - evas_object_box_layout_horizontal()
10154 * - evas_object_box_layout_vertical()
10155 * - evas_object_box_layout_homogeneous_horizontal()
10156 * - evas_object_box_layout_homogeneous_vertical()
10157 * - evas_object_box_layout_homogeneous_max_size_horizontal()
10158 * - evas_object_box_layout_homogeneous_max_size_vertical()
10159 * - evas_object_box_layout_flow_horizontal()
10160 * - evas_object_box_layout_flow_vertical()
10161 * - evas_object_box_layout_stack()
10163 * Refer to each of their documentation texts for details on them.
10165 * @note A box layouting function will be triggered by the @c
10166 * 'calculate' smart callback of the box's smart class.
10168 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);
10171 * Add a new box object on the provided canvas.
10173 * @param evas The canvas to create the box object on.
10174 * @return @c NULL on error, a pointer to a new box object on
10177 * After instantiation, if a box object hasn't its layout function
10178 * set, via evas_object_box_layout_set(), it will have it by default
10179 * set to evas_object_box_layout_horizontal(). The remaining
10180 * properties of the box must be set/retrieved via
10181 * <c>evas_object_box_{h,v}_{align,padding}_{get,set)()</c>.
10183 EAPI Evas_Object *evas_object_box_add (Evas *evas) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
10186 * Add a new box as a @b child of a given smart object.
10188 * @param parent The parent smart object to put the new box in.
10189 * @return @c NULL on error, a pointer to a new box object on
10192 * This is a helper function that has the same effect of putting a new
10193 * box object into @p parent by use of evas_object_smart_member_add().
10195 * @see evas_object_box_add()
10197 EAPI Evas_Object *evas_object_box_add_to (Evas_Object *parent) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
10200 * Layout function which sets the box @a o to a (basic) horizontal box
10202 * @param o The box object in question
10203 * @param priv The smart data of the @p o
10204 * @param data The data pointer passed on
10205 * evas_object_box_layout_set(), if any
10207 * In this layout, the box object's overall behavior is controlled by
10208 * its padding/alignment properties, which are set by the
10209 * <c>evas_object_box_{h,v}_{align,padding}_set()</c> family of
10210 * functions. The size hints of the elements in the box -- set by the
10211 * <c>evas_object_size_hint_{align,padding,weight}_set()</c> functions
10212 * -- also control the way this function works.
10214 * \par Box's properties:
10215 * @c align_h controls the horizontal alignment of the child objects
10216 * relative to the containing box. When set to @c 0.0, children are
10217 * aligned to the left. A value of @c 1.0 makes them aligned to the
10218 * right border. Values in between align them proportionally. Note
10219 * that if the size required by the children, which is given by their
10220 * widths and the @c padding_h property of the box, is bigger than the
10221 * their container's width, the children will be displayed out of the
10222 * box's bounds. A negative value of @c align_h makes the box to
10223 * @b justify its children. The padding between them, in this case, is
10224 * corrected so that the leftmost one touches the left border and the
10225 * rightmost one touches the right border (even if they must
10226 * overlap). The @c align_v and @c padding_v properties of the box
10227 * @b don't contribute to its behaviour when this layout is chosen.
10229 * \par Child element's properties:
10230 * @c align_x does @b not influence the box's behavior. @c padding_l
10231 * and @c padding_r sum up to the container's horizontal padding
10232 * between elements. The child's @c padding_t, @c padding_b and
10233 * @c align_y properties apply for padding/alignment relative to the
10234 * overall height of the box. Finally, there is the @c weight_x
10235 * property, which, if set to a non-zero value, tells the container
10236 * that the child width is @b not pre-defined. If the container can't
10237 * accommodate all its children, it sets the widths of the ones
10238 * <b>with weights</b> to sizes as small as they can all fit into
10239 * it. If the size required by the children is less than the
10240 * available, the box increases its childrens' (which have weights)
10241 * widths as to fit the remaining space. The @c weight_x property,
10242 * besides telling the element is resizable, gives a @b weight for the
10243 * resizing process. The parent box will try to distribute (or take
10244 * off) widths accordingly to the @b normalized list of weigths: most
10245 * weighted children remain/get larger in this process than the least
10246 * ones. @c weight_y does not influence the layout.
10248 * If one desires that, besides having weights, child elements must be
10249 * resized bounded to a minimum or maximum size, those size hints must
10250 * be set, by the <c>evas_object_size_hint_{min,max}_set()</c>
10253 EAPI void evas_object_box_layout_horizontal (Evas_Object *o, Evas_Object_Box_Data *priv, void *data) EINA_ARG_NONNULL(1, 2);
10256 * Layout function which sets the box @a o to a (basic) vertical box
10258 * This function behaves analogously to
10259 * evas_object_box_layout_horizontal(). The description of its
10260 * behaviour can be derived from that function's documentation.
10262 EAPI void evas_object_box_layout_vertical (Evas_Object *o, Evas_Object_Box_Data *priv, void *data) EINA_ARG_NONNULL(1, 2);
10265 * Layout function which sets the box @a o to a @b homogeneous
10268 * This function behaves analogously to
10269 * evas_object_box_layout_homogeneous_horizontal(). The description
10270 * of its behaviour can be derived from that function's documentation.
10272 EAPI void evas_object_box_layout_homogeneous_vertical (Evas_Object *o, Evas_Object_Box_Data *priv, void *data) EINA_ARG_NONNULL(1, 2);
10275 * Layout function which sets the box @a o to a @b homogeneous
10278 * @param o The box object in question
10279 * @param priv The smart data of the @p o
10280 * @param data The data pointer passed on
10281 * evas_object_box_layout_set(), if any
10283 * In a homogeneous horizontal box, its width is divided @b equally
10284 * between the contained objects. The box's overall behavior is
10285 * controlled by its padding/alignment properties, which are set by
10286 * the <c>evas_object_box_{h,v}_{align,padding}_set()</c> family of
10287 * functions. The size hints the elements in the box -- set by the
10288 * <c>evas_object_size_hint_{align,padding,weight}_set()</c> functions
10289 * -- also control the way this function works.
10291 * \par Box's properties:
10292 * @c align_h has no influence on the box for this layout.
10293 * @c padding_h tells the box to draw empty spaces of that size, in
10294 * pixels, between the (equal) child objects's cells. The @c align_v
10295 * and @c padding_v properties of the box don't contribute to its
10296 * behaviour when this layout is chosen.
10298 * \par Child element's properties:
10299 * @c padding_l and @c padding_r sum up to the required width of the
10300 * child element. The @c align_x property tells the relative position
10301 * of this overall child width in its allocated cell (@r 0.0 to
10302 * extreme left, @c 1.0 to extreme right). A value of @c -1.0 to
10303 * @c align_x makes the box try to resize this child element to the exact
10304 * width of its cell (respecting the minimum and maximum size hints on
10305 * the child's width and accounting for its horizontal padding
10306 * hints). The child's @c padding_t, @c padding_b and @c align_y
10307 * properties apply for padding/alignment relative to the overall
10308 * height of the box. A value of @c -1.0 to @c align_y makes the box
10309 * try to resize this child element to the exact height of its parent
10310 * (respecting the maximum size hint on the child's height).
10312 EAPI void evas_object_box_layout_homogeneous_horizontal (Evas_Object *o, Evas_Object_Box_Data *priv, void *data) EINA_ARG_NONNULL(1, 2);
10315 * Layout function which sets the box @a o to a <b>maximum size,
10316 * homogeneous</b> horizontal box
10318 * @param o The box object in question
10319 * @param priv The smart data of the @p o
10320 * @param data The data pointer passed on
10321 * evas_object_box_layout_set(), if any
10323 * In a maximum size, homogeneous horizontal box, besides having cells
10324 * of <b>equal size</b> reserved for the child objects, this size will
10325 * be defined by the size of the @b largest child in the box (in
10326 * width). The box's overall behavior is controlled by its properties,
10327 * which are set by the
10328 * <c>evas_object_box_{h,v}_{align,padding}_set()</c> family of
10329 * functions. The size hints of the elements in the box -- set by the
10330 * <c>evas_object_size_hint_{align,padding,weight}_set()</c> functions
10331 * -- also control the way this function works.
10333 * \par Box's properties:
10334 * @c padding_h tells the box to draw empty spaces of that size, in
10335 * pixels, between the child objects's cells. @c align_h controls the
10336 * horizontal alignment of the child objects, relative to the
10337 * containing box. When set to @c 0.0, children are aligned to the
10338 * left. A value of @c 1.0 lets them aligned to the right
10339 * border. Values in between align them proportionally. A negative
10340 * value of @c align_h makes the box to @b justify its children
10341 * cells. The padding between them, in this case, is corrected so that
10342 * the leftmost one touches the left border and the rightmost one
10343 * touches the right border (even if they must overlap). The
10344 * @c align_v and @c padding_v properties of the box don't contribute to
10345 * its behaviour when this layout is chosen.
10347 * \par Child element's properties:
10348 * @c padding_l and @c padding_r sum up to the required width of the
10349 * child element. The @c align_x property tells the relative position
10350 * of this overall child width in its allocated cell (@c 0.0 to
10351 * extreme left, @c 1.0 to extreme right). A value of @c -1.0 to
10352 * @c align_x makes the box try to resize this child element to the exact
10353 * width of its cell (respecting the minimun and maximum size hints on
10354 * the child's width and accounting for its horizontal padding
10355 * hints). The child's @c padding_t, @c padding_b and @c align_y
10356 * properties apply for padding/alignment relative to the overall
10357 * height of the box. A value of @c -1.0 to @c align_y makes the box
10358 * try to resize this child element to the exact height of its parent
10359 * (respecting the max hint on the child's height).
10361 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);
10364 * Layout function which sets the box @a o to a <b>maximum size,
10365 * homogeneous</b> vertical box
10367 * This function behaves analogously to
10368 * evas_object_box_layout_homogeneous_max_size_horizontal(). The
10369 * description of its behaviour can be derived from that function's
10372 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);
10375 * Layout function which sets the box @a o to a @b flow horizontal
10378 * @param o The box object in question
10379 * @param priv The smart data of the @p o
10380 * @param data The data pointer passed on
10381 * evas_object_box_layout_set(), if any
10383 * In a flow horizontal box, the box's child elements are placed in
10384 * @b rows (think of text as an analogy). A row has as much elements as
10385 * can fit into the box's width. The box's overall behavior is
10386 * controlled by its properties, which are set by the
10387 * <c>evas_object_box_{h,v}_{align,padding}_set()</c> family of
10388 * functions. The size hints of the elements in the box -- set by the
10389 * <c>evas_object_size_hint_{align,padding,weight}_set()</c> functions
10390 * -- also control the way this function works.
10392 * \par Box's properties:
10393 * @c padding_h tells the box to draw empty spaces of that size, in
10394 * pixels, between the child objects's cells. @c align_h dictates the
10395 * horizontal alignment of the rows (@c 0.0 to left align them, @c 1.0
10396 * to right align). A value of @c -1.0 to @c align_h lets the rows
10397 * @b justified horizontally. @c align_v controls the vertical alignment
10398 * of the entire set of rows (@c 0.0 to top, @c 1.0 to bottom). A
10399 * value of @c -1.0 to @c align_v makes the box to @b justify the rows
10400 * vertically. The padding between them, in this case, is corrected so
10401 * that the first row touches the top border and the last one touches
10402 * the bottom border (even if they must overlap). @c padding_v has no
10403 * influence on the layout.
10405 * \par Child element's properties:
10406 * @c padding_l and @c padding_r sum up to the required width of the
10407 * child element. The @c align_x property has no influence on the
10408 * layout. The child's @c padding_t and @c padding_b sum up to the
10409 * required height of the child element and is the only means (besides
10410 * row justifying) of setting space between rows. Note, however, that
10411 * @c align_y dictates positioning relative to the <b>largest
10412 * height</b> required by a child object in the actual row.
10414 EAPI void evas_object_box_layout_flow_horizontal (Evas_Object *o, Evas_Object_Box_Data *priv, void *data) EINA_ARG_NONNULL(1, 2);
10417 * Layout function which sets the box @a o to a @b flow vertical box.
10419 * This function behaves analogously to
10420 * evas_object_box_layout_flow_horizontal(). The description of its
10421 * behaviour can be derived from that function's documentation.
10423 EAPI void evas_object_box_layout_flow_vertical (Evas_Object *o, Evas_Object_Box_Data *priv, void *data) EINA_ARG_NONNULL(1, 2);
10426 * Layout function which sets the box @a o to a @b stacking box
10428 * @param o The box object in question
10429 * @param priv The smart data of the @p o
10430 * @param data The data pointer passed on
10431 * evas_object_box_layout_set(), if any
10433 * In a stacking box, all children will be given the same size -- the
10434 * box's own size -- and they will be stacked one above the other, so
10435 * that the first object in @p o's internal list of child elements
10436 * will be the bottommost in the stack.
10438 * \par Box's properties:
10439 * No box properties are used.
10441 * \par Child element's properties:
10442 * @c padding_l and @c padding_r sum up to the required width of the
10443 * child element. The @c align_x property tells the relative position
10444 * of this overall child width in its allocated cell (@c 0.0 to
10445 * extreme left, @c 1.0 to extreme right). A value of @c -1.0 to @c
10446 * align_x makes the box try to resize this child element to the exact
10447 * width of its cell (respecting the min and max hints on the child's
10448 * width and accounting for its horizontal padding properties). The
10449 * same applies to the vertical axis.
10451 EAPI void evas_object_box_layout_stack (Evas_Object *o, Evas_Object_Box_Data *priv, void *data) EINA_ARG_NONNULL(1, 2);
10454 * Set the alignment of the whole bounding box of contents, for a
10455 * given box object.
10457 * @param o The given box object to set alignment from
10458 * @param horizontal The horizontal alignment, in pixels
10459 * @param vertical the vertical alignment, in pixels
10461 * This will influence how a box object is to align its bounding box
10462 * of contents within its own area. The values @b must be in the range
10463 * @c 0.0 - @c 1.0, or undefined behavior is expected. For horizontal
10464 * alignment, @c 0.0 means to the left, with @c 1.0 meaning to the
10465 * right. For vertical alignment, @c 0.0 means to the top, with @c 1.0
10466 * meaning to the bottom.
10468 * @note The default values for both alignments is @c 0.5.
10470 * @see evas_object_box_align_get()
10472 EAPI void evas_object_box_align_set (Evas_Object *o, double horizontal, double vertical) EINA_ARG_NONNULL(1);
10475 * Get the alignment of the whole bounding box of contents, for a
10476 * given box object.
10478 * @param o The given box object to get alignment from
10479 * @param horizontal Pointer to a variable where to store the
10480 * horizontal alignment
10481 * @param vertical Pointer to a variable where to store the vertical
10484 * @see evas_object_box_align_set() for more information
10486 EAPI void evas_object_box_align_get (const Evas_Object *o, double *horizontal, double *vertical) EINA_ARG_NONNULL(1);
10489 * Set the (space) padding between cells set for a given box object.
10491 * @param o The given box object to set padding from
10492 * @param horizontal The horizontal padding, in pixels
10493 * @param vertical the vertical padding, in pixels
10495 * @note The default values for both padding components is @c 0.
10497 * @see evas_object_box_padding_get()
10499 EAPI void evas_object_box_padding_set (Evas_Object *o, Evas_Coord horizontal, Evas_Coord vertical) EINA_ARG_NONNULL(1);
10502 * Get the (space) padding between cells set for a given box object.
10504 * @param o The given box object to get padding from
10505 * @param horizontal Pointer to a variable where to store the
10506 * horizontal padding
10507 * @param vertical Pointer to a variable where to store the vertical
10510 * @see evas_object_box_padding_set()
10512 EAPI void evas_object_box_padding_get (const Evas_Object *o, Evas_Coord *horizontal, Evas_Coord *vertical) EINA_ARG_NONNULL(1);
10515 * Append a new @a child object to the given box object @a o.
10517 * @param o The given box object
10518 * @param child A child Evas object to be made a member of @p o
10519 * @return A box option bound to the recently added box item or @c
10522 * On success, the @c "child,added" smart event will take place.
10524 * @note The actual placing of the item relative to @p o's area will
10525 * depend on the layout set to it. For example, on horizontal layouts
10526 * an item in the end of the box's list of children will appear on its
10529 * @note This call will trigger the box's _Evas_Object_Box_Api::append
10532 EAPI Evas_Object_Box_Option *evas_object_box_append (Evas_Object *o, Evas_Object *child) EINA_ARG_NONNULL(1, 2);
10535 * Prepend a new @a child object to the given box object @a o.
10537 * @param o The given box object
10538 * @param child A child Evas object to be made a member of @p o
10539 * @return A box option bound to the recently added box item or @c
10542 * On success, the @c "child,added" smart event will take place.
10544 * @note The actual placing of the item relative to @p o's area will
10545 * depend on the layout set to it. For example, on horizontal layouts
10546 * an item in the beginning of the box's list of children will appear
10549 * @note This call will trigger the box's
10550 * _Evas_Object_Box_Api::prepend smart function.
10552 EAPI Evas_Object_Box_Option *evas_object_box_prepend (Evas_Object *o, Evas_Object *child) EINA_ARG_NONNULL(1, 2);
10555 * Insert a new @a child object <b>before another existing one</b>, in
10556 * a given box object @a o.
10558 * @param o The given box object
10559 * @param child A child Evas object to be made a member of @p o
10560 * @param reference The child object to place this new one before
10561 * @return A box option bound to the recently added box item or @c
10564 * On success, the @c "child,added" smart event will take place.
10566 * @note This function will fail if @p reference is not a member of @p
10569 * @note The actual placing of the item relative to @p o's area will
10570 * depend on the layout set to it.
10572 * @note This call will trigger the box's
10573 * _Evas_Object_Box_Api::insert_before smart function.
10575 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);
10578 * Insert a new @a child object <b>after another existing one</b>, in
10579 * a given box object @a o.
10581 * @param o The given box object
10582 * @param child A child Evas object to be made a member of @p o
10583 * @param reference The child object to place this new one after
10584 * @return A box option bound to the recently added box item or @c
10587 * On success, the @c "child,added" smart event will take place.
10589 * @note This function will fail if @p reference is not a member of @p
10592 * @note The actual placing of the item relative to @p o's area will
10593 * depend on the layout set to it.
10595 * @note This call will trigger the box's
10596 * _Evas_Object_Box_Api::insert_after smart function.
10598 EAPI Evas_Object_Box_Option *evas_object_box_insert_after (Evas_Object *o, Evas_Object *child, const Evas_Object *referente) EINA_ARG_NONNULL(1, 2, 3);
10601 * Insert a new @a child object <b>at a given position</b>, in a given
10604 * @param o The given box object
10605 * @param child A child Evas object to be made a member of @p o
10606 * @param pos The numeric position (starting from @c 0) to place the
10607 * new child object at
10608 * @return A box option bound to the recently added box item or @c
10611 * On success, the @c "child,added" smart event will take place.
10613 * @note This function will fail if the given position is invalid,
10614 * given @p o's internal list of elements.
10616 * @note The actual placing of the item relative to @p o's area will
10617 * depend on the layout set to it.
10619 * @note This call will trigger the box's
10620 * _Evas_Object_Box_Api::insert_at smart function.
10622 EAPI Evas_Object_Box_Option *evas_object_box_insert_at (Evas_Object *o, Evas_Object *child, unsigned int pos) EINA_ARG_NONNULL(1, 2);
10625 * Remove a given object from a box object, unparenting it again.
10627 * @param o The box object to remove a child object from
10628 * @param child The handle to the child object to be removed
10629 * @return @c EINA_TRUE, on success, @c EINA_FALSE otherwise
10631 * On removal, you'll get an unparented object again, just as it was
10632 * before you inserted it in the box. The
10633 * _Evas_Object_Box_Api::option_free box smart callback will be called
10634 * automatilly for you and, also, the @c "child,removed" smart event
10637 * @note This call will trigger the box's _Evas_Object_Box_Api::remove
10640 EAPI Eina_Bool evas_object_box_remove (Evas_Object *o, Evas_Object *child) EINA_ARG_NONNULL(1, 2);
10643 * Remove an object, <b>bound to a given position</b> in a box object,
10644 * unparenting it again.
10646 * @param o The box object to remove a child object from
10647 * @param in The numeric position (starting from @c 0) of the child
10648 * object to be removed
10649 * @return @c EINA_TRUE, on success, @c EINA_FALSE otherwise
10651 * On removal, you'll get an unparented object again, just as it was
10652 * before you inserted it in the box. The @c option_free() box smart
10653 * callback will be called automatilly for you and, also, the
10654 * @c "child,removed" smart event will take place.
10656 * @note This function will fail if the given position is invalid,
10657 * given @p o's internal list of elements.
10659 * @note This call will trigger the box's
10660 * _Evas_Object_Box_Api::remove_at smart function.
10662 EAPI Eina_Bool evas_object_box_remove_at (Evas_Object *o, unsigned int pos) EINA_ARG_NONNULL(1);
10665 * Remove @b all child objects from a box object, unparenting them
10668 * @param o The box object to remove a child object from
10669 * @param child The handle to the child object to be removed
10670 * @return @c EINA_TRUE, on success, @c EINA_FALSE otherwise
10672 * This has the same effect of calling evas_object_box_remove() on
10673 * each of @p o's child objects, in sequence. If, and only if, all
10674 * those calls succeed, so does this one.
10676 EAPI Eina_Bool evas_object_box_remove_all (Evas_Object *o, Eina_Bool clear) EINA_ARG_NONNULL(1);
10679 * Get an iterator to walk the list of children of a given box object.
10681 * @param o The box to retrieve an items iterator from
10682 * @return An iterator on @p o's child objects, on success, or @c NULL,
10685 * @note Do @b not remove or delete objects while walking the list.
10687 EAPI Eina_Iterator *evas_object_box_iterator_new (const Evas_Object *o) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
10690 * Get an accessor (a structure providing random items access) to the
10691 * list of children of a given box object.
10693 * @param o The box to retrieve an items iterator from
10694 * @return An accessor on @p o's child objects, on success, or @c NULL,
10697 * @note Do not remove or delete objects while walking the list.
10699 EAPI Eina_Accessor *evas_object_box_accessor_new (const Evas_Object *o) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
10702 * Get the list of children objects in a given box object.
10704 * @param o The box to retrieve an items list from
10705 * @return A list of @p o's child objects, on success, or @c NULL,
10706 * on errors (or if it has no child objects)
10708 * The returned list should be freed with @c eina_list_free() when you
10709 * no longer need it.
10711 * @note This is a duplicate of the list kept by the box internally.
10712 * It's up to the user to destroy it when it no longer needs it.
10713 * It's possible to remove objects from the box when walking
10714 * this list, but these removals won't be reflected on it.
10716 EAPI Eina_List *evas_object_box_children_get (const Evas_Object *o) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
10719 * Get the name of the property of the child elements of the box @a o
10720 * which have @a id as identifier
10722 * @param o The box to search child options from
10723 * @param id The numerical identifier of the option being searched, for
10725 * @return The name of the given property or @c NULL, on errors.
10727 * @note This call won't do anything for a canonical Evas box. Only
10728 * users which have @b subclassed it, setting custom box items options
10729 * (see #Evas_Object_Box_Option) on it, would benefit from this
10730 * function. They'd have to implement it and set it to be the
10731 * _Evas_Object_Box_Api::property_name_get smart class function of the
10732 * box, which is originally set to @c NULL.
10734 EAPI const char *evas_object_box_option_property_name_get (Evas_Object *o, int property) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
10737 * Get the numerical identifier of the property of the child elements
10738 * of the box @a o which have @a name as name string
10740 * @param o The box to search child options from
10741 * @param name The name string of the option being searched, for
10743 * @return The numerical ID of the given property or @c -1, on
10746 * @note This call won't do anything for a canonical Evas box. Only
10747 * users which have @b subclassed it, setting custom box items options
10748 * (see #Evas_Object_Box_Option) on it, would benefit from this
10749 * function. They'd have to implement it and set it to be the
10750 * _Evas_Object_Box_Api::property_id_get smart class function of the
10751 * box, which is originally set to @c NULL.
10753 EAPI int evas_object_box_option_property_id_get (Evas_Object *o, const char *name) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2) EINA_PURE;
10756 * Set a property value (by its given numerical identifier), on a
10757 * given box child element
10759 * @param o The box parenting the child element
10760 * @param opt The box option structure bound to the child box element
10761 * to set a property on
10762 * @param id The numerical ID of the given property
10763 * @param ... (List of) actual value(s) to be set for this
10764 * property. It (they) @b must be of the same type the user has
10765 * defined for it (them).
10766 * @return @c EINA_TRUE on success, @c EINA_FALSE on failure.
10768 * @note This call won't do anything for a canonical Evas box. Only
10769 * users which have @b subclassed it, setting custom box items options
10770 * (see #Evas_Object_Box_Option) on it, would benefit from this
10771 * function. They'd have to implement it and set it to be the
10772 * _Evas_Object_Box_Api::property_set smart class function of the box,
10773 * which is originally set to @c NULL.
10775 * @note This function will internally create a variable argument
10776 * list, with the values passed after @p property, and call
10777 * evas_object_box_option_property_vset() with this list and the same
10778 * previous arguments.
10780 EAPI Eina_Bool evas_object_box_option_property_set (Evas_Object *o, Evas_Object_Box_Option *opt, int property, ...) EINA_ARG_NONNULL(1, 2);
10783 * Set a property value (by its given numerical identifier), on a
10784 * given box child element -- by a variable argument list
10786 * @param o The box parenting the child element
10787 * @param opt The box option structure bound to the child box element
10788 * to set a property on
10789 * @param id The numerical ID of the given property
10790 * @param va_list The variable argument list implementing the value to
10791 * be set for this property. It @b must be of the same type the user has
10793 * @return @c EINA_TRUE on success, @c EINA_FALSE on failure.
10795 * This is a variable argument list variant of the
10796 * evas_object_box_option_property_set(). See its documentation for
10799 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);
10802 * Get a property's value (by its given numerical identifier), on a
10803 * given box child element
10805 * @param o The box parenting the child element
10806 * @param opt The box option structure bound to the child box element
10807 * to get a property from
10808 * @param id The numerical ID of the given property
10809 * @param ... (List of) pointer(s) where to store the value(s) set for
10810 * this property. It (they) @b must point to variable(s) of the same
10811 * type the user has defined for it (them).
10812 * @return @c EINA_TRUE on success, @c EINA_FALSE on failure.
10814 * @note This call won't do anything for a canonical Evas box. Only
10815 * users which have @b subclassed it, getting custom box items options
10816 * (see #Evas_Object_Box_Option) on it, would benefit from this
10817 * function. They'd have to implement it and get it to be the
10818 * _Evas_Object_Box_Api::property_get smart class function of the
10819 * box, which is originally get to @c NULL.
10821 * @note This function will internally create a variable argument
10822 * list, with the values passed after @p property, and call
10823 * evas_object_box_option_property_vget() with this list and the same
10824 * previous arguments.
10826 EAPI Eina_Bool evas_object_box_option_property_get (Evas_Object *o, Evas_Object_Box_Option *opt, int property, ...) EINA_ARG_NONNULL(1, 2);
10829 * Get a property's value (by its given numerical identifier), on a
10830 * given box child element -- by a variable argument list
10832 * @param o The box parenting the child element
10833 * @param opt The box option structure bound to the child box element
10834 * to get a property from
10835 * @param id The numerical ID of the given property
10836 * @param va_list The variable argument list with pointers to where to
10837 * store the values of this property. They @b must point to variables
10838 * of the same type the user has defined for them.
10839 * @return @c EINA_TRUE on success, @c EINA_FALSE on failure.
10841 * This is a variable argument list variant of the
10842 * evas_object_box_option_property_get(). See its documentation for
10845 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);
10852 * @defgroup Evas_Object_Table Table Smart Object.
10854 * Convenience smart object that packs children using a tabular
10855 * layout using children size hints to define their size and
10856 * alignment inside their cell space.
10858 * @ref tutorial_table shows how to use this Evas_Object.
10860 * @see @ref Evas_Object_Group_Size_Hints
10862 * @ingroup Evas_Smart_Object_Group
10868 * @brief Create a new table.
10870 * @param evas Canvas in which table will be added.
10872 EAPI Evas_Object *evas_object_table_add (Evas *evas) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
10875 * @brief Create a table that is child of a given element @a parent.
10877 * @see evas_object_table_add()
10879 EAPI Evas_Object *evas_object_table_add_to (Evas_Object *parent) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
10882 * @brief Set how this table should layout children.
10884 * @todo consider aspect hint and respect it.
10886 * @par EVAS_OBJECT_TABLE_HOMOGENEOUS_NONE
10887 * If table does not use homogeneous mode then columns and rows will
10888 * be calculated based on hints of individual cells. This operation
10889 * mode is more flexible, but more complex and heavy to calculate as
10890 * well. @b Weight properties are handled as a boolean expand. Negative
10891 * alignment will be considered as 0.5. This is the default.
10893 * @todo @c EVAS_OBJECT_TABLE_HOMOGENEOUS_NONE should balance weight.
10895 * @par EVAS_OBJECT_TABLE_HOMOGENEOUS_TABLE
10896 * When homogeneous is relative to table the own table size is divided
10897 * equally among children, filling the whole table area. That is, if
10898 * table has @c WIDTH and @c COLUMNS, each cell will get <tt>WIDTH /
10899 * COLUMNS</tt> pixels. If children have minimum size that is larger
10900 * than this amount (including padding), then it will overflow and be
10901 * aligned respecting the alignment hint, possible overlapping sibling
10902 * cells. @b Weight hint is used as a boolean, if greater than zero it
10903 * will make the child expand in that axis, taking as much space as
10904 * possible (bounded to maximum size hint). Negative alignment will be
10905 * considered as 0.5.
10907 * @par EVAS_OBJECT_TABLE_HOMOGENEOUS_ITEM
10908 * When homogeneous is relative to item it means the greatest minimum
10909 * cell size will be used. That is, if no element is set to expand,
10910 * the table will have its contents to a minimum size, the bounding
10911 * box of all these children will be aligned relatively to the table
10912 * object using evas_object_table_align_get(). If the table area is
10913 * too small to hold this minimum bounding box, then the objects will
10914 * keep their size and the bounding box will overflow the box area,
10915 * still respecting the alignment. @b Weight hint is used as a
10916 * boolean, if greater than zero it will make that cell expand in that
10917 * axis, toggling the <b>expand mode</b>, which makes the table behave
10918 * much like @b EVAS_OBJECT_TABLE_HOMOGENEOUS_TABLE, except that the
10919 * bounding box will overflow and items will not overlap siblings. If
10920 * no minimum size is provided at all then the table will fallback to
10921 * expand mode as well.
10923 EAPI void evas_object_table_homogeneous_set (Evas_Object *o, Evas_Object_Table_Homogeneous_Mode homogeneous) EINA_ARG_NONNULL(1);
10926 * Get the current layout homogeneous mode.
10928 * @see evas_object_table_homogeneous_set()
10930 EAPI Evas_Object_Table_Homogeneous_Mode evas_object_table_homogeneous_get (const Evas_Object *o) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
10933 * Set padding between cells.
10935 EAPI void evas_object_table_padding_set (Evas_Object *o, Evas_Coord horizontal, Evas_Coord vertical) EINA_ARG_NONNULL(1);
10938 * Get padding between cells.
10940 EAPI void evas_object_table_padding_get (const Evas_Object *o, Evas_Coord *horizontal, Evas_Coord *vertical) EINA_ARG_NONNULL(1);
10943 * Set the alignment of the whole bounding box of contents.
10945 EAPI void evas_object_table_align_set (Evas_Object *o, double horizontal, double vertical) EINA_ARG_NONNULL(1);
10948 * Get alignment of the whole bounding box of contents.
10950 EAPI void evas_object_table_align_get (const Evas_Object *o, double *horizontal, double *vertical) EINA_ARG_NONNULL(1);
10953 * Sets the mirrored mode of the table. In mirrored mode the table items go
10954 * from right to left instead of left to right. That is, 1,1 is top right, not
10957 * @param obj The table object.
10958 * @param mirrored the mirrored mode to set
10961 EAPI void evas_object_table_mirrored_set (Evas_Object *o, Eina_Bool mirrored) EINA_ARG_NONNULL(1);
10964 * Gets the mirrored mode of the table.
10966 * @param obj The table object.
10967 * @return EINA_TRUE if it's a mirrored table, EINA_FALSE otherwise.
10969 * @see evas_object_table_mirrored_set()
10971 EAPI Eina_Bool evas_object_table_mirrored_get (const Evas_Object *o) EINA_ARG_NONNULL(1);
10974 * Get packing location of a child of table
10976 * @param o The given table object.
10977 * @param child The child object to add.
10978 * @param col pointer to store relative-horizontal position to place child.
10979 * @param row pointer to store relative-vertical position to place child.
10980 * @param colspan pointer to store how many relative-horizontal position to use for this child.
10981 * @param rowspan pointer to store how many relative-vertical position to use for this child.
10983 * @return 1 on success, 0 on failure.
10986 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);
10989 * Add a new child to a table object or set its current packing.
10991 * @param o The given table object.
10992 * @param child The child object to add.
10993 * @param col relative-horizontal position to place child.
10994 * @param row relative-vertical position to place child.
10995 * @param colspan how many relative-horizontal position to use for this child.
10996 * @param rowspan how many relative-vertical position to use for this child.
10998 * @return 1 on success, 0 on failure.
11000 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);
11003 * Remove child from table.
11005 * @note removing a child will immediately call a walk over children in order
11006 * to recalculate numbers of columns and rows. If you plan to remove
11007 * all children, use evas_object_table_clear() instead.
11009 * @return 1 on success, 0 on failure.
11011 EAPI Eina_Bool evas_object_table_unpack (Evas_Object *o, Evas_Object *child) EINA_ARG_NONNULL(1, 2);
11014 * Faster way to remove all child objects from a table object.
11016 * @param o The given table object.
11017 * @param clear if true, it will delete just removed children.
11019 EAPI void evas_object_table_clear (Evas_Object *o, Eina_Bool clear) EINA_ARG_NONNULL(1);
11022 * Get the number of columns and rows this table takes.
11024 * @note columns and rows are virtual entities, one can specify a table
11025 * with a single object that takes 4 columns and 5 rows. The only
11026 * difference for a single cell table is that paddings will be
11027 * accounted proportionally.
11029 EAPI void evas_object_table_col_row_size_get(const Evas_Object *o, int *cols, int *rows) EINA_ARG_NONNULL(1);
11032 * Get an iterator to walk the list of children for the table.
11034 * @note Do not remove or delete objects while walking the list.
11036 EAPI Eina_Iterator *evas_object_table_iterator_new (const Evas_Object *o) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
11039 * Get an accessor to get random access to the list of children for the table.
11041 * @note Do not remove or delete objects while walking the list.
11043 EAPI Eina_Accessor *evas_object_table_accessor_new (const Evas_Object *o) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
11046 * Get the list of children for the table.
11048 * @note This is a duplicate of the list kept by the table internally.
11049 * It's up to the user to destroy it when it no longer needs it.
11050 * It's possible to remove objects from the table when walking this
11051 * list, but these removals won't be reflected on it.
11053 EAPI Eina_List *evas_object_table_children_get (const Evas_Object *o) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
11056 * Get the child of the table at the given coordinates
11058 * @note This does not take into account col/row spanning
11060 EAPI Evas_Object *evas_object_table_child_get (const Evas_Object *o, unsigned short col, unsigned short row) EINA_ARG_NONNULL(1);
11066 * @defgroup Evas_Object_Grid Grid Smart Object.
11068 * Convenience smart object that packs children under a regular grid
11069 * layout, using their virtual grid location and size to determine
11070 * children's positions inside the grid object's area.
11072 * @ingroup Evas_Smart_Object_Group
11077 * @addtogroup Evas_Object_Grid
11082 * Create a new grid.
11084 * It's set to a virtual size of 1x1 by default and add children with
11085 * evas_object_grid_pack().
11088 EAPI Evas_Object *evas_object_grid_add (Evas *evas) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
11091 * Create a grid that is child of a given element @a parent.
11093 * @see evas_object_grid_add()
11096 EAPI Evas_Object *evas_object_grid_add_to (Evas_Object *parent) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
11099 * Set the virtual resolution for the grid
11101 * @param o The grid object to modify
11102 * @param w The virtual horizontal size (resolution) in integer units
11103 * @param h The virtual vertical size (resolution) in integer units
11106 EAPI void evas_object_grid_size_set (Evas_Object *o, int w, int h) EINA_ARG_NONNULL(1);
11109 * Get the current virtual resolution
11111 * @param o The grid object to query
11112 * @param w A pointer to an integer to store the virtual width
11113 * @param h A pointer to an integer to store the virtual height
11114 * @see evas_object_grid_size_set()
11117 EAPI void evas_object_grid_size_get (const Evas_Object *o, int *w, int *h) EINA_ARG_NONNULL(1) EINA_PURE;
11120 * Sets the mirrored mode of the grid. In mirrored mode the grid items go
11121 * from right to left instead of left to right. That is, 0,0 is top right, not
11124 * @param obj The grid object.
11125 * @param mirrored the mirrored mode to set
11128 EAPI void evas_object_grid_mirrored_set (Evas_Object *o, Eina_Bool mirrored) EINA_ARG_NONNULL(1);
11131 * Gets the mirrored mode of the grid.
11133 * @param obj The grid object.
11134 * @return EINA_TRUE if it's a mirrored grid, EINA_FALSE otherwise.
11135 * @see evas_object_grid_mirrored_set()
11138 EAPI Eina_Bool evas_object_grid_mirrored_get (const Evas_Object *o) EINA_ARG_NONNULL(1);
11141 * Add a new child to a grid object.
11143 * @param o The given grid object.
11144 * @param child The child object to add.
11145 * @param x The virtual x coordinate of the child
11146 * @param y The virtual y coordinate of the child
11147 * @param w The virtual width of the child
11148 * @param h The virtual height of the child
11149 * @return 1 on success, 0 on failure.
11152 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);
11155 * Remove child from grid.
11157 * @note removing a child will immediately call a walk over children in order
11158 * to recalculate numbers of columns and rows. If you plan to remove
11159 * all children, use evas_object_grid_clear() instead.
11161 * @return 1 on success, 0 on failure.
11164 EAPI Eina_Bool evas_object_grid_unpack (Evas_Object *o, Evas_Object *child) EINA_ARG_NONNULL(1, 2);
11167 * Faster way to remove all child objects from a grid object.
11169 * @param o The given grid object.
11170 * @param clear if true, it will delete just removed children.
11173 EAPI void evas_object_grid_clear (Evas_Object *o, Eina_Bool clear) EINA_ARG_NONNULL(1);
11176 * Get the pack options for a grid child
11178 * Get the pack x, y, width and height in virtual coordinates set by
11179 * evas_object_grid_pack()
11180 * @param o The grid object
11181 * @param child The grid child to query for coordinates
11182 * @param x The pointer to where the x coordinate will be returned
11183 * @param y The pointer to where the y coordinate will be returned
11184 * @param w The pointer to where the width will be returned
11185 * @param h The pointer to where the height will be returned
11186 * @return 1 on success, 0 on failure.
11189 EAPI Eina_Bool evas_object_grid_pack_get (Evas_Object *o, Evas_Object *child, int *x, int *y, int *w, int *h);
11192 * Get an iterator to walk the list of children for the grid.
11194 * @note Do not remove or delete objects while walking the list.
11197 EAPI Eina_Iterator *evas_object_grid_iterator_new (const Evas_Object *o) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
11200 * Get an accessor to get random access to the list of children for the grid.
11202 * @note Do not remove or delete objects while walking the list.
11205 EAPI Eina_Accessor *evas_object_grid_accessor_new (const Evas_Object *o) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
11208 * Get the list of children for the grid.
11210 * @note This is a duplicate of the list kept by the grid internally.
11211 * It's up to the user to destroy it when it no longer needs it.
11212 * It's possible to remove objects from the grid when walking this
11213 * list, but these removals won't be reflected on it.
11216 EAPI Eina_List *evas_object_grid_children_get (const Evas_Object *o) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
11223 * @defgroup Evas_Cserve Shared Image Cache Server
11225 * Evas has an (optional) module which provides client-server
11226 * infrastructure to <b>share bitmaps across multiple processes</b>,
11227 * saving data and processing power.
11229 * Be warned that it @b doesn't work when <b>threaded image
11230 * preloading</b> is enabled for Evas, though.
11232 typedef struct _Evas_Cserve_Stats Evas_Cserve_Stats;
11233 typedef struct _Evas_Cserve_Image_Cache Evas_Cserve_Image_Cache;
11234 typedef struct _Evas_Cserve_Image Evas_Cserve_Image;
11235 typedef struct _Evas_Cserve_Config Evas_Cserve_Config;
11238 * Statistics about the server that shares cached bitmaps.
11239 * @ingroup Evas_Cserve
11241 struct _Evas_Cserve_Stats
11243 int saved_memory; /**< current amount of saved memory, in bytes */
11244 int wasted_memory; /**< current amount of wasted memory, in bytes */
11245 int saved_memory_peak; /**< peak ammount of saved memory, in bytes */
11246 int wasted_memory_peak; /**< peak ammount of wasted memory, in bytes */
11247 double saved_time_image_header_load; /**< time, in seconds, saved in header loads by sharing cached loads instead */
11248 double saved_time_image_data_load; /**< time, in seconds, saved in data loads by sharing cached loads instead */
11252 * A handle of a cache of images shared by a server.
11253 * @ingroup Evas_Cserve
11255 struct _Evas_Cserve_Image_Cache
11265 * A handle to an image shared by a server.
11266 * @ingroup Evas_Cserve
11268 struct _Evas_Cserve_Image
11270 const char *file, *key;
11272 time_t file_mod_time;
11273 time_t file_checked_time;
11274 time_t cached_time;
11277 int memory_footprint;
11278 double head_load_time;
11279 double data_load_time;
11280 Eina_Bool alpha : 1;
11281 Eina_Bool data_loaded : 1;
11282 Eina_Bool active : 1;
11283 Eina_Bool dead : 1;
11284 Eina_Bool useless : 1;
11288 * Configuration that controls the server that shares cached bitmaps.
11289 * @ingroup Evas_Cserve
11291 struct _Evas_Cserve_Config
11293 int cache_max_usage;
11294 int cache_item_timeout;
11295 int cache_item_timeout_check;
11300 * Retrieves if the system wants to share bitmaps using the server.
11301 * @return @c EINA_TRUE if it wants, @c EINA_FALSE otherwise.
11302 * @ingroup Evas_Cserve
11304 EAPI Eina_Bool evas_cserve_want_get (void) EINA_WARN_UNUSED_RESULT EINA_PURE;
11307 * Retrieves if the system is connected to the server used to share
11310 * @return @c EINA_TRUE if it's connected, @c EINA_FALSE otherwise.
11311 * @ingroup Evas_Cserve
11313 EAPI Eina_Bool evas_cserve_connected_get (void) EINA_WARN_UNUSED_RESULT;
11316 * Retrieves statistics from a running bitmap sharing server.
11317 * @param stats pointer to structure to fill with statistics about the
11318 * bitmap cache server.
11320 * @return @c EINA_TRUE if @p stats were filled with data,
11321 * @c EINA_FALSE otherwise (when @p stats is untouched)
11322 * @ingroup Evas_Cserve
11324 EAPI Eina_Bool evas_cserve_stats_get (Evas_Cserve_Stats *stats) EINA_WARN_UNUSED_RESULT;
11327 * Completely discard/clean a given images cache, thus re-setting it.
11329 * @param cache A handle to the given images cache.
11331 EAPI void evas_cserve_image_cache_contents_clean (Evas_Cserve_Image_Cache *cache) EINA_PURE;
11334 * Retrieves the current configuration of the Evas image caching
11337 * @param config where to store current image caching server's
11340 * @return @c EINA_TRUE if @p config was filled with data,
11341 * @c EINA_FALSE otherwise (when @p config is untouched)
11343 * The fields of @p config will be altered to reflect the current
11344 * configuration's values.
11346 * @see evas_cserve_config_set()
11348 * @ingroup Evas_Cserve
11350 EAPI Eina_Bool evas_cserve_config_get (Evas_Cserve_Config *config) EINA_WARN_UNUSED_RESULT EINA_PURE;
11353 * Changes the configurations of the Evas image caching server.
11355 * @param config A bitmap cache configuration handle with fields set
11356 * to desired configuration values.
11357 * @return @c EINA_TRUE if @p config was successfully applied,
11358 * @c EINA_FALSE otherwise.
11360 * @see evas_cserve_config_get()
11362 * @ingroup Evas_Cserve
11364 EAPI Eina_Bool evas_cserve_config_set (const Evas_Cserve_Config *config) EINA_WARN_UNUSED_RESULT EINA_PURE;
11367 * Force the system to disconnect from the bitmap caching server.
11369 * @ingroup Evas_Cserve
11371 EAPI void evas_cserve_disconnect (void);
11374 * @defgroup Evas_Utils General Utilities
11376 * Some functions that are handy but are not specific of canvas or
11381 * Converts the given Evas image load error code into a string
11382 * describing it in english.
11384 * @param error the error code, a value in ::Evas_Load_Error.
11385 * @return Always returns a valid string. If the given @p error is not
11386 * supported, <code>"Unknown error"</code> is returned.
11388 * Mostly evas_object_image_file_set() would be the function setting
11389 * that error value afterwards, but also evas_object_image_load(),
11390 * evas_object_image_save(), evas_object_image_data_get(),
11391 * evas_object_image_data_convert(), evas_object_image_pixels_import()
11392 * and evas_object_image_is_inside(). This function is meant to be
11393 * used in conjunction with evas_object_image_load_error_get(), as in:
11396 * @dontinclude evas-load-error-str.c
11398 * @until ecore_main_loop_begin(
11400 * Here, being @c valid_path the path to a valid image and @c
11401 * bogus_path a path to a file which does not exist, the two outputs
11402 * of evas_load_error_str() would be (if no other errors occur):
11403 * <code>"No error on load"</code> and <code>"File (or file path) does
11404 * not exist"</code>, respectively. See the full @ref
11405 * Example_Evas_Images "example".
11407 * @ingroup Evas_Utils
11409 EAPI const char *evas_load_error_str (Evas_Load_Error error);
11411 /* Evas utility routines for color space conversions */
11412 /* hsv color space has h in the range 0.0 to 360.0, and s,v in the range 0.0 to 1.0 */
11413 /* rgb color space has r,g,b in the range 0 to 255 */
11416 * Convert a given color from HSV to RGB format.
11418 * @param h The Hue component of the color.
11419 * @param s The Saturation component of the color.
11420 * @param v The Value component of the color.
11421 * @param r The Red component of the color.
11422 * @param g The Green component of the color.
11423 * @param b The Blue component of the color.
11425 * This function converts a given color in HSV color format to RGB
11428 * @ingroup Evas_Utils
11430 EAPI void evas_color_hsv_to_rgb (float h, float s, float v, int *r, int *g, int *b);
11433 * Convert a given color from RGB to HSV format.
11435 * @param r The Red component of the color.
11436 * @param g The Green component of the color.
11437 * @param b The Blue component of the color.
11438 * @param h The Hue component of the color.
11439 * @param s The Saturation component of the color.
11440 * @param v The Value component of the color.
11442 * This function converts a given color in RGB color format to HSV
11445 * @ingroup Evas_Utils
11447 EAPI void evas_color_rgb_to_hsv (int r, int g, int b, float *h, float *s, float *v);
11449 /* argb color space has a,r,g,b in the range 0 to 255 */
11452 * Pre-multiplies a rgb triplet by an alpha factor.
11454 * @param a The alpha factor.
11455 * @param r The Red component of the color.
11456 * @param g The Green component of the color.
11457 * @param b The Blue component of the color.
11459 * This function pre-multiplies a given rbg triplet by an alpha
11460 * factor. Alpha factor is used to define transparency.
11462 * @ingroup Evas_Utils
11464 EAPI void evas_color_argb_premul (int a, int *r, int *g, int *b);
11467 * Undo pre-multiplication of a rgb triplet by an alpha factor.
11469 * @param a The alpha factor.
11470 * @param r The Red component of the color.
11471 * @param g The Green component of the color.
11472 * @param b The Blue component of the color.
11474 * This function undoes pre-multiplication a given rbg triplet by an
11475 * alpha factor. Alpha factor is used to define transparency.
11477 * @see evas_color_argb_premul().
11479 * @ingroup Evas_Utils
11481 EAPI void evas_color_argb_unpremul (int a, int *r, int *g, int *b);
11485 * Pre-multiplies data by an alpha factor.
11487 * @param data The data value.
11488 * @param len The length value.
11490 * This function pre-multiplies a given data by an alpha
11491 * factor. Alpha factor is used to define transparency.
11493 * @ingroup Evas_Utils
11495 EAPI void evas_data_argb_premul (unsigned int *data, unsigned int len);
11498 * Undo pre-multiplication data by an alpha factor.
11500 * @param data The data value.
11501 * @param len The length value.
11503 * This function undoes pre-multiplication of a given data by an alpha
11504 * factor. Alpha factor is used to define transparency.
11506 * @ingroup Evas_Utils
11508 EAPI void evas_data_argb_unpremul (unsigned int *data, unsigned int len);
11510 /* string and font handling */
11513 * Gets the next character in the string
11515 * Given the UTF-8 string in @p str, and starting byte position in @p pos,
11516 * this function will place in @p decoded the decoded code point at @p pos
11517 * and return the byte index for the next character in the string.
11519 * The only boundary check done is that @p pos must be >= 0. Other than that,
11520 * no checks are performed, so passing an index value that's not within the
11521 * length of the string will result in undefined behavior.
11523 * @param str The UTF-8 string
11524 * @param pos The byte index where to start
11525 * @param decoded Address where to store the decoded code point. Optional.
11527 * @return The byte index of the next character
11529 * @ingroup Evas_Utils
11531 EAPI int evas_string_char_next_get (const char *str, int pos, int *decoded) EINA_ARG_NONNULL(1);
11534 * Gets the previous character in the string
11536 * Given the UTF-8 string in @p str, and starting byte position in @p pos,
11537 * this function will place in @p decoded the decoded code point at @p pos
11538 * and return the byte index for the previous character in the string.
11540 * The only boundary check done is that @p pos must be >= 1. Other than that,
11541 * no checks are performed, so passing an index value that's not within the
11542 * length of the string will result in undefined behavior.
11544 * @param str The UTF-8 string
11545 * @param pos The byte index where to start
11546 * @param decoded Address where to store the decoded code point. Optional.
11548 * @return The byte index of the previous character
11550 * @ingroup Evas_Utils
11552 EAPI int evas_string_char_prev_get (const char *str, int pos, int *decoded) EINA_ARG_NONNULL(1);
11555 * Get the length in characters of the string.
11556 * @param str The string to get the length of.
11557 * @return The length in characters (not bytes)
11558 * @ingroup Evas_Utils
11560 EAPI int evas_string_char_len_get (const char *str) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
11563 * @defgroup Evas_Keys Key Input Functions
11565 * Functions which feed key events to the canvas.
11567 * As explained in @ref intro_not_evas, Evas is @b not aware of input
11568 * systems at all. Then, the user, if using it crudely (evas_new()),
11569 * will have to feed it with input events, so that it can react
11570 * somehow. If, however, the user creates a canvas by means of the
11571 * Ecore_Evas wrapper, it will automatically bind the chosen display
11572 * engine's input events to the canvas, for you.
11574 * This group presents the functions dealing with the feeding of key
11575 * events to the canvas. On most of them, one has to reference a given
11576 * key by a name (<code>keyname</code> argument). Those are
11577 * <b>platform dependent</b> symbolic names for the keys. Sometimes
11578 * you'll get the right <code>keyname</code> by simply using an ASCII
11579 * value of the key name, but it won't be like that always.
11581 * Typical platforms are Linux frame buffer (Ecore_FB) and X server
11582 * (Ecore_X) when using Evas with Ecore and Ecore_Evas. Please refer
11583 * to your display engine's documentation when using evas through an
11584 * Ecore helper wrapper when you need the <code>keyname</code>s.
11587 * @dontinclude evas-events.c
11588 * @skip mods = evas_key_modifier_get(evas);
11591 * All the other @c evas_key functions behave on the same manner. See
11592 * the full @ref Example_Evas_Events "example".
11594 * @ingroup Evas_Canvas
11598 * @addtogroup Evas_Keys
11603 * Returns a handle to the list of modifier keys registered in the
11604 * canvas @p e. This is required to check for which modifiers are set
11605 * at a given time with the evas_key_modifier_is_set() function.
11607 * @param e The pointer to the Evas canvas
11609 * @see evas_key_modifier_add
11610 * @see evas_key_modifier_del
11611 * @see evas_key_modifier_on
11612 * @see evas_key_modifier_off
11613 * @see evas_key_modifier_is_set
11615 * @return An ::Evas_Modifier handle to query Evas' keys subsystem
11616 * with evas_key_modifier_is_set(), or @c NULL on error.
11618 EAPI const Evas_Modifier *evas_key_modifier_get (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
11621 * Returns a handle to the list of lock keys registered in the canvas
11622 * @p e. This is required to check for which locks are set at a given
11623 * time with the evas_key_lock_is_set() function.
11625 * @param e The pointer to the Evas canvas
11627 * @see evas_key_lock_add
11628 * @see evas_key_lock_del
11629 * @see evas_key_lock_on
11630 * @see evas_key_lock_off
11631 * @see evas_key_lock_is_set
11633 * @return An ::Evas_Lock handle to query Evas' keys subsystem with
11634 * evas_key_lock_is_set(), or @c NULL on error.
11636 EAPI const Evas_Lock *evas_key_lock_get (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
11640 * Checks the state of a given modifier key, at the time of the
11641 * call. If the modifier is set, such as shift being pressed, this
11642 * function returns @c Eina_True.
11644 * @param m The current modifiers set, as returned by
11645 * evas_key_modifier_get().
11646 * @param keyname The name of the modifier key to check status for.
11648 * @return @c Eina_True if the modifier key named @p keyname is on, @c
11649 * Eina_False otherwise.
11651 * @see evas_key_modifier_add
11652 * @see evas_key_modifier_del
11653 * @see evas_key_modifier_get
11654 * @see evas_key_modifier_on
11655 * @see evas_key_modifier_off
11657 EAPI Eina_Bool evas_key_modifier_is_set (const Evas_Modifier *m, const char *keyname) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2) EINA_PURE;
11661 * Checks the state of a given lock key, at the time of the call. If
11662 * the lock is set, such as caps lock, this function returns @c
11665 * @param l The current locks set, as returned by evas_key_lock_get().
11666 * @param keyname The name of the lock key to check status for.
11668 * @return @c Eina_True if the @p keyname lock key is set, @c
11669 * Eina_False otherwise.
11671 * @see evas_key_lock_get
11672 * @see evas_key_lock_add
11673 * @see evas_key_lock_del
11674 * @see evas_key_lock_on
11675 * @see evas_key_lock_off
11677 EAPI Eina_Bool evas_key_lock_is_set (const Evas_Lock *l, const char *keyname) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2) EINA_PURE;
11681 * Adds the @p keyname key to the current list of modifier keys.
11683 * @param e The pointer to the Evas canvas
11684 * @param keyname The name of the modifier key to add to the list of
11687 * Modifiers are keys like shift, alt and ctrl, i.e., keys which are
11688 * meant to be pressed together with others, altering the behavior of
11689 * the secondly pressed keys somehow. Evas is so that these keys can
11692 * This call allows custom modifiers to be added to the Evas system at
11693 * run time. It is then possible to set and unset modifier keys
11694 * programmatically for other parts of the program to check and act
11695 * on. Programmers using Evas would check for modifier keys on key
11696 * event callbacks using evas_key_modifier_is_set().
11698 * @see evas_key_modifier_del
11699 * @see evas_key_modifier_get
11700 * @see evas_key_modifier_on
11701 * @see evas_key_modifier_off
11702 * @see evas_key_modifier_is_set
11704 * @note If the programmer instantiates the canvas by means of the
11705 * ecore_evas_new() family of helper functions, Ecore will take
11706 * care of registering on it all standard modifiers: "Shift",
11707 * "Control", "Alt", "Meta", "Hyper", "Super".
11709 EAPI void evas_key_modifier_add (Evas *e, const char *keyname) EINA_ARG_NONNULL(1, 2);
11712 * Removes the @p keyname key from the current list of modifier keys
11715 * @param e The pointer to the Evas canvas
11716 * @param keyname The name of the key to remove from the modifiers list.
11718 * @see evas_key_modifier_add
11719 * @see evas_key_modifier_get
11720 * @see evas_key_modifier_on
11721 * @see evas_key_modifier_off
11722 * @see evas_key_modifier_is_set
11724 EAPI void evas_key_modifier_del (Evas *e, const char *keyname) EINA_ARG_NONNULL(1, 2);
11727 * Adds the @p keyname key to the current list of lock keys.
11729 * @param e The pointer to the Evas canvas
11730 * @param keyname The name of the key to add to the locks list.
11732 * Locks are keys like caps lock, num lock or scroll lock, i.e., keys
11733 * which are meant to be pressed once -- toggling a binary state which
11734 * is bound to it -- and thus altering the behavior of all
11735 * subsequently pressed keys somehow, depending on its state. Evas is
11736 * so that these keys can be defined by the user.
11738 * This allows custom locks to be added to the evas system at run
11739 * time. It is then possible to set and unset lock keys
11740 * programmatically for other parts of the program to check and act
11741 * on. Programmers using Evas would check for lock keys on key event
11742 * callbacks using evas_key_lock_is_set().
11744 * @see evas_key_lock_get
11745 * @see evas_key_lock_del
11746 * @see evas_key_lock_on
11747 * @see evas_key_lock_off
11748 * @see evas_key_lock_is_set
11750 * @note If the programmer instantiates the canvas by means of the
11751 * ecore_evas_new() family of helper functions, Ecore will take
11752 * care of registering on it all standard lock keys: "Caps_Lock",
11753 * "Num_Lock", "Scroll_Lock".
11755 EAPI void evas_key_lock_add (Evas *e, const char *keyname) EINA_ARG_NONNULL(1, 2);
11758 * Removes the @p keyname key from the current list of lock keys on
11761 * @param e The pointer to the Evas canvas
11762 * @param keyname The name of the key to remove from the locks list.
11764 * @see evas_key_lock_get
11765 * @see evas_key_lock_add
11766 * @see evas_key_lock_on
11767 * @see evas_key_lock_off
11769 EAPI void evas_key_lock_del (Evas *e, const char *keyname) EINA_ARG_NONNULL(1, 2);
11773 * Enables or turns on programmatically the modifier key with name @p
11776 * @param e The pointer to the Evas canvas
11777 * @param keyname The name of the modifier to enable.
11779 * The effect will be as if the key was pressed for the whole time
11780 * between this call and a matching evas_key_modifier_off().
11782 * @see evas_key_modifier_add
11783 * @see evas_key_modifier_get
11784 * @see evas_key_modifier_off
11785 * @see evas_key_modifier_is_set
11787 EAPI void evas_key_modifier_on (Evas *e, const char *keyname) EINA_ARG_NONNULL(1, 2);
11790 * Disables or turns off programmatically the modifier key with name
11793 * @param e The pointer to the Evas canvas
11794 * @param keyname The name of the modifier to disable.
11796 * @see evas_key_modifier_add
11797 * @see evas_key_modifier_get
11798 * @see evas_key_modifier_on
11799 * @see evas_key_modifier_is_set
11801 EAPI void evas_key_modifier_off (Evas *e, const char *keyname) EINA_ARG_NONNULL(1, 2);
11804 * Enables or turns on programmatically the lock key with name @p
11807 * @param e The pointer to the Evas canvas
11808 * @param keyname The name of the lock to enable.
11810 * The effect will be as if the key was put on its active state after
11813 * @see evas_key_lock_get
11814 * @see evas_key_lock_add
11815 * @see evas_key_lock_del
11816 * @see evas_key_lock_off
11818 EAPI void evas_key_lock_on (Evas *e, const char *keyname) EINA_ARG_NONNULL(1, 2);
11821 * Disables or turns off programmatically the lock key with name @p
11824 * @param e The pointer to the Evas canvas
11825 * @param keyname The name of the lock to disable.
11827 * The effect will be as if the key was put on its inactive state
11830 * @see evas_key_lock_get
11831 * @see evas_key_lock_add
11832 * @see evas_key_lock_del
11833 * @see evas_key_lock_on
11835 EAPI void evas_key_lock_off (Evas *e, const char *keyname) EINA_ARG_NONNULL(1, 2);
11839 * Creates a bit mask from the @p keyname @b modifier key. Values
11840 * returned from different calls to it may be ORed together,
11843 * @param e The canvas whom to query the bit mask from.
11844 * @param keyname The name of the modifier key to create the mask for.
11846 * @returns the bit mask or 0 if the @p keyname key wasn't registered as a
11847 * modifier for canvas @p e.
11849 * This function is meant to be using in conjunction with
11850 * evas_object_key_grab()/evas_object_key_ungrab(). Go check their
11851 * documentation for more information.
11853 * @see evas_key_modifier_add
11854 * @see evas_key_modifier_get
11855 * @see evas_key_modifier_on
11856 * @see evas_key_modifier_off
11857 * @see evas_key_modifier_is_set
11858 * @see evas_object_key_grab
11859 * @see evas_object_key_ungrab
11861 EAPI Evas_Modifier_Mask evas_key_modifier_mask_get (const Evas *e, const char *keyname) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2) EINA_PURE;
11865 * Requests @p keyname key events be directed to @p obj.
11867 * @param obj the object to direct @p keyname events to.
11868 * @param keyname the key to request events for.
11869 * @param modifiers a mask of modifiers that must be present to
11870 * trigger the event.
11871 * @param not_modifiers a mask of modifiers that must @b not be present
11872 * to trigger the event.
11873 * @param exclusive request that the @p obj is the only object
11874 * receiving the @p keyname events.
11875 * @return @c EINA_TRUE, if the call succeeded, @c EINA_FALSE otherwise.
11877 * Key grabs allow one or more objects to receive key events for
11878 * specific key strokes even if other objects have focus. Whenever a
11879 * key is grabbed, only the objects grabbing it will get the events
11880 * for the given keys.
11882 * @p keyname is a platform dependent symbolic name for the key
11883 * pressed (see @ref Evas_Keys for more information).
11885 * @p modifiers and @p not_modifiers are bit masks of all the
11886 * modifiers that must and mustn't, respectively, be pressed along
11887 * with @p keyname key in order to trigger this new key
11888 * grab. Modifiers can be things such as Shift and Ctrl as well as
11889 * user defigned types via evas_key_modifier_add(). Retrieve them with
11890 * evas_key_modifier_mask_get() or use @c 0 for empty masks.
11892 * @p exclusive will make the given object the only one permitted to
11893 * grab the given key. If given @c EINA_TRUE, subsequent calls on this
11894 * function with different @p obj arguments will fail, unless the key
11895 * is ungrabbed again.
11897 * Example code follows.
11898 * @dontinclude evas-events.c
11899 * @skip if (d.focus)
11902 * See the full example @ref Example_Evas_Events "here".
11904 * @see evas_object_key_ungrab
11905 * @see evas_object_focus_set
11906 * @see evas_object_focus_get
11907 * @see evas_focus_get
11908 * @see evas_key_modifier_add
11910 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);
11913 * Removes the grab on @p keyname key events by @p obj.
11915 * @param obj the object that has an existing key grab.
11916 * @param keyname the key the grab is set for.
11917 * @param modifiers a mask of modifiers that must be present to
11918 * trigger the event.
11919 * @param not_modifiers a mask of modifiers that must not not be
11920 * present to trigger the event.
11922 * Removes a key grab on @p obj if @p keyname, @p modifiers, and @p
11923 * not_modifiers match.
11925 * Example code follows.
11926 * @dontinclude evas-events.c
11927 * @skip got here by key grabs
11930 * See the full example @ref Example_Evas_Events "here".
11932 * @see evas_object_key_grab
11933 * @see evas_object_focus_set
11934 * @see evas_object_focus_get
11935 * @see evas_focus_get
11937 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);