7 @author Carsten Haitzler <raster@@rasterman.com>
8 @author Till Adam <till@@adam-lilienthal.de>
9 @author Steve Ireland <sireland@@pobox.com>
10 @author Brett Nash <nash@@nash.id.au>
11 @author Tilman Sauerbeck <tilman@@code-monkey.de>
12 @author Corey Donohoe <atmos@@atmos.org>
13 @author Yuri Hudobin <glassy_ape@@users.sourceforge.net>
14 @author Nathan Ingersoll <ningerso@@d.umn.edu>
15 @author Willem Monsuwe <willem@@stack.nl>
16 @author Jose O Gonzalez <jose_ogp@@juno.com>
17 @author Bernhard Nemec <Bernhard.Nemec@@viasyshc.com>
18 @author Jorge Luis Zapata Muga <jorgeluis.zapata@@gmail.com>
19 @author Cedric Bail <cedric.bail@@free.fr>
20 @author Gustavo Sverzut Barbieri <barbieri@@profusion.mobi>
21 @author Vincent Torri <vtorri@@univ-evry.fr>
22 @author Tim Horton <hortont424@@gmail.com>
23 @author Tom Hacohen <tom@@stosb.com>
24 @author Mathieu Taillefumier <mathieu.taillefumier@@free.fr>
25 @author Iván Briano <ivan@@profusion.mobi>
26 @author Gustavo Lima Chaves <glima@@profusion.mobi>
27 @author Samsung Electronics <tbd>
28 @author Samsung SAIT <tbd>
29 @author Sung W. Park <sungwoo@@gmail.com>
30 @author Jiyoun Park <jy0703.park@@samsung.com>
31 @author Myoungwoon Roy Kim(roy_kim) <myoungwoon.kim@@samsung.com> <myoungwoon@@gmail.com>
32 @author Thierry el Borgi <thierry@@substantiel.fr>
33 @author ChunEon Park <hermet@@hermet.pe.kr>
36 @section toc Table of Contents
43 @li @ref intro_example
46 @section intro What is Evas?
48 Evas is a clean display canvas API for several target display systems that
49 can draw anti-aliased text, smooth super and sub-sampled scaled images,
50 alpha-blend objects much and more.
52 It abstracts any need to know much about what the characteristics of your
53 display system are or what graphics calls are used to draw them and how. It
54 deals on an object level where all you do is create and manipulate objects
55 in a canvas, set their properties, and the rest is done for you.
57 Evas optimises the rendering pipeline to minimise effort in redrawing changes
58 made to the canvas and so takes this work out of the programmers hand,
59 saving a lot of time and energy.
61 It's small and lean, designed to work on embedded systems all the way to
62 large and powerful multi-cpu workstations. It can be compiled to only have
63 the features you need for your target platform if you so wish, thus keeping
64 it small and lean. It has several display back-ends, letting it display on
65 several display systems, making it portable for cross-device and
66 cross-platform development.
68 @subsection intro_not_evas What Evas is not?
70 Evas is not a widget set or widget toolkit, however it is their
71 base. See Elementary (http://docs.enlightenment.org/auto/elementary/)
72 for a toolkit based on Evas, Edje, Ecore and other Enlightenment
75 It is not dependent or aware of main loops, input or output
76 systems. Input should be polled from various sources and feed them to
77 Evas. Similarly, it will not create windows or report windows updates
78 to your system, rather just drawing the pixels and reporting to the
79 user the areas that were changed. Of course these operations are quite
80 common and thus they are ready to use in Ecore, particularly in
81 Ecore_Evas (http://docs.enlightenment.org/auto/ecore/).
84 @section work How does Evas work?
86 Evas is a canvas display library. This is markedly different from most
87 display and windowing systems as a Canvas is structural and is also a state
88 engine, whereas most display and windowing systems are immediate mode display
89 targets. Evas handles the logic between a structural display via its' state
90 engine, and controls the target windowing system in order to produce
91 rendered results of the current canvases state on the display.
93 Immediate mode display systems retain very little, or no state. A program
94 will execute a series of commands, as in the pseudo code:
97 draw line from position (0, 0) to position (100, 200);
99 draw rectangle from position (10, 30) to position (50, 500);
101 bitmap_handle = create_bitmap();
102 scale bitmap_handle to size 100 x 100;
103 draw image bitmap_handle at position (10, 30);
106 The series of commands is executed by the windowing system and the results
107 are displayed on the screen (normally). Once the commands are executed the
108 display system has little or no idea of how to reproduce this image again,
109 and so has to be instructed by the application how to redraw sections of the
110 screen whenever needed. Each successive command will be executed as
111 instructed by the application and either emulated by software or sent to the
112 graphics hardware on the device to be performed.
114 The advantage of such a system is that it is simple, and gives a program
115 tight control over how something looks and is drawn. Given the increasing
116 complexity of displays and demands by users to have better looking
117 interfaces, more and more work is needing to be done at this level by the
118 internals of widget sets, custom display widgets and other programs. This
119 means more and more logic and display rendering code needs to be written
120 time and time again, each time the application needs to figure out how to
121 minimise redraws so that display is fast and interactive, and keep track of
122 redraw logic. The power comes at a high-price, lots of extra code and work.
123 Programmers not very familiar with graphics programming will often make
124 mistakes at this level and produce code that is sub optimal. Those familiar
125 with this kind of programming will simply get bored by writing the same code
128 For example, if in the above scene, the windowing system requires the
129 application to redraw the area from 0, 0 to 50, 50 (also referred as
130 "expose event"), then the programmer must calculate manually the
131 updates and repaint it again:
134 Redraw from position (0, 0) to position (50, 50):
136 // what was in area (0, 0, 50, 50)?
138 // 1. intersection part of line (0, 0) to (100, 200)?
139 draw line from position (0, 0) to position (25, 50);
141 // 2. intersection part of rectangle (10, 30) to (50, 500)?
142 draw rectangle from position (10, 30) to position (50, 50)
144 // 3. intersection part of image at (10, 30), size 100 x 100?
145 bitmap_subimage = subregion from position (0, 0) to position (40, 20)
146 draw image bitmap_subimage at position (10, 30);
149 The clever reader might have noticed that, if all elements in the
150 above scene are opaque, then the system is doing useless paints: part
151 of the line is behind the rectangle, and part of the rectangle is
152 behind the image. These useless paints tends to be very costly, as
153 pixels tend to be 4 bytes in size, thus an overlapping region of 100 x
154 100 pixels is around 40000 useless writes! The developer could write
155 code to calculate the overlapping areas and avoid painting then, but
156 then it should be mixed with the "expose event" handling mentioned
157 above and quickly one realizes the initially simpler method became
160 Evas is a structural system in which the programmer creates and manages
161 display objects and their properties, and as a result of this higher level
162 state management, the canvas is able to redraw the set of objects when
163 needed to represent the current state of the canvas.
165 For example, the pseudo code:
168 line_handle = create_line();
169 set line_handle from position (0, 0) to position (100, 200);
172 rectangle_handle = create_rectangle();
173 move rectangle_handle to position (10, 30);
174 resize rectangle_handle to size 40 x 470;
175 show rectangle_handle;
177 bitmap_handle = create_bitmap();
178 scale bitmap_handle to size 100 x 100;
179 move bitmap_handle to position (10, 30);
185 This may look longer, but when the display needs to be refreshed or updated,
186 the programmer only moves, resizes, shows, hides etc. the objects that they
187 need to change. The programmer simply thinks at the object logic level, and
188 the canvas software does the rest of the work for them, figuring out what
189 actually changed in the canvas since it was last drawn, how to most
190 efficiently redraw he canvas and its contents to reflect the current state,
191 and then it can go off and do the actual drawing of the canvas.
193 This lets the programmer think in a more natural way when dealing with a
194 display, and saves time and effort of working out how to load and display
195 images, render given the current display system etc. Since Evas also is
196 portable across different display systems, this also gives the programmer
197 the ability to have their code ported and display on different display
198 systems with very little work.
200 Evas can be seen as a display system that stands somewhere between a widget
201 set and an immediate mode display system. It retains basic display logic,
202 but does very little high-level logic such as scrollbars, sliders, push
206 @section compiling How to compile using Evas ?
208 Evas is a library your application links to. The procedure for this is very
209 simple. You simply have to compile your application with the appropriate
210 compiler flags that the @p pkg-config script outputs. For example:
212 Compiling C or C++ files into object files:
215 gcc -c -o main.o main.c `pkg-config --cflags evas`
218 Linking object files into a binary executable:
221 gcc -o my_application main.o `pkg-config --libs evas`
224 You simply have to make sure that pkg-config is in your shell's PATH (see
225 the manual page for your appropriate shell) and evas.pc in /usr/lib/pkgconfig
226 or its path is in the PKG_CONFIG_PATH environment variable. It's that simple
227 to link and use Evas once you have written your code to use it.
229 Since the program is linked to Evas, it is now able to use any advertised
230 API calls to display graphics in a canvas managed by Evas, as well as use
231 the API calls provided to manage data as well.
233 You should make sure you add any extra compile and link flags to your
234 compile commands that your application may need as well. The above example
235 is only guaranteed to make Evas add it's own requirements.
238 @section install How is it installed?
250 @section next_steps Next Steps
252 After you understood what Evas is and installed it in your system you
253 should proceed understanding the programming interface for all
254 objects, then see the specific for the most used elements. We'd
255 recommend you to take a while to learn Ecore
256 (http://docs.enlightenment.org/auto/ecore/) and Edje
257 (http://docs.enlightenment.org/auto/edje/) as they will likely save
258 you tons of work compared to using just Evas directly.
262 @li @ref Evas_Object_Group
263 @li @ref Evas_Object_Rectangle
264 @li @ref Evas_Object_Image
265 @li @ref Evas_Object_Text
266 @li @ref Evas_Smart_Object_Group and @ref Evas_Smart_Group to define
267 an object that provides custom functions to handle clipping,
268 hiding, moving, resizing, setting the color and more. These could
269 be as simple as a group of objects that move together (see @ref
270 Evas_Smart_Object_Clipped). These smart objects can implement what
271 ends to be a widget, providing some intelligence (thus the name),
272 like a button or check box.
274 @section intro_example Introductory Example
276 @include evas-buffer-simple.c
291 # ifdef EFL_EVAS_BUILD
293 # define EAPI __declspec(dllexport)
296 # endif /* ! DLL_EXPORT */
298 # define EAPI __declspec(dllimport)
299 # endif /* ! EFL_EVAS_BUILD */
303 # define EAPI __attribute__ ((visibility("default")))
310 #endif /* ! _WIN32 */
316 #define EVAS_VERSION_MAJOR 1
317 #define EVAS_VERSION_MINOR 0
319 typedef struct _Evas_Version
327 EAPI extern Evas_Version *evas_version;
331 * @brief These routines are used for Evas library interaction.
333 * @todo check boolean return values and convert to Eina_Bool
334 * @todo change all api to use EINA_SAFETY_*
335 * @todo finish api documentation
338 /* BiDi exposed stuff */
340 typedef enum _Evas_BiDi_Direction
342 EVAS_BIDI_DIRECTION_NATURAL,
343 EVAS_BIDI_DIRECTION_LTR,
344 EVAS_BIDI_DIRECTION_RTL
345 } Evas_BiDi_Direction;
348 * Identifier of callbacks to be set for Evas canvases or Evas
351 * @see evas_object_event_callback_add()
352 * @see evas_event_callback_add()
354 typedef enum _Evas_Callback_Type
357 * The following events are only for use with Evas objects, with
358 * evas_object_event_callback_add():
360 EVAS_CALLBACK_MOUSE_IN, /**< Mouse In Event */
361 EVAS_CALLBACK_MOUSE_OUT, /**< Mouse Out Event */
362 EVAS_CALLBACK_MOUSE_DOWN, /**< Mouse Button Down Event */
363 EVAS_CALLBACK_MOUSE_UP, /**< Mouse Button Up Event */
364 EVAS_CALLBACK_MOUSE_MOVE, /**< Mouse Move Event */
365 EVAS_CALLBACK_MOUSE_WHEEL, /**< Mouse Wheel Event */
366 EVAS_CALLBACK_MULTI_DOWN, /**< Multi-touch Down Event */
367 EVAS_CALLBACK_MULTI_UP, /**< Multi-touch Up Event */
368 EVAS_CALLBACK_MULTI_MOVE, /**< Multi-touch Move Event */
369 EVAS_CALLBACK_FREE, /**< Object Being Freed (Called after Del) */
370 EVAS_CALLBACK_KEY_DOWN, /**< Key Press Event */
371 EVAS_CALLBACK_KEY_UP, /**< Key Release Event */
372 EVAS_CALLBACK_FOCUS_IN, /**< Focus In Event */
373 EVAS_CALLBACK_FOCUS_OUT, /**< Focus Out Event */
374 EVAS_CALLBACK_SHOW, /**< Show Event */
375 EVAS_CALLBACK_HIDE, /**< Hide Event */
376 EVAS_CALLBACK_MOVE, /**< Move Event */
377 EVAS_CALLBACK_RESIZE, /**< Resize Event */
378 EVAS_CALLBACK_RESTACK, /**< Restack Event */
379 EVAS_CALLBACK_DEL, /**< Object Being Deleted (called before Free) */
380 EVAS_CALLBACK_HOLD, /**< Events go on/off hold */
381 EVAS_CALLBACK_CHANGED_SIZE_HINTS, /**< Size hints changed event */
382 EVAS_CALLBACK_IMAGE_PRELOADED, /**< Image has been preloaded */
385 * The following events are only for use with Evas canvases, with
386 * evas_event_callback_add():
388 EVAS_CALLBACK_CANVAS_FOCUS_IN, /**< Canvas got focus as a whole */
389 EVAS_CALLBACK_CANVAS_FOCUS_OUT, /**< Canvas lost focus as a whole */
390 EVAS_CALLBACK_RENDER_FLUSH_PRE, /**< Called just before rendering is updated on the canvas target */
391 EVAS_CALLBACK_RENDER_FLUSH_POST, /**< Called just after rendering is updated on the canvas target */
392 EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_IN, /**< Canvas object got focus */
393 EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_OUT, /**< Canvas object lost focus */
396 * More Evas object event types - see evas_object_event_callback_add():
398 EVAS_CALLBACK_IMAGE_UNLOADED, /**< Image data has been unloaded (by some mechanims in Evas that throw out original image data) */
400 EVAS_CALLBACK_LAST /**< kept as last element/sentinel -- not really an event */
401 } Evas_Callback_Type; /**< The types of events triggering a callback */
404 * Flags for Mouse Button events
406 typedef enum _Evas_Button_Flags
408 EVAS_BUTTON_NONE = 0, /**< No extra mouse button data */
409 EVAS_BUTTON_DOUBLE_CLICK = (1 << 0), /**< This mouse button press was the 2nd press of a double click */
410 EVAS_BUTTON_TRIPLE_CLICK = (1 << 1) /**< This mouse button press was the 3rd press of a triple click */
411 } Evas_Button_Flags; /**< Flags for Mouse Button events */
416 typedef enum _Evas_Event_Flags
418 EVAS_EVENT_FLAG_NONE = 0, /**< No fancy flags set */
419 EVAS_EVENT_FLAG_ON_HOLD = (1 << 0), /**< This event is being delivered but should be put "on hold" until the on hold flag is unset. the event should be used for informational purposes and maybe some indications visually, but not actually perform anything */
420 EVAS_EVENT_FLAG_ON_SCROLL = (1 << 1) /**< This event flag indicates the event occurs while scrolling; for exameple, DOWN event occurs during scrolling; the event should be used for informational purposes and maybe some indications visually, but not actually perform anything */
421 } Evas_Event_Flags; /**< Flags for Events */
424 * Flags for Font Hinting
425 * @ingroup Evas_Font_Group
427 typedef enum _Evas_Font_Hinting_Flags
429 EVAS_FONT_HINTING_NONE, /**< No font hinting */
430 EVAS_FONT_HINTING_AUTO, /**< Automatic font hinting */
431 EVAS_FONT_HINTING_BYTECODE /**< Bytecode font hinting */
432 } Evas_Font_Hinting_Flags; /**< Flags for Font Hinting */
435 * Colorspaces for pixel data supported by Evas
436 * @ingroup Evas_Object_Image
438 typedef enum _Evas_Colorspace
440 EVAS_COLORSPACE_ARGB8888, /**< ARGB 32 bits per pixel, high-byte is Alpha, accessed 1 32bit word at a time */
441 /* these are not currently supported - but planned for the future */
442 EVAS_COLORSPACE_YCBCR422P601_PL, /**< YCbCr 4:2:2 Planar, ITU.BT-601 specifications. The data poitned to is just an array of row pointer, pointing to the Y rows, then the Cb, then Cr rows */
443 EVAS_COLORSPACE_YCBCR422P709_PL,/**< YCbCr 4:2:2 Planar, ITU.BT-709 specifications. The data poitned to is just an array of row pointer, pointing to the Y rows, then the Cb, then Cr rows */
444 EVAS_COLORSPACE_RGB565_A5P, /**< 16bit rgb565 + Alpha plane at end - 5 bits of the 8 being used per alpha byte */
445 EVAS_COLORSPACE_GRY8 /**< 8bit grayscale */
446 } Evas_Colorspace; /**< Colorspaces for pixel data supported by Evas */
449 * How to pack items into cells in a table.
450 * @ingroup Evas_Object_Table
452 typedef enum _Evas_Object_Table_Homogeneous_Mode
454 EVAS_OBJECT_TABLE_HOMOGENEOUS_NONE = 0,
455 EVAS_OBJECT_TABLE_HOMOGENEOUS_TABLE = 1,
456 EVAS_OBJECT_TABLE_HOMOGENEOUS_ITEM = 2
457 } Evas_Object_Table_Homogeneous_Mode; /**< Table cell pack mode. */
459 typedef struct _Evas_Coord_Rectangle Evas_Coord_Rectangle; /**< A generic rectangle handle */
460 typedef struct _Evas_Point Evas_Point; /**< integer point */
462 typedef struct _Evas_Coord_Point Evas_Coord_Point; /**< Evas_Coord point */
463 typedef struct _Evas_Coord_Precision_Point Evas_Coord_Precision_Point; /**< Evas_Coord point with sub-pixel precision */
465 typedef struct _Evas_Position Evas_Position; /**< associates given point in Canvas and Output */
466 typedef struct _Evas_Precision_Position Evas_Precision_Position; /**< associates given point in Canvas and Output, with sub-pixel precision */
469 * @typedef Evas_Smart_Class
471 * A smart object's @b base class definition
473 * @ingroup Evas_Smart_Group
475 typedef struct _Evas_Smart_Class Evas_Smart_Class;
478 * @typedef Evas_Smart_Cb_Description
479 * A smart object callback description, used to provide introspection
480 * @ingroup Evas_Smart_Group
482 typedef struct _Evas_Smart_Cb_Description Evas_Smart_Cb_Description;
486 * An opaque handle to map points
487 * @see evas_map_new()
488 * @see evas_map_free()
489 * @see evas_map_dup()
490 * @ingroup Evas_Object_Group_Map
492 typedef struct _Evas_Map Evas_Map;
496 * An opaque handle to an Evas canvas.
499 * @ingroup Evas_Canvas
501 typedef struct _Evas Evas;
504 * @typedef Evas_Object
505 * An Evas Object handle.
506 * @ingroup Evas_Object_Group
508 typedef struct _Evas_Object Evas_Object;
510 typedef void Evas_Performance; /**< An Evas Performance handle */
511 typedef struct _Evas_Modifier Evas_Modifier; /**< An opaque type containing information on which modifier keys are registered in an Evas canvas */
512 typedef struct _Evas_Lock Evas_Lock; /**< An opaque type containing information on which lock keys are registered in an Evas canvas */
513 typedef struct _Evas_Smart Evas_Smart; /**< An Evas Smart Object handle */
514 typedef struct _Evas_Native_Surface Evas_Native_Surface; /**< A generic datatype for engine specific native surface information */
515 typedef unsigned long long Evas_Modifier_Mask; /**< An Evas modifier mask type */
517 typedef int Evas_Coord;
518 typedef int Evas_Font_Size;
519 typedef int Evas_Angle;
521 struct _Evas_Coord_Rectangle /**< A rectangle in Evas_Coord */
523 Evas_Coord x; /**< top-left x co-ordinate of rectangle */
524 Evas_Coord y; /**< top-left y co-ordinate of rectangle */
525 Evas_Coord w; /**< width of rectangle */
526 Evas_Coord h; /**< height of rectangle */
534 struct _Evas_Coord_Point
539 struct _Evas_Coord_Precision_Point
545 struct _Evas_Position
548 Evas_Coord_Point canvas;
551 struct _Evas_Precision_Position
554 Evas_Coord_Precision_Point canvas;
557 typedef enum _Evas_Aspect_Control
559 EVAS_ASPECT_CONTROL_NONE = 0, /**< Preference on scaling unset */
560 EVAS_ASPECT_CONTROL_NEITHER = 1, /**< Same effect as unset preference on scaling */
561 EVAS_ASPECT_CONTROL_HORIZONTAL = 2, /**< Use all horizontal container space to place an object, using the given aspect */
562 EVAS_ASPECT_CONTROL_VERTICAL = 3, /**< Use all vertical container space to place an object, using the given aspect */
563 EVAS_ASPECT_CONTROL_BOTH = 4 /**< Use all horizontal @b and vertical container spaces to place an object (never growing it out of those bounds), using the given aspect */
564 } Evas_Aspect_Control; /**< Aspect types/policies for scaling size hints, used for evas_object_size_hint_aspect_set() */
566 typedef struct _Evas_Pixel_Import_Source Evas_Pixel_Import_Source; /**< A source description of pixels for importing pixels */
567 typedef struct _Evas_Engine_Info Evas_Engine_Info; /**< A generic Evas Engine information structure */
568 typedef struct _Evas_Device Evas_Device; /**< A source device handle - where the event came from */
569 typedef struct _Evas_Event_Mouse_Down Evas_Event_Mouse_Down; /**< Event structure for #EVAS_CALLBACK_MOUSE_DOWN event callbacks */
570 typedef struct _Evas_Event_Mouse_Up Evas_Event_Mouse_Up; /**< Event structure for #EVAS_CALLBACK_MOUSE_UP event callbacks */
571 typedef struct _Evas_Event_Mouse_In Evas_Event_Mouse_In; /**< Event structure for #EVAS_CALLBACK_MOUSE_IN event callbacks */
572 typedef struct _Evas_Event_Mouse_Out Evas_Event_Mouse_Out; /**< Event structure for #EVAS_CALLBACK_MOUSE_OUT event callbacks */
573 typedef struct _Evas_Event_Mouse_Move Evas_Event_Mouse_Move; /**< Event structure for #EVAS_CALLBACK_MOUSE_MOVE event callbacks */
574 typedef struct _Evas_Event_Mouse_Wheel Evas_Event_Mouse_Wheel; /**< Event structure for #EVAS_CALLBACK_MOUSE_WHEEL event callbacks */
575 typedef struct _Evas_Event_Multi_Down Evas_Event_Multi_Down; /**< Event structure for #EVAS_CALLBACK_MULTI_DOWN event callbacks */
576 typedef struct _Evas_Event_Multi_Up Evas_Event_Multi_Up; /**< Event structure for #EVAS_CALLBACK_MULTI_UP event callbacks */
577 typedef struct _Evas_Event_Multi_Move Evas_Event_Multi_Move; /**< Event structure for #EVAS_CALLBACK_MULTI_MOVE event callbacks */
578 typedef struct _Evas_Event_Key_Down Evas_Event_Key_Down; /**< Event structure for #EVAS_CALLBACK_KEY_DOWN event callbacks */
579 typedef struct _Evas_Event_Key_Up Evas_Event_Key_Up; /**< Event structure for #EVAS_CALLBACK_KEY_UP event callbacks */
580 typedef struct _Evas_Event_Hold Evas_Event_Hold; /**< Event structure for #EVAS_CALLBACK_HOLD event callbacks */
582 typedef enum _Evas_Load_Error
584 EVAS_LOAD_ERROR_NONE = 0, /**< No error on load */
585 EVAS_LOAD_ERROR_GENERIC = 1, /**< A non-specific error occurred */
586 EVAS_LOAD_ERROR_DOES_NOT_EXIST = 2, /**< File (or file path) does not exist */
587 EVAS_LOAD_ERROR_PERMISSION_DENIED = 3, /**< Permission deinied to an existing file (or path) */
588 EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED = 4, /**< Allocation of resources failure prevented load */
589 EVAS_LOAD_ERROR_CORRUPT_FILE = 5, /**< File corrupt (but was detected as a known format) */
590 EVAS_LOAD_ERROR_UNKNOWN_FORMAT = 6 /**< File is not a known format */
591 } Evas_Load_Error; /**< Evas image load error codes one can get - see evas_load_error_str() too. */
594 typedef enum _Evas_Alloc_Error
596 EVAS_ALLOC_ERROR_NONE = 0, /**< No allocation error */
597 EVAS_ALLOC_ERROR_FATAL = 1, /**< Allocation failed despite attempts to free up memory */
598 EVAS_ALLOC_ERROR_RECOVERED = 2 /**< Allocation succeeded, but extra memory had to be found by freeing up speculative resources */
599 } Evas_Alloc_Error; /**< Possible allocation errors returned by evas_alloc_error() */
601 typedef enum _Evas_Fill_Spread
603 EVAS_TEXTURE_REFLECT = 0, /**< image fill tiling mode - tiling reflects */
604 EVAS_TEXTURE_REPEAT = 1, /**< tiling repeats */
605 EVAS_TEXTURE_RESTRICT = 2, /**< tiling clamps - range offset ignored */
606 EVAS_TEXTURE_RESTRICT_REFLECT = 3, /**< tiling clamps and any range offset reflects */
607 EVAS_TEXTURE_RESTRICT_REPEAT = 4, /**< tiling clamps and any range offset repeats */
608 EVAS_TEXTURE_PAD = 5 /**< tiling extends with end values */
609 } Evas_Fill_Spread; /**< Fill types used for evas_object_image_fill_spread_set() */
611 typedef enum _Evas_Pixel_Import_Pixel_Format
613 EVAS_PIXEL_FORMAT_NONE = 0, /**< No pixel format */
614 EVAS_PIXEL_FORMAT_ARGB32 = 1, /**< ARGB 32bit pixel format with A in the high byte per 32bit pixel word */
615 EVAS_PIXEL_FORMAT_YUV420P_601 = 2 /**< YUV 420 Planar format with CCIR 601 color encoding wuth contiguous planes in the order Y, U and V */
616 } Evas_Pixel_Import_Pixel_Format; /**< Pixel format for import call. See evas_object_image_pixels_import() */
618 struct _Evas_Pixel_Import_Source
620 Evas_Pixel_Import_Pixel_Format format; /**< pixel format type ie ARGB32, YUV420P_601 etc. */
621 int w, h; /**< width and height of source in pixels */
622 void **rows; /**< an array of pointers (size depends on format) pointing to left edge of each scanline */
625 /* magic version number to know what the native surf struct looks like */
626 #define EVAS_NATIVE_SURFACE_VERSION 2
628 typedef enum _Evas_Native_Surface_Type
630 EVAS_NATIVE_SURFACE_NONE,
631 EVAS_NATIVE_SURFACE_X11,
632 EVAS_NATIVE_SURFACE_OPENGL
633 } Evas_Native_Surface_Type;
635 struct _Evas_Native_Surface
638 Evas_Native_Surface_Type type;
641 void *visual; /**< visual of the pixmap to use (Visual) */
642 unsigned long pixmap; /**< pixmap id to use (Pixmap) */
645 unsigned int texture_id; /**< opengl texture id to use from glGenTextures() */
646 unsigned int framebuffer_id; /**< 0 if not a FBO, FBO id otherwise from glGenFramebuffers() */
647 unsigned int internal_format; /**< same as 'internalFormat' for glTexImage2D() */
648 unsigned int format; /**< same as 'format' for glTexImage2D() */
649 unsigned int x, y, w, h; /**< region inside the texture to use (image size is assumed as texture size, with 0, 0 being the top-left and co-ordinates working down to the right and bottom being positive) */
654 #define EVAS_LAYER_MIN -32768 /**< bottom-most layer number */
655 #define EVAS_LAYER_MAX 32767 /**< top-most layer number */
657 #define EVAS_COLOR_SPACE_ARGB 0 /**< Not used for anything */
658 #define EVAS_COLOR_SPACE_AHSV 1 /**< Not used for anything */
659 #define EVAS_TEXT_INVALID -1 /**< Not used for anything */
660 #define EVAS_TEXT_SPECIAL -2 /**< Not used for anything */
662 #define EVAS_HINT_EXPAND 1.0 /**< Use with evas_object_size_hint_weight_set(), evas_object_size_hint_weight_get(), evas_object_size_hint_expand_set(), evas_object_size_hint_expand_get() */
663 #define EVAS_HINT_FILL -1.0 /**< Use with evas_object_size_hint_align_set(), evas_object_size_hint_align_get(), evas_object_size_hint_fill_set(), evas_object_size_hint_fill_get() */
664 #define evas_object_size_hint_fill_set evas_object_size_hint_align_set /**< Convenience macro to make it easier to understand that align is also used for fill properties (as fill is mutually exclusive to align) */
665 #define evas_object_size_hint_fill_get evas_object_size_hint_align_get /**< Convenience macro to make it easier to understand that align is also used for fill properties (as fill is mutually exclusive to align) */
666 #define evas_object_size_hint_expand_set evas_object_size_hint_weight_set /**< Convenience macro to make it easier to understand that weight is also used for expand properties */
667 #define evas_object_size_hint_expand_get evas_object_size_hint_weight_get /**< Convenience macro to make it easier to understand that weight is also used for expand properties */
670 * How the object should be rendered to output.
671 * @ingroup Evas_Object_Group_Extras
673 typedef enum _Evas_Render_Op
675 EVAS_RENDER_BLEND = 0, /**< default op: d = d*(1-sa) + s */
676 EVAS_RENDER_BLEND_REL = 1, /**< d = d*(1 - sa) + s*da */
677 EVAS_RENDER_COPY = 2, /**< d = s */
678 EVAS_RENDER_COPY_REL = 3, /**< d = s*da */
679 EVAS_RENDER_ADD = 4, /**< d = d + s */
680 EVAS_RENDER_ADD_REL = 5, /**< d = d + s*da */
681 EVAS_RENDER_SUB = 6, /**< d = d - s */
682 EVAS_RENDER_SUB_REL = 7, /**< d = d - s*da */
683 EVAS_RENDER_TINT = 8, /**< d = d*s + d*(1 - sa) + s*(1 - da) */
684 EVAS_RENDER_TINT_REL = 9, /**< d = d*(1 - sa + s) */
685 EVAS_RENDER_MASK = 10, /**< d = d*sa */
686 EVAS_RENDER_MUL = 11 /**< d = d*s */
687 } Evas_Render_Op; /**< How the object should be rendered to output. */
689 typedef enum _Evas_Border_Fill_Mode
691 EVAS_BORDER_FILL_NONE = 0, /**< Image's center region is @b not to be rendered */
692 EVAS_BORDER_FILL_DEFAULT = 1, /**< Image's center region is to be @b blended with objects underneath it, if it has transparency. This is the default behavior for image objects */
693 EVAS_BORDER_FILL_SOLID = 2 /**< Image's center region is to be made solid, even if it has transparency on it */
694 } Evas_Border_Fill_Mode; /**< How an image's center region (the complement to the border region) should be rendered by Evas */
696 typedef enum _Evas_Image_Scale_Hint
698 EVAS_IMAGE_SCALE_HINT_NONE = 0,
699 EVAS_IMAGE_SCALE_HINT_DYNAMIC = 1,
700 EVAS_IMAGE_SCALE_HINT_STATIC = 2
701 } Evas_Image_Scale_Hint;
703 typedef enum _Evas_Engine_Render_Mode
705 EVAS_RENDER_MODE_BLOCKING = 0,
706 EVAS_RENDER_MODE_NONBLOCKING = 1,
707 } Evas_Engine_Render_Mode;
709 typedef enum _Evas_Image_Content_Hint
711 EVAS_IMAGE_CONTENT_HINT_NONE = 0, /**< No hint at all */
712 EVAS_IMAGE_CONTENT_HINT_DYNAMIC = 1, /**< The contents will change over time */
713 EVAS_IMAGE_CONTENT_HINT_STATIC = 2 /**< The contents won't change over time */
714 } Evas_Image_Content_Hint; /**< How an image's data is to be treated by Evas, for optimization */
716 struct _Evas_Engine_Info /** Generic engine information. Generic info is useless */
718 int magic; /**< Magic number */
721 struct _Evas_Event_Mouse_Down /** Mouse button press event */
723 int button; /**< Mouse button number that went down (1 - 32) */
726 Evas_Coord_Point canvas;
729 Evas_Modifier *modifiers;
732 Evas_Button_Flags flags;
733 unsigned int timestamp;
734 Evas_Event_Flags event_flags;
738 struct _Evas_Event_Mouse_Up /** Mouse button release event */
740 int button; /**< Mouse button number that was raised (1 - 32) */
743 Evas_Coord_Point canvas;
746 Evas_Modifier *modifiers;
749 Evas_Button_Flags flags;
750 unsigned int timestamp;
751 Evas_Event_Flags event_flags;
755 struct _Evas_Event_Mouse_In /** Mouse enter event */
757 int buttons; /**< Button pressed mask, Bits set to 1 are buttons currently pressed (bit 0 = mouse button 1, bit 1 = mouse button 2 etc.) */
760 Evas_Coord_Point canvas;
763 Evas_Modifier *modifiers;
765 unsigned int timestamp;
766 Evas_Event_Flags event_flags;
770 struct _Evas_Event_Mouse_Out /** Mouse leave event */
772 int buttons; /**< Button pressed mask, Bits set to 1 are buttons currently pressed (bit 0 = mouse button 1, bit 1 = mouse button 2 etc.) */
776 Evas_Coord_Point canvas;
779 Evas_Modifier *modifiers;
781 unsigned int timestamp;
782 Evas_Event_Flags event_flags;
786 struct _Evas_Event_Mouse_Move /** Mouse button down event */
788 int buttons; /**< Button pressed mask, Bits set to 1 are buttons currently pressed (bit 0 = mouse button 1, bit 1 = mouse button 2 etc.) */
790 Evas_Position cur, prev;
793 Evas_Modifier *modifiers;
795 unsigned int timestamp;
796 Evas_Event_Flags event_flags;
800 struct _Evas_Event_Mouse_Wheel /** Wheel event */
802 int direction; /* 0 = default up/down wheel FIXME: more wheel types */
803 int z; /* ...,-2,-1 = down, 1,2,... = up */
806 Evas_Coord_Point canvas;
809 Evas_Modifier *modifiers;
811 unsigned int timestamp;
812 Evas_Event_Flags event_flags;
816 struct _Evas_Event_Multi_Down /** Multi button press event */
818 int device; /**< Multi device number that went down (1 or more for extra touches) */
819 double radius, radius_x, radius_y;
820 double pressure, angle;
823 Evas_Coord_Precision_Point canvas;
826 Evas_Modifier *modifiers;
829 Evas_Button_Flags flags;
830 unsigned int timestamp;
831 Evas_Event_Flags event_flags;
835 struct _Evas_Event_Multi_Up /** Multi button release event */
837 int device; /**< Multi device number that went up (1 or more for extra touches) */
838 double radius, radius_x, radius_y;
839 double pressure, angle;
842 Evas_Coord_Precision_Point canvas;
845 Evas_Modifier *modifiers;
848 Evas_Button_Flags flags;
849 unsigned int timestamp;
850 Evas_Event_Flags event_flags;
854 struct _Evas_Event_Multi_Move /** Multi button down event */
856 int device; /**< Multi device number that moved (1 or more for extra touches) */
857 double radius, radius_x, radius_y;
858 double pressure, angle;
860 Evas_Precision_Position cur;
863 Evas_Modifier *modifiers;
865 unsigned int timestamp;
866 Evas_Event_Flags event_flags;
870 struct _Evas_Event_Key_Down /** Key press event */
872 char *keyname; /**< The string name of the key pressed */
874 Evas_Modifier *modifiers;
877 const char *key; /**< The logical key : (eg shift+1 == exclamation) */
878 const char *string; /**< A UTF8 string if this keystroke has produced a visible string to be ADDED */
879 const char *compose; /**< A UTF8 string if this keystroke has modified a string in the middle of being composed - this string replaces the previous one */
880 unsigned int timestamp;
881 Evas_Event_Flags event_flags;
885 struct _Evas_Event_Key_Up /** Key release event */
887 char *keyname; /**< The string name of the key released */
889 Evas_Modifier *modifiers;
892 const char *key; /**< The logical key : (eg shift+1 == exclamation) */
893 const char *string; /**< A UTF8 string if this keystroke has produced a visible string to be ADDED */
894 const char *compose; /**< A UTF8 string if this keystroke has modified a string in the middle of being composed - this string replaces the previous one */
895 unsigned int timestamp;
896 Evas_Event_Flags event_flags;
900 struct _Evas_Event_Hold /** Hold change event */
902 int hold; /**< The hold flag */
905 unsigned int timestamp;
906 Evas_Event_Flags event_flags;
911 * How the mouse pointer should be handled by Evas.
913 * In the mode #EVAS_OBJECT_POINTER_MODE_AUTOGRAB, when a mouse button
914 * is pressed down over an object and held, with the mouse pointer
915 * being moved outside of it, the pointer still behaves as being bound
916 * to that object, albeit out of its drawing region. When the button
917 * is released, the event will be fed to the object, that may check if
918 * the final position is over it or not and do something about it.
920 * In the mode #EVAS_OBJECT_POINTER_MODE_NOGRAB, the pointer will
921 * always be bound to the object right below it.
923 * @ingroup Evas_Object_Group_Extras
925 typedef enum _Evas_Object_Pointer_Mode
927 EVAS_OBJECT_POINTER_MODE_AUTOGRAB, /**< default, X11-like */
928 EVAS_OBJECT_POINTER_MODE_NOGRAB /**< pointer always bound to the object right below it */
929 } Evas_Object_Pointer_Mode; /**< How the mouse pointer should be handled by Evas. */
931 typedef void (*Evas_Smart_Cb) (void *data, Evas_Object *obj, void *event_info);
932 typedef void (*Evas_Event_Cb) (void *data, Evas *e, void *event_info); /**< Evas event callback function signature */
933 typedef Eina_Bool (*Evas_Object_Event_Post_Cb) (void *data, Evas *e);
934 typedef void (*Evas_Object_Event_Cb) (void *data, Evas *e, Evas_Object *obj, void *event_info); /**< Evas object event callback function signature */
935 typedef void (*Evas_Async_Events_Put_Cb)(void *target, Evas_Callback_Type type, void *event_info);
938 * @defgroup Evas_Group Top Level Functions
940 * Functions that affect Evas as a whole.
946 * @return The init counter value.
948 * This function initializes Evas and increments a counter of the
949 * number of calls to it. It returs the new counter's value.
951 * @see evas_shutdown().
953 * Most EFL users wouldn't be using this function directly, because
954 * they wouldn't access Evas directly by themselves. Instead, they
955 * would be using higher level helpers, like @c ecore_evas_init().
956 * See http://docs.enlightenment.org/auto/ecore/.
958 * You should be using this if your use is something like the
959 * following. The buffer engine is just one of the many ones Evas
962 * @dontinclude evas-buffer-simple.c
965 * And being the canvas creation something like:
966 * @skip static Evas *create_canvas
967 * @until evas_output_viewport_set(canvas,
969 * Note that this is code creating an Evas canvas with no usage of
970 * Ecore helpers at all -- no linkage with Ecore on this scenario,
971 * thus. Again, this wouldn't be on Evas common usage for most
972 * developers. See the full @ref Example_Evas_Buffer_Simple "example".
974 * @ingroup Evas_Group
976 EAPI int evas_init (void);
981 * @return Evas' init counter value.
983 * This function finalizes Evas, decrementing the counter of the
984 * number of calls to the function evas_init(). This new value for the
985 * counter is returned.
989 * If you were the sole user of Evas, by means of evas_init(), you can
990 * check if it's being properly shut down by expecting a return value
993 * Example code follows.
994 * @dontinclude evas-buffer-simple.c
995 * @skip // NOTE: use ecore_evas_buffer_new
996 * @until evas_shutdown
997 * Where that function would contain:
998 * @skip evas_free(canvas)
999 * @until evas_free(canvas)
1001 * Most users would be using ecore_evas_shutdown() instead, like told
1002 * in evas_init(). See the full @ref Example_Evas_Buffer_Simple
1005 * @ingroup Evas_Group
1007 EAPI int evas_shutdown (void);
1011 * Return if any allocation errors have occurred during the prior function
1012 * @return The allocation error flag
1014 * This function will return if any memory allocation errors occurred during,
1015 * and what kind they were. The return value will be one of
1016 * EVAS_ALLOC_ERROR_NONE, EVAS_ALLOC_ERROR_FATAL or EVAS_ALLOC_ERROR_RECOVERED
1017 * with each meaning something different.
1019 * EVAS_ALLOC_ERROR_NONE means that no errors occurred at all and the function
1020 * worked as expected.
1022 * EVAS_ALLOC_ERROR_FATAL means the function was completely unable to perform
1023 * its job and will have exited as cleanly as possible. The programmer
1024 * should consider this as a sign of very low memory and should try and safely
1025 * recover from the prior functions failure (or try free up memory elsewhere
1026 * and try again after more memory is freed).
1028 * EVAS_ALLOC_ERROR_RECOVERED means that an allocation error occurred, but was
1029 * recovered from by evas finding memory of its own it has allocated and
1030 * freeing what it sees as not really usefully allocated memory. What is freed
1031 * may vary. Evas may reduce the resolution of images, free cached images or
1032 * fonts, trhow out pre-rendered data, reduce the complexity of change lists
1033 * etc. Evas and the program will function as per normal after this, but this
1034 * is a sign of low memory, and it is suggested that the program try and
1035 * identify memory it doesn't need, and free it.
1039 * extern Evas_Object *object;
1040 * void callback (void *data, Evas *e, Evas_Object *obj, void *event_info);
1042 * evas_object_event_callback_add(object, EVAS_CALLBACK_MOUSE_DOWN, callback, NULL);
1043 * if (evas_alloc_error() == EVAS_ALLOC_ERROR_FATAL)
1045 * fprintf(stderr, "ERROR: Completely unable to attach callback. Must\n");
1046 * fprintf(stderr, " destroy object now as it cannot be used.\n");
1047 * evas_object_del(object);
1049 * fprintf(stderr, "WARNING: Memory is really low. Cleaning out RAM.\n");
1050 * my_memory_cleanup();
1052 * if (evas_alloc_error() == EVAS_ALLOC_ERROR_RECOVERED)
1054 * fprintf(stderr, "WARNING: Memory is really low. Cleaning out RAM.\n");
1055 * my_memory_cleanup();
1059 * @ingroup Evas_Group
1061 EAPI Evas_Alloc_Error evas_alloc_error (void);
1065 * @brief Get evas' internal asynchronous events read file descriptor.
1067 * @return The canvas' asynchronous events read file descriptor.
1069 * Evas' asynchronous events are meant to be dealt with internally,
1070 * i. e., when building stuff to be glued together into the EFL
1071 * infrastructure -- a module, for example. The context which demands
1072 * its use is when calculations need to be done out of the main
1073 * thread, asynchronously, and some action must be performed after
1076 * An example of actual use of this API is for image asynchronous
1077 * preload inside evas. If the canvas was instantiated through
1078 * ecore-evas usage, ecore itself will take care of calling those
1079 * events' processing.
1081 * This function returns the read file descriptor where to get the
1082 * asynchronous events of the canvas. Naturally, other mainloops,
1083 * apart from ecore, may make use of it.
1085 * @ingroup Evas_Group
1087 EAPI int evas_async_events_fd_get (void) EINA_WARN_UNUSED_RESULT EINA_PURE;
1090 * @brief Trigger the processing of all events waiting on the file
1091 * descriptor returned by evas_async_events_fd_get().
1093 * @return The number of events processed.
1095 * All asynchronous events queued up by evas_async_events_put() are
1096 * processed here. More precisely, the callback functions, informed
1097 * together with other event parameters, when queued, get called (with
1098 * those parameters), in that order.
1100 * @ingroup Evas_Group
1102 EAPI int evas_async_events_process (void);
1105 * Insert asynchronous events on the canvas.
1107 * @param target The target to be affected by the events.
1108 * @param type The type of callback function.
1109 * @param event_info Information about the event.
1110 * @param func The callback function pointer.
1112 * This is the way, for a routine running outside evas' main thread,
1113 * to report an asynchronous event. A callback function is informed,
1114 * whose call is to happen after evas_async_events_process() is
1117 * @ingroup Evas_Group
1119 EAPI Eina_Bool evas_async_events_put (const void *target, Evas_Callback_Type type, void *event_info, Evas_Async_Events_Put_Cb func) EINA_ARG_NONNULL(1, 4);
1122 * @defgroup Evas_Canvas Canvas Functions
1124 * Low level Evas canvas functions. Sub groups will present more high
1125 * level ones, though.
1127 * Most of these functions deal with low level Evas actions, like:
1128 * @li create/destroy raw canvases, not bound to any displaying engine
1129 * @li tell a canvas i got focused (in a windowing context, for example)
1130 * @li tell a canvas a region should not be calculated anymore in rendering
1131 * @li tell a canvas to render its contents, immediately
1133 * Most users will be using Evas by means of the @c Ecore_Evas
1134 * wrapper, which deals with all the above mentioned issues
1135 * automatically for them. Thus, you'll be looking at this section
1136 * only if you're building low level stuff.
1138 * The groups within present you functions that deal with the canvas
1139 * directly, too, and not yet with its @b objects. They are the
1140 * functions you need to use at a minimum to get a working canvas.
1142 * Some of the funcions in this group are exemplified @ref
1143 * Example_Evas_Events "here".
1147 * Creates a new empty evas.
1149 * Note that before you can use the evas, you will to at a minimum:
1150 * @li Set its render method with @ref evas_output_method_set .
1151 * @li Set its viewport size with @ref evas_output_viewport_set .
1152 * @li Set its size of the canvas with @ref evas_output_size_set .
1153 * @li Ensure that the render engine is given the correct settings
1154 * with @ref evas_engine_info_set .
1156 * This function should only fail if the memory allocation fails
1158 * @note this function is very low level. Instead of using it
1159 * directly, consider using the high level functions in
1160 * Ecore_Evas such as @c ecore_evas_new(). See
1161 * http://docs.enlightenment.org/auto/ecore/.
1163 * @attention it is recommended that one calls evas_init() before
1164 * creating new canvas.
1166 * @return A new uninitialised Evas canvas on success. Otherwise, @c
1168 * @ingroup Evas_Canvas
1170 EAPI Evas *evas_new (void) EINA_WARN_UNUSED_RESULT EINA_MALLOC;
1173 * Frees the given evas and any objects created on it.
1175 * Any objects with 'free' callbacks will have those callbacks called
1178 * @param e The given evas.
1180 * @ingroup Evas_Canvas
1182 EAPI void evas_free (Evas *e) EINA_ARG_NONNULL(1);
1186 * Inform to the evas that it got the focus.
1188 * @param e The evas to change information.
1189 * @ingroup Evas_Canvas
1191 EAPI void evas_focus_in (Evas *e);
1194 * Inform to the evas that it lost the focus.
1196 * @param e The evas to change information.
1197 * @ingroup Evas_Canvas
1199 EAPI void evas_focus_out (Evas *e);
1202 * Get the focus state known by the given evas
1204 * @param e The evas to query information.
1205 * @ingroup Evas_Canvas
1207 EAPI Eina_Bool evas_focus_state_get (const Evas *e) EINA_PURE;
1210 * Push the nochange flag up 1
1212 * This tells evas, that while the nochange flag is greater than 0, do not
1213 * mark objects as "changed" when making changes.
1215 * @param e The evas to change information.
1216 * @ingroup Evas_Canvas
1218 EAPI void evas_nochange_push (Evas *e);
1221 * Pop the nochange flag down 1
1223 * This tells evas, that while the nochange flag is greater than 0, do not
1224 * mark objects as "changed" when making changes.
1226 * @param e The evas to change information.
1227 * @ingroup Evas_Canvas
1229 EAPI void evas_nochange_pop (Evas *e);
1233 * Attaches a specific pointer to the evas for fetching later
1235 * @param e The canvas to attach the pointer to
1236 * @param data The pointer to attach
1237 * @ingroup Evas_Canvas
1239 EAPI void evas_data_attach_set (Evas *e, void *data) EINA_ARG_NONNULL(1);
1242 * Returns the pointer attached by evas_data_attach_set()
1244 * @param e The canvas to attach the pointer to
1245 * @return The pointer attached
1246 * @ingroup Evas_Canvas
1248 EAPI void *evas_data_attach_get (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
1252 * Add a damage rectangle.
1254 * @param e The given canvas pointer.
1255 * @param x The rectangle's left position.
1256 * @param y The rectangle's top position.
1257 * @param w The rectangle's width.
1258 * @param h The rectangle's height.
1260 * This is the function by which one tells evas that a part of the
1261 * canvas has to be repainted.
1263 * @ingroup Evas_Canvas
1265 EAPI void evas_damage_rectangle_add (Evas *e, int x, int y, int w, int h) EINA_ARG_NONNULL(1);
1268 * Add an "obscured region" to an Evas canvas.
1270 * @param e The given canvas pointer.
1271 * @param x The rectangle's top left corner's horizontal coordinate.
1272 * @param y The rectangle's top left corner's vertical coordinate
1273 * @param w The rectangle's width.
1274 * @param h The rectangle's height.
1276 * This is the function by which one tells an Evas canvas that a part
1277 * of it <b>must not</b> be repainted. The region must be
1278 * rectangular and its coordinates inside the canvas viewport are
1279 * passed in the call. After this call, the region specified won't
1280 * participate in any form in Evas' calculations and actions during
1281 * its rendering updates, having its displaying content frozen as it
1282 * was just after this function took place.
1284 * We call it "obscured region" because the most common use case for
1285 * this rendering (partial) freeze is something else (most problaby
1286 * other canvas) being on top of the specified rectangular region,
1287 * thus shading it completely from the user's final scene in a
1288 * display. To avoid unecessary processing, one should indicate to the
1289 * obscured canvas not to bother about the non-important area.
1291 * The majority of users won't have to worry about this funcion, as
1292 * they'll be using just one canvas in their applications, with
1293 * nothing inset or on top of it in any form.
1295 * To make this region one that @b has to be repainted again, call the
1296 * function evas_obscured_clear().
1298 * @note This is a <b>very low level function</b>, which most of
1299 * Evas' users wouldn't care about.
1301 * @note This function does @b not flag the canvas as having its state
1302 * changed. If you want to re-render it afterwards expecting new
1303 * contents, you have to add "damage" regions yourself (see
1304 * evas_damage_rectangle_add()).
1306 * @see evas_obscured_clear()
1307 * @see evas_render_updates()
1309 * Example code follows.
1310 * @dontinclude evas-events.c
1311 * @skip add an obscured
1312 * @until evas_obscured_clear(evas);
1314 * In that example, pressing the "Ctrl" and "o" keys will impose or
1315 * remove an obscured region in the middle of the canvas. You'll get
1316 * the same contents at the time the key was pressed, if toggling it
1317 * on, until you toggle it off again (make sure the animation is
1318 * running on to get the idea better). See the full @ref
1319 * Example_Evas_Events "example".
1321 * @ingroup Evas_Canvas
1323 EAPI void evas_obscured_rectangle_add (Evas *e, int x, int y, int w, int h) EINA_ARG_NONNULL(1);
1326 * Remove all "obscured regions" from an Evas canvas.
1328 * @param e The given canvas pointer.
1330 * This function removes all the rectangles from the obscured regions
1331 * list of the canvas @p e. It takes obscured areas added with
1332 * evas_obscured_rectangle_add() and make them again a regions that @b
1333 * have to be repainted on rendering updates.
1335 * @note This is a <b>very low level function</b>, which most of
1336 * Evas' users wouldn't care about.
1338 * @note This function does @b not flag the canvas as having its state
1339 * changed. If you want to re-render it afterwards expecting new
1340 * contents, you have to add "damage" regions yourself (see
1341 * evas_damage_rectangle_add()).
1343 * @see evas_obscured_rectangle_add() for an example
1344 * @see evas_render_updates()
1346 * @ingroup Evas_Canvas
1348 EAPI void evas_obscured_clear (Evas *e) EINA_ARG_NONNULL(1);
1351 * Force immediate renderization of the given Evas canvas.
1353 * @param e The given canvas pointer.
1354 * @return A newly allocated list of updated rectangles of the canvas
1355 * (@c Eina_Rectangle structs). Free this list with
1356 * evas_render_updates_free().
1358 * This function forces an immediate renderization update of the given
1361 * @note This is a <b>very low level function</b>, which most of
1362 * Evas' users wouldn't care about. One would use it, for example, to
1363 * grab an Evas' canvas update regions and paint them back, using the
1364 * canvas' pixmap, on a displaying system working below Evas.
1366 * @note Evas is a stateful canvas. If no operations changing its
1367 * state took place since the last rendering action, you won't see no
1368 * changes and this call will be a no-op.
1370 * Example code follows.
1371 * @dontinclude evas-events.c
1372 * @skip add an obscured
1373 * @until d.obscured = !d.obscured;
1375 * See the full @ref Example_Evas_Events "example".
1377 * @ingroup Evas_Canvas
1379 EAPI Eina_List *evas_render_updates (Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
1382 * Free the rectangles returned by evas_render_updates().
1384 * @param updates The list of updated rectangles of the canvas.
1386 * This function removes the region from the render updates list. It
1387 * makes the region doesn't be render updated anymore.
1389 * @see evas_render_updates() for an example
1391 * @ingroup Evas_Canvas
1393 EAPI void evas_render_updates_free (Eina_List *updates);
1396 * Force renderization of the given canvas.
1398 * @param e The given canvas pointer.
1400 * @ingroup Evas_Canvas
1402 EAPI void evas_render (Evas *e) EINA_ARG_NONNULL(1);
1405 * Update the canvas internal objects but not triggering immediate
1408 * @param e The given canvas pointer.
1410 * This function updates the canvas internal objects not triggering
1411 * renderization. To force renderization function evas_render() should
1416 * @ingroup Evas_Canvas
1418 EAPI void evas_norender (Evas *e) EINA_ARG_NONNULL(1);
1421 * Make the canvas discard internally cached data used for rendering.
1423 * @param e The given canvas pointer.
1425 * This function flushes the arrays of delete, active and render objects.
1426 * Other things it may also discard are: shared memory segments,
1427 * temporary scratch buffers, cached data to avoid re-compute of that data etc.
1429 * @ingroup Evas_Canvas
1431 EAPI void evas_render_idle_flush (Evas *e) EINA_ARG_NONNULL(1);
1434 * Make the canvas discard as much data as possible used by the engine at
1437 * @param e The given canvas pointer.
1439 * This function will unload images, delete textures and much more, where
1440 * possible. You may also want to call evas_render_idle_flush() immediately
1441 * prior to this to perhaps discard a little more, though evas_render_dump()
1442 * should implicitly delete most of what evas_render_idle_flush() might
1445 * @ingroup Evas_Canvas
1447 EAPI void evas_render_dump (Evas *e) EINA_ARG_NONNULL(1);
1450 * @defgroup Evas_Output_Method Render Engine Functions
1452 * Functions that are used to set the render engine for a given
1453 * function, and then get that engine working.
1455 * The following code snippet shows how they can be used to
1456 * initialise an evas that uses the X11 software engine:
1459 * Evas_Engine_Info_Software_X11 *einfo;
1460 * extern Display *display;
1461 * extern Window win;
1465 * evas = evas_new();
1466 * evas_output_method_set(evas, evas_render_method_lookup("software_x11"));
1467 * evas_output_size_set(evas, 640, 480);
1468 * evas_output_viewport_set(evas, 0, 0, 640, 480);
1469 * einfo = (Evas_Engine_Info_Software_X11 *)evas_engine_info_get(evas);
1470 * einfo->info.display = display;
1471 * einfo->info.visual = DefaultVisual(display, DefaultScreen(display));
1472 * einfo->info.colormap = DefaultColormap(display, DefaultScreen(display));
1473 * einfo->info.drawable = win;
1474 * einfo->info.depth = DefaultDepth(display, DefaultScreen(display));
1475 * evas_engine_info_set(evas, (Evas_Engine_Info *)einfo);
1478 * @ingroup Evas_Canvas
1482 * Look up a numeric ID from a string name of a rendering engine.
1484 * @param name The string name of an engine
1485 * @return A numeric (opaque) ID for the rendering engine
1486 * @ingroup Evas_Output_Method
1488 * This function looks up a numeric return value for the named engine
1489 * in the string @p name. This is a normal C string, NUL byte
1490 * terminated. The name is case sensitive. If the rendering engine is
1491 * available, a numeric ID for that engine is returned that is not
1492 * 0. If the engine is not available, 0 is returned, indicating an
1495 * The programmer should NEVER rely on the numeric ID of an engine
1496 * unless it is returned by this function. Programs should NOT be
1497 * written accessing render method ID's directly, without first
1498 * obtaining it from this function.
1500 * @attention it is mandatory that one calls evas_init() before
1501 * looking up the render method.
1510 * evas = evas_new();
1513 * fprintf(stderr, "ERROR: Canvas creation failed. Fatal error.\n");
1516 * engine_id = evas_render_method_lookup("software_x11");
1519 * fprintf(stderr, "ERROR: Requested rendering engine is absent.\n");
1522 * evas_output_method_set(evas, engine_id);
1525 EAPI int evas_render_method_lookup (const char *name) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
1528 * List all the rendering engines compiled into the copy of the Evas library
1530 * @return A linked list whose data members are C strings of engine names
1531 * @ingroup Evas_Output_Method
1533 * Calling this will return a handle (pointer) to an Evas linked
1534 * list. Each node in the linked list will have the data pointer be a
1535 * (char *) pointer to the string name of the rendering engine
1536 * available. The strings should never be modified, neither should the
1537 * list be modified. This list should be cleaned up as soon as the
1538 * program no longer needs it using evas_render_method_list_free(). If
1539 * no engines are available from Evas, NULL will be returned.
1543 * Eina_List *engine_list, *l;
1544 * char *engine_name;
1546 * engine_list = evas_render_method_list();
1549 * fprintf(stderr, "ERROR: Evas supports no engines! Exit.\n");
1552 * printf("Available Evas Engines:\n");
1553 * EINA_LIST_FOREACH(engine_list, l, engine_name)
1554 * printf("%s\n", engine_name);
1555 * evas_render_method_list_free(engine_list);
1558 EAPI Eina_List *evas_render_method_list (void) EINA_WARN_UNUSED_RESULT;
1561 * This function should be called to free a list of engine names
1563 * @param list The Eina_List base pointer for the engine list to be freed
1564 * @ingroup Evas_Output_Method
1566 * When this function is called it will free the engine list passed in
1567 * as @p list. The list should only be a list of engines generated by
1568 * calling evas_render_method_list(). If @p list is NULL, nothing will
1573 * Eina_List *engine_list, *l;
1574 * char *engine_name;
1576 * engine_list = evas_render_method_list();
1579 * fprintf(stderr, "ERROR: Evas supports no engines! Exit.\n");
1582 * printf("Available Evas Engines:\n");
1583 * EINA_LIST_FOREACH(engine_list, l, engine_name)
1584 * printf("%s\n", engine_name);
1585 * evas_render_method_list_free(engine_list);
1588 EAPI void evas_render_method_list_free (Eina_List *list);
1592 * Sets the output engine for the given evas.
1594 * Once the output engine for an evas is set, any attempt to change it
1595 * will be ignored. The value for @p render_method can be found using
1596 * @ref evas_render_method_lookup .
1598 * @param e The given evas.
1599 * @param render_method The numeric engine value to use.
1601 * @attention it is mandatory that one calls evas_init() before
1602 * setting the output method.
1604 * @ingroup Evas_Output_Method
1606 EAPI void evas_output_method_set (Evas *e, int render_method) EINA_ARG_NONNULL(1);
1609 * Retrieves the number of the output engine used for the given evas.
1610 * @param e The given evas.
1611 * @return The ID number of the output engine being used. @c 0 is
1612 * returned if there is an error.
1613 * @ingroup Evas_Output_Method
1615 EAPI int evas_output_method_get (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
1619 * Retrieves the current render engine info struct from the given evas.
1621 * The returned structure is publicly modifiable. The contents are
1622 * valid until either @ref evas_engine_info_set or @ref evas_render
1625 * This structure does not need to be freed by the caller.
1627 * @param e The given evas.
1628 * @return A pointer to the Engine Info structure. @c NULL is returned if
1629 * an engine has not yet been assigned.
1630 * @ingroup Evas_Output_Method
1632 EAPI Evas_Engine_Info *evas_engine_info_get (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
1635 * Applies the engine settings for the given evas from the given @c
1636 * Evas_Engine_Info structure.
1638 * To get the Evas_Engine_Info structure to use, call @ref
1639 * evas_engine_info_get . Do not try to obtain a pointer to an
1640 * @c Evas_Engine_Info structure in any other way.
1642 * You will need to call this function at least once before you can
1643 * create objects on an evas or render that evas. Some engines allow
1644 * their settings to be changed more than once.
1646 * Once called, the @p info pointer should be considered invalid.
1648 * @param e The pointer to the Evas Canvas
1649 * @param info The pointer to the Engine Info to use
1650 * @return 1 if no error occurred, 0 otherwise
1651 * @ingroup Evas_Output_Method
1653 EAPI Eina_Bool evas_engine_info_set (Evas *e, Evas_Engine_Info *info) EINA_ARG_NONNULL(1);
1656 * @defgroup Evas_Output_Size Output and Viewport Resizing Functions
1658 * Functions that set and retrieve the output and viewport size of an
1661 * @ingroup Evas_Canvas
1665 * Sets the output size of the render engine of the given evas.
1667 * The evas will render to a rectangle of the given size once this
1668 * function is called. The output size is independent of the viewport
1669 * size. The viewport will be stretched to fill the given rectangle.
1671 * The units used for @p w and @p h depend on the engine used by the
1674 * @param e The given evas.
1675 * @param w The width in output units, usually pixels.
1676 * @param h The height in output units, usually pixels.
1677 * @ingroup Evas_Output_Size
1679 EAPI void evas_output_size_set (Evas *e, int w, int h) EINA_ARG_NONNULL(1);
1682 * Retrieve the output size of the render engine of the given evas.
1684 * The output size is given in whatever the output units are for the
1687 * If either @p w or @p h is @c NULL, then it is ignored. If @p e is
1688 * invalid, the returned results are undefined.
1690 * @param e The given evas.
1691 * @param w The pointer to an integer to store the width in.
1692 * @param h The pointer to an integer to store the height in.
1693 * @ingroup Evas_Output_Size
1695 EAPI void evas_output_size_get (const Evas *e, int *w, int *h) EINA_ARG_NONNULL(1);
1698 * Sets the output viewport of the given evas in evas units.
1700 * The output viewport is the area of the evas that will be visible to
1701 * the viewer. The viewport will be stretched to fit the output
1702 * target of the evas when rendering is performed.
1704 * @note The coordinate values do not have to map 1-to-1 with the output
1705 * target. However, it is generally advised that it is done for ease
1708 * @param e The given evas.
1709 * @param x The top-left corner x value of the viewport.
1710 * @param y The top-left corner y value of the viewport.
1711 * @param w The width of the viewport. Must be greater than 0.
1712 * @param h The height of the viewport. Must be greater than 0.
1713 * @ingroup Evas_Output_Size
1715 EAPI void evas_output_viewport_set (Evas *e, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h) EINA_ARG_NONNULL(1);
1718 * Get the render engine's output viewport co-ordinates in canvas units.
1719 * @param e The pointer to the Evas Canvas
1720 * @param x The pointer to a x variable to be filled in
1721 * @param y The pointer to a y variable to be filled in
1722 * @param w The pointer to a width variable to be filled in
1723 * @param h The pointer to a height variable to be filled in
1724 * @ingroup Evas_Output_Size
1726 * Calling this function writes the current canvas output viewport
1727 * size and location values into the variables pointed to by @p x, @p
1728 * y, @p w and @p h. On success the variables have the output
1729 * location and size values written to them in canvas units. Any of @p
1730 * x, @p y, @p w or @p h that are NULL will not be written to. If @p e
1731 * is invalid, the results are undefined.
1735 * extern Evas *evas;
1736 * Evas_Coord x, y, width, height;
1738 * evas_output_viewport_get(evas, &x, &y, &w, &h);
1741 EAPI void evas_output_viewport_get (const Evas *e, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h) EINA_ARG_NONNULL(1);
1744 * @defgroup Evas_Coord_Mapping_Group Coordinate Mapping Functions
1746 * Functions that are used to map coordinates from the canvas to the
1747 * screen or the screen to the canvas.
1749 * @ingroup Evas_Canvas
1753 * Convert/scale an ouput screen co-ordinate into canvas co-ordinates
1755 * @param e The pointer to the Evas Canvas
1756 * @param x The screen/output x co-ordinate
1757 * @return The screen co-ordinate translated to canvas unit co-ordinates
1758 * @ingroup Evas_Coord_Mapping_Group
1760 * This function takes in a horizontal co-ordinate as the @p x
1761 * parameter and converts it into canvas units, accounting for output
1762 * size, viewport size and location, returning it as the function
1763 * return value. If @p e is invalid, the results are undefined.
1767 * extern Evas *evas;
1768 * extern int screen_x;
1769 * Evas_Coord canvas_x;
1771 * canvas_x = evas_coord_screen_x_to_world(evas, screen_x);
1774 EAPI Evas_Coord evas_coord_screen_x_to_world (const Evas *e, int x) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
1777 * Convert/scale an ouput screen co-ordinate into canvas co-ordinates
1779 * @param e The pointer to the Evas Canvas
1780 * @param y The screen/output y co-ordinate
1781 * @return The screen co-ordinate translated to canvas unit co-ordinates
1782 * @ingroup Evas_Coord_Mapping_Group
1784 * This function takes in a vertical co-ordinate as the @p y parameter
1785 * and converts it into canvas units, accounting for output size,
1786 * viewport size and location, returning it as the function return
1787 * value. If @p e is invalid, the results are undefined.
1791 * extern Evas *evas;
1792 * extern int screen_y;
1793 * Evas_Coord canvas_y;
1795 * canvas_y = evas_coord_screen_y_to_world(evas, screen_y);
1798 EAPI Evas_Coord evas_coord_screen_y_to_world (const Evas *e, int y) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
1801 * Convert/scale a canvas co-ordinate into output screen co-ordinates
1803 * @param e The pointer to the Evas Canvas
1804 * @param x The canvas x co-ordinate
1805 * @return The output/screen co-ordinate translated to output co-ordinates
1806 * @ingroup Evas_Coord_Mapping_Group
1808 * This function takes in a horizontal co-ordinate as the @p x
1809 * parameter and converts it into output units, accounting for output
1810 * size, viewport size and location, returning it as the function
1811 * return value. If @p e is invalid, the results are undefined.
1815 * extern Evas *evas;
1817 * extern Evas_Coord canvas_x;
1819 * screen_x = evas_coord_world_x_to_screen(evas, canvas_x);
1822 EAPI int evas_coord_world_x_to_screen (const Evas *e, Evas_Coord x) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
1825 * Convert/scale a canvas co-ordinate into output screen co-ordinates
1827 * @param e The pointer to the Evas Canvas
1828 * @param y The canvas y co-ordinate
1829 * @return The output/screen co-ordinate translated to output co-ordinates
1830 * @ingroup Evas_Coord_Mapping_Group
1832 * This function takes in a vertical co-ordinate as the @p x parameter
1833 * and converts it into output units, accounting for output size,
1834 * viewport size and location, returning it as the function return
1835 * value. If @p e is invalid, the results are undefined.
1839 * extern Evas *evas;
1841 * extern Evas_Coord canvas_y;
1843 * screen_y = evas_coord_world_y_to_screen(evas, canvas_y);
1846 EAPI int evas_coord_world_y_to_screen (const Evas *e, Evas_Coord y) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
1849 * @defgroup Evas_Pointer_Group Pointer (Mouse) Functions
1851 * Functions that deal with the status of the pointer (mouse cursor).
1853 * @ingroup Evas_Canvas
1857 * This function returns the current known pointer co-ordinates
1859 * @param e The pointer to the Evas Canvas
1860 * @param x The pointer to an integer to be filled in
1861 * @param y The pointer to an integer to be filled in
1862 * @ingroup Evas_Pointer_Group
1864 * This function returns the current known screen/output co-ordinates
1865 * of the mouse pointer and sets the contents of the integers pointed
1866 * to by @p x and @p y to contain these co-ordinates. If @p e is not a
1867 * valid canvas the results of this function are undefined.
1871 * extern Evas *evas;
1872 * int mouse_x, mouse_y;
1874 * evas_pointer_output_xy_get(evas, &mouse_x, &mouse_y);
1875 * printf("Mouse is at screen position %i, %i\n", mouse_x, mouse_y);
1878 EAPI void evas_pointer_output_xy_get (const Evas *e, int *x, int *y) EINA_ARG_NONNULL(1);
1881 * This function returns the current known pointer co-ordinates
1883 * @param e The pointer to the Evas Canvas
1884 * @param x The pointer to a Evas_Coord to be filled in
1885 * @param y The pointer to a Evas_Coord to be filled in
1886 * @ingroup Evas_Pointer_Group
1888 * This function returns the current known canvas unit co-ordinates of
1889 * the mouse pointer and sets the contents of the Evas_Coords pointed
1890 * to by @p x and @p y to contain these co-ordinates. If @p e is not a
1891 * valid canvas the results of this function are undefined.
1895 * extern Evas *evas;
1896 * Evas_Coord mouse_x, mouse_y;
1898 * evas_pointer_output_xy_get(evas, &mouse_x, &mouse_y);
1899 * printf("Mouse is at canvas position %f, %f\n", mouse_x, mouse_y);
1902 EAPI void evas_pointer_canvas_xy_get (const Evas *e, Evas_Coord *x, Evas_Coord *y) EINA_ARG_NONNULL(1);
1905 * Returns a bitmask with the mouse buttons currently pressed, set to 1
1907 * @param e The pointer to the Evas Canvas
1908 * @return A bitmask of the currently depressed buttons on the cavas
1909 * @ingroup Evas_Pointer_Group
1911 * Calling this function will return a 32-bit integer with the
1912 * appropriate bits set to 1 that correspond to a mouse button being
1913 * depressed. This limits Evas to a mouse devices with a maximum of 32
1914 * buttons, but that is generally in excess of any host system's
1915 * pointing device abilities.
1917 * A canvas by default begins with no mouse buttons being pressed and
1918 * only calls to evas_event_feed_mouse_down(),
1919 * evas_event_feed_mouse_down_data(), evas_event_feed_mouse_up() and
1920 * evas_event_feed_mouse_up_data() will alter that.
1922 * The least significant bit corresponds to the first mouse button
1923 * (button 1) and the most significant bit corresponds to the last
1924 * mouse button (button 32).
1926 * If @p e is not a valid canvas, the return value is undefined.
1930 * extern Evas *evas;
1931 * int button_mask, i;
1933 * button_mask = evas_pointer_button_down_mask_get(evas);
1934 * printf("Buttons currently pressed:\n");
1935 * for (i = 0; i < 32; i++)
1937 * if ((button_mask & (1 << i)) != 0) printf("Button %i\n", i + 1);
1941 EAPI int evas_pointer_button_down_mask_get (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
1944 * Returns whether the mouse pointer is logically inside the canvas
1946 * @param e The pointer to the Evas Canvas
1947 * @return An integer that is 1 if the mouse is inside the canvas, 0 otherwise
1948 * @ingroup Evas_Pointer_Group
1950 * When this function is called it will return a value of either 0 or
1951 * 1, depending on if evas_event_feed_mouse_in(),
1952 * evas_event_feed_mouse_in_data(), or evas_event_feed_mouse_out(),
1953 * evas_event_feed_mouse_out_data() have been called to feed in a
1954 * mouse enter event into the canvas.
1956 * A return value of 1 indicates the mouse is logically inside the
1957 * canvas, and 0 implies it is logically outside the canvas.
1959 * A canvas begins with the mouse being assumed outside (0).
1961 * If @p e is not a valid canvas, the return value is undefined.
1965 * extern Evas *evas;
1967 * if (evas_pointer_inside_get(evas)) printf("Mouse is in!\n");
1968 * else printf("Mouse is out!\n");
1971 EAPI Eina_Bool evas_pointer_inside_get (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
1972 EAPI void evas_sync(Evas *e) EINA_ARG_NONNULL(1);
1975 * @defgroup Evas_Canvas_Events Canvas Events
1977 * Functions relating to canvas events, which are mainly reports on
1978 * its internal states changing (an object got focused, the rendering
1981 * Some of the funcions in this group are exemplified @ref
1982 * Example_Evas_Events "here".
1984 * @ingroup Evas_Canvas
1988 * @addtogroup Evas_Canvas_Events
1993 * Add (register) a callback function to a given canvas event.
1995 * @param e Canvas to attach a callback to
1996 * @param type The type of event that will trigger the callback
1997 * @param func The (callback) function to be called when the event is
1999 * @param data The data pointer to be passed to @p func
2001 * This function adds a function callback to the canvas @p e when the
2002 * event of type @p type occurs on it. The function pointer is @p
2005 * In the event of a memory allocation error during the addition of
2006 * the callback to the canvas, evas_alloc_error() should be used to
2007 * determine the nature of the error, if any, and the program should
2008 * sensibly try and recover.
2010 * A callback function must have the ::Evas_Event_Cb prototype
2011 * definition. The first parameter (@p data) in this definition will
2012 * have the same value passed to evas_event_callback_add() as the @p
2013 * data parameter, at runtime. The second parameter @p e is the canvas
2014 * pointer on which the event occurred. The third parameter @p
2015 * event_info is a pointer to a data structure that may or may not be
2016 * passed to the callback, depending on the event type that triggered
2017 * the callback. This is so because some events don't carry extra
2018 * context with them, but others do.
2020 * The event type @p type to trigger the function may be one of
2021 * #EVAS_CALLBACK_RENDER_FLUSH_PRE, #EVAS_CALLBACK_RENDER_FLUSH_POST,
2022 * #EVAS_CALLBACK_CANVAS_FOCUS_IN, #EVAS_CALLBACK_CANVAS_FOCUS_OUT,
2023 * #EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_IN and
2024 * #EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_OUT. This determines the kind of
2025 * event that will trigger the callback to be called. Only the last
2026 * two of the event types listed here provide useful event information
2027 * data -- a pointer to the recently focused Evas object. For the
2028 * others the @p event_info pointer is going to be @c NULL.
2031 * @dontinclude evas-events.c
2032 * @skip evas_event_callback_add(d.canvas, EVAS_CALLBACK_RENDER_FLUSH_PRE
2033 * @until two canvas event callbacks
2035 * Looking to the callbacks registered above,
2036 * @dontinclude evas-events.c
2037 * @skip called when our rectangle gets focus
2038 * @until let's have our events back
2040 * we see that the canvas flushes its rendering pipeline
2041 * (#EVAS_CALLBACK_RENDER_FLUSH_PRE) whenever the @c _resize_cb
2042 * routine takes place: it has to redraw that image at a different
2043 * size. Also, the callback on an object being focused comes just
2044 * after we focus it explicitly, on code.
2046 * See the full @ref Example_Evas_Events "example".
2048 * @note Be careful not to add the same callback multiple times, if
2049 * that's not what you want, because Evas won't check if a callback
2050 * existed before exactly as the one being registered (and thus, call
2051 * it more than once on the event, in this case). This would make
2052 * sense if you passed different functions and/or callback data, only.
2054 EAPI void evas_event_callback_add (Evas *e, Evas_Callback_Type type, Evas_Event_Cb func, const void *data) EINA_ARG_NONNULL(1, 3);
2057 * Delete a callback function from the canvas.
2059 * @param e Canvas to remove a callback from
2060 * @param type The type of event that was triggering the callback
2061 * @param func The function that was to be called when the event was triggered
2062 * @return The data pointer that was to be passed to the callback
2064 * This function removes the most recently added callback from the
2065 * canvas @p e which was triggered by the event type @p type and was
2066 * calling the function @p func when triggered. If the removal is
2067 * successful it will also return the data pointer that was passed to
2068 * evas_event_callback_add() when the callback was added to the
2069 * canvas. If not successful NULL will be returned.
2075 * void focus_in_callback(void *data, Evas *e, void *event_info);
2077 * my_data = evas_event_callback_del(ebject, EVAS_CALLBACK_CANVAS_FOCUS_IN, focus_in_callback);
2080 EAPI void *evas_event_callback_del (Evas *e, Evas_Callback_Type type, Evas_Event_Cb func) EINA_ARG_NONNULL(1, 3);
2083 * Delete (unregister) a callback function registered to a given
2086 * @param e Canvas to remove an event callback from
2087 * @param type The type of event that was triggering the callback
2088 * @param func The function that was to be called when the event was
2090 * @param data The data pointer that was to be passed to the callback
2091 * @return The data pointer that was to be passed to the callback
2093 * This function removes <b>the first</b> added callback from the
2094 * canvas @p e matching the event type @p type, the registered
2095 * function pointer @p func and the callback data pointer @p data. If
2096 * the removal is successful it will also return the data pointer that
2097 * was passed to evas_event_callback_add() (that will be the same as
2098 * the parameter) when the callback(s) was(were) added to the
2099 * canvas. If not successful @c NULL will be returned. A common use
2100 * would be to remove an exact match of a callback.
2103 * @dontinclude evas-events.c
2104 * @skip evas_event_callback_del_full(evas, EVAS_CALLBACK_RENDER_FLUSH_PRE,
2105 * @until _object_focus_in_cb, NULL);
2107 * See the full @ref Example_Evas_Events "example".
2109 * @note For deletion of canvas events callbacks filtering by just
2110 * type and function pointer, user evas_event_callback_del().
2112 EAPI void *evas_event_callback_del_full (Evas *e, Evas_Callback_Type type, Evas_Event_Cb func, const void *data) EINA_ARG_NONNULL(1, 3);
2115 * Push a callback on the post-event callback stack
2117 * @param e Canvas to push the callback on
2118 * @param func The function that to be called when the stack is unwound
2119 * @param data The data pointer to be passed to the callback
2121 * Evas has a stack of callbacks that get called after all the callbacks for
2122 * an event have triggered (all the objects it triggers on and al the callbacks
2123 * in each object triggered). When all these have been called, the stack is
2124 * unwond from most recently to least recently pushed item and removed from the
2125 * stack calling the callback set for it.
2127 * This is intended for doing reverse logic-like processing, example - when a
2128 * child object that happens to get the event later is meant to be able to
2129 * "steal" functions from a parent and thus on unwind of this stack hav its
2130 * function called first, thus being able to set flags, or return 0 from the
2131 * post-callback that stops all other post-callbacks in the current stack from
2132 * being called (thus basically allowing a child to take control, if the event
2133 * callback prepares information ready for taking action, but the post callback
2134 * actually does the action).
2137 EAPI void evas_post_event_callback_push (Evas *e, Evas_Object_Event_Post_Cb func, const void *data);
2140 * Remove a callback from the post-event callback stack
2142 * @param e Canvas to push the callback on
2143 * @param func The function that to be called when the stack is unwound
2145 * This removes a callback from the stack added with
2146 * evas_post_event_callback_push(). The first instance of the function in
2147 * the callback stack is removed from being executed when the stack is
2148 * unwound. Further instances may still be run on unwind.
2150 EAPI void evas_post_event_callback_remove (Evas *e, Evas_Object_Event_Post_Cb func);
2153 * Remove a callback from the post-event callback stack
2155 * @param e Canvas to push the callback on
2156 * @param func The function that to be called when the stack is unwound
2157 * @param data The data pointer to be passed to the callback
2159 * This removes a callback from the stack added with
2160 * evas_post_event_callback_push(). The first instance of the function and data
2161 * in the callback stack is removed from being executed when the stack is
2162 * unwound. Further instances may still be run on unwind.
2164 EAPI void evas_post_event_callback_remove_full (Evas *e, Evas_Object_Event_Post_Cb func, const void *data);
2167 * @defgroup Evas_Event_Freezing_Group Input Events Freezing Functions
2169 * Functions that deal with the freezing of input event processing of
2172 * There might be scenarios during a graphical user interface
2173 * program's use when the developer whishes the users wouldn't be able
2174 * to deliver input events to this application. It may, for example,
2175 * be the time for it to populate a view or to change some
2176 * layout. Assuming proper behavior with user interaction during this
2177 * exact time would be hard, as things are in a changing state. The
2178 * programmer can then tell the canvas to ignore input events,
2179 * bringing it back to normal behavior when he/she wants.
2181 * Some of the funcions in this group are exemplified @ref
2182 * Example_Evas_Events "here".
2184 * @ingroup Evas_Canvas_Events
2188 * @addtogroup Evas_Event_Freezing_Group
2193 * Freeze all input events processing.
2195 * @param e The canvas to freeze input events processing on.
2197 * This function will indicate to Evas that the canvas @p e is to have
2198 * all input event processing frozen until a matching
2199 * evas_event_thaw() function is called on the same canvas. All events
2200 * of this kind during the freeze will get @b discarded. Every freeze
2201 * call must be matched by a thaw call in order to completely thaw out
2202 * a canvas (i.e. these calls may be nested). The most common use is
2203 * when you don't want the user to interect with your user interface
2204 * when you're populating a view or changing the layout.
2207 * @dontinclude evas-events.c
2208 * @skip freeze input for 3 seconds
2210 * @dontinclude evas-events.c
2211 * @skip let's have our events back
2214 * See the full @ref Example_Evas_Events "example".
2216 * If you run that example, you'll see the canvas ignoring all input
2217 * events for 3 seconds, when the "f" key is pressed. In a more
2218 * realistic code we would be freezing while a toolkit or Edje was
2219 * doing some UI changes, thawing it back afterwards.
2221 EAPI void evas_event_freeze (Evas *e) EINA_ARG_NONNULL(1);
2224 * Thaw a canvas out after freezing (for input events).
2226 * @param e The canvas to thaw out.
2228 * This will thaw out a canvas after a matching evas_event_freeze()
2229 * call. If this call completely thaws out a canvas, i.e., there's no
2230 * other unbalanced call to evas_event_freeze(), events will start to
2231 * be processed again, but any "missed" events will @b not be
2234 * See evas_event_freeze() for an example.
2236 EAPI void evas_event_thaw (Evas *e) EINA_ARG_NONNULL(1);
2239 * Return the freeze count on input events of a given canvas.
2241 * @param e The canvas to fetch the freeze count from.
2243 * This returns the number of times the canvas has been told to freeze
2244 * input events. It is possible to call evas_event_freeze() multiple
2245 * times, and these must be matched by evas_event_thaw() calls. This
2246 * call allows the program to discover just how many times things have
2247 * been frozen in case it may want to break out of a deep freeze state
2248 * where the count is high.
2252 * extern Evas *evas;
2254 * while (evas_event_freeze_get(evas) > 0) evas_event_thaw(evas);
2258 EAPI int evas_event_freeze_get (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
2261 * After thaw of a canvas, re-evaluate the state of objects and call callbacks
2263 * @param e The canvas to evaluate after a thaw
2265 * This is normally called after evas_event_thaw() to re-evaluate mouse
2266 * containment and other states and thus also call callbacks for mouse in and
2267 * out on new objects if the state change demands it.
2269 EAPI void evas_event_thaw_eval (Evas *e) EINA_ARG_NONNULL(1);
2276 * @defgroup Evas_Event_Feeding_Group Input Events Feeding Functions
2278 * Functions to tell Evas that input events happened and should be
2281 * As explained in @ref intro_not_evas, Evas does not know how to poll
2282 * for input events, so the developer should do it and then feed such
2283 * events to the canvas to be processed. This is only required if
2284 * operating Evas directly. Modules such as Ecore_Evas do that for
2287 * Some of the funcions in this group are exemplified @ref
2288 * Example_Evas_Events "here".
2290 * @ingroup Evas_Canvas_Events
2294 * @addtogroup Evas_Event_Feeding_Group
2299 * Mouse down event feed.
2301 * @param e The given canvas pointer.
2302 * @param b The button number.
2303 * @param flags The evas button flags.
2304 * @param timestamp The timestamp of the mouse down event.
2305 * @param data The data for canvas.
2307 * This function will set some evas properties that is necessary when
2308 * the mouse button is pressed. It prepares information to be treated
2309 * by the callback function.
2312 EAPI void evas_event_feed_mouse_down (Evas *e, int b, Evas_Button_Flags flags, unsigned int timestamp, const void *data) EINA_ARG_NONNULL(1);
2315 * Mouse up event feed.
2317 * @param e The given canvas pointer.
2318 * @param b The button number.
2319 * @param flags evas button flags.
2320 * @param timestamp The timestamp of the mouse up event.
2321 * @param data The data for canvas.
2323 * This function will set some evas properties that is necessary when
2324 * the mouse button is released. It prepares information to be treated
2325 * by the callback function.
2328 EAPI void evas_event_feed_mouse_up (Evas *e, int b, Evas_Button_Flags flags, unsigned int timestamp, const void *data) EINA_ARG_NONNULL(1);
2331 * Mouse move event feed.
2333 * @param e The given canvas pointer.
2334 * @param x The horizontal position of the mouse pointer.
2335 * @param y The vertical position of the mouse pointer.
2336 * @param timestamp The timestamp of the mouse up event.
2337 * @param data The data for canvas.
2339 * This function will set some evas properties that is necessary when
2340 * the mouse is moved from its last position. It prepares information
2341 * to be treated by the callback function.
2344 EAPI void evas_event_feed_mouse_move (Evas *e, int x, int y, unsigned int timestamp, const void *data) EINA_ARG_NONNULL(1);
2347 * Mouse in event feed.
2349 * @param e The given canvas pointer.
2350 * @param timestamp The timestamp of the mouse up event.
2351 * @param data The data for canvas.
2353 * This function will set some evas properties that is necessary when
2354 * the mouse in event happens. It prepares information to be treated
2355 * by the callback function.
2358 EAPI void evas_event_feed_mouse_in (Evas *e, unsigned int timestamp, const void *data) EINA_ARG_NONNULL(1);
2361 * Mouse out event feed.
2363 * @param e The given canvas pointer.
2364 * @param timestamp Timestamp of the mouse up event.
2365 * @param data The data for canvas.
2367 * This function will set some evas properties that is necessary when
2368 * the mouse out event happens. It prepares information to be treated
2369 * by the callback function.
2372 EAPI void evas_event_feed_mouse_out (Evas *e, unsigned int timestamp, const void *data) EINA_ARG_NONNULL(1);
2373 EAPI void evas_event_feed_multi_down (Evas *e, int d, int x, int y, double rad, double radx, double rady, double pres, double ang, double fx, double fy, Evas_Button_Flags flags, unsigned int timestamp, const void *data);
2374 EAPI void evas_event_feed_multi_up (Evas *e, int d, int x, int y, double rad, double radx, double rady, double pres, double ang, double fx, double fy, Evas_Button_Flags flags, unsigned int timestamp, const void *data);
2375 EAPI void evas_event_feed_multi_move (Evas *e, int d, int x, int y, double rad, double radx, double rady, double pres, double ang, double fx, double fy, unsigned int timestamp, const void *data);
2378 * Mouse cancel event feed.
2380 * @param e The given canvas pointer.
2381 * @param timestamp The timestamp of the mouse up event.
2382 * @param data The data for canvas.
2384 * This function will call evas_event_feed_mouse_up() when a
2385 * mouse cancel event happens.
2388 EAPI void evas_event_feed_mouse_cancel (Evas *e, unsigned int timestamp, const void *data) EINA_ARG_NONNULL(1);
2391 * Mouse wheel event feed.
2393 * @param e The given canvas pointer.
2394 * @param direction The wheel mouse direction.
2395 * @param z How much mouse wheel was scrolled up or down.
2396 * @param timestamp The timestamp of the mouse up event.
2397 * @param data The data for canvas.
2399 * This function will set some evas properties that is necessary when
2400 * the mouse wheel is scrolled up or down. It prepares information to
2401 * be treated by the callback function.
2404 EAPI void evas_event_feed_mouse_wheel (Evas *e, int direction, int z, unsigned int timestamp, const void *data) EINA_ARG_NONNULL(1);
2407 * Key down event feed
2409 * @param e The canvas to thaw out
2410 * @param keyname Name of the key
2411 * @param key The key pressed.
2412 * @param string A String
2413 * @param compose The compose string
2414 * @param timestamp Timestamp of the mouse up event
2415 * @param data Data for canvas.
2417 * This function will set some evas properties that is necessary when
2418 * a key is pressed. It prepares information to be treated by the
2419 * callback function.
2422 EAPI void evas_event_feed_key_down (Evas *e, const char *keyname, const char *key, const char *string, const char *compose, unsigned int timestamp, const void *data) EINA_ARG_NONNULL(1);
2427 * @param e The canvas to thaw out
2428 * @param keyname Name of the key
2429 * @param key The key released.
2430 * @param string string
2431 * @param compose compose
2432 * @param timestamp Timestamp of the mouse up event
2433 * @param data Data for canvas.
2435 * This function will set some evas properties that is necessary when
2436 * a key is released. It prepares information to be treated by the
2437 * callback function.
2440 EAPI void evas_event_feed_key_up (Evas *e, const char *keyname, const char *key, const char *string, const char *compose, unsigned int timestamp, const void *data) EINA_ARG_NONNULL(1);
2445 * @param e The given canvas pointer.
2446 * @param hold The hold.
2447 * @param timestamp The timestamp of the mouse up event.
2448 * @param data The data for canvas.
2450 * This function makes the object to stop sending events.
2453 EAPI void evas_event_feed_hold (Evas *e, int hold, unsigned int timestamp, const void *data) EINA_ARG_NONNULL(1);
2464 * @defgroup Evas_Image_Group Image Functions
2466 * Functions that deals with images at canvas level.
2468 * @ingroup Evas_Canvas
2472 * Flush the image cache of the canvas.
2474 * @param e The given evas pointer.
2476 * This function flushes image cache of canvas.
2479 EAPI void evas_image_cache_flush (Evas *e) EINA_ARG_NONNULL(1);
2482 * Reload the image cache
2484 * @param e The given evas pointer.
2486 * This function reloads the image cache of canvas.
2489 EAPI void evas_image_cache_reload (Evas *e) EINA_ARG_NONNULL(1);
2492 * Set the image cache.
2494 * @param e The given evas pointer.
2495 * @param size The cache size.
2497 * This function sets the image cache of canvas.
2500 EAPI void evas_image_cache_set (Evas *e, int size) EINA_ARG_NONNULL(1);
2503 * Set the image cache
2505 * @param e The given evas pointer.
2507 * This function returns the image cache of canvas.
2510 EAPI int evas_image_cache_get (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
2513 * @defgroup Evas_Font_Group Font Functions
2515 * Functions that deals with fonts.
2517 * @ingroup Evas_Canvas
2521 * Changes the font hinting for the given evas.
2523 * @param e The given evas.
2524 * @param hinting The hinting to use, one of #EVAS_FONT_HINTING_NONE,
2525 * #EVAS_FONT_HINTING_AUTO, #EVAS_FONT_HINTING_BYTECODE.
2526 * @ingroup Evas_Font_Group
2528 EAPI void evas_font_hinting_set (Evas *e, Evas_Font_Hinting_Flags hinting) EINA_ARG_NONNULL(1);
2531 * Retrieves the font hinting used by the given evas.
2533 * @param e The given evas to query.
2534 * @return The hinting in use, one of #EVAS_FONT_HINTING_NONE,
2535 * #EVAS_FONT_HINTING_AUTO, #EVAS_FONT_HINTING_BYTECODE.
2536 * @ingroup Evas_Font_Group
2538 EAPI Evas_Font_Hinting_Flags evas_font_hinting_get (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
2541 * Checks if the font hinting is supported by the given evas.
2543 * @param e The given evas to query.
2544 * @param hinting The hinting to use, one of #EVAS_FONT_HINTING_NONE,
2545 * #EVAS_FONT_HINTING_AUTO, #EVAS_FONT_HINTING_BYTECODE.
2546 * @return @c EINA_TRUE if it is supported, @c EINA_FALSE otherwise.
2547 * @ingroup Evas_Font_Group
2549 EAPI Eina_Bool evas_font_hinting_can_hint (const Evas *e, Evas_Font_Hinting_Flags hinting) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
2553 * Force the given evas and associated engine to flush its font cache.
2555 * @param e The given evas to flush font cache.
2556 * @ingroup Evas_Font_Group
2558 EAPI void evas_font_cache_flush (Evas *e) EINA_ARG_NONNULL(1);
2561 * Changes the size of font cache of the given evas.
2563 * @param e The given evas to flush font cache.
2564 * @param size The size, in bytes.
2566 * @ingroup Evas_Font_Group
2568 EAPI void evas_font_cache_set (Evas *e, int size) EINA_ARG_NONNULL(1);
2571 * Changes the size of font cache of the given evas.
2573 * @param e The given evas to flush font cache.
2574 * @return The size, in bytes.
2576 * @ingroup Evas_Font_Group
2578 EAPI int evas_font_cache_get (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
2582 * List of available font descriptions known or found by this evas.
2584 * The list depends on Evas compile time configuration, such as
2585 * fontconfig support, and the paths provided at runtime as explained
2586 * in @ref Evas_Font_Path_Group.
2588 * @param e The evas instance to query.
2589 * @return a newly allocated list of strings. Do not change the
2590 * strings. Be sure to call evas_font_available_list_free()
2591 * after you're done.
2593 * @ingroup Evas_Font_Group
2595 EAPI Eina_List *evas_font_available_list (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
2598 * Free list of font descriptions returned by evas_font_dir_available_list().
2600 * @param e The evas instance that returned such list.
2601 * @param available the list returned by evas_font_dir_available_list().
2603 * @ingroup Evas_Font_Group
2605 EAPI void evas_font_available_list_free(Evas *e, Eina_List *available) EINA_ARG_NONNULL(1);
2608 * @defgroup Evas_Font_Path_Group Font Path Functions
2610 * Functions that edit the paths being used to load fonts.
2612 * @ingroup Evas_Font_Group
2616 * Removes all font paths loaded into memory for the given evas.
2617 * @param e The given evas.
2618 * @ingroup Evas_Font_Path_Group
2620 EAPI void evas_font_path_clear (Evas *e) EINA_ARG_NONNULL(1);
2623 * Appends a font path to the list of font paths used by the given evas.
2624 * @param e The given evas.
2625 * @param path The new font path.
2626 * @ingroup Evas_Font_Path_Group
2628 EAPI void evas_font_path_append (Evas *e, const char *path) EINA_ARG_NONNULL(1, 2);
2631 * Prepends a font path to the list of font paths used by the given evas.
2632 * @param e The given evas.
2633 * @param path The new font path.
2634 * @ingroup Evas_Font_Path_Group
2636 EAPI void evas_font_path_prepend (Evas *e, const char *path) EINA_ARG_NONNULL(1, 2);
2639 * Retrieves the list of font paths used by the given evas.
2640 * @param e The given evas.
2641 * @return The list of font paths used.
2642 * @ingroup Evas_Font_Path_Group
2644 EAPI const Eina_List *evas_font_path_list (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
2647 * @defgroup Evas_Object_Group Generic Object Functions
2649 * Functions that manipulate generic Evas objects.
2651 * All Evas displaying units are Evas objects. One handles them all by
2652 * means of the handle ::Evas_Object. Besides Evas treats their
2653 * objects equally, they have @b types, which define their specific
2654 * behavior (and individual API).
2656 * Evas comes with a set of built-in object types:
2664 * These functions apply to @b any Evas object, whichever type thay
2667 * @note The built-in types which are most used are rectangles, text
2668 * and images. In fact, with these ones one can create 2D interfaces
2669 * of arbitrary complexity and EFL makes it easy.
2673 * @defgroup Evas_Object_Group_Basic Basic Object Manipulation
2675 * Methods that are broadly used, like those that change the color,
2676 * clippers and geometry of an Evas object.
2678 * An example on the most used functions in this group can be seen @ref
2679 * Example_Evas_Object_Manipulation "here".
2681 * For function dealing with stacking, the examples are gathered @ref
2682 * Example_Evas_Stacking "here".
2684 * @ingroup Evas_Object_Group
2688 * @addtogroup Evas_Object_Group_Basic
2693 * Clip one object to another.
2695 * @param obj The object to be clipped
2696 * @param clip The object to clip @p obj by
2698 * This function will clip the object @p obj to the area occupied by
2699 * the object @p clip. This means the object @p obj will only be
2700 * visible within the area occupied by the clipping object (@p clip).
2702 * The color of the object being clipped will be multiplied by the
2703 * color of the clipping one, so the resulting color for the former
2704 * will be <code>RESULT = (OBJ * CLIP) / (255 * 255)</code>, per color
2705 * element (red, green, blue and alpha).
2707 * Clipping is recursive, so clipping objects may be clipped by
2708 * others, and their color will in term be multiplied. You may @b not
2709 * set up circular clipping lists (i.e. object 1 clips object 2, which
2710 * clips object 1): the behavior of Evas is undefined in this case.
2712 * Objects which do not clip others are visible in the canvas as
2713 * normal; <b>those that clip one or more objects become invisible
2714 * themselves</b>, only affecting what they clip. If an object ceases
2715 * to have other objects being clipped by it, it will become visible
2718 * The visibility of an object affects the objects that are clipped by
2719 * it, so if the object clipping others is not shown (as in
2720 * evas_object_show()), the objects clipped by it will not be shown
2723 * If @p obj was being clipped by another object when this function is
2724 * called, it gets implicitly removed from the old clipper's domain
2725 * and is made now to be clipped by its new clipper.
2727 * @note At the moment the <b>only objects that can validly be used to
2728 * clip other objects are rectangle objects</b>. All other object
2729 * types are invalid and the result of using them is undefined. The
2730 * clip object @p clip must be a valid object, but can also be @c
2731 * NULL, in which case the effect of this function is the same as
2732 * calling evas_object_clip_unset() on the @p obj object.
2735 * @dontinclude evas-object-manipulation.c
2736 * @skip solid white clipper (note that it's the default color for a
2737 * @until evas_object_show(d.clipper);
2739 * See the full @ref Example_Evas_Object_Manipulation "example".
2741 EAPI void evas_object_clip_set (Evas_Object *obj, Evas_Object *clip) EINA_ARG_NONNULL(1, 2);
2744 * Get the object clipping @p obj (if any).
2746 * @param obj The object to get the clipper from
2748 * This function returns the object clipping @p obj. If @p obj is
2749 * not being clipped at all, @c NULL is returned. The object @p obj
2750 * must be a valid ::Evas_Object.
2752 * See also evas_object_clip_set(), evas_object_clip_unset() and
2753 * evas_object_clipees_get().
2756 * @dontinclude evas-object-manipulation.c
2757 * @skip if (evas_object_clip_get(d.img) == d.clipper)
2760 * See the full @ref Example_Evas_Object_Manipulation "example".
2762 EAPI Evas_Object *evas_object_clip_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
2765 * Disable/cease clipping on a clipped @p obj object.
2767 * @param obj The object to cease clipping on
2769 * This function disables clipping for the object @p obj, if it was
2770 * already clipped, i.e., its visibility and color get detached from
2771 * the previous clipper. If it wasn't, this has no effect. The object
2772 * @p obj must be a valid ::Evas_Object.
2774 * See also evas_object_clip_set() (for an example),
2775 * evas_object_clipees_get() and evas_object_clip_get().
2778 EAPI void evas_object_clip_unset (Evas_Object *obj);
2781 * Return a list of objects currently clipped by @p obj.
2783 * @param obj The object to get a list of clippees from
2784 * @return a list of objects being clipped by @p obj
2786 * This returns the internal list handle that contains all objects
2787 * clipped by the object @p obj. If none are clipped by it, the call
2788 * returns @c NULL. This list is only valid until the clip list is
2789 * changed and should be fetched again with another call to
2790 * evas_object_clipees_get() if any objects being clipped by this
2791 * object are unclipped, clipped by a new object, deleted or get the
2792 * clipper deleted. These operations will invalidate the list
2793 * returned, so it should not be used anymore after that point. Any
2794 * use of the list after this may have undefined results, possibly
2795 * leading to crashes. The object @p obj must be a valid
2798 * See also evas_object_clip_set(), evas_object_clip_unset() and
2799 * evas_object_clip_get().
2803 * extern Evas_Object *obj;
2804 * Evas_Object *clipper;
2806 * clipper = evas_object_clip_get(obj);
2809 * Eina_List *clippees, *l;
2810 * Evas_Object *obj_tmp;
2812 * clippees = evas_object_clipees_get(clipper);
2813 * printf("Clipper clips %i objects\n", eina_list_count(clippees));
2814 * EINA_LIST_FOREACH(clippees, l, obj_tmp)
2815 * evas_object_show(obj_tmp);
2819 EAPI const Eina_List *evas_object_clipees_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
2823 * Sets or unsets a given object as the currently focused one on its
2826 * @param obj The object to be focused or unfocused.
2827 * @param focus @c EINA_TRUE, to set it as focused or @c EINA_FALSE,
2828 * to take away the focus from it.
2830 * Changing focus only affects where (key) input events go. There can
2831 * be only one object focused at any time. If @p focus is @c
2832 * EINA_TRUE, @p obj will be set as the currently focused object and
2833 * it will receive all keyboard events that are not exclusive key
2834 * grabs on other objects.
2837 * @dontinclude evas-events.c
2838 * @skip evas_object_focus_set
2839 * @until evas_object_focus_set
2841 * See the full example @ref Example_Evas_Events "here".
2843 * @see evas_object_focus_get
2844 * @see evas_focus_get
2845 * @see evas_object_key_grab
2846 * @see evas_object_key_ungrab
2848 EAPI void evas_object_focus_set (Evas_Object *obj, Eina_Bool focus) EINA_ARG_NONNULL(1);
2851 * Retrieve whether an object has the focus.
2853 * @param obj The object to retrieve focus information from.
2854 * @return @c EINA_TRUE if the object has the focus, @c EINA_FALSE
2857 * If the passed object is the currently focused one, @c EINA_TRUE is
2858 * returned. @c EINA_FALSE is returned, otherwise.
2861 * @dontinclude evas-events.c
2863 * @until something is bad
2865 * See the full example @ref Example_Evas_Events "here".
2867 * @see evas_object_focus_set
2868 * @see evas_focus_get
2869 * @see evas_object_key_grab
2870 * @see evas_object_key_ungrab
2872 EAPI Eina_Bool evas_object_focus_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
2876 * Sets the layer of the its canvas that the given object will be part
2879 * @param obj The given Evas object.
2880 * @param l The number of the layer to place the object on.
2881 * Must be between #EVAS_LAYER_MIN and #EVAS_LAYER_MAX.
2883 * If you don't use this function, you'll be dealing with an @b unique
2884 * layer of objects, the default one. Additional layers are handy when
2885 * you don't want a set of objects to interfere with another set with
2886 * regard to @b stacking. Two layers are completely disjoint in that
2889 * This is a low-level function, which you'd be using when something
2890 * should be always on top, for example.
2892 * @warning Be careful, it doesn't make sense to change the layer of
2893 * smart objects' children. Smart objects have a layer of their own,
2894 * which should contain all their children objects.
2896 * @see evas_object_layer_get()
2898 EAPI void evas_object_layer_set (Evas_Object *obj, short l) EINA_ARG_NONNULL(1);
2901 * Retrieves the layer of its canvas that the given object is part of.
2903 * @param obj The given Evas object to query layer from
2904 * @return Number of the its layer
2906 * @see evas_object_layer_set()
2908 EAPI short evas_object_layer_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
2912 * Sets the name of the given Evas object to the given name.
2914 * @param obj The given object.
2915 * @param name The given name.
2917 * There might be ocasions where one would like to name his/her
2921 * @dontinclude evas-events.c
2922 * @skip d.bg = evas_object_rectangle_add(d.canvas);
2923 * @until evas_object_name_set(d.bg, "our dear rectangle");
2925 * See the full @ref Example_Evas_Events "example".
2927 EAPI void evas_object_name_set (Evas_Object *obj, const char *name) EINA_ARG_NONNULL(1);
2930 * Retrieves the name of the given Evas object.
2932 * @param obj The given object.
2933 * @return The name of the object or @c NULL, if no name has been given
2937 * @dontinclude evas-events.c
2938 * @skip fprintf(stdout, "An object got focused: %s\n",
2939 * @until evas_focus_get
2941 * See the full @ref Example_Evas_Events "example".
2943 EAPI const char *evas_object_name_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
2947 * Increments object reference count to defer its deletion.
2949 * @param obj The given Evas object to reference
2951 * This increments the reference count of an object, which if greater
2952 * than 0 will defer deletion by evas_object_del() until all
2953 * references are released back (counter back to 0). References cannot
2954 * go below 0 and unreferencing past that will result in the reference
2955 * count being limited to 0. References are limited to <c>2^32 - 1</c>
2956 * for an object. Referencing it more than this will result in it
2957 * being limited to this value.
2959 * @see evas_object_unref()
2960 * @see evas_object_del()
2962 * @note This is a <b>very simple<b> reference counting mechanism! For
2963 * instance, Evas is not ready to check for pending references on a
2964 * canvas deletion, or things like that. This is useful on scenarios
2965 * where, inside a code block, callbacks exist which would possibly
2966 * delete an object we are operating on afterwards. Then, one would
2967 * evas_object_ref() it on the beginning of the block and
2968 * evas_object_unref() it on the end. I would then be deleted at this
2969 * point, if it should be.
2973 * evas_object_ref(obj);
2976 * evas_object_smart_callback_call(obj, SIG_SELECTED, NULL);
2977 * // more action here...
2978 * evas_object_unref(obj);
2981 * @ingroup Evas_Object_Group_Basic
2984 EAPI void evas_object_ref (Evas_Object *obj);
2987 * Decrements object reference count.
2989 * @param obj The given Evas object to unreference
2991 * This decrements the reference count of an object. If the object has
2992 * had evas_object_del() called on it while references were more than
2993 * 0, it will be deleted at the time this function is called and puts
2994 * the counter back to 0. See evas_object_ref() for more information.
2996 * @see evas_object_ref() (for an example)
2997 * @see evas_object_del()
2999 * @ingroup Evas_Object_Group_Basic
3002 EAPI void evas_object_unref (Evas_Object *obj);
3006 * Marks the given Evas object for deletion (when Evas will free its
3009 * @param obj The given Evas object.
3011 * This call will mark @p obj for deletion, which will take place
3012 * whenever it has no more references to it (see evas_object_ref() and
3013 * evas_object_unref()).
3015 * At actual deletion time, which may or may not be just after this
3016 * call, ::EVAS_CALLBACK_DEL and ::EVAS_CALLBACK_FREE callbacks will
3017 * be called. If the object currently had the focus, its
3018 * ::EVAS_CALLBACK_FOCUS_OUT callback will also be called.
3020 * @see evas_object_ref()
3021 * @see evas_object_unref()
3023 * @ingroup Evas_Object_Group_Basic
3025 EAPI void evas_object_del (Evas_Object *obj) EINA_ARG_NONNULL(1);
3028 * Move the given Evas object to the given location inside its
3031 * @param obj The given Evas object.
3032 * @param x X position to move the object to, in canvas units.
3033 * @param y Y position to move the object to, in canvas units.
3035 * Besides being moved, the object's ::EVAS_CALLBACK_MOVE callback
3038 * @note Naturally, newly created objects are placed at the canvas'
3039 * origin: <code>0, 0</code>.
3042 * @dontinclude evas-object-manipulation.c
3043 * @skip evas_object_image_border_set(d.clipper_border, 3, 3, 3, 3);
3044 * @until evas_object_show
3046 * See the full @ref Example_Evas_Object_Manipulation "example".
3048 * @ingroup Evas_Object_Group_Basic
3050 EAPI void evas_object_move (Evas_Object *obj, Evas_Coord x, Evas_Coord y) EINA_ARG_NONNULL(1);
3053 * Changes the size of the given Evas object.
3055 * @param obj The given Evas object.
3056 * @param w The new width of the Evas object.
3057 * @param h The new height of the Evas object.
3059 * Besides being resized, the object's ::EVAS_CALLBACK_RESIZE callback
3062 * @note Newly created objects have zeroed dimensions. Then, you most
3063 * probably want to use evas_object_resize() on them after they are
3066 * @note Be aware that resizing an object changes its drawing area,
3067 * but that does imply the object is rescaled! For instance, images
3068 * are filled inside their drawing area using the specifications of
3069 * evas_object_image_fill_set(). Thus to scale the image to match
3070 * exactly your drawing area, you need to change the
3071 * evas_object_image_fill_set() as well.
3073 * @note This is more evident in images, but text, textblock, lines
3074 * and polygons will behave similarly. Check their specific APIs to
3075 * know how to achieve your desired behavior. Consider the following
3079 * // rescale image to fill exactly its area without tiling:
3080 * evas_object_resize(img, w, h);
3081 * evas_object_image_fill_set(img, 0, 0, w, h);
3084 * @ingroup Evas_Object_Group_Basic
3086 EAPI void evas_object_resize (Evas_Object *obj, Evas_Coord w, Evas_Coord h) EINA_ARG_NONNULL(1);
3089 * Retrieves the position and (rectangular) size of the given Evas
3092 * @param obj The given Evas object.
3093 * @param x Pointer to an integer in which to store the X coordinate
3095 * @param y Pointer to an integer in which to store the Y coordinate
3097 * @param w Pointer to an integer in which to store the width of the
3099 * @param h Pointer to an integer in which to store the height of the
3102 * The position, naturally, will be relative to the top left corner of
3103 * the canvas' viewport.
3105 * @note Use @c NULL pointers on the geometry components you're not
3106 * interested in: they'll be ignored by the function.
3109 * @dontinclude evas-events.c
3110 * @skip int w, h, cw, ch;
3113 * See the full @ref Example_Evas_Events "example".
3115 * @ingroup Evas_Object_Group_Basic
3117 EAPI void evas_object_geometry_get (const Evas_Object *obj, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h) EINA_ARG_NONNULL(1);
3121 * Makes the given Evas object visible.
3123 * @param obj The given Evas object.
3125 * Besides becoming visible, the object's ::EVAS_CALLBACK_SHOW
3126 * callback will be called.
3128 * @see evas_object_hide() for more on object visibility.
3129 * @see evas_object_visible_get()
3131 * @ingroup Evas_Object_Group_Basic
3133 EAPI void evas_object_show (Evas_Object *obj) EINA_ARG_NONNULL(1);
3136 * Makes the given Evas object invisible.
3138 * @param obj The given Evas object.
3140 * Hidden objects, besides not being shown at all in your canvas,
3141 * won't be checked for changes on the canvas rendering
3142 * process. Furthermore, they will not catch input events. Thus, they
3143 * are much ligher (in processing needs) than an object that is
3144 * invisible due to indirect causes, such as being clipped or out of
3145 * the canvas' viewport.
3147 * Besides becoming hidden, @p obj object's ::EVAS_CALLBACK_SHOW
3148 * callback will be called.
3150 * @note All objects are created in the hidden state! If you want them
3151 * shown, use evas_object_show() after their creation.
3153 * @see evas_object_show()
3154 * @see evas_object_visible_get()
3157 * @dontinclude evas-object-manipulation.c
3158 * @skip if (evas_object_visible_get(d.clipper))
3161 * See the full @ref Example_Evas_Object_Manipulation "example".
3163 * @ingroup Evas_Object_Group_Basic
3165 EAPI void evas_object_hide (Evas_Object *obj) EINA_ARG_NONNULL(1);
3168 * Retrieves whether or not the given Evas object is visible.
3170 * @param obj The given Evas object.
3171 * @return @c EINA_TRUE if the object is visible, @c EINA_FALSE
3174 * This retrieves an object's visibily as the one enforced by
3175 * evas_object_show() and evas_object_hide().
3177 * @note The value returned isn't, by any means, influenced by
3178 * clippers covering @obj, it being out of its canvas' viewport or
3179 * stacked below other object.
3181 * @see evas_object_show()
3182 * @see evas_object_hide() (for an example)
3184 * @ingroup Evas_Object_Group_Basic
3186 EAPI Eina_Bool evas_object_visible_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
3190 * Sets the general/main color of the given Evas object to the given
3193 * @param obj The given Evas object.
3194 * @param r The red component of the given color.
3195 * @param g The green component of the given color.
3196 * @param b The blue component of the given color.
3197 * @param a The alpha component of the given color.
3199 * @see evas_object_color_get() (for an example)
3201 * @ingroup Evas_Object_Group_Basic
3203 EAPI void evas_object_color_set (Evas_Object *obj, int r, int g, int b, int a) EINA_ARG_NONNULL(1);
3206 * Retrieves the general/main color of the given Evas object.
3208 * @param obj The given Evas object to retrieve color from.
3209 * @param r Pointer to an integer in which to store the red component
3211 * @param g Pointer to an integer in which to store the green
3212 * component of the color.
3213 * @param b Pointer to an integer in which to store the blue component
3215 * @param a Pointer to an integer in which to store the alpha
3216 * component of the color.
3218 * Retrieves the “main” color's RGB component (and alpha channel)
3219 * values, <b>which range from 0 to 255</b>. For the alpha channel,
3220 * which defines the object's transparency level, the former value
3221 * means totally trasparent, while the latter means opaque.
3223 * Usually you’ll use this attribute for text and rectangle objects,
3224 * where the “main” color is their unique one. If set for objects
3225 * which themselves have colors, like the images one, those colors get
3226 * modulated by this one.
3228 * @note All newly created Evas rectangles get the default color
3229 * values of <code>255 255 255 255</code> (opaque white).
3231 * @note Use @c NULL pointers on the components you're not interested
3232 * in: they'll be ignored by the function.
3235 * @dontinclude evas-object-manipulation.c
3236 * @skip int alpha, r, g, b;
3239 * See the full @ref Example_Evas_Object_Manipulation "example".
3241 * @ingroup Evas_Object_Group_Basic
3243 EAPI void evas_object_color_get (const Evas_Object *obj, int *r, int *g, int *b, int *a) EINA_ARG_NONNULL(1);
3247 * Retrieves the Evas canvas that the given object lives on.
3249 * @param obj The given Evas object.
3250 * @return A pointer to the canvas where the object is on.
3252 * This function is most useful at code contexts where you need to
3253 * operate on the canvas but have only the object pointer.
3255 * @ingroup Evas_Object_Group_Basic
3257 EAPI Evas *evas_object_evas_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
3260 * Retrieves the type of the given Evas object.
3262 * @param obj The given object.
3263 * @return The type of the object.
3265 * For Evas' builtin types, the return strings will be one of:
3266 * - <c>"rectangle"</c>,
3268 * - <c>"polygon"</c>,
3270 * - <c>"textblock"</c> and
3273 * For Evas smart objects (see @ref Evas_Smart_Group), the name of the
3274 * smart class itself is returned on this call. For the built-in smart
3275 * objects, these names are:
3276 * - <c>"EvasObjectSmartClipped"</c>, for the clipped smart object
3277 * - <c>"Evas_Object_Box"</c>, for the box object and
3278 * - <c>"Evas_Object_Table"</c>, for the table object.
3281 * @dontinclude evas-object-manipulation.c
3282 * @skip d.img = evas_object_image_filled_add(d.canvas);
3283 * @until border on the
3285 * See the full @ref Example_Evas_Object_Manipulation "example".
3287 EAPI const char *evas_object_type_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
3290 * Raise @p obj to the bottom of its layer.
3292 * @param obj the object to raise
3294 * @p obj will, then, be the highest one in the layer it belongs
3295 * to. Object on other layers won't get touched.
3297 * @see evas_object_stack_above()
3298 * @see evas_object_stack_below()
3299 * @see evas_object_lower()
3301 EAPI void evas_object_raise (Evas_Object *obj) EINA_ARG_NONNULL(1);
3304 * Lower @p obj to the bottom of its layer.
3306 * @param obj the object to lower
3308 * @p obj will, then, be the lowest one in the layer it belongs
3309 * to. Objects on other layers won't get touched.
3311 * @see evas_object_stack_above()
3312 * @see evas_object_stack_below()
3313 * @see evas_object_raise()
3315 EAPI void evas_object_lower (Evas_Object *obj) EINA_ARG_NONNULL(1);
3318 * Stack @p obj immediately above @p above
3320 * @param obj the object to stack
3321 * @param above the object above which to stack
3323 * Objects, in a given canvas, are stacked in the order they get added
3324 * to it. This means that, if they overlap, the highest ones will
3325 * cover the lowest ones, in that order. This function is a way to
3326 * change the stacking order for the objects.
3328 * This function is intended to be used with <b>objects belonging to
3329 * the same layer</b> in a given canvas, otherwise it will fail (and
3330 * accomplish nothing).
3332 * If you have smart objects on your canvas and @p obj is a member of
3333 * one of them, then @p above must also be a member of the same
3336 * Similarly, if @p obj is not a member of a smart object, @p above
3337 * must not be either.
3339 * @see evas_object_layer_get()
3340 * @see evas_object_layer_set()
3341 * @see evas_object_stack_below()
3343 EAPI void evas_object_stack_above (Evas_Object *obj, Evas_Object *above) EINA_ARG_NONNULL(1, 2);
3346 * Stack @p obj immediately below @p below
3348 * @param obj the object to stack
3349 * @param below the object below which to stack
3351 * Objects, in a given canvas, are stacked in the order they get added
3352 * to it. This means that, if they overlap, the highest ones will
3353 * cover the lowest ones, in that order. This function is a way to
3354 * change the stacking order for the objects.
3356 * This function is intended to be used with <b>objects belonging to
3357 * the same layer</b> in a given canvas, otherwise it will fail (and
3358 * accomplish nothing).
3360 * If you have smart objects on your canvas and @p obj is a member of
3361 * one of them, then @p below must also be a member of the same
3364 * Similarly, if @p obj is not a member of a smart object, @p below
3365 * must not be either.
3367 * @see evas_object_layer_get()
3368 * @see evas_object_layer_set()
3369 * @see evas_object_stack_below()
3371 EAPI void evas_object_stack_below (Evas_Object *obj, Evas_Object *below) EINA_ARG_NONNULL(1, 2);
3374 * Get the Evas object stacked right above @p obj
3376 * @param obj an #Evas_Object
3377 * @return the #Evas_Object directly above @p obj, if any, or @c NULL,
3380 * This function will traverse layers in its search, if there are
3381 * objects on layers above the one @p obj is placed at.
3383 * @see evas_object_layer_get()
3384 * @see evas_object_layer_set()
3385 * @see evas_object_below_get()
3388 EAPI Evas_Object *evas_object_above_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
3391 * Get the Evas object stacked right below @p obj
3393 * @param obj an #Evas_Object
3394 * @return the #Evas_Object directly below @p obj, if any, or @c NULL,
3397 * This function will traverse layers in its search, if there are
3398 * objects on layers below the one @p obj is placed at.
3400 * @see evas_object_layer_get()
3401 * @see evas_object_layer_set()
3402 * @see evas_object_below_set()
3404 EAPI Evas_Object *evas_object_below_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
3411 * @defgroup Evas_Object_Group_Events Object Events
3413 * Objects generate events when they are moved, resized, when their
3414 * visibility change, when they are deleted and so on. These methods
3415 * allow one to be notified about and to handle such events.
3417 * Objects also generate events on input (keyboard and mouse), if they
3418 * accept them (are visible, focused, etc).
3420 * Examples on this group of functions can be found @ref
3421 * Example_Evas_Stacking "here" and @ref Example_Evas_Events "here".
3423 * @ingroup Evas_Object_Group
3427 * @addtogroup Evas_Object_Group_Events
3432 * Add (register) a callback function to a given Evas object event.
3434 * @param obj Object to attach a callback to
3435 * @param type The type of event that will trigger the callback
3436 * @param func The function to be called when the event is triggered
3437 * @param data The data pointer to be passed to @p func
3439 * This function adds a function callback to an object when the event
3440 * of type @p type occurs on object @p obj. The function is @p func.
3442 * In the event of a memory allocation error during addition of the
3443 * callback to the object, evas_alloc_error() should be used to
3444 * determine the nature of the error, if any, and the program should
3445 * sensibly try and recover.
3447 * A callback function must have the ::Evas_Object_Event_Cb prototype
3448 * definition. The first parameter (@p data) in this definition will
3449 * have the same value passed to evas_object_event_callback_add() as
3450 * the @p data parameter, at runtime. The second parameter @p e is the
3451 * canvas pointer on which the event occurred. The third parameter is
3452 * a pointer to the object on which event occurred. Finally, the
3453 * fourth parameter @p event_info is a pointer to a data structure
3454 * that may or may not be passed to the callback, depending on the
3455 * event type that triggered the callback. This is so because some
3456 * events don't carry extra context with them, but others do.
3458 * The event type @p type to trigger the function may be one of
3459 * #EVAS_CALLBACK_MOUSE_IN, #EVAS_CALLBACK_MOUSE_OUT,
3460 * #EVAS_CALLBACK_MOUSE_DOWN, #EVAS_CALLBACK_MOUSE_UP,
3461 * #EVAS_CALLBACK_MOUSE_MOVE, #EVAS_CALLBACK_MOUSE_WHEEL,
3462 * #EVAS_CALLBACK_MULTI_DOWN, #EVAS_CALLBACK_MULTI_UP,
3463 * #EVAS_CALLBACK_MULTI_MOVE, #EVAS_CALLBACK_FREE,
3464 * #EVAS_CALLBACK_KEY_DOWN, #EVAS_CALLBACK_KEY_UP,
3465 * #EVAS_CALLBACK_FOCUS_IN, #EVAS_CALLBACK_FOCUS_OUT,
3466 * #EVAS_CALLBACK_SHOW, #EVAS_CALLBACK_HIDE, #EVAS_CALLBACK_MOVE,
3467 * #EVAS_CALLBACK_RESIZE, #EVAS_CALLBACK_RESTACK, #EVAS_CALLBACK_DEL,
3468 * #EVAS_CALLBACK_HOLD, #EVAS_CALLBACK_CHANGED_SIZE_HINTS,
3469 * #EVAS_CALLBACK_IMAGE_PRELOADED or #EVAS_CALLBACK_IMAGE_UNLOADED.
3471 * This determines the kind of event that will trigger the callback.
3472 * What follows is a list explaining better the nature of each type of
3473 * event, along with their associated @p event_info pointers:
3475 * - #EVAS_CALLBACK_MOUSE_IN: @p event_info is a pointer to an
3476 * #Evas_Event_Mouse_In struct\n\n
3477 * This event is triggered when the mouse pointer enters the area
3478 * (not shaded by other objects) of the object @p obj. This may
3479 * occur by the mouse pointer being moved by
3480 * evas_event_feed_mouse_move() calls, or by the object being shown,
3481 * raised, moved, resized, or other objects being moved out of the
3482 * way, hidden or lowered, whatever may cause the mouse pointer to
3483 * get on top of @p obj, having been on top of another object
3486 * - #EVAS_CALLBACK_MOUSE_OUT: @p event_info is a pointer to an
3487 * #Evas_Event_Mouse_Out struct\n\n
3488 * This event is triggered exactly like #EVAS_CALLBACK_MOUSE_IN is,
3489 * but it occurs when the mouse pointer exits an object's area. Note
3490 * that no mouse out events will be reported if the mouse pointer is
3491 * implicitly grabbed to an object (mouse buttons are down, having
3492 * been pressed while the pointer was over that object). In these
3493 * cases, mouse out events will be reported once all buttons are
3494 * released, if the mouse pointer has left the object's area. The
3495 * indirect ways of taking off the mouse pointer from an object,
3496 * like cited above, for #EVAS_CALLBACK_MOUSE_IN, also apply here,
3499 * - #EVAS_CALLBACK_MOUSE_DOWN: @p event_info is a pointer to an
3500 * #Evas_Event_Mouse_Down struct\n\n
3501 * This event is triggered by a mouse button being pressed while the
3502 * mouse pointer is over an object. If the pointer mode for Evas is
3503 * #EVAS_OBJECT_POINTER_MODE_AUTOGRAB (default), this causes this
3504 * object to <b>passively grab the mouse</b> until all mouse buttons
3505 * have been released: all future mouse events will be reported to
3506 * only this object until no buttons are down. That includes mouse
3507 * move events, mouse in and mouse out events, and further button
3508 * presses. When all buttons are released, event propagation will
3509 * occur as normal (see #Evas_Object_Pointer_Mode).
3511 * - #EVAS_CALLBACK_MOUSE_UP: @p event_info is a pointer to an
3512 * #Evas_Event_Mouse_Up struct\n\n
3513 * This event is triggered by a mouse button being released while
3514 * the mouse pointer is over an object's area (or when passively
3515 * grabbed to an object).
3517 * - #EVAS_CALLBACK_MOUSE_MOVE: @p event_info is a pointer to an
3518 * #Evas_Event_Mouse_Move struct\n\n
3519 * This event is triggered by the mouse pointer being moved while
3520 * over an object's area (or while passively grabbed to an object).
3522 * - #EVAS_CALLBACK_MOUSE_WHEEL: @p event_info is a pointer to an
3523 * #Evas_Event_Mouse_Wheel struct\n\n
3524 * This event is triggered by the mouse wheel being rolled while the
3525 * mouse pointer is over an object (or passively grabbed to an
3528 * - #EVAS_CALLBACK_MULTI_DOWN: @p event_info is a pointer to an
3529 * #Evas_Event_Multi_Down struct
3531 * - #EVAS_CALLBACK_MULTI_UP: @p event_info is a pointer to an
3532 * #Evas_Event_Multi_Up struct
3534 * - #EVAS_CALLBACK_MULTI_MOVE: @p event_info is a pointer to an
3535 * #Evas_Event_Multi_Move struct
3537 * - #EVAS_CALLBACK_FREE: @p event_info is @c NULL \n\n
3538 * This event is triggered just before Evas is about to free all
3539 * memory used by an object and remove all references to it. This is
3540 * useful for programs to use if they attached data to an object and
3541 * want to free it when the object is deleted. The object is still
3542 * valid when this callback is called, but after it returns, there
3543 * is no guarantee on the object's validity.
3545 * - #EVAS_CALLBACK_KEY_DOWN: @p event_info is a pointer to an
3546 * #Evas_Event_Key_Down struct\n\n
3547 * This callback is called when a key is pressed and the focus is on
3548 * the object, or a key has been grabbed to a particular object
3549 * which wants to intercept the key press regardless of what object
3552 * - #EVAS_CALLBACK_KEY_UP: @p event_info is a pointer to an
3553 * #Evas_Event_Key_Up struct \n\n
3554 * This callback is called when a key is released and the focus is
3555 * on the object, or a key has been grabbed to a particular object
3556 * which wants to intercept the key release regardless of what
3557 * object has the focus.
3559 * - #EVAS_CALLBACK_FOCUS_IN: @p event_info is @c NULL \n\n
3560 * This event is called when an object gains the focus. When it is
3561 * called the object has already gained the focus.
3563 * - #EVAS_CALLBACK_FOCUS_OUT: @p event_info is @c NULL \n\n
3564 * This event is triggered when an object loses the focus. When it
3565 * is called the object has already lost the focus.
3567 * - #EVAS_CALLBACK_SHOW: @p event_info is @c NULL \n\n
3568 * This event is triggered by the object being shown by
3569 * evas_object_show().
3571 * - #EVAS_CALLBACK_HIDE: @p event_info is @c NULL \n\n
3572 * This event is triggered by an object being hidden by
3573 * evas_object_hide().
3575 * - #EVAS_CALLBACK_MOVE: @p event_info is @c NULL \n\n
3576 * This event is triggered by an object being
3577 * moved. evas_object_move() can trigger this, as can any
3578 * object-specific manipulations that would mean the object's origin
3581 * - #EVAS_CALLBACK_RESIZE: @p event_info is @c NULL \n\n
3582 * This event is triggered by an object being resized. Resizes can
3583 * be triggered by evas_object_resize() or by any object-specific
3584 * calls that may cause the object to resize.
3586 * - #EVAS_CALLBACK_RESTACK: @p event_info is @c NULL \n\n
3587 * This event is triggered by an object being re-stacked. Stacking
3588 * changes can be triggered by
3589 * evas_object_stack_below()/evas_object_stack_above() and others.
3591 * - #EVAS_CALLBACK_DEL: @p event_info is @c NULL.
3593 * - #EVAS_CALLBACK_HOLD: @p event_info is a pointer to an
3594 * #Evas_Event_Hold struct
3596 * - #EVAS_CALLBACK_CHANGED_SIZE_HINTS: @p event_info is @c NULL.
3598 * - #EVAS_CALLBACK_IMAGE_PRELOADED: @p event_info is @c NULL.
3600 * - #EVAS_CALLBACK_IMAGE_UNLOADED: @p event_info is @c NULL.
3602 * @note Be careful not to add the same callback multiple times, if
3603 * that's not what you want, because Evas won't check if a callback
3604 * existed before exactly as the one being registered (and thus, call
3605 * it more than once on the event, in this case). This would make
3606 * sense if you passed different functions and/or callback data, only.
3609 * @dontinclude evas-events.c
3610 * @skip evas_object_event_callback_add(
3613 * See the full example @ref Example_Evas_Events "here".
3616 EAPI void evas_object_event_callback_add (Evas_Object *obj, Evas_Callback_Type type, Evas_Object_Event_Cb func, const void *data) EINA_ARG_NONNULL(1, 3);
3619 * Delete a callback function from an object
3621 * @param obj Object to remove a callback from
3622 * @param type The type of event that was triggering the callback
3623 * @param func The function that was to be called when the event was triggered
3624 * @return The data pointer that was to be passed to the callback
3626 * This function removes the most recently added callback from the
3627 * object @p obj which was triggered by the event type @p type and was
3628 * calling the function @p func when triggered. If the removal is
3629 * successful it will also return the data pointer that was passed to
3630 * evas_object_event_callback_add() when the callback was added to the
3631 * object. If not successful NULL will be returned.
3635 * extern Evas_Object *object;
3637 * void up_callback(void *data, Evas *e, Evas_Object *obj, void *event_info);
3639 * my_data = evas_object_event_callback_del(object, EVAS_CALLBACK_MOUSE_UP, up_callback);
3642 EAPI void *evas_object_event_callback_del (Evas_Object *obj, Evas_Callback_Type type, Evas_Object_Event_Cb func) EINA_ARG_NONNULL(1, 3);
3645 * Delete (unregister) a callback function registered to a given
3646 * Evas object event.
3648 * @param obj Object to remove a callback from
3649 * @param type The type of event that was triggering the callback
3650 * @param func The function that was to be called when the event was
3652 * @param data The data pointer that was to be passed to the callback
3653 * @return The data pointer that was to be passed to the callback
3655 * This function removes the most recently added callback from the
3656 * object @p obj, which was triggered by the event type @p type and was
3657 * calling the function @p func with data @p data, when triggered. If
3658 * the removal is successful it will also return the data pointer that
3659 * was passed to evas_object_event_callback_add() (that will be the
3660 * same as the parameter) when the callback was added to the
3661 * object. In errors, @c NULL will be returned.
3663 * @note For deletion of Evas object events callbacks filtering by
3664 * just type and function pointer, user
3665 * evas_object_event_callback_del().
3669 * extern Evas_Object *object;
3671 * void up_callback(void *data, Evas *e, Evas_Object *obj, void *event_info);
3673 * my_data = evas_object_event_callback_del_full(object, EVAS_CALLBACK_MOUSE_UP, up_callback, data);
3676 EAPI void *evas_object_event_callback_del_full(Evas_Object *obj, Evas_Callback_Type type, Evas_Object_Event_Cb func, const void *data) EINA_ARG_NONNULL(1, 3);
3680 * Set whether an Evas object is to pass (ignore) events.
3682 * @param obj the Evas object to operate on
3683 * @param pass whether @p obj is to pass events (@c EINA_TRUE) or not
3686 * If @p pass is @c EINA_TRUE, it will make events on @p obj to be @b
3687 * ignored. They will be triggered on the @b next lower object (that
3688 * is not set to pass events), instead (see evas_object_below_get()).
3690 * If @p pass is @c EINA_FALSE, events will be processed on that
3693 * @see evas_object_pass_events_get() for an example
3694 * @see evas_object_repeat_events_set()
3695 * @see evas_object_propagate_events_set()
3697 EAPI void evas_object_pass_events_set (Evas_Object *obj, Eina_Bool pass) EINA_ARG_NONNULL(1);
3700 * Determine whether an object is set to pass (ignore) events.
3702 * @param obj the Evas object to get information from.
3703 * @return pass whether @p obj is set to pass events (@c EINA_TRUE) or not
3707 * @dontinclude evas-stacking.c
3708 * @skip if (strcmp(ev->keyname, "p") == 0)
3711 * See the full @ref Example_Evas_Stacking "example".
3713 * @see evas_object_pass_events_set()
3714 * @see evas_object_repeat_events_get()
3715 * @see evas_object_propagate_events_get()
3717 EAPI Eina_Bool evas_object_pass_events_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
3720 * Set whether an Evas object is to repeat events.
3722 * @param obj the Evas object to operate on
3723 * @param repeat whether @p obj is to repeat events (@c EINA_TRUE) or not
3726 * If @p repeat is @c EINA_TRUE, it will make events on @p obj to also
3727 * be repeated for the @b next lower object in the objects' stack (see
3728 * see evas_object_below_get()).
3730 * If @p repeat is @c EINA_FALSE, events occurring on @p obj will be
3731 * processed only on it.
3734 * @dontinclude evas-stacking.c
3735 * @skip if (strcmp(ev->keyname, "r") == 0)
3738 * See the full @ref Example_Evas_Stacking "example".
3740 * @see evas_object_repeat_events_get()
3741 * @see evas_object_pass_events_get()
3742 * @see evas_object_propagate_events_get()
3744 EAPI void evas_object_repeat_events_set (Evas_Object *obj, Eina_Bool repeat) EINA_ARG_NONNULL(1);
3747 * Determine whether an object is set to repeat events.
3749 * @param obj the given Evas object pointer
3750 * @retrieve whether @p obj is set to repeat events (@c EINA_TRUE)
3751 * or not (@c EINA_FALSE)
3753 * @see evas_object_repeat_events_set() for an example
3754 * @see evas_object_pass_events_set()
3755 * @see evas_object_propagate_events_set()
3757 EAPI Eina_Bool evas_object_repeat_events_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
3760 * Set whether events on a smart object's member should get propagated
3763 * @param obj the smart object's child to operate on
3764 * @param prop whether to propagate events (@c EINA_TRUE) or not (@c
3767 * This function has @b no effect if @p obj is not a member of a smart
3770 * If @p prop is @c EINA_TRUE, events occurring on this object will be
3771 * propagated on to the smart object of which @p obj is a member. If
3772 * @p prop is @c EINA_FALSE, events occurring on this object will @b
3773 * not be propagated on to the smart object of which @p obj is a
3774 * member. The default value is @c EINA_TRUE.
3776 * @see evas_object_event_callback_add()
3777 * @see evas_object_propagate_events_get()
3778 * @see evas_object_repeat_events_get()
3779 * @see evas_object_pass_events_get()
3781 EAPI void evas_object_propagate_events_set (Evas_Object *obj, Eina_Bool prop) EINA_ARG_NONNULL(1);
3784 * Retrieve whether an Evas object is set to propagate events.
3786 * @param obj the given Evas object pointer
3787 * @return whether @p obj is set to propagate events (@c EINA_TRUE)
3788 * or not (@c EINA_FALSE)
3790 * @see evas_object_event_callback_add()
3791 * @see evas_object_propagate_events_set()
3792 * @see evas_object_repeat_events_set()
3793 * @see evas_object_pass_events_set()
3795 EAPI Eina_Bool evas_object_propagate_events_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
3802 * @defgroup Evas_Object_Group_Map UV Mapping (Rotation, Perspecitve, 3D...)
3804 * Evas allows different transformations to be applied to all kinds of
3805 * objects. These are applied by means of UV mapping.
3807 * With UV mapping, one maps points in the source object to a 3D space
3808 * positioning at target. This allows rotation, perspective, scale and
3809 * lots of other effects, depending on the map that is used.
3811 * Each map point may carry a multiplier color. If properly
3812 * calculated, these can do shading effects on the object, producing
3815 * As usual, Evas provides both the raw and easy to use methods. The
3816 * raw methods allow developer to create its maps somewhere else,
3817 * maybe load them from some file format. The easy to use methods,
3818 * calculate the points given some high-level parameters, such as
3819 * rotation angle, ambient light and so on.
3821 * @note applying mapping will reduce performance, so use with
3822 * care. The impact on performance depends on engine in
3823 * use. Software is quite optimized, but not as fast as OpenGL.
3826 * @li @ref Example_Evas_Map_Overview
3828 * @ingroup Evas_Object_Group
3834 * Enable or disable the map that is set.
3836 * Enable or disable the use of map for the object @p obj.
3837 * On enable, the object geometry will be saved, and the new geometry will
3838 * change (position and size) to reflect the map geometry set.
3840 * If the object doesn't have a map set (with evas_object_map_set()), the
3841 * initial geometry will be undefined. It is adviced to always set a map
3842 * to the object first, and then call this function to enable its use.
3844 * @param obj object to enable the map on
3845 * @param enabled enabled state
3847 EAPI void evas_object_map_enable_set (Evas_Object *obj, Eina_Bool enabled);
3850 * Get the map enabled state
3852 * This returns the currently enabled state of the map on the object indicated.
3853 * The default map enable state is off. You can enable and disable it with
3854 * evas_object_map_enable_set().
3856 * @param obj object to get the map enabled state from
3857 * @return the map enabled state
3859 EAPI Eina_Bool evas_object_map_enable_get (const Evas_Object *obj);
3862 * Set the map source object
3864 * This sets the object from which the map is taken - can be any object that
3865 * has map enabled on it.
3867 * Currently not implemented. for future use.
3869 * @param obj object to set the map source of
3870 * @param src the source object from which the map is taken
3872 EAPI void evas_object_map_source_set (Evas_Object *obj, Evas_Object *src);
3875 * Get the map source object
3877 * @param obj object to set the map source of
3878 * @return the object set as the source
3880 * @see evas_object_map_source_set()
3882 EAPI Evas_Object *evas_object_map_source_get (const Evas_Object *obj);
3885 * Set current object transformation map.
3887 * This sets the map on a given object. It is copied from the @p map pointer,
3888 * so there is no need to keep the @p map object if you don't need it anymore.
3890 * A map is a set of 4 points which have canvas x, y coordinates per point,
3891 * with an optional z point value as a hint for perspective correction, if it
3892 * is available. As well each point has u and v coordinates. These are like
3893 * "texture coordinates" in OpenGL in that they define a point in the source
3894 * image that is mapped to that map vertex/point. The u corresponds to the x
3895 * coordinate of this mapped point and v, the y coordinate. Note that these
3896 * coordinates describe a bounding region to sample. If you have a 200x100
3897 * source image and want to display it at 200x100 with proper pixel
3898 * precision, then do:
3901 * Evas_Map *m = evas_map_new(4);
3902 * evas_map_point_coord_set(m, 0, 0, 0, 0);
3903 * evas_map_point_coord_set(m, 1, 200, 0, 0);
3904 * evas_map_point_coord_set(m, 2, 200, 100, 0);
3905 * evas_map_point_coord_set(m, 3, 0, 100, 0);
3906 * evas_map_point_image_uv_set(m, 0, 0, 0);
3907 * evas_map_point_image_uv_set(m, 1, 200, 0);
3908 * evas_map_point_image_uv_set(m, 2, 200, 100);
3909 * evas_map_point_image_uv_set(m, 3, 0, 100);
3910 * evas_object_map_set(obj, m);
3914 * Note that the map points a uv coordinates match the image geometry. If
3915 * the @p map parameter is NULL, the stored map will be freed and geometry
3916 * prior to enabling/setting a map will be restored.
3918 * @param obj object to change transformation map
3919 * @param map new map to use
3921 * @see evas_map_new()
3923 EAPI void evas_object_map_set (Evas_Object *obj, const Evas_Map *map);
3926 * Get current object transformation map.
3928 * This returns the current internal map set on the indicated object. It is
3929 * intended for read-only acces and is only valid as long as the object is
3930 * not deleted or the map on the object is not changed. If you wish to modify
3931 * the map and set it back do the following:
3934 * const Evas_Map *m = evas_object_map_get(obj);
3935 * Evas_Map *m2 = evas_map_dup(m);
3936 * evas_map_util_rotate(m2, 30.0, 0, 0);
3937 * evas_object_map_set(obj);
3938 * evas_map_free(m2);
3941 * @param obj object to query transformation map.
3942 * @return map reference to map in use. This is an internal data structure, so
3945 * @see evas_object_map_set()
3947 EAPI const Evas_Map *evas_object_map_get (const Evas_Object *obj);
3951 * Populate source and destination map points to match exactly object.
3953 * Usually one initialize map of an object to match it's original
3954 * position and size, then transform these with evas_map_util_*
3955 * functions, such as evas_map_util_rotate() or
3956 * evas_map_util_3d_rotate(). The original set is done by this
3957 * function, avoiding code duplication all around.
3959 * @param m map to change all 4 points (must be of size 4).
3960 * @param obj object to use unmapped geometry to populate map coordinates.
3961 * @param z Point Z Coordinate hint (pre-perspective transform). This value
3962 * will be used for all four points.
3964 * @see evas_map_util_points_populate_from_object()
3965 * @see evas_map_point_coord_set()
3966 * @see evas_map_point_image_uv_set()
3968 EAPI void evas_map_util_points_populate_from_object_full(Evas_Map *m, const Evas_Object *obj, Evas_Coord z);
3971 * Populate source and destination map points to match exactly object.
3973 * Usually one initialize map of an object to match it's original
3974 * position and size, then transform these with evas_map_util_*
3975 * functions, such as evas_map_util_rotate() or
3976 * evas_map_util_3d_rotate(). The original set is done by this
3977 * function, avoiding code duplication all around.
3979 * Z Point coordinate is assumed as 0 (zero).
3981 * @param m map to change all 4 points (must be of size 4).
3982 * @param obj object to use unmapped geometry to populate map coordinates.
3984 * @see evas_map_util_points_populate_from_object_full()
3985 * @see evas_map_util_points_populate_from_geometry()
3986 * @see evas_map_point_coord_set()
3987 * @see evas_map_point_image_uv_set()
3989 EAPI void evas_map_util_points_populate_from_object (Evas_Map *m, const Evas_Object *obj);
3992 * Populate source and destination map points to match given geometry.
3994 * Similar to evas_map_util_points_populate_from_object_full(), this
3995 * call takes raw values instead of querying object's unmapped
3996 * geometry. The given width will be used to calculate destination
3997 * points (evas_map_point_coord_set()) and set the image uv
3998 * (evas_map_point_image_uv_set()).
4000 * @param m map to change all 4 points (must be of size 4).
4001 * @param x Point X Coordinate
4002 * @param y Point Y Coordinate
4003 * @param w width to use to calculate second and third points.
4004 * @param h height to use to calculate third and fourth points.
4005 * @param z Point Z Coordinate hint (pre-perspective transform). This value
4006 * will be used for all four points.
4008 * @see evas_map_util_points_populate_from_object()
4009 * @see evas_map_point_coord_set()
4010 * @see evas_map_point_image_uv_set()
4012 EAPI void evas_map_util_points_populate_from_geometry (Evas_Map *m, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h, Evas_Coord z);
4015 * Set color of all points to given color.
4017 * This call is useful to reuse maps after they had 3d lightning or
4018 * any other colorization applied before.
4020 * @param m map to change the color of.
4021 * @param r red (0 - 255)
4022 * @param g green (0 - 255)
4023 * @param b blue (0 - 255)
4024 * @param a alpha (0 - 255)
4026 * @see evas_map_point_color_set()
4028 EAPI void evas_map_util_points_color_set (Evas_Map *m, int r, int g, int b, int a);
4031 * Change the map to apply the given rotation.
4033 * This rotates the indicated map's coordinates around the center coordinate
4034 * given by @p cx and @p cy as the rotation center. The points will have their
4035 * X and Y coordinates rotated clockwise by @p degrees degress (360.0 is a
4036 * full rotation). Negative values for degrees will rotate counter-clockwise
4037 * by that amount. All coordinates are canvas global coordinates.
4039 * @param m map to change.
4040 * @param degrees amount of degrees from 0.0 to 360.0 to rotate.
4041 * @param cx rotation's center horizontal position.
4042 * @param cy rotation's center vertical position.
4044 * @see evas_map_point_coord_set()
4045 * @see evas_map_util_zoom()
4047 EAPI void evas_map_util_rotate (Evas_Map *m, double degrees, Evas_Coord cx, Evas_Coord cy);
4050 * Change the map to apply the given zooming.
4052 * Like evas_map_util_rotate(), this zooms the points of the map from a center
4053 * point. That center is defined by @p cx and @p cy. The @p zoomx and @p zoomy
4054 * parameters specify how much to zoom in the X and Y direction respectively.
4055 * A value of 1.0 means "don't zoom". 2.0 means "dobule the size". 0.5 is
4056 * "half the size" etc. All coordinates are canvas global coordinates.
4058 * @param m map to change.
4059 * @param zoomx horizontal zoom to use.
4060 * @param zoomy vertical zoom to use.
4061 * @param cx zooming center horizontal position.
4062 * @param cy zooming center vertical position.
4064 * @see evas_map_point_coord_set()
4065 * @see evas_map_util_rotate()
4067 EAPI void evas_map_util_zoom (Evas_Map *m, double zoomx, double zoomy, Evas_Coord cx, Evas_Coord cy);
4070 * Rotate the map around 3 axes in 3D
4072 * This will rotate not just around the "Z" axis as in evas_map_util_rotate()
4073 * (which is a convenience call for those only wanting 2D). This will rotate
4074 * around the X, Y and Z axes. The Z axis points "into" the screen with low
4075 * values at the screen and higher values further away. The X axis runs from
4076 * left to right on the screen and the Y axis from top to bottom. Like with
4077 * evas_map_util_rotate() you provide a center point to rotate around (in 3D).
4079 * @param m map to change.
4080 * @param dx amount of degrees from 0.0 to 360.0 to rotate arount X axis.
4081 * @param dy amount of degrees from 0.0 to 360.0 to rotate arount Y axis.
4082 * @param dz amount of degrees from 0.0 to 360.0 to rotate arount Z axis.
4083 * @param cx rotation's center horizontal position.
4084 * @param cy rotation's center vertical position.
4085 * @param cz rotation's center vertical position.
4087 EAPI void evas_map_util_3d_rotate (Evas_Map *m, double dx, double dy, double dz, Evas_Coord cx, Evas_Coord cy, Evas_Coord cz);
4090 * Perform lighting calculations on the given Map
4092 * This is used to apply lighting calculations (from a single light source)
4093 * to a given map. The R, G and B values of each vertex will be modified to
4094 * reflect the lighting based on the lixth point coordinates, the light
4095 * color and the ambient color, and at what angle the map is facing the
4096 * light source. A surface should have its points be declared in a
4097 * clockwise fashion if the face is "facing" towards you (as opposed to
4098 * away from you) as faces have a "logical" side for lighting.
4100 * @param m map to change.
4101 * @param lx X coordinate in space of light point
4102 * @param ly Y coordinate in space of light point
4103 * @param lz Z coordinate in space of light point
4104 * @param lr light red value (0 - 255)
4105 * @param lg light green value (0 - 255)
4106 * @param lb light blue value (0 - 255)
4107 * @param ar ambient color red value (0 - 255)
4108 * @param ag ambient color green value (0 - 255)
4109 * @param ab ambient color blue value (0 - 255)
4111 EAPI void evas_map_util_3d_lighting (Evas_Map *m, Evas_Coord lx, Evas_Coord ly, Evas_Coord lz, int lr, int lg, int lb, int ar, int ag, int ab);
4114 * Apply a perspective transform to the map
4116 * This applies a given perspective (3D) to the map coordinates. X, Y and Z
4117 * values are used. The px and py points specify the "infinite distance" point
4118 * in the 3D conversion (where all lines converge to like when artists draw
4119 * 3D by hand). The @p z0 value specifis the z value at which there is a 1:1
4120 * mapping between spatial coorinates and screen coordinates. Any points
4121 * on this z value will not have their X and Y values modified in the transform.
4122 * Those further away (Z value higher) will shrink into the distance, and
4123 * those less than this value will expand and become bigger. The @p foc value
4124 * determines the "focal length" of the camera. This is in reality the distance
4125 * between the camera lens plane itself (at or closer than this rendering
4126 * results are undefined) and the "z0" z value. This allows for some "depth"
4127 * control and @p foc must be greater than 0.
4129 * @param m map to change.
4130 * @param px The pespective distance X coordinate
4131 * @param py The pespective distance Y coordinate
4132 * @param z0 The "0" z plane value
4133 * @param foc The focal distance
4135 EAPI void evas_map_util_3d_perspective (Evas_Map *m, Evas_Coord px, Evas_Coord py, Evas_Coord z0, Evas_Coord foc);
4138 * Get the clockwise state of a map
4140 * This determines if the output points (X and Y. Z is not used) are
4141 * clockwise or anti-clockwise. This can be used for "back-face culling". This
4142 * is where you hide objects that "face away" from you. In this case objects
4143 * that are not clockwise.
4145 * @param m map to query.
4146 * @return 1 if clockwise, 0 otherwise
4148 EAPI Eina_Bool evas_map_util_clockwise_get (Evas_Map *m);
4152 * Create map of transformation points to be later used with an Evas object.
4154 * This creates a set of points (currently only 4 is supported. no other
4155 * number for @p count will work). That is empty and ready to be modified
4156 * with evas_map calls.
4158 * @param count number of points in the map.
4159 * @return a newly allocated map or @c NULL on errors.
4161 * @see evas_map_free()
4162 * @see evas_map_dup()
4163 * @see evas_map_point_coord_set()
4164 * @see evas_map_point_image_uv_set()
4165 * @see evas_map_util_points_populate_from_object_full()
4166 * @see evas_map_util_points_populate_from_object()
4168 * @see evas_object_map_set()
4170 EAPI Evas_Map *evas_map_new (int count);
4173 * Set the smoothing for map rendering
4175 * This sets smoothing for map rendering. If the object is a type that has
4176 * its own smoothing settings, then both the smooth settings for this object
4177 * and the map must be turned off. By default smooth maps are enabled.
4179 * @param m map to modify. Must not be NULL.
4180 * @param enabled enable or disable smooth map rendering
4182 EAPI void evas_map_smooth_set (Evas_Map *m, Eina_Bool enabled);
4185 * get the smoothing for map rendering
4187 * This gets smoothing for map rendering.
4189 * @param m map to get the smooth from. Must not be NULL.
4191 EAPI Eina_Bool evas_map_smooth_get (const Evas_Map *m);
4194 * Set the alpha flag for map rendering
4196 * This sets alpha flag for map rendering. If the object is a type that has
4197 * its own alpha settings, then this will take precedence. Only image objects
4198 * have this currently.
4199 * Setting this off stops alpha blending of the map area, and is
4200 * useful if you know the object and/or all sub-objects is 100% solid.
4202 * @param m map to modify. Must not be NULL.
4203 * @param enabled enable or disable alpha map rendering
4205 EAPI void evas_map_alpha_set (Evas_Map *m, Eina_Bool enabled);
4208 * get the alpha flag for map rendering
4210 * This gets the alph flag for map rendering.
4212 * @param m map to get the alpha from. Must not be NULL.
4214 EAPI Eina_Bool evas_map_alpha_get (const Evas_Map *m);
4217 * Copy a previously allocated map.
4219 * This makes a duplicate of the @p m object and returns it.
4221 * @param m map to copy. Must not be NULL.
4222 * @return newly allocated map with the same count and contents as @p m.
4224 EAPI Evas_Map *evas_map_dup (const Evas_Map *m);
4227 * Free a previously allocated map.
4229 * This frees a givem map @p m and all memory associated with it. You must NOT
4230 * free a map returned by evas_object_map_get() as this is internal.
4232 * @param m map to free.
4234 EAPI void evas_map_free (Evas_Map *m);
4239 * Returns the number of points in a map. Should be at least 4.
4241 * @param m map to get size.
4242 * @return -1 on error, points otherwise.
4244 EAPI int evas_map_count_get (const Evas_Map *m) EINA_CONST;
4247 * Change the map point's coordinate.
4249 * This sets the fixed point's coordinate in the map. Note that points
4250 * describe the outline of a quadrangle and are ordered either clockwise
4251 * or anit-clock-wise. It is suggested to keep your quadrangles concave and
4252 * non-complex, though these polygon modes may work, they may not render
4253 * a desired set of output. The quadrangle will use points 0 and 1 , 1 and 2,
4254 * 2 and 3, and 3 and 0 to describe the edges of the quandrangle.
4256 * The X and Y and Z coordinates are in canvas units. Z is optional and may
4257 * or may not be honored in drawing. Z is a hint and does not affect the
4258 * X and Y rendered coordinates. It may be used for calculating fills with
4259 * perspective correct rendering.
4261 * Remember all coordinates are canvas global ones like with move and reize
4264 * @param m map to change point. Must not be @c NULL.
4265 * @param idx index of point to change. Must be smaller than map size.
4266 * @param x Point X Coordinate
4267 * @param y Point Y Coordinate
4268 * @param z Point Z Coordinate hint (pre-perspective transform)
4270 * @see evas_map_util_rotate()
4271 * @see evas_map_util_zoom()
4272 * @see evas_map_util_points_populate_from_object_full()
4273 * @see evas_map_util_points_populate_from_object()
4275 EAPI void evas_map_point_coord_set (Evas_Map *m, int idx, Evas_Coord x, Evas_Coord y, Evas_Coord z);
4278 * Get the map point's coordinate.
4280 * This returns the coordinates of the given point in the map.
4282 * @param m map to query point.
4283 * @param idx index of point to query. Must be smaller than map size.
4284 * @param x where to return the X coordinate.
4285 * @param y where to return the Y coordinate.
4286 * @param z where to return the Z coordinate.
4288 EAPI void evas_map_point_coord_get (const Evas_Map *m, int idx, Evas_Coord *x, Evas_Coord *y, Evas_Coord *z);
4291 * Change the map point's U and V texture source point
4293 * This sets the U and V coordinates for the point. This determines which
4294 * coordinate in the source image is mapped to the given point, much like
4295 * OpenGL and textures. Notes that these points do select the pixel, but
4296 * are double floating point values to allow for accuracy and sub-pixel
4299 * @param m map to change the point of.
4300 * @param idx index of point to change. Must be smaller than map size.
4301 * @param u the X coordinate within the image/texture source
4302 * @param v the Y coordinate within the image/texture source
4304 * @see evas_map_point_coord_set()
4305 * @see evas_object_map_set()
4306 * @see evas_map_util_points_populate_from_object_full()
4307 * @see evas_map_util_points_populate_from_object()
4309 EAPI void evas_map_point_image_uv_set (Evas_Map *m, int idx, double u, double v);
4312 * Get the map point's U and V texture source points
4314 * This returns the texture points set by evas_map_point_image_uv_set().
4316 * @param m map to query point.
4317 * @param idx index of point to query. Must be smaller than map size.
4318 * @param u where to write the X coordinate within the image/texture source
4319 * @param v where to write the Y coordinate within the image/texture source
4321 EAPI void evas_map_point_image_uv_get (const Evas_Map *m, int idx, double *u, double *v);
4324 * Set the color of a vertex in the map
4326 * This sets the color of the vertex in the map. Colors will be linearly
4327 * interpolated between vertex points through the map. Color will multiply
4328 * the "texture" pixels (like GL_MODULATE in OpenGL). The default color of
4329 * a vertex in a map is white solid (255, 255, 255, 255) which means it will
4330 * have no affect on modifying the texture pixels.
4332 * @param m map to change the color of.
4333 * @param idx index of point to change. Must be smaller than map size.
4334 * @param r red (0 - 255)
4335 * @param g green (0 - 255)
4336 * @param b blue (0 - 255)
4337 * @param a alpha (0 - 255)
4339 * @see evas_map_util_points_color_set()
4340 * @see evas_map_point_coord_set()
4341 * @see evas_object_map_set()
4343 EAPI void evas_map_point_color_set (Evas_Map *m, int idx, int r, int g, int b, int a);
4346 * Get the color set on a vertex in the map
4348 * This gets the color set by evas_map_point_color_set() on the given vertex
4351 * @param m map to get the color of the vertex from.
4352 * @param idx index of point get. Must be smaller than map size.
4353 * @param r pointer to red return
4354 * @param g pointer to green return
4355 * @param b pointer to blue return
4356 * @param a pointer to alpha return (0 - 255)
4358 * @see evas_map_point_coord_set()
4359 * @see evas_object_map_set()
4361 EAPI void evas_map_point_color_get (const Evas_Map *m, int idx, int *r, int *g, int *b, int *a);
4367 * @defgroup Evas_Object_Group_Size_Hints Size Hints
4369 * Objects may carry hints, so that another object that acts as a
4370 * manager (see @ref Evas_Smart_Object_Group) may know how to properly
4371 * position and resize its subordinate objects. The Size Hints provide
4372 * a common interface that is recommended as the protocol for such
4375 * For example, box objects use alignment hints to align its
4376 * lines/columns inside its container, padding hints to set the
4377 * padding between each individual child, etc.
4379 * Examples on their usage:
4380 * - @ref Example_Evas_Size_Hints "evas-hints.c"
4381 * - @ref Example_Evas_Aspect_Hints "evas-aspect-hints.c"
4383 * @ingroup Evas_Object_Group
4387 * @addtogroup Evas_Object_Group_Size_Hints
4392 * Retrieves the hints for an object's minimum size.
4394 * @param obj The given Evas object to query hints from.
4395 * @param w Pointer to an integer in which to store the minimum width.
4396 * @param h Pointer to an integer in which to store the minimum height.
4398 * These are hints on the minimim sizes @p obj should have. This is
4399 * not a size enforcement in any way, it's just a hint that should be
4400 * used whenever appropriate.
4402 * @note Use @c NULL pointers on the hint components you're not
4403 * interested in: they'll be ignored by the function.
4405 * @see evas_object_size_hint_min_set() for an example
4407 EAPI void evas_object_size_hint_min_get (const Evas_Object *obj, Evas_Coord *w, Evas_Coord *h) EINA_ARG_NONNULL(1);
4410 * Sets the hints for an object's minimum size.
4412 * @param obj The given Evas object to query hints from.
4413 * @param w Integer to use as the minimum width hint.
4414 * @param h Integer to use as the minimum height hint.
4416 * This is not a size enforcement in any way, it's just a hint that
4417 * should be used whenever appropriate.
4419 * Values @c 0 will be treated as unset hint components, when queried
4423 * @dontinclude evas-hints.c
4424 * @skip evas_object_size_hint_min_set
4427 * In this example the minimum size hints change de behavior of an
4428 * Evas box when layouting its children. See the full @ref
4429 * Example_Evas_Size_Hints "example".
4431 * @see evas_object_size_hint_min_get()
4433 EAPI void evas_object_size_hint_min_set (Evas_Object *obj, Evas_Coord w, Evas_Coord h) EINA_ARG_NONNULL(1);
4436 * Retrieves the hints for an object's maximum size.
4438 * @param obj The given Evas object to query hints from.
4439 * @param w Pointer to an integer in which to store the maximum width.
4440 * @param h Pointer to an integer in which to store the maximum height.
4442 * These are hints on the maximum sizes @p obj should have. This is
4443 * not a size enforcement in any way, it's just a hint that should be
4444 * used whenever appropriate.
4446 * @note Use @c NULL pointers on the hint components you're not
4447 * interested in: they'll be ignored by the function.
4449 * @see evas_object_size_hint_max_set()
4451 EAPI void evas_object_size_hint_max_get (const Evas_Object *obj, Evas_Coord *w, Evas_Coord *h) EINA_ARG_NONNULL(1);
4454 * Sets the hints for an object's maximum size.
4456 * @param obj The given Evas object to query hints from.
4457 * @param w Integer to use as the maximum width hint.
4458 * @param h Integer to use as the maximum height hint.
4460 * This is not a size enforcement in any way, it's just a hint that
4461 * should be used whenever appropriate.
4463 * Values @c -1 will be treated as unset hint components, when queried
4467 * @dontinclude evas-hints.c
4468 * @skip evas_object_size_hint_max_set
4471 * In this example the maximum size hints change de behavior of an
4472 * Evas box when layouting its children. See the full @ref
4473 * Example_Evas_Size_Hints "example".
4475 * @see evas_object_size_hint_max_get()
4477 EAPI void evas_object_size_hint_max_set (Evas_Object *obj, Evas_Coord w, Evas_Coord h) EINA_ARG_NONNULL(1);
4480 * Retrieves the hints for an object's optimum size.
4482 * @param obj The given Evas object to query hints from.
4483 * @param w Pointer to an integer in which to store the requested width.
4484 * @param h Pointer to an integer in which to store the requested height.
4486 * These are hints on the optimum sizes @p obj should have. This is
4487 * not a size enforcement in any way, it's just a hint that should be
4488 * used whenever appropriate.
4490 * @note Use @c NULL pointers on the hint components you're not
4491 * interested in: they'll be ignored by the function.
4493 * @see evas_object_size_hint_request_set()
4495 EAPI void evas_object_size_hint_request_get (const Evas_Object *obj, Evas_Coord *w, Evas_Coord *h) EINA_ARG_NONNULL(1);
4498 * Sets the hints for an object's optimum size.
4500 * @param obj The given Evas object to query hints from.
4501 * @param w Integer to use as the preferred width hint.
4502 * @param h Integer to use as the preferred height hint.
4504 * This is not a size enforcement in any way, it's just a hint that
4505 * should be used whenever appropriate.
4507 * Values @c 0 will be treated as unset hint components, when queried
4510 * @see evas_object_size_hint_request_get()
4512 EAPI void evas_object_size_hint_request_set (Evas_Object *obj, Evas_Coord w, Evas_Coord h) EINA_ARG_NONNULL(1);
4515 * Retrieves the hints for an object's aspect ratio.
4517 * @param obj The given Evas object to query hints from.
4518 * @param aspect Returns the policy/type of aspect ratio applied to @p obj.
4519 * @param w Pointer to an integer in which to store the aspect's width
4521 * @param h Pointer to an integer in which to store the aspect's
4522 * height ratio term.
4524 * The different aspect ratio policies are documented in the
4525 * #Evas_Aspect_Control type. A container respecting these size hints
4526 * would @b scale its children accordingly to those policies.
4528 * For any policy, if any of the given aspect ratio terms are @c 0,
4529 * the object's container should ignore the aspect and scale @p obj to
4530 * occupy the whole available area. If they are both positive
4531 * integers, that proportion will be respected, under each scaling
4534 * These images illustrate some of the #Evas_Aspect_Control policies:
4536 * @image html any-policy.png
4537 * @image rtf any-policy.png
4538 * @image latex any-policy.eps
4540 * @image html aspect-control-none-neither.png
4541 * @image rtf aspect-control-none-neither.png
4542 * @image latex aspect-control-none-neither.eps
4544 * @image html aspect-control-both.png
4545 * @image rtf aspect-control-both.png
4546 * @image latex aspect-control-both.eps
4548 * @image html aspect-control-horizontal.png
4549 * @image rtf aspect-control-horizontal.png
4550 * @image latex aspect-control-horizontal.eps
4552 * This is not a size enforcement in any way, it's just a hint that
4553 * should be used whenever appropriate.
4555 * @note Use @c NULL pointers on the hint components you're not
4556 * interested in: they'll be ignored by the function.
4559 * @dontinclude evas-aspect-hints.c
4560 * @skip if (strcmp(ev->keyname, "c") == 0)
4563 * See the full @ref Example_Evas_Aspect_Hints "example".
4565 * @see evas_object_size_hint_aspect_set()
4567 EAPI void evas_object_size_hint_aspect_get (const Evas_Object *obj, Evas_Aspect_Control *aspect, Evas_Coord *w, Evas_Coord *h) EINA_ARG_NONNULL(1);
4570 * Sets the hints for an object's aspect ratio.
4572 * @param obj The given Evas object to query hints from.
4573 * @param aspect The policy/type of aspect ratio to apply to @p obj.
4574 * @param w Integer to use as aspect width ratio term.
4575 * @param h Integer to use as aspect height ratio term.
4577 * This is not a size enforcement in any way, it's just a hint that should
4578 * be used whenever appropriate.
4580 * If any of the given aspect ratio terms are @c 0,
4581 * the object's container will ignore the aspect and scale @p obj to
4582 * occupy the whole available area, for any given policy.
4584 * @see evas_object_size_hint_aspect_get() for more information.
4586 EAPI void evas_object_size_hint_aspect_set (Evas_Object *obj, Evas_Aspect_Control aspect, Evas_Coord w, Evas_Coord h) EINA_ARG_NONNULL(1);
4589 * Retrieves the hints for on object's alignment.
4591 * @param obj The given Evas object to query hints from.
4592 * @param x Pointer to a double in which to store the horizontal
4594 * @param y Pointer to a double in which to store the vertical
4597 * This is not a size enforcement in any way, it's just a hint that
4598 * should be used whenever appropriate.
4600 * @note Use @c NULL pointers on the hint components you're not
4601 * interested in: they'll be ignored by the function.
4603 * @see evas_object_size_hint_align_set() for more information
4605 EAPI void evas_object_size_hint_align_get (const Evas_Object *obj, double *x, double *y) EINA_ARG_NONNULL(1);
4608 * Sets the hints for an object's alignment.
4610 * @param obj The given Evas object to query hints from.
4611 * @param x Double, ranging from @c 0.0 to @c 1.0 or with the
4612 * special value #EVAS_HINT_FILL, to use as horizontal alignment hint.
4613 * @param y Double, ranging from @c 0.0 to @c 1.0 or with the
4614 * special value #EVAS_HINT_FILL, to use as vertical alignment hint.
4616 * These are hints on how to align an object <b>inside the boundaries
4617 * of a container/manager</b>. Accepted values are in the @c 0.0 to @c
4618 * 1.0 range, with the special value #EVAS_HINT_FILL used to specify
4619 * "justify" or "fill" by some users. See documentation of possible
4620 * users: in Evas, they are the @ref Evas_Object_Box "box" and @ref
4621 * Evas_Object_Table "table" smart objects.
4623 * For the horizontal component, @c 0.0 means to the left, @c 1.0
4624 * means to the right. Analogously, for the vertical component, @c 0.0
4625 * to the top, @c 1.0 means to the bottom.
4627 * See the following figure:
4628 * @image html alignment-hints.png
4629 * @image rtf alignment-hints.png
4630 * @image latex alignment-hints.eps
4632 * This is not a size enforcement in any way, it's just a hint that
4633 * should be used whenever appropriate.
4636 * @dontinclude evas-hints.c
4637 * @skip evas_object_size_hint_align_set
4640 * In this example the alignment hints change de behavior of an Evas
4641 * box when layouting its children. See the full @ref
4642 * Example_Evas_Size_Hints "example".
4644 * @see evas_object_size_hint_align_get()
4646 EAPI void evas_object_size_hint_align_set (Evas_Object *obj, double x, double y) EINA_ARG_NONNULL(1);
4649 * Retrieves the hints for an object's weight.
4651 * @param obj The given Evas object to query hints from.
4652 * @param x Pointer to a double in which to store the horizontal weight.
4653 * @param y Pointer to a double in which to store the vertical weight.
4655 * Accepted values are zero or positive values. Some users might use
4656 * this hint as a boolean, but some might consider it as a @b
4657 * proportion, see documentation of possible users, which in Evas are
4658 * the @ref Evas_Object_Box "box" and @ref Evas_Object_Table "table"
4661 * This is not a size enforcement in any way, it's just a hint that
4662 * should be used whenever appropriate.
4664 * @note Use @c NULL pointers on the hint components you're not
4665 * interested in: they'll be ignored by the function.
4667 * @see evas_object_size_hint_weight_set() for an example
4669 EAPI void evas_object_size_hint_weight_get (const Evas_Object *obj, double *x, double *y) EINA_ARG_NONNULL(1);
4672 * Sets the hints for an object's weight.
4674 * @param obj The given Evas object to query hints from.
4675 * @param x Double (@c 0.0-1.0) to use as horizontal weight hint.
4676 * @param y Double (@c 0.0-1.0) to use as vertical weight hint.
4678 * This is not a size enforcement in any way, it's just a hint that should
4679 * be used whenever appropriate.
4682 * @dontinclude evas-hints.c
4683 * @skip evas_object_size_hint_weight_set
4686 * In this example the weight hints change de behavior of an Evas box
4687 * when layouting its children. See the full @ref
4688 * Example_Evas_Size_Hints "example".
4690 * @see evas_object_size_hint_weight_get() for more information
4692 EAPI void evas_object_size_hint_weight_set (Evas_Object *obj, double x, double y) EINA_ARG_NONNULL(1);
4695 * Retrieves the hints for an object's padding space.
4697 * @param obj The given Evas object to query hints from.
4698 * @param l Pointer to an integer in which to store left padding.
4699 * @param r Pointer to an integer in which to store right padding.
4700 * @param t Pointer to an integer in which to store top padding.
4701 * @param b Pointer to an integer in which to store bottom padding.
4703 * Padding is extra space an object takes on each of its delimiting
4704 * rectangle sides, in canvas units. This space will be rendered
4705 * transparent, naturally.
4707 * This is not a size enforcement in any way, it's just a hint that
4708 * should be used whenever appropriate.
4710 * @note Use @c NULL pointers on the hint components you're not
4711 * interested in: they'll be ignored by the function.
4714 * @dontinclude evas-hints.c
4715 * @skip evas_object_size_hint_padding_set
4718 * In this example the padding hints change de behavior of an Evas box
4719 * when layouting its children. See the full @ref
4720 * Example_Evas_Size_Hints "example".
4722 * @see evas_object_size_hint_padding_set()
4724 EAPI void evas_object_size_hint_padding_get (const Evas_Object *obj, Evas_Coord *l, Evas_Coord *r, Evas_Coord *t, Evas_Coord *b) EINA_ARG_NONNULL(1);
4727 * Sets the hints for an object's padding space.
4729 * @param obj The given Evas object to query hints from.
4730 * @param l Integer to specify left padding.
4731 * @param r Integer to specify right padding.
4732 * @param t Integer to specify top padding.
4733 * @param b Integer to specify bottom padding.
4735 * This is not a size enforcement in any way, it's just a hint that
4736 * should be used whenever appropriate.
4738 * @see evas_object_size_hint_padding_get() for more information
4740 EAPI void evas_object_size_hint_padding_set (Evas_Object *obj, Evas_Coord l, Evas_Coord r, Evas_Coord t, Evas_Coord b) EINA_ARG_NONNULL(1);
4747 * @defgroup Evas_Object_Group_Extras Extra Object Manipulation
4749 * Miscellaneous functions that also apply to any object, but are less
4750 * used or not implemented by all objects.
4752 * Examples on this group of functions can be found @ref
4753 * Example_Evas_Stacking "here" and @ref Example_Evas_Events "here".
4755 * @ingroup Evas_Object_Group
4759 * @addtogroup Evas_Object_Group_Extras
4764 * Set an attached data pointer to an object with a given string key.
4766 * @param obj The object to attach the data pointer to
4767 * @param key The string key for the data to access it
4768 * @param data The ponter to the data to be attached
4770 * This attaches the pointer @p data to the object @p obj, given the
4771 * access string @p key. This pointer will stay "hooked" to the object
4772 * until a new pointer with the same string key is attached with
4773 * evas_object_data_set() or it is deleted with
4774 * evas_object_data_del(). On deletion of the object @p obj, the
4775 * pointers will not be accessible from the object anymore.
4777 * You can find the pointer attached under a string key using
4778 * evas_object_data_get(). It is the job of the calling application to
4779 * free any data pointed to by @p data when it is no longer required.
4781 * If @p data is @c NULL, the old value stored at @p key will be
4782 * removed but no new value will be stored. This is synonymous with
4783 * calling evas_object_data_del() with @p obj and @p key.
4785 * @note This function is very handy when you have data associated
4786 * specifically to an Evas object, being of use only when dealing with
4787 * it. Than you don't have the burden to a pointer to it elsewhere,
4788 * using this family of functions.
4794 * extern Evas_Object *obj;
4796 * my_data = malloc(500);
4797 * evas_object_data_set(obj, "name_of_data", my_data);
4798 * printf("The data that was attached was %p\n", evas_object_data_get(obj, "name_of_data"));
4801 EAPI void evas_object_data_set (Evas_Object *obj, const char *key, const void *data) EINA_ARG_NONNULL(1, 2);
4804 * Return an attached data pointer on an Evas object by its given
4807 * @param obj The object to which the data was attached
4808 * @param key The string key the data was stored under
4809 * @return The data pointer stored, or @c NULL if none was stored
4811 * This function will return the data pointer attached to the object
4812 * @p obj, stored using the string key @p key. If the object is valid
4813 * and a data pointer was stored under the given key, that pointer
4814 * will be returned. If this is not the case, @c NULL will be
4815 * returned, signifying an invalid object or a non-existent key. It is
4816 * possible that a @c NULL pointer was stored given that key, but this
4817 * situation is non-sensical and thus can be considered an error as
4818 * well. @c NULL pointers are never stored as this is the return value
4819 * if an error occurs.
4825 * extern Evas_Object *obj;
4827 * my_data = evas_object_data_get(obj, "name_of_my_data");
4828 * if (my_data) printf("Data stored was %p\n", my_data);
4829 * else printf("No data was stored on the object\n");
4832 EAPI void *evas_object_data_get (const Evas_Object *obj, const char *key) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2) EINA_PURE;
4835 * Delete an attached data pointer from an object.
4837 * @param obj The object to delete the data pointer from
4838 * @param key The string key the data was stored under
4839 * @return The original data pointer stored at @p key on @p obj
4841 * This will remove the stored data pointer from @p obj stored under
4842 * @p key and return this same pointer, if actually there was data
4843 * there, or @c NULL, if nothing was stored under that key.
4849 * extern Evas_Object *obj;
4851 * my_data = evas_object_data_del(obj, "name_of_my_data");
4854 EAPI void *evas_object_data_del (Evas_Object *obj, const char *key) EINA_ARG_NONNULL(1, 2);
4858 * Set pointer behavior.
4861 * @param setting desired behavior.
4863 * This function has direct effect on event callbacks related to
4866 * If @p setting is EVAS_OBJECT_POINTER_MODE_AUTOGRAB, then when mouse
4867 * is down at this object, events will be restricted to it as source,
4868 * mouse moves, for example, will be emitted even if outside this
4871 * If @p setting is EVAS_OBJECT_POINTER_MODE_NOGRAB, then events will
4872 * be emitted just when inside this object area.
4874 * The default value is EVAS_OBJECT_POINTER_MODE_AUTOGRAB.
4876 * @ingroup Evas_Object_Group_Extras
4878 EAPI void evas_object_pointer_mode_set (Evas_Object *obj, Evas_Object_Pointer_Mode setting) EINA_ARG_NONNULL(1);
4881 * Determine how pointer will behave.
4883 * @return pointer behavior.
4884 * @ingroup Evas_Object_Group_Extras
4886 EAPI Evas_Object_Pointer_Mode evas_object_pointer_mode_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
4890 * Sets whether or not the given Evas object is to be drawn anti-aliased.
4892 * @param obj The given Evas object.
4893 * @param anti_alias 1 if the object is to be anti_aliased, 0 otherwise.
4894 * @ingroup Evas_Object_Group_Extras
4896 EAPI void evas_object_anti_alias_set (Evas_Object *obj, Eina_Bool antialias) EINA_ARG_NONNULL(1);
4899 * Retrieves whether or not the given Evas object is to be drawn anti_aliased.
4900 * @param obj The given Evas object.
4901 * @return @c 1 if the object is to be anti_aliased. @c 0 otherwise.
4902 * @ingroup Evas_Object_Group_Extras
4904 EAPI Eina_Bool evas_object_anti_alias_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
4908 * Sets the scaling factor for an Evas object. Does not affect all
4911 * @param obj The given Evas object.
4912 * @param scale The scaling factor. <c>1.0</c> means no scaling,
4915 * This will multiply the object's dimension by the given factor, thus
4916 * altering its geometry (width and height). Useful when you want
4917 * scalable UI elements, possibly at run time.
4919 * @note Only text and textblock objects have scaling change
4920 * handlers. Other objects won't change visually on this call.
4922 * @see evas_object_scale_get()
4924 * @ingroup Evas_Object_Group_Extras
4926 EAPI void evas_object_scale_set (Evas_Object *obj, double scale) EINA_ARG_NONNULL(1);
4929 * Retrieves the scaling factor for the given Evas object.
4931 * @param obj The given Evas object.
4932 * @return The scaling factor.
4934 * @ingroup Evas_Object_Group_Extras
4936 * @see evas_object_scale_set()
4938 EAPI double evas_object_scale_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
4942 * Sets the render_op to be used for rendering the Evas object.
4943 * @param obj The given Evas object.
4944 * @param render_op one of the Evas_Render_Op values.
4945 * @ingroup Evas_Object_Group_Extras
4947 EAPI void evas_object_render_op_set (Evas_Object *obj, Evas_Render_Op op) EINA_ARG_NONNULL(1);
4950 * Retrieves the current value of the operation used for rendering the Evas object.
4951 * @param obj The given Evas object.
4952 * @return one of the enumerated values in Evas_Render_Op.
4953 * @ingroup Evas_Object_Group_Extras
4955 EAPI Evas_Render_Op evas_object_render_op_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
4958 * Set whether to use precise (usually expensive) point collision
4959 * detection for a given Evas object.
4961 * @param obj The given object.
4962 * @param precise whether to use precise point collision detection or
4963 * not The default value is false.
4965 * Use this function to make Evas treat objects' transparent areas as
4966 * @b not belonging to it with regard to mouse pointer events. By
4967 * default, all of the object's boundary rectangle will be taken in
4970 * @warning By using precise point collision detection you'll be
4971 * making Evas more resource intensive.
4973 * Example code follows.
4974 * @dontinclude evas-events.c
4975 * @skip if (strcmp(ev->keyname, "p") == 0)
4978 * See the full example @ref Example_Evas_Events "here".
4980 * @see evas_object_precise_is_inside_get()
4981 * @ingroup Evas_Object_Group_Extras
4983 EAPI void evas_object_precise_is_inside_set(Evas_Object *obj, Eina_Bool precise) EINA_ARG_NONNULL(1);
4986 * Determine whether an object is set to use precise point collision
4989 * @param obj The given object.
4990 * @return whether @p obj is set to use precise point collision
4991 * detection or not The default value is false.
4993 * @see evas_object_precise_is_inside_set() for an example
4995 * @ingroup Evas_Object_Group_Extras
4997 EAPI Eina_Bool evas_object_precise_is_inside_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
4999 EAPI void evas_object_static_clip_set (Evas_Object *obj, Eina_Bool is_static_clip) EINA_ARG_NONNULL(1);
5000 EAPI Eina_Bool evas_object_static_clip_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
5007 * @defgroup Evas_Object_Group_Find Finding Objects
5009 * Functions that allows finding objects by their position, name or
5012 * @ingroup Evas_Object_Group
5016 * @addtogroup Evas_Object_Group_Find
5021 * Retrieve the object that currently has focus.
5023 * @param e The Evas canvas to query for focused object on.
5024 * @return The object that has focus or @c NULL if there is not one.
5026 * Evas can have (at most) one of its objects focused at a time.
5027 * Focused objects will be the ones having <b>key events</b> delivered
5028 * to, which the programmer can act upon by means of
5029 * evas_object_event_callback_add() usage.
5031 * @note Most users wouldn't be dealing directly with Evas' focused
5032 * objects. Instead, they would be using a higher level library for
5033 * that (like a toolkit, as Elementary) to handle focus and who's
5034 * receiving input for them.
5036 * This call returns the object that currently has focus on the canvas
5037 * @p e or @c NULL, if none.
5039 * @see evas_object_focus_set
5040 * @see evas_object_focus_get
5041 * @see evas_object_key_grab
5042 * @see evas_object_key_ungrab
5045 * @dontinclude evas-events.c
5046 * @skip evas_event_callback_add(d.canvas, EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_IN,
5047 * @until evas_object_focus_set(d.bg, EINA_TRUE);
5048 * @dontinclude evas-events.c
5049 * @skip called when our rectangle gets focus
5052 * In this example the @c event_info is exactly a pointer to that
5053 * focused rectangle. See the full @ref Example_Evas_Events "example".
5055 * @ingroup Evas_Object_Group_Find
5057 EAPI Evas_Object *evas_focus_get (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
5061 * Retrieves the object on the given evas with the given name.
5062 * @param e The given evas.
5063 * @param name The given name.
5064 * @return If successful, the Evas object with the given name. Otherwise,
5066 * @ingroup Evas_Object_Group_Find
5068 EAPI Evas_Object *evas_object_name_find (const Evas *e, const char *name) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
5072 * Retrieves the top object at the given position (x,y)
5073 * @param e The given Evas object.
5074 * @param x The horizontal coordinate
5075 * @param y The vertical coordinate
5076 * @param include_pass_events_objects Boolean Flag to include or not
5077 * pass events objects
5078 * @param include_hidden_objects Boolean Flag to include or not hidden objects
5079 * @return The Evas object that is over all others objects at the given position.
5081 EAPI Evas_Object *evas_object_top_at_xy_get (const Evas *e, Evas_Coord x, Evas_Coord y, Eina_Bool include_pass_events_objects, Eina_Bool include_hidden_objects) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
5084 * Retrieves the top object at mouse pointer position
5085 * @param e The given Evas object.
5086 * @return The Evas object that is over all others objects at the
5089 EAPI Evas_Object *evas_object_top_at_pointer_get (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
5092 * Retrieves the top object in the given rectangle region
5093 * @param e The given Evas object.
5094 * @param x The horizontal coordinate.
5095 * @param y The vertical coordinate.
5096 * @param w The width size.
5097 * @param h The height size.
5098 * @param include_pass_events_objects Boolean Flag to include or not pass events objects
5099 * @param include_hidden_objects Boolean Flag to include or not hidden objects
5100 * @return The Evas object that is over all others objects at the pointer position.
5103 EAPI Evas_Object *evas_object_top_in_rectangle_get (const Evas *e, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h, Eina_Bool include_pass_events_objects, Eina_Bool include_hidden_objects) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
5107 * Retrieves the objects at the given position
5108 * @param e The given Evas object.
5109 * @param x The horizontal coordinate.
5110 * @param y The vertical coordinate.
5111 * @param include_pass_events_objects Boolean Flag to include or not
5112 * pass events objects
5113 * @param include_hidden_objects Boolean Flag to include or not hidden objects
5114 * @return The list of Evas objects at the pointer position.
5117 EAPI Eina_List *evas_objects_at_xy_get (const Evas *e, Evas_Coord x, Evas_Coord y, Eina_Bool include_pass_events_objects, Eina_Bool include_hidden_objects) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
5118 EAPI Eina_List *evas_objects_in_rectangle_get (const Evas *e, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h, Eina_Bool include_pass_events_objects, Eina_Bool include_hidden_objects) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
5121 * Get the lowest (stacked) Evas object on the canvas @p
5123 * @param e a valid canvas pointer
5124 * @return a pointer to the lowest object on it, if any, or @c NULL,
5127 * This function will take all populated layers in the canvas into
5128 * account, getting the lowest object for the lowest layer, naturally.
5130 * @see evas_object_layer_get()
5131 * @see evas_object_layer_set()
5132 * @see evas_object_below_set()
5133 * @see evas_object_above_set()
5135 EAPI Evas_Object *evas_object_bottom_get (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
5138 * Get the highest (stacked) Evas object on the canvas @p
5140 * @param e a valid canvas pointer
5141 * @return a pointer to the highest object on it, if any, or @c NULL,
5144 * This function will take all populated layers in the canvas into
5145 * account, getting the highest object for the highest layer,
5148 * @see evas_object_layer_get()
5149 * @see evas_object_layer_set()
5150 * @see evas_object_below_set()
5151 * @see evas_object_above_set()
5153 EAPI Evas_Object *evas_object_top_get (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
5160 * @defgroup Evas_Object_Group_Interceptors Object Method Interceptors
5162 * Evas provides a way to intercept method calls. The interceptor
5163 * callback may opt to completely deny the call, or may check and
5164 * change the parameters before continuing. The continuation of an
5165 * intercepted call is done by calling the intercepted call again,
5166 * from inside the interceptor callback.
5168 * @ingroup Evas_Object_Group
5170 typedef void (*Evas_Object_Intercept_Show_Cb) (void *data, Evas_Object *obj);
5171 typedef void (*Evas_Object_Intercept_Hide_Cb) (void *data, Evas_Object *obj);
5172 typedef void (*Evas_Object_Intercept_Move_Cb) (void *data, Evas_Object *obj, Evas_Coord x, Evas_Coord y);
5173 typedef void (*Evas_Object_Intercept_Resize_Cb) (void *data, Evas_Object *obj, Evas_Coord w, Evas_Coord h);
5174 typedef void (*Evas_Object_Intercept_Raise_Cb) (void *data, Evas_Object *obj);
5175 typedef void (*Evas_Object_Intercept_Lower_Cb) (void *data, Evas_Object *obj);
5176 typedef void (*Evas_Object_Intercept_Stack_Above_Cb) (void *data, Evas_Object *obj, Evas_Object *above);
5177 typedef void (*Evas_Object_Intercept_Stack_Below_Cb) (void *data, Evas_Object *obj, Evas_Object *above);
5178 typedef void (*Evas_Object_Intercept_Layer_Set_Cb) (void *data, Evas_Object *obj, int l);
5179 typedef void (*Evas_Object_Intercept_Color_Set_Cb) (void *data, Evas_Object *obj, int r, int g, int b, int a);
5180 typedef void (*Evas_Object_Intercept_Clip_Set_Cb) (void *data, Evas_Object *obj, Evas_Object *clip);
5181 typedef void (*Evas_Object_Intercept_Clip_Unset_Cb) (void *data, Evas_Object *obj);
5185 * Set the callback function that intercepts a show event of a object.
5187 * @param obj The given canvas object pointer.
5188 * @param func The given function to be the callback function.
5189 * @param data The data passed to the callback function.
5191 * This function sets a callback function to intercepts a show event
5192 * of a canvas object.
5194 * @see evas_object_intercept_show_callback_del().
5197 EAPI void evas_object_intercept_show_callback_add (Evas_Object *obj, Evas_Object_Intercept_Show_Cb func, const void *data) EINA_ARG_NONNULL(1, 2);
5200 * Unset the callback function that intercepts a show event of a
5203 * @param obj The given canvas object pointer.
5204 * @param func The given callback function.
5206 * This function sets a callback function to intercepts a show event
5207 * of a canvas object.
5209 * @see evas_object_intercept_show_callback_add().
5212 EAPI void *evas_object_intercept_show_callback_del (Evas_Object *obj, Evas_Object_Intercept_Show_Cb func) EINA_ARG_NONNULL(1, 2);
5215 * Set the callback function that intercepts a hide event of a object.
5217 * @param obj The given canvas object pointer.
5218 * @param func The given function to be the callback function.
5219 * @param data The data passed to the callback function.
5221 * This function sets a callback function to intercepts a hide event
5222 * of a canvas object.
5224 * @see evas_object_intercept_hide_callback_del().
5227 EAPI void evas_object_intercept_hide_callback_add (Evas_Object *obj, Evas_Object_Intercept_Hide_Cb func, const void *data) EINA_ARG_NONNULL(1, 2);
5230 * Unset the callback function that intercepts a hide event of a
5233 * @param obj The given canvas object pointer.
5234 * @param func The given callback function.
5236 * This function sets a callback function to intercepts a hide event
5237 * of a canvas object.
5239 * @see evas_object_intercept_hide_callback_add().
5242 EAPI void *evas_object_intercept_hide_callback_del (Evas_Object *obj, Evas_Object_Intercept_Hide_Cb func) EINA_ARG_NONNULL(1, 2);
5245 * Set the callback function that intercepts a move event of a object.
5247 * @param obj The given canvas object pointer.
5248 * @param func The given function to be the callback function.
5249 * @param data The data passed to the callback function.
5251 * This function sets a callback function to intercepts a move event
5252 * of a canvas object.
5254 * @see evas_object_intercept_move_callback_del().
5257 EAPI void evas_object_intercept_move_callback_add (Evas_Object *obj, Evas_Object_Intercept_Move_Cb func, const void *data) EINA_ARG_NONNULL(1, 2);
5260 * Unset the callback function that intercepts a move event of a
5263 * @param obj The given canvas object pointer.
5264 * @param func The given callback function.
5266 * This function sets a callback function to intercepts a move event
5267 * of a canvas object.
5269 * @see evas_object_intercept_move_callback_add().
5272 EAPI void *evas_object_intercept_move_callback_del (Evas_Object *obj, Evas_Object_Intercept_Move_Cb func) EINA_ARG_NONNULL(1, 2);
5274 EAPI void evas_object_intercept_resize_callback_add (Evas_Object *obj, Evas_Object_Intercept_Resize_Cb func, const void *data) EINA_ARG_NONNULL(1, 2);
5275 EAPI void *evas_object_intercept_resize_callback_del (Evas_Object *obj, Evas_Object_Intercept_Resize_Cb func) EINA_ARG_NONNULL(1, 2);
5276 EAPI void evas_object_intercept_raise_callback_add (Evas_Object *obj, Evas_Object_Intercept_Raise_Cb func, const void *data) EINA_ARG_NONNULL(1, 2);
5277 EAPI void *evas_object_intercept_raise_callback_del (Evas_Object *obj, Evas_Object_Intercept_Raise_Cb func) EINA_ARG_NONNULL(1, 2);
5278 EAPI void evas_object_intercept_lower_callback_add (Evas_Object *obj, Evas_Object_Intercept_Lower_Cb func, const void *data) EINA_ARG_NONNULL(1, 2);
5279 EAPI void *evas_object_intercept_lower_callback_del (Evas_Object *obj, Evas_Object_Intercept_Lower_Cb func) EINA_ARG_NONNULL(1, 2);
5280 EAPI void evas_object_intercept_stack_above_callback_add (Evas_Object *obj, Evas_Object_Intercept_Stack_Above_Cb func, const void *data) EINA_ARG_NONNULL(1, 2);
5281 EAPI void *evas_object_intercept_stack_above_callback_del (Evas_Object *obj, Evas_Object_Intercept_Stack_Above_Cb func) EINA_ARG_NONNULL(1, 2);
5282 EAPI void evas_object_intercept_stack_below_callback_add (Evas_Object *obj, Evas_Object_Intercept_Stack_Below_Cb func, const void *data) EINA_ARG_NONNULL(1, 2);
5283 EAPI void *evas_object_intercept_stack_below_callback_del (Evas_Object *obj, Evas_Object_Intercept_Stack_Below_Cb func) EINA_ARG_NONNULL(1, 2);
5284 EAPI void evas_object_intercept_layer_set_callback_add (Evas_Object *obj, Evas_Object_Intercept_Layer_Set_Cb func, const void *data) EINA_ARG_NONNULL(1, 2);
5285 EAPI void *evas_object_intercept_layer_set_callback_del (Evas_Object *obj, Evas_Object_Intercept_Layer_Set_Cb func) EINA_ARG_NONNULL(1, 2);
5286 EAPI void evas_object_intercept_color_set_callback_add (Evas_Object *obj, Evas_Object_Intercept_Color_Set_Cb func, const void *data) EINA_ARG_NONNULL(1, 2);
5287 EAPI void *evas_object_intercept_color_set_callback_del (Evas_Object *obj, Evas_Object_Intercept_Color_Set_Cb func) EINA_ARG_NONNULL(1, 2);
5288 EAPI void evas_object_intercept_clip_set_callback_add (Evas_Object *obj, Evas_Object_Intercept_Clip_Set_Cb func, const void *data) EINA_ARG_NONNULL(1, 2);
5289 EAPI void *evas_object_intercept_clip_set_callback_del (Evas_Object *obj, Evas_Object_Intercept_Clip_Set_Cb func) EINA_ARG_NONNULL(1, 2);
5290 EAPI void evas_object_intercept_clip_unset_callback_add (Evas_Object *obj, Evas_Object_Intercept_Clip_Unset_Cb func, const void *data) EINA_ARG_NONNULL(1, 2);
5291 EAPI void *evas_object_intercept_clip_unset_callback_del (Evas_Object *obj, Evas_Object_Intercept_Clip_Unset_Cb func) EINA_ARG_NONNULL(1, 2);
5294 * @defgroup Evas_Object_Specific Specific Object Functions
5296 * Functions that work on specific objects.
5301 * @defgroup Evas_Object_Rectangle Rectangle Object Functions
5303 * @brief Function to create evas rectangle objects.
5305 * This function may seem useless given there are no functions to manipulate
5306 * the created rectangle, however the rectangle is actually very useful and can
5307 * be manipulate using the generic @ref Evas_Object_Group
5308 * "evas object functions".
5310 * For an example of use of an evas_object_rectangle see @ref
5311 * Example_Evas_Object_Manipulation "here".
5313 * @ingroup Evas_Object_Specific
5317 * Adds a rectangle to the given evas.
5318 * @param e The given evas.
5319 * @return The new rectangle object.
5321 * @ingroup Evas_Object_Rectangle
5323 EAPI Evas_Object *evas_object_rectangle_add (Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
5326 * @defgroup Evas_Object_Image Image Object Functions
5328 * Functions used to create and manipulate image objects.
5330 * Note - Image objects may return or accept "image data" in multiple
5331 * formats. This is based on the colorspace of an object. Here is a
5332 * rundown on formats:
5334 * - #EVAS_COLORSPACE_ARGB8888:
5336 * This pixel format is a linear block of pixels, starting at the
5337 * top-left row by row until the bottom right of the image or pixel
5338 * region. All pixels are 32-bit unsigned int's with the high-byte
5339 * being alpha and the low byte being blue in the format ARGB. Alpha
5340 * may or may not be used by evas depending on the alpha flag of the
5341 * image, but if not used, should be set to 0xff anyway.
5343 * This colorspace uses premultiplied alpha. That means that R, G
5344 * and B cannot exceed A in value. The conversion from
5345 * non-premultiplied colorspace is:
5347 * R = (r * a) / 255; G = (g * a) / 255; B = (b * a) / 255;
5349 * So 50% transparent blue will be: 0x80000080. This will not be
5350 * "dark" - just 50% transparent. Values are 0 == black, 255 ==
5351 * solid or full red, green or blue.
5353 * - #EVAS_COLORSPACE_YCBCR422P601_PL:
5355 * This is a pointer-list indirected set of YUV (YCbCr) pixel
5356 * data. This means that the data returned or set is not actual
5357 * pixel data, but pointers TO lines of pixel data. The list of
5358 * pointers will first be N rows of pointers to the Y plane -
5359 * pointing to the first pixel at the start of each row in the Y
5360 * plane. N is the height of the image data in pixels. Each pixel in
5361 * the Y, U and V planes is 1 byte exactly, packed. The next N / 2
5362 * pointers will point to rows in the U plane, and the next N / 2
5363 * pointers will point to the V plane rows. U and V planes are half
5364 * the horizontal and vertical resolution of the Y plane.
5366 * Row order is top to bottom and row pixels are stored left to
5369 * There is a limitation that these images MUST be a multiple of 2
5370 * pixels in size horizontally or vertically. This is due to the U
5371 * and V planes being half resolution. Also note that this assumes
5372 * the itu601 YUV colorspace specification. This is defined for
5373 * standard television and mpeg streams. HDTV may use the itu709
5376 * Values are 0 to 255, indicating full or no signal in that plane
5379 * - #EVAS_COLORSPACE_YCBCR422P709_PL:
5381 * Not implemented yet.
5383 * - #EVAS_COLORSPACE_RGB565_A5P:
5385 * In the process of being implemented in 1 engine only. This may
5388 * This is a pointer to image data for 16-bit half-word pixel data
5389 * in 16bpp RGB 565 format (5 bits red, 6 bits green, 5 bits blue),
5390 * with the high-byte containing red and the low byte containing
5391 * blue, per pixel. This data is packed row by row from the top-left
5392 * to the bottom right.
5394 * If the image has an alpha channel enabled there will be an extra
5395 * alpha plane after the color pixel plane. If not, then this data
5396 * will not exist and should not be accessed in any way. This plane
5397 * is a set of pixels with 1 byte per pixel defining the alpha
5398 * values of all pixels in the image from the top-left to the bottom
5399 * right of the image, row by row. Even though the values of the
5400 * alpha pixels can be 0 to 255, only values 0 through to 32 are
5401 * used, 32 being solid and 0 being transparent.
5403 * RGB values can be 0 to 31 for red and blue and 0 to 63 for green,
5404 * with 0 being black and 31 or 63 being full red, green or blue
5405 * respectively. This colorspace is also pre-multiplied like
5406 * EVAS_COLORSPACE_ARGB8888 so:
5408 * R = (r * a) / 32; G = (g * a) / 32; B = (b * a) / 32;
5410 * - #EVAS_COLORSPACE_GRY8:
5412 * The image is just a alpha mask (8 bit's per pixel). This is used
5413 * for alpha masking.
5415 * Some examples on this group of functions can be found @ref
5416 * Example_Evas_Images "here".
5418 * @ingroup Evas_Object_Specific
5422 * @addtogroup Evas_Object_Image
5426 typedef void (*Evas_Object_Image_Pixels_Get_Cb) (void *data, Evas_Object *o);
5430 * Creates a new image object on the given Evas @p e canvas.
5432 * @param e The given canvas.
5433 * @return The created image object handle.
5435 * Image objects are available to whichever occasion one needs complex
5436 * imagery on a GUI, which cannot be achieved by the other Evas'
5437 * primitive object types, or to make image manipulations.
5439 * Evas will support whichever image file types it was compiled with
5440 * support to (its image loaders) -- check your software packager for
5443 * @note If you intend to @b display an image somehow in a GUI,
5444 * besides binding it to a real image file/source (with
5445 * evas_object_image_file_set(), for example), you'll have to tell
5446 * this image object how to fill its space with the pixels it can get
5447 * from the source. See evas_object_image_filled_add(), for a helper
5448 * on the common case of scaling up an image source to the whole area
5449 * of the image object.
5451 * @see evas_object_image_fill_set()
5453 EAPI Evas_Object *evas_object_image_add (Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
5456 * Creates a new image object that @b automatically scales its bound
5457 * image to the object's area, on both axis.
5459 * @param e The given canvas.
5460 * @return The created image object handle.
5462 * This is a helper function around evas_object_image_add() and
5463 * evas_object_image_filled_set(). It has the same effect of applying
5464 * those functions in sequence, which is a very common use case.
5466 * @note Whenever this object gets resized, the bound image will be
5469 * @see evas_object_image_add()
5470 * @see evas_object_image_filled_set()
5471 * @see evas_object_image_fill_set()
5473 EAPI Evas_Object *evas_object_image_filled_add (Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
5477 * Sets the data for an image from memory to be loaded
5479 * This is the same as evas_object_image_file_set() but the file to be loaded
5480 * may exist at an address in memory (the data for the file, not the filename
5481 * itself). The @p data at the address is copied and stored for future use, so
5482 * no @p data needs to be kept after this call is made. It will be managed and
5483 * freed for you when no longer needed. The @p size is limited to 2 gigabytes
5484 * in size, and must be greater than 0. A NULL @p data pointer is also invalid.
5485 * Set the filename to NULL to reset to empty state and have the image file
5486 * data freed from memory using evas_object_image_file_set().
5488 * The @p format is optional (pass NULL if you don't need/use it). It is used
5489 * to help Evas guess better which loader to use for the data. It may simply
5490 * be the "extension" of the file as it would normally be on disk such as
5491 * "jpg" or "png" or "gif" etc.
5493 * @param obj The given image object.
5494 * @param data The image file data address
5495 * @param size The size of the image file data in bytes
5496 * @param format The format of the file (optional), or @c NULL if not needed
5497 * @param key The image key in file, or @c NULL.
5499 EAPI void evas_object_image_memfile_set (Evas_Object *obj, void *data, int size, char *format, char *key) EINA_ARG_NONNULL(1, 2);
5502 * Set the source file from where an image object must fetch the real
5503 * image data (it may be an Eet file, besides pure image ones).
5505 * @param obj The given image object.
5506 * @param file The image file path.
5507 * @param key The image key in @p file (if its an Eet one), or @c
5510 * If the file supports multiple data stored in it (as Eet files do),
5511 * you can specify the key to be used as the index of the image in
5514 EAPI void evas_object_image_file_set (Evas_Object *obj, const char *file, const char *key) EINA_ARG_NONNULL(1);
5517 * Retrieve the source file from where an image object is to fetch the
5518 * real image data (it may be an Eet file, besides pure image ones).
5520 * @param obj The given image object.
5521 * @param file Location to store the image file path.
5522 * @param key Location to store the image key (if @p file is an Eet
5525 * You must @b not modify the strings on the returned pointers.
5527 * @note Use @c NULL pointers on the file components you're not
5528 * interested in: they'll be ignored by the function.
5530 EAPI void evas_object_image_file_get (const Evas_Object *obj, const char **file, const char **key) EINA_ARG_NONNULL(1, 2);
5533 * Set the dimensions for an image object's border, a region which @b
5534 * won't ever be scaled together with its center.
5536 * @param obj The given image object.
5537 * @param l The border's left width.
5538 * @param r The border's right width.
5539 * @param t The border's top width.
5540 * @param b The border's bottom width.
5542 * When Evas is rendering, an image source may be scaled to fit the
5543 * size of its image object. This function sets an area from the
5544 * borders of the image inwards which is @b not to be scaled. This
5545 * function is useful for making frames and for widget theming, where,
5546 * for example, buttons may be of varying sizes, but their border size
5547 * must remain constant.
5549 * The units used for @p l, @p r, @p t and @p b are canvas units.
5551 * @note The border region itself @b may be scaled by the
5552 * evas_object_image_border_scale_set() function.
5554 * @note By default, image objects have no borders set, i. e. @c l, @c
5555 * r, @c t and @c b start as @c 0.
5557 * @see evas_object_image_border_get()
5558 * @see evas_object_image_border_center_fill_set()
5560 EAPI void evas_object_image_border_set (Evas_Object *obj, int l, int r, int t, int b) EINA_ARG_NONNULL(1);
5563 * Retrieve the dimensions for an image object's border, a region
5564 * which @b won't ever be scaled together with its center.
5566 * @param obj The given image object.
5567 * @param l Location to store the border's left width in.
5568 * @param r Location to store the border's right width in.
5569 * @param t Location to store the border's top width in.
5570 * @param b Location to store the border's bottom width in.
5572 * @note Use @c NULL pointers on the border components you're not
5573 * interested in: they'll be ignored by the function.
5575 * See @ref evas_object_image_border_set() for more details.
5577 EAPI void evas_object_image_border_get (const Evas_Object *obj, int *l, int *r, int *t, int *b) EINA_ARG_NONNULL(1);
5580 * Sets @b how the center part of the given image object (not the
5581 * borders) should be drawn when Evas is rendering it.
5583 * @param obj The given image object.
5584 * @param fill Fill mode of the center region of @p obj (a value in
5585 * #Evas_Border_Fill_Mode).
5587 * This function sets how the center part of the image object's source
5588 * image is to be drawn, which must be one of the values in
5589 * #Evas_Border_Fill_Mode. By center we mean the complementary part of
5590 * that defined by evas_object_image_border_set(). This one is very
5591 * useful for making frames and decorations. You would most probably
5592 * also be using a filled image (as in evas_object_image_filled_set())
5593 * to use as a frame.
5595 * @see evas_object_image_border_center_fill_get()
5597 EAPI void evas_object_image_border_center_fill_set (Evas_Object *obj, Evas_Border_Fill_Mode fill) EINA_ARG_NONNULL(1);
5600 * Retrieves @b how the center part of the given image object (not the
5601 * borders) is to be drawn when Evas is rendering it.
5603 * @param obj The given image object.
5604 * @return fill Fill mode of the center region of @p obj (a value in
5605 * #Evas_Border_Fill_Mode).
5607 * See @ref evas_object_image_fill_set() for more details.
5609 EAPI Evas_Border_Fill_Mode evas_object_image_border_center_fill_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
5612 * Set whether the image object's fill property should track the
5615 * @param obj The given image object.
5616 * @param setting @c EINA_TRUE, to make the fill property follow
5617 * object size or @c EINA_FALSE, otherwise
5619 * If @p setting is @c EINA_TRUE, then every evas_object_resize() will
5620 * @b automatically trigger a call to evas_object_image_fill_set()
5621 * with the that new size (and @c 0, @c 0 as source image's origin),
5622 * so the bound image will fill the whole object's area.
5624 * @see evas_object_image_filled_add()
5625 * @see evas_object_image_fill_get()
5627 EAPI void evas_object_image_filled_set (Evas_Object *obj, Eina_Bool setting) EINA_ARG_NONNULL(1);
5630 * Retrieve whether the image object's fill property should track the
5633 * @param obj The given image object.
5634 * @return @c EINA_TRUE if it is tracking, @c EINA_FALSE, if not (and
5635 * evas_object_fill_set() must be called manually).
5637 * @see evas_object_image_filled_set() for more information
5639 EAPI Eina_Bool evas_object_image_filled_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
5642 * Sets the scaling factor (multiplier) for the borders of an image
5645 * @param obj The given image object.
5646 * @param scale The scale factor (default is @c 1.0 - i.e. no scaling)
5648 * @see evas_object_image_border_set()
5649 * @see evas_object_image_border_scale_get()
5651 EAPI void evas_object_image_border_scale_set (Evas_Object *obj, double scale);
5654 * Retrieves the scaling factor (multiplier) for the borders of an
5657 * @param obj The given image object.
5658 * @return The scale factor set for its borders
5660 * @see evas_object_image_border_set()
5661 * @see evas_object_image_border_scale_set()
5663 EAPI double evas_object_image_border_scale_get (const Evas_Object *obj);
5666 * Set how to fill an image object's drawing rectangle given the
5667 * (real) image bound to it.
5669 * @param obj The given image object to operate on.
5670 * @param x The x coordinate (from the top left corner of the bound
5671 * image) to start drawing from.
5672 * @param y The y coordinate (from the top left corner of the bound
5673 * image) to start drawing from.
5674 * @param w The width the bound image will be displayed at.
5675 * @param h The height the bound image will be displayed at.
5677 * Note that if @p w or @h are smaller the same dimensions @p obj, the
5678 * displayed image will be @b tiled around the object's area. To have
5679 * only one copy of the bound image drawn, @p x and @p y must be 0 and
5680 * @p w and @p h need to be the exact width and height of the image
5681 * object itself, respectively.
5683 * @warning The default values for the fill parameters are @p x = 0,
5684 * @p y = 0, @p w = 0 and @p h = 0. Thus, if you're not using the
5685 * evas_object_image_filled_add() helper and want your image
5686 * displayed, you'll have to set valid values with this fuction on
5689 * @note evas_object_image_filled_set() is helper function which will
5690 * @b override the values set here automatically, for you, in a given
5693 EAPI void evas_object_image_fill_set (Evas_Object *obj, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h) EINA_ARG_NONNULL(1);
5696 * Retrieve how an image object is to fill its drawing rectangle,
5697 * given the (real) image bound to it.
5699 * @param obj The given image object.
5700 * @param x Location to store the x coordinate (from the top left
5701 * corner of the bound image) to start drawing from.
5702 * @param y Location to store the y coordinate (from the top left
5703 * corner of the bound image) to start drawing from.
5704 * @param w Location to store the width the bound image is to be
5706 * @param h Location to store the height the bound image is to be
5709 * @note Use @c NULL pointers on the fill components you're not
5710 * interested in: they'll be ignored by the function.
5712 * See @ref evas_object_image_fill_set() for more details.
5714 EAPI void evas_object_image_fill_get (const Evas_Object *obj, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h) EINA_ARG_NONNULL(1);
5717 * Sets the tiling mode for the given evas image object's fill.
5718 * @param obj The given evas image object.
5719 * @param spread One of EVAS_TEXTURE_REFLECT, EVAS_TEXTURE_REPEAT,
5720 * EVAS_TEXTURE_RESTRICT, or EVAS_TEXTURE_PAD.
5722 EAPI void evas_object_image_fill_spread_set (Evas_Object *obj, Evas_Fill_Spread spread) EINA_ARG_NONNULL(1);
5725 * Retrieves the spread (tiling mode) for the given image object's
5728 * @param obj The given evas image object.
5729 * @return The current spread mode of the image object.
5731 EAPI Evas_Fill_Spread evas_object_image_fill_spread_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
5734 * Sets the size of the given image object.
5736 * @param obj The given image object.
5737 * @param w The new width of the image.
5738 * @param h The new height of the image.
5740 * This function will scale down or crop the image so that it is
5741 * treated as if it were at the given size. If the size given is
5742 * smaller than the image, it will be cropped. If the size given is
5743 * larger, then the image will be treated as if it were in the upper
5744 * left hand corner of a larger image that is otherwise transparent.
5746 EAPI void evas_object_image_size_set (Evas_Object *obj, int w, int h) EINA_ARG_NONNULL(1);
5749 * Retrieves the size of the given image object.
5751 * @param obj The given image object.
5752 * @param w Location to store the width of the image in, or @c NULL.
5753 * @param h Location to store the height of the image in, or @c NULL.
5755 * See @ref evas_object_image_size_set() for more details.
5757 EAPI void evas_object_image_size_get (const Evas_Object *obj, int *w, int *h) EINA_ARG_NONNULL(1);
5760 * Retrieves the row stride of the given image object.
5762 * @param obj The given image object.
5763 * @return The stride of the image (<b>in bytes</b>).
5765 * The row stride is the number of bytes between the start of a row
5766 * and the start of the next row for image data.
5768 EAPI int evas_object_image_stride_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
5771 * Retrieves a number representing any error that occurred during the
5772 * last loading of the given image object's source image.
5774 * @param obj The given image object.
5775 * @return A value giving the last error that occurred. It should be
5776 * one of the #Evas_Load_Error values. #EVAS_LOAD_ERROR_NONE
5777 * is returned if there was no error.
5779 EAPI Evas_Load_Error evas_object_image_load_error_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
5782 * Sets the raw image data of the given image object.
5784 * @param obj The given image object.
5785 * @param data The raw data, or @c NULL.
5787 * Note that the raw data must be of the same size (see
5788 * evas_object_image_size_set(), which has to be called @b before this
5789 * one) and colorspace (see evas_object_image_colorspace_set()) of the
5790 * image. If data is @c NULL, the current image data will be
5791 * freed. Naturally, if one does not set an image object's data
5792 * manually, it will still have one, allocated by Evas.
5794 * @see evas_object_image_data_get()
5796 EAPI void evas_object_image_data_set (Evas_Object *obj, void *data) EINA_ARG_NONNULL(1);
5799 * Get a pointer to the raw image data of the given image object.
5801 * @param obj The given image object.
5802 * @param for_writing Whether the data being retrieved will be
5803 * modified (@c EINA_TRUE) or not (@c EINA_FALSE).
5804 * @return The raw image data.
5806 * This function returns a pointer to an image object's internal pixel
5807 * buffer, for reading only or read/write. If you request it for
5808 * writing, the image will be marked dirty so that it gets redrawn at
5811 * Each time you call this function on an image object, its data
5812 * buffer will have an internal reference counter
5813 * incremented. Decrement it back by using
5814 * evas_object_image_data_set(). This is specially important for the
5815 * directfb Evas engine.
5817 * This is best suited for when you want to modify an existing image,
5818 * without changing its dimensions.
5820 * @note The contents' formart returned by it depend on the color
5821 * space of the given image object.
5823 * @note You may want to use evas_object_image_data_update_add() to
5824 * inform data changes, if you did any.
5826 * @see evas_object_image_data_set()
5828 EAPI void *evas_object_image_data_get (const Evas_Object *obj, Eina_Bool for_writing) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
5831 * Converts the raw image data of the given image object to the
5832 * specified colorspace.
5834 * Note that this function does not modify the raw image data. If the
5835 * requested colorspace is the same as the image colorspace nothing is
5836 * done and NULL is returned. You should use
5837 * evas_object_image_colorspace_get() to check the current image
5840 * See @ref evas_object_image_colorspace_get.
5842 * @param obj The given image object.
5843 * @param to_cspace The colorspace to which the image raw data will be converted.
5844 * @return data A newly allocated data in the format specified by to_cspace.
5846 EAPI void *evas_object_image_data_convert (Evas_Object *obj, Evas_Colorspace to_cspace) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
5849 * Replaces the raw image data of the given image object.
5851 * @param obj The given image object.
5852 * @param data The raw data to replace.
5854 * This function lets the application replace an image object's
5855 * internal pixel buffer with an user-allocated one. For best results,
5856 * you should generally first call evas_object_image_size_set() with
5857 * the width and height for the new buffer.
5859 * This call is best suited for when you will be using image data with
5860 * different dimensions than the existing image data, if any. If you
5861 * only need to modify the existing image in some fashion, then using
5862 * evas_object_image_data_get() is probably what you are after.
5864 * Note that the caller is responsible for freeing the buffer when
5865 * finished with it, as user-set image data will not be automatically
5866 * freed when the image object is deleted.
5868 * See @ref evas_object_image_data_get() for more details.
5871 EAPI void evas_object_image_data_copy_set (Evas_Object *obj, void *data) EINA_ARG_NONNULL(1);
5874 * Mark a sub-region of the given image object to be redrawn.
5876 * @param obj The given image object.
5877 * @param x X-offset of the region to be updated.
5878 * @param y Y-offset of the region to be updated.
5879 * @param w Width of the region to be updated.
5880 * @param h Height of the region to be updated.
5882 * This function schedules a particular rectangular region of an image
5883 * object to be updated (redrawn) at the next rendering cycle.
5885 EAPI void evas_object_image_data_update_add (Evas_Object *obj, int x, int y, int w, int h) EINA_ARG_NONNULL(1);
5888 * Enable or disable alpha channel usage on the given image object.
5890 * @param obj The given image object.
5891 * @param has_alpha Whether to use alpha channel (@c EINA_TRUE) data
5892 * or not (@c EINA_FALSE).
5894 * This function sets a flag on an image object indicating whether or
5895 * not to use alpha channel data. A value of @c EINA_TRUE makes it use
5896 * alpha channel data, and @c EINA_FALSE makes it ignore that
5897 * data. Note that this has nothing to do with an object's color as
5898 * manipulated by evas_object_color_set().
5900 * @see evas_object_image_alpha_get()
5902 EAPI void evas_object_image_alpha_set (Evas_Object *obj, Eina_Bool has_alpha) EINA_ARG_NONNULL(1);
5905 * Retrieve whether alpha channel data is being used on the given
5908 * @param obj The given image object.
5909 * @return Whether the alpha channel data is being used (@c EINA_TRUE)
5910 * or not (@c EINA_FALSE).
5912 * This function returns @c EINA_TRUE if the image object's alpha
5913 * channel is being used, or @c EINA_FALSE otherwise.
5915 * See @ref evas_object_image_alpha_set() for more details.
5917 EAPI Eina_Bool evas_object_image_alpha_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
5920 * Sets whether to use high-quality image scaling algorithm on the
5921 * given image object.
5923 * @param obj The given image object.
5924 * @param smooth_scale Whether to use smooth scale or not.
5926 * When enabled, a higher quality image scaling algorithm is used when
5927 * scaling images to sizes other than the source image's original
5928 * one. This gives better results but is more computationally
5931 * @note Image objects get created originally with smooth scaling @b
5934 * @see evas_object_image_smooth_scale_get()
5936 EAPI void evas_object_image_smooth_scale_set (Evas_Object *obj, Eina_Bool smooth_scale) EINA_ARG_NONNULL(1);
5939 * Retrieves whether the given image object is using high-quality
5940 * image scaling algorithm.
5942 * @param obj The given image object.
5943 * @return Whether smooth scale is being used.
5945 * See @ref evas_object_image_smooth_scale_set() for more details.
5947 EAPI Eina_Bool evas_object_image_smooth_scale_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
5950 * Preload an image object's image data in the background
5952 * @param obj The given image object.
5953 * @param cancel @c EINA_FALSE will add it the preloading work queue,
5954 * @c EINA_TRUE will remove it (if it was issued before).
5956 * This function requests the preload of the data image in the
5957 * background. The work is queued before being processed (because
5958 * there might be other pending requests of this type).
5960 * Whenever the image data gets loaded, Evas will call
5961 * #EVAS_CALLBACK_IMAGE_PRELOADED registered callbacks on @p obj (what
5962 * may be immediately, if the data was already preloaded before).
5964 * Use @c EINA_TRUE for @p cancel on scenarios where you don't need
5965 * the image data preloaded anymore.
5967 EAPI void evas_object_image_preload (Evas_Object *obj, Eina_Bool cancel) EINA_ARG_NONNULL(1);
5970 * Reload an image object's image data.
5972 * @param obj The given image object pointer.
5974 * This function reloads the image data bound to image object @p obj.
5976 EAPI void evas_object_image_reload (Evas_Object *obj) EINA_ARG_NONNULL(1);
5979 * Save the given image object's contents to an (image) file.
5981 * @param obj The given image object.
5982 * @param file The filename to be used to save the image (extension
5984 * @param key The image key in the file (if an Eet one), or @c NULL,
5986 * @param flags String containing the flags to be used (@c NULL for
5989 * The extension suffix on @p file will determine which <b>saver
5990 * module</b> Evas is to use when saving, thus the final file's
5991 * format. If the file supports multiple data stored in it (Eet ones),
5992 * you can specify the key to be used as the index of the image in it.
5994 * You can specify some flags when saving the image. Currently
5995 * acceptable flags are @c quality and @c compress. Eg.: @c
5996 * "quality=100 compress=9"
5998 EAPI Eina_Bool evas_object_image_save (const Evas_Object *obj, const char *file, const char *key, const char *flags) EINA_ARG_NONNULL(1, 2);
6001 * Import pixels from given source to a given canvas image object.
6003 * @param obj The given canvas object.
6004 * @param pixels The pixel's source to be imported.
6006 * This function imports pixels from a given source to a given canvas image.
6009 EAPI Eina_Bool evas_object_image_pixels_import (Evas_Object *obj, Evas_Pixel_Import_Source *pixels) EINA_ARG_NONNULL(1, 2);
6012 * Set the callback function to get pixels from a canva's image.
6014 * @param obj The given canvas pointer.
6015 * @param func The callback function.
6016 * @param data The data pointer to be passed to @a func.
6018 * This functions sets a function to be the callback function that get
6019 * pixes from a image of the canvas.
6022 EAPI void evas_object_image_pixels_get_callback_set(Evas_Object *obj, Evas_Object_Image_Pixels_Get_Cb func, void *data) EINA_ARG_NONNULL(1, 2);
6025 * Mark whether the given image object is dirty (needs to be redrawn).
6027 * @param obj The given image object.
6028 * @param dirty Whether the image is dirty.
6030 EAPI void evas_object_image_pixels_dirty_set (Evas_Object *obj, Eina_Bool dirty) EINA_ARG_NONNULL(1);
6033 * Retrieves whether the given image object is dirty (needs to be redrawn).
6035 * @param obj The given image object.
6036 * @return Whether the image is dirty.
6038 EAPI Eina_Bool evas_object_image_pixels_dirty_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
6041 * Set the DPI resolution of an image object's source image.
6043 * @param obj The given canvas pointer.
6044 * @param dpi The new DPI resolution.
6046 * This function sets the DPI resolution of a given loaded canvas
6047 * image. Most useful for the SVG image loader.
6049 * @see evas_object_image_load_dpi_get()
6051 EAPI void evas_object_image_load_dpi_set (Evas_Object *obj, double dpi) EINA_ARG_NONNULL(1);
6054 * Get the DPI resolution of a loaded image object in the canvas.
6056 * @param obj The given canvas pointer.
6057 * @return The DPI resolution of the given canvas image.
6059 * This function returns the DPI resolution of the given canvas image.
6061 * @see evas_object_image_load_dpi_set() for more details
6063 EAPI double evas_object_image_load_dpi_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
6066 * Set the size of a given image object's source image, when loading
6069 * @param obj The given canvas object.
6070 * @param w The new width of the image's load size.
6071 * @param h The new height of the image's load size.
6073 * This function sets a new (loading) size for the given canvas
6076 * @see evas_object_image_load_size_get()
6078 EAPI void evas_object_image_load_size_set (Evas_Object *obj, int w, int h) EINA_ARG_NONNULL(1);
6081 * Get the size of a given image object's source image, when loading
6084 * @param obj The given image object.
6085 * @param w Where to store the new width of the image's load size.
6086 * @param h Where to store the new height of the image's load size.
6088 * @note Use @c NULL pointers on the size components you're not
6089 * interested in: they'll be ignored by the function.
6091 * @see evas_object_image_load_size_set() for more details
6093 EAPI void evas_object_image_load_size_get (const Evas_Object *obj, int *w, int *h) EINA_ARG_NONNULL(1);
6096 * Set the scale down factor of a given image object's source image,
6099 * @param obj The given image object pointer.
6100 * @param scale_down The scale down factor.
6102 * This function sets the scale down factor of a given canvas
6103 * image. Most useful for the SVG image loader.
6105 * @see evas_object_image_load_scale_down_get()
6107 EAPI void evas_object_image_load_scale_down_set (Evas_Object *obj, int scale_down) EINA_ARG_NONNULL(1);
6110 * get the scale down factor of a given image object's source image,
6113 * @param obj The given image object pointer.
6115 * @see evas_object_image_load_scale_down_set() for more details
6117 EAPI int evas_object_image_load_scale_down_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
6120 * Inform a given image object to load a selective region of its
6123 * @param obj The given image object pointer.
6124 * @param x X-offset of the region to be loaded.
6125 * @param y Y-offset of the region to be loaded.
6126 * @param w Width of the region to be loaded.
6127 * @param h Height of the region to be loaded.
6129 * This function is useful when one is not showing all of an image's
6130 * area on its image object.
6132 * @note The image loader for the image format in question has to
6133 * support selective region loading in order to this function to take
6136 * @see evas_object_image_load_region_get()
6138 EAPI void evas_object_image_load_region_set (Evas_Object *obj, int x, int y, int w, int h) EINA_ARG_NONNULL(1);
6141 * Retrieve the coordinates of a given image object's selective
6142 * (source image) load region.
6144 * @param obj The given image object pointer.
6145 * @param x Where to store the X-offset of the region to be loaded.
6146 * @param y Where to store the Y-offset of the region to be loaded.
6147 * @param w Where to store the width of the region to be loaded.
6148 * @param h Where to store the height of the region to be loaded.
6150 * @note Use @c NULL pointers on the coordinates you're not interested
6151 * in: they'll be ignored by the function.
6153 * @see evas_object_image_load_region_get()
6155 EAPI void evas_object_image_load_region_get (const Evas_Object *obj, int *x, int *y, int *w, int *h) EINA_ARG_NONNULL(1);
6158 * Define if the orientation information in the image file should be honored.
6160 * @param obj The given image object pointer.
6161 * @param enable @p EINA_TRUE means that it should honor the orientation information
6164 EAPI void evas_object_image_load_orientation_set (Evas_Object *obj, Eina_Bool enable) EINA_ARG_NONNULL(1);
6167 * Get if the orientation information in the image file should be honored.
6169 * @param obj The given image object pointer.
6172 EAPI Eina_Bool evas_object_image_load_orientation_get (const Evas_Object *obj) EINA_ARG_NONNULL(1);
6175 * Set the colorspace of a given image of the canvas.
6177 * @param obj The given image object pointer.
6178 * @param cspace The new color space.
6180 * This function sets the colorspace of given canvas image.
6183 EAPI void evas_object_image_colorspace_set (Evas_Object *obj, Evas_Colorspace cspace) EINA_ARG_NONNULL(1);
6186 * Get the colorspace of a given image of the canvas.
6188 * @param obj The given image object pointer.
6189 * @return The colorspace of the image.
6191 * This function returns the colorspace of given canvas image.
6194 EAPI Evas_Colorspace evas_object_image_colorspace_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
6197 * Set the native surface of a given image of the canvas
6199 * @param obj The given canvas pointer.
6200 * @param surf The new native surface.
6202 * This function sets a native surface of a given canvas image.
6205 EAPI void evas_object_image_native_surface_set (Evas_Object *obj, Evas_Native_Surface *surf) EINA_ARG_NONNULL(1, 2);
6208 * Get the native surface of a given image of the canvas
6210 * @param obj The given canvas pointer.
6211 * @return The native surface of the given canvas image.
6213 * This function returns the native surface of a given canvas image.
6216 EAPI Evas_Native_Surface *evas_object_image_native_surface_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
6219 * Set the scale hint of a given image of the canvas.
6221 * @param obj The given canvas pointer.
6222 * @param hint The scale hint value.
6224 * This function sets the scale hint value of the given image of the
6225 * canvas, which will affect how Evas is to scale it.
6227 * @see evas_object_image_scale_hint_get()
6229 EAPI void evas_object_image_scale_hint_set (Evas_Object *obj, Evas_Image_Scale_Hint hint) EINA_ARG_NONNULL(1);
6232 * Get the scale hint of a given image of the canvas.
6234 * @param obj The given canvas pointer.
6236 * This function returns the scale hint value of the given image of
6239 * @see evas_object_image_scale_hint_set()
6241 EAPI Evas_Image_Scale_Hint evas_object_image_scale_hint_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
6244 * Set the content hint setting of a given image object of the canvas.
6246 * @param obj The given canvas pointer.
6247 * @param hint The content hint value, one of the
6248 * #Evas_Image_Content_Hint ones.
6250 * This function sets the content hint value of the given image of the
6251 * canvas. For example, if you're on the GL engine and your driver
6252 * implementation supports it, setting this hint to
6253 * #EVAS_IMAGE_CONTENT_HINT_DYNAMIC will make it need @b zero copies
6254 * at texture upload time, which is an "expensive" operation.
6256 * @see evas_object_image_content_hint_get()
6258 EAPI void evas_object_image_content_hint_set (Evas_Object *obj, Evas_Image_Content_Hint hint) EINA_ARG_NONNULL(1);
6261 * Get the content hint setting of a given image object of the canvas.
6263 * @param obj The given canvas pointer.
6264 * @return hint The content hint value set on it, one of the
6265 * #Evas_Image_Content_Hint ones (#EVAS_IMAGE_CONTENT_HINT_NONE means
6268 * This function returns the content hint value of the given image of
6271 * @see evas_object_image_content_hint_set()
6273 EAPI Evas_Image_Content_Hint evas_object_image_content_hint_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
6277 * Enable an image to be used as an alpha mask.
6279 * This will set any flags, and discard any excess image data not used as an
6282 * Note there is little point in using a image as alpha mask unless it has an
6285 * @param obj Object to use as an alpha mask.
6286 * @param ismask Use image as alphamask, must be true.
6288 EAPI void evas_object_image_alpha_mask_set (Evas_Object *obj, Eina_Bool ismask) EINA_ARG_NONNULL(1);
6291 * Set the source object on an image object to used as a @b proxy.
6293 * @param obj Proxy (image) object.
6294 * @param src Source object to use for the proxy.
6295 * @return @c EINA_TRUE on success, @c EINA_FALSE on error.
6297 * If an image object is set to behave as a @b proxy, it will mirror
6298 * the rendering contents of a given @b source object in its drawing
6299 * region, without affecting that source in any way. The source must
6300 * be another valid Evas object. Other effects may be applied to the
6301 * proxy, such as a map (see evas_object_map_set()) to create a
6302 * reflection of the original object (for example).
6304 * Any existing source object on @p obj will be removed after this
6305 * call. Setting @p src to @c NULL clears the proxy object (not in
6306 * "proxy state" anymore).
6308 * @warning You cannot set a proxy as another proxy's source.
6310 * @see evas_object_image_source_get()
6311 * @see evas_object_image_source_unset()
6313 EAPI Eina_Bool evas_object_image_source_set (Evas_Object *obj, Evas_Object *src) EINA_ARG_NONNULL(1);
6316 * Get the current source object of an image object.
6318 * @param obj Image object
6319 * @return Source object (if any), or @c NULL, if not in "proxy mode"
6322 * @see evas_object_image_source_set() for more details
6324 EAPI Evas_Object *evas_object_image_source_get (Evas_Object *obj) EINA_ARG_NONNULL(1);
6327 * Clear the source object on a proxy image object.
6329 * @param obj Image object to clear source of.
6330 * @return @c EINA_TRUE on success, @c EINA_FALSE on error.
6332 * This is equivalent to calling evas_object_image_source_set() with a
6335 EAPI Eina_Bool evas_object_image_source_unset (Evas_Object *obj) EINA_ARG_NONNULL(1);
6338 * Check if a file extention may be supported by @ref Evas_Object_Image.
6340 * @param file The file to check
6341 * @return EINA_TRUE if we may be able to opeen it, EINA_FALSE if it's unlikely.
6344 * If file is a Eina_Stringshare, use directly @ref evas_object_image_extension_can_load_fast_get.
6346 * This functions is threadsafe.
6348 EAPI Eina_Bool evas_object_image_extension_can_load_get(const char *file);
6351 * Check if a file extention may be supported by @ref Evas_Object_Image.
6353 * @param file The file to check, it should be an Eina_Stringshare.
6354 * @return EINA_TRUE if we may be able to opeen it, EINA_FALSE if it's unlikely.
6357 * This functions is threadsafe.
6359 EAPI Eina_Bool evas_object_image_extension_can_load_fast_get(const char *file);
6366 * @defgroup Evas_Object_Text Text Object Functions
6368 * Functions that operate on single line, single style text objects.
6370 * For multiline and multiple style text, see @ref Evas_Object_Textblock.
6372 * @ingroup Evas_Object_Specific
6376 * @addtogroup Evas_Object_Text
6380 /* basic styles (4 bits allocated use 0->10 now, 5 left) */
6381 #define EVAS_TEXT_STYLE_MASK_BASIC 0xf
6384 * Text style type creation macro. Use style types on the 's'
6385 * arguments, being 'x' your style variable.
6387 #define EVAS_TEXT_STYLE_BASIC_SET(x, s) \
6388 do { x = ((x) & ~EVAS_TEXT_STYLE_MASK_BASIC) | (s); } while (0)
6390 #define EVAS_TEXT_STYLE_MASK_SHADOW_DIRECTION (0x7 << 4)
6393 * Text style type creation macro. This one will impose shadow
6394 * directions on the style type variable -- use the @c
6395 * EVAS_TEXT_STYLE_SHADOW_DIRECTION_* values on 's', incremmentally.
6397 #define EVAS_TEXT_STYLE_SHADOW_DIRECTION_SET(x, s) \
6398 do { x = ((x) & ~EVAS_TEXT_STYLE_MASK_SHADOW_DIRECTION) | (s); } while (0)
6400 typedef enum _Evas_Text_Style_Type
6402 EVAS_TEXT_STYLE_PLAIN, /**< plain, standard text */
6403 EVAS_TEXT_STYLE_SHADOW, /**< text with shadow underneath */
6404 EVAS_TEXT_STYLE_OUTLINE, /**< text with an outline */
6405 EVAS_TEXT_STYLE_SOFT_OUTLINE, /**< text with a soft outline */
6406 EVAS_TEXT_STYLE_GLOW, /**< text with a glow effect */
6407 EVAS_TEXT_STYLE_OUTLINE_SHADOW, /**< text with both outline and shadow effects */
6408 EVAS_TEXT_STYLE_FAR_SHADOW, /**< text with (far) shadow underneath */
6409 EVAS_TEXT_STYLE_OUTLINE_SOFT_SHADOW, /**< text with outline and soft shadow effects combined */
6410 EVAS_TEXT_STYLE_SOFT_SHADOW, /**< text with (soft) shadow underneath */
6411 EVAS_TEXT_STYLE_FAR_SOFT_SHADOW, /**< text with (far soft) shadow underneath */
6413 /* OR these to modify shadow direction (3 bits needed) */
6414 EVAS_TEXT_STYLE_SHADOW_DIRECTION_BOTTOM_RIGHT = (0x0 << 4), /**< shadow growing to bottom right */
6415 EVAS_TEXT_STYLE_SHADOW_DIRECTION_BOTTOM = (0x1 << 4), /**< shadow growing to the bottom */
6416 EVAS_TEXT_STYLE_SHADOW_DIRECTION_BOTTOM_LEFT = (0x2 << 4), /**< shadow growing to bottom left */
6417 EVAS_TEXT_STYLE_SHADOW_DIRECTION_LEFT = (0x3 << 4), /**< shadow growing to the left */
6418 EVAS_TEXT_STYLE_SHADOW_DIRECTION_TOP_LEFT = (0x4 << 4), /**< shadow growing to top left */
6419 EVAS_TEXT_STYLE_SHADOW_DIRECTION_TOP = (0x5 << 4), /**< shadow growing to the top */
6420 EVAS_TEXT_STYLE_SHADOW_DIRECTION_TOP_RIGHT = (0x6 << 4), /**< shadow growing to top right */
6421 EVAS_TEXT_STYLE_SHADOW_DIRECTION_RIGHT = (0x7 << 4) /**< shadow growing to the right */
6422 } Evas_Text_Style_Type; /**< Types of styles to be applied on text objects. The @c EVAS_TEXT_STYLE_SHADOW_DIRECTION_* ones are to be ORed together with others imposing shadow, to change shadow's direction */
6425 * Creates a new text object on the provided canvas.
6427 * @param e The canvas to create the text object on.
6428 * @return @c NULL on error, a pointer to a new text object on
6431 * Text objects are for simple, single line text elements. If you want
6432 * more elaborated text blocks, see @ref Evas_Object_Textblock.
6434 * @see evas_object_text_font_source_set()
6435 * @see evas_object_text_font_set()
6436 * @see evas_object_text_text_set()
6438 EAPI Evas_Object *evas_object_text_add (Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
6441 * Set the font (source) file to be used on a given text object.
6443 * @param obj The text object to set font for.
6444 * @param font The font file's path.
6446 * This function allows the font file to be explicitly set for a given
6447 * text object, overriding system lookup, which will first occur in
6448 * the given file's contents.
6450 * @see evas_object_text_font_get()
6452 EAPI void evas_object_text_font_source_set (Evas_Object *obj, const char *font) EINA_ARG_NONNULL(1);
6455 * Get the font file's path which is being used on a given text
6458 * @param obj The text object to set font for.
6459 * @param font The font file's path.
6461 * @see evas_object_text_font_get() for more details
6463 EAPI const char *evas_object_text_font_source_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
6466 * Set the font family and size on a given text object.
6468 * @param obj The text object to set font for.
6469 * @param font The font (family) name.
6470 * @param size The font size, in points.
6472 * This function allows the font name and size of a text object to be
6473 * set. The @p font string has to follow fontconfig's convention on
6474 * naming fonts, as it's the underlying lybrary used to query system
6475 * fonts by Evas (see the @c fc-list command's output, on your system,
6478 * @see evas_object_text_font_get()
6479 * @see evas_object_text_font_source_set()
6481 EAPI void evas_object_text_font_set (Evas_Object *obj, const char *font, Evas_Font_Size size) EINA_ARG_NONNULL(1);
6484 * Retrieve the font family and size in use on a given text object.
6486 * @param obj The evas text object to query for font information.
6487 * @param font A pointer to the location to store the font name in.
6488 * @param size A pointer to the location to store the font size in.
6490 * This function allows the font name and size of a text object to be
6491 * queried. Be aware that the font name string is still owned by Evas
6492 * and should @b not have free() called on it by the caller of the
6495 * @see evas_object_text_font_set()
6497 EAPI void evas_object_text_font_get (const Evas_Object *obj, const char **font, Evas_Font_Size *size) EINA_ARG_NONNULL(1, 2);
6500 * Sets the text string to be displayed by the given text object.
6502 * @param obj The text object to set text string on.
6503 * @param text Text string to display on it.
6505 * @see evas_object_text_text_get()
6507 EAPI void evas_object_text_text_set (Evas_Object *obj, const char *text) EINA_ARG_NONNULL(1);
6510 * Retrieves the text string currently being displayed by the given
6513 * @param obj The given text object.
6514 * @return The text string currently being displayed on it.
6516 * @note Do not free() the return value.
6518 * @see evas_object_text_text_set()
6520 EAPI const char *evas_object_text_text_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
6523 * @brief Sets the BiDi delimiters used in the textblock.
6525 * BiDi delimiters are use for in-paragraph separation of bidi segments. This
6526 * is useful for example in recipients fields of e-mail clients where bidi
6527 * oddities can occur when mixing rtl and ltr.
6529 * @param obj The given text object.
6530 * @param delim A null terminated string of delimiters, e.g ",|".
6533 EAPI void evas_object_text_bidi_delimiters_set(Evas_Object *obj, const char *delim);
6536 * @brief Gets the BiDi delimiters used in the textblock.
6538 * BiDi delimiters are use for in-paragraph separation of bidi segments. This
6539 * is useful for example in recipients fields of e-mail clients where bidi
6540 * oddities can occur when mixing rtl and ltr.
6542 * @param obj The given text object.
6543 * @return A null terminated string of delimiters, e.g ",|". If empty, returns NULL.
6546 EAPI const char *evas_object_text_bidi_delimiters_get(const Evas_Object *obj);
6548 EAPI Evas_Coord evas_object_text_ascent_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
6549 EAPI Evas_Coord evas_object_text_descent_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
6550 EAPI Evas_Coord evas_object_text_max_ascent_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
6551 EAPI Evas_Coord evas_object_text_max_descent_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
6552 EAPI Evas_Coord evas_object_text_horiz_advance_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
6553 EAPI Evas_Coord evas_object_text_vert_advance_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
6554 EAPI Evas_Coord evas_object_text_inset_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
6557 * Retrieve position and dimension information of a character within a text @c Evas_Object.
6559 * This function is used to obtain the X, Y, width and height of a the character
6560 * located at @p pos within the @c Evas_Object @p obj. @p obj must be a text object
6561 * as created with evas_object_text_add(). Any of the @c Evas_Coord parameters (@p cx,
6562 * @p cy, @p cw, @p ch) may be NULL in which case no value will be assigned to that
6565 * @param obj The text object to retrieve position information for.
6566 * @param pos The character position to request co-ordinates for.
6567 * @param cx A pointer to an @c Evas_Coord to store the X value in (can be NULL).
6568 * @param cy A pointer to an @c Evas_Coord to store the Y value in (can be NULL).
6569 * @param cw A pointer to an @c Evas_Coord to store the Width value in (can be NULL).
6570 * @param ch A pointer to an @c Evas_Coord to store the Height value in (can be NULL).
6572 * @returns EINA_FALSE on error, EINA_TRUE on success.
6574 EAPI Eina_Bool evas_object_text_char_pos_get (const Evas_Object *obj, int pos, Evas_Coord *cx, Evas_Coord *cy, Evas_Coord *cw, Evas_Coord *ch) EINA_ARG_NONNULL(1);
6575 EAPI int evas_object_text_char_coords_get (const Evas_Object *obj, Evas_Coord x, Evas_Coord y, Evas_Coord *cx, Evas_Coord *cy, Evas_Coord *cw, Evas_Coord *ch) EINA_ARG_NONNULL(1);
6578 * Returns the logical position of the last char in the text
6579 * up to the pos given. this is NOT the position of the last char
6580 * because of the possibility of RTL in the text.
6582 EAPI int evas_object_text_last_up_to_pos (const Evas_Object *obj, Evas_Coord x, Evas_Coord y) EINA_ARG_NONNULL(1);
6585 * Retrieves the style on use on the given text object.
6587 * @param obj the given text object to set style on.
6588 * @return the style type in use.
6590 * @see evas_object_text_style_set() for more details.
6592 EAPI Evas_Text_Style_Type evas_object_text_style_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
6595 * Sets the style to apply on the given text object.
6597 * @param obj the given text object to set style on.
6598 * @param type a style type.
6600 * Text object styles are one of the values in
6601 * #Evas_Text_Style_Type. Some of those values are combinations of
6602 * more than one style, and some account for the direction of the
6603 * rendering of shadow effects.
6605 * @note One may use the helper macros #EVAS_TEXT_STYLE_BASIC_SET and
6606 * #EVAS_TEXT_STYLE_SHADOW_DIRECTION_SET to assemble a style value.
6608 * @see evas_object_text_style_get()
6609 * @see evas_object_text_shadow_color_set()
6610 * @see evas_object_text_outline_color_set()
6611 * @see evas_object_text_glow_color_set()
6612 * @see evas_object_text_glow2_color_set()
6614 EAPI void evas_object_text_style_set (Evas_Object *obj, Evas_Text_Style_Type type) EINA_ARG_NONNULL(1);
6617 * Sets the shadow color for the given text object.
6619 * @param obj The given Evas text object.
6620 * @param r The red component of the given color.
6621 * @param g The green component of the given color.
6622 * @param b The blue component of the given color.
6623 * @param a The alpha component of the given color.
6625 * Shadow effects, which are fading colors decorating the text
6626 * underneath it, will just be shown if the object is set to one of
6627 * the following styles:
6629 * - #EVAS_TEXT_STYLE_SHADOW
6630 * - #EVAS_TEXT_STYLE_OUTLINE_SHADOW
6631 * - #EVAS_TEXT_STYLE_FAR_SHADOW
6632 * - #EVAS_TEXT_STYLE_OUTLINE_SOFT_SHADOW
6633 * - #EVAS_TEXT_STYLE_SOFT_SHADOW
6634 * - #EVAS_TEXT_STYLE_FAR_SOFT_SHADOW
6636 * One can also change de direction the shadow grows to, with
6637 * evas_object_text_style_set().
6639 * @see evas_object_text_shadow_color_get()
6641 EAPI void evas_object_text_shadow_color_set (Evas_Object *obj, int r, int g, int b, int a) EINA_ARG_NONNULL(1);
6644 * Retrieves the shadow color for the given text object.
6646 * @param obj The given Evas text object.
6647 * @param r Pointer to variable to hold the red component of the given
6649 * @param g Pointer to variable to hold the green component of the
6651 * @param b Pointer to variable to hold the blue component of the
6653 * @param a Pointer to variable to hold the alpha component of the
6656 * @note Use @c NULL pointers on the color components you're not
6657 * interested in: they'll be ignored by the function.
6659 * @see evas_object_text_shadow_color_set() for more details.
6661 EAPI void evas_object_text_shadow_color_get (const Evas_Object *obj, int *r, int *g, int *b, int *a) EINA_ARG_NONNULL(1);
6664 * Sets the glow color for the given text object.
6666 * @param obj The given Evas text object.
6667 * @param r The red component of the given color.
6668 * @param g The green component of the given color.
6669 * @param b The blue component of the given color.
6670 * @param a The alpha component of the given color.
6672 * Glow effects, which are glowing colors decorating the text's
6673 * surroundings, will just be shown if the object is set to the
6674 * #EVAS_TEXT_STYLE_GLOW style.
6676 * @note Glow effects are placed from a short distance of the text
6677 * itself, but no touching it. For glowing effects right on the
6678 * borders of the glyphs, see 'glow 2' effects
6679 * (evas_object_text_glow2_color_set()).
6681 * @see evas_object_text_glow_color_get()
6683 EAPI void evas_object_text_glow_color_set (Evas_Object *obj, int r, int g, int b, int a) EINA_ARG_NONNULL(1);
6686 * Retrieves the glow color for the given text object.
6688 * @param obj The given Evas text object.
6689 * @param r Pointer to variable to hold the red component of the given
6691 * @param g Pointer to variable to hold the green component of the
6693 * @param b Pointer to variable to hold the blue component of the
6695 * @param a Pointer to variable to hold the alpha component of the
6698 * @note Use @c NULL pointers on the color components you're not
6699 * interested in: they'll be ignored by the function.
6701 * @see evas_object_text_glow_color_set() for more details.
6703 EAPI void evas_object_text_glow_color_get (const Evas_Object *obj, int *r, int *g, int *b, int *a) EINA_ARG_NONNULL(1);
6706 * Sets the 'glow 2' color for the given text object.
6708 * @param obj The given Evas text object.
6709 * @param r The red component of the given color.
6710 * @param g The green component of the given color.
6711 * @param b The blue component of the given color.
6712 * @param a The alpha component of the given color.
6714 * 'Glow 2' effects, which are glowing colors decorating the text's
6715 * (immediate) surroundings, will just be shown if the object is set
6716 * to the #EVAS_TEXT_STYLE_GLOW style. See also
6717 * evas_object_text_glow_color_set().
6719 * @see evas_object_text_glow2_color_get()
6721 EAPI void evas_object_text_glow2_color_set (Evas_Object *obj, int r, int g, int b, int a) EINA_ARG_NONNULL(1);
6724 * Retrieves the 'glow 2' color for the given text object.
6726 * @param obj The given Evas text object.
6727 * @param r Pointer to variable to hold the red component of the given
6729 * @param g Pointer to variable to hold the green component of the
6731 * @param b Pointer to variable to hold the blue component of the
6733 * @param a Pointer to variable to hold the alpha component of the
6736 * @note Use @c NULL pointers on the color components you're not
6737 * interested in: they'll be ignored by the function.
6739 * @see evas_object_text_glow2_color_set() for more details.
6741 EAPI void evas_object_text_glow2_color_get (const Evas_Object *obj, int *r, int *g, int *b, int *a) EINA_ARG_NONNULL(1);
6744 * Sets the outline color for the given text object.
6746 * @param obj The given Evas text object.
6747 * @param r The red component of the given color.
6748 * @param g The green component of the given color.
6749 * @param b The blue component of the given color.
6750 * @param a The alpha component of the given color.
6752 * Outline effects (colored lines around text glyphs) will just be
6753 * shown if the object is set to one of the following styles:
6754 * - #EVAS_TEXT_STYLE_OUTLINE
6755 * - #EVAS_TEXT_STYLE_SOFT_OUTLINE
6756 * - #EVAS_TEXT_STYLE_OUTLINE_SHADOW
6757 * - #EVAS_TEXT_STYLE_OUTLINE_SOFT_SHADOW
6759 * @see evas_object_text_outline_color_get()
6761 EAPI void evas_object_text_outline_color_set(Evas_Object *obj, int r, int g, int b, int a) EINA_ARG_NONNULL(1);
6764 * Retrieves the outline color for the given text object.
6766 * @param obj The given Evas text object.
6767 * @param r Pointer to variable to hold the red component of the given
6769 * @param g Pointer to variable to hold the green component of the
6771 * @param b Pointer to variable to hold the blue component of the
6773 * @param a Pointer to variable to hold the alpha component of the
6776 * @note Use @c NULL pointers on the color components you're not
6777 * interested in: they'll be ignored by the function.
6779 * @see evas_object_text_outline_color_set() for more details.
6781 EAPI void evas_object_text_outline_color_get(const Evas_Object *obj, int *r, int *g, int *b, int *a) EINA_ARG_NONNULL(1);
6784 * Gets the text style pad of a text object.
6786 * @param obj The given text object.
6787 * @param l The left pad (or @c NULL).
6788 * @param r The right pad (or @c NULL).
6789 * @param t The top pad (or @c NULL).
6790 * @param b The bottom pad (or @c NULL).
6793 EAPI void evas_object_text_style_pad_get (const Evas_Object *obj, int *l, int *r, int *t, int *b) EINA_ARG_NONNULL(1);
6796 * Retrieves the direction of the text currently being displayed in the
6798 * @param obj The given evas text object.
6799 * @return the direction of the text
6801 EAPI Evas_BiDi_Direction evas_object_text_direction_get (const Evas_Object *obj) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
6808 * @defgroup Evas_Object_Textblock Textblock Object Functions
6810 * Functions used to create and manipulate textblock objects. Unlike
6811 * @ref Evas_Object_Text, these handle complex text, doing multiple
6812 * styles and multiline text based on HTML-like tags. Of these extra
6813 * features will be heavier on memory and processing cost.
6815 * @todo put here some usage examples
6817 * @ingroup Evas_Object_Specific
6821 * @section Evas_Object_Textblock_Tutorial Textblock Object Tutorial
6823 * This part explains about the textblock object's API and proper usage.
6824 * If you want to develop textblock, you should also refer to @ref Evas_Object_Textblock_Internal.
6825 * The main user of the textblock object is the edje entry object in Edje, so
6826 * that's a good place to learn from, but I think this document is more than
6827 * enough, if it's not, please request for me info and I'll update it.
6829 * @subsection textblock_intro Introduction
6830 * The textblock objects is, as implied, an object that can show big chunks of
6831 * text. Textblock supports many features including: Text formatting, automatic
6832 * and manual text alignment, embedding items (for example icons) and more.
6833 * Textblock has three important parts, the text paragraphs, the format nodes
6836 * @subsection textblock_cursors Textblock Object Cursors
6837 * A textblock Cursor @ref Evas_Textblock_Cursor is data type that represents
6838 * a position in a textblock. Each cursor contains information about the
6839 * paragraph it points to, the position in that paragraph and the object itself.
6840 * Cursors register to textblock objects upon creation, this means that once
6841 * you created a cursor, it belongs to a specific obj and you can't for example
6842 * copy a cursor "into" a cursor of a different object. Registered cursors
6843 * also have the added benefit of updating automatically upon textblock changes,
6844 * this means that if you have a cursor pointing to a specific character, it'll
6845 * still point to it even after you change the whole object completely (as long
6846 * as the char was not deleted), this is not possible without updating, because
6847 * as mentioned, each cursor holds a character position. There are many
6848 * functions that handle cursors, just check out the evas_textblock_cursor*
6849 * functions. For creation and deletion of cursors check out:
6850 * @see evas_object_textblock_cursor_new()
6851 * @see evas_textblock_cursor_free()
6852 * @note Cursors are generally the correct way to handle text in the textblock object, and there are enough functions to do everything you need with them (no need to get big chunks of text and processing them yourself).
6854 * @subsection textblock_paragraphs Textblock Object Paragraphs
6855 * The textblock object is made out of text splitted to paragraphs (delimited
6856 * by the paragraph separation character). Each paragraph has many (or none)
6857 * format nodes associated with it which are responsible for the formatting
6858 * of that paragraph.
6860 * @subsection textblock_format_nodes Textblock Object Format Nodes
6861 * As explained in @ref textblock_paragraphs each one of the format nodes
6862 * is associated with a paragraph.
6863 * There are two types of format nodes, visible and invisible:
6864 * Visible: formats that a cursor can point to, i.e formats that
6865 * occupy space, for example: newlines, tabs, items and etc. Some visible items
6866 * are made of two parts, in this case, only the opening tag is visible.
6867 * A closing tag (i.e a </tag> tag) should NEVER be visible.
6868 * Invisible: formats that don't occupy space, for example: bold and underline.
6869 * Being able to access format nodes is very important for some uses. For
6870 * example, edje uses the "<a>" format to create links in the text (and pop
6871 * popups above them when clicked). For the textblock object a is just a
6872 * formatting instruction (how to color the text), but edje utilizes the access
6873 * to the format nodes to make it do more.
6874 * For more information, take a look at all the evas_textblock_node_format_*
6876 * The translation of "<tag>" tags to actual format is done according to the
6877 * tags defined in the style, see @ref evas_textblock_style_set
6879 * @subsection textblock_special_formats Special Formats
6880 * This section is not yet written. If you want some info about styles/formats
6881 * and how to use them, expedite's textblock_basic test is a great start.
6882 * @todo Write @textblock_special_formats
6884 typedef struct _Evas_Textblock_Style Evas_Textblock_Style;
6885 typedef struct _Evas_Textblock_Cursor Evas_Textblock_Cursor;
6887 * @typedef Evas_Object_Textblock_Node_Format
6890 typedef struct _Evas_Object_Textblock_Node_Format Evas_Object_Textblock_Node_Format;
6891 typedef struct _Evas_Textblock_Rectangle Evas_Textblock_Rectangle;
6893 struct _Evas_Textblock_Rectangle
6895 Evas_Coord x, y, w, h;
6898 typedef enum _Evas_Textblock_Text_Type
6900 EVAS_TEXTBLOCK_TEXT_RAW,
6901 EVAS_TEXTBLOCK_TEXT_PLAIN,
6902 EVAS_TEXTBLOCK_TEXT_MARKUP
6903 } Evas_Textblock_Text_Type;
6905 typedef enum _Evas_Textblock_Cursor_Type
6907 EVAS_TEXTBLOCK_CURSOR_UNDER,
6908 EVAS_TEXTBLOCK_CURSOR_BEFORE
6909 } Evas_Textblock_Cursor_Type;
6913 * Adds a textblock to the given evas.
6914 * @param e The given evas.
6915 * @return The new textblock object.
6917 EAPI Evas_Object *evas_object_textblock_add(Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
6921 * Returns the unescaped version of escape.
6922 * @param escape the string to be escaped
6923 * @return the unescaped version of escape
6925 EAPI const char *evas_textblock_escape_string_get(const char *escape) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
6928 * Returns the escaped version of the string.
6929 * @param string to escape
6930 * @param len_ret the len of the new escape
6931 * @return the escaped string.
6933 EAPI const char *evas_textblock_string_escape_get(const char *string, int *len_ret) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
6936 * Return the unescaped version of the string between start and end.
6938 * @param escape_start the start of the string.
6939 * @param escape_end the end of the string.
6940 * @return the unescaped version of the range
6942 EAPI const char *evas_textblock_escape_string_range_get(const char *escape_start, const char *escape_end) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2) EINA_PURE;
6946 * Creates a new textblock style.
6947 * @return The new textblock style.
6949 EAPI Evas_Textblock_Style *evas_textblock_style_new(void) EINA_WARN_UNUSED_RESULT EINA_MALLOC;
6952 * Destroys a textblock style.
6953 * @param ts The textblock style to free.
6955 EAPI void evas_textblock_style_free(Evas_Textblock_Style *ts) EINA_ARG_NONNULL(1);
6958 * Sets the style ts to the style passed as text by text.
6959 * Expected a string consisting of many (or none) tag='format' pairs.
6961 * @param ts the style to set.
6962 * @param text the text to parse - NOT NULL.
6963 * @return Returns no value.
6965 EAPI void evas_textblock_style_set(Evas_Textblock_Style *ts, const char *text) EINA_ARG_NONNULL(1);
6968 * Return the text of the style ts.
6969 * @param ts the style to get it's text.
6970 * @return the text of the style or null on error.
6972 EAPI const char *evas_textblock_style_get(const Evas_Textblock_Style *ts) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
6976 * Set the objects style to ts.
6977 * @param obj the Evas object to set the style to.
6978 * @param ts the style to set.
6979 * @return Returns no value.
6981 EAPI void evas_object_textblock_style_set(Evas_Object *obj, Evas_Textblock_Style *ts) EINA_ARG_NONNULL(1);
6984 * Return the style of an object.
6985 * @param obj the object to get the style from.
6986 * @return the style of the object.
6988 EAPI const Evas_Textblock_Style *evas_object_textblock_style_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
6991 * @brief Set the "replacement character" to use for the given textblock object.
6993 * @param obj The given textblock object.
6994 * @param ch The charset name.
6996 EAPI void evas_object_textblock_replace_char_set(Evas_Object *obj, const char *ch) EINA_ARG_NONNULL(1);
6999 * @brief Get the "replacement character" for given textblock object. Returns
7000 * NULL if no replacement character is in use.
7002 * @param obj The given textblock object
7003 * @return replacement character or @c NULL
7005 EAPI const char *evas_object_textblock_replace_char_get(Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
7008 * @brief Sets the vertical alignment of text within the textblock object
7011 * Normally alignment is 0.0 (top of object). Values given should be
7012 * between 0.0 and 1.0 (1.0 bottom of object, 0.5 being vertically centered
7015 * @param obj The given textblock object.
7016 * @param align A value between 0.0 and 1.0
7019 EAPI void evas_object_textblock_valign_set(Evas_Object *obj, double align);
7022 * @brief Gets the vertical alignment of a textblock
7024 * @param obj The given textblock object.
7025 * @return The elignment set for the object
7028 EAPI double evas_object_textblock_valign_get(const Evas_Object *obj);
7031 * @brief Sets the BiDi delimiters used in the textblock.
7033 * BiDi delimiters are use for in-paragraph separation of bidi segments. This
7034 * is useful for example in recipients fields of e-mail clients where bidi
7035 * oddities can occur when mixing rtl and ltr.
7037 * @param obj The given textblock object.
7038 * @param delim A null terminated string of delimiters, e.g ",|".
7041 EAPI void evas_object_textblock_bidi_delimiters_set(Evas_Object *obj, const char *delim);
7044 * @brief Gets the BiDi delimiters used in the textblock.
7046 * BiDi delimiters are use for in-paragraph separation of bidi segments. This
7047 * is useful for example in recipients fields of e-mail clients where bidi
7048 * oddities can occur when mixing rtl and ltr.
7050 * @param obj The given textblock object.
7051 * @return A null terminated string of delimiters, e.g ",|". If empty, returns NULL.
7054 EAPI const char *evas_object_textblock_bidi_delimiters_get(const Evas_Object *obj);
7057 * @brief Sets newline mode. When true, newline character will behave
7058 * as a paragraph separator.
7060 * @param obj The given textblock object.
7061 * @param mode EINA_TRUE for PS mode, EINA_FALSE otherwise.
7064 EAPI void evas_object_textblock_newline_mode_set(Evas_Object *obj, Eina_Bool mode) EINA_ARG_NONNULL(1);
7067 * @brief Gets newline mode. When true, newline character behaves
7068 * as a paragraph separator.
7070 * @param obj The given textblock object.
7071 * @return EINA_TRUE if in PS mode, EINA_FALSE otherwise.
7074 EAPI Eina_Bool evas_object_textblock_newline_mode_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
7078 * Sets the tetxblock's text to the markup text.
7080 * @note assumes text does not include the unicode object replacement char (0xFFFC)
7082 * @param obj the textblock object.
7083 * @param text the markup text to use.
7084 * @return Return no value.
7086 EAPI void evas_object_textblock_text_markup_set(Evas_Object *obj, const char *text) EINA_ARG_NONNULL(1);
7089 * Prepends markup to the cursor cur.
7091 * @note assumes text does not include the unicode object replacement char (0xFFFC)
7093 * @param cur the cursor to prepend to.
7094 * @param text the markup text to prepend.
7095 * @return Return no value.
7097 EAPI void evas_object_textblock_text_markup_prepend(Evas_Textblock_Cursor *cur, const char *text) EINA_ARG_NONNULL(1, 2);
7100 * Return the markup of the object.
7102 * @param obj the Evas object.
7103 * @return the markup text of the object.
7105 EAPI const char *evas_object_textblock_text_markup_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
7109 * Return the object's main cursor.
7111 * @param obj the object.
7112 * @return the obj's main cursor.
7114 EAPI const Evas_Textblock_Cursor *evas_object_textblock_cursor_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
7117 * Create a new cursor, associate it to the obj and init it to point
7118 * to the start of the textblock. Association to the object means the cursor
7119 * will be updated when the object will change.
7121 * @note if you need speed and you know what you are doing, it's slightly faster to just allocate the cursor yourself and not associate it. (only people developing the actual object, and not users of the object).
7123 * @param obj the object to associate to.
7124 * @return the new cursor.
7126 EAPI Evas_Textblock_Cursor *evas_object_textblock_cursor_new(Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
7130 * Free the cursor and unassociate it from the object.
7131 * @note do not use it to free unassociated cursors.
7133 * @param cur the cursor to free.
7134 * @return Returns no value.
7136 EAPI void evas_textblock_cursor_free(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
7140 * Sets the cursor to the start of the first text node.
7142 * @param cur the cursor to update.
7143 * @return Returns no value.
7145 EAPI void evas_textblock_cursor_paragraph_first(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
7148 * sets the cursor to the end of the last text node.
7150 * @param cur the cursor to set.
7151 * @return Returns no value.
7153 EAPI void evas_textblock_cursor_paragraph_last(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
7156 * Advances to the start of the next text node
7158 * @param cur the cursor to update
7159 * @return #EINA_TRUE if it managed to advance a paragraph, #EINA_FALSE otherwise.
7161 EAPI Eina_Bool evas_textblock_cursor_paragraph_next(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
7164 * Advances to the end of the previous text node
7166 * @param cur the cursor to update
7167 * @return #EINA_TRUE if it managed to advance a paragraph, #EINA_FALSE otherwise.
7169 EAPI Eina_Bool evas_textblock_cursor_paragraph_prev(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
7174 * @param obj The evas, must not be NULL.
7175 * @param anchor the anchor name to get
7176 * @return Returns the list format node corresponding to the anchor, may be null if there are none.
7178 EAPI const Eina_List *evas_textblock_node_format_list_get(const Evas_Object *obj, const char *anchor) EINA_ARG_NONNULL(1, 2);
7181 * Returns the first format node.
7183 * @param obj The evas, must not be NULL.
7184 * @return Returns the first format node, may be null if there are none.
7186 EAPI const Evas_Object_Textblock_Node_Format *evas_textblock_node_format_first_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
7189 * Returns the last format node.
7191 * @param obj The evas textblock, must not be NULL.
7192 * @return Returns the first format node, may be null if there are none.
7194 EAPI const Evas_Object_Textblock_Node_Format *evas_textblock_node_format_last_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
7197 * Returns the next format node (after n)
7199 * @param n the current format node - not null.
7200 * @return Returns the next format node, may be null.
7202 EAPI const Evas_Object_Textblock_Node_Format *evas_textblock_node_format_next_get(const Evas_Object_Textblock_Node_Format *n) EINA_ARG_NONNULL(1);
7205 * Returns the prev format node (after n)
7207 * @param n the current format node - not null.
7208 * @return Returns the prev format node, may be null.
7210 EAPI const Evas_Object_Textblock_Node_Format *evas_textblock_node_format_prev_get(const Evas_Object_Textblock_Node_Format *n) EINA_ARG_NONNULL(1);
7213 * Remove a format node and it's match. i.e, removes a <tag> </tag> pair.
7214 * Assumes the node is the first part of <tag> i.e, this won't work if
7215 * n is a closing tag.
7217 * @param obj the Evas object of the textblock - not null.
7218 * @param n the current format node - not null.
7220 EAPI void evas_textblock_node_format_remove_pair(Evas_Object *obj, Evas_Object_Textblock_Node_Format *n) EINA_ARG_NONNULL(1, 2);
7223 * Sets the cursor to point to the place where format points to.
7225 * @param cur the cursor to update.
7226 * @param n the format node to update according.
7228 EAPI void evas_textblock_cursor_set_at_format(Evas_Textblock_Cursor *cur, const Evas_Object_Textblock_Node_Format *n) EINA_ARG_NONNULL(1, 2);
7231 * Return the format node at the position pointed by cur.
7233 * @param cur the position to look at.
7234 * @return the format node if found, NULL otherwise.
7235 * @see evas_textblock_cursor_format_is_visible_get()
7237 EAPI const Evas_Object_Textblock_Node_Format *evas_textblock_cursor_format_get(const Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
7240 * Get the text format representation of the format node.
7242 * @param fmt the format node.
7243 * @return the textual format of the format node.
7245 EAPI const char *evas_textblock_node_format_text_get(const Evas_Object_Textblock_Node_Format *cur) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
7248 * Set the cursor to point to the position of fmt.
7250 * @param cur the cursor to update
7251 * @param fmt the format to update according to.
7253 EAPI void evas_textblock_cursor_at_format_set(Evas_Textblock_Cursor *cur, const Evas_Object_Textblock_Node_Format *fmt) EINA_ARG_NONNULL(1, 2);
7256 * Check if the current cursor position is a visible format. This way is more
7257 * efficient than evas_textblock_cursor_format_get() to check for the existence
7258 * of a visible format.
7260 * @param cur the cursor to look at.
7261 * @return #EINA_TRUE if the cursor points to a visible format, #EINA_FALSE otherwise.
7262 * @see evas_textblock_cursor_format_get()
7264 EAPI Eina_Bool evas_textblock_cursor_format_is_visible_get(const Evas_Textblock_Cursor *cur) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
7267 * Advances to the next format node
7269 * @param cur the cursor to be updated.
7270 * @return #EINA_TRUE on success #EINA_FALSE otherwise.
7272 EAPI Eina_Bool evas_textblock_cursor_format_next(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
7275 * Advances to the previous format node.
7277 * @param cur the cursor to update.
7278 * @return #EINA_TRUE on success #EINA_FALSE otherwise.
7280 EAPI Eina_Bool evas_textblock_cursor_format_prev(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
7283 * Returns true if the cursor points to a format.
7285 * @param cur the cursor to check.
7286 * @return Returns #EINA_TRUE if a cursor points to a format #EINA_FALSE otherwise.
7288 EAPI Eina_Bool evas_textblock_cursor_is_format(const Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
7291 * Advances 1 char forward.
7293 * @param cur the cursor to advance.
7294 * @return #EINA_TRUE on success #EINA_FALSE otherwise.
7296 EAPI Eina_Bool evas_textblock_cursor_char_next(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
7299 * Advances 1 char backward.
7301 * @param cur the cursor to advance.
7302 * @return #EINA_TRUE on success #EINA_FALSE otherwise.
7304 EAPI Eina_Bool evas_textblock_cursor_char_prev(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
7307 * Go to the first char in the node the cursor is pointing on.
7309 * @param cur the cursor to update.
7310 * @return Returns no value.
7312 EAPI void evas_textblock_cursor_paragraph_char_first(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
7315 * Go to the last char in a text node.
7317 * @param cur the cursor to update.
7318 * @return Returns no value.
7320 EAPI void evas_textblock_cursor_paragraph_char_last(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
7323 * Go to the start of the current line
7325 * @param cur the cursor to update.
7326 * @return Returns no value.
7328 EAPI void evas_textblock_cursor_line_char_first(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
7331 * Go to the end of the current line.
7333 * @param cur the cursor to update.
7334 * @return Returns no value.
7336 EAPI void evas_textblock_cursor_line_char_last(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
7339 * Return the current cursor pos.
7341 * @param cur the cursor to take the position from.
7342 * @return the position or -1 on error
7344 EAPI int evas_textblock_cursor_pos_get(const Evas_Textblock_Cursor *cur) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
7347 * Set the cursor pos.
7349 * @param cur the cursor to be set.
7350 * @param pos the pos to set.
7352 EAPI void evas_textblock_cursor_pos_set(Evas_Textblock_Cursor *cur, int pos) EINA_ARG_NONNULL(1);
7355 * Go to the start of the line passed
7357 * @param cur cursor to update.
7358 * @param line numer to set.
7359 * @return #EINA_TRUE on success, #EINA_FALSE on error.
7361 EAPI Eina_Bool evas_textblock_cursor_line_set(Evas_Textblock_Cursor *cur, int line) EINA_ARG_NONNULL(1);
7364 * Compare two cursors.
7366 * @param cur1 the first cursor.
7367 * @param cur2 the second cursor.
7368 * @return -1 if cur1 < cur2, 0 if cur1 == cur2 and 1 otherwise.
7370 EAPI int evas_textblock_cursor_compare(const Evas_Textblock_Cursor *cur1, const Evas_Textblock_Cursor *cur2) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2) EINA_PURE;
7373 * Make cur_dest point to the same place as cur. Does not work if they don't
7374 * point to the same object.
7376 * @param cur the source cursor.
7377 * @param cur_dest destination cursor.
7378 * @return Returns no value.
7380 EAPI void evas_textblock_cursor_copy(const Evas_Textblock_Cursor *cur, Evas_Textblock_Cursor *cur_dest) EINA_ARG_NONNULL(1, 2);
7384 * Adds text to the current cursor position and set the cursor to *before*
7385 * the start of the text just added.
7387 * @param cur the cursor to where to add text at.
7388 * @param _text the text to add.
7389 * @return Returns the len of the text added.
7390 * @see evas_textblock_cursor_text_prepend()
7392 EAPI int evas_textblock_cursor_text_append(Evas_Textblock_Cursor *cur, const char *text) EINA_ARG_NONNULL(1, 2);
7395 * Adds text to the current cursor position and set the cursor to *after*
7396 * the start of the text just added.
7398 * @param cur the cursor to where to add text at.
7399 * @param _text the text to add.
7400 * @return Returns the len of the text added.
7401 * @see evas_textblock_cursor_text_append()
7403 EAPI int evas_textblock_cursor_text_prepend(Evas_Textblock_Cursor *cur, const char *text) EINA_ARG_NONNULL(1, 2);
7407 * Adds format to the current cursor position. If the format being added is a
7408 * visible format, add it *before* the cursor position, otherwise, add it after.
7409 * This behavior is because visible formats are like characters and invisible
7410 * should be stacked in a way that the last one is added last.
7412 * This function works with native formats, that means that style defined
7413 * tags like <br> won't work here. For those kind of things use markup prepend.
7415 * @param cur the cursor to where to add format at.
7416 * @param format the format to add.
7417 * @return Returns true if a visible format was added, false otherwise.
7418 * @see evas_textblock_cursor_format_prepend()
7422 * Check if the current cursor position points to the terminating null of the
7423 * last paragraph. (shouldn't be allowed to point to the terminating null of
7424 * any previous paragraph anyway.
7426 * @param cur the cursor to look at.
7427 * @return #EINA_TRUE if the cursor points to the terminating null, #EINA_FALSE otherwise.
7429 EAPI Eina_Bool evas_textblock_cursor_format_append(Evas_Textblock_Cursor *cur, const char *format) EINA_ARG_NONNULL(1, 2);
7432 * Adds format to the current cursor position. If the format being added is a
7433 * visible format, add it *before* the cursor position, otherwise, add it after.
7434 * This behavior is because visible formats are like characters and invisible
7435 * should be stacked in a way that the last one is added last.
7436 * If the format is visible the cursor is advanced after it.
7438 * This function works with native formats, that means that style defined
7439 * tags like <br> won't work here. For those kind of things use markup prepend.
7441 * @param cur the cursor to where to add format at.
7442 * @param format the format to add.
7443 * @return Returns true if a visible format was added, false otherwise.
7444 * @see evas_textblock_cursor_format_prepend()
7446 EAPI Eina_Bool evas_textblock_cursor_format_prepend(Evas_Textblock_Cursor *cur, const char *format) EINA_ARG_NONNULL(1, 2);
7449 * Delete the character at the location of the cursor. If there's a format
7450 * pointing to this position, delete it as well.
7452 * @param cur the cursor pointing to the current location.
7453 * @return Returns no value.
7455 EAPI void evas_textblock_cursor_char_delete(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
7458 * Delete the range between cur1 and cur2.
7460 * @param cur1 one side of the range.
7461 * @param cur2 the second side of the range
7462 * @return Returns no value.
7464 EAPI void evas_textblock_cursor_range_delete(Evas_Textblock_Cursor *cur1, Evas_Textblock_Cursor *cur2) EINA_ARG_NONNULL(1, 2);
7468 * Return the text of the paragraph cur points to - returns the text in markup..
7470 * @param cur the cursor pointing to the paragraph.
7471 * @return the text on success, NULL otherwise.
7473 EAPI const char *evas_textblock_cursor_paragraph_text_get(const Evas_Textblock_Cursor *cur) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
7476 * Return the length of the paragraph, cheaper the eina_unicode_strlen()
7478 * @param cur the position of the paragraph.
7479 * @return the length of the paragraph on success, -1 otehrwise.
7481 EAPI int evas_textblock_cursor_paragraph_text_length_get(const Evas_Textblock_Cursor *cur) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
7484 * Return the text in the range between cur1 and cur2
7486 * FIXME: format is currently unused, you always get markup back.
7488 * @param cur1 one side of the range.
7489 * @param cur2 the other side of the range
7490 * @param format to be documented
7491 * @return the text in the range
7492 * @see elm_entry_markup_to_utf8()
7494 EAPI char *evas_textblock_cursor_range_text_get(const Evas_Textblock_Cursor *cur1, const Evas_Textblock_Cursor *cur2, Evas_Textblock_Text_Type format) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2) EINA_PURE;
7497 * Return the content of the cursor.
7499 * @param cur the cursor
7500 * @return the text in the range
7502 EAPI char *evas_textblock_cursor_content_get(const Evas_Textblock_Cursor *cur) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
7506 * Returns the geometry of the cursor. Depends on the type of cursor requested.
7507 * This should be used instead of char_geometry_get because there are weird
7508 * special cases with BiDi text.
7509 * in '_' cursor mode (i.e a line below the char) it's the same as char_geometry
7510 * get, except for the case of the last char of a line which depends on the
7511 * paragraph direction.
7513 * in '|' cursor mode (i.e a line between two chars) it is very varyable.
7514 * For example consider the following visual string:
7515 * "abcCBA" (ABC are rtl chars), a cursor pointing on A should actually draw
7516 * a '|' between the c and the C.
7518 * @param cur the cursor.
7519 * @param cx the x of the cursor
7520 * @param cy the y of the cursor
7521 * @param cw the width of the cursor
7522 * @param ch the height of the cursor
7523 * @param dir the direction of the cursor, can be NULL.
7524 * @param ctype the type of the cursor.
7525 * @return line number of the char on success, -1 on error.
7527 EAPI int evas_textblock_cursor_geometry_get(const Evas_Textblock_Cursor *cur, Evas_Coord *cx, Evas_Coord *cy, Evas_Coord *cw, Evas_Coord *ch, Evas_BiDi_Direction *dir, Evas_Textblock_Cursor_Type ctype) EINA_ARG_NONNULL(1);
7530 * Returns the geometry of the char at cur.
7532 * @param cur the position of the char.
7533 * @param cx the x of the char.
7534 * @param cy the y of the char.
7535 * @param cw the w of the char.
7536 * @param ch the h of the char.
7537 * @return line number of the char on success, -1 on error.
7539 EAPI int evas_textblock_cursor_char_geometry_get(const Evas_Textblock_Cursor *cur, Evas_Coord *cx, Evas_Coord *cy, Evas_Coord *cw, Evas_Coord *ch) EINA_ARG_NONNULL(1);
7542 * Returns the geometry of the pen at cur.
7544 * @param cur the position of the char.
7545 * @param cpen_x the pen_x of the char.
7546 * @param cy the y of the char.
7547 * @param cadv the adv of the char.
7548 * @param ch the h of the char.
7549 * @return line number of the char on success, -1 on error.
7551 EAPI int evas_textblock_cursor_pen_geometry_get(const Evas_Textblock_Cursor *cur, Evas_Coord *cpen_x, Evas_Coord *cy, Evas_Coord *cadv, Evas_Coord *ch) EINA_ARG_NONNULL(1);
7554 * Returns the geometry of the line at cur.
7556 * @param cur the position of the line.
7557 * @param cx the x of the line.
7558 * @param cy the y of the line.
7559 * @param cw the width of the line.
7560 * @param ch the height of the line.
7561 * @return line number of the line on success, -1 on error.
7563 EAPI int evas_textblock_cursor_line_geometry_get(const Evas_Textblock_Cursor *cur, Evas_Coord *cx, Evas_Coord *cy, Evas_Coord *cw, Evas_Coord *ch) EINA_ARG_NONNULL(1);
7566 * Set the position of the cursor according to the X and Y coordinates.
7568 * @param cur the cursor to set.
7569 * @param x coord to set by.
7570 * @param y coord to set by.
7571 * @return #EINA_TRUE on success, #EINA_FALSE otherwise.
7573 EAPI Eina_Bool evas_textblock_cursor_char_coord_set(Evas_Textblock_Cursor *cur, Evas_Coord x, Evas_Coord y) EINA_ARG_NONNULL(1);
7576 * Set the cursor position according to the y coord.
7578 * @param cur the cur to be set.
7579 * @param y the coord to set by.
7580 * @return the line number found, -1 on error.
7582 EAPI int evas_textblock_cursor_line_coord_set(Evas_Textblock_Cursor *cur, Evas_Coord y) EINA_ARG_NONNULL(1);
7585 * Get the geometry of a range.
7587 * @param cur1 one side of the range.
7588 * @param cur2 other side of the range.
7589 * @return a list of Rectangles representing the geometry of the range.
7591 EAPI Eina_List *evas_textblock_cursor_range_geometry_get(const Evas_Textblock_Cursor *cur1, const Evas_Textblock_Cursor *cur2) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2) EINA_PURE;
7592 EAPI Eina_Bool evas_textblock_cursor_format_item_geometry_get(const Evas_Textblock_Cursor *cur, Evas_Coord *cx, Evas_Coord *cy, Evas_Coord *cw, Evas_Coord *ch) EINA_ARG_NONNULL(1);
7596 * Checks if the cursor points to the end of the line.
7598 * @param cur the cursor to check.
7599 * @return #EINA_TRUE if true, #EINA_FALSE otherwise.
7601 EAPI Eina_Bool evas_textblock_cursor_eol_get(const Evas_Textblock_Cursor *cur) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
7605 * Get the geometry of a line number.
7607 * @param obj the object.
7608 * @param line the line number.
7609 * @param cx x coord of the line.
7610 * @param cy y coord of the line.
7611 * @param cw w coord of the line.
7612 * @param ch h coord of the line.
7613 * @return #EINA_TRUE on success, #EINA_FALSE otherwise.
7615 EAPI Eina_Bool evas_object_textblock_line_number_geometry_get(const Evas_Object *obj, int line, Evas_Coord *cx, Evas_Coord *cy, Evas_Coord *cw, Evas_Coord *ch) EINA_ARG_NONNULL(1);
7618 * Clear the textblock object.
7619 * @note Does *NOT* free the Evas object itself.
7621 * @param obj the object to clear.
7624 EAPI void evas_object_textblock_clear(Evas_Object *obj) EINA_ARG_NONNULL(1);
7627 * Get the formatted width and height. This calculates the actual size after restricting
7628 * the textblock to the current size of the object.
7629 * The main difference between this and @ref evas_object_textblock_size_native_get
7630 * is that the "native" function does not wrapping into account
7631 * it just calculates the real width of the object if it was placed on an
7632 * infinite canvas, while this function gives the size after wrapping
7633 * according to the size restrictions of the object.
7635 * For example for a textblock containing the text: "You shall not pass!"
7636 * with no margins or padding and assuming a monospace font and a size of
7637 * 7x10 char widths (for simplicity) has a native size of 19x1
7638 * and a formatted size of 5x4.
7641 * @param obj the Evas object.
7642 * @param w[out] the width of the object.
7643 * @param h[out] the height of the object
7644 * @return Returns no value.
7645 * @see evas_object_textblock_size_native_get
7647 EAPI void evas_object_textblock_size_formatted_get(const Evas_Object *obj, Evas_Coord *w, Evas_Coord *h) EINA_ARG_NONNULL(1);
7650 * Get the native width and height. This calculates the actual size without taking account
7651 * the current size of the object.
7652 * The main difference between this and @ref evas_object_textblock_size_formatted_get
7653 * is that the "native" function does not take wrapping into account
7654 * it just calculates the real width of the object if it was placed on an
7655 * infinite canvas, while the "formatted" function gives the size after
7656 * wrapping text according to the size restrictions of the object.
7658 * For example for a textblock containing the text: "You shall not pass!"
7659 * with no margins or padding and assuming a monospace font and a size of
7660 * 7x10 char widths (for simplicity) has a native size of 19x1
7661 * and a formatted size of 5x4.
7663 * @param obj the Evas object of the textblock
7664 * @param w[out] the width returned
7665 * @param h[out] the height returned
7666 * @return Returns no value.
7668 EAPI void evas_object_textblock_size_native_get(const Evas_Object *obj, Evas_Coord *w, Evas_Coord *h) EINA_ARG_NONNULL(1);
7669 EAPI void evas_object_textblock_style_insets_get(const Evas_Object *obj, Evas_Coord *l, Evas_Coord *r, Evas_Coord *t, Evas_Coord *b) EINA_ARG_NONNULL(1);
7672 * @defgroup Evas_Line_Group Line Object Functions
7674 * Functions used to deal with evas line objects.
7676 * @ingroup Evas_Object_Specific
7680 * Adds a new evas line object to the given evas.
7681 * @param e The given evas.
7682 * @return The new evas line object.
7684 EAPI Evas_Object *evas_object_line_add (Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
7687 * Sets the coordinates of the end points of the given evas line object.
7688 * @param obj The given evas line object.
7689 * @param x1 The X coordinate of the first point.
7690 * @param y1 The Y coordinate of the first point.
7691 * @param x2 The X coordinate of the second point.
7692 * @param y2 The Y coordinate of the second point.
7694 EAPI void evas_object_line_xy_set (Evas_Object *obj, Evas_Coord x1, Evas_Coord y1, Evas_Coord x2, Evas_Coord y2);
7697 * Retrieves the coordinates of the end points of the given evas line object.
7698 * @param obj The given line object.
7699 * @param x1 Pointer to an integer in which to store the X coordinate of the
7701 * @param y1 Pointer to an integer in which to store the Y coordinate of the
7703 * @param x2 Pointer to an integer in which to store the X coordinate of the
7705 * @param y2 Pointer to an integer in which to store the Y coordinate of the
7708 EAPI void evas_object_line_xy_get (const Evas_Object *obj, Evas_Coord *x1, Evas_Coord *y1, Evas_Coord *x2, Evas_Coord *y2);
7711 * @defgroup Evas_Object_Polygon Polygon Object Functions
7713 * Functions that operate on evas polygon objects.
7715 * Hint: as evas does not provide ellipse, smooth paths or circle, one
7716 * can calculate points and convert these to a polygon.
7718 * @ingroup Evas_Object_Specific
7722 * Adds a new evas polygon object to the given evas.
7723 * @param e The given evas.
7724 * @return A new evas polygon object.
7726 EAPI Evas_Object *evas_object_polygon_add (Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
7729 * Adds the given point to the given evas polygon object.
7730 * @param obj The given evas polygon object.
7731 * @param x The X coordinate of the given point.
7732 * @param y The Y coordinate of the given point.
7733 * @ingroup Evas_Polygon_Group
7735 EAPI void evas_object_polygon_point_add (Evas_Object *obj, Evas_Coord x, Evas_Coord y) EINA_ARG_NONNULL(1);
7738 * Removes all of the points from the given evas polygon object.
7739 * @param obj The given polygon object.
7741 EAPI void evas_object_polygon_points_clear (Evas_Object *obj) EINA_ARG_NONNULL(1);
7744 * @defgroup Evas_Smart_Group Smart Functions
7746 * Functions that deal with Evas_Smart's, creating definition
7747 * (classes) of objects that will have customized behavior for methods
7748 * like evas_object_move(), evas_object_resize(),
7749 * evas_object_clip_set() and others.
7751 * These objects will accept the generic methods defined in @ref
7752 * Evas_Object_Group and the extensions defined in @ref
7753 * Evas_Smart_Object_Group. There are couple of existent smart objects
7754 * in Evas itself, see @ref Evas_Object_Box, @ref Evas_Object_Table
7755 * and @ref Evas_Smart_Object_Clipped.
7759 * @def EVAS_SMART_CLASS_VERSION
7761 * The version you have to put into the version field in the
7762 * #Evas_Smart_Class struct. Used to safeguard from binaries with old
7763 * smart object intefaces running with newer ones.
7765 * @ingroup Evas_Smart_Group
7767 #define EVAS_SMART_CLASS_VERSION 4
7769 * @struct _Evas_Smart_Class
7771 * A smart object's @b base class definition
7773 * @ingroup Evas_Smart_Group
7775 struct _Evas_Smart_Class
7777 const char *name; /**< the name string of the class */
7779 void (*add) (Evas_Object *o); /**< code to be run when adding object to a canvas */
7780 void (*del) (Evas_Object *o); /**< code to be run when removing object to a canvas */
7781 void (*move) (Evas_Object *o, Evas_Coord x, Evas_Coord y); /**< code to be run when moving object on a canvas */
7782 void (*resize) (Evas_Object *o, Evas_Coord w, Evas_Coord h); /**< code to be run when resizing object on a canvas */
7783 void (*show) (Evas_Object *o); /**< code to be run when showing object on a canvas */
7784 void (*hide) (Evas_Object *o); /**< code to be run when hiding object on a canvas */
7785 void (*color_set) (Evas_Object *o, int r, int g, int b, int a); /**< code to be run when setting color of object on a canvas */
7786 void (*clip_set) (Evas_Object *o, Evas_Object *clip); /**< code to be run when setting clipper of object on a canvas */
7787 void (*clip_unset) (Evas_Object *o); /**< code to be run when unsetting clipper of object on a canvas */
7788 void (*calculate) (Evas_Object *o); /**< code to be run when object has rendering updates on a canvas */
7789 void (*member_add) (Evas_Object *o, Evas_Object *child); /**< code to be run when child member is added to object */
7790 void (*member_del) (Evas_Object *o, Evas_Object *child); /**< code to be run when child member is removed from object */
7792 const Evas_Smart_Class *parent; /**< this class inherits from this parent */
7793 const Evas_Smart_Cb_Description *callbacks; /**< callbacks at this level, @c NULL terminated */
7794 void *interfaces; /**< to be used in a future near you */
7799 * @struct _Evas_Smart_Cb_Description
7801 * Describes a callback used by a smart class
7802 * evas_object_smart_callback_call(), particularly useful to explain
7803 * to user and its code (ie: introspection) what the parameter @c
7804 * event_info will contain.
7806 * @ingroup Evas_Smart_Group
7808 struct _Evas_Smart_Cb_Description
7810 const char *name; /**< callback name, ie: "changed" */
7813 * @brief Hint type of @c event_info parameter of Evas_Smart_Cb.
7815 * The type string uses the pattern similar to
7817 * http://dbus.freedesktop.org/doc/dbus-specification.html#message-protocol-signatures
7819 * but extended to optionally include variable names within
7820 * brackets preceding types. Example:
7822 * @li Structure with two integers:
7825 * @li Structure called 'x' with two integers named 'a' and 'b':
7826 * @c "[x]([a]i[b]i)"
7828 * @li Array of integers:
7831 * @li Array called 'x' of struct with two integers:
7834 * @note This type string is used as a hint and is @b not validated
7835 * or enforced anyhow. Implementors should make the best use
7836 * of it to help bindings, documentation and other users of
7837 * introspection features.
7843 * @def EVAS_SMART_CLASS_INIT_NULL
7844 * Initializer to zero a whole Evas_Smart_Class structure.
7846 * @see EVAS_SMART_CLASS_INIT_VERSION
7847 * @see EVAS_SMART_CLASS_INIT_NAME_VERSION
7848 * @see EVAS_SMART_CLASS_INIT_NAME_VERSION_PARENT
7849 * @see EVAS_SMART_CLASS_INIT_NAME_VERSION_PARENT_CALLBACKS
7850 * @ingroup Evas_Smart_Group
7852 #define EVAS_SMART_CLASS_INIT_NULL {NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL}
7855 * @def EVAS_SMART_CLASS_INIT_VERSION
7856 * Initializer to zero a whole Evas_Smart_Class structure and set version.
7858 * Similar to EVAS_SMART_CLASS_INIT_NULL, but will set version field to
7859 * latest EVAS_SMART_CLASS_VERSION.
7861 * @see EVAS_SMART_CLASS_INIT_NULL
7862 * @see EVAS_SMART_CLASS_INIT_NAME_VERSION
7863 * @see EVAS_SMART_CLASS_INIT_NAME_VERSION_PARENT
7864 * @see EVAS_SMART_CLASS_INIT_NAME_VERSION_PARENT_CALLBACKS
7865 * @ingroup Evas_Smart_Group
7867 #define EVAS_SMART_CLASS_INIT_VERSION {NULL, EVAS_SMART_CLASS_VERSION, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL}
7870 * @def EVAS_SMART_CLASS_INIT_NAME_VERSION
7871 * Initializer to zero a whole Evas_Smart_Class structure and set name
7874 * Similar to EVAS_SMART_CLASS_INIT_NULL, but will set version field to
7875 * latest EVAS_SMART_CLASS_VERSION and name to the specified value.
7877 * It will keep a reference to name field as a "const char *", that is,
7878 * name must be available while the structure is used (hint: static or global!)
7879 * and will not be modified.
7881 * @see EVAS_SMART_CLASS_INIT_NULL
7882 * @see EVAS_SMART_CLASS_INIT_VERSION
7883 * @see EVAS_SMART_CLASS_INIT_NAME_VERSION_PARENT
7884 * @see EVAS_SMART_CLASS_INIT_NAME_VERSION_PARENT_CALLBACKS
7885 * @ingroup Evas_Smart_Group
7887 #define EVAS_SMART_CLASS_INIT_NAME_VERSION(name) {name, EVAS_SMART_CLASS_VERSION, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL}
7890 * @def EVAS_SMART_CLASS_INIT_NAME_VERSION_PARENT
7891 * Initializer to zero a whole Evas_Smart_Class structure and set name,
7892 * version and parent class.
7894 * Similar to EVAS_SMART_CLASS_INIT_NULL, but will set version field to
7895 * latest EVAS_SMART_CLASS_VERSION, name to the specified value and
7898 * It will keep a reference to name field as a "const char *", that is,
7899 * name must be available while the structure is used (hint: static or global!)
7900 * and will not be modified. Similarly, parent reference will be kept.
7902 * @see EVAS_SMART_CLASS_INIT_NULL
7903 * @see EVAS_SMART_CLASS_INIT_VERSION
7904 * @see EVAS_SMART_CLASS_INIT_NAME_VERSION
7905 * @see EVAS_SMART_CLASS_INIT_NAME_VERSION_PARENT_CALLBACKS
7906 * @ingroup Evas_Smart_Group
7908 #define EVAS_SMART_CLASS_INIT_NAME_VERSION_PARENT(name, parent) {name, EVAS_SMART_CLASS_VERSION, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, parent, NULL, NULL}
7911 * @def EVAS_SMART_CLASS_INIT_NAME_VERSION_PARENT_CALLBACKS
7912 * Initializer to zero a whole Evas_Smart_Class structure and set name,
7913 * version, parent class and callbacks definition.
7915 * Similar to EVAS_SMART_CLASS_INIT_NULL, but will set version field to
7916 * latest EVAS_SMART_CLASS_VERSION, name to the specified value, parent
7917 * class and callbacks at this level.
7919 * It will keep a reference to name field as a "const char *", that is,
7920 * name must be available while the structure is used (hint: static or global!)
7921 * and will not be modified. Similarly, parent and callbacks reference
7924 * @see EVAS_SMART_CLASS_INIT_NULL
7925 * @see EVAS_SMART_CLASS_INIT_VERSION
7926 * @see EVAS_SMART_CLASS_INIT_NAME_VERSION
7927 * @see EVAS_SMART_CLASS_INIT_NAME_VERSION_PARENT
7928 * @ingroup Evas_Smart_Group
7930 #define EVAS_SMART_CLASS_INIT_NAME_VERSION_PARENT_CALLBACKS(name, parent, callbacks) {name, EVAS_SMART_CLASS_VERSION, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, parent, callbacks, NULL}
7933 * @def EVAS_SMART_SUBCLASS_NEW
7935 * Convenience macro to subclass a given Evas smart class.
7937 * @param smart_name The name used for the smart class. e.g:
7938 * @c "Evas_Object_Box".
7939 * @param prefix Prefix used for all variables and functions defined
7940 * and referenced by this macro.
7941 * @param api_type Type of the structure used as API for the smart
7942 * class. Either #Evas_Smart_Class or something derived from it.
7943 * @param parent_type Type of the parent class API.
7944 * @param parent_func Function that gets the parent class. e.g:
7945 * evas_object_box_smart_class_get().
7946 * @param cb_desc Array of callback descriptions for this smart class.
7948 * This macro saves some typing when writing a smart class derived
7949 * from another one. In order to work, the user @b must provide some
7950 * functions adhering to the following guidelines:
7951 * - @<prefix@>_smart_set_user(): the @b internal @c _smart_set
7952 * function (defined by this macro) will call this one, provided by
7953 * the user, after inheriting everything from the parent, which
7954 * should <b>take care of setting the right member functions for
7955 * the class</b>, both overrides and extensions, if any.
7956 * - If this new class should be subclassable as well, a @b public @c
7957 * _smart_set() function is desirable to fill in the class used as
7958 * parent by the children. It's up to the user to provide this
7959 * interface, which will most likely call @<prefix@>_smart_set() to
7962 * After the macro's usage, the following will be defined for use:
7963 * - @<prefix@>_parent_sc: A pointer to the @b parent smart
7964 * class. When calling parent functions from overloaded ones, use
7965 * this global variable.
7966 * - @<prefix@>_smart_class_new(): this function returns the
7967 * #Evas_Smart needed to create smart objects with this class,
7968 * which should be passed to evas_object_smart_add().
7970 * @ingroup Evas_Smart_Group
7972 #define EVAS_SMART_SUBCLASS_NEW(smart_name, prefix, api_type, parent_type, parent_func, cb_desc) \
7973 static const parent_type * prefix##_parent_sc = NULL; \
7974 static void prefix##_smart_set_user(api_type *api); \
7975 static void prefix##_smart_set(api_type *api) \
7977 Evas_Smart_Class *sc; \
7978 if (!(sc = (Evas_Smart_Class *)api)) \
7980 if (!prefix##_parent_sc) \
7981 prefix##_parent_sc = parent_func(); \
7982 evas_smart_class_inherit(sc, (const Evas_Smart_Class *)prefix##_parent_sc); \
7983 prefix##_smart_set_user(api); \
7985 static Evas_Smart * prefix##_smart_class_new(void) \
7987 static Evas_Smart *smart = NULL; \
7988 static api_type api; \
7991 Evas_Smart_Class *sc = (Evas_Smart_Class *)&api; \
7992 memset(&api, 0, sizeof(api_type)); \
7993 sc->version = EVAS_SMART_CLASS_VERSION; \
7994 sc->name = smart_name; \
7995 sc->callbacks = cb_desc; \
7996 prefix##_smart_set(&api); \
7997 smart = evas_smart_class_new(sc); \
8003 * @def EVAS_SMART_DATA_ALLOC
8005 * Convenience macro to allocate smart data only if needed.
8007 * When writing a subclassable smart object, the @c .add() function
8008 * will need to check if the smart private data was already allocated
8009 * by some child object or not. This macro makes it easier to do it.
8011 * @note This is an idiom used when one calls the parent's @c. add()
8012 * after the specialized code. Naturally, the parent's base smart data
8013 * has to be contemplated as the specialized one's first member, for
8016 * @param o Evas object passed to the @c .add() function
8017 * @param priv_type The type of the data to allocate
8019 * @ingroup Evas_Smart_Group
8021 #define EVAS_SMART_DATA_ALLOC(o, priv_type) \
8023 priv = evas_object_smart_data_get(o); \
8025 priv = (priv_type *)calloc(1, sizeof(priv_type)); \
8026 if (!priv) return; \
8027 evas_object_smart_data_set(o, priv); \
8032 * Free an Evas_Smart
8034 * If this smart was created using evas_smart_class_new(), the associated
8035 * Evas_Smart_Class will not be freed.
8037 * @param s the Evas_Smart to free
8040 EAPI void evas_smart_free (Evas_Smart *s) EINA_ARG_NONNULL(1);
8043 * Creates an Evas_Smart from an Evas_Smart_Class.
8045 * @param sc the smart class definition
8046 * @return an Evas_Smart
8048 EAPI Evas_Smart *evas_smart_class_new (const Evas_Smart_Class *sc) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
8051 * Get the Evas_Smart_Class of an Evas_Smart
8053 * @param s the Evas_Smart
8054 * @return the Evas_Smart_Class
8056 EAPI const Evas_Smart_Class *evas_smart_class_get (const Evas_Smart *s) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
8060 * @brief Get the data pointer set on an Evas_Smart.
8062 * @param s Evas_Smart
8064 * This data pointer is set either as the final parameter to
8065 * evas_smart_new or as the data field in the Evas_Smart_Class passed
8066 * in to evas_smart_class_new
8068 EAPI void *evas_smart_data_get (const Evas_Smart *s) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
8071 * Get the callbacks known by this Evas_Smart.
8073 * This is likely different from Evas_Smart_Class::callbacks as it
8074 * will contain the callbacks of all class hierarchy sorted, while the
8075 * direct smart class member refers only to that specific class and
8076 * should not include parent's.
8078 * If no callbacks are known, this function returns @c NULL.
8080 * The array elements and thus their contents will be reference to
8081 * original values given to evas_smart_new() as
8082 * Evas_Smart_Class::callbacks.
8084 * The array is sorted by name. The last array element is the @c NULL
8085 * pointer and is not counted in @a count. Loop iterations can check
8086 * any of these cases.
8088 * @param s the Evas_Smart.
8089 * @param count returns the number of elements in returned array.
8090 * @return the array with callback descriptions known by this class,
8091 * its size is returned in @a count parameter. It should not
8092 * be modified anyhow. If no callbacks are known, @c NULL is
8093 * returned. The array is sorted by name and elements refer to
8094 * the original value given to evas_smart_new().
8096 * @note objects may provide per-instance callbacks, use
8097 * evas_object_smart_callbacks_descriptions_get() to get those
8099 * @see evas_object_smart_callbacks_descriptions_get()
8101 EAPI const Evas_Smart_Cb_Description **evas_smart_callbacks_descriptions_get(const Evas_Smart *s, unsigned int *count) EINA_ARG_NONNULL(1, 1);
8105 * Find callback description for callback called @a name.
8107 * @param s the Evas_Smart.
8108 * @param name name of desired callback, must @b not be @c NULL. The
8109 * search have a special case for @a name being the same
8110 * pointer as registered with Evas_Smart_Cb_Description, one
8111 * can use it to avoid excessive use of strcmp().
8112 * @return reference to description if found, @c NULL if not found.
8114 EAPI const Evas_Smart_Cb_Description *evas_smart_callback_description_find(const Evas_Smart *s, const char *name) EINA_ARG_NONNULL(1, 2) EINA_PURE;
8118 * Sets one class to inherit from the other.
8120 * Copy all function pointers, set @c parent to @a parent_sc and copy
8121 * everything after sizeof(Evas_Smart_Class) present in @a parent_sc,
8122 * using @a parent_sc_size as reference.
8124 * This is recommended instead of a single memcpy() since it will take
8125 * care to not modify @a sc name, version, callbacks and possible
8128 * @param sc child class.
8129 * @param parent_sc parent class, will provide attributes.
8130 * @param parent_sc_size size of parent_sc structure, child should be at least
8131 * this size. Everything after @c Evas_Smart_Class size is copied
8132 * using regular memcpy().
8134 EAPI Eina_Bool evas_smart_class_inherit_full (Evas_Smart_Class *sc, const Evas_Smart_Class *parent_sc, unsigned int parent_sc_size) EINA_ARG_NONNULL(1, 2);
8137 * Get the number of users of the smart instance
8139 * @param s The Evas_Smart to get the usage count of
8140 * @return The number of uses of the smart instance
8142 * This function tells you how many more uses of the smart instance are in
8143 * existence. This should be used before freeing/clearing any of the
8144 * Evas_Smart_Class that was used to create the smart instance. The smart
8145 * instance will refer to data in the Evas_Smart_Class used to create it and
8146 * thus you cannot remove the original data until all users of it are gone.
8147 * When the usage count goes to 0, you can evas_smart_free() the smart
8148 * instance @p s and remove from memory any of the Evas_Smart_Class that
8149 * was used to create the smart instance, if you desire. Removing it from
8150 * memory without doing this will cause problems (crashes, undefined
8151 * behavior etc. etc.), so either never remove the original
8152 * Evas_Smart_Class data from memory (have it be a constant structure and
8153 * data), or use this API call and be very careful.
8155 EAPI int evas_smart_usage_get(const Evas_Smart *s);
8158 * @def evas_smart_class_inherit
8159 * Easy to use version of evas_smart_class_inherit_full().
8161 * This version will use sizeof(parent_sc), copying everything.
8163 * @param sc child class, will have methods copied from @a parent_sc
8164 * @param parent_sc parent class, will provide contents to be copied.
8165 * @return 1 on success, 0 on failure.
8166 * @ingroup Evas_Smart_Group
8168 #define evas_smart_class_inherit(sc, parent_sc) evas_smart_class_inherit_full(sc, parent_sc, sizeof(*parent_sc))
8171 * @defgroup Evas_Smart_Object_Group Smart Object Functions
8173 * Functions dealing with Evas smart objects (instances).
8175 * Smart objects are groupings of primitive Evas objects that behave
8176 * as a cohesive group. For instance, a file manager icon may be a
8177 * smart object composed of an image object, a text label and two
8178 * rectangles that appear behind the image and text when the icon is
8179 * selected. As a smart object, the normal Evas object API could be
8180 * used on the icon object.
8182 * See some @ref Example_Evas_Smart_Objects "examples" of this group
8185 * @see @ref Evas_Smart_Group for class definitions.
8189 * @addtogroup Evas_Smart_Object_Group
8194 * Instantiates a new smart object described by @p s.
8196 * @param e the canvas on which to add the object
8197 * @param s the #Evas_Smart describing the smart object
8198 * @return a new #Evas_Object handle
8200 * This is the function one should use when defining the public
8201 * function @b adding an instance of the new smart object to a given
8202 * canvas. It will take care of setting all of its internals to work
8203 * as they should, if the user set things properly, as seem on the
8204 * #EVAS_SMART_SUBCLASS_NEW, for example.
8206 * @ingroup Evas_Smart_Object_Group
8208 EAPI Evas_Object *evas_object_smart_add (Evas *e, Evas_Smart *s) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2) EINA_MALLOC;
8211 * Set an Evas object as a member of a smart object.
8213 * @param obj The member object
8214 * @param smart_obj The smart object
8216 * Members will automatically be stacked and layered with the smart object.
8217 * The various stacking function will operate on members relative to the
8218 * other members instead of the entire canvas.
8220 * Non-member objects can not interleave a smart object's members.
8222 * @ingroup Evas_Smart_Object_Group
8224 EAPI void evas_object_smart_member_add (Evas_Object *obj, Evas_Object *smart_obj) EINA_ARG_NONNULL(1, 2);
8227 * Removes a member object from a smart object.
8229 * @param obj the member object
8230 * @ingroup Evas_Smart_Object_Group
8232 * This removes a member object from a smart object. The object will still
8233 * be on the canvas, but no longer associated with whichever smart object
8234 * it was associated with.
8237 EAPI void evas_object_smart_member_del (Evas_Object *obj) EINA_ARG_NONNULL(1);
8240 * Gets the smart parent of an Evas_Object
8241 * @param obj the Evas_Object you want to get the parent
8242 * @return Returns the smart parent of @a obj, or @c NULL if @a obj is not a smart member of another Evas_Object
8243 * @ingroup Evas_Smart_Object_Group
8245 EAPI Evas_Object *evas_object_smart_parent_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
8248 * Checks the Smart type of the object and its parents
8249 * @param obj the Evas_Object to check the type of
8250 * @param type the type to check for
8251 * @return EINA_TRUE if @a obj or any of its parents if of type @a type, EINA_FALSE otherwise
8252 * @ingroup Evas_Smart_Object_Group
8254 EAPI Eina_Bool evas_object_smart_type_check (const Evas_Object *obj, const char *type) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2) EINA_PURE;
8257 * Checks the Smart type of the object and its parents using pointer comparison
8258 * @param obj the Evas_Object to check the type of
8259 * @param type the type to check for. Must be the name pointer in the smart class used to create the object
8260 * @return EINA_TRUE if @a obj or any of its parents if of type @a type, EINA_FALSE otherwise
8261 * @ingroup Evas_Smart_Object_Group
8263 EAPI Eina_Bool evas_object_smart_type_check_ptr (const Evas_Object *obj, const char *type) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2) EINA_PURE;
8266 * Gets the list of the member objects of an Evas_Object
8267 * @param obj the Evas_Object you want to get the list of member objects
8268 * @return Returns the list of the member objects of @a obj.
8269 * The returned list should be freed with eina_list_free() when you no longer need it
8271 EAPI Eina_List *evas_object_smart_members_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
8274 * Get the Evas_Smart from which @p obj was created.
8276 * @param obj a smart object
8277 * @return the Evas_Smart
8278 * @ingroup Evas_Smart_Object_Group
8280 EAPI Evas_Smart *evas_object_smart_smart_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
8283 * Retrieve user data stored on a given smart object.
8285 * @param obj The smart object's handle
8286 * @return A pointer to data stored using
8287 * evas_object_smart_data_set(), or @c NULL, if none has been
8290 * @see evas_object_smart_data_set()
8292 * @ingroup Evas_Smart_Object_Group
8294 EAPI void *evas_object_smart_data_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
8297 * Store a pointer to user data for a given smart object.
8299 * @param obj The smart object's handle
8300 * @param data A pointer to user data
8302 * This data is stored @b independently of the one set by
8303 * evas_object_data_set(), naturally.
8305 * @see evas_object_smart_data_get()
8307 * @ingroup Evas_Smart_Object_Group
8309 EAPI void evas_object_smart_data_set (Evas_Object *obj, void *data) EINA_ARG_NONNULL(1);
8312 * Add a callback for the smart event specified by @p event.
8314 * @param obj a smart object
8315 * @param event the event name
8316 * @param func the callback function
8317 * @param data user data to be passed to the callback function
8318 * @ingroup Evas_Smart_Object_Group
8320 EAPI void evas_object_smart_callback_add (Evas_Object *obj, const char *event, Evas_Smart_Cb func, const void *data) EINA_ARG_NONNULL(1, 2, 3);
8323 * Remove a smart callback
8325 * Removes a callback that was added by evas_object_smart_callback_add()
8327 * @param obj a smart object
8328 * @param event the event name
8329 * @param func the callback function
8330 * @return the data pointer
8331 * @ingroup Evas_Smart_Object_Group
8333 EAPI void *evas_object_smart_callback_del (Evas_Object *obj, const char *event, Evas_Smart_Cb func) EINA_ARG_NONNULL(1, 2, 3);
8336 * Call any smart callbacks on @p obj for @p event.
8338 * @param obj the smart object
8339 * @param event the event name
8340 * @param event_info an event specific struct of info to pass to the callback
8342 * This should be called internally in the smart object when some specific
8343 * event has occurred. The documentation for the smart object should include
8344 * a list of possible events and what type of @p event_info to expect.
8346 * @ingroup Evas_Smart_Object_Group
8348 EAPI void evas_object_smart_callback_call (Evas_Object *obj, const char *event, void *event_info) EINA_ARG_NONNULL(1, 2);
8352 * Set smart object instance callbacks descriptions.
8354 * These descriptions are hints to be used by introspection and are
8355 * not enforced in any way.
8357 * It will not be checked if instance callbacks descriptions have the
8358 * same name as another in class. Both are kept in different arrays
8359 * and users of evas_object_smart_callbacks_descriptions_get() should
8360 * handle this case as they wish.
8362 * @param obj The smart object
8363 * @param descriptions NULL terminated (name != NULL) array with
8364 * descriptions. Array elements will not be modified, but
8365 * reference to them and their contents will be made, so this
8366 * array should be kept alive during object lifetime.
8367 * @return 1 on success, 0 on failure.
8368 * @ingroup Evas_Smart_Object_Group
8370 * @note while instance callbacks descriptions are possible, they are
8371 * not recommended. Use class callbacks descriptions instead as they
8372 * make user's life simpler and will use less memory as descriptions
8373 * and arrays will be shared among all instances.
8375 EAPI Eina_Bool evas_object_smart_callbacks_descriptions_set(Evas_Object *obj, const Evas_Smart_Cb_Description *descriptions) EINA_ARG_NONNULL(1);
8378 * Get the callbacks descriptions known by this smart object.
8380 * This call retrieves processed callbacks descriptions for both
8381 * instance and class. These arrays are sorted by description's name
8382 * and are @c NULL terminated, so both @a class_count and
8383 * @a instance_count can be ignored, the terminator @c NULL is not
8384 * counted in these values.
8386 * @param obj the smart object.
8387 * @param class_descriptions where to store class callbacks
8388 * descriptions array, if any is known. If no descriptions are
8389 * known, @c NULL is returned. This parameter may be @c NULL if
8390 * it is not of interest.
8391 * @param class_count returns how many class callbacks descriptions
8393 * @param instance_descriptions where to store instance callbacks
8394 * descriptions array, if any is known. If no descriptions are
8395 * known, @c NULL is returned. This parameter may be @c NULL if
8396 * it is not of interest.
8397 * @param instance_count returns how many instance callbacks
8398 * descriptions are known.
8400 * @note if just class descriptions are of interest, try
8401 * evas_smart_callbacks_descriptions_get() instead.
8403 * @see evas_smart_callbacks_descriptions_get()
8404 * @ingroup Evas_Smart_Object_Group
8406 EAPI void evas_object_smart_callbacks_descriptions_get(const Evas_Object *obj, const Evas_Smart_Cb_Description ***class_descriptions, unsigned int *class_count, const Evas_Smart_Cb_Description ***instance_descriptions, unsigned int *instance_count) EINA_ARG_NONNULL(1);
8409 * Find callback description for callback called @a name.
8411 * @param obj the smart object.
8412 * @param name name of desired callback, must @b not be @c NULL. The
8413 * search have a special case for @a name being the same
8414 * pointer as registered with Evas_Smart_Cb_Description, one
8415 * can use it to avoid excessive use of strcmp().
8416 * @param class_description pointer to return class description or @c
8417 * NULL if not found. If parameter is @c NULL, no search will
8418 * be done on class descriptions.
8419 * @param instance_description pointer to return instance description
8420 * or @c NULL if not found. If parameter is @c NULL, no search
8421 * will be done on instance descriptions.
8422 * @return reference to description if found, @c NULL if not found.
8424 EAPI void evas_object_smart_callback_description_find(const Evas_Object *obj, const char *name, const Evas_Smart_Cb_Description **class_description, const Evas_Smart_Cb_Description **instance_description) EINA_ARG_NONNULL(1, 2);
8428 * Mark smart object as changed, dirty.
8430 * @param obj The given Evas smart object
8432 * This will flag the given object as needing recalculation,
8433 * forcefully. As an effect, on the next rendering cycle it's @b
8434 * calculate() (see #Evas_Smart_Class) smart function will be called.
8436 * @see evas_object_smart_need_recalculate_set().
8437 * @see evas_object_smart_calculate().
8439 * @ingroup Evas_Smart_Object_Group
8441 EAPI void evas_object_smart_changed (Evas_Object *obj) EINA_ARG_NONNULL(1);
8444 * Set the need_recalculate flag of given smart object.
8446 * If this flag is set then calculate() callback (method) of the given
8447 * smart object will be called, if one is provided, during render phase
8448 * usually evas_render(). After this step, this flag will be automatically
8451 * If no calculate() is provided, this flag will be left unchanged.
8453 * @note just setting this flag will not make scene dirty and evas_render()
8454 * will have no effect. To do that, use evas_object_smart_changed(),
8455 * that will automatically call this function with 1 as parameter.
8457 * @param obj the smart object
8458 * @param value if one want to set or unset the need_recalculate flag.
8460 * @ingroup Evas_Smart_Object_Group
8462 EAPI void evas_object_smart_need_recalculate_set(Evas_Object *obj, Eina_Bool value) EINA_ARG_NONNULL(1);
8465 * Get the current value of need_recalculate flag.
8467 * @note this flag will be unset during the render phase, after calculate()
8468 * is called if one is provided. If no calculate() is provided, then
8469 * the flag will be left unchanged after render phase.
8471 * @param obj the smart object
8472 * @return if flag is set or not.
8474 * @ingroup Evas_Smart_Object_Group
8476 EAPI Eina_Bool evas_object_smart_need_recalculate_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
8479 * Call the @b calculate() smart function immediataly on a given smart
8482 * @param obj the smart object's handle
8484 * This will force immediate calculations (see #Evas_Smart_Class)
8485 * needed for renderization of this object and, besides, unset the
8486 * flag on it telling it needs recalculation for the next rendering
8489 * @ingroup Evas_Smart_Object_Group
8491 EAPI void evas_object_smart_calculate (Evas_Object *obj) EINA_ARG_NONNULL(1);
8494 * Call user provided calculate() and unset need_calculate on all objects.
8496 * @param e The canvas to calculate all objects in
8498 * @ingroup Evas_Smart_Object_Group
8500 EAPI void evas_smart_objects_calculate (Evas *e);
8504 * Moves all children objects relative to given offset.
8506 * @param obj the smart Evas object to use.
8507 * @param dx horizontal offset.
8508 * @param dy vertical offset.
8510 EAPI void evas_object_smart_move_children_relative(Evas_Object *obj, Evas_Coord dx, Evas_Coord dy) EINA_ARG_NONNULL(1);
8517 * @defgroup Evas_Smart_Object_Clipped Clipped Smart Object
8519 * Clipped smart object is a base to construct other smart objects
8520 * based on the concept of having an internal clipper that is applied
8521 * to all children objects. This clipper will control the visibility,
8522 * clipping and color of sibling objects (remember that the clipping
8523 * is recursive, and clipper color modulates the color of its
8524 * clippees). By default, this base will also move children relatively
8525 * to the parent, and delete them when parent is deleted. In other
8526 * words, it is the base for simple object grouping.
8528 * See some @ref Example_Evas_Smart_Objects "examples" of this group
8531 * @see evas_object_smart_clipped_smart_set()
8533 * @ingroup Evas_Smart_Object_Group
8537 * @addtogroup Evas_Smart_Object_Clipped
8542 * Every subclass should provide this at the beginning of their own
8543 * data set with evas_object_smart_data_set().
8545 typedef struct _Evas_Object_Smart_Clipped_Data Evas_Object_Smart_Clipped_Data;
8546 struct _Evas_Object_Smart_Clipped_Data
8548 Evas_Object *clipper;
8554 * Get the clipper object for the given clipped smart object.
8556 * @param obj the clipped smart object to retrieve associated clipper
8558 * @return the clipper object.
8560 * Use this function if you want to change any of this clipper's
8561 * properties, like colors.
8563 * @see evas_object_smart_clipped_smart_add()
8565 EAPI Evas_Object *evas_object_smart_clipped_clipper_get (Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
8568 * Set a given smart class' callbacks so it implements the <b>clipped smart
8569 * object"</b>'s interface.
8571 * @param sc The smart class handle to operate on
8573 * This call will assign all the required methods of the @p sc
8574 * #Evas_Smart_Class instance to the implementations set for clipped
8575 * smart objects. If one wants to "subclass" it, call this function
8576 * and then override desired values. If one wants to call any original
8577 * method, save it somewhere. Example:
8580 * static Evas_Smart_Class parent_sc = EVAS_SMART_CLASS_INIT_NULL;
8582 * static void my_class_smart_add(Evas_Object *o)
8585 * evas_object_color_set(evas_object_smart_clipped_clipper_get(o),
8589 * Evas_Smart_Class *my_class_new(void)
8591 * static Evas_Smart_Class sc = EVAS_SMART_CLASS_INIT_NAME_VERSION("MyClass");
8592 * if (!parent_sc.name)
8594 * evas_object_smart_clipped_smart_set(&sc);
8596 * sc.add = my_class_smart_add;
8602 * Default behavior for each of #Evas_Smart_Class functions on a
8603 * clipped smart object are:
8604 * - @c add: creates a hidden clipper with "infinite" size, to clip
8605 * any incoming members;
8606 * - @c del: delete all children objects;
8607 * - @c move: move all objects relative relatively;
8608 * - @c resize: <b>not defined</b>;
8609 * - @c show: if there are children objects, show clipper;
8610 * - @c hide: hides clipper;
8611 * - @c color_set: set the color of clipper;
8612 * - @c clip_set: set clipper of clipper;
8613 * - @c clip_unset: unset the clipper of clipper;
8615 * @note There are other means of assigning parent smart classes to
8616 * child ones, like the #EVAS_SMART_SUBCLASS_NEW macro or the
8617 * evas_smart_class_inherit_full() function.
8619 EAPI void evas_object_smart_clipped_smart_set (Evas_Smart_Class *sc) EINA_ARG_NONNULL(1);
8622 * Get a pointer to the <b>clipped smart object's</b> class, to use
8623 * for proper inheritance
8625 * @see #Evas_Smart_Object_Clipped for more information on this smart
8628 EAPI const Evas_Smart_Class *evas_object_smart_clipped_class_get (void) EINA_CONST;
8635 * @defgroup Evas_Object_Box Box (Sequence) Smart Object.
8637 * Convenience smart object that packs children as a sequence using
8638 * a layout function specified by user. There are a couple of helper
8639 * layout functions, all of them using children size hints to define
8640 * their size and alignment inside their cell space.
8642 * @see @ref Evas_Object_Group_Size_Hints
8644 * @ingroup Evas_Smart_Object_Group
8647 * @typedef Evas_Object_Box_Api
8648 * Smart Class extension providing extra box requirements.
8649 * @ingroup Evas_Object_Box
8651 typedef struct _Evas_Object_Box_Api Evas_Object_Box_Api;
8653 * @typedef Evas_Object_Box_Data
8654 * Smart instance data providing box requirements.
8655 * @ingroup Evas_Object_Box
8657 typedef struct _Evas_Object_Box_Data Evas_Object_Box_Data;
8659 * @typedef Evas_Object_Box_Option
8660 * The base structure for a box option.
8661 * @ingroup Evas_Object_Box
8663 typedef struct _Evas_Object_Box_Option Evas_Object_Box_Option;
8664 typedef void (*Evas_Object_Box_Layout) (Evas_Object *o, Evas_Object_Box_Data *priv, void *user_data);
8667 * @def EVAS_OBJECT_BOX_API_VERSION
8668 * @ingroup Evas_Object_Box
8670 #define EVAS_OBJECT_BOX_API_VERSION 1
8672 * @struct _Evas_Object_Box_Api
8674 * This structure should be used by any class that wants to inherit
8675 * from box to provide custom behavior not allowed only by providing a
8676 * layout function with evas_object_box_layout_set().
8678 * @extends Evas_Smart_Class
8679 * @ingroup Evas_Object_Box
8681 struct _Evas_Object_Box_Api
8683 Evas_Smart_Class base;
8685 Evas_Object_Box_Option *(*append) (Evas_Object *o, Evas_Object_Box_Data *priv, Evas_Object *child);
8686 Evas_Object_Box_Option *(*prepend) (Evas_Object *o, Evas_Object_Box_Data *priv, Evas_Object *child);
8687 Evas_Object_Box_Option *(*insert_before) (Evas_Object *o, Evas_Object_Box_Data *priv, Evas_Object *child, const Evas_Object *reference);
8688 Evas_Object_Box_Option *(*insert_after) (Evas_Object *o, Evas_Object_Box_Data *priv, Evas_Object *child, const Evas_Object *reference);
8689 Evas_Object_Box_Option *(*insert_at) (Evas_Object *o, Evas_Object_Box_Data *priv, Evas_Object *child, unsigned int pos);
8690 Evas_Object *(*remove) (Evas_Object *o, Evas_Object_Box_Data *priv, Evas_Object *child);
8691 Evas_Object *(*remove_at) (Evas_Object *o, Evas_Object_Box_Data *priv, unsigned int pos);
8692 Eina_Bool (*property_set) (Evas_Object *o, Evas_Object_Box_Option *opt, int property, va_list args);
8693 Eina_Bool (*property_get) (Evas_Object *o, Evas_Object_Box_Option *opt, int property, va_list args);
8694 const char *(*property_name_get)(Evas_Object *o, int property);
8695 int (*property_id_get) (Evas_Object *o, const char *name);
8696 Evas_Object_Box_Option *(*option_new) (Evas_Object *o, Evas_Object_Box_Data *priv, Evas_Object *child);
8697 void (*option_free) (Evas_Object *o, Evas_Object_Box_Data *priv, Evas_Object_Box_Option *opt);
8701 * @def EVAS_OBJECT_BOX_API_INIT
8702 * Initializer for whole Evas_Object_Box_Api structure.
8704 * @param smart_class_init initializer to use for the "base" field
8705 * (Evas_Smart_Class).
8707 * @see EVAS_SMART_CLASS_INIT_NULL
8708 * @see EVAS_SMART_CLASS_INIT_VERSION
8709 * @see EVAS_SMART_CLASS_INIT_NAME_VERSION
8710 * @see EVAS_OBJECT_BOX_API_INIT_NULL
8711 * @see EVAS_OBJECT_BOX_API_INIT_VERSION
8712 * @see EVAS_OBJECT_BOX_API_INIT_NAME_VERSION
8713 * @ingroup Evas_Object_Box
8715 #define EVAS_OBJECT_BOX_API_INIT(smart_class_init) {smart_class_init, EVAS_OBJECT_BOX_API_VERSION, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL}
8718 * @def EVAS_OBJECT_BOX_API_INIT_NULL
8719 * Initializer to zero a whole Evas_Object_Box_Api structure.
8721 * @see EVAS_OBJECT_BOX_API_INIT_VERSION
8722 * @see EVAS_OBJECT_BOX_API_INIT_NAME_VERSION
8723 * @see EVAS_OBJECT_BOX_API_INIT
8724 * @ingroup Evas_Object_Box
8726 #define EVAS_OBJECT_BOX_API_INIT_NULL EVAS_OBJECT_BOX_API_INIT(EVAS_SMART_CLASS_INIT_NULL)
8729 * @def EVAS_OBJECT_BOX_API_INIT_VERSION
8730 * Initializer to zero a whole Evas_Object_Box_Api structure and set version.
8732 * Similar to EVAS_OBJECT_BOX_API_INIT_NULL, but will set version field of
8733 * Evas_Smart_Class (base field) to latest EVAS_SMART_CLASS_VERSION
8735 * @see EVAS_OBJECT_BOX_API_INIT_NULL
8736 * @see EVAS_OBJECT_BOX_API_INIT_NAME_VERSION
8737 * @see EVAS_OBJECT_BOX_API_INIT
8738 * @ingroup Evas_Object_Box
8740 #define EVAS_OBJECT_BOX_API_INIT_VERSION EVAS_OBJECT_BOX_API_INIT(EVAS_SMART_CLASS_INIT_VERSION)
8743 * @def EVAS_OBJECT_BOX_API_INIT_NAME_VERSION
8744 * Initializer to zero a whole Evas_Object_Box_Api structure and set
8747 * Similar to EVAS_OBJECT_BOX_API_INIT_NULL, but will set version field of
8748 * Evas_Smart_Class (base field) to latest EVAS_SMART_CLASS_VERSION and name
8749 * to the specific value.
8751 * It will keep a reference to name field as a "const char *", that is,
8752 * name must be available while the structure is used (hint: static or global!)
8753 * and will not be modified.
8755 * @see EVAS_OBJECT_BOX_API_INIT_NULL
8756 * @see EVAS_OBJECT_BOX_API_INIT_VERSION
8757 * @see EVAS_OBJECT_BOX_API_INIT
8758 * @ingroup Evas_Object_Box
8760 #define EVAS_OBJECT_BOX_API_INIT_NAME_VERSION(name) EVAS_OBJECT_BOX_API_INIT(EVAS_SMART_CLASS_INIT_NAME_VERSION(name))
8763 * @struct _Evas_Object_Box_Data
8765 * This structure augments clipped smart object's instance data,
8766 * providing extra members required by generic box implementation. If
8767 * a subclass inherits from #Evas_Object_Box_Api then it may augment
8768 * #Evas_Object_Box_Data to fit its own needs.
8770 * @extends Evas_Object_Smart_Clipped_Data
8771 * @ingroup Evas_Object_Box
8773 struct _Evas_Object_Box_Data
8775 Evas_Object_Smart_Clipped_Data base;
8776 const Evas_Object_Box_Api *api;
8783 Eina_List *children;
8785 Evas_Object_Box_Layout cb;
8787 void (*free_data)(void *data);
8789 Eina_Bool layouting : 1;
8790 Eina_Bool children_changed : 1;
8793 struct _Evas_Object_Box_Option
8796 Eina_Bool max_reached:1;
8797 Eina_Bool min_reached:1;
8798 Evas_Coord alloc_size;
8803 * Set the default box @a api struct (Evas_Object_Box_Api)
8804 * with the default values. May be used to extend that API.
8806 EAPI void evas_object_box_smart_set (Evas_Object_Box_Api *api) EINA_ARG_NONNULL(1);
8809 * Get Box Smart Class for inheritance purposes
8811 EAPI const Evas_Object_Box_Api *evas_object_box_smart_class_get (void) EINA_CONST;
8814 * Set a 'calculate' callback (@a cb) to the @a o box's smart class,
8815 * which here defines its genre (horizontal, vertical, homogeneous,
8818 EAPI void evas_object_box_layout_set (Evas_Object *o, Evas_Object_Box_Layout cb, const void *data, void (*free_data)(void *data)) EINA_ARG_NONNULL(1, 2);
8824 * Its layout function must be set via evas_object_box_layout_set()
8825 * (defaults to evas_object_box_layout_horizontal()). The other
8826 * properties of the box must be set/retrieved via
8827 * evas_object_box_{h,v}_{align,padding}_{get,set)().
8829 EAPI Evas_Object *evas_object_box_add (Evas *evas) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
8832 * Create a box that is child of a given element @a parent.
8834 * @see evas_object_box_add()
8836 EAPI Evas_Object *evas_object_box_add_to (Evas_Object *parent) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
8840 * Layout function which sets the box @a o to a (basic) horizontal
8841 * box. @a priv must be the smart data of the box.
8843 * The object's overall behavior is controlled by its properties,
8844 * which are set by the evas_object_box_{h,v}_{align,padding}_set()
8845 * family of functions. The properties of the elements in the box --
8846 * set by evas_object_size_hint_{align,padding,weight}_set() functions
8847 * -- also control the way this function works.
8849 * \par box's properties:
8850 * @c align_h controls the horizontal alignment of the child objects
8851 * relative to the containing box. When set to 0, children are aligned
8852 * to the left. A value of 1 lets them aligned to the right border.
8853 * Values in between align them proportionally. Note that if the size
8854 * required by the children, which is given by their widths and the @c
8855 * padding_h property of the box, is bigger than the container width,
8856 * the children will be displayed out of its bounds. A negative value
8857 * of @c align_h makes the box to *justify* its children. The padding
8858 * between them, in this case, is corrected so that the leftmost one
8859 * touches the left border and the rightmost one touches the right
8860 * border (even if they must overlap). The @c align_v and @c
8861 * padding_v properties of the box don't contribute to its behaviour
8862 * when this layout is chosen.
8864 * \par Child element's properties:
8865 * @c align_x does not influence the box's behavior. @c padding_l and
8866 * @c padding_r sum up to the container's horizontal padding between
8867 * elements. The child's @c padding_t, @c padding_b and @c align_y
8868 * properties apply for padding/positioning relative to the overall
8869 * height of the box. Finally, there is the @c weight_x property,
8870 * which, if set to a non-zero value, tells the container that the
8871 * child width is not pre-defined. If the container can't accommodate
8872 * all its children, it sets the widths of the children *with weights*
8873 * to sizes as small as they can all fit into it. If the size
8874 * required by the children is less than the available, the box
8875 * increases its children's (which have weights) widths as to fit the
8876 * remaining space. The @c weight_x property, besides telling the
8877 * element is resizable, gives a *weight* for the resizing process.
8878 * The parent box will try to distribute (or take off) widths
8879 * accordingly to the *normalized* list of weigths: most weighted
8880 * children remain/get larger in this process than the least ones.
8881 * @c weight_y does not influence the layout.
8883 * If one desires that, besides having weights, child elements must be
8884 * resized bounded to a minimum or maximum size, their size hint
8885 * properties must be set (by the
8886 * evas_object_size_hint_{min,max}_set() functions.
8888 EAPI void evas_object_box_layout_horizontal (Evas_Object *o, Evas_Object_Box_Data *priv, void *data) EINA_ARG_NONNULL(1, 2);
8891 * Layout function which sets the box @a o to a (basic) vertical box.
8892 * @a priv must be the smart data of the box.
8894 * This function behaves analogously to
8895 * evas_object_box_layout_horizontal(). The description of its
8896 * behaviour can be derived from that function's documentation.
8898 EAPI void evas_object_box_layout_vertical (Evas_Object *o, Evas_Object_Box_Data *priv, void *data) EINA_ARG_NONNULL(1, 2);
8901 * Layout function which sets the box @a o to a *homogeneous* vertical
8902 * box. @a priv must be the smart data of the box.
8904 * This function behaves analogously to
8905 * evas_object_box_layout_homogeneous_horizontal(). The description
8906 * of its behaviour can be derived from that function's documentation.
8908 EAPI void evas_object_box_layout_homogeneous_vertical (Evas_Object *o, Evas_Object_Box_Data *priv, void *data) EINA_ARG_NONNULL(1, 2);
8911 * Layout function which sets the box @a o to a *homogeneous*
8912 * horizontal box. @a priv must be the smart data of the box.
8914 * In a homogeneous horizontal box, its width is divided equally
8915 * between the contained objects. The box's overall behavior is
8916 * controlled by its properties, which are set by the
8917 * evas_object_box_{h,v}_{align,padding}_set() family of functions.
8918 * The properties of the elements in the box -- set by
8919 * evas_object_size_hint_{align,padding,weight}_set() functions --
8920 * also control the way this function works.
8922 * \par box's properties:
8923 * @c align_h has no influence on the box for this layout. @c
8924 * padding_h tells the box to draw empty spaces of that size, in
8925 * pixels, between the (still equal) child objects's cells. The @c
8926 * align_v and @c padding_v properties of the box don't contribute to
8927 * its behaviour when this layout is chosen.
8929 * \par Child element's properties:
8930 * @c padding_l and @c padding_r sum up to the required width of the
8931 * child element. The @c align_x property tells the relative position
8932 * of this overall child width in its allocated cell (0 to extreme
8933 * left, 1 to extreme right). A value of -1.0 to @c align_x makes the
8934 * box try to resize this child element to the exact width of its cell
8935 * (respecting the min and max hints on the child's width *and*
8936 * accounting its horizontal padding properties). The child's @c
8937 * padding_t, @c padding_b and @c align_y properties apply for
8938 * padding/positioning relative to the overall height of the box. A
8939 * value of -1.0 to @c align_y makes the box try to resize this child
8940 * element to the exact height of its parent (respecting the max hint
8941 * on the child's height).
8943 EAPI void evas_object_box_layout_homogeneous_horizontal (Evas_Object *o, Evas_Object_Box_Data *priv, void *data) EINA_ARG_NONNULL(1, 2);
8946 * Layout function which sets the box @a o to a *max size-homogeneous*
8947 * horizontal box. @a priv must be the smart data of the box.
8949 * In a max size-homogeneous horizontal box, the equal sized cells
8950 * reserved for the child objects have the width of the space required
8951 * by the largest child (in width). The box's overall behavior is
8952 * controlled by its properties, which are set by the
8953 * evas_object_box_{h,v}_{align,padding}_set() family of functions.
8954 * The properties of the elements in the box -- set by
8955 * evas_object_size_hint_{align,padding,weight}_set() functions --
8956 * also control the way this function works.
8958 * \par box's properties:
8959 * @c padding_h tells the box to draw empty spaces of that size, in
8960 * pixels, between the child objects's cells. @c align_h controls the
8961 * horizontal alignment of the child objects relative to the
8962 * containing box. When set to 0, children are aligned to the left. A
8963 * value of 1 lets them aligned to the right border. Values in
8964 * between align them proportionally. A negative value of @c align_h
8965 * makes the box to *justify* its children cells. The padding between
8966 * them, in this case, is corrected so that the leftmost one touches
8967 * the left border and the rightmost one touches the right border
8968 * (even if they must overlap). The @c align_v and @c padding_v
8969 * properties of the box don't contribute to its behaviour when this
8972 * \par Child element's properties:
8973 * @c padding_l and @c padding_r sum up to the required width of the
8974 * child element. The @c align_x property tells the relative position
8975 * of this overall child width in its allocated cell (0 to extreme
8976 * left, 1 to extreme right). A value of -1.0 to @c align_x makes the
8977 * box try to resize this child element to the exact width of its cell
8978 * (respecting the min and max hints on the child's width *and*
8979 * accounting its horizontal padding properties). The child's @c
8980 * padding_t, @c padding_b and @c align_y properties apply for
8981 * padding/positioning relative to the overall height of the box. A
8982 * value of -1.0 to @c align_y makes the box try to resize this child
8983 * element to the exact height of its parent (respecting the max hint
8984 * on the child's height).
8986 EAPI void evas_object_box_layout_homogeneous_max_size_horizontal(Evas_Object *o, Evas_Object_Box_Data *priv, void *data) EINA_ARG_NONNULL(1, 2);
8989 * Layout function which sets the box @a o to a *max size-homogeneous*
8990 * vertical box. @a priv must be the smart data of the box.
8992 * This function behaves analogously to
8993 * evas_object_box_layout_homogeneous_max_size_horizontal(). The
8994 * description of its behaviour can be derived from that function's
8997 EAPI void evas_object_box_layout_homogeneous_max_size_vertical (Evas_Object *o, Evas_Object_Box_Data *priv, void *data) EINA_ARG_NONNULL(1, 2);
9000 * Layout function which sets the box @a o to a *flow* horizontal box.
9001 * @a priv must be the smart data of the box.
9003 * In a flow horizontal box, the box's child elements are placed in
9004 * rows (think of text as an analogy). A row has as much elements as
9005 * can fit into the box's width. The box's overall behavior is
9006 * controlled by its properties, which are set by the
9007 * evas_object_box_{h,v}_{align,padding}_set() family of functions.
9008 * The properties of the elements in the box -- set by
9009 * evas_object_size_hint_{align,padding,weight}_set() functions --
9010 * also control the way this function works.
9012 * \par box's properties:
9013 * @c padding_h tells the box to draw empty spaces of that size, in
9014 * pixels, between the child objects's cells. @c align_h dictates the
9015 * horizontal alignment of the rows (0 to left align them, 1 to right
9016 * align). A value of -1.0 to @c align_h lets the rows *justified*
9017 * horizontally. @c align_v controls the vertical alignment of the
9018 * entire set of rows (0 to top, 1 to bottom). A value of -1.0 to @c
9019 * align_v makes the box to *justify* the rows vertically. The padding
9020 * between them, in this case, is corrected so that the first row
9021 * touches the top border and the last one touches the bottom border
9022 * (even if they must overlap). @c padding_v has no influence on the
9025 * \par Child element's properties:
9026 * @c padding_l and @c padding_r sum up to the required width of the
9027 * child element. The @c align_x property has no influence on the
9028 * layout. The child's @c padding_t and @c padding_b sum up to the
9029 * required height of the child element and is the only means (besides
9030 * row justifying) of setting space between rows. Note, however, that
9031 * @c align_y dictates positioning relative to the *largest height*
9032 * required by a child object in the actual row.
9034 EAPI void evas_object_box_layout_flow_horizontal (Evas_Object *o, Evas_Object_Box_Data *priv, void *data) EINA_ARG_NONNULL(1, 2);
9037 * Layout function which sets the box @a o to a *flow* vertical box.
9038 * @a priv must be the smart data of the box.
9040 * This function behaves analogously to
9041 * evas_object_box_layout_flow_horizontal(). The description of its
9042 * behaviour can be derived from that function's documentation.
9044 EAPI void evas_object_box_layout_flow_vertical (Evas_Object *o, Evas_Object_Box_Data *priv, void *data) EINA_ARG_NONNULL(1, 2);
9047 * Layout function which sets the box @a o to set all children to the
9048 * size of the object. @a priv must be the smart data of the box.
9050 * In a stack box, all children will be given the same size and they
9051 * will be stacked on above the other, so the first object will be the
9054 * \par box's properties:
9055 * No box option is used.
9057 * \par Child element's properties:
9058 * @c padding_l and @c padding_r sum up to the required width of the
9059 * child element. The @c align_x property tells the relative position
9060 * of this overall child width in its allocated cell (0 to extreme
9061 * left, 1 to extreme right). A value of -1.0 to @c align_x makes the
9062 * box try to resize this child element to the exact width of its cell
9063 * (respecting the min and max hints on the child's width *and*
9064 * accounting its horizontal padding properties). Same applies to
9067 EAPI void evas_object_box_layout_stack (Evas_Object *o, Evas_Object_Box_Data *priv, void *data) EINA_ARG_NONNULL(1, 2);
9071 * Set the alignment of the whole bounding box of contents.
9073 EAPI void evas_object_box_align_set (Evas_Object *o, double horizontal, double vertical) EINA_ARG_NONNULL(1);
9076 * Get alignment of the whole bounding box of contents.
9078 EAPI void evas_object_box_align_get (const Evas_Object *o, double *horizontal, double *vertical) EINA_ARG_NONNULL(1);
9081 * Set the space (padding) between cells.
9083 EAPI void evas_object_box_padding_set (Evas_Object *o, Evas_Coord horizontal, Evas_Coord vertical) EINA_ARG_NONNULL(1);
9086 * Get the (space) padding between cells.
9088 EAPI void evas_object_box_padding_get (const Evas_Object *o, Evas_Coord *horizontal, Evas_Coord *vertical) EINA_ARG_NONNULL(1);
9092 * Append a new object @a child to the box @a o. On error, @c NULL is
9095 EAPI Evas_Object_Box_Option *evas_object_box_append (Evas_Object *o, Evas_Object *child) EINA_ARG_NONNULL(1, 2);
9098 * Prepend a new object @a child to the box @a o. On error, @c NULL is
9101 EAPI Evas_Object_Box_Option *evas_object_box_prepend (Evas_Object *o, Evas_Object *child) EINA_ARG_NONNULL(1, 2);
9104 * Prepend a new object @a child to the box @c o relative to element @a
9105 * reference. If @a reference is not contained in the box or any other
9106 * error occurs, @c NULL is returned.
9108 EAPI Evas_Object_Box_Option *evas_object_box_insert_before (Evas_Object *o, Evas_Object *child, const Evas_Object *reference) EINA_ARG_NONNULL(1, 2, 3);
9111 * Append a new object @a child to the box @c o relative to element @a
9112 * reference. If @a reference is not contained in the box or any other
9113 * error occurs, @c NULL is returend.
9115 EAPI Evas_Object_Box_Option *evas_object_box_insert_after (Evas_Object *o, Evas_Object *child, const Evas_Object *referente) EINA_ARG_NONNULL(1, 2, 3);
9118 * Insert a new object @a child to the box @a o at position @a pos. On
9119 * error, @c NULL is returned.
9121 EAPI Evas_Object_Box_Option *evas_object_box_insert_at (Evas_Object *o, Evas_Object *child, unsigned int pos) EINA_ARG_NONNULL(1, 2);
9124 * Remove an object @a child from the box @a o. On error, @c 0 is
9127 EAPI Eina_Bool evas_object_box_remove (Evas_Object *o, Evas_Object *child) EINA_ARG_NONNULL(1, 2);
9130 * Remove an object from the box @a o which occupies position @a
9131 * pos. On error, @c 0 is returned.
9133 EAPI Eina_Bool evas_object_box_remove_at (Evas_Object *o, unsigned int pos) EINA_ARG_NONNULL(1);
9136 * Remove all child objects.
9137 * @return 0 on errors
9139 EAPI Eina_Bool evas_object_box_remove_all (Evas_Object *o, Eina_Bool clear) EINA_ARG_NONNULL(1);
9142 * Get an iterator to walk the list of children for the box.
9144 * @note Do not remove or delete objects while walking the list.
9146 EAPI Eina_Iterator *evas_object_box_iterator_new (const Evas_Object *o) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
9149 * Get an accessor to get random access to the list of children for the box.
9151 * @note Do not remove or delete objects while walking the list.
9153 EAPI Eina_Accessor *evas_object_box_accessor_new (const Evas_Object *o) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
9156 * Get the list of children for the box.
9158 * @note This is a duplicate of the list kept by the box internally.
9159 * It's up to the user to destroy it when it no longer needs it.
9160 * It's possible to remove objects from the box when walking this
9161 * list, but these removals won't be reflected on it.
9163 EAPI Eina_List *evas_object_box_children_get (const Evas_Object *o) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
9167 * Get the name of the property of the child elements of the box @a o
9168 * whose id is @a property. On error, @c NULL is returned.
9170 EAPI const char *evas_object_box_option_property_name_get (Evas_Object *o, int property) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
9173 * Get the id of the property of the child elements of the box @a o
9174 * whose name is @a name. On error, @c -1 is returned.
9176 EAPI int evas_object_box_option_property_id_get (Evas_Object *o, const char *name) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2) EINA_PURE;
9179 * Set the property (with id @a property) of the child element of the
9180 * box @a o whose property struct is @a opt. The property's values
9181 * must be the last arguments and their type *must* match that of the
9182 * property itself. On error, @c 0 is returned.
9184 EAPI Eina_Bool evas_object_box_option_property_set (Evas_Object *o, Evas_Object_Box_Option *opt, int property, ...) EINA_ARG_NONNULL(1, 2);
9187 * Set the property (with id @a property) of the child element of the
9188 * box @a o whose property struct is @a opt. The property's values
9189 * must be the args which the va_list @a args is initialized with and
9190 * their type *must* match that of the property itself. On error, @c 0
9193 EAPI Eina_Bool evas_object_box_option_property_vset (Evas_Object *o, Evas_Object_Box_Option *opt, int property, va_list args) EINA_ARG_NONNULL(1, 2);
9196 * Get the property (with id @a property) of the child element of the
9197 * box @a o whose property struct is @a opt. The last arguments must
9198 * be addresses of variables with the same type of that property. On
9199 * error, @c 0 is returned.
9201 EAPI Eina_Bool evas_object_box_option_property_get (Evas_Object *o, Evas_Object_Box_Option *opt, int property, ...) EINA_ARG_NONNULL(1, 2);
9204 * Get the property (with id @a property) of the child element of the
9205 * box @a o whose property struct is @a opt. The args which the
9206 * va_list @a args is initialized with must be addresses of variables
9207 * with the same type of that property. On error, @c 0 is returned.
9209 EAPI Eina_Bool evas_object_box_option_property_vget (Evas_Object *o, Evas_Object_Box_Option *opt, int property, va_list args) EINA_ARG_NONNULL(1, 2);
9212 * @defgroup Evas_Object_Table Table Smart Object.
9214 * Convenience smart object that packs children using a tabular
9215 * layout using children size hints to define their size and
9216 * alignment inside their cell space.
9218 * @see @ref Evas_Object_Group_Size_Hints
9220 * @ingroup Evas_Smart_Object_Group
9224 * Create a new table.
9226 * It's set to non-homogeneous by default, add children with
9227 * evas_object_table_pack().
9229 EAPI Evas_Object *evas_object_table_add (Evas *evas) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
9232 * Create a table that is child of a given element @a parent.
9234 * @see evas_object_table_add()
9236 EAPI Evas_Object *evas_object_table_add_to (Evas_Object *parent) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
9239 * Set how this table should layout children.
9241 * @todo consider aspect hint and respect it.
9243 * @par EVAS_OBJECT_TABLE_HOMOGENEOUS_NONE
9244 * If table does not use homogeneous mode then columns and rows will
9245 * be calculated based on hints of individual cells. This operation
9246 * mode is more flexible, but more complex and heavy to calculate as
9247 * well. @b Weight properties are handled as a boolean
9248 * expand. Negative alignment will be considered as 0.5.
9250 * @todo @c EVAS_OBJECT_TABLE_HOMOGENEOUS_NONE should balance weight.
9252 * @par EVAS_OBJECT_TABLE_HOMOGENEOUS_TABLE
9253 * When homogeneous is relative to table the own table size is divided
9254 * equally among children, filling the whole table area. That is, if
9255 * table has @c WIDTH and @c COLUMNS, each cell will get <tt>WIDTH /
9256 * COLUMNS</tt> pixels. If children have minimum size that is larger
9257 * than this amount (including padding), then it will overflow and be
9258 * aligned respecting the alignment hint, possible overlapping sibling
9259 * cells. @b Weight hint is used as a boolean, if greater than zero it
9260 * will make the child expand in that axis, taking as much space as
9261 * possible (bounded to maximum size hint). Negative alignment will be
9262 * considered as 0.5.
9264 * @par EVAS_OBJECT_TABLE_HOMOGENEOUS_ITEM
9265 * When homogeneous is relative to item it means the greatest minimum
9266 * cell size will be used. That is, if no element is set to expand,
9267 * the table will have its contents to a minimum size, the bounding
9268 * box of all these children will be aligned relatively to the table
9269 * object using evas_object_table_align_get(). If the table area is
9270 * too small to hold this minimum bounding box, then the objects will
9271 * keep their size and the bounding box will overflow the box area,
9272 * still respecting the alignment. @b Weight hint is used as a
9273 * boolean, if greater than zero it will make that cell expand in that
9274 * axis, toggling the <b>expand mode</b>, which makes the table behave
9275 * much like @b EVAS_OBJECT_TABLE_HOMOGENEOUS_TABLE, except that the
9276 * bounding box will overflow and items will not overlap siblings. If
9277 * no minimum size is provided at all then the table will fallback to
9278 * expand mode as well.
9280 EAPI void evas_object_table_homogeneous_set (Evas_Object *o, Evas_Object_Table_Homogeneous_Mode homogeneous) EINA_ARG_NONNULL(1);
9283 * Get the current layout homogeneous mode.
9285 * @see evas_object_table_homogeneous_set()
9287 EAPI Evas_Object_Table_Homogeneous_Mode evas_object_table_homogeneous_get (const Evas_Object *o) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
9290 * Set padding between cells.
9292 EAPI void evas_object_table_padding_set (Evas_Object *o, Evas_Coord horizontal, Evas_Coord vertical) EINA_ARG_NONNULL(1);
9295 * Get padding between cells.
9297 EAPI void evas_object_table_padding_get (const Evas_Object *o, Evas_Coord *horizontal, Evas_Coord *vertical) EINA_ARG_NONNULL(1);
9300 * Set the alignment of the whole bounding box of contents.
9302 EAPI void evas_object_table_align_set (Evas_Object *o, double horizontal, double vertical) EINA_ARG_NONNULL(1);
9305 * Get alignment of the whole bounding box of contents.
9307 EAPI void evas_object_table_align_get (const Evas_Object *o, double *horizontal, double *vertical) EINA_ARG_NONNULL(1);
9310 * Sets the mirrored mode of the table. In mirrored mode the table items go
9311 * from right to left instead of left to right. That is, 1,1 is top right, not
9314 * @param obj The table object.
9315 * @param mirrored the mirrored mode to set
9318 EAPI void evas_object_table_mirrored_set (Evas_Object *o, Eina_Bool mirrored) EINA_ARG_NONNULL(1);
9321 * Gets the mirrored mode of the table. In mirrored mode the table items go
9322 * from right to left instead of left to right. That is, 1,1 is top right, not
9325 * @param obj The table object.
9326 * @return EINA_TRUE if it's a mirrored table, EINA_FALSE otherwise.
9331 * Get a child from the table using its coordinates
9333 * @note This does not take into account col/row spanning
9335 EAPI Eina_Bool evas_object_table_mirrored_get (const Evas_Object *o) EINA_ARG_NONNULL(1);
9339 * Get packing location of a child of table
9341 * @param o The given table object.
9342 * @param child The child object to add.
9343 * @param col pointer to store relative-horizontal position to place child.
9344 * @param row pointer to store relative-vertical position to place child.
9345 * @param colspan pointer to store how many relative-horizontal position to use for this child.
9346 * @param rowspan pointer to store how many relative-vertical position to use for this child.
9348 * @return 1 on success, 0 on failure.
9351 EAPI Eina_Bool evas_object_table_pack_get(Evas_Object *o, Evas_Object *child, unsigned short *col, unsigned short *row, unsigned short *colspan, unsigned short *rowspan);
9354 * Add a new child to a table object or set its current packing.
9356 * @param o The given table object.
9357 * @param child The child object to add.
9358 * @param col relative-horizontal position to place child.
9359 * @param row relative-vertical position to place child.
9360 * @param colspan how many relative-horizontal position to use for this child.
9361 * @param rowspan how many relative-vertical position to use for this child.
9363 * @return 1 on success, 0 on failure.
9365 EAPI Eina_Bool evas_object_table_pack (Evas_Object *o, Evas_Object *child, unsigned short col, unsigned short row, unsigned short colspan, unsigned short rowspan) EINA_ARG_NONNULL(1, 2);
9368 * Remove child from table.
9370 * @note removing a child will immediately call a walk over children in order
9371 * to recalculate numbers of columns and rows. If you plan to remove
9372 * all children, use evas_object_table_clear() instead.
9374 * @return 1 on success, 0 on failure.
9376 EAPI Eina_Bool evas_object_table_unpack (Evas_Object *o, Evas_Object *child) EINA_ARG_NONNULL(1, 2);
9379 * Faster way to remove all child objects from a table object.
9381 * @param o The given table object.
9382 * @param clear if true, it will delete just removed children.
9384 EAPI void evas_object_table_clear (Evas_Object *o, Eina_Bool clear) EINA_ARG_NONNULL(1);
9388 * Get the number of columns and rows this table takes.
9390 * @note columns and rows are virtual entities, one can specify a table
9391 * with a single object that takes 4 columns and 5 rows. The only
9392 * difference for a single cell table is that paddings will be
9393 * accounted proportionally.
9395 EAPI void evas_object_table_col_row_size_get(const Evas_Object *o, int *cols, int *rows) EINA_ARG_NONNULL(1);
9398 * Get an iterator to walk the list of children for the table.
9400 * @note Do not remove or delete objects while walking the list.
9402 EAPI Eina_Iterator *evas_object_table_iterator_new (const Evas_Object *o) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
9405 * Get an accessor to get random access to the list of children for the table.
9407 * @note Do not remove or delete objects while walking the list.
9409 EAPI Eina_Accessor *evas_object_table_accessor_new (const Evas_Object *o) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
9412 * Get the list of children for the table.
9414 * @note This is a duplicate of the list kept by the table internally.
9415 * It's up to the user to destroy it when it no longer needs it.
9416 * It's possible to remove objects from the table when walking this
9417 * list, but these removals won't be reflected on it.
9419 EAPI Eina_List *evas_object_table_children_get (const Evas_Object *o) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
9420 EAPI Evas_Object *evas_object_table_child_get (const Evas_Object *o, unsigned short col, unsigned short row) EINA_ARG_NONNULL(1);
9423 * @defgroup Evas_Object_Grid Grid Smart Object.
9425 * Convenience smart object that packs children using a regular grid
9426 * layout using Their virtual grid location and size to determine
9427 * position inside the grid object
9429 * @ingroup Evas_Smart_Object_Group
9434 * Create a new grid.
9436 * It's set to a virtual size of 1x1 by default and add children with
9437 * evas_object_grid_pack().
9440 EAPI Evas_Object *evas_object_grid_add (Evas *evas) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
9443 * Create a grid that is child of a given element @a parent.
9445 * @see evas_object_grid_add()
9448 EAPI Evas_Object *evas_object_grid_add_to (Evas_Object *parent) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
9451 * Set the virtual resolution for the grid
9453 * @param o The grid object to modify
9454 * @param w The virtual horizontal size (resolution) in integer units
9455 * @param h The virtual vertical size (resolution) in integer units
9458 EAPI void evas_object_grid_size_set (Evas_Object *o, int w, int h) EINA_ARG_NONNULL(1);
9461 * Get the current virtual resolution
9463 * @param o The grid object to query
9464 * @param w A pointer to an integer to store the virtual width
9465 * @param h A pointer to an integer to store the virtual height
9466 * @see evas_object_grid_size_set()
9469 EAPI void evas_object_grid_size_get (const Evas_Object *o, int *w, int *h) EINA_ARG_NONNULL(1) EINA_PURE;
9472 * Sets the mirrored mode of the grid. In mirrored mode the grid items go
9473 * from right to left instead of left to right. That is, 0,0 is top right, not
9476 * @param obj The grid object.
9477 * @param mirrored the mirrored mode to set
9480 EAPI void evas_object_grid_mirrored_set (Evas_Object *o, Eina_Bool mirrored) EINA_ARG_NONNULL(1);
9483 * Gets the mirrored mode of the grid.
9485 * @param obj The grid object.
9486 * @return EINA_TRUE if it's a mirrored grid, EINA_FALSE otherwise.
9487 * @see evas_object_grid_mirrored_set()
9490 EAPI Eina_Bool evas_object_grid_mirrored_get (const Evas_Object *o) EINA_ARG_NONNULL(1);
9493 * Add a new child to a grid object.
9495 * @param o The given grid object.
9496 * @param child The child object to add.
9497 * @param x The virtual x coordinate of the child
9498 * @param y The virtual y coordinate of the child
9499 * @param w The virtual width of the child
9500 * @param h The virtual height of the child
9501 * @return 1 on success, 0 on failure.
9504 EAPI Eina_Bool evas_object_grid_pack (Evas_Object *o, Evas_Object *child, int x, int y, int w, int h) EINA_ARG_NONNULL(1, 2);
9507 * Remove child from grid.
9509 * @note removing a child will immediately call a walk over children in order
9510 * to recalculate numbers of columns and rows. If you plan to remove
9511 * all children, use evas_object_grid_clear() instead.
9513 * @return 1 on success, 0 on failure.
9516 EAPI Eina_Bool evas_object_grid_unpack (Evas_Object *o, Evas_Object *child) EINA_ARG_NONNULL(1, 2);
9519 * Faster way to remove all child objects from a grid object.
9521 * @param o The given grid object.
9522 * @param clear if true, it will delete just removed children.
9525 EAPI void evas_object_grid_clear (Evas_Object *o, Eina_Bool clear) EINA_ARG_NONNULL(1);
9528 * Get the pack options for a grid child
9530 * Get the pack x, y, width and height in virtual coordinates set by
9531 * evas_object_grid_pack()
9532 * @param o The grid object
9533 * @param child The grid child to query for coordinates
9534 * @param x The pointer to where the x coordinate will be returned
9535 * @param y The pointer to where the y coordinate will be returned
9536 * @param w The pointer to where the width will be returned
9537 * @param h The pointer to where the height will be returned
9538 * @return 1 on success, 0 on failure.
9541 EAPI Eina_Bool evas_object_grid_pack_get (Evas_Object *o, Evas_Object *child, int *x, int *y, int *w, int *h);
9544 * Get an iterator to walk the list of children for the grid.
9546 * @note Do not remove or delete objects while walking the list.
9549 EAPI Eina_Iterator *evas_object_grid_iterator_new (const Evas_Object *o) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
9552 * Get an accessor to get random access to the list of children for the grid.
9554 * @note Do not remove or delete objects while walking the list.
9557 EAPI Eina_Accessor *evas_object_grid_accessor_new (const Evas_Object *o) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
9560 * Get the list of children for the grid.
9562 * @note This is a duplicate of the list kept by the grid internally.
9563 * It's up to the user to destroy it when it no longer needs it.
9564 * It's possible to remove objects from the grid when walking this
9565 * list, but these removals won't be reflected on it.
9568 EAPI Eina_List *evas_object_grid_children_get (const Evas_Object *o) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
9571 * @defgroup Evas_Cserve Shared Image Cache Server
9573 * Provides client-server infrastructure to share bitmaps across
9574 * multiple processes, saving data and processing power.
9576 typedef struct _Evas_Cserve_Stats Evas_Cserve_Stats;
9577 typedef struct _Evas_Cserve_Image_Cache Evas_Cserve_Image_Cache;
9578 typedef struct _Evas_Cserve_Image Evas_Cserve_Image;
9579 typedef struct _Evas_Cserve_Config Evas_Cserve_Config;
9582 * Statistics about server that shares cached bitmaps.
9583 * @ingroup Evas_Cserve
9585 struct _Evas_Cserve_Stats
9587 int saved_memory; /**< current saved memory, in bytes */
9588 int wasted_memory; /**< current wasted memory, in bytes */
9589 int saved_memory_peak; /**< peak of saved memory, in bytes */
9590 int wasted_memory_peak; /**< peak of wasted memory, in bytes */
9591 double saved_time_image_header_load; /**< time, in seconds, saved in header loads by sharing cached loads instead */
9592 double saved_time_image_data_load; /**< time, in seconds, saved in data loads by sharing cached loads instead */
9596 * Cache of images shared by server.
9597 * @ingroup Evas_Cserve
9599 struct _Evas_Cserve_Image_Cache
9609 * An image shared by the server.
9610 * @ingroup Evas_Cserve
9612 struct _Evas_Cserve_Image
9614 const char *file, *key;
9616 time_t file_mod_time;
9617 time_t file_checked_time;
9621 int memory_footprint;
9622 double head_load_time;
9623 double data_load_time;
9624 Eina_Bool alpha : 1;
9625 Eina_Bool data_loaded : 1;
9626 Eina_Bool active : 1;
9628 Eina_Bool useless : 1;
9632 * Configuration that controls the server that shares cached bitmaps.
9633 * @ingroup Evas_Cserve
9635 struct _Evas_Cserve_Config
9637 int cache_max_usage;
9638 int cache_item_timeout;
9639 int cache_item_timeout_check;
9644 * Retrieves if the system wants to share bitmaps using the server.
9645 * @return @c EINA_TRUE if wants, @c EINA_FALSE otherwise.
9646 * @ingroup Evas_Cserve
9648 EAPI Eina_Bool evas_cserve_want_get (void) EINA_WARN_UNUSED_RESULT EINA_PURE;
9651 * Retrieves if the system is connected to the server used to shae bitmaps.
9652 * @return @c EINA_TRUE if connected, @c EINA_FALSE otherwise.
9653 * @ingroup Evas_Cserve
9655 EAPI Eina_Bool evas_cserve_connected_get (void) EINA_WARN_UNUSED_RESULT;
9658 * Retrieves if the system wants to share bitmaps using the server.
9659 * @param stats pointer to structure to fill with statistics about
9661 * @return @c EINA_TRUE if @p stats were filled with data,
9662 * @c EINA_FALSE otherwise and @p stats is untouched.
9663 * @ingroup Evas_Cserve
9665 EAPI Eina_Bool evas_cserve_stats_get (Evas_Cserve_Stats *stats) EINA_WARN_UNUSED_RESULT;
9666 EAPI void evas_cserve_image_cache_contents_clean (Evas_Cserve_Image_Cache *cache) EINA_PURE;
9669 * Retrieves the current configuration of the server.
9670 * @param config where to store current server configuration.
9671 * @return @c EINA_TRUE if @p config were filled with data,
9672 * @c EINA_FALSE otherwise and @p config is untouched.
9673 * @ingroup Evas_Cserve
9675 EAPI Eina_Bool evas_cserve_config_get (Evas_Cserve_Config *config) EINA_WARN_UNUSED_RESULT EINA_PURE;
9678 * Changes the configuration of the server.
9679 * @param config where to store current server configuration.
9680 * @return @c EINA_TRUE if @p config were successfully applied,
9681 * @c EINA_FALSE otherwise.
9682 * @ingroup Evas_Cserve
9684 EAPI Eina_Bool evas_cserve_config_set (const Evas_Cserve_Config *config) EINA_WARN_UNUSED_RESULT EINA_PURE;
9687 * Force system to disconnect from cache server.
9688 * @ingroup Evas_Cserve
9690 EAPI void evas_cserve_disconnect (void);
9693 * @defgroup Evas_Utils General Utilities
9695 * Some functions that are handy but are not specific of canvas or
9700 * Converts the given Evas image load error code into a string
9701 * describing it in english.
9703 * @param error the error code, a value in ::Evas_Load_Error.
9704 * @return Always returns a valid string. If the given @p error is not
9705 * supported, <code>"Unknown error"</code> is returned.
9707 * Mostly evas_object_image_file_set() would be the function setting
9708 * that error value afterwards, but also evas_object_image_load(),
9709 * evas_object_image_save(), evas_object_image_data_get(),
9710 * evas_object_image_data_convert(), evas_object_image_pixels_import()
9711 * and evas_object_image_is_inside(). This function is meant to be
9712 * used in conjunction with evas_object_image_load_error_get(), as in:
9715 * @dontinclude evas-load-error-str.c
9717 * @until ecore_main_loop_begin(
9719 * Here, being @c valid_path the path to a valid image and @c
9720 * bogus_path a path to a file which does not exist, the two outputs
9721 * of evas_load_error_str() would be (if no other errors occur):
9722 * <code>"No error on load"</code> and <code>"File (or file path) does
9723 * not exist"</code>, respectively. See the full @ref
9724 * Example_Evas_Images "example".
9726 * @ingroup Evas_Utils
9728 EAPI const char *evas_load_error_str (Evas_Load_Error error);
9730 /* Evas utility routines for color space conversions */
9731 /* hsv color space has h in the range 0.0 to 360.0, and s,v in the range 0.0 to 1.0 */
9732 /* rgb color space has r,g,b in the range 0 to 255 */
9735 * Convert a given color from HSV to RGB format.
9737 * @param h The Hue component of the color.
9738 * @param s The Saturation component of the color.
9739 * @param v The Value component of the color.
9740 * @param r The Red component of the color.
9741 * @param g The Green component of the color.
9742 * @param b The Blue component of the color.
9744 * This function converts a given color in HSV color format to RGB
9747 * @ingroup Evas_Utils
9749 EAPI void evas_color_hsv_to_rgb (float h, float s, float v, int *r, int *g, int *b);
9752 * Convert a given color from RGB to HSV format.
9754 * @param r The Red component of the color.
9755 * @param g The Green component of the color.
9756 * @param b The Blue component of the color.
9757 * @param h The Hue component of the color.
9758 * @param s The Saturation component of the color.
9759 * @param v The Value component of the color.
9761 * This function converts a given color in RGB color format to HSV
9764 * @ingroup Evas_Utils
9766 EAPI void evas_color_rgb_to_hsv (int r, int g, int b, float *h, float *s, float *v);
9768 /* argb color space has a,r,g,b in the range 0 to 255 */
9771 * Pre-multiplies a rgb triplet by an alpha factor.
9773 * @param a The alpha factor.
9774 * @param r The Red component of the color.
9775 * @param g The Green component of the color.
9776 * @param b The Blue component of the color.
9778 * This function pre-multiplies a given rbg triplet by an alpha
9779 * factor. Alpha factor is used to define transparency.
9781 * @ingroup Evas_Utils
9783 EAPI void evas_color_argb_premul (int a, int *r, int *g, int *b);
9786 * Undo pre-multiplication of a rgb triplet by an alpha factor.
9788 * @param a The alpha factor.
9789 * @param r The Red component of the color.
9790 * @param g The Green component of the color.
9791 * @param b The Blue component of the color.
9793 * This function undoes pre-multiplication a given rbg triplet by an
9794 * alpha factor. Alpha factor is used to define transparency.
9796 * @see evas_color_argb_premul().
9798 * @ingroup Evas_Utils
9800 EAPI void evas_color_argb_unpremul (int a, int *r, int *g, int *b);
9804 * Pre-multiplies data by an alpha factor.
9806 * @param data The data value.
9807 * @param len The length value.
9809 * This function pre-multiplies a given data by an alpha
9810 * factor. Alpha factor is used to define transparency.
9812 * @ingroup Evas_Utils
9814 EAPI void evas_data_argb_premul (unsigned int *data, unsigned int len);
9817 * Undo pre-multiplication data by an alpha factor.
9819 * @param data The data value.
9820 * @param len The length value.
9822 * This function undoes pre-multiplication of a given data by an alpha
9823 * factor. Alpha factor is used to define transparency.
9825 * @ingroup Evas_Utils
9827 EAPI void evas_data_argb_unpremul (unsigned int *data, unsigned int len);
9829 /* string and font handling */
9832 * Gets the next character in the string
9834 * Given the UTF-8 string in @p str, and starting byte position in @p pos,
9835 * this function will place in @p decoded the decoded code point at @p pos
9836 * and return the byte index for the next character in the string.
9838 * The only boundary check done is that @p pos must be >= 0. Other than that,
9839 * no checks are performed, so passing an index value that's not within the
9840 * length of the string will result in undefined behavior.
9842 * @param str The UTF-8 string
9843 * @param pos The byte index where to start
9844 * @param decoded Address where to store the decoded code point. Optional.
9846 * @return The byte index of the next character
9848 * @ingroup Evas_Utils
9850 EAPI int evas_string_char_next_get (const char *str, int pos, int *decoded) EINA_ARG_NONNULL(1);
9853 * Gets the previous character in the string
9855 * Given the UTF-8 string in @p str, and starting byte position in @p pos,
9856 * this function will place in @p decoded the decoded code point at @p pos
9857 * and return the byte index for the previous character in the string.
9859 * The only boundary check done is that @p pos must be >= 1. Other than that,
9860 * no checks are performed, so passing an index value that's not within the
9861 * length of the string will result in undefined behavior.
9863 * @param str The UTF-8 string
9864 * @param pos The byte index where to start
9865 * @param decoded Address where to store the decoded code point. Optional.
9867 * @return The byte index of the previous character
9869 * @ingroup Evas_Utils
9871 EAPI int evas_string_char_prev_get (const char *str, int pos, int *decoded) EINA_ARG_NONNULL(1);
9874 * Get the length in characters of the string.
9875 * @param str The string to get the length of.
9876 * @return The length in characters (not bytes)
9877 * @ingroup Evas_Utils
9879 EAPI int evas_string_char_len_get (const char *str) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
9882 * @defgroup Evas_Keys Key Input Functions
9884 * Functions which feed key events to the canvas.
9886 * As explained in @ref intro_not_evas, Evas is @b not aware of input
9887 * systems at all. Then, the user, if using it crudely (evas_new()),
9888 * will have to feed it with input events, so that it can react
9889 * somehow. If, however, the user creates a canvas by means of the
9890 * Ecore_Evas wrapper, it will automatically bind the chosen display
9891 * engine's input events to the canvas, for you.
9893 * This group presents the functions dealing with the feeding of key
9894 * events to the canvas. On most of them, one has to reference a given
9895 * key by a name (<code>keyname</code> argument). Those are
9896 * <b>platform dependent</b> symbolic names for the keys. Sometimes
9897 * you'll get the right <code>keyname</code> by simply using an ASCII
9898 * value of the key name, but it won't be like that always.
9900 * Typical platforms are Linux frame buffer (Ecore_FB) and X server
9901 * (Ecore_X) when using Evas with Ecore and Ecore_Evas. Please refer
9902 * to your display engine's documentation when using evas through an
9903 * Ecore helper wrapper when you need the <code>keyname</code>s.
9906 * @dontinclude evas-events.c
9907 * @skip mods = evas_key_modifier_get(evas);
9910 * All the other @c evas_key functions behave on the same manner. See
9911 * the full @ref Example_Evas_Events "example".
9913 * @ingroup Evas_Canvas
9917 * @addtogroup Evas_Keys
9922 * Returns a handle to the list of modifier keys registered in the
9923 * canvas @p e. This is required to check for which modifiers are set
9924 * at a given time with the evas_key_modifier_is_set() function.
9926 * @param e The pointer to the Evas canvas
9928 * @see evas_key_modifier_add
9929 * @see evas_key_modifier_del
9930 * @see evas_key_modifier_on
9931 * @see evas_key_modifier_off
9932 * @see evas_key_modifier_is_set
9934 * @return An ::Evas_Modifier handle to query Evas' keys subsystem
9935 * with evas_key_modifier_is_set(), or @c NULL on error.
9937 EAPI const Evas_Modifier *evas_key_modifier_get (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
9940 * Returns a handle to the list of lock keys registered in the canvas
9941 * @p e. This is required to check for which locks are set at a given
9942 * time with the evas_key_lock_is_set() function.
9944 * @param e The pointer to the Evas canvas
9946 * @see evas_key_lock_add
9947 * @see evas_key_lock_del
9948 * @see evas_key_lock_on
9949 * @see evas_key_lock_off
9950 * @see evas_key_lock_is_set
9952 * @return An ::Evas_Lock handle to query Evas' keys subsystem with
9953 * evas_key_lock_is_set(), or @c NULL on error.
9955 EAPI const Evas_Lock *evas_key_lock_get (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
9959 * Checks the state of a given modifier key, at the time of the
9960 * call. If the modifier is set, such as shift being pressed, this
9961 * function returns @c Eina_True.
9963 * @param m The current modifiers set, as returned by
9964 * evas_key_modifier_get().
9965 * @param keyname The name of the modifier key to check status for.
9967 * @return @c Eina_True if the modifier key named @p keyname is on, @c
9968 * Eina_False otherwise.
9970 * @see evas_key_modifier_add
9971 * @see evas_key_modifier_del
9972 * @see evas_key_modifier_get
9973 * @see evas_key_modifier_on
9974 * @see evas_key_modifier_off
9976 EAPI Eina_Bool evas_key_modifier_is_set (const Evas_Modifier *m, const char *keyname) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2) EINA_PURE;
9980 * Checks the state of a given lock key, at the time of the call. If
9981 * the lock is set, such as caps lock, this function returns @c
9984 * @param l The current locks set, as returned by evas_key_lock_get().
9985 * @param keyname The name of the lock key to check status for.
9987 * @return @c Eina_True if the @p keyname lock key is set, @c
9988 * Eina_False otherwise.
9990 * @see evas_key_lock_get
9991 * @see evas_key_lock_add
9992 * @see evas_key_lock_del
9993 * @see evas_key_lock_on
9994 * @see evas_key_lock_off
9996 EAPI Eina_Bool evas_key_lock_is_set (const Evas_Lock *l, const char *keyname) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2) EINA_PURE;
10000 * Adds the @p keyname key to the current list of modifier keys.
10002 * @param e The pointer to the Evas canvas
10003 * @param keyname The name of the modifier key to add to the list of
10006 * Modifiers are keys like shift, alt and ctrl, i.e., keys which are
10007 * meant to be pressed together with others, altering the behavior of
10008 * the secondly pressed keys somehow. Evas is so that these keys can
10011 * This call allows custom modifiers to be added to the Evas system at
10012 * run time. It is then possible to set and unset modifier keys
10013 * programmatically for other parts of the program to check and act
10014 * on. Programmers using Evas would check for modifier keys on key
10015 * event callbacks using evas_key_modifier_is_set().
10017 * @see evas_key_modifier_del
10018 * @see evas_key_modifier_get
10019 * @see evas_key_modifier_on
10020 * @see evas_key_modifier_off
10021 * @see evas_key_modifier_is_set
10023 * @note If the programmer instantiates the canvas by means of the
10024 * ecore_evas_new() family of helper functions, Ecore will take
10025 * care of registering on it all standard modifiers: "Shift",
10026 * "Control", "Alt", "Meta", "Hyper", "Super".
10028 EAPI void evas_key_modifier_add (Evas *e, const char *keyname) EINA_ARG_NONNULL(1, 2);
10031 * Removes the @p keyname key from the current list of modifier keys
10034 * @param e The pointer to the Evas canvas
10035 * @param keyname The name of the key to remove from the modifiers list.
10037 * @see evas_key_modifier_add
10038 * @see evas_key_modifier_get
10039 * @see evas_key_modifier_on
10040 * @see evas_key_modifier_off
10041 * @see evas_key_modifier_is_set
10043 EAPI void evas_key_modifier_del (Evas *e, const char *keyname) EINA_ARG_NONNULL(1, 2);
10046 * Adds the @p keyname key to the current list of lock keys.
10048 * @param e The pointer to the Evas canvas
10049 * @param keyname The name of the key to add to the locks list.
10051 * Locks are keys like caps lock, num lock or scroll lock, i.e., keys
10052 * which are meant to be pressed once -- toggling a binary state which
10053 * is bound to it -- and thus altering the behavior of all
10054 * subsequently pressed keys somehow, depending on its state. Evas is
10055 * so that these keys can be defined by the user.
10057 * This allows custom locks to be added to the evas system at run
10058 * time. It is then possible to set and unset lock keys
10059 * programmatically for other parts of the program to check and act
10060 * on. Programmers using Evas would check for lock keys on key event
10061 * callbacks using evas_key_lock_is_set().
10063 * @see evas_key_lock_get
10064 * @see evas_key_lock_del
10065 * @see evas_key_lock_on
10066 * @see evas_key_lock_off
10067 * @see evas_key_lock_is_set
10069 * @note If the programmer instantiates the canvas by means of the
10070 * ecore_evas_new() family of helper functions, Ecore will take
10071 * care of registering on it all standard lock keys: "Caps_Lock",
10072 * "Num_Lock", "Scroll_Lock".
10074 EAPI void evas_key_lock_add (Evas *e, const char *keyname) EINA_ARG_NONNULL(1, 2);
10077 * Removes the @p keyname key from the current list of lock keys on
10080 * @param e The pointer to the Evas canvas
10081 * @param keyname The name of the key to remove from the locks list.
10083 * @see evas_key_lock_get
10084 * @see evas_key_lock_add
10085 * @see evas_key_lock_on
10086 * @see evas_key_lock_off
10088 EAPI void evas_key_lock_del (Evas *e, const char *keyname) EINA_ARG_NONNULL(1, 2);
10092 * Enables or turns on programmatically the modifier key with name @p
10095 * @param e The pointer to the Evas canvas
10096 * @param keyname The name of the modifier to enable.
10098 * The effect will be as if the key was pressed for the whole time
10099 * between this call and a matching evas_key_modifier_off().
10101 * @see evas_key_modifier_add
10102 * @see evas_key_modifier_get
10103 * @see evas_key_modifier_off
10104 * @see evas_key_modifier_is_set
10106 EAPI void evas_key_modifier_on (Evas *e, const char *keyname) EINA_ARG_NONNULL(1, 2);
10109 * Disables or turns off programmatically the modifier key with name
10112 * @param e The pointer to the Evas canvas
10113 * @param keyname The name of the modifier to disable.
10115 * @see evas_key_modifier_add
10116 * @see evas_key_modifier_get
10117 * @see evas_key_modifier_on
10118 * @see evas_key_modifier_is_set
10120 EAPI void evas_key_modifier_off (Evas *e, const char *keyname) EINA_ARG_NONNULL(1, 2);
10123 * Enables or turns on programmatically the lock key with name @p
10126 * @param e The pointer to the Evas canvas
10127 * @param keyname The name of the lock to enable.
10129 * The effect will be as if the key was put on its active state after
10132 * @see evas_key_lock_get
10133 * @see evas_key_lock_add
10134 * @see evas_key_lock_del
10135 * @see evas_key_lock_off
10137 EAPI void evas_key_lock_on (Evas *e, const char *keyname) EINA_ARG_NONNULL(1, 2);
10140 * Disables or turns off programmatically the lock key with name @p
10143 * @param e The pointer to the Evas canvas
10144 * @param keyname The name of the lock to disable.
10146 * The effect will be as if the key was put on its inactive state
10149 * @see evas_key_lock_get
10150 * @see evas_key_lock_add
10151 * @see evas_key_lock_del
10152 * @see evas_key_lock_on
10154 EAPI void evas_key_lock_off (Evas *e, const char *keyname) EINA_ARG_NONNULL(1, 2);
10158 * Creates a bit mask from the @p keyname @b modifier key. Values
10159 * returned from different calls to it may be ORed together,
10162 * @param e The canvas whom to query the bit mask from.
10163 * @param keyname The name of the modifier key to create the mask for.
10165 * @returns the bit mask or 0 if the @p keyname key wasn't registered as a
10166 * modifier for canvas @p e.
10168 * This function is meant to be using in conjunction with
10169 * evas_object_key_grab()/evas_object_key_ungrab(). Go check their
10170 * documentation for more information.
10172 * @see evas_key_modifier_add
10173 * @see evas_key_modifier_get
10174 * @see evas_key_modifier_on
10175 * @see evas_key_modifier_off
10176 * @see evas_key_modifier_is_set
10177 * @see evas_object_key_grab
10178 * @see evas_object_key_ungrab
10180 EAPI Evas_Modifier_Mask evas_key_modifier_mask_get (const Evas *e, const char *keyname) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2) EINA_PURE;
10184 * Requests @p keyname key events be directed to @p obj.
10186 * @param obj the object to direct @p keyname events to.
10187 * @param keyname the key to request events for.
10188 * @param modifiers a mask of modifiers that must be present to
10189 * trigger the event.
10190 * @param not_modifiers a mask of modifiers that must @b not be present
10191 * to trigger the event.
10192 * @param exclusive request that the @p obj is the only object
10193 * receiving the @p keyname events.
10194 * @return @c EINA_TRUE, if the call succeeded, @c EINA_FALSE otherwise.
10196 * Key grabs allow one or more objects to receive key events for
10197 * specific key strokes even if other objects have focus. Whenever a
10198 * key is grabbed, only the objects grabbing it will get the events
10199 * for the given keys.
10201 * @p keyname is a platform dependent symbolic name for the key
10202 * pressed (see @ref Evas_Keys for more information).
10204 * @p modifiers and @p not_modifiers are bit masks of all the
10205 * modifiers that must and mustn't, respectively, be pressed along
10206 * with @p keyname key in order to trigger this new key
10207 * grab. Modifiers can be things such as Shift and Ctrl as well as
10208 * user defigned types via evas_key_modifier_add(). Retrieve them with
10209 * evas_key_modifier_mask_get() or use @c 0 for empty masks.
10211 * @p exclusive will make the given object the only one permitted to
10212 * grab the given key. If given @c EINA_TRUE, subsequent calls on this
10213 * function with different @p obj arguments will fail, unless the key
10214 * is ungrabbed again.
10216 * Example code follows.
10217 * @dontinclude evas-events.c
10218 * @skip if (d.focus)
10221 * See the full example @ref Example_Evas_Events "here".
10223 * @see evas_object_key_ungrab
10224 * @see evas_object_focus_set
10225 * @see evas_object_focus_get
10226 * @see evas_focus_get
10227 * @see evas_key_modifier_add
10229 EAPI Eina_Bool evas_object_key_grab (Evas_Object *obj, const char *keyname, Evas_Modifier_Mask modifiers, Evas_Modifier_Mask not_modifiers, Eina_Bool exclusive) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2);
10232 * Removes the grab on @p keyname key events by @p obj.
10234 * @param obj the object that has an existing key grab.
10235 * @param keyname the key the grab is set for.
10236 * @param modifiers a mask of modifiers that must be present to
10237 * trigger the event.
10238 * @param not_modifiers a mask of modifiers that must not not be
10239 * present to trigger the event.
10241 * Removes a key grab on @p obj if @p keyname, @p modifiers, and @p
10242 * not_modifiers match.
10244 * Example code follows.
10245 * @dontinclude evas-events.c
10246 * @skip got here by key grabs
10249 * See the full example @ref Example_Evas_Events "here".
10251 * @see evas_object_key_grab
10252 * @see evas_object_focus_set
10253 * @see evas_object_focus_get
10254 * @see evas_focus_get
10256 EAPI void evas_object_key_ungrab (Evas_Object *obj, const char *keyname, Evas_Modifier_Mask modifiers, Evas_Modifier_Mask not_modifiers) EINA_ARG_NONNULL(1, 2);